listBranches method
Gets information about one or more branches in a repository.
May throw RepositoryNameRequiredException. May throw RepositoryDoesNotExistException. May throw InvalidRepositoryNameException. May throw EncryptionIntegrityChecksFailedException. May throw EncryptionKeyAccessDeniedException. May throw EncryptionKeyDisabledException. May throw EncryptionKeyNotFoundException. May throw EncryptionKeyUnavailableException. May throw InvalidContinuationTokenException.
Parameter repositoryName
:
The name of the repository that contains the branches.
Parameter nextToken
:
An enumeration token that allows the operation to batch the results.
Implementation
Future<ListBranchesOutput> listBranches({
required String repositoryName,
String? nextToken,
}) async {
ArgumentError.checkNotNull(repositoryName, 'repositoryName');
_s.validateStringLength(
'repositoryName',
repositoryName,
1,
100,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CodeCommit_20150413.ListBranches'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'repositoryName': repositoryName,
if (nextToken != null) 'nextToken': nextToken,
},
);
return ListBranchesOutput.fromJson(jsonResponse.body);
}