updatePullRequestApprovalState method

Future<void> updatePullRequestApprovalState({
  1. required ApprovalState approvalState,
  2. required String pullRequestId,
  3. required String revisionId,
})

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 PullRequestDoesNotExistException. May throw InvalidPullRequestIdException. May throw PullRequestIdRequiredException. May throw InvalidRevisionIdException. May throw RevisionIdRequiredException. May throw InvalidApprovalStateException. May throw ApprovalStateRequiredException. May throw PullRequestCannotBeApprovedByAuthorException. May throw RevisionNotCurrentException. May throw PullRequestAlreadyClosedException. May throw MaximumNumberOfApprovalsExceededException. May throw EncryptionIntegrityChecksFailedException. May throw EncryptionKeyAccessDeniedException. May throw EncryptionKeyDisabledException. May throw EncryptionKeyNotFoundException. May throw EncryptionKeyUnavailableException.

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 {
  ArgumentError.checkNotNull(approvalState, 'approvalState');
  ArgumentError.checkNotNull(pullRequestId, 'pullRequestId');
  ArgumentError.checkNotNull(revisionId, 'revisionId');
  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.toValue(),
      'pullRequestId': pullRequestId,
      'revisionId': revisionId,
    },
  );
}