listEnvironments method

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

Gets a list of AWS Cloud9 development environment identifiers.

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

Parameter maxResults : The maximum number of environments to get identifiers for.

Parameter nextToken : During a previous call, if there are more than 25 items in the list, only the first 25 items are returned, along with a unique string called a next token. To get the next batch of items in the list, call this operation again, adding the next token to the call. To get all of the items in the list, keep calling this operation with each subsequent next token that is returned, until no more next tokens are returned.

Implementation

Future<ListEnvironmentsResult> listEnvironments({
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    25,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSCloud9WorkspaceManagementService.ListEnvironments'
  };
  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 ListEnvironmentsResult.fromJson(jsonResponse.body);
}