fetchCommitList method

Future<FetchGitRepositoryLinkCommitListResponse> fetchCommitList(
  1. String name, {
  2. int? pageSize,
  3. String? pageToken,
  4. String? ref,
  5. String? view,
  6. String? $fields,
})

Fetch a list of Commits from a Git repository link.

Request parameters:

name - Required. The resource name of the GitRepositoryLink in the format `projects / * /locations / * /connections / * /gitRepositoryLinks /

  • . Value must have pattern ^projects/[^/]+/locations/[^/]+/connections/[^/]+/gitRepositoryLinks/[^/]+$`.

pageSize - Optional. Number of results to return in the list. Default is 50. Max is 100.

pageToken - Optional. A page token, received from a previous FetchGitRepositoryLinkCommitList call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to FetchGitRepositoryLinkCommitList must match the call that provided the page token.

ref - Optional. The commit SHA, or symbolic revision (for example, branch name, tag, or Git reference) from which to start listing commits.

view - Optional. The level of commit details to return in the response. Only BASIC is supported; FULL returns INVALID_ARGUMENT. Defaults to BASIC if unspecified. Use FetchGitRepositoryLinkCommit to get file diffs for a single commit. Possible string values are:

  • "COMMIT_VIEW_UNSPECIFIED" : Unspecified, defaults to BASIC.
  • "BASIC" : Basic view, returns commit metadata but no file diffs.
  • "FULL" : Full view, returns commit metadata and file diffs.

$fields - Selector specifying which fields to include in a partial response.

Completes with a FetchGitRepositoryLinkCommitListResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<FetchGitRepositoryLinkCommitListResponse> fetchCommitList(
  core.String name, {
  core.int? pageSize,
  core.String? pageToken,
  core.String? ref,
  core.String? view,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'pageSize': ?pageSize == null ? null : ['${pageSize}'],
    'pageToken': ?pageToken == null ? null : [pageToken],
    'ref': ?ref == null ? null : [ref],
    'view': ?view == null ? null : [view],
    'fields': ?$fields == null ? null : [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':fetchCommitList';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return FetchGitRepositoryLinkCommitListResponse.fromJson(
    response_ as core.Map<core.String, core.dynamic>,
  );
}