listAccounts method

Future<ListAccountsResponse> listAccounts({
  1. int? maxResults,
  2. String? name,
  3. String? nextToken,
  4. String? userEmail,
})

Lists the Amazon Chime accounts under the administrator's AWS account. You can filter accounts by account name prefix. To find out which Amazon Chime account a user belongs to, you can filter by the user's email address, which returns one account result.

May throw UnauthorizedClientException. May throw NotFoundException. May throw ForbiddenException. May throw BadRequestException. May throw ThrottledClientException. May throw ServiceUnavailableException. May throw ServiceFailureException.

Parameter maxResults : The maximum number of results to return in a single call. Defaults to 100.

Parameter name : Amazon Chime account name prefix with which to filter results.

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

Parameter userEmail : User email address with which to filter results.

Implementation

Future<ListAccountsResponse> listAccounts({
  int? maxResults,
  String? name,
  String? nextToken,
  String? userEmail,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    200,
  );
  _s.validateStringLength(
    'name',
    name,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'max-results': [maxResults.toString()],
    if (name != null) 'name': [name],
    if (nextToken != null) 'next-token': [nextToken],
    if (userEmail != null) 'user-email': [userEmail],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/accounts',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListAccountsResponse.fromJson(response);
}