listUsers method

Future<ListUsersResponse> listUsers({
  1. required String serverId,
  2. int? maxResults,
  3. String? nextToken,
})

Lists the users for a file transfer protocol-enabled server that you specify by passing the ServerId parameter.

May throw InternalServiceError. May throw InvalidNextTokenException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ServiceUnavailableException.

Parameter serverId : A system-assigned unique identifier for a server that has users assigned to it.

Parameter maxResults : Specifies the number of users to return as a response to the ListUsers request.

Parameter nextToken : If there are additional results from the ListUsers call, a NextToken parameter is returned in the output. You can then pass the NextToken to a subsequent ListUsers command, to continue listing additional users.

Implementation

Future<ListUsersResponse> listUsers({
  required String serverId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'TransferService.ListUsers'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ServerId': serverId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListUsersResponse.fromJson(jsonResponse.body);
}