deletePullRequestApprovalRule method

Future<DeletePullRequestApprovalRuleOutput> deletePullRequestApprovalRule({
  1. required String approvalRuleName,
  2. required String pullRequestId,
})

Deletes an approval rule from a specified pull request. Approval rules can be deleted from a pull request only if the pull request is open, and if the approval rule was created specifically for a pull request and not generated from an approval rule template associated with the repository where the pull request was created. You cannot delete an approval rule from a merged or closed pull request.

May throw PullRequestDoesNotExistException. May throw InvalidPullRequestIdException. May throw PullRequestIdRequiredException. May throw PullRequestAlreadyClosedException. May throw ApprovalRuleNameRequiredException. May throw InvalidApprovalRuleNameException. May throw CannotDeleteApprovalRuleFromTemplateException. May throw EncryptionIntegrityChecksFailedException. May throw EncryptionKeyAccessDeniedException. May throw EncryptionKeyDisabledException. May throw EncryptionKeyNotFoundException. May throw EncryptionKeyUnavailableException.

Parameter approvalRuleName : The name of the approval rule you want to delete.

Parameter pullRequestId : The system-generated ID of the pull request that contains the approval rule you want to delete.

Implementation

Future<DeletePullRequestApprovalRuleOutput> deletePullRequestApprovalRule({
  required String approvalRuleName,
  required String pullRequestId,
}) async {
  ArgumentError.checkNotNull(approvalRuleName, 'approvalRuleName');
  _s.validateStringLength(
    'approvalRuleName',
    approvalRuleName,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(pullRequestId, 'pullRequestId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeCommit_20150413.DeletePullRequestApprovalRule'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'approvalRuleName': approvalRuleName,
      'pullRequestId': pullRequestId,
    },
  );

  return DeletePullRequestApprovalRuleOutput.fromJson(jsonResponse.body);
}