listGateways method

Future<ListGatewaysOutput> listGateways({
  1. int? limit,
  2. String? marker,
})

Lists gateways owned by an AWS account in an AWS Region specified in the request. The returned list is ordered by gateway Amazon Resource Name (ARN).

By default, the operation returns a maximum of 100 gateways. This operation supports pagination that allows you to optionally reduce the number of gateways returned in a response.

If you have more gateways than are returned in a response (that is, the response returns only a truncated list of your gateways), the response contains a marker that you can specify in your next request to fetch the next page of gateways.

May throw InvalidGatewayRequestException. May throw InternalServerError.

Parameter limit : Specifies that the list of gateways returned be limited to the specified number of items.

Parameter marker : An opaque string that indicates the position at which to begin the returned list of gateways.

Implementation

Future<ListGatewaysOutput> listGateways({
  int? limit,
  String? marker,
}) async {
  _s.validateNumRange(
    'limit',
    limit,
    1,
    1152921504606846976,
  );
  _s.validateStringLength(
    'marker',
    marker,
    1,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StorageGateway_20130630.ListGateways'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (limit != null) 'Limit': limit,
      if (marker != null) 'Marker': marker,
    },
  );

  return ListGatewaysOutput.fromJson(jsonResponse.body);
}