listPullRequests method
Returns a list of pull requests for a specified repository. The return list can be refined by pull request status or pull request author ARN.
May throw AuthorDoesNotExistException.
May throw EncryptionIntegrityChecksFailedException.
May throw EncryptionKeyAccessDeniedException.
May throw EncryptionKeyDisabledException.
May throw EncryptionKeyNotFoundException.
May throw EncryptionKeyUnavailableException.
May throw InvalidAuthorArnException.
May throw InvalidContinuationTokenException.
May throw InvalidMaxResultsException.
May throw InvalidPullRequestStatusException.
May throw InvalidRepositoryNameException.
May throw RepositoryDoesNotExistException.
May throw RepositoryNameRequiredException.
Parameter repositoryName :
The name of the repository for which you want to list pull requests.
Parameter authorArn :
Optional. The Amazon Resource Name (ARN) of the user who created the pull
request. If used, this filters the results to pull requests created by
that user.
Parameter maxResults :
A non-zero, non-negative integer used to limit the number of returned
results.
Parameter nextToken :
An enumeration token that, when provided in a request, returns the next
batch of the results.
Parameter pullRequestStatus :
Optional. The status of the pull request. If used, this refines the
results to the pull requests that match the specified status.
Implementation
Future<ListPullRequestsOutput> listPullRequests({
required String repositoryName,
String? authorArn,
int? maxResults,
String? nextToken,
PullRequestStatusEnum? pullRequestStatus,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CodeCommit_20150413.ListPullRequests'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'repositoryName': repositoryName,
if (authorArn != null) 'authorArn': authorArn,
if (maxResults != null) 'maxResults': maxResults,
if (nextToken != null) 'nextToken': nextToken,
if (pullRequestStatus != null)
'pullRequestStatus': pullRequestStatus.value,
},
);
return ListPullRequestsOutput.fromJson(jsonResponse.body);
}