listDirectories method

Future<ListDirectoriesResponse> listDirectories({
  1. int? maxResults,
  2. String? nextToken,
  3. DirectoryState? state,
})

Lists directories created within an account.

May throw InternalServiceException. May throw InvalidArnException. May throw RetryableConflictException. May throw ValidationException. May throw LimitExceededException. May throw AccessDeniedException. May throw InvalidNextTokenException.

Parameter maxResults : The maximum number of results to retrieve.

Parameter nextToken : The pagination token.

Parameter state : The state of the directories in the list. Can be either Enabled, Disabled, or Deleted.

Implementation

Future<ListDirectoriesResponse> listDirectories({
  int? maxResults,
  String? nextToken,
  DirectoryState? state,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1152921504606846976,
  );
  final $payload = <String, dynamic>{
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
    if (state != null) 'state': state.toValue(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/amazonclouddirectory/2017-01-11/directory/list',
    exceptionFnMap: _exceptionFns,
  );
  return ListDirectoriesResponse.fromJson(response);
}