updateIntegration method

Future<Integration> updateIntegration({
  1. required String httpMethod,
  2. required String resourceId,
  3. required String restApiId,
  4. List<PatchOperation>? patchOperations,
})

Represents an update integration.

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

Parameter httpMethod : Required Represents an update integration request's HTTP method.

Parameter resourceId : Required Represents an update integration request's resource identifier.

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<Integration> updateIntegration({
  required String httpMethod,
  required String resourceId,
  required String restApiId,
  List<PatchOperation>? patchOperations,
}) async {
  ArgumentError.checkNotNull(httpMethod, 'httpMethod');
  ArgumentError.checkNotNull(resourceId, 'resourceId');
  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)}/resources/${Uri.encodeComponent(resourceId)}/methods/${Uri.encodeComponent(httpMethod)}/integration',
    exceptionFnMap: _exceptionFns,
  );
  return Integration.fromJson(response);
}