listRepositoriesForApprovalRuleTemplate method

Future<ListRepositoriesForApprovalRuleTemplateOutput> listRepositoriesForApprovalRuleTemplate({
  1. required String approvalRuleTemplateName,
  2. int? maxResults,
  3. String? nextToken,
})

Lists all repositories associated with the specified approval rule template.

May throw ApprovalRuleTemplateNameRequiredException. May throw InvalidApprovalRuleTemplateNameException. May throw ApprovalRuleTemplateDoesNotExistException. May throw InvalidMaxResultsException. May throw InvalidContinuationTokenException. May throw EncryptionIntegrityChecksFailedException. May throw EncryptionKeyAccessDeniedException. May throw EncryptionKeyDisabledException. May throw EncryptionKeyNotFoundException. May throw EncryptionKeyUnavailableException.

Parameter approvalRuleTemplateName : The name of the approval rule template for which you want to list repositories that are associated with that template.

Parameter maxResults : A non-zero, non-negative integer used to limit the number of returned results.

Parameter nextToken : An enumeration token that, when provided in a request, returns the next batch of the results.

Implementation

Future<ListRepositoriesForApprovalRuleTemplateOutput>
    listRepositoriesForApprovalRuleTemplate({
  required String approvalRuleTemplateName,
  int? maxResults,
  String? nextToken,
}) 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.ListRepositoriesForApprovalRuleTemplate'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'approvalRuleTemplateName': approvalRuleTemplateName,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListRepositoriesForApprovalRuleTemplateOutput.fromJson(
      jsonResponse.body);
}