fetchFileBlame method
Fetches blame information for a file or line range in a file.
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/[^/]+$`.
firstLine - Optional. The 1-indexed starting line number of the range to
blame (inclusive). If not specified, blame begins at line 1.
lastLine - Optional. The 1-indexed ending line number of the range to
blame (inclusive). If not specified, blame extends to the end of the file.
path - Required. The file path within the repository.
ref - Required. The SCM commit SHA, or symbolic revision (for example,
branch name, tag) from which to fetch the blame.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a FetchGitRepositoryLinkFileBlameResponse.
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<FetchGitRepositoryLinkFileBlameResponse> fetchFileBlame(
core.String name, {
core.int? firstLine,
core.int? lastLine,
core.String? path,
core.String? ref,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'firstLine': ?firstLine == null ? null : ['${firstLine}'],
'lastLine': ?lastLine == null ? null : ['${lastLine}'],
'path': ?path == null ? null : [path],
'ref': ?ref == null ? null : [ref],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':fetchFileBlame';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return FetchGitRepositoryLinkFileBlameResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}