listJobTemplates method

Future<ListJobTemplatesResponse> listJobTemplates({
  1. String? category,
  2. JobTemplateListBy? listBy,
  3. int? maxResults,
  4. String? nextToken,
  5. Order? order,
})

Retrieve a JSON array of up to twenty of your job templates. This will return the templates themselves, not just a list of them. To retrieve the next twenty templates, use the nextToken string returned with the array

May throw BadRequestException. May throw InternalServerErrorException. May throw ForbiddenException. May throw NotFoundException. May throw TooManyRequestsException. May throw ConflictException.

Parameter category : Optionally, specify a job template category to limit responses to only job templates from that category.

Parameter listBy : Optional. When you request a list of job templates, you can choose to list them alphabetically by NAME or chronologically by CREATION_DATE. If you don't specify, the service will list them by name.

Parameter maxResults : Optional. Number of job templates, up to twenty, that will be returned at one time.

Parameter nextToken : Use this string, provided with the response to a previous request, to request the next batch of job templates.

Parameter order : Optional. When you request lists of resources, you can specify whether they are sorted in ASCENDING or DESCENDING order. Default varies by resource.

Implementation

Future<ListJobTemplatesResponse> listJobTemplates({
  String? category,
  JobTemplateListBy? listBy,
  int? maxResults,
  String? nextToken,
  Order? order,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    20,
  );
  final $query = <String, List<String>>{
    if (category != null) 'category': [category],
    if (listBy != null) 'listBy': [listBy.toValue()],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (order != null) 'order': [order.toValue()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/2017-08-29/jobTemplates',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListJobTemplatesResponse.fromJson(response);
}