listRegions method

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

Retrieves a list of AWS regions supported by Amazon WorkSpaces Instances, enabling region discovery for workspace deployments.

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

Parameter maxResults : Maximum number of regions to return in a single API call. Enables pagination of region results.

Parameter nextToken : Pagination token for retrieving subsequent pages of region results.

Implementation

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