listServers method

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

Lists the file transfer protocol-enabled servers that are associated with your AWS account.

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

Parameter maxResults : Specifies the number of servers to return as a response to the ListServers query.

Parameter nextToken : When additional results are obtained from the ListServers command, a NextToken parameter is returned in the output. You can then pass the NextToken parameter in a subsequent command to continue listing additional servers.

Implementation

Future<ListServersResponse> listServers({
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    6144,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'TransferService.ListServers'
  };
  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 ListServersResponse.fromJson(jsonResponse.body);
}