deleteApprovalRuleTemplate method

Future<DeleteApprovalRuleTemplateOutput> deleteApprovalRuleTemplate({
  1. required String approvalRuleTemplateName,
})

Deletes a specified approval rule template. Deleting a template does not remove approval rules on pull requests already created with the template.

May throw ApprovalRuleTemplateNameRequiredException. May throw InvalidApprovalRuleTemplateNameException. May throw ApprovalRuleTemplateInUseException.

Parameter approvalRuleTemplateName : The name of the approval rule template to delete.

Implementation

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

  return DeleteApprovalRuleTemplateOutput.fromJson(jsonResponse.body);
}