listGateways method

Future<ListGatewaysResponse> listGateways({
  1. String? gatewayGroupArn,
  2. int? maxResults,
  3. String? nextToken,
})

Retrieves a list of gateway summaries. Use GetGateway to retrieve details of a specific gateway. An optional gateway group ARN can be provided to only retrieve gateway summaries of gateways that are associated with that gateway group ARN.

Parameter gatewayGroupArn : The gateway group ARN for which to list gateways.

Parameter maxResults : The maximum number of gateway summaries to return. The default is 50.

Parameter nextToken : The token used to paginate though multiple pages of gateway summaries.

Implementation

Future<ListGatewaysResponse> listGateways({
  String? gatewayGroupArn,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    1100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AlexaForBusiness.ListGateways'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (gatewayGroupArn != null) 'GatewayGroupArn': gatewayGroupArn,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListGatewaysResponse.fromJson(jsonResponse.body);
}