updateGatewayResponse method

Future<GatewayResponse> updateGatewayResponse({
  1. required GatewayResponseType responseType,
  2. required String restApiId,
  3. List<PatchOperation>? patchOperations,
})

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

May throw UnauthorizedException. May throw NotFoundException. May throw BadRequestException. 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.

Parameter patchOperations : A list of update operations to be applied to the specified resource and in the order specified in this list.

Implementation

Future<GatewayResponse> updateGatewayResponse({
  required GatewayResponseType responseType,
  required String restApiId,
  List<PatchOperation>? patchOperations,
}) async {
  ArgumentError.checkNotNull(responseType, 'responseType');
  ArgumentError.checkNotNull(restApiId, 'restApiId');
  final $payload = <String, dynamic>{
    if (patchOperations != null) 'patchOperations': patchOperations,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/restapis/${Uri.encodeComponent(restApiId)}/gatewayresponses/${Uri.encodeComponent(responseType.toValue())}',
    exceptionFnMap: _exceptionFns,
  );
  return GatewayResponse.fromJson(response);
}