updateApprovalRuleTemplateName method

Future<UpdateApprovalRuleTemplateNameOutput> updateApprovalRuleTemplateName({
  1. required String newApprovalRuleTemplateName,
  2. required String oldApprovalRuleTemplateName,
})

Updates the name of a specified approval rule template.

May throw InvalidApprovalRuleTemplateNameException. May throw ApprovalRuleTemplateNameRequiredException. May throw ApprovalRuleTemplateDoesNotExistException. May throw ApprovalRuleTemplateNameAlreadyExistsException.

Parameter newApprovalRuleTemplateName : The new name you want to apply to the approval rule template.

Parameter oldApprovalRuleTemplateName : The current name of the approval rule template.

Implementation

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

  return UpdateApprovalRuleTemplateNameOutput.fromJson(jsonResponse.body);
}