updateResource method

Future<Resource> updateResource({
  1. required String resourceId,
  2. required String restApiId,
  3. List<PatchOperation>? patchOperations,
})

Changes information about a Resource resource.

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

Parameter resourceId : Required The identifier of the Resource resource.

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<Resource> updateResource({
  required String resourceId,
  required String restApiId,
  List<PatchOperation>? patchOperations,
}) async {
  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)}',
    exceptionFnMap: _exceptionFns,
  );
  return Resource.fromJson(response);
}