fetchGitRefs method
Fetch the list of branches or tags for a given repository.
Request parameters:
repository
- Required. The resource name of the repository in the format
projects / * /locations / * /connections / * /repositories / *
.
Value must have pattern
^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+/repositories/\[^/\]+$
.
pageSize
- Optional. Number of results to return in the list. Default to
100.
pageToken
- Optional. Page start.
refType
- 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 repository, {
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_ = 'v2/' + core.Uri.encodeFull('$repository') + ':fetchGitRefs';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return FetchGitRefsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}