listApprovalRuleTemplates method

Future<ListApprovalRuleTemplatesOutput> listApprovalRuleTemplates({
  1. int? maxResults,
  2. String? nextToken,
})

Lists all approval rule templates in the specified Amazon Web Services Region in your Amazon Web Services account. If an Amazon Web Services Region is not specified, the Amazon Web Services Region where you are signed in is used.

May throw InvalidContinuationTokenException. May throw InvalidMaxResultsException.

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<ListApprovalRuleTemplatesOutput> listApprovalRuleTemplates({
  int? maxResults,
  String? nextToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeCommit_20150413.ListApprovalRuleTemplates'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListApprovalRuleTemplatesOutput.fromJson(jsonResponse.body);
}