updatePullRequestStatus method

Future<UpdatePullRequestStatusOutput> updatePullRequestStatus({
  1. required String pullRequestId,
  2. required PullRequestStatusEnum pullRequestStatus,
})

Updates the status of a pull request.

May throw PullRequestDoesNotExistException. May throw InvalidPullRequestIdException. May throw PullRequestIdRequiredException. May throw InvalidPullRequestStatusUpdateException. May throw InvalidPullRequestStatusException. May throw PullRequestStatusRequiredException. May throw EncryptionIntegrityChecksFailedException. May throw EncryptionKeyAccessDeniedException. May throw EncryptionKeyDisabledException. May throw EncryptionKeyNotFoundException. May throw EncryptionKeyUnavailableException.

Parameter pullRequestId : The system-generated ID of the pull request. To get this ID, use ListPullRequests.

Parameter pullRequestStatus : The status of the pull request. The only valid operations are to update the status from OPEN to OPEN, OPEN to CLOSED or from CLOSED to CLOSED.

Implementation

Future<UpdatePullRequestStatusOutput> updatePullRequestStatus({
  required String pullRequestId,
  required PullRequestStatusEnum pullRequestStatus,
}) async {
  ArgumentError.checkNotNull(pullRequestId, 'pullRequestId');
  ArgumentError.checkNotNull(pullRequestStatus, 'pullRequestStatus');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeCommit_20150413.UpdatePullRequestStatus'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'pullRequestId': pullRequestId,
      'pullRequestStatus': pullRequestStatus.toValue(),
    },
  );

  return UpdatePullRequestStatusOutput.fromJson(jsonResponse.body);
}