listServiceTemplates method

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

List service templates with detail data.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter maxResults : The maximum number of service templates to list.

Parameter nextToken : A token that indicates the location of the next service template in the array of service templates, after the list of service templates previously requested.

Implementation

Future<ListServiceTemplatesOutput> listServiceTemplates({
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AwsProton20200720.ListServiceTemplates'
  };
  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 ListServiceTemplatesOutput.fromJson(jsonResponse.body);
}