fetchGitRefs method

Future<FetchGitRefsResponse> fetchGitRefs(
  1. String gitRepositoryLink, {
  2. int? pageSize,
  3. String? pageToken,
  4. String? refType,
  5. String? $fields,
})

Fetch the list of branches or tags for a given repository.

Request parameters:

gitRepositoryLink - Required. The resource name of 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 to 20.

pageToken - Optional. Page start.

refType - Required. Type of refs to fetch. Possible string values are:

  • "REF_TYPE_UNSPECIFIED" : No type specified.
  • "TAG" : To fetch tags.
  • "BRANCH" : To fetch branches.

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

Completes with a FetchGitRefsResponse.

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<FetchGitRefsResponse> fetchGitRefs(
  core.String gitRepositoryLink, {
  core.int? pageSize,
  core.String? pageToken,
  core.String? refType,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (refType != null) 'refType': [refType],
    if ($fields != null) 'fields': [$fields],
  };

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

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