getGatewayResponse method

Future<GatewayResponse> getGatewayResponse({
  1. required GatewayResponseType responseType,
  2. required String restApiId,
})

Gets a GatewayResponse of a specified response type on the given RestApi.

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

Parameter responseType : Required The response type of the associated GatewayResponse. Valid values are

  • ACCESS_DENIED
  • API_CONFIGURATION_ERROR
  • AUTHORIZER_FAILURE
  • AUTHORIZER_CONFIGURATION_ERROR
  • BAD_REQUEST_PARAMETERS
  • BAD_REQUEST_BODY
  • DEFAULT_4XX
  • DEFAULT_5XX
  • EXPIRED_TOKEN
  • INVALID_SIGNATURE
  • INTEGRATION_FAILURE
  • INTEGRATION_TIMEOUT
  • INVALID_API_KEY
  • MISSING_AUTHENTICATION_TOKEN
  • QUOTA_EXCEEDED
  • REQUEST_TOO_LARGE
  • RESOURCE_NOT_FOUND
  • THROTTLED
  • UNAUTHORIZED
  • UNSUPPORTED_MEDIA_TYPE

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

Implementation

Future<GatewayResponse> getGatewayResponse({
  required GatewayResponseType responseType,
  required String restApiId,
}) async {
  ArgumentError.checkNotNull(responseType, 'responseType');
  ArgumentError.checkNotNull(restApiId, 'restApiId');
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/restapis/${Uri.encodeComponent(restApiId)}/gatewayresponses/${Uri.encodeComponent(responseType.toValue())}',
    exceptionFnMap: _exceptionFns,
  );
  return GatewayResponse.fromJson(response);
}