listWorkspaces method

Future<ListWorkspacesResponse> listWorkspaces({
  1. String? alias,
  2. int? maxResults,
  3. String? nextToken,
})

Lists all of the Amazon Managed Service for Prometheus workspaces in your account. This includes workspaces being created or deleted.

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

Parameter alias : If this is included, it filters the results to only the workspaces with names that start with the value that you specify here.

Amazon Managed Service for Prometheus will automatically strip any blank spaces from the beginning and end of the alias that you specify.

Parameter maxResults : The maximum number of workspaces to return per request. The default is 100.

Parameter nextToken : The token for the next set of items to return. You receive this token from a previous call, and use it to get the next page of results. The other parameters must be the same as the initial call.

For example, if your initial request has maxResults of 10, and there are 12 workspaces to return, then your initial request will return 10 and a nextToken. Using the next token in a subsequent call will return the remaining 2 workspaces.

Implementation

Future<ListWorkspacesResponse> listWorkspaces({
  String? alias,
  int? maxResults,
  String? nextToken,
}) async {
  final $query = <String, List<String>>{
    if (alias != null) 'alias': [alias],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/workspaces',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListWorkspacesResponse.fromJson(response);
}