listPresets method

Future<ListPresetsResponse> listPresets({
  1. String? category,
  2. PresetListBy? listBy,
  3. int? maxResults,
  4. String? nextToken,
  5. Order? order,
})

Retrieve a JSON array of up to twenty of your presets. This will return the presets themselves, not just a list of them. To retrieve the next twenty presets, 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 preset category to limit responses to only presets from that category.

Parameter listBy : Optional. When you request a list of presets, 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 presets, 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 presets.

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<ListPresetsResponse> listPresets({
  String? category,
  PresetListBy? 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/presets',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListPresetsResponse.fromJson(response);
}