Update models

async AsyncCogniteClient.three_d.models.update(
item: ThreeDModel | ThreeDModelUpdate | Sequence[ThreeDModel | ThreeDModelUpdate],
mode: Literal['replace_ignore_null', 'patch', 'replace'] = 'replace_ignore_null',
) ThreeDModel | ThreeDModelList

Update 3d models.

Parameters:
  • item (ThreeDModel | ThreeDModelUpdate | Sequence[ThreeDModel | ThreeDModelUpdate]) – ThreeDModel(s) to update

  • mode (Literal['replace_ignore_null', 'patch', 'replace']) – How to update data when a non-update object is given (ThreeDModel or -Write). If you use ‘replace_ignore_null’, only the fields you have set will be used to replace existing (default). Using ‘replace’ will additionally clear all the fields that are not specified by you. Last option, ‘patch’, will update only the fields you have set and for container-like fields such as metadata or labels, add the values to the existing. For more details, see Update and Upsert Mode Parameter.

Returns:

Updated ThreeDModel(s)

Return type:

ThreeDModel | ThreeDModelList

Examples

Update 3d model that you have fetched. This will perform a full update of the model:

>>> from cognite.client import CogniteClient, AsyncCogniteClient
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> model = client.three_d.models.retrieve(id=1)
>>> model.name = "New Name"
>>> res = client.three_d.models.update(model)

Perform a partial update on a 3d model:

>>> from cognite.client.data_classes import ThreeDModelUpdate
>>> my_update = ThreeDModelUpdate(id=1).name.set("New Name")
>>> res = client.three_d.models.update(my_update)