getGatewayResponses method

Future<GatewayResponses> getGatewayResponses({
  1. required String restApiId,
  2. int? limit,
  3. String? position,
})

Gets the GatewayResponses collection on the given RestApi. If an API developer has not added any definitions for gateway responses, the result will be the API Gateway-generated default GatewayResponses collection for the supported response types.

May throw BadRequestException. May throw UnauthorizedException. May throw NotFoundException. May throw TooManyRequestsException.

Parameter restApiId : Required The string identifier of the associated RestApi.

Parameter limit : The maximum number of returned results per page. The default value is 25 and the maximum value is 500. The GatewayResponses collection does not support pagination and the limit does not apply here.

Parameter position : The current pagination position in the paged result set. The GatewayResponse collection does not support pagination and the position does not apply here.

Implementation

Future<GatewayResponses> getGatewayResponses({
  required String restApiId,
  int? limit,
  String? position,
}) async {
  ArgumentError.checkNotNull(restApiId, 'restApiId');
  final $query = <String, List<String>>{
    if (limit != null) 'limit': [limit.toString()],
    if (position != null) 'position': [position],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/restapis/${Uri.encodeComponent(restApiId)}/gatewayresponses',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GatewayResponses.fromJson(response);
}