getApprovalRuleTemplate method

Future<GetApprovalRuleTemplateOutput> getApprovalRuleTemplate({
  1. required String approvalRuleTemplateName,
})

Returns information about a specified approval rule template.

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

Parameter approvalRuleTemplateName : The name of the approval rule template for which you want to get information.

Implementation

Future<GetApprovalRuleTemplateOutput> getApprovalRuleTemplate({
  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.GetApprovalRuleTemplate'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'approvalRuleTemplateName': approvalRuleTemplateName,
    },
  );

  return GetApprovalRuleTemplateOutput.fromJson(jsonResponse.body);
}