listThemes method

Future<ListThemesResponse> listThemes({
  1. required String appId,
  2. required String environmentName,
  3. int? maxResults,
  4. String? nextToken,
})

Retrieves a list of themes for a specified Amplify app and backend environment.

May throw InternalServerException. May throw InvalidParameterException.

Parameter appId : The unique ID for the Amplify app.

Parameter environmentName : The name of the backend environment that is a part of the Amplify app.

Parameter maxResults : The maximum number of theme results to return in the response.

Parameter nextToken : The token to request the next page of results.

Implementation

Future<ListThemesResponse> listThemes({
  required String appId,
  required String environmentName,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/app/${Uri.encodeComponent(appId)}/environment/${Uri.encodeComponent(environmentName)}/themes',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListThemesResponse.fromJson(response);
}