From 91c82e6e0c65c7a88cbca6a92fa1588ee5667114 Mon Sep 17 00:00:00 2001 From: Anders Albert <60234212+doctrino@users.noreply.github.com> Date: Thu, 25 Jul 2024 16:27:08 +0200 Subject: [PATCH] Updated core model to version with required keywords and docstrings (#1864) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: HÃ¥kon V. Treider --- CHANGELOG.md | 5 + cognite/client/_version.py | 2 +- cognite/client/data_classes/cdm/__init__.py | 4 + cognite/client/data_classes/cdm/v1.py | 4234 ++++++++++++++----- pyproject.toml | 2 +- scripts/generate_core_model.py | 26 + 6 files changed, 3130 insertions(+), 1143 deletions(-) create mode 100644 scripts/generate_core_model.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cefb5f43..dc5b466b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,11 @@ Changes are grouped as follows - `Fixed` for any bug fixes. - `Security` in case of vulnerabilities. +## [7.54.9] - 2024-07-22 +### Changed +- [Feature Preview] Updated the Core Model to require keyword arguments for all classes and include + docstring. + ## [7.54.8] - 2024-07-22 ### Added - The method `client.functions.schedules.retrieve` now accepts the missing parameter `ignore_unknown_ids` as well diff --git a/cognite/client/_version.py b/cognite/client/_version.py index dc766201c..3181a60bc 100644 --- a/cognite/client/_version.py +++ b/cognite/client/_version.py @@ -1,4 +1,4 @@ from __future__ import annotations -__version__ = "7.54.8" +__version__ = "7.54.9" __api_subversion__ = "20230101" diff --git a/cognite/client/data_classes/cdm/__init__.py b/cognite/client/data_classes/cdm/__init__.py index 9d48db4f9..810d769a1 100644 --- a/cognite/client/data_classes/cdm/__init__.py +++ b/cognite/client/data_classes/cdm/__init__.py @@ -1 +1,5 @@ from __future__ import annotations + +from cognite.client.utils._experimental import FeaturePreviewWarning + +FeaturePreviewWarning("alpha", "alpha", "Core Data Model").warn() diff --git a/cognite/client/data_classes/cdm/v1.py b/cognite/client/data_classes/cdm/v1.py index b252eb4fe..0b2ad5dfc 100644 --- a/cognite/client/data_classes/cdm/v1.py +++ b/cognite/client/data_classes/cdm/v1.py @@ -12,103 +12,38 @@ TypedNode, TypedNodeApply, ) -from cognite.client.utils._experimental import FeaturePreviewWarning -FeaturePreviewWarning("alpha", "alpha", "Core Data Model").warn() - - -class CogniteSourceableProperties: - source_id = PropertyOptions("sourceId") - source_context = PropertyOptions("sourceContext") - source_created_time = PropertyOptions("sourceCreatedTime") - source_updated_time = PropertyOptions("sourceUpdatedTime") - source_created_user = PropertyOptions("sourceCreatedUser") - source_updated_user = PropertyOptions("sourceUpdatedUser") +class CogniteDescribableProperties: @classmethod def get_source(cls) -> ViewId: - return ViewId("cdf_cdm_experimental", "CogniteSourceable", "v1") - - -class CogniteSourceableNodeApply(CogniteSourceableProperties, TypedNodeApply): - def __init__( - self, - space: str, - external_id: str, - source_id: str | None = None, - source_context: str | None = None, - source: DirectRelationReference | tuple[str, str] | None = None, - source_created_time: datetime | None = None, - source_updated_time: datetime | None = None, - source_created_user: str | None = None, - source_updated_user: str | None = None, - existing_version: int | None = None, - type: DirectRelationReference | tuple[str, str] | None = None, - ) -> None: - TypedNodeApply.__init__(self, space, external_id, existing_version, None, type) - self.source_id = source_id - self.source_context = source_context - self.source = DirectRelationReference.load(source) if source else None - self.source_created_time = source_created_time - self.source_updated_time = source_updated_time - self.source_created_user = source_created_user - self.source_updated_user = source_updated_user + return ViewId("cdf_cdm_experimental", "CogniteDescribable", "v1") -class CogniteSourceableNode(CogniteSourceableProperties, TypedNode): - def __init__( - self, - space: str, - external_id: str, - version: int, - last_updated_time: int, - created_time: int, - source_id: str | None = None, - source_context: str | None = None, - source: DirectRelationReference | None = None, - source_created_time: datetime | None = None, - source_updated_time: datetime | None = None, - source_created_user: str | None = None, - source_updated_user: str | None = None, - type: DirectRelationReference | None = None, - deleted_time: int | None = None, - ) -> None: - TypedNode.__init__(self, space, external_id, version, last_updated_time, created_time, deleted_time, None, type) - self.source_id = source_id - self.source_context = source_context - self.source = DirectRelationReference.load(source) if source else None - self.source_created_time = source_created_time - self.source_updated_time = source_updated_time - self.source_created_user = source_created_user - self.source_updated_user = source_updated_user +class CogniteDescribableNodeApply(CogniteDescribableProperties, TypedNodeApply): + """This represents the writing format of Cognite describable node. - def as_write(self) -> CogniteSourceableNodeApply: - return CogniteSourceableNodeApply( - self.space, - self.external_id, - self.source_id, - self.source_context, - self.source, - self.source_created_time, - self.source_updated_time, - self.source_created_user, - self.source_updated_user, - self.version, - self.type, - ) + It is used to when data is written to CDF. + The describable core concept is used as a standard way of holding the bare minimum of information about the instance -class CogniteDescribableProperties: - @classmethod - def get_source(cls) -> ViewId: - return ViewId("cdf_cdm_experimental", "CogniteDescribable", "v1") + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite describable node. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ -class CogniteDescribableNodeApply(CogniteDescribableProperties, TypedNodeApply): def __init__( self, space: str, external_id: str, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -124,6 +59,27 @@ def __init__( class CogniteDescribableNode(CogniteDescribableProperties, TypedNode): + """This represents the reading format of Cognite describable node. + + It is used to when data is read from CDF. + + The describable core concept is used as a standard way of holding the bare minimum of information about the instance + + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite describable node. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -131,6 +87,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -148,12 +105,12 @@ def as_write(self) -> CogniteDescribableNodeApply: return CogniteDescribableNodeApply( self.space, self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.version, - self.type, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + existing_version=self.version, + type=self.type, ) @@ -169,10 +126,28 @@ def get_source(cls) -> ViewId: class CogniteSchedulableApply(CogniteSchedulableProperties, TypedNodeApply): + """This represents the writing format of Cognite schedulable. + + It is used to when data is written to CDF. + + CogniteSchedulable represents the metadata about when an activity (or similar) starts and ends. + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite schedulable. + start_time (datetime | None): The actual start time of an activity (or similar that extends this) + end_time (datetime | None): The actual end time of an activity (or similar that extends this) + scheduled_start_time (datetime | None): The planned start time of an activity (or similar that extends this) + scheduled_end_time (datetime | None): The planned end time of an activity (or similar that extends this) + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, start_time: datetime | None = None, end_time: datetime | None = None, scheduled_start_time: datetime | None = None, @@ -188,6 +163,26 @@ def __init__( class CogniteSchedulable(CogniteSchedulableProperties, TypedNode): + """This represents the reading format of Cognite schedulable. + + It is used to when data is read from CDF. + + CogniteSchedulable represents the metadata about when an activity (or similar) starts and ends. + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite schedulable. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + start_time (datetime | None): The actual start time of an activity (or similar that extends this) + end_time (datetime | None): The actual end time of an activity (or similar that extends this) + scheduled_start_time (datetime | None): The planned start time of an activity (or similar that extends this) + scheduled_end_time (datetime | None): The planned end time of an activity (or similar that extends this) + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -195,6 +190,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, start_time: datetime | None = None, end_time: datetime | None = None, scheduled_start_time: datetime | None = None, @@ -212,17 +208,138 @@ def as_write(self) -> CogniteSchedulableApply: return CogniteSchedulableApply( self.space, self.external_id, - self.start_time, - self.end_time, - self.scheduled_start_time, - self.scheduled_end_time, - self.version, - self.type, + start_time=self.start_time, + end_time=self.end_time, + scheduled_start_time=self.scheduled_start_time, + scheduled_end_time=self.scheduled_end_time, + existing_version=self.version, + type=self.type, + ) + + +class CogniteSourceableProperties: + source_id = PropertyOptions("sourceId") + source_context = PropertyOptions("sourceContext") + source_created_time = PropertyOptions("sourceCreatedTime") + source_updated_time = PropertyOptions("sourceUpdatedTime") + source_created_user = PropertyOptions("sourceCreatedUser") + source_updated_user = PropertyOptions("sourceUpdatedUser") + + @classmethod + def get_source(cls) -> ViewId: + return ViewId("cdf_cdm_experimental", "CogniteSourceable", "v1") + + +class CogniteSourceableNodeApply(CogniteSourceableProperties, TypedNodeApply): + """This represents the writing format of Cognite sourceable node. + + It is used to when data is written to CDF. + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite sourceable node. + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | tuple[str, str] | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + + def __init__( + self, + space: str, + external_id: str, + *, + source_id: str | None = None, + source_context: str | None = None, + source: DirectRelationReference | tuple[str, str] | None = None, + source_created_time: datetime | None = None, + source_updated_time: datetime | None = None, + source_created_user: str | None = None, + source_updated_user: str | None = None, + existing_version: int | None = None, + type: DirectRelationReference | tuple[str, str] | None = None, + ) -> None: + TypedNodeApply.__init__(self, space, external_id, existing_version, None, type) + self.source_id = source_id + self.source_context = source_context + self.source = DirectRelationReference.load(source) if source else None + self.source_created_time = source_created_time + self.source_updated_time = source_updated_time + self.source_created_user = source_created_user + self.source_updated_user = source_updated_user + + +class CogniteSourceableNode(CogniteSourceableProperties, TypedNode): + """This represents the reading format of Cognite sourceable node. + + It is used to when data is read from CDF. + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite sourceable node. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + + def __init__( + self, + space: str, + external_id: str, + version: int, + last_updated_time: int, + created_time: int, + *, + source_id: str | None = None, + source_context: str | None = None, + source: DirectRelationReference | None = None, + source_created_time: datetime | None = None, + source_updated_time: datetime | None = None, + source_created_user: str | None = None, + source_updated_user: str | None = None, + type: DirectRelationReference | None = None, + deleted_time: int | None = None, + ) -> None: + TypedNode.__init__(self, space, external_id, version, last_updated_time, created_time, deleted_time, None, type) + self.source_id = source_id + self.source_context = source_context + self.source = DirectRelationReference.load(source) if source else None + self.source_created_time = source_created_time + self.source_updated_time = source_updated_time + self.source_created_user = source_created_user + self.source_updated_user = source_updated_user + + def as_write(self) -> CogniteSourceableNodeApply: + return CogniteSourceableNodeApply( + self.space, + self.external_id, + source_id=self.source_id, + source_context=self.source_context, + source=self.source, + source_created_time=self.source_created_time, + source_updated_time=self.source_updated_time, + source_created_user=self.source_created_user, + source_updated_user=self.source_updated_user, + existing_version=self.version, + type=self.type, ) class CogniteVisualizableProperties: - object_3_d = PropertyOptions("object3D") + object_3d = PropertyOptions("object3D") @classmethod def get_source(cls) -> ViewId: @@ -230,19 +347,51 @@ def get_source(cls) -> ViewId: class CogniteVisualizableApply(CogniteVisualizableProperties, TypedNodeApply): + """This represents the writing format of Cognite visualizable. + + It is used to when data is written to CDF. + + CogniteVisualizable defines the standard way to reference a related 3D resource + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite visualizable. + object_3d (DirectRelationReference | tuple[str, str] | None): Direct relation to an Object3D instance representing the 3D resource + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, - object_3_d: DirectRelationReference | tuple[str, str] | None = None, + *, + object_3d: DirectRelationReference | tuple[str, str] | None = None, existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: TypedNodeApply.__init__(self, space, external_id, existing_version, None, type) - self.object_3_d = DirectRelationReference.load(object_3_d) if object_3_d else None + self.object_3d = DirectRelationReference.load(object_3d) if object_3d else None class CogniteVisualizable(CogniteVisualizableProperties, TypedNode): + """This represents the reading format of Cognite visualizable. + + It is used to when data is read from CDF. + + CogniteVisualizable defines the standard way to reference a related 3D resource + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite visualizable. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + object_3d (DirectRelationReference | None): Direct relation to an Object3D instance representing the 3D resource + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -250,26 +399,27 @@ def __init__( version: int, last_updated_time: int, created_time: int, - object_3_d: DirectRelationReference | None = None, + *, + object_3d: DirectRelationReference | None = None, type: DirectRelationReference | None = None, deleted_time: int | None = None, ) -> None: TypedNode.__init__(self, space, external_id, version, last_updated_time, created_time, deleted_time, None, type) - self.object_3_d = DirectRelationReference.load(object_3_d) if object_3_d else None + self.object_3d = DirectRelationReference.load(object_3d) if object_3d else None def as_write(self) -> CogniteVisualizableApply: return CogniteVisualizableApply( self.space, self.external_id, - self.object_3_d, - self.version, - self.type, + object_3d=self.object_3d, + existing_version=self.version, + type=self.type, ) class CogniteRevision3DProperties: type_ = PropertyOptions("type") - model_3_d = PropertyOptions("model3D") + model_3d = PropertyOptions("model3D") @classmethod def get_source(cls) -> ViewId: @@ -277,14 +427,33 @@ def get_source(cls) -> ViewId: class CogniteRevision3DApply(CogniteRevision3DProperties, TypedNodeApply): + """This represents the writing format of Cognite revision 3D. + + It is used to when data is written to CDF. + + Shared revision information for various 3D data types. Normally not used directly, but through CognitePointCloudRevision, Image360Collection or CogniteCADRevision + + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite revision 3D. + status (Literal["Done", "Failed", "Processing", "Queued"] | None): The status field. + published (Literal["Done", "Failed", "Processing", "Queued"] | None): The published field. + type_ (Literal["CAD", "Image360", "PointCloud"] | None): The type field. + model_3d (DirectRelationReference | tuple[str, str] | None): The model 3D field. + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, status: Literal["Done", "Failed", "Processing", "Queued"] | None = None, published: Literal["Done", "Failed", "Processing", "Queued"] | None = None, type_: Literal["CAD", "Image360", "PointCloud"] | None = None, - model_3_d: DirectRelationReference | tuple[str, str] | None = None, + model_3d: DirectRelationReference | tuple[str, str] | None = None, existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: @@ -292,10 +461,31 @@ def __init__( self.status = status self.published = published self.type_ = type_ - self.model_3_d = DirectRelationReference.load(model_3_d) if model_3_d else None + self.model_3d = DirectRelationReference.load(model_3d) if model_3d else None class CogniteRevision3D(CogniteRevision3DProperties, TypedNode): + """This represents the reading format of Cognite revision 3D. + + It is used to when data is read from CDF. + + Shared revision information for various 3D data types. Normally not used directly, but through CognitePointCloudRevision, Image360Collection or CogniteCADRevision + + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite revision 3D. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + status (Literal["Done", "Failed", "Processing", "Queued"] | None): The status field. + published (Literal["Done", "Failed", "Processing", "Queued"] | None): The published field. + type_ (Literal["CAD", "Image360", "PointCloud"] | None): The type field. + model_3d (DirectRelationReference | None): The model 3D field. + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -303,10 +493,11 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, status: Literal["Done", "Failed", "Processing", "Queued"] | None = None, published: Literal["Done", "Failed", "Processing", "Queued"] | None = None, type_: Literal["CAD", "Image360", "PointCloud"] | None = None, - model_3_d: DirectRelationReference | None = None, + model_3d: DirectRelationReference | None = None, type: DirectRelationReference | None = None, deleted_time: int | None = None, ) -> None: @@ -314,18 +505,18 @@ def __init__( self.status = status self.published = published self.type_ = type_ - self.model_3_d = DirectRelationReference.load(model_3_d) if model_3_d else None + self.model_3d = DirectRelationReference.load(model_3d) if model_3d else None def as_write(self) -> CogniteRevision3DApply: return CogniteRevision3DApply( self.space, self.external_id, - self.status, - self.published, - self.type_, - self.model_3_d, - self.version, - self.type, + status=self.status, + published=self.published, + type_=self.type_, + model_3d=self.model_3d, + existing_version=self.version, + type=self.type, ) @@ -336,10 +527,31 @@ def get_source(cls) -> ViewId: class CogniteCubeMapApply(CogniteCubeMapProperties, TypedNodeApply): + """This represents the writing format of Cognite cube map. + + It is used to when data is written to CDF. + + The cube map holds references to projections for a cube surrounding an 3D entity extending this, such as CogniteImage360 + + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite cube map. + front (DirectRelationReference | tuple[str, str] | None): Direct relation to a file holding the front projection of the cube map + back (DirectRelationReference | tuple[str, str] | None): Direct relation to a file holding the back projection of the cube map + left (DirectRelationReference | tuple[str, str] | None): Direct relation to a file holding the left projection of the cube map + right (DirectRelationReference | tuple[str, str] | None): Direct relation to a file holding the right projection of the cube map + top (DirectRelationReference | tuple[str, str] | None): Direct relation to a file holding the top projection of the cube map + bottom (DirectRelationReference | tuple[str, str] | None): Direct relation to a file holding the bottom projection of the cube map + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, front: DirectRelationReference | tuple[str, str] | None = None, back: DirectRelationReference | tuple[str, str] | None = None, left: DirectRelationReference | tuple[str, str] | None = None, @@ -359,6 +571,29 @@ def __init__( class CogniteCubeMap(CogniteCubeMapProperties, TypedNode): + """This represents the reading format of Cognite cube map. + + It is used to when data is read from CDF. + + The cube map holds references to projections for a cube surrounding an 3D entity extending this, such as CogniteImage360 + + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite cube map. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + front (DirectRelationReference | None): Direct relation to a file holding the front projection of the cube map + back (DirectRelationReference | None): Direct relation to a file holding the back projection of the cube map + left (DirectRelationReference | None): Direct relation to a file holding the left projection of the cube map + right (DirectRelationReference | None): Direct relation to a file holding the right projection of the cube map + top (DirectRelationReference | None): Direct relation to a file holding the top projection of the cube map + bottom (DirectRelationReference | None): Direct relation to a file holding the bottom projection of the cube map + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -366,6 +601,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, front: DirectRelationReference | None = None, back: DirectRelationReference | None = None, left: DirectRelationReference | None = None, @@ -387,14 +623,14 @@ def as_write(self) -> CogniteCubeMapApply: return CogniteCubeMapApply( self.space, self.external_id, - self.front, - self.back, - self.left, - self.right, - self.top, - self.bottom, - self.version, - self.type, + front=self.front, + back=self.back, + left=self.left, + right=self.right, + top=self.top, + bottom=self.bottom, + existing_version=self.version, + type=self.type, ) @@ -415,10 +651,34 @@ def get_source(cls) -> ViewId: class CogniteTransformation3DNodeApply(CogniteTransformation3DProperties, TypedNodeApply): + """This represents the writing format of Cognite transformation 3D node. + + It is used to when data is written to CDF. + + The CogniteTransformation3D object defines a comprehensive 3D transformation, enabling precise adjustments to an object's position, orientation, and size in 3D space. It allows for the translation of objects along the three spatial axes, rotation around these axes using Euler angles, and scaling along each axis to modify the object's dimensions + + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite transformation 3D node. + translation_x (float | None): The displacement of the object along the X-axis in 3D space + translation_y (float | None): The displacement of the object along the Y-axis in 3D space + translation_z (float | None): The displacement of the object along the Z-axis in 3D space + euler_rotation_x (float | None): The rotation of the object around the X-axis, measured in degrees + euler_rotation_y (float | None): The rotation of the object around the Y-axis, measured in degrees + euler_rotation_z (float | None): The rotation of the object around the Z-axis, measured in degrees + scale_x (float | None): The scaling factor applied to the object along the X-axis + scale_y (float | None): The scaling factor applied to the object along the Y-axis + scale_z (float | None): The scaling factor applied to the object along the Z-axis + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, translation_x: float | None = None, translation_y: float | None = None, translation_z: float | None = None, @@ -444,6 +704,32 @@ def __init__( class CogniteTransformation3DNode(CogniteTransformation3DProperties, TypedNode): + """This represents the reading format of Cognite transformation 3D node. + + It is used to when data is read from CDF. + + The CogniteTransformation3D object defines a comprehensive 3D transformation, enabling precise adjustments to an object's position, orientation, and size in 3D space. It allows for the translation of objects along the three spatial axes, rotation around these axes using Euler angles, and scaling along each axis to modify the object's dimensions + + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite transformation 3D node. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + translation_x (float | None): The displacement of the object along the X-axis in 3D space + translation_y (float | None): The displacement of the object along the Y-axis in 3D space + translation_z (float | None): The displacement of the object along the Z-axis in 3D space + euler_rotation_x (float | None): The rotation of the object around the X-axis, measured in degrees + euler_rotation_y (float | None): The rotation of the object around the Y-axis, measured in degrees + euler_rotation_z (float | None): The rotation of the object around the Z-axis, measured in degrees + scale_x (float | None): The scaling factor applied to the object along the X-axis + scale_y (float | None): The scaling factor applied to the object along the Y-axis + scale_z (float | None): The scaling factor applied to the object along the Z-axis + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -451,6 +737,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, translation_x: float | None = None, translation_y: float | None = None, translation_z: float | None = None, @@ -478,17 +765,17 @@ def as_write(self) -> CogniteTransformation3DNodeApply: return CogniteTransformation3DNodeApply( self.space, self.external_id, - self.translation_x, - self.translation_y, - self.translation_z, - self.euler_rotation_x, - self.euler_rotation_y, - self.euler_rotation_z, - self.scale_x, - self.scale_y, - self.scale_z, - self.version, - self.type, + translation_x=self.translation_x, + translation_y=self.translation_y, + translation_z=self.translation_z, + euler_rotation_x=self.euler_rotation_x, + euler_rotation_y=self.euler_rotation_y, + euler_rotation_z=self.euler_rotation_z, + scale_x=self.scale_x, + scale_y=self.scale_y, + scale_z=self.scale_z, + existing_version=self.version, + type=self.type, ) @@ -499,10 +786,30 @@ def get_source(cls) -> ViewId: class CogniteAssetClassApply(CogniteAssetClassProperties, CogniteDescribableNodeApply): + """This represents the writing format of Cognite asset class. + + It is used to when data is written to CDF. + + This identifies the class of an asset + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite asset class. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + code (str | None): A unique identifier for the class of asset + standard (str | None): Textual string for which standard the code is from + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -512,12 +819,43 @@ def __init__( existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - super().__init__(space, external_id, name, description, tags, aliases, existing_version, type) + super().__init__( + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, + ) self.code = code self.standard = standard class CogniteAssetClass(CogniteAssetClassProperties, CogniteDescribableNode): + """This represents the reading format of Cognite asset class. + + It is used to when data is read from CDF. + + This identifies the class of an asset + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite asset class. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + code (str | None): A unique identifier for the class of asset + standard (str | None): Textual string for which standard the code is from + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -525,6 +863,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -540,12 +879,12 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, ) self.code = code self.standard = standard @@ -554,14 +893,14 @@ def as_write(self) -> CogniteAssetClassApply: return CogniteAssetClassApply( self.space, self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.code, - self.standard, - self.version, - self.type, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + code=self.code, + standard=self.standard, + existing_version=self.version, + type=self.type, ) @@ -574,10 +913,30 @@ def get_source(cls) -> ViewId: class CogniteAssetTypeApply(CogniteAssetTypeProperties, CogniteDescribableNodeApply): + """This represents the writing format of Cognite asset type. + + It is used to when data is written to CDF. + + This identifies the type of an asset + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite asset type. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + code (str | None): A unique identifier for the type of asset + asset_class (DirectRelationReference | tuple[str, str] | None): Class of this type, direct relation to CogniteAssetClass + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -587,12 +946,43 @@ def __init__( existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - super().__init__(space, external_id, name, description, tags, aliases, existing_version, type) + super().__init__( + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, + ) self.code = code self.asset_class = DirectRelationReference.load(asset_class) if asset_class else None class CogniteAssetType(CogniteAssetTypeProperties, CogniteDescribableNode): + """This represents the reading format of Cognite asset type. + + It is used to when data is read from CDF. + + This identifies the type of an asset + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite asset type. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + code (str | None): A unique identifier for the type of asset + asset_class (DirectRelationReference | None): Class of this type, direct relation to CogniteAssetClass + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -600,6 +990,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -615,12 +1006,12 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, ) self.code = code self.asset_class = DirectRelationReference.load(asset_class) if asset_class else None @@ -629,20 +1020,20 @@ def as_write(self) -> CogniteAssetTypeApply: return CogniteAssetTypeApply( self.space, self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.code, - self.asset_class, - self.version, - self.type, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + code=self.code, + asset_class=self.asset_class, + existing_version=self.version, + type=self.type, ) class CogniteCADNodeProperties: - object_3_d = PropertyOptions("object3D") - model_3_d = PropertyOptions("model3D") + object_3d = PropertyOptions("object3D") + model_3d = PropertyOptions("model3D") cad_node_reference = PropertyOptions("cadNodeReference") tree_indexes = PropertyOptions("treeIndexes") sub_tree_sizes = PropertyOptions("subTreeSizes") @@ -653,16 +1044,40 @@ def get_source(cls) -> ViewId: class CogniteCADNodeApply(CogniteCADNodeProperties, CogniteDescribableNodeApply): + """This represents the writing format of Cognite cad node. + + It is used to when data is written to CDF. + + Represents nodes from the 3D model that have been contextualized + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite cad node. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + object_3d (DirectRelationReference | tuple[str, str] | None): Direct relation to object3D grouping for this node + model_3d (DirectRelationReference | tuple[str, str] | None): Direct relation to CogniteModel3D + cad_node_reference (str | None): Reference to a node within a CAD model from the 3D API + revisions (list[DirectRelationReference | tuple[str, str]] | None): List of direct relations to instances of CogniteRevision3D which this CogniteCADNode exists in. + tree_indexes (list[int] | None): List of tree indexes in the same order as revisions. Used by Reveal and similar applications to map from CogniteCADNode to tree index + sub_tree_sizes (list[int] | None): List of subtree sizes in the same order as revisions. Used by Reveal and similar applications to know how many nodes exists below this node in the hierarchy + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, aliases: list[str] | None = None, - object_3_d: DirectRelationReference | tuple[str, str] | None = None, - model_3_d: DirectRelationReference | tuple[str, str] | None = None, + object_3d: DirectRelationReference | tuple[str, str] | None = None, + model_3d: DirectRelationReference | tuple[str, str] | None = None, cad_node_reference: str | None = None, revisions: list[DirectRelationReference | tuple[str, str]] | None = None, tree_indexes: list[int] | None = None, @@ -670,9 +1085,18 @@ def __init__( existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - super().__init__(space, external_id, name, description, tags, aliases, existing_version, type) - self.object_3_d = DirectRelationReference.load(object_3_d) if object_3_d else None - self.model_3_d = DirectRelationReference.load(model_3_d) if model_3_d else None + super().__init__( + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, + ) + self.object_3d = DirectRelationReference.load(object_3d) if object_3d else None + self.model_3d = DirectRelationReference.load(model_3d) if model_3d else None self.cad_node_reference = cad_node_reference self.revisions = [DirectRelationReference.load(revision) for revision in revisions] if revisions else None self.tree_indexes = tree_indexes @@ -680,6 +1104,32 @@ def __init__( class CogniteCADNode(CogniteCADNodeProperties, CogniteDescribableNode): + """This represents the reading format of Cognite cad node. + + It is used to when data is read from CDF. + + Represents nodes from the 3D model that have been contextualized + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite cad node. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + object_3d (DirectRelationReference | None): Direct relation to object3D grouping for this node + model_3d (DirectRelationReference | None): Direct relation to CogniteModel3D + cad_node_reference (str | None): Reference to a node within a CAD model from the 3D API + revisions (list[DirectRelationReference] | None): List of direct relations to instances of CogniteRevision3D which this CogniteCADNode exists in. + tree_indexes (list[int] | None): List of tree indexes in the same order as revisions. Used by Reveal and similar applications to map from CogniteCADNode to tree index + sub_tree_sizes (list[int] | None): List of subtree sizes in the same order as revisions. Used by Reveal and similar applications to know how many nodes exists below this node in the hierarchy + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -687,12 +1137,13 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, aliases: list[str] | None = None, - object_3_d: DirectRelationReference | None = None, - model_3_d: DirectRelationReference | None = None, + object_3d: DirectRelationReference | None = None, + model_3d: DirectRelationReference | None = None, cad_node_reference: str | None = None, revisions: list[DirectRelationReference] | None = None, tree_indexes: list[int] | None = None, @@ -706,15 +1157,15 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, ) - self.object_3_d = DirectRelationReference.load(object_3_d) if object_3_d else None - self.model_3_d = DirectRelationReference.load(model_3_d) if model_3_d else None + self.object_3d = DirectRelationReference.load(object_3d) if object_3d else None + self.model_3d = DirectRelationReference.load(model_3d) if model_3d else None self.cad_node_reference = cad_node_reference self.revisions = [DirectRelationReference.load(revision) for revision in revisions] if revisions else None self.tree_indexes = tree_indexes @@ -724,176 +1175,57 @@ def as_write(self) -> CogniteCADNodeApply: return CogniteCADNodeApply( self.space, self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.object_3_d, - self.model_3_d, - self.cad_node_reference, - self.revisions, # type: ignore[arg-type] - self.tree_indexes, - self.sub_tree_sizes, - self.version, - self.type, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + object_3d=self.object_3d, + model_3d=self.model_3d, + cad_node_reference=self.cad_node_reference, + revisions=self.revisions, # type: ignore[arg-type] + tree_indexes=self.tree_indexes, + sub_tree_sizes=self.sub_tree_sizes, + existing_version=self.version, + type=self.type, ) -class CogniteEquipmentProperties: - serial_number = PropertyOptions("serialNumber") - equipment_type = PropertyOptions("equipmentType") +class CogniteEquipmentTypeProperties: + equipment_class = PropertyOptions("equipmentClass") + standard_reference = PropertyOptions("standardReference") @classmethod def get_source(cls) -> ViewId: - return ViewId("cdf_cdm_experimental", "CogniteEquipment", "v1") + return ViewId("cdf_cdm_experimental", "CogniteEquipmentType", "v1") -class CogniteEquipmentApply(CogniteEquipmentProperties, CogniteDescribableNodeApply, CogniteSourceableNodeApply): - def __init__( - self, - space: str, - external_id: str, - name: str | None = None, - description: str | None = None, - tags: list[str] | None = None, - aliases: list[str] | None = None, - source_id: str | None = None, - source_context: str | None = None, - source: DirectRelationReference | tuple[str, str] | None = None, - source_created_time: datetime | None = None, - source_updated_time: datetime | None = None, - source_created_user: str | None = None, - source_updated_user: str | None = None, - serial_number: str | None = None, - manufacturer: str | None = None, - equipment_type: DirectRelationReference | tuple[str, str] | None = None, - files: list[DirectRelationReference | tuple[str, str]] | None = None, - existing_version: int | None = None, - type: DirectRelationReference | tuple[str, str] | None = None, - ) -> None: - CogniteDescribableNodeApply.__init__( - self, space, external_id, name, description, tags, aliases, existing_version, type - ) - CogniteSourceableNodeApply.__init__( - self, - space, - external_id, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - existing_version, - type, - ) - self.serial_number = serial_number - self.manufacturer = manufacturer - self.equipment_type = DirectRelationReference.load(equipment_type) if equipment_type else None - self.files = [DirectRelationReference.load(file) for file in files] if files else None - - -class CogniteEquipment(CogniteEquipmentProperties, CogniteDescribableNode, CogniteSourceableNode): - def __init__( - self, - space: str, - external_id: str, - version: int, - last_updated_time: int, - created_time: int, - name: str | None = None, - description: str | None = None, - tags: list[str] | None = None, - aliases: list[str] | None = None, - source_id: str | None = None, - source_context: str | None = None, - source: DirectRelationReference | None = None, - source_created_time: datetime | None = None, - source_updated_time: datetime | None = None, - source_created_user: str | None = None, - source_updated_user: str | None = None, - serial_number: str | None = None, - manufacturer: str | None = None, - equipment_type: DirectRelationReference | None = None, - files: list[DirectRelationReference] | None = None, - type: DirectRelationReference | None = None, - deleted_time: int | None = None, - ) -> None: - CogniteDescribableNode.__init__( - self, - space, - external_id, - version, - last_updated_time, - created_time, - name, - description, - tags, - aliases, - type, - deleted_time, - ) - CogniteSourceableNode.__init__( - self, - space, - external_id, - version, - last_updated_time, - created_time, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - type, - deleted_time, - ) - self.serial_number = serial_number - self.manufacturer = manufacturer - self.equipment_type = DirectRelationReference.load(equipment_type) if equipment_type else None - self.files = [DirectRelationReference.load(file) for file in files] if files else None - - def as_write(self) -> CogniteEquipmentApply: - return CogniteEquipmentApply( - self.space, - self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.source_id, - self.source_context, - self.source, - self.source_created_time, - self.source_updated_time, - self.source_created_user, - self.source_updated_user, - self.serial_number, - self.manufacturer, - self.equipment_type, - self.files, # type: ignore[arg-type] - self.version, - self.type, - ) - - -class CogniteEquipmentTypeProperties: - equipment_class = PropertyOptions("equipmentClass") - standard_reference = PropertyOptions("standardReference") - - @classmethod - def get_source(cls) -> ViewId: - return ViewId("cdf_cdm_experimental", "CogniteEquipmentType", "v1") - - -class CogniteEquipmentTypeApply(CogniteEquipmentTypeProperties, CogniteDescribableNodeApply): +class CogniteEquipmentTypeApply(CogniteEquipmentTypeProperties, CogniteDescribableNodeApply): + """This represents the writing format of Cognite equipment type. + + It is used to when data is written to CDF. + + This identifies the type of an equipment + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite equipment type. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + code (str | None): A unique identifier for the type of equipment + equipment_class (str | None): Class of equipment + standard (str | None): Identifier for which standard this equipment type is sourced from, such as ISO14224 or similar + standard_reference (str | None): Reference to the source of the equipment specification + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -905,7 +1237,16 @@ def __init__( existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - super().__init__(space, external_id, name, description, tags, aliases, existing_version, type) + super().__init__( + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, + ) self.code = code self.equipment_class = equipment_class self.standard = standard @@ -913,6 +1254,30 @@ def __init__( class CogniteEquipmentType(CogniteEquipmentTypeProperties, CogniteDescribableNode): + """This represents the reading format of Cognite equipment type. + + It is used to when data is read from CDF. + + This identifies the type of an equipment + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite equipment type. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + code (str | None): A unique identifier for the type of equipment + equipment_class (str | None): Class of equipment + standard (str | None): Identifier for which standard this equipment type is sourced from, such as ISO14224 or similar + standard_reference (str | None): Reference to the source of the equipment specification + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -920,6 +1285,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -937,12 +1303,12 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, ) self.code = code self.equipment_class = equipment_class @@ -953,168 +1319,16 @@ def as_write(self) -> CogniteEquipmentTypeApply: return CogniteEquipmentTypeApply( self.space, self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.code, - self.equipment_class, - self.standard, - self.standard_reference, - self.version, - self.type, - ) - - -class CogniteFileProperties: - mime_type = PropertyOptions("mimeType") - is_uploaded = PropertyOptions("isUploaded") - uploaded_time = PropertyOptions("uploadedTime") - - @classmethod - def get_source(cls) -> ViewId: - return ViewId("cdf_cdm_experimental", "CogniteFile", "v1") - - -class CogniteFileApply(CogniteFileProperties, CogniteDescribableNodeApply, CogniteSourceableNodeApply): - def __init__( - self, - space: str, - external_id: str, - name: str | None = None, - description: str | None = None, - tags: list[str] | None = None, - aliases: list[str] | None = None, - source_id: str | None = None, - source_context: str | None = None, - source: DirectRelationReference | tuple[str, str] | None = None, - source_created_time: datetime | None = None, - source_updated_time: datetime | None = None, - source_created_user: str | None = None, - source_updated_user: str | None = None, - assets: list[DirectRelationReference | tuple[str, str]] | None = None, - mime_type: str | None = None, - directory: str | None = None, - is_uploaded: bool | None = None, - uploaded_time: datetime | None = None, - category: DirectRelationReference | tuple[str, str] | None = None, - existing_version: int | None = None, - type: DirectRelationReference | tuple[str, str] | None = None, - ) -> None: - CogniteDescribableNodeApply.__init__( - self, space, external_id, name, description, tags, aliases, existing_version, type - ) - CogniteSourceableNodeApply.__init__( - self, - space, - external_id, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - existing_version, - type, - ) - self.assets = [DirectRelationReference.load(asset) for asset in assets] if assets else None - self.mime_type = mime_type - self.directory = directory - self.is_uploaded = is_uploaded - self.uploaded_time = uploaded_time - self.category = DirectRelationReference.load(category) if category else None - - -class CogniteFile(CogniteFileProperties, CogniteDescribableNode, CogniteSourceableNode): - def __init__( - self, - space: str, - external_id: str, - version: int, - last_updated_time: int, - created_time: int, - name: str | None = None, - description: str | None = None, - tags: list[str] | None = None, - aliases: list[str] | None = None, - source_id: str | None = None, - source_context: str | None = None, - source: DirectRelationReference | None = None, - source_created_time: datetime | None = None, - source_updated_time: datetime | None = None, - source_created_user: str | None = None, - source_updated_user: str | None = None, - assets: list[DirectRelationReference] | None = None, - mime_type: str | None = None, - directory: str | None = None, - is_uploaded: bool | None = None, - uploaded_time: datetime | None = None, - category: DirectRelationReference | None = None, - type: DirectRelationReference | None = None, - deleted_time: int | None = None, - ) -> None: - CogniteDescribableNode.__init__( - self, - space, - external_id, - version, - last_updated_time, - created_time, - name, - description, - tags, - aliases, - type, - deleted_time, - ) - CogniteSourceableNode.__init__( - self, - space, - external_id, - version, - last_updated_time, - created_time, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - type, - deleted_time, - ) - self.assets = [DirectRelationReference.load(asset) for asset in assets] if assets else None - self.mime_type = mime_type - self.directory = directory - self.is_uploaded = is_uploaded - self.uploaded_time = uploaded_time - self.category = DirectRelationReference.load(category) if category else None - - def as_write(self) -> CogniteFileApply: - return CogniteFileApply( - self.space, - self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.source_id, - self.source_context, - self.source, - self.source_created_time, - self.source_updated_time, - self.source_created_user, - self.source_updated_user, - self.assets, # type: ignore[arg-type] - self.mime_type, - self.directory, - self.is_uploaded, - self.uploaded_time, - self.category, - self.version, - self.type, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + code=self.code, + equipment_class=self.equipment_class, + standard=self.standard, + standard_reference=self.standard_reference, + existing_version=self.version, + type=self.type, ) @@ -1127,10 +1341,31 @@ def get_source(cls) -> ViewId: class CogniteFileCategoryApply(CogniteFileCategoryProperties, CogniteDescribableNodeApply): + """This represents the writing format of Cognite file category. + + It is used to when data is written to CDF. + + This identifies the category of file as found through contextualization/categorization + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite file category. + code (str): Identified category code, such as 'AA' for Accounting (from Norsok) + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + standard (str | None): Name of the standard the category originates from, such as 'Norsok' + standard_reference (str | None): Reference to the source of the category standard + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, code: str, name: str | None = None, description: str | None = None, @@ -1141,13 +1376,45 @@ def __init__( existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - super().__init__(space, external_id, name, description, tags, aliases, existing_version, type) + super().__init__( + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, + ) self.code = code self.standard = standard self.standard_reference = standard_reference class CogniteFileCategory(CogniteFileCategoryProperties, CogniteDescribableNode): + """This represents the reading format of Cognite file category. + + It is used to when data is read from CDF. + + This identifies the category of file as found through contextualization/categorization + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite file category. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + code (str): Identified category code, such as 'AA' for Accounting (from Norsok) + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + standard (str | None): Name of the standard the category originates from, such as 'Norsok' + standard_reference (str | None): Reference to the source of the category standard + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -1155,6 +1422,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, code: str, name: str | None = None, description: str | None = None, @@ -1171,12 +1439,12 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, ) self.code = code self.standard = standard @@ -1186,15 +1454,15 @@ def as_write(self) -> CogniteFileCategoryApply: return CogniteFileCategoryApply( self.space, self.external_id, - self.code, - self.name, - self.description, - self.tags, - self.aliases, - self.standard, - self.standard_reference, - self.version, - self.type, + code=self.code, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + standard=self.standard, + standard_reference=self.standard_reference, + existing_version=self.version, + type=self.type, ) @@ -1207,10 +1475,29 @@ def get_source(cls) -> ViewId: class CogniteImage360StationApply(CogniteImage360StationProperties, CogniteDescribableNodeApply): + """This represents the writing format of Cognite image 360 station. + + It is used to when data is written to CDF. + + Navigational aid for traversing multiple CogniteImage360 instances for a single station + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite image 360 station. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + group_type (Literal['Station360'] | None): Type of group + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -1219,11 +1506,41 @@ def __init__( existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - super().__init__(space, external_id, name, description, tags, aliases, existing_version, type) + super().__init__( + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, + ) self.group_type = group_type class CogniteImage360Station(CogniteImage360StationProperties, CogniteDescribableNode): + """This represents the reading format of Cognite image 360 station. + + It is used to when data is read from CDF. + + Navigational aid for traversing multiple CogniteImage360 instances for a single station + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite image 360 station. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + group_type (Literal['Station360'] | None): Type of group + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -1231,6 +1548,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -1245,12 +1563,12 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, ) self.group_type = group_type @@ -1258,13 +1576,13 @@ def as_write(self) -> CogniteImage360StationApply: return CogniteImage360StationApply( self.space, self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.group_type, - self.version, - self.type, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + group_type=self.group_type, + existing_version=self.version, + type=self.type, ) @@ -1277,10 +1595,29 @@ def get_source(cls) -> ViewId: class CogniteModel3DApply(CogniteModel3DProperties, CogniteDescribableNodeApply): + """This represents the writing format of Cognite model 3D. + + It is used to when data is written to CDF. + + Groups revisions of 3D data of various kinds together (CAD, PointCloud, CogniteImage360) + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite model 3D. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + type_ (Literal["CAD", "Image360", "PointCloud"] | None): CAD, PointCloud or CogniteImage360 + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -1289,11 +1626,41 @@ def __init__( existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - super().__init__(space, external_id, name, description, tags, aliases, existing_version, type) + super().__init__( + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, + ) self.type_ = type_ class CogniteModel3D(CogniteModel3DProperties, CogniteDescribableNode): + """This represents the reading format of Cognite model 3D. + + It is used to when data is read from CDF. + + Groups revisions of 3D data of various kinds together (CAD, PointCloud, CogniteImage360) + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite model 3D. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + type_ (Literal["CAD", "Image360", "PointCloud"] | None): CAD, PointCloud or CogniteImage360 + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -1301,6 +1668,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -1315,12 +1683,12 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, ) self.type_ = type_ @@ -1328,13 +1696,13 @@ def as_write(self) -> CogniteModel3DApply: return CogniteModel3DApply( self.space, self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.type_, - self.version, - self.type, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + type_=self.type_, + existing_version=self.version, + type=self.type, ) @@ -1352,10 +1720,34 @@ def get_source(cls) -> ViewId: class CogniteObject3DApply(CogniteObject3DProperties, CogniteDescribableNodeApply): + """This represents the writing format of Cognite object 3D. + + It is used to when data is written to CDF. + + This is a virtual representation of an object in world space, tied to an asset and 3D resources. + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite object 3D. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + x_min (float | None): Lowest X value + x_max (float | None): Highest X value + y_min (float | None): Lowest Y value + y_max (float | None): Highest Y value + z_min (float | None): Lowest Z value + z_max (float | None): Highest Z value + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -1369,7 +1761,16 @@ def __init__( existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - super().__init__(space, external_id, name, description, tags, aliases, existing_version, type) + super().__init__( + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, + ) self.x_min = x_min self.x_max = x_max self.y_min = y_min @@ -1379,6 +1780,32 @@ def __init__( class CogniteObject3D(CogniteObject3DProperties, CogniteDescribableNode): + """This represents the reading format of Cognite object 3D. + + It is used to when data is read from CDF. + + This is a virtual representation of an object in world space, tied to an asset and 3D resources. + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite object 3D. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + x_min (float | None): Lowest X value + x_max (float | None): Highest X value + y_min (float | None): Lowest Y value + y_max (float | None): Highest Y value + z_min (float | None): Lowest Z value + z_max (float | None): Highest Z value + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -1386,6 +1813,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -1405,12 +1833,12 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, ) self.x_min = x_min self.x_max = x_max @@ -1423,24 +1851,24 @@ def as_write(self) -> CogniteObject3DApply: return CogniteObject3DApply( self.space, self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.x_min, - self.x_max, - self.y_min, - self.y_max, - self.z_min, - self.z_max, - self.version, - self.type, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + x_min=self.x_min, + x_max=self.x_max, + y_min=self.y_min, + y_max=self.y_max, + z_min=self.z_min, + z_max=self.z_max, + existing_version=self.version, + type=self.type, ) class CognitePointCloudVolumeProperties: - object_3_d = PropertyOptions("object3D") - model_3_d = PropertyOptions("model3D") + object_3d = PropertyOptions("object3D") + model_3d = PropertyOptions("model3D") volume_references = PropertyOptions("volumeReferences") volume_type = PropertyOptions("volumeType") format_version = PropertyOptions("formatVersion") @@ -1451,16 +1879,41 @@ def get_source(cls) -> ViewId: class CognitePointCloudVolumeApply(CognitePointCloudVolumeProperties, CogniteDescribableNodeApply): + """This represents the writing format of Cognite point cloud volume. + + It is used to when data is written to CDF. + + PointCloud volume definition + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite point cloud volume. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + object_3d (DirectRelationReference | tuple[str, str] | None): Direct relation to object3D grouping for this node + model_3d (DirectRelationReference | tuple[str, str] | None): Direct relation to CogniteModel3D instance + volume_references (list[str] | None): Unique volume metric hashes used to access the 3D specialized data storage + revisions (list[DirectRelationReference | tuple[str, str]] | None): List of direct relations to revision information + volume_type (Literal["Box", "Cylinder"] | None): Type of volume (Cylinder or Box) + volume (list[float] | None): Relevant coordinates for the volume type, 9 floats in total, that defines the volume + format_version (str | None): Specifies the version the 'volume' field is following. Volume definition is today 9 floats (property volume) + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, aliases: list[str] | None = None, - object_3_d: DirectRelationReference | tuple[str, str] | None = None, - model_3_d: DirectRelationReference | tuple[str, str] | None = None, + object_3d: DirectRelationReference | tuple[str, str] | None = None, + model_3d: DirectRelationReference | tuple[str, str] | None = None, volume_references: list[str] | None = None, revisions: list[DirectRelationReference | tuple[str, str]] | None = None, volume_type: Literal["Box", "Cylinder"] | None = None, @@ -1469,9 +1922,18 @@ def __init__( existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - super().__init__(space, external_id, name, description, tags, aliases, existing_version, type) - self.object_3_d = DirectRelationReference.load(object_3_d) if object_3_d else None - self.model_3_d = DirectRelationReference.load(model_3_d) if model_3_d else None + super().__init__( + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, + ) + self.object_3d = DirectRelationReference.load(object_3d) if object_3d else None + self.model_3d = DirectRelationReference.load(model_3d) if model_3d else None self.volume_references = volume_references self.revisions = [DirectRelationReference.load(revision) for revision in revisions] if revisions else None self.volume_type = volume_type @@ -1480,6 +1942,33 @@ def __init__( class CognitePointCloudVolume(CognitePointCloudVolumeProperties, CogniteDescribableNode): + """This represents the reading format of Cognite point cloud volume. + + It is used to when data is read from CDF. + + PointCloud volume definition + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite point cloud volume. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + object_3d (DirectRelationReference | None): Direct relation to object3D grouping for this node + model_3d (DirectRelationReference | None): Direct relation to CogniteModel3D instance + volume_references (list[str] | None): Unique volume metric hashes used to access the 3D specialized data storage + revisions (list[DirectRelationReference] | None): List of direct relations to revision information + volume_type (Literal["Box", "Cylinder"] | None): Type of volume (Cylinder or Box) + volume (list[float] | None): Relevant coordinates for the volume type, 9 floats in total, that defines the volume + format_version (str | None): Specifies the version the 'volume' field is following. Volume definition is today 9 floats (property volume) + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -1487,12 +1976,13 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, aliases: list[str] | None = None, - object_3_d: DirectRelationReference | None = None, - model_3_d: DirectRelationReference | None = None, + object_3d: DirectRelationReference | None = None, + model_3d: DirectRelationReference | None = None, volume_references: list[str] | None = None, revisions: list[DirectRelationReference] | None = None, volume_type: Literal["Box", "Cylinder"] | None = None, @@ -1507,15 +1997,15 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, ) - self.object_3_d = DirectRelationReference.load(object_3_d) if object_3_d else None - self.model_3_d = DirectRelationReference.load(model_3_d) if model_3_d else None + self.object_3d = DirectRelationReference.load(object_3d) if object_3d else None + self.model_3d = DirectRelationReference.load(model_3d) if model_3d else None self.volume_references = volume_references self.revisions = [DirectRelationReference.load(revision) for revision in revisions] if revisions else None self.volume_type = volume_type @@ -1526,19 +2016,19 @@ def as_write(self) -> CognitePointCloudVolumeApply: return CognitePointCloudVolumeApply( self.space, self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.object_3_d, - self.model_3_d, - self.volume_references, - self.revisions, # type: ignore[arg-type] - self.volume_type, - self.volume, - self.format_version, - self.version, - self.type, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + object_3d=self.object_3d, + model_3d=self.model_3d, + volume_references=self.volume_references, + revisions=self.revisions, # type: ignore[arg-type] + volume_type=self.volume_type, + volume=self.volume, + format_version=self.format_version, + existing_version=self.version, + type=self.type, ) @@ -1551,10 +2041,30 @@ def get_source(cls) -> ViewId: class CogniteSourceSystemApply(CogniteSourceSystemProperties, CogniteDescribableNodeApply): + """This represents the writing format of Cognite source system. + + It is used to when data is written to CDF. + + The CogniteSourceSystem core concept is used to standardize the way source system is stored. + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite source system. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + version_ (str | None): Version identifier for the source system + manufacturer (str | None): Manufacturer of the source system + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -1564,12 +2074,43 @@ def __init__( existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - super().__init__(space, external_id, name, description, tags, aliases, existing_version, type) + super().__init__( + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, + ) self.version_ = version_ self.manufacturer = manufacturer class CogniteSourceSystem(CogniteSourceSystemProperties, CogniteDescribableNode): + """This represents the reading format of Cognite source system. + + It is used to when data is read from CDF. + + The CogniteSourceSystem core concept is used to standardize the way source system is stored. + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite source system. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + version_ (str | None): Version identifier for the source system + manufacturer (str | None): Manufacturer of the source system + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -1577,6 +2118,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -1592,12 +2134,12 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, ) self.version_ = version_ self.manufacturer = manufacturer @@ -1606,33 +2148,526 @@ def as_write(self) -> CogniteSourceSystemApply: return CogniteSourceSystemApply( self.space, self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.version_, - self.manufacturer, - self.version, - self.type, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + version_=self.version_, + manufacturer=self.manufacturer, + existing_version=self.version, + type=self.type, ) -class CogniteTimeSeriesProperties: - type_ = PropertyOptions("type") - is_step = PropertyOptions("isStep") - source_unit = PropertyOptions("sourceUnit") +class CogniteActivityProperties: + time_series = PropertyOptions("timeSeries") @classmethod def get_source(cls) -> ViewId: - return ViewId("cdf_cdm_experimental", "CogniteTimeSeries", "v1") + return ViewId("cdf_cdm_experimental", "CogniteActivity", "v1") -class CogniteTimeSeriesApply(CogniteTimeSeriesProperties, CogniteDescribableNodeApply, CogniteSourceableNodeApply): +class CogniteActivityApply( + CogniteActivityProperties, CogniteDescribableNodeApply, CogniteSourceableNodeApply, CogniteSchedulableApply +): + """This represents the writing format of Cognite activity. + + It is used to when data is written to CDF. + + Represent an activity + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite activity. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | tuple[str, str] | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + start_time (datetime | None): The actual start time of an activity (or similar that extends this) + end_time (datetime | None): The actual end time of an activity (or similar that extends this) + scheduled_start_time (datetime | None): The planned start time of an activity (or similar that extends this) + scheduled_end_time (datetime | None): The planned end time of an activity (or similar that extends this) + assets (list[DirectRelationReference | tuple[str, str]] | None): List of assets this activity relates to + equipment (list[DirectRelationReference | tuple[str, str]] | None): The list of equipment this activity relates to + time_series (list[DirectRelationReference | tuple[str, str]] | None): The list of time series this activity relates to + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, - type_: Literal["numeric", "string"], + *, + name: str | None = None, + description: str | None = None, + tags: list[str] | None = None, + aliases: list[str] | None = None, + source_id: str | None = None, + source_context: str | None = None, + source: DirectRelationReference | tuple[str, str] | None = None, + source_created_time: datetime | None = None, + source_updated_time: datetime | None = None, + source_created_user: str | None = None, + source_updated_user: str | None = None, + start_time: datetime | None = None, + end_time: datetime | None = None, + scheduled_start_time: datetime | None = None, + scheduled_end_time: datetime | None = None, + assets: list[DirectRelationReference | tuple[str, str]] | None = None, + equipment: list[DirectRelationReference | tuple[str, str]] | None = None, + time_series: list[DirectRelationReference | tuple[str, str]] | None = None, + existing_version: int | None = None, + type: DirectRelationReference | tuple[str, str] | None = None, + ) -> None: + CogniteDescribableNodeApply.__init__( + self, + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, + ) + CogniteSourceableNodeApply.__init__( + self, + space, + external_id, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + existing_version=existing_version, + type=type, + ) + CogniteSchedulableApply.__init__( + self, + space, + external_id, + start_time=start_time, + end_time=end_time, + scheduled_start_time=scheduled_start_time, + scheduled_end_time=scheduled_end_time, + existing_version=existing_version, + type=type, + ) + self.assets = [DirectRelationReference.load(asset) for asset in assets] if assets else None + self.equipment = [DirectRelationReference.load(equipment) for equipment in equipment] if equipment else None + self.time_series = ( + [DirectRelationReference.load(time_series) for time_series in time_series] if time_series else None + ) + + +class CogniteActivity(CogniteActivityProperties, CogniteDescribableNode, CogniteSourceableNode, CogniteSchedulable): + """This represents the reading format of Cognite activity. + + It is used to when data is read from CDF. + + Represent an activity + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite activity. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + start_time (datetime | None): The actual start time of an activity (or similar that extends this) + end_time (datetime | None): The actual end time of an activity (or similar that extends this) + scheduled_start_time (datetime | None): The planned start time of an activity (or similar that extends this) + scheduled_end_time (datetime | None): The planned end time of an activity (or similar that extends this) + assets (list[DirectRelationReference] | None): List of assets this activity relates to + equipment (list[DirectRelationReference] | None): The list of equipment this activity relates to + time_series (list[DirectRelationReference] | None): The list of time series this activity relates to + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + + def __init__( + self, + space: str, + external_id: str, + version: int, + last_updated_time: int, + created_time: int, + *, + name: str | None = None, + description: str | None = None, + tags: list[str] | None = None, + aliases: list[str] | None = None, + source_id: str | None = None, + source_context: str | None = None, + source: DirectRelationReference | None = None, + source_created_time: datetime | None = None, + source_updated_time: datetime | None = None, + source_created_user: str | None = None, + source_updated_user: str | None = None, + start_time: datetime | None = None, + end_time: datetime | None = None, + scheduled_start_time: datetime | None = None, + scheduled_end_time: datetime | None = None, + assets: list[DirectRelationReference] | None = None, + equipment: list[DirectRelationReference] | None = None, + time_series: list[DirectRelationReference] | None = None, + type: DirectRelationReference | None = None, + deleted_time: int | None = None, + ) -> None: + CogniteDescribableNode.__init__( + self, + space, + external_id, + version, + last_updated_time, + created_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, + ) + CogniteSourceableNode.__init__( + self, + space, + external_id, + version, + last_updated_time, + created_time, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + type=type, + deleted_time=deleted_time, + ) + CogniteSchedulable.__init__( + self, + space, + external_id, + version, + last_updated_time, + created_time, + start_time=start_time, + end_time=end_time, + scheduled_start_time=scheduled_start_time, + scheduled_end_time=scheduled_end_time, + type=type, + deleted_time=deleted_time, + ) + self.assets = [DirectRelationReference.load(asset) for asset in assets] if assets else None + self.equipment = [DirectRelationReference.load(equipment) for equipment in equipment] if equipment else None + self.time_series = ( + [DirectRelationReference.load(time_series) for time_series in time_series] if time_series else None + ) + + def as_write(self) -> CogniteActivityApply: + return CogniteActivityApply( + self.space, + self.external_id, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + source_id=self.source_id, + source_context=self.source_context, + source=self.source, + source_created_time=self.source_created_time, + source_updated_time=self.source_updated_time, + source_created_user=self.source_created_user, + source_updated_user=self.source_updated_user, + start_time=self.start_time, + end_time=self.end_time, + scheduled_start_time=self.scheduled_start_time, + scheduled_end_time=self.scheduled_end_time, + assets=self.assets, # type: ignore[arg-type] + equipment=self.equipment, # type: ignore[arg-type] + time_series=self.time_series, + existing_version=self.version, + type=self.type, + ) + + +class CogniteEquipmentProperties: + serial_number = PropertyOptions("serialNumber") + equipment_type = PropertyOptions("equipmentType") + + @classmethod + def get_source(cls) -> ViewId: + return ViewId("cdf_cdm_experimental", "CogniteEquipment", "v1") + + +class CogniteEquipmentApply(CogniteEquipmentProperties, CogniteDescribableNodeApply, CogniteSourceableNodeApply): + """This represents the writing format of Cognite equipment. + + It is used to when data is written to CDF. + + Represent a physical piece of equipment + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite equipment. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | tuple[str, str] | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + serial_number (str | None): Serial number of the equipment + manufacturer (str | None): Manufacturer of the equipment + equipment_type (DirectRelationReference | tuple[str, str] | None): Type of this equipment, direct relation to CogniteEquipmentType + files (list[DirectRelationReference | tuple[str, str]] | None): List of files this equipment relates to + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + + def __init__( + self, + space: str, + external_id: str, + *, + name: str | None = None, + description: str | None = None, + tags: list[str] | None = None, + aliases: list[str] | None = None, + source_id: str | None = None, + source_context: str | None = None, + source: DirectRelationReference | tuple[str, str] | None = None, + source_created_time: datetime | None = None, + source_updated_time: datetime | None = None, + source_created_user: str | None = None, + source_updated_user: str | None = None, + serial_number: str | None = None, + manufacturer: str | None = None, + equipment_type: DirectRelationReference | tuple[str, str] | None = None, + files: list[DirectRelationReference | tuple[str, str]] | None = None, + existing_version: int | None = None, + type: DirectRelationReference | tuple[str, str] | None = None, + ) -> None: + CogniteDescribableNodeApply.__init__( + self, + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, + ) + CogniteSourceableNodeApply.__init__( + self, + space, + external_id, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + existing_version=existing_version, + type=type, + ) + self.serial_number = serial_number + self.manufacturer = manufacturer + self.equipment_type = DirectRelationReference.load(equipment_type) if equipment_type else None + self.files = [DirectRelationReference.load(file) for file in files] if files else None + + +class CogniteEquipment(CogniteEquipmentProperties, CogniteDescribableNode, CogniteSourceableNode): + """This represents the reading format of Cognite equipment. + + It is used to when data is read from CDF. + + Represent a physical piece of equipment + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite equipment. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + serial_number (str | None): Serial number of the equipment + manufacturer (str | None): Manufacturer of the equipment + equipment_type (DirectRelationReference | None): Type of this equipment, direct relation to CogniteEquipmentType + files (list[DirectRelationReference] | None): List of files this equipment relates to + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + + def __init__( + self, + space: str, + external_id: str, + version: int, + last_updated_time: int, + created_time: int, + *, + name: str | None = None, + description: str | None = None, + tags: list[str] | None = None, + aliases: list[str] | None = None, + source_id: str | None = None, + source_context: str | None = None, + source: DirectRelationReference | None = None, + source_created_time: datetime | None = None, + source_updated_time: datetime | None = None, + source_created_user: str | None = None, + source_updated_user: str | None = None, + serial_number: str | None = None, + manufacturer: str | None = None, + equipment_type: DirectRelationReference | None = None, + files: list[DirectRelationReference] | None = None, + type: DirectRelationReference | None = None, + deleted_time: int | None = None, + ) -> None: + CogniteDescribableNode.__init__( + self, + space, + external_id, + version, + last_updated_time, + created_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, + ) + CogniteSourceableNode.__init__( + self, + space, + external_id, + version, + last_updated_time, + created_time, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + type=type, + deleted_time=deleted_time, + ) + self.serial_number = serial_number + self.manufacturer = manufacturer + self.equipment_type = DirectRelationReference.load(equipment_type) if equipment_type else None + self.files = [DirectRelationReference.load(file) for file in files] if files else None + + def as_write(self) -> CogniteEquipmentApply: + return CogniteEquipmentApply( + self.space, + self.external_id, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + source_id=self.source_id, + source_context=self.source_context, + source=self.source, + source_created_time=self.source_created_time, + source_updated_time=self.source_updated_time, + source_created_user=self.source_created_user, + source_updated_user=self.source_updated_user, + serial_number=self.serial_number, + manufacturer=self.manufacturer, + equipment_type=self.equipment_type, + files=self.files, # type: ignore[arg-type] + existing_version=self.version, + type=self.type, + ) + + +class CogniteFileProperties: + mime_type = PropertyOptions("mimeType") + is_uploaded = PropertyOptions("isUploaded") + uploaded_time = PropertyOptions("uploadedTime") + + @classmethod + def get_source(cls) -> ViewId: + return ViewId("cdf_cdm_experimental", "CogniteFile", "v1") + + +class CogniteFileApply(CogniteFileProperties, CogniteDescribableNodeApply, CogniteSourceableNodeApply): + """This represents the writing format of Cognite file. + + It is used to when data is written to CDF. + + This concept models the underlying file + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite file. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | tuple[str, str] | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + assets (list[DirectRelationReference | tuple[str, str]] | None): List of assets this file relates to + mime_type (str | None): MIME type of the file + directory (str | None): Contains the path elements from the source (for when the source system has a file system hierarchy or similar) + is_uploaded (bool | None): Whether the file content has been uploaded to Cognite Data Fusion + uploaded_time (datetime | None): Point in time when the file upload was completed and the file was made available + category (DirectRelationReference | tuple[str, str] | None): Direct relation to an instance of CogniteFileCategory representing the detected categorization/class for the file + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + + def __init__( + self, + space: str, + external_id: str, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -1644,40 +2679,82 @@ def __init__( source_updated_time: datetime | None = None, source_created_user: str | None = None, source_updated_user: str | None = None, - is_step: bool | None = None, - source_unit: str | None = None, - unit: DirectRelationReference | tuple[str, str] | None = None, assets: list[DirectRelationReference | tuple[str, str]] | None = None, - equipment: list[DirectRelationReference | tuple[str, str]] | None = None, + mime_type: str | None = None, + directory: str | None = None, + is_uploaded: bool | None = None, + uploaded_time: datetime | None = None, + category: DirectRelationReference | tuple[str, str] | None = None, existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: CogniteDescribableNodeApply.__init__( - self, space, external_id, name, description, tags, aliases, existing_version, type + self, + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, ) CogniteSourceableNodeApply.__init__( self, space, external_id, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - existing_version, - type, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + existing_version=existing_version, + type=type, ) - self.type_ = type_ - self.is_step = is_step - self.source_unit = source_unit - self.unit = DirectRelationReference.load(unit) if unit else None self.assets = [DirectRelationReference.load(asset) for asset in assets] if assets else None - self.equipment = [DirectRelationReference.load(equipment) for equipment in equipment] if equipment else None + self.mime_type = mime_type + self.directory = directory + self.is_uploaded = is_uploaded + self.uploaded_time = uploaded_time + self.category = DirectRelationReference.load(category) if category else None -class CogniteTimeSeries(CogniteTimeSeriesProperties, CogniteDescribableNode, CogniteSourceableNode): +class CogniteFile(CogniteFileProperties, CogniteDescribableNode, CogniteSourceableNode): + """This represents the reading format of Cognite file. + + It is used to when data is read from CDF. + + This concept models the underlying file + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite file. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + assets (list[DirectRelationReference] | None): List of assets this file relates to + mime_type (str | None): MIME type of the file + directory (str | None): Contains the path elements from the source (for when the source system has a file system hierarchy or similar) + is_uploaded (bool | None): Whether the file content has been uploaded to Cognite Data Fusion + uploaded_time (datetime | None): Point in time when the file upload was completed and the file was made available + category (DirectRelationReference | None): Direct relation to an instance of CogniteFileCategory representing the detected categorization/class for the file + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -1685,7 +2762,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, - type_: Literal["numeric", "string"], + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -1697,11 +2774,12 @@ def __init__( source_updated_time: datetime | None = None, source_created_user: str | None = None, source_updated_user: str | None = None, - is_step: bool | None = None, - source_unit: str | None = None, - unit: DirectRelationReference | None = None, assets: list[DirectRelationReference] | None = None, - equipment: list[DirectRelationReference] | None = None, + mime_type: str | None = None, + directory: str | None = None, + is_uploaded: bool | None = None, + uploaded_time: datetime | None = None, + category: DirectRelationReference | None = None, type: DirectRelationReference | None = None, deleted_time: int | None = None, ) -> None: @@ -1712,12 +2790,12 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, ) CogniteSourceableNode.__init__( self, @@ -1726,64 +2804,93 @@ def __init__( version, last_updated_time, created_time, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - type, - deleted_time, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + type=type, + deleted_time=deleted_time, ) - self.type_ = type_ - self.is_step = is_step - self.source_unit = source_unit - self.unit = DirectRelationReference.load(unit) if unit else None self.assets = [DirectRelationReference.load(asset) for asset in assets] if assets else None - self.equipment = [DirectRelationReference.load(equipment) for equipment in equipment] if equipment else None + self.mime_type = mime_type + self.directory = directory + self.is_uploaded = is_uploaded + self.uploaded_time = uploaded_time + self.category = DirectRelationReference.load(category) if category else None - def as_write(self) -> CogniteTimeSeriesApply: - return CogniteTimeSeriesApply( + def as_write(self) -> CogniteFileApply: + return CogniteFileApply( self.space, self.external_id, - self.type_, - self.name, - self.description, - self.tags, - self.aliases, - self.source_id, - self.source_context, - self.source, - self.source_created_time, - self.source_updated_time, - self.source_created_user, - self.source_updated_user, - self.is_step, - self.source_unit, - self.unit, - self.assets, # type: ignore[arg-type] - self.equipment, # type: ignore[arg-type] - self.version, - self.type, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + source_id=self.source_id, + source_context=self.source_context, + source=self.source, + source_created_time=self.source_created_time, + source_updated_time=self.source_updated_time, + source_created_user=self.source_created_user, + source_updated_user=self.source_updated_user, + assets=self.assets, # type: ignore[arg-type] + mime_type=self.mime_type, + directory=self.directory, + is_uploaded=self.is_uploaded, + uploaded_time=self.uploaded_time, + category=self.category, + existing_version=self.version, + type=self.type, ) -class CogniteActivityProperties: - time_series = PropertyOptions("timeSeries") +class CogniteTimeSeriesProperties: + type_ = PropertyOptions("type") + is_step = PropertyOptions("isStep") + source_unit = PropertyOptions("sourceUnit") @classmethod def get_source(cls) -> ViewId: - return ViewId("cdf_cdm_experimental", "CogniteActivity", "v1") + return ViewId("cdf_cdm_experimental", "CogniteTimeSeries", "v1") -class CogniteActivityApply( - CogniteActivityProperties, CogniteDescribableNodeApply, CogniteSourceableNodeApply, CogniteSchedulableApply -): +class CogniteTimeSeriesApply(CogniteTimeSeriesProperties, CogniteDescribableNodeApply, CogniteSourceableNodeApply): + """This represents the writing format of Cognite time series. + + It is used to when data is written to CDF. + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite time series. + type_ (Literal["numeric", "string"]): Defines data type of the data points. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | tuple[str, str] | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + is_step (bool | None): Defines whether the time series is a step series or not. + source_unit (str | None): Unit as specified in the source system + unit (DirectRelationReference | tuple[str, str] | None): direct relation to unit in the `cdf_units` space + assets (list[DirectRelationReference | tuple[str, str]] | None): The asset field. + equipment (list[DirectRelationReference | tuple[str, str]] | None): The equipment field. + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, + type_: Literal["numeric", "string"], name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -1795,52 +2902,79 @@ def __init__( source_updated_time: datetime | None = None, source_created_user: str | None = None, source_updated_user: str | None = None, - start_time: datetime | None = None, - end_time: datetime | None = None, - scheduled_start_time: datetime | None = None, - scheduled_end_time: datetime | None = None, + is_step: bool | None = None, + source_unit: str | None = None, + unit: DirectRelationReference | tuple[str, str] | None = None, assets: list[DirectRelationReference | tuple[str, str]] | None = None, equipment: list[DirectRelationReference | tuple[str, str]] | None = None, - time_series: list[DirectRelationReference | tuple[str, str]] | None = None, existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: CogniteDescribableNodeApply.__init__( - self, space, external_id, name, description, tags, aliases, existing_version, type - ) - CogniteSourceableNodeApply.__init__( self, space, external_id, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - existing_version, - type, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, ) - CogniteSchedulableApply.__init__( + CogniteSourceableNodeApply.__init__( self, space, external_id, - start_time, - end_time, - scheduled_start_time, - scheduled_end_time, - existing_version, - type, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + existing_version=existing_version, + type=type, ) + self.type_ = type_ + self.is_step = is_step + self.source_unit = source_unit + self.unit = DirectRelationReference.load(unit) if unit else None self.assets = [DirectRelationReference.load(asset) for asset in assets] if assets else None self.equipment = [DirectRelationReference.load(equipment) for equipment in equipment] if equipment else None - self.time_series = ( - [DirectRelationReference.load(time_series) for time_series in time_series] if time_series else None - ) -class CogniteActivity(CogniteActivityProperties, CogniteDescribableNode, CogniteSourceableNode, CogniteSchedulable): +class CogniteTimeSeries(CogniteTimeSeriesProperties, CogniteDescribableNode, CogniteSourceableNode): + """This represents the reading format of Cognite time series. + + It is used to when data is read from CDF. + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite time series. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + type_ (Literal["numeric", "string"]): Defines data type of the data points. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + is_step (bool | None): Defines whether the time series is a step series or not. + source_unit (str | None): Unit as specified in the source system + unit (DirectRelationReference | None): direct relation to unit in the `cdf_units` space + assets (list[DirectRelationReference] | None): The asset field. + equipment (list[DirectRelationReference] | None): The equipment field. + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -1848,6 +2982,8 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, + type_: Literal["numeric", "string"], name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -1859,13 +2995,11 @@ def __init__( source_updated_time: datetime | None = None, source_created_user: str | None = None, source_updated_user: str | None = None, - start_time: datetime | None = None, - end_time: datetime | None = None, - scheduled_start_time: datetime | None = None, - scheduled_end_time: datetime | None = None, + is_step: bool | None = None, + source_unit: str | None = None, + unit: DirectRelationReference | None = None, assets: list[DirectRelationReference] | None = None, equipment: list[DirectRelationReference] | None = None, - time_series: list[DirectRelationReference] | None = None, type: DirectRelationReference | None = None, deleted_time: int | None = None, ) -> None: @@ -1876,12 +3010,12 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, ) CogniteSourceableNode.__init__( self, @@ -1890,60 +3024,46 @@ def __init__( version, last_updated_time, created_time, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - type, - deleted_time, - ) - CogniteSchedulable.__init__( - self, - space, - external_id, - version, - last_updated_time, - created_time, - start_time, - end_time, - scheduled_start_time, - scheduled_end_time, - type, - deleted_time, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + type=type, + deleted_time=deleted_time, ) + self.type_ = type_ + self.is_step = is_step + self.source_unit = source_unit + self.unit = DirectRelationReference.load(unit) if unit else None self.assets = [DirectRelationReference.load(asset) for asset in assets] if assets else None self.equipment = [DirectRelationReference.load(equipment) for equipment in equipment] if equipment else None - self.time_series = ( - [DirectRelationReference.load(time_series) for time_series in time_series] if time_series else None - ) - def as_write(self) -> CogniteActivityApply: - return CogniteActivityApply( + def as_write(self) -> CogniteTimeSeriesApply: + return CogniteTimeSeriesApply( self.space, self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.source_id, - self.source_context, - self.source, - self.source_created_time, - self.source_updated_time, - self.source_created_user, - self.source_updated_user, - self.start_time, - self.end_time, - self.scheduled_start_time, - self.scheduled_end_time, - self.assets, # type: ignore[arg-type] - self.equipment, # type: ignore[arg-type] - self.time_series, - self.version, - self.type, + type_=self.type_, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + source_id=self.source_id, + source_context=self.source_context, + source=self.source, + source_created_time=self.source_created_time, + source_updated_time=self.source_updated_time, + source_created_user=self.source_created_user, + source_updated_user=self.source_updated_user, + is_step=self.is_step, + source_unit=self.source_unit, + unit=self.unit, + assets=self.assets, # type: ignore[arg-type] + equipment=self.equipment, # type: ignore[arg-type] + existing_version=self.version, + type=self.type, ) @@ -1960,11 +3080,44 @@ def get_source(cls) -> ViewId: class CogniteAssetApply( CogniteAssetProperties, CogniteVisualizableApply, CogniteDescribableNodeApply, CogniteSourceableNodeApply ): + """This represents the writing format of Cognite asset. + + It is used to when data is written to CDF. + + The asset is the bare bone representation of assets in our asset centric world + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite asset. + object_3d (DirectRelationReference | tuple[str, str] | None): Direct relation to an Object3D instance representing the 3D resource + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | tuple[str, str] | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + parent (DirectRelationReference | tuple[str, str] | None): Parent of this asset + root (DirectRelationReference | tuple[str, str] | None): Asset at the top of the hierarchy. + path (list[DirectRelationReference | tuple[str, str]] | None): Materialized path of this asset + last_path_materialization_time (datetime | None): Last time the path materializer updated the path of this asset + equipment (DirectRelationReference | tuple[str, str] | None): Equipment associated with this asset + asset_class (DirectRelationReference | tuple[str, str] | None): Class of this asset + type_ (DirectRelationReference | tuple[str, str] | None): Type of this asset + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, - object_3_d: DirectRelationReference | tuple[str, str] | None = None, + *, + object_3d: DirectRelationReference | tuple[str, str] | None = None, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -1986,23 +3139,33 @@ def __init__( existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - CogniteVisualizableApply.__init__(self, space, external_id, object_3_d, existing_version, type) + CogniteVisualizableApply.__init__( + self, space, external_id, object_3d=object_3d, existing_version=existing_version, type=type + ) CogniteDescribableNodeApply.__init__( - self, space, external_id, name, description, tags, aliases, existing_version, type + self, + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, ) CogniteSourceableNodeApply.__init__( self, space, external_id, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - existing_version, - type, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + existing_version=existing_version, + type=type, ) self.parent = DirectRelationReference.load(parent) if parent else None self.root = DirectRelationReference.load(root) if root else None @@ -2014,6 +3177,41 @@ def __init__( class CogniteAsset(CogniteAssetProperties, CogniteVisualizable, CogniteDescribableNode, CogniteSourceableNode): + """This represents the reading format of Cognite asset. + + It is used to when data is read from CDF. + + The asset is the bare bone representation of assets in our asset centric world + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite asset. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + object_3d (DirectRelationReference | None): Direct relation to an Object3D instance representing the 3D resource + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + parent (DirectRelationReference | None): Parent of this asset + root (DirectRelationReference | None): Asset at the top of the hierarchy. + path (list[DirectRelationReference] | None): Materialized path of this asset + last_path_materialization_time (datetime | None): Last time the path materializer updated the path of this asset + equipment (DirectRelationReference | None): Equipment associated with this asset + asset_class (DirectRelationReference | None): Class of this asset + type_ (DirectRelationReference | None): Type of this asset + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -2021,7 +3219,8 @@ def __init__( version: int, last_updated_time: int, created_time: int, - object_3_d: DirectRelationReference | None = None, + *, + object_3d: DirectRelationReference | None = None, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -2044,7 +3243,15 @@ def __init__( deleted_time: int | None = None, ) -> None: CogniteVisualizable.__init__( - self, space, external_id, version, last_updated_time, created_time, object_3_d, type, deleted_time + self, + space, + external_id, + version, + last_updated_time, + created_time, + object_3d=object_3d, + type=type, + deleted_time=deleted_time, ) CogniteDescribableNode.__init__( self, @@ -2053,12 +3260,12 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, ) CogniteSourceableNode.__init__( self, @@ -2067,15 +3274,15 @@ def __init__( version, last_updated_time, created_time, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - type, - deleted_time, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + type=type, + deleted_time=deleted_time, ) self.parent = DirectRelationReference.load(parent) if parent else None self.root = DirectRelationReference.load(root) if root else None @@ -2089,27 +3296,27 @@ def as_write(self) -> CogniteAssetApply: return CogniteAssetApply( self.space, self.external_id, - self.object_3_d, - self.name, - self.description, - self.tags, - self.aliases, - self.source_id, - self.source_context, - self.source, - self.source_created_time, - self.source_updated_time, - self.source_created_user, - self.source_updated_user, - self.parent, - self.root, - self.path, # type: ignore[arg-type] - self.last_path_materialization_time, - self.equipment, - self.asset_class, - self.type_, - self.version, - self.type, + object_3d=self.object_3d, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + source_id=self.source_id, + source_context=self.source_context, + source=self.source, + source_created_time=self.source_created_time, + source_updated_time=self.source_updated_time, + source_created_user=self.source_created_user, + source_updated_user=self.source_updated_user, + parent=self.parent, + root=self.root, + path=self.path, # type: ignore[arg-type] + last_path_materialization_time=self.last_path_materialization_time, + equipment=self.equipment, + asset_class=self.asset_class, + type_=self.type_, + existing_version=self.version, + type=self.type, ) @@ -2122,23 +3329,67 @@ def get_source(cls) -> ViewId: class CogniteCADRevisionApply(CogniteCADRevisionProperties, CogniteRevision3DApply): + """This represents the writing format of Cognite cad revision. + + It is used to when data is written to CDF. + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite cad revision. + status (Literal["Done", "Failed", "Processing", "Queued"] | None): The status field. + published (Literal["Done", "Failed", "Processing", "Queued"] | None): The published field. + type_ (Literal["CAD", "Image360", "PointCloud"] | None): The type field. + model_3d (DirectRelationReference | tuple[str, str] | None): . + revision_id (int | None): The 3D API revision identifier for this CAD model + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, status: Literal["Done", "Failed", "Processing", "Queued"] | None = None, published: Literal["Done", "Failed", "Processing", "Queued"] | None = None, type_: Literal["CAD", "Image360", "PointCloud"] | None = None, - model_3_d: DirectRelationReference | tuple[str, str] | None = None, + model_3d: DirectRelationReference | tuple[str, str] | None = None, revision_id: int | None = None, existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - super().__init__(space, external_id, status, published, type_, model_3_d, existing_version, type) + super().__init__( + space, + external_id, + status=status, + published=published, + type_=type_, + model_3d=model_3d, + existing_version=existing_version, + type=type, + ) self.revision_id = revision_id class CogniteCADRevision(CogniteCADRevisionProperties, CogniteRevision3D): + """This represents the reading format of Cognite cad revision. + + It is used to when data is read from CDF. + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite cad revision. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + status (Literal["Done", "Failed", "Processing", "Queued"] | None): The status field. + published (Literal["Done", "Failed", "Processing", "Queued"] | None): The published field. + type_ (Literal["CAD", "Image360", "PointCloud"] | None): The type field. + model_3d (DirectRelationReference | None): . + revision_id (int | None): The 3D API revision identifier for this CAD model + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -2146,10 +3397,11 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, status: Literal["Done", "Failed", "Processing", "Queued"] | None = None, published: Literal["Done", "Failed", "Processing", "Queued"] | None = None, type_: Literal["CAD", "Image360", "PointCloud"] | None = None, - model_3_d: DirectRelationReference | None = None, + model_3d: DirectRelationReference | None = None, revision_id: int | None = None, type: DirectRelationReference | None = None, deleted_time: int | None = None, @@ -2160,12 +3412,12 @@ def __init__( version, last_updated_time, created_time, - status, - published, - type_, - model_3_d, - type, - deleted_time, + status=status, + published=published, + type_=type_, + model_3d=model_3d, + type=type, + deleted_time=deleted_time, ) self.revision_id = revision_id @@ -2173,13 +3425,13 @@ def as_write(self) -> CogniteCADRevisionApply: return CogniteCADRevisionApply( self.space, self.external_id, - self.status, - self.published, - self.type_, - self.model_3_d, - self.revision_id, - self.version, - self.type, + status=self.status, + published=self.published, + type_=self.type_, + model_3d=self.model_3d, + revision_id=self.revision_id, + existing_version=self.version, + type=self.type, ) @@ -2192,10 +3444,32 @@ def get_source(cls) -> ViewId: class CogniteImage360CollectionApply( CogniteImage360CollectionProperties, CogniteDescribableNodeApply, CogniteRevision3DApply ): + """This represents the writing format of Cognite image 360 collection. + + It is used to when data is written to CDF. + + Represents a logical collection of CogniteImage360 instances + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite image 360 collection. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + status (Literal["Done", "Failed", "Processing", "Queued"] | None): The status field. + published (Literal["Done", "Failed", "Processing", "Queued"] | None): The published field. + type_ (Literal["CAD", "Image360", "PointCloud"] | None): The type field. + model_3d (DirectRelationReference | tuple[str, str] | None): The model 3D field. + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -2203,19 +3477,59 @@ def __init__( status: Literal["Done", "Failed", "Processing", "Queued"] | None = None, published: Literal["Done", "Failed", "Processing", "Queued"] | None = None, type_: Literal["CAD", "Image360", "PointCloud"] | None = None, - model_3_d: DirectRelationReference | tuple[str, str] | None = None, + model_3d: DirectRelationReference | tuple[str, str] | None = None, existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: CogniteDescribableNodeApply.__init__( - self, space, external_id, name, description, tags, aliases, existing_version, type + self, + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, + type=type, ) CogniteRevision3DApply.__init__( - self, space, external_id, status, published, type_, model_3_d, existing_version, type + self, + space, + external_id, + status=status, + published=published, + type_=type_, + model_3d=model_3d, + existing_version=existing_version, + type=type, ) class CogniteImage360Collection(CogniteImage360CollectionProperties, CogniteDescribableNode, CogniteRevision3D): + """This represents the reading format of Cognite image 360 collection. + + It is used to when data is read from CDF. + + Represents a logical collection of CogniteImage360 instances + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite image 360 collection. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + status (Literal["Done", "Failed", "Processing", "Queued"] | None): The status field. + published (Literal["Done", "Failed", "Processing", "Queued"] | None): The published field. + type_ (Literal["CAD", "Image360", "PointCloud"] | None): The type field. + model_3d (DirectRelationReference | None): The model 3D field. + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -2223,6 +3537,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -2230,7 +3545,7 @@ def __init__( status: Literal["Done", "Failed", "Processing", "Queued"] | None = None, published: Literal["Done", "Failed", "Processing", "Queued"] | None = None, type_: Literal["CAD", "Image360", "PointCloud"] | None = None, - model_3_d: DirectRelationReference | None = None, + model_3d: DirectRelationReference | None = None, type: DirectRelationReference | None = None, deleted_time: int | None = None, ) -> None: @@ -2241,12 +3556,12 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type=type, + deleted_time=deleted_time, ) CogniteRevision3D.__init__( self, @@ -2255,28 +3570,28 @@ def __init__( version, last_updated_time, created_time, - status, - published, - type_, - model_3_d, - type, - deleted_time, + status=status, + published=published, + type_=type_, + model_3d=model_3d, + type=type, + deleted_time=deleted_time, ) def as_write(self) -> CogniteImage360CollectionApply: return CogniteImage360CollectionApply( self.space, self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.status, - self.published, - self.type_, - self.model_3_d, - self.version, - self.type, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + status=self.status, + published=self.published, + type_=self.type_, + model_3d=self.model_3d, + existing_version=self.version, + type=self.type, ) @@ -2289,23 +3604,72 @@ def get_source(cls) -> ViewId: class CognitePointCloudRevisionApply(CognitePointCloudRevisionProperties, CogniteRevision3DApply): + """This represents the writing format of Cognite point cloud revision. + + It is used to when data is written to CDF. + + Navigational aid for traversing CognitePointCloudRevision instances + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite point cloud revision. + status (Literal["Done", "Failed", "Processing", "Queued"] | None): The status field. + published (Literal["Done", "Failed", "Processing", "Queued"] | None): The published field. + type_ (Literal["CAD", "Image360", "PointCloud"] | None): The type field. + model_3d (DirectRelationReference | tuple[str, str] | None): . + revision_id (int | None): The 3D API revision identifier for this PointCloud model + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, status: Literal["Done", "Failed", "Processing", "Queued"] | None = None, published: Literal["Done", "Failed", "Processing", "Queued"] | None = None, type_: Literal["CAD", "Image360", "PointCloud"] | None = None, - model_3_d: DirectRelationReference | tuple[str, str] | None = None, + model_3d: DirectRelationReference | tuple[str, str] | None = None, revision_id: int | None = None, existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - super().__init__(space, external_id, status, published, type_, model_3_d, existing_version, type) + super().__init__( + space, + external_id, + status=status, + published=published, + type_=type_, + model_3d=model_3d, + existing_version=existing_version, + type=type, + ) self.revision_id = revision_id class CognitePointCloudRevision(CognitePointCloudRevisionProperties, CogniteRevision3D): + """This represents the reading format of Cognite point cloud revision. + + It is used to when data is read from CDF. + + Navigational aid for traversing CognitePointCloudRevision instances + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite point cloud revision. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + status (Literal["Done", "Failed", "Processing", "Queued"] | None): The status field. + published (Literal["Done", "Failed", "Processing", "Queued"] | None): The published field. + type_ (Literal["CAD", "Image360", "PointCloud"] | None): The type field. + model_3d (DirectRelationReference | None): . + revision_id (int | None): The 3D API revision identifier for this PointCloud model + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -2313,10 +3677,11 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, status: Literal["Done", "Failed", "Processing", "Queued"] | None = None, published: Literal["Done", "Failed", "Processing", "Queued"] | None = None, type_: Literal["CAD", "Image360", "PointCloud"] | None = None, - model_3_d: DirectRelationReference | None = None, + model_3d: DirectRelationReference | None = None, revision_id: int | None = None, type: DirectRelationReference | None = None, deleted_time: int | None = None, @@ -2327,12 +3692,12 @@ def __init__( version, last_updated_time, created_time, - status, - published, - type_, - model_3_d, - type, - deleted_time, + status=status, + published=published, + type_=type_, + model_3d=model_3d, + type=type, + deleted_time=deleted_time, ) self.revision_id = revision_id @@ -2340,13 +3705,13 @@ def as_write(self) -> CognitePointCloudRevisionApply: return CognitePointCloudRevisionApply( self.space, self.external_id, - self.status, - self.published, - self.type_, - self.model_3_d, - self.revision_id, - self.version, - self.type, + status=self.status, + published=self.published, + type_=self.type_, + model_3d=self.model_3d, + revision_id=self.revision_id, + existing_version=self.version, + type=self.type, ) @@ -2361,10 +3726,39 @@ def get_source(cls) -> ViewId: class CogniteImage360Apply(CogniteImage360Properties, CogniteTransformation3DNodeApply, CogniteCubeMapApply): + """This represents the writing format of Cognite image 360. + + It is used to when data is written to CDF. + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite image 360. + translation_x (float | None): The displacement of the object along the X-axis in 3D space + translation_y (float | None): The displacement of the object along the Y-axis in 3D space + translation_z (float | None): The displacement of the object along the Z-axis in 3D space + euler_rotation_x (float | None): The rotation of the object around the X-axis, measured in degrees + euler_rotation_y (float | None): The rotation of the object around the Y-axis, measured in degrees + euler_rotation_z (float | None): The rotation of the object around the Z-axis, measured in degrees + scale_x (float | None): The scaling factor applied to the object along the X-axis + scale_y (float | None): The scaling factor applied to the object along the Y-axis + scale_z (float | None): The scaling factor applied to the object along the Z-axis + front (DirectRelationReference | tuple[str, str] | None): Direct relation to a file holding the front projection of the cube map + back (DirectRelationReference | tuple[str, str] | None): Direct relation to a file holding the back projection of the cube map + left (DirectRelationReference | tuple[str, str] | None): Direct relation to a file holding the left projection of the cube map + right (DirectRelationReference | tuple[str, str] | None): Direct relation to a file holding the right projection of the cube map + top (DirectRelationReference | tuple[str, str] | None): Direct relation to a file holding the top projection of the cube map + bottom (DirectRelationReference | tuple[str, str] | None): Direct relation to a file holding the bottom projection of the cube map + collection_360 (DirectRelationReference | tuple[str, str] | None): Direct relation to CogniteImage360Collection + station_360 (DirectRelationReference | tuple[str, str] | None): Direct relation to CogniteGroup3D instance that groups different CogniteImage360 instances to the same station + taken_at (datetime | None): The timestamp when the 6 photos were taken. + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, translation_x: float | None = None, translation_y: float | None = None, translation_z: float | None = None, @@ -2390,20 +3784,30 @@ def __init__( self, space, external_id, - translation_x, - translation_y, - translation_z, - euler_rotation_x, - euler_rotation_y, - euler_rotation_z, - scale_x, - scale_y, - scale_z, - existing_version, - type, + translation_x=translation_x, + translation_y=translation_y, + translation_z=translation_z, + euler_rotation_x=euler_rotation_x, + euler_rotation_y=euler_rotation_y, + euler_rotation_z=euler_rotation_z, + scale_x=scale_x, + scale_y=scale_y, + scale_z=scale_z, + existing_version=existing_version, + type=type, ) CogniteCubeMapApply.__init__( - self, space, external_id, front, back, left, right, top, bottom, existing_version, type + self, + space, + external_id, + front=front, + back=back, + left=left, + right=right, + top=top, + bottom=bottom, + existing_version=existing_version, + type=type, ) self.collection_360 = DirectRelationReference.load(collection_360) if collection_360 else None self.station_360 = DirectRelationReference.load(station_360) if station_360 else None @@ -2411,6 +3815,38 @@ def __init__( class CogniteImage360(CogniteImage360Properties, CogniteTransformation3DNode, CogniteCubeMap): + """This represents the reading format of Cognite image 360. + + It is used to when data is read from CDF. + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite image 360. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + translation_x (float | None): The displacement of the object along the X-axis in 3D space + translation_y (float | None): The displacement of the object along the Y-axis in 3D space + translation_z (float | None): The displacement of the object along the Z-axis in 3D space + euler_rotation_x (float | None): The rotation of the object around the X-axis, measured in degrees + euler_rotation_y (float | None): The rotation of the object around the Y-axis, measured in degrees + euler_rotation_z (float | None): The rotation of the object around the Z-axis, measured in degrees + scale_x (float | None): The scaling factor applied to the object along the X-axis + scale_y (float | None): The scaling factor applied to the object along the Y-axis + scale_z (float | None): The scaling factor applied to the object along the Z-axis + front (DirectRelationReference | None): Direct relation to a file holding the front projection of the cube map + back (DirectRelationReference | None): Direct relation to a file holding the back projection of the cube map + left (DirectRelationReference | None): Direct relation to a file holding the left projection of the cube map + right (DirectRelationReference | None): Direct relation to a file holding the right projection of the cube map + top (DirectRelationReference | None): Direct relation to a file holding the top projection of the cube map + bottom (DirectRelationReference | None): Direct relation to a file holding the bottom projection of the cube map + collection_360 (DirectRelationReference | None): Direct relation to CogniteImage360Collection + station_360 (DirectRelationReference | None): Direct relation to CogniteGroup3D instance that groups different CogniteImage360 instances to the same station + taken_at (datetime | None): The timestamp when the 6 photos were taken. + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -2418,6 +3854,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, translation_x: float | None = None, translation_y: float | None = None, translation_z: float | None = None, @@ -2446,17 +3883,17 @@ def __init__( version, last_updated_time, created_time, - translation_x, - translation_y, - translation_z, - euler_rotation_x, - euler_rotation_y, - euler_rotation_z, - scale_x, - scale_y, - scale_z, - type, - deleted_time, + translation_x=translation_x, + translation_y=translation_y, + translation_z=translation_z, + euler_rotation_x=euler_rotation_x, + euler_rotation_y=euler_rotation_y, + euler_rotation_z=euler_rotation_z, + scale_x=scale_x, + scale_y=scale_y, + scale_z=scale_z, + type=type, + deleted_time=deleted_time, ) CogniteCubeMap.__init__( self, @@ -2465,14 +3902,14 @@ def __init__( version, last_updated_time, created_time, - front, - back, - left, - right, - top, - bottom, - type, - deleted_time, + front=front, + back=back, + left=left, + right=right, + top=top, + bottom=bottom, + type=type, + deleted_time=deleted_time, ) self.collection_360 = DirectRelationReference.load(collection_360) if collection_360 else None self.station_360 = DirectRelationReference.load(station_360) if station_360 else None @@ -2482,26 +3919,26 @@ def as_write(self) -> CogniteImage360Apply: return CogniteImage360Apply( self.space, self.external_id, - self.translation_x, - self.translation_y, - self.translation_z, - self.euler_rotation_x, - self.euler_rotation_y, - self.euler_rotation_z, - self.scale_x, - self.scale_y, - self.scale_z, - self.front, - self.back, - self.left, - self.right, - self.top, - self.bottom, - self.collection_360, - self.station_360, - self.taken_at, - self.version, - self.type, + translation_x=self.translation_x, + translation_y=self.translation_y, + translation_z=self.translation_z, + euler_rotation_x=self.euler_rotation_x, + euler_rotation_y=self.euler_rotation_y, + euler_rotation_z=self.euler_rotation_z, + scale_x=self.scale_x, + scale_y=self.scale_y, + scale_z=self.scale_z, + front=self.front, + back=self.back, + left=self.left, + right=self.right, + top=self.top, + bottom=self.bottom, + collection_360=self.collection_360, + station_360=self.station_360, + taken_at=self.taken_at, + existing_version=self.version, + type=self.type, ) @@ -2512,10 +3949,29 @@ def get_source(cls) -> ViewId: class CogniteCADModelApply(CogniteCADModelProperties, CogniteModel3DApply): + """This represents the writing format of Cognite cad model. + + It is used to when data is written to CDF. + + Navigational aid for traversing CogniteCADModel instances + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite cad model. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + type_ (Literal["CAD", "Image360", "PointCloud"] | None): CAD, PointCloud or CogniteImage360 + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -2524,10 +3980,41 @@ def __init__( existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - super().__init__(space, external_id, name, description, tags, aliases, type_, existing_version, type) + super().__init__( + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + type_=type_, + existing_version=existing_version, + type=type, + ) class CogniteCADModel(CogniteCADModelProperties, CogniteModel3D): + """This represents the reading format of Cognite cad model. + + It is used to when data is read from CDF. + + Navigational aid for traversing CogniteCADModel instances + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite cad model. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + type_ (Literal["CAD", "Image360", "PointCloud"] | None): CAD, PointCloud or CogniteImage360 + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -2535,6 +4022,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -2549,26 +4037,26 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type_, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type_=type_, + type=type, + deleted_time=deleted_time, ) def as_write(self) -> CogniteCADModelApply: return CogniteCADModelApply( self.space, self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.type_, - self.version, - self.type, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + type_=self.type_, + existing_version=self.version, + type=self.type, ) @@ -2579,10 +4067,29 @@ def get_source(cls) -> ViewId: class CogniteImage360ModelApply(CogniteImage360ModelProperties, CogniteModel3DApply): + """This represents the writing format of Cognite image 360 model. + + It is used to when data is written to CDF. + + Navigational aid for traversing CogniteImage360Model instances + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite image 360 model. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + type_ (Literal["CAD", "Image360", "PointCloud"] | None): CAD, PointCloud or CogniteImage360 + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -2591,10 +4098,41 @@ def __init__( existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - super().__init__(space, external_id, name, description, tags, aliases, type_, existing_version, type) + super().__init__( + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + type_=type_, + existing_version=existing_version, + type=type, + ) class CogniteImage360Model(CogniteImage360ModelProperties, CogniteModel3D): + """This represents the reading format of Cognite image 360 model. + + It is used to when data is read from CDF. + + Navigational aid for traversing CogniteImage360Model instances + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite image 360 model. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + type_ (Literal["CAD", "Image360", "PointCloud"] | None): CAD, PointCloud or CogniteImage360 + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -2602,6 +4140,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -2616,26 +4155,26 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type_, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type_=type_, + type=type, + deleted_time=deleted_time, ) def as_write(self) -> CogniteImage360ModelApply: return CogniteImage360ModelApply( self.space, self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.type_, - self.version, - self.type, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + type_=self.type_, + existing_version=self.version, + type=self.type, ) @@ -2646,10 +4185,29 @@ def get_source(cls) -> ViewId: class CognitePointCloudModelApply(CognitePointCloudModelProperties, CogniteModel3DApply): + """This represents the writing format of Cognite point cloud model. + + It is used to when data is written to CDF. + + Navigational aid for traversing CognitePointCloudModel instances + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite point cloud model. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + type_ (Literal["CAD", "Image360", "PointCloud"] | None): CAD, PointCloud or CogniteImage360 + existing_version (int | None): Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the node (for the specified container or node). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + type (DirectRelationReference | tuple[str, str] | None): Direct relation pointing to the type node. + """ + def __init__( self, space: str, external_id: str, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -2658,10 +4216,41 @@ def __init__( existing_version: int | None = None, type: DirectRelationReference | tuple[str, str] | None = None, ) -> None: - super().__init__(space, external_id, name, description, tags, aliases, type_, existing_version, type) + super().__init__( + space, + external_id, + name=name, + description=description, + tags=tags, + aliases=aliases, + type_=type_, + existing_version=existing_version, + type=type, + ) class CognitePointCloudModel(CognitePointCloudModelProperties, CogniteModel3D): + """This represents the reading format of Cognite point cloud model. + + It is used to when data is read from CDF. + + Navigational aid for traversing CognitePointCloudModel instances + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite point cloud model. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + type_ (Literal["CAD", "Image360", "PointCloud"] | None): CAD, PointCloud or CogniteImage360 + type (DirectRelationReference | None): Direct relation pointing to the type node. + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -2669,6 +4258,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -2683,30 +4273,50 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - type_, - type, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + type_=type_, + type=type, + deleted_time=deleted_time, ) def as_write(self) -> CognitePointCloudModelApply: return CognitePointCloudModelApply( self.space, self.external_id, - self.name, - self.description, - self.tags, - self.aliases, - self.type_, - self.version, - self.type, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + type_=self.type_, + existing_version=self.version, + type=self.type, ) class CogniteDescribableEdgeApply(CogniteDescribableProperties, TypedEdgeApply): + """This represents the writing format of Cognite describable edge. + + It is used to when data is written to CDF. + + The describable core concept is used as a standard way of holding the bare minimum of information about the instance + + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite describable edge. + type (DirectRelationReference | tuple[str, str]): The type of edge. + start_node (DirectRelationReference | tuple[str, str]): Reference to the direct relation. The reference consists of a space and an external-id. + end_node (DirectRelationReference | tuple[str, str]): Reference to the direct relation. The reference consists of a space and an external-id. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + existing_version (int | None): Fail the ingestion request if the edge's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the edge (for the specified container or edge). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + """ + def __init__( self, space: str, @@ -2714,6 +4324,7 @@ def __init__( type: DirectRelationReference | tuple[str, str], start_node: DirectRelationReference | tuple[str, str], end_node: DirectRelationReference | tuple[str, str], + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -2728,6 +4339,29 @@ def __init__( class CogniteDescribableEdge(CogniteDescribableProperties, TypedEdge): + """This represents the reading format of Cognite describable edge. + + It is used to when data is read from CDF. + + The describable core concept is used as a standard way of holding the bare minimum of information about the instance + + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite describable edge. + type (DirectRelationReference): The type of edge. + start_node (DirectRelationReference): Reference to the direct relation. The reference consists of a space and an external-id. + end_node (DirectRelationReference): Reference to the direct relation. The reference consists of a space and an external-id. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -2738,6 +4372,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -2769,15 +4404,35 @@ def as_write(self) -> CogniteDescribableEdgeApply: self.type, self.start_node, self.end_node, - self.name, - self.description, - self.tags, - self.aliases, - self.version, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + existing_version=self.version, ) class CogniteSourceableEdgeApply(CogniteSourceableProperties, TypedEdgeApply): + """This represents the writing format of Cognite sourceable edge. + + It is used to when data is written to CDF. + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite sourceable edge. + type (DirectRelationReference | tuple[str, str]): The type of edge. + start_node (DirectRelationReference | tuple[str, str]): Reference to the direct relation. The reference consists of a space and an external-id. + end_node (DirectRelationReference | tuple[str, str]): Reference to the direct relation. The reference consists of a space and an external-id. + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | tuple[str, str] | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + existing_version (int | None): Fail the ingestion request if the edge's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the edge (for the specified container or edge). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + """ + def __init__( self, space: str, @@ -2785,6 +4440,7 @@ def __init__( type: DirectRelationReference | tuple[str, str], start_node: DirectRelationReference | tuple[str, str], end_node: DirectRelationReference | tuple[str, str], + *, source_id: str | None = None, source_context: str | None = None, source: DirectRelationReference | tuple[str, str] | None = None, @@ -2805,6 +4461,29 @@ def __init__( class CogniteSourceableEdge(CogniteSourceableProperties, TypedEdge): + """This represents the reading format of Cognite sourceable edge. + + It is used to when data is read from CDF. + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite sourceable edge. + type (DirectRelationReference): The type of edge. + start_node (DirectRelationReference): Reference to the direct relation. The reference consists of a space and an external-id. + end_node (DirectRelationReference): Reference to the direct relation. The reference consists of a space and an external-id. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -2815,6 +4494,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, source_id: str | None = None, source_context: str | None = None, source: DirectRelationReference | None = None, @@ -2852,18 +4532,43 @@ def as_write(self) -> CogniteSourceableEdgeApply: self.type, self.start_node, self.end_node, - self.source_id, - self.source_context, - self.source, - self.source_created_time, - self.source_updated_time, - self.source_created_user, - self.source_updated_user, - self.version, + source_id=self.source_id, + source_context=self.source_context, + source=self.source, + source_created_time=self.source_created_time, + source_updated_time=self.source_updated_time, + source_created_user=self.source_created_user, + source_updated_user=self.source_updated_user, + existing_version=self.version, ) class CogniteTransformation3DEdgeApply(CogniteTransformation3DProperties, TypedEdgeApply): + """This represents the writing format of Cognite transformation 3D edge. + + It is used to when data is written to CDF. + + The CogniteTransformation3D object defines a comprehensive 3D transformation, enabling precise adjustments to an object's position, orientation, and size in 3D space. It allows for the translation of objects along the three spatial axes, rotation around these axes using Euler angles, and scaling along each axis to modify the object's dimensions + + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite transformation 3D edge. + type (DirectRelationReference | tuple[str, str]): The type of edge. + start_node (DirectRelationReference | tuple[str, str]): Reference to the direct relation. The reference consists of a space and an external-id. + end_node (DirectRelationReference | tuple[str, str]): Reference to the direct relation. The reference consists of a space and an external-id. + translation_x (float | None): The displacement of the object along the X-axis in 3D space + translation_y (float | None): The displacement of the object along the Y-axis in 3D space + translation_z (float | None): The displacement of the object along the Z-axis in 3D space + euler_rotation_x (float | None): The rotation of the object around the X-axis, measured in degrees + euler_rotation_y (float | None): The rotation of the object around the Y-axis, measured in degrees + euler_rotation_z (float | None): The rotation of the object around the Z-axis, measured in degrees + scale_x (float | None): The scaling factor applied to the object along the X-axis + scale_y (float | None): The scaling factor applied to the object along the Y-axis + scale_z (float | None): The scaling factor applied to the object along the Z-axis + existing_version (int | None): Fail the ingestion request if the edge's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the edge (for the specified container or edge). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + """ + def __init__( self, space: str, @@ -2871,6 +4576,7 @@ def __init__( type: DirectRelationReference | tuple[str, str], start_node: DirectRelationReference | tuple[str, str], end_node: DirectRelationReference | tuple[str, str], + *, translation_x: float | None = None, translation_y: float | None = None, translation_z: float | None = None, @@ -2895,6 +4601,34 @@ def __init__( class CogniteTransformation3DEdge(CogniteTransformation3DProperties, TypedEdge): + """This represents the reading format of Cognite transformation 3D edge. + + It is used to when data is read from CDF. + + The CogniteTransformation3D object defines a comprehensive 3D transformation, enabling precise adjustments to an object's position, orientation, and size in 3D space. It allows for the translation of objects along the three spatial axes, rotation around these axes using Euler angles, and scaling along each axis to modify the object's dimensions + + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite transformation 3D edge. + type (DirectRelationReference): The type of edge. + start_node (DirectRelationReference): Reference to the direct relation. The reference consists of a space and an external-id. + end_node (DirectRelationReference): Reference to the direct relation. The reference consists of a space and an external-id. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + translation_x (float | None): The displacement of the object along the X-axis in 3D space + translation_y (float | None): The displacement of the object along the Y-axis in 3D space + translation_z (float | None): The displacement of the object along the Z-axis in 3D space + euler_rotation_x (float | None): The rotation of the object around the X-axis, measured in degrees + euler_rotation_y (float | None): The rotation of the object around the Y-axis, measured in degrees + euler_rotation_z (float | None): The rotation of the object around the Z-axis, measured in degrees + scale_x (float | None): The scaling factor applied to the object along the X-axis + scale_y (float | None): The scaling factor applied to the object along the Y-axis + scale_z (float | None): The scaling factor applied to the object along the Z-axis + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -2905,6 +4639,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, translation_x: float | None = None, translation_y: float | None = None, translation_z: float | None = None, @@ -2946,16 +4681,16 @@ def as_write(self) -> CogniteTransformation3DEdgeApply: self.type, self.start_node, self.end_node, - self.translation_x, - self.translation_y, - self.translation_z, - self.euler_rotation_x, - self.euler_rotation_y, - self.euler_rotation_z, - self.scale_x, - self.scale_y, - self.scale_z, - self.version, + translation_x=self.translation_x, + translation_y=self.translation_y, + translation_z=self.translation_z, + euler_rotation_x=self.euler_rotation_x, + euler_rotation_y=self.euler_rotation_y, + euler_rotation_z=self.euler_rotation_z, + scale_x=self.scale_x, + scale_y=self.scale_y, + scale_z=self.scale_z, + existing_version=self.version, ) @@ -2966,6 +4701,34 @@ def get_source(cls) -> ViewId: class CogniteAnnotationApply(CogniteAnnotationProperties, CogniteDescribableEdgeApply, CogniteSourceableEdgeApply): + """This represents the writing format of Cognite annotation. + + It is used to when data is written to CDF. + + Annotation represents contextualization results or links + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite annotation. + type (DirectRelationReference | tuple[str, str]): The type of edge. + start_node (DirectRelationReference | tuple[str, str]): Reference to the direct relation. The reference consists of a space and an external-id. + end_node (DirectRelationReference | tuple[str, str]): Reference to the direct relation. The reference consists of a space and an external-id. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | tuple[str, str] | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + confidence (float | None): The confidence that the annotation is a good match + status (Literal["Approved", "Rejected", "Suggested"] | None): The confidence that the annotation is a good match + existing_version (int | None): Fail the ingestion request if the edge's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the edge (for the specified container or edge). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + """ + def __init__( self, space: str, @@ -2973,6 +4736,7 @@ def __init__( type: DirectRelationReference | tuple[str, str], start_node: DirectRelationReference | tuple[str, str], end_node: DirectRelationReference | tuple[str, str], + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -2989,7 +4753,17 @@ def __init__( existing_version: int | None = None, ) -> None: CogniteDescribableEdgeApply.__init__( - self, space, external_id, type, start_node, end_node, name, description, tags, aliases, existing_version + self, + space, + external_id, + type, + start_node, + end_node, + name=name, + description=description, + tags=tags, + aliases=aliases, + existing_version=existing_version, ) CogniteSourceableEdgeApply.__init__( self, @@ -2998,20 +4772,51 @@ def __init__( type, start_node, end_node, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - existing_version, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + existing_version=existing_version, ) self.confidence = confidence self.status = status class CogniteAnnotation(CogniteAnnotationProperties, CogniteDescribableEdge, CogniteSourceableEdge): + """This represents the reading format of Cognite annotation. + + It is used to when data is read from CDF. + + Annotation represents contextualization results or links + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite annotation. + type (DirectRelationReference): The type of edge. + start_node (DirectRelationReference): Reference to the direct relation. The reference consists of a space and an external-id. + end_node (DirectRelationReference): Reference to the direct relation. The reference consists of a space and an external-id. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + confidence (float | None): The confidence that the annotation is a good match + status (Literal["Approved", "Rejected", "Suggested"] | None): The confidence that the annotation is a good match + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -3022,6 +4827,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -3047,11 +4853,11 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + deleted_time=deleted_time, ) CogniteSourceableEdge.__init__( self, @@ -3063,14 +4869,14 @@ def __init__( version, last_updated_time, created_time, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - deleted_time, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + deleted_time=deleted_time, ) self.confidence = confidence self.status = status @@ -3082,20 +4888,20 @@ def as_write(self) -> CogniteAnnotationApply: self.type, self.start_node, self.end_node, - self.name, - self.description, - self.tags, - self.aliases, - self.source_id, - self.source_context, - self.source, - self.source_created_time, - self.source_updated_time, - self.source_created_user, - self.source_updated_user, - self.confidence, - self.status, - self.version, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + source_id=self.source_id, + source_context=self.source_context, + source=self.source, + source_created_time=self.source_created_time, + source_updated_time=self.source_updated_time, + source_created_user=self.source_created_user, + source_updated_user=self.source_updated_user, + confidence=self.confidence, + status=self.status, + existing_version=self.version, ) @@ -3119,6 +4925,46 @@ def get_source(cls) -> ViewId: class CogniteDiagramAnnotationApply(CogniteDiagramAnnotationProperties, CogniteAnnotationApply): + """This represents the writing format of Cognite diagram annotation. + + It is used to when data is written to CDF. + + Annotation for diagrams + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite diagram annotation. + type (DirectRelationReference | tuple[str, str]): The type of edge. + start_node (DirectRelationReference | tuple[str, str]): Reference to the direct relation. The reference consists of a space and an external-id. + end_node (DirectRelationReference | tuple[str, str]): Reference to the direct relation. The reference consists of a space and an external-id. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | tuple[str, str] | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + confidence (float | None): The confidence that the annotation is a good match + status (Literal["Approved", "Rejected", "Suggested"] | None): The confidence that the annotation is a good match + start_node_page_number (int | None): The number of the page on which this annotation is located in `startNode` File. The first page has number 1 + end_node_page_number (int | None): The number of the page on which this annotation is located in the endNode File if an endNode is present. The first page has number 1 + start_node_x_min (float | None): Value between [0,1]. Minimum abscissa of the bounding box (left edge). Must be strictly less than startNodeXMax + start_node_x_max (float | None): Value between [0,1]. Maximum abscissa of the bounding box (right edge). Must be strictly more than startNodeXMin + start_node_y_min (float | None): Value between [0,1]. Minimum ordinate of the bounding box (bottom edge). Must be strictly less than startNodeYMax + start_node_y_max (float | None): Value between [0,1]. Maximum ordinate of the bounding box (top edge). Must be strictly more than startNodeYMin + start_node_text (str | None): The text extracted from within the bounding box on the startNode + end_node_x_min (float | None): Value between [0,1]. Minimum abscissa of the bounding box (left edge). Must be strictly less than endNodeXMax. Only applicable if an endNode is defined + end_node_x_max (float | None): Value between [0,1]. Maximum abscissa of the bounding box (right edge). Must be strictly more than endNodeXMin. Only applicable if an endNode is defined + end_node_y_min (float | None): Value between [0,1]. Minimum ordinate of the bounding box (bottom edge). Must be strictly less than endNodeYMax. Only applicable if an endNode is defined + end_node_y_max (float | None): Value between [0,1]. Maximum ordinate of the bounding box (top edge). Must be strictly more than endNodeYMin. Only applicable if an endNode is defined + end_node_text (str | None): The text extracted from within the bounding box on the endNode. Only applicable if an endNode is defined + existing_version (int | None): Fail the ingestion request if the edge's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the edge (for the specified container or edge). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + """ + def __init__( self, space: str, @@ -3126,6 +4972,7 @@ def __init__( type: DirectRelationReference | tuple[str, str], start_node: DirectRelationReference | tuple[str, str], end_node: DirectRelationReference | tuple[str, str], + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -3159,20 +5006,20 @@ def __init__( type, start_node, end_node, - name, - description, - tags, - aliases, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - confidence, - status, - existing_version, + name=name, + description=description, + tags=tags, + aliases=aliases, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + confidence=confidence, + status=status, + existing_version=existing_version, ) self.start_node_page_number = start_node_page_number self.end_node_page_number = end_node_page_number @@ -3189,6 +5036,49 @@ def __init__( class CogniteDiagramAnnotation(CogniteDiagramAnnotationProperties, CogniteAnnotation): + """This represents the reading format of Cognite diagram annotation. + + It is used to when data is read from CDF. + + Annotation for diagrams + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite diagram annotation. + type (DirectRelationReference): The type of edge. + start_node (DirectRelationReference): Reference to the direct relation. The reference consists of a space and an external-id. + end_node (DirectRelationReference): Reference to the direct relation. The reference consists of a space and an external-id. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + confidence (float | None): The confidence that the annotation is a good match + status (Literal["Approved", "Rejected", "Suggested"] | None): The confidence that the annotation is a good match + start_node_page_number (int | None): The number of the page on which this annotation is located in `startNode` File. The first page has number 1 + end_node_page_number (int | None): The number of the page on which this annotation is located in the endNode File if an endNode is present. The first page has number 1 + start_node_x_min (float | None): Value between [0,1]. Minimum abscissa of the bounding box (left edge). Must be strictly less than startNodeXMax + start_node_x_max (float | None): Value between [0,1]. Maximum abscissa of the bounding box (right edge). Must be strictly more than startNodeXMin + start_node_y_min (float | None): Value between [0,1]. Minimum ordinate of the bounding box (bottom edge). Must be strictly less than startNodeYMax + start_node_y_max (float | None): Value between [0,1]. Maximum ordinate of the bounding box (top edge). Must be strictly more than startNodeYMin + start_node_text (str | None): The text extracted from within the bounding box on the startNode + end_node_x_min (float | None): Value between [0,1]. Minimum abscissa of the bounding box (left edge). Must be strictly less than endNodeXMax. Only applicable if an endNode is defined + end_node_x_max (float | None): Value between [0,1]. Maximum abscissa of the bounding box (right edge). Must be strictly more than endNodeXMin. Only applicable if an endNode is defined + end_node_y_min (float | None): Value between [0,1]. Minimum ordinate of the bounding box (bottom edge). Must be strictly less than endNodeYMax. Only applicable if an endNode is defined + end_node_y_max (float | None): Value between [0,1]. Maximum ordinate of the bounding box (top edge). Must be strictly more than endNodeYMin. Only applicable if an endNode is defined + end_node_text (str | None): The text extracted from within the bounding box on the endNode. Only applicable if an endNode is defined + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -3199,6 +5089,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -3235,20 +5126,20 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - confidence, - status, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + confidence=confidence, + status=status, + deleted_time=deleted_time, ) self.start_node_page_number = start_node_page_number self.end_node_page_number = end_node_page_number @@ -3270,32 +5161,32 @@ def as_write(self) -> CogniteDiagramAnnotationApply: self.type, self.start_node, self.end_node, - self.name, - self.description, - self.tags, - self.aliases, - self.source_id, - self.source_context, - self.source, - self.source_created_time, - self.source_updated_time, - self.source_created_user, - self.source_updated_user, - self.confidence, - self.status, - self.start_node_page_number, - self.end_node_page_number, - self.start_node_x_min, - self.start_node_x_max, - self.start_node_y_min, - self.start_node_y_max, - self.start_node_text, - self.end_node_x_min, - self.end_node_x_max, - self.end_node_y_min, - self.end_node_y_max, - self.end_node_text, - self.version, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + source_id=self.source_id, + source_context=self.source_context, + source=self.source, + source_created_time=self.source_created_time, + source_updated_time=self.source_updated_time, + source_created_user=self.source_created_user, + source_updated_user=self.source_updated_user, + confidence=self.confidence, + status=self.status, + start_node_page_number=self.start_node_page_number, + end_node_page_number=self.end_node_page_number, + start_node_x_min=self.start_node_x_min, + start_node_x_max=self.start_node_x_max, + start_node_y_min=self.start_node_y_min, + start_node_y_max=self.start_node_y_max, + start_node_text=self.start_node_text, + end_node_x_min=self.end_node_x_min, + end_node_x_max=self.end_node_x_max, + end_node_y_min=self.end_node_y_min, + end_node_y_max=self.end_node_y_max, + end_node_text=self.end_node_text, + existing_version=self.version, ) @@ -3308,6 +5199,34 @@ def get_source(cls) -> ViewId: class CogniteImage360AnnotationApply(CogniteImage360AnnotationProperties, CogniteAnnotationApply): + """This represents the writing format of Cognite image 360 annotation. + + It is used to when data is written to CDF. + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite image 360 annotation. + type (DirectRelationReference | tuple[str, str]): The type of edge. + start_node (DirectRelationReference | tuple[str, str]): Reference to the direct relation. The reference consists of a space and an external-id. + end_node (DirectRelationReference | tuple[str, str]): Reference to the direct relation. The reference consists of a space and an external-id. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | tuple[str, str] | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + confidence (float | None): The confidence that the annotation is a good match + status (Literal["Approved", "Rejected", "Suggested"] | None): The confidence that the annotation is a good match + polygon (list[float] | None): List of floats representing the polygon. Format depends on formatVersion + format_version (str | None): Specifies the storage representation for the polygon property + existing_version (int | None): Fail the ingestion request if the edge's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the edge (for the specified container or edge). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. + """ + def __init__( self, space: str, @@ -3315,6 +5234,7 @@ def __init__( type: DirectRelationReference | tuple[str, str], start_node: DirectRelationReference | tuple[str, str], end_node: DirectRelationReference | tuple[str, str], + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -3338,26 +5258,57 @@ def __init__( type, start_node, end_node, - name, - description, - tags, - aliases, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - confidence, - status, - existing_version, + name=name, + description=description, + tags=tags, + aliases=aliases, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + confidence=confidence, + status=status, + existing_version=existing_version, ) self.polygon = polygon self.format_version = format_version class CogniteImage360Annotation(CogniteImage360AnnotationProperties, CogniteAnnotation): + """This represents the reading format of Cognite image 360 annotation. + + It is used to when data is read from CDF. + + Args: + space (str): The space where the node is located. + external_id (str): The external id of the Cognite image 360 annotation. + type (DirectRelationReference): The type of edge. + start_node (DirectRelationReference): Reference to the direct relation. The reference consists of a space and an external-id. + end_node (DirectRelationReference): Reference to the direct relation. The reference consists of a space and an external-id. + version (int): DMS version. + last_updated_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + created_time (int): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. + name (str | None): Name of the instance + description (str | None): Description of the instance + tags (list[str] | None): Text based labels for generic use, limited to 1000 + aliases (list[str] | None): Alternative names for the node + source_id (str | None): Identifier from the source system + source_context (str | None): Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set. + source (DirectRelationReference | None): Direct relation to a source system + source_created_time (datetime | None): When the instance was created in source system (if available) + source_updated_time (datetime | None): When the instance was last updated in the source system (if available) + source_created_user (str | None): User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF + source_updated_user (str | None): User identifier from the source system on who last updated the source data. This identifier is not guaranteed to match the user identifiers in CDF + confidence (float | None): The confidence that the annotation is a good match + status (Literal["Approved", "Rejected", "Suggested"] | None): The confidence that the annotation is a good match + polygon (list[float] | None): List of floats representing the polygon. Format depends on formatVersion + format_version (str | None): Specifies the storage representation for the polygon property + deleted_time (int | None): The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. Timestamp when the instance was soft deleted. Note that deleted instances are filtered out of query results, but present in sync results + """ + def __init__( self, space: str, @@ -3368,6 +5319,7 @@ def __init__( version: int, last_updated_time: int, created_time: int, + *, name: str | None = None, description: str | None = None, tags: list[str] | None = None, @@ -3394,20 +5346,20 @@ def __init__( version, last_updated_time, created_time, - name, - description, - tags, - aliases, - source_id, - source_context, - source, - source_created_time, - source_updated_time, - source_created_user, - source_updated_user, - confidence, - status, - deleted_time, + name=name, + description=description, + tags=tags, + aliases=aliases, + source_id=source_id, + source_context=source_context, + source=source, + source_created_time=source_created_time, + source_updated_time=source_updated_time, + source_created_user=source_created_user, + source_updated_user=source_updated_user, + confidence=confidence, + status=status, + deleted_time=deleted_time, ) self.polygon = polygon self.format_version = format_version @@ -3419,20 +5371,20 @@ def as_write(self) -> CogniteImage360AnnotationApply: self.type, self.start_node, self.end_node, - self.name, - self.description, - self.tags, - self.aliases, - self.source_id, - self.source_context, - self.source, - self.source_created_time, - self.source_updated_time, - self.source_created_user, - self.source_updated_user, - self.confidence, - self.status, - self.polygon, - self.format_version, - self.version, + name=self.name, + description=self.description, + tags=self.tags, + aliases=self.aliases, + source_id=self.source_id, + source_context=self.source_context, + source=self.source, + source_created_time=self.source_created_time, + source_updated_time=self.source_updated_time, + source_created_user=self.source_created_user, + source_updated_user=self.source_updated_user, + confidence=self.confidence, + status=self.status, + polygon=self.polygon, + format_version=self.format_version, + existing_version=self.version, ) diff --git a/pyproject.toml b/pyproject.toml index 26a2ec7b0..8f0a073a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "cognite-sdk" -version = "7.54.8" +version = "7.54.9" description = "Cognite Python SDK" readme = "README.md" documentation = "https://cognite-sdk-python.readthedocs-hosted.com" diff --git a/scripts/generate_core_model.py b/scripts/generate_core_model.py new file mode 100644 index 000000000..afa377f55 --- /dev/null +++ b/scripts/generate_core_model.py @@ -0,0 +1,26 @@ +"""This script requires pygen to be installed. It generates typed classes for the core data model v1. + +`pip install cognite-pygen==0.99.28` + +Note that `pygen` requires `Python 3.9` or later`, so if you develop in an older version of Python, +you need to run this script in a Python 3.9 environment. +""" + +from pathlib import Path + +from cognite.pygen._generator import generate_typed +from tests.tests_integration.conftest import make_cognite_client + +THIS_REPO = Path(__file__).resolve().parent.parent + +OUTPUT_FILE = THIS_REPO / "cognite" / "client" / "data_classes" / "cdm" / "v1.py" + + +def main() -> None: + client = make_cognite_client(beta=False) + + generate_typed(("cdf_cdm_experimental", "core_data_model", "v1"), OUTPUT_FILE, client, format_code=False) + + +if __name__ == "__main__": + main()