updatePullRequestApprovalState method
Updates the state of a user's approval on a pull request. The user is derived from the signed-in account when the request is made.
May throw ApprovalStateRequiredException.
May throw EncryptionIntegrityChecksFailedException.
May throw EncryptionKeyAccessDeniedException.
May throw EncryptionKeyDisabledException.
May throw EncryptionKeyNotFoundException.
May throw EncryptionKeyUnavailableException.
May throw InvalidApprovalStateException.
May throw InvalidPullRequestIdException.
May throw InvalidRevisionIdException.
May throw MaximumNumberOfApprovalsExceededException.
May throw PullRequestAlreadyClosedException.
May throw PullRequestCannotBeApprovedByAuthorException.
May throw PullRequestDoesNotExistException.
May throw PullRequestIdRequiredException.
May throw RevisionIdRequiredException.
May throw RevisionNotCurrentException.
Parameter approvalState :
The approval state to associate with the user on the pull request.
Parameter pullRequestId :
The system-generated ID of the pull request.
Parameter revisionId :
The system-generated ID of the revision.
Implementation
Future<void> updatePullRequestApprovalState({
required ApprovalState approvalState,
required String pullRequestId,
required String revisionId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CodeCommit_20150413.UpdatePullRequestApprovalState'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'approvalState': approvalState.value,
'pullRequestId': pullRequestId,
'revisionId': revisionId,
},
);
}