Skip to content

CogniteCore Data Classes

examples.cognite_core.data_classes

Cognite360Image

Bases: Cognite3DTransformationNode, CogniteCubeMap

This represents the reading version of Cognite 360 image.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 360 image.

required
data_record

The data record of the Cognite 360 image node.

required
back

Direct relation to a file holding the back projection of the cube map

required
bottom

Direct relation to a file holding the bottom projection of the cube map

required
collection_360

Direct relation to Cognite360ImageCollection

required
euler_rotation_x

The rotation of the object around the X-axis in radians

required
euler_rotation_y

The rotation of the object around the Y-axis in radians

required
euler_rotation_z

The rotation of the object around the Z-axis in radians

required
front

Direct relation to a file holding the front projection of the cube map

required
left

Direct relation to a file holding the left projection of the cube map

required
right

Direct relation to a file holding the right projection of the cube map

required
scale_x

The scaling factor applied to the object along the X-axis

required
scale_y

The scaling factor applied to the object along the Y-axis

required
scale_z

The scaling factor applied to the object along the Z-axis

required
station_360

Direct relation to Cognite3DGroup instance that groups different Cognite360Image instances to the same station

required
taken_at

The timestamp when the 6 photos were taken

required
top

Direct relation to a file holding the top projection of the cube map

required
translation_x

The displacement of the object along the X-axis in the 3D coordinate system

required
translation_y

The displacement of the object along the Y-axis in the 3D coordinate system

required
translation_z

The displacement of the object along the Z-axis in the 3D coordinate system

required
Source code in examples/cognite_core/data_classes/_cognite_360_image.py
class Cognite360Image(Cognite3DTransformationNode, CogniteCubeMap):
    """This represents the reading version of Cognite 360 image.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 360 image.
        data_record: The data record of the Cognite 360 image node.
        back: Direct relation to a file holding the back projection of the cube map
        bottom: Direct relation to a file holding the bottom projection of the cube map
        collection_360: Direct relation to Cognite360ImageCollection
        euler_rotation_x: The rotation of the object around the X-axis in radians
        euler_rotation_y: The rotation of the object around the Y-axis in radians
        euler_rotation_z: The rotation of the object around the Z-axis in radians
        front: Direct relation to a file holding the front projection of the cube map
        left: Direct relation to a file holding the left projection of the cube map
        right: Direct relation to a file holding the right projection of the cube map
        scale_x: The scaling factor applied to the object along the X-axis
        scale_y: The scaling factor applied to the object along the Y-axis
        scale_z: The scaling factor applied to the object along the Z-axis
        station_360: Direct relation to Cognite3DGroup instance that groups different Cognite360Image instances to the
            same station
        taken_at: The timestamp when the 6 photos were taken
        top: Direct relation to a file holding the top projection of the cube map
        translation_x: The displacement of the object along the X-axis in the 3D coordinate system
        translation_y: The displacement of the object along the Y-axis in the 3D coordinate system
        translation_z: The displacement of the object along the Z-axis in the 3D coordinate system
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite360Image", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    collection_360: Union[Cognite360ImageCollection, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="collection360"
    )
    station_360: Union[Cognite360ImageStation, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="station360"
    )
    taken_at: Optional[datetime.datetime] = Field(None, alias="takenAt")

    @field_validator("back", "bottom", "collection_360", "front", "left", "right", "station_360", "top", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    def as_write(self) -> Cognite360ImageWrite:
        """Convert this read version of Cognite 360 image to the writing version."""
        return Cognite360ImageWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite 360 image to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_360_image.py
def as_write(self) -> Cognite360ImageWrite:
    """Convert this read version of Cognite 360 image to the writing version."""
    return Cognite360ImageWrite.model_validate(as_write_args(self))

Cognite360ImageAnnotation

Bases: CogniteAnnotation

This represents the reading version of Cognite 360 image annotation.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 360 image annotation.

required
data_record

The data record of the Cognite 360 image annotation edge.

required
end_node

The end node of this edge.

required
aliases

Alternative names for the node

required
confidence

The confidence that the annotation is a good match

required
description

Description of the instance

required
format_version

Specifies the storage representation for the polygon

required
name

Name of the instance

required
polygon

List of floats representing the polygon. Format depends on formatVersion

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
status

The status of the annotation

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_360_image_annotation.py
class Cognite360ImageAnnotation(CogniteAnnotation):
    """This represents the reading version of Cognite 360 image annotation.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 360 image annotation.
        data_record: The data record of the Cognite 360 image annotation edge.
        end_node: The end node of this edge.
        aliases: Alternative names for the node
        confidence: The confidence that the annotation is a good match
        description: Description of the instance
        format_version: Specifies the storage representation for the polygon
        name: Name of the instance
        polygon: List of floats representing the polygon. Format depends on formatVersion
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        status: The status of the annotation
        tags: Text based labels for generic use, limited to 1000
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite360ImageAnnotation", "v1")
    space: str = DEFAULT_INSTANCE_SPACE
    format_version: Optional[str] = Field(None, alias="formatVersion")
    polygon: Optional[list[float]] = None

    def as_write(self) -> Cognite360ImageAnnotationWrite:
        """Convert this read version of Cognite 360 image annotation to the writing version."""
        return Cognite360ImageAnnotationWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite 360 image annotation to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_360_image_annotation.py
def as_write(self) -> Cognite360ImageAnnotationWrite:
    """Convert this read version of Cognite 360 image annotation to the writing version."""
    return Cognite360ImageAnnotationWrite.model_validate(as_write_args(self))

Cognite360ImageAnnotationGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite 360 image annotation, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 360 image annotation.

required
data_record

The data record of the Cognite 360 image annotation node.

required
end_node

The end node of this edge.

required
aliases

Alternative names for the node

required
confidence

The confidence that the annotation is a good match

required
description

Description of the instance

required
format_version

Specifies the storage representation for the polygon

required
name

Name of the instance

required
polygon

List of floats representing the polygon. Format depends on formatVersion

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
status

The status of the annotation

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_360_image_annotation.py
class Cognite360ImageAnnotationGraphQL(GraphQLCore):
    """This represents the reading version of Cognite 360 image annotation, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 360 image annotation.
        data_record: The data record of the Cognite 360 image annotation node.
        end_node: The end node of this edge.
        aliases: Alternative names for the node
        confidence: The confidence that the annotation is a good match
        description: Description of the instance
        format_version: Specifies the storage representation for the polygon
        name: Name of the instance
        polygon: List of floats representing the polygon. Format depends on formatVersion
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        status: The status of the annotation
        tags: Text based labels for generic use, limited to 1000
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite360ImageAnnotation", "v1")
    end_node: Union[Cognite360ImageGraphQL, None] = Field(None, alias="endNode")
    aliases: Optional[list[str]] = None
    confidence: Optional[float] = None
    description: Optional[str] = None
    format_version: Optional[str] = Field(None, alias="formatVersion")
    name: Optional[str] = None
    polygon: Optional[list[float]] = None
    source: Optional[CogniteSourceSystemGraphQL] = Field(default=None, repr=False)
    source_context: Optional[str] = Field(None, alias="sourceContext")
    source_created_time: Optional[datetime.datetime] = Field(None, alias="sourceCreatedTime")
    source_created_user: Optional[str] = Field(None, alias="sourceCreatedUser")
    source_id: Optional[str] = Field(None, alias="sourceId")
    source_updated_time: Optional[datetime.datetime] = Field(None, alias="sourceUpdatedTime")
    source_updated_user: Optional[str] = Field(None, alias="sourceUpdatedUser")
    status: Optional[Literal["Approved", "Rejected", "Suggested"]] = None
    tags: Optional[list[str]] = None

    def as_read(self) -> Cognite360ImageAnnotation:
        """Convert this GraphQL format of Cognite 360 image annotation to the reading format."""
        return Cognite360ImageAnnotation.model_validate(as_read_args(self))

    def as_write(self) -> Cognite360ImageAnnotationWrite:
        """Convert this GraphQL format of Cognite 360 image annotation to the writing format."""
        return Cognite360ImageAnnotationWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite 360 image annotation to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_360_image_annotation.py
def as_read(self) -> Cognite360ImageAnnotation:
    """Convert this GraphQL format of Cognite 360 image annotation to the reading format."""
    return Cognite360ImageAnnotation.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite 360 image annotation to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_360_image_annotation.py
def as_write(self) -> Cognite360ImageAnnotationWrite:
    """Convert this GraphQL format of Cognite 360 image annotation to the writing format."""
    return Cognite360ImageAnnotationWrite.model_validate(as_write_args(self))

Cognite360ImageAnnotationList

Bases: DomainRelationList[Cognite360ImageAnnotation]

List of Cognite 360 image annotations in the reading version.

Source code in examples/cognite_core/data_classes/_cognite_360_image_annotation.py
class Cognite360ImageAnnotationList(DomainRelationList[Cognite360ImageAnnotation]):
    """List of Cognite 360 image annotations in the reading version."""

    _INSTANCE = Cognite360ImageAnnotation

    def as_write(self) -> Cognite360ImageAnnotationWriteList:
        """Convert this read version of Cognite 360 image annotation list to the writing version."""
        return Cognite360ImageAnnotationWriteList([edge.as_write() for edge in self])

as_write()

Convert this read version of Cognite 360 image annotation list to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_360_image_annotation.py
def as_write(self) -> Cognite360ImageAnnotationWriteList:
    """Convert this read version of Cognite 360 image annotation list to the writing version."""
    return Cognite360ImageAnnotationWriteList([edge.as_write() for edge in self])

Cognite360ImageAnnotationWrite

Bases: CogniteAnnotationWrite

This represents the writing version of Cognite 360 image annotation.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 360 image annotation.

required
data_record

The data record of the Cognite 360 image annotation edge.

required
end_node

The end node of this edge.

required
aliases

Alternative names for the node

required
confidence

The confidence that the annotation is a good match

required
description

Description of the instance

required
format_version

Specifies the storage representation for the polygon

required
name

Name of the instance

required
polygon

List of floats representing the polygon. Format depends on formatVersion

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
status

The status of the annotation

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_360_image_annotation.py
class Cognite360ImageAnnotationWrite(CogniteAnnotationWrite):
    """This represents the writing version of Cognite 360 image annotation.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 360 image annotation.
        data_record: The data record of the Cognite 360 image annotation edge.
        end_node: The end node of this edge.
        aliases: Alternative names for the node
        confidence: The confidence that the annotation is a good match
        description: Description of the instance
        format_version: Specifies the storage representation for the polygon
        name: Name of the instance
        polygon: List of floats representing the polygon. Format depends on formatVersion
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        status: The status of the annotation
        tags: Text based labels for generic use, limited to 1000
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "confidence",
        "description",
        "format_version",
        "name",
        "polygon",
        "source",
        "source_context",
        "source_created_time",
        "source_created_user",
        "source_id",
        "source_updated_time",
        "source_updated_user",
        "status",
        "tags",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = ("source",)
    _validate_end_node = _validate_end_node

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite360ImageAnnotation", "v1")
    format_version: Optional[str] = Field(None, alias="formatVersion")
    polygon: Optional[list[float]] = None

Cognite360ImageAnnotationWriteList

Bases: DomainRelationWriteList[Cognite360ImageAnnotationWrite]

List of Cognite 360 image annotations in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_360_image_annotation.py
class Cognite360ImageAnnotationWriteList(DomainRelationWriteList[Cognite360ImageAnnotationWrite]):
    """List of Cognite 360 image annotations in the writing version."""

    _INSTANCE = Cognite360ImageAnnotationWrite

Cognite360ImageCollection

Bases: CogniteDescribableNode, Cognite3DRevision

This represents the reading version of Cognite 360 image collection.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 360 image collection.

required
data_record

The data record of the Cognite 360 image collection node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
model_3d

The model 3d field.

required
name

Name of the instance

required
published

The published field.

required
status

The status field.

required
tags

Text based labels for generic use, limited to 1000

required
type_

The type field.

required
Source code in examples/cognite_core/data_classes/_cognite_360_image_collection.py
class Cognite360ImageCollection(CogniteDescribableNode, Cognite3DRevision, protected_namespaces=()):
    """This represents the reading version of Cognite 360 image collection.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 360 image collection.
        data_record: The data record of the Cognite 360 image collection node.
        aliases: Alternative names for the node
        description: Description of the instance
        model_3d: The model 3d field.
        name: Name of the instance
        published: The published field.
        status: The status field.
        tags: Text based labels for generic use, limited to 1000
        type_: The type field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite360ImageCollection", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None

    @field_validator("model_3d", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    def as_write(self) -> Cognite360ImageCollectionWrite:
        """Convert this read version of Cognite 360 image collection to the writing version."""
        return Cognite360ImageCollectionWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite 360 image collection to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_360_image_collection.py
def as_write(self) -> Cognite360ImageCollectionWrite:
    """Convert this read version of Cognite 360 image collection to the writing version."""
    return Cognite360ImageCollectionWrite.model_validate(as_write_args(self))

Cognite360ImageCollectionGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite 360 image collection, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 360 image collection.

required
data_record

The data record of the Cognite 360 image collection node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
model_3d

The model 3d field.

required
name

Name of the instance

required
published

The published field.

required
status

The status field.

required
tags

Text based labels for generic use, limited to 1000

required
type_

The type field.

required
Source code in examples/cognite_core/data_classes/_cognite_360_image_collection.py
class Cognite360ImageCollectionGraphQL(GraphQLCore, protected_namespaces=()):
    """This represents the reading version of Cognite 360 image collection, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 360 image collection.
        data_record: The data record of the Cognite 360 image collection node.
        aliases: Alternative names for the node
        description: Description of the instance
        model_3d: The model 3d field.
        name: Name of the instance
        published: The published field.
        status: The status field.
        tags: Text based labels for generic use, limited to 1000
        type_: The type field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite360ImageCollection", "v1")
    aliases: Optional[list[str]] = None
    description: Optional[str] = None
    model_3d: Optional[Cognite360ImageModelGraphQL] = Field(default=None, repr=False, alias="model3D")
    name: Optional[str] = None
    published: Optional[bool] = None
    status: Optional[Literal["Done", "Failed", "Processing", "Queued"]] = None
    tags: Optional[list[str]] = None
    type_: Optional[Literal["CAD", "Image360", "PointCloud"]] = Field(None, alias="type")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("model_3d", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> Cognite360ImageCollection:
        """Convert this GraphQL format of Cognite 360 image collection to the reading format."""
        return Cognite360ImageCollection.model_validate(as_read_args(self))

    def as_write(self) -> Cognite360ImageCollectionWrite:
        """Convert this GraphQL format of Cognite 360 image collection to the writing format."""
        return Cognite360ImageCollectionWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite 360 image collection to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_360_image_collection.py
def as_read(self) -> Cognite360ImageCollection:
    """Convert this GraphQL format of Cognite 360 image collection to the reading format."""
    return Cognite360ImageCollection.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite 360 image collection to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_360_image_collection.py
def as_write(self) -> Cognite360ImageCollectionWrite:
    """Convert this GraphQL format of Cognite 360 image collection to the writing format."""
    return Cognite360ImageCollectionWrite.model_validate(as_write_args(self))

Cognite360ImageCollectionList

Bases: DomainModelList[Cognite360ImageCollection]

List of Cognite 360 image collections in the read version.

Source code in examples/cognite_core/data_classes/_cognite_360_image_collection.py
class Cognite360ImageCollectionList(DomainModelList[Cognite360ImageCollection]):
    """List of Cognite 360 image collections in the read version."""

    _INSTANCE = Cognite360ImageCollection

    def as_write(self) -> Cognite360ImageCollectionWriteList:
        """Convert these read versions of Cognite 360 image collection to the writing versions."""
        return Cognite360ImageCollectionWriteList([node.as_write() for node in self.data])

    @property
    def model_3d(self) -> Cognite360ImageModelList:
        from ._cognite_360_image_model import Cognite360ImageModel, Cognite360ImageModelList

        return Cognite360ImageModelList(
            [item.model_3d for item in self.data if isinstance(item.model_3d, Cognite360ImageModel)]
        )

as_write()

Convert these read versions of Cognite 360 image collection to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_360_image_collection.py
def as_write(self) -> Cognite360ImageCollectionWriteList:
    """Convert these read versions of Cognite 360 image collection to the writing versions."""
    return Cognite360ImageCollectionWriteList([node.as_write() for node in self.data])

Cognite360ImageCollectionWrite

Bases: CogniteDescribableNodeWrite, Cognite3DRevisionWrite

This represents the writing version of Cognite 360 image collection.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 360 image collection.

required
data_record

The data record of the Cognite 360 image collection node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
model_3d

The model 3d field.

required
name

Name of the instance

required
published

The published field.

required
status

The status field.

required
tags

Text based labels for generic use, limited to 1000

required
type_

The type field.

required
Source code in examples/cognite_core/data_classes/_cognite_360_image_collection.py
class Cognite360ImageCollectionWrite(CogniteDescribableNodeWrite, Cognite3DRevisionWrite, protected_namespaces=()):
    """This represents the writing version of Cognite 360 image collection.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 360 image collection.
        data_record: The data record of the Cognite 360 image collection node.
        aliases: Alternative names for the node
        description: Description of the instance
        model_3d: The model 3d field.
        name: Name of the instance
        published: The published field.
        status: The status field.
        tags: Text based labels for generic use, limited to 1000
        type_: The type field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "description",
        "model_3d",
        "name",
        "published",
        "status",
        "tags",
        "type_",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = ("model_3d",)

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite360ImageCollection", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None

Cognite360ImageCollectionWriteList

Bases: DomainModelWriteList[Cognite360ImageCollectionWrite]

List of Cognite 360 image collections in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_360_image_collection.py
class Cognite360ImageCollectionWriteList(DomainModelWriteList[Cognite360ImageCollectionWrite]):
    """List of Cognite 360 image collections in the writing version."""

    _INSTANCE = Cognite360ImageCollectionWrite

    @property
    def model_3d(self) -> Cognite360ImageModelWriteList:
        from ._cognite_360_image_model import Cognite360ImageModelWrite, Cognite360ImageModelWriteList

        return Cognite360ImageModelWriteList(
            [item.model_3d for item in self.data if isinstance(item.model_3d, Cognite360ImageModelWrite)]
        )

Cognite360ImageGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite 360 image, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 360 image.

required
data_record

The data record of the Cognite 360 image node.

required
back

Direct relation to a file holding the back projection of the cube map

required
bottom

Direct relation to a file holding the bottom projection of the cube map

required
collection_360

Direct relation to Cognite360ImageCollection

required
euler_rotation_x

The rotation of the object around the X-axis in radians

required
euler_rotation_y

The rotation of the object around the Y-axis in radians

required
euler_rotation_z

The rotation of the object around the Z-axis in radians

required
front

Direct relation to a file holding the front projection of the cube map

required
left

Direct relation to a file holding the left projection of the cube map

required
right

Direct relation to a file holding the right projection of the cube map

required
scale_x

The scaling factor applied to the object along the X-axis

required
scale_y

The scaling factor applied to the object along the Y-axis

required
scale_z

The scaling factor applied to the object along the Z-axis

required
station_360

Direct relation to Cognite3DGroup instance that groups different Cognite360Image instances to the same station

required
taken_at

The timestamp when the 6 photos were taken

required
top

Direct relation to a file holding the top projection of the cube map

required
translation_x

The displacement of the object along the X-axis in the 3D coordinate system

required
translation_y

The displacement of the object along the Y-axis in the 3D coordinate system

required
translation_z

The displacement of the object along the Z-axis in the 3D coordinate system

required
Source code in examples/cognite_core/data_classes/_cognite_360_image.py
class Cognite360ImageGraphQL(GraphQLCore):
    """This represents the reading version of Cognite 360 image, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 360 image.
        data_record: The data record of the Cognite 360 image node.
        back: Direct relation to a file holding the back projection of the cube map
        bottom: Direct relation to a file holding the bottom projection of the cube map
        collection_360: Direct relation to Cognite360ImageCollection
        euler_rotation_x: The rotation of the object around the X-axis in radians
        euler_rotation_y: The rotation of the object around the Y-axis in radians
        euler_rotation_z: The rotation of the object around the Z-axis in radians
        front: Direct relation to a file holding the front projection of the cube map
        left: Direct relation to a file holding the left projection of the cube map
        right: Direct relation to a file holding the right projection of the cube map
        scale_x: The scaling factor applied to the object along the X-axis
        scale_y: The scaling factor applied to the object along the Y-axis
        scale_z: The scaling factor applied to the object along the Z-axis
        station_360: Direct relation to Cognite3DGroup instance that groups different Cognite360Image instances to the
            same station
        taken_at: The timestamp when the 6 photos were taken
        top: Direct relation to a file holding the top projection of the cube map
        translation_x: The displacement of the object along the X-axis in the 3D coordinate system
        translation_y: The displacement of the object along the Y-axis in the 3D coordinate system
        translation_z: The displacement of the object along the Z-axis in the 3D coordinate system
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite360Image", "v1")
    back: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)
    bottom: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)
    collection_360: Optional[Cognite360ImageCollectionGraphQL] = Field(default=None, repr=False, alias="collection360")
    euler_rotation_x: Optional[float] = Field(None, alias="eulerRotationX")
    euler_rotation_y: Optional[float] = Field(None, alias="eulerRotationY")
    euler_rotation_z: Optional[float] = Field(None, alias="eulerRotationZ")
    front: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)
    left: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)
    right: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)
    scale_x: Optional[float] = Field(None, alias="scaleX")
    scale_y: Optional[float] = Field(None, alias="scaleY")
    scale_z: Optional[float] = Field(None, alias="scaleZ")
    station_360: Optional[Cognite360ImageStationGraphQL] = Field(default=None, repr=False, alias="station360")
    taken_at: Optional[datetime.datetime] = Field(None, alias="takenAt")
    top: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)
    translation_x: Optional[float] = Field(None, alias="translationX")
    translation_y: Optional[float] = Field(None, alias="translationY")
    translation_z: Optional[float] = Field(None, alias="translationZ")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("back", "bottom", "collection_360", "front", "left", "right", "station_360", "top", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> Cognite360Image:
        """Convert this GraphQL format of Cognite 360 image to the reading format."""
        return Cognite360Image.model_validate(as_read_args(self))

    def as_write(self) -> Cognite360ImageWrite:
        """Convert this GraphQL format of Cognite 360 image to the writing format."""
        return Cognite360ImageWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite 360 image to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_360_image.py
def as_read(self) -> Cognite360Image:
    """Convert this GraphQL format of Cognite 360 image to the reading format."""
    return Cognite360Image.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite 360 image to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_360_image.py
def as_write(self) -> Cognite360ImageWrite:
    """Convert this GraphQL format of Cognite 360 image to the writing format."""
    return Cognite360ImageWrite.model_validate(as_write_args(self))

Cognite360ImageList

Bases: DomainModelList[Cognite360Image]

List of Cognite 360 images in the read version.

Source code in examples/cognite_core/data_classes/_cognite_360_image.py
class Cognite360ImageList(DomainModelList[Cognite360Image]):
    """List of Cognite 360 images in the read version."""

    _INSTANCE = Cognite360Image

    def as_write(self) -> Cognite360ImageWriteList:
        """Convert these read versions of Cognite 360 image to the writing versions."""
        return Cognite360ImageWriteList([node.as_write() for node in self.data])

    @property
    def back(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.back for item in self.data if isinstance(item.back, CogniteFile)])

    @property
    def bottom(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.bottom for item in self.data if isinstance(item.bottom, CogniteFile)])

    @property
    def collection_360(self) -> Cognite360ImageCollectionList:
        from ._cognite_360_image_collection import Cognite360ImageCollection, Cognite360ImageCollectionList

        return Cognite360ImageCollectionList(
            [item.collection_360 for item in self.data if isinstance(item.collection_360, Cognite360ImageCollection)]
        )

    @property
    def front(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.front for item in self.data if isinstance(item.front, CogniteFile)])

    @property
    def left(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.left for item in self.data if isinstance(item.left, CogniteFile)])

    @property
    def right(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.right for item in self.data if isinstance(item.right, CogniteFile)])

    @property
    def station_360(self) -> Cognite360ImageStationList:
        from ._cognite_360_image_station import Cognite360ImageStation, Cognite360ImageStationList

        return Cognite360ImageStationList(
            [item.station_360 for item in self.data if isinstance(item.station_360, Cognite360ImageStation)]
        )

    @property
    def top(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.top for item in self.data if isinstance(item.top, CogniteFile)])

as_write()

Convert these read versions of Cognite 360 image to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_360_image.py
def as_write(self) -> Cognite360ImageWriteList:
    """Convert these read versions of Cognite 360 image to the writing versions."""
    return Cognite360ImageWriteList([node.as_write() for node in self.data])

Cognite360ImageModel

Bases: Cognite3DModel

This represents the reading version of Cognite 360 image model.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 360 image model.

required
data_record

The data record of the Cognite 360 image model node.

required
aliases

Alternative names for the node

required
collections

List Cognite360Image collections for this instance

required
description

Description of the instance

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
thumbnail

Thumbnail of the 3D model

required
type_

CAD, PointCloud or Image360

required
Source code in examples/cognite_core/data_classes/_cognite_360_image_model.py
class Cognite360ImageModel(Cognite3DModel):
    """This represents the reading version of Cognite 360 image model.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 360 image model.
        data_record: The data record of the Cognite 360 image model node.
        aliases: Alternative names for the node
        collections: List Cognite360Image collections for this instance
        description: Description of the instance
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
        thumbnail: Thumbnail of the 3D model
        type_: CAD, PointCloud or Image360
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite360ImageModel", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    collections: Optional[list[Cognite360ImageCollection]] = Field(default=None, repr=False)

    @field_validator("thumbnail", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    @field_validator("collections", mode="before")
    @classmethod
    def parse_list(cls, value: Any, info: ValidationInfo) -> Any:
        if value is None:
            return None
        return [parse_single_connection(item, info.field_name) for item in value]

    def as_write(self) -> Cognite360ImageModelWrite:
        """Convert this read version of Cognite 360 image model to the writing version."""
        return Cognite360ImageModelWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite 360 image model to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_360_image_model.py
def as_write(self) -> Cognite360ImageModelWrite:
    """Convert this read version of Cognite 360 image model to the writing version."""
    return Cognite360ImageModelWrite.model_validate(as_write_args(self))

Cognite360ImageModelGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite 360 image model, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 360 image model.

required
data_record

The data record of the Cognite 360 image model node.

required
aliases

Alternative names for the node

required
collections

List Cognite360Image collections for this instance

required
description

Description of the instance

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
thumbnail

Thumbnail of the 3D model

required
type_

CAD, PointCloud or Image360

required
Source code in examples/cognite_core/data_classes/_cognite_360_image_model.py
class Cognite360ImageModelGraphQL(GraphQLCore):
    """This represents the reading version of Cognite 360 image model, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 360 image model.
        data_record: The data record of the Cognite 360 image model node.
        aliases: Alternative names for the node
        collections: List Cognite360Image collections for this instance
        description: Description of the instance
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
        thumbnail: Thumbnail of the 3D model
        type_: CAD, PointCloud or Image360
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite360ImageModel", "v1")
    aliases: Optional[list[str]] = None
    collections: Optional[list[Cognite360ImageCollectionGraphQL]] = Field(default=None, repr=False)
    description: Optional[str] = None
    name: Optional[str] = None
    tags: Optional[list[str]] = None
    thumbnail: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)
    type_: Optional[Literal["CAD", "Image360", "PointCloud"]] = Field(None, alias="type")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("collections", "thumbnail", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> Cognite360ImageModel:
        """Convert this GraphQL format of Cognite 360 image model to the reading format."""
        return Cognite360ImageModel.model_validate(as_read_args(self))

    def as_write(self) -> Cognite360ImageModelWrite:
        """Convert this GraphQL format of Cognite 360 image model to the writing format."""
        return Cognite360ImageModelWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite 360 image model to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_360_image_model.py
def as_read(self) -> Cognite360ImageModel:
    """Convert this GraphQL format of Cognite 360 image model to the reading format."""
    return Cognite360ImageModel.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite 360 image model to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_360_image_model.py
def as_write(self) -> Cognite360ImageModelWrite:
    """Convert this GraphQL format of Cognite 360 image model to the writing format."""
    return Cognite360ImageModelWrite.model_validate(as_write_args(self))

Cognite360ImageModelList

Bases: DomainModelList[Cognite360ImageModel]

List of Cognite 360 image models in the read version.

Source code in examples/cognite_core/data_classes/_cognite_360_image_model.py
class Cognite360ImageModelList(DomainModelList[Cognite360ImageModel]):
    """List of Cognite 360 image models in the read version."""

    _INSTANCE = Cognite360ImageModel

    def as_write(self) -> Cognite360ImageModelWriteList:
        """Convert these read versions of Cognite 360 image model to the writing versions."""
        return Cognite360ImageModelWriteList([node.as_write() for node in self.data])

    @property
    def collections(self) -> Cognite360ImageCollectionList:
        from ._cognite_360_image_collection import Cognite360ImageCollection, Cognite360ImageCollectionList

        return Cognite360ImageCollectionList(
            [
                item
                for items in self.data
                for item in items.collections or []
                if isinstance(item, Cognite360ImageCollection)
            ]
        )

    @property
    def thumbnail(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.thumbnail for item in self.data if isinstance(item.thumbnail, CogniteFile)])

as_write()

Convert these read versions of Cognite 360 image model to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_360_image_model.py
def as_write(self) -> Cognite360ImageModelWriteList:
    """Convert these read versions of Cognite 360 image model to the writing versions."""
    return Cognite360ImageModelWriteList([node.as_write() for node in self.data])

Cognite360ImageModelWrite

Bases: Cognite3DModelWrite

This represents the writing version of Cognite 360 image model.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 360 image model.

required
data_record

The data record of the Cognite 360 image model node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
thumbnail

Thumbnail of the 3D model

required
type_

CAD, PointCloud or Image360

required
Source code in examples/cognite_core/data_classes/_cognite_360_image_model.py
class Cognite360ImageModelWrite(Cognite3DModelWrite):
    """This represents the writing version of Cognite 360 image model.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 360 image model.
        data_record: The data record of the Cognite 360 image model node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
        thumbnail: Thumbnail of the 3D model
        type_: CAD, PointCloud or Image360
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "description",
        "name",
        "tags",
        "thumbnail",
        "type_",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = ("thumbnail",)

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite360ImageModel", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None

Cognite360ImageModelWriteList

Bases: DomainModelWriteList[Cognite360ImageModelWrite]

List of Cognite 360 image models in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_360_image_model.py
class Cognite360ImageModelWriteList(DomainModelWriteList[Cognite360ImageModelWrite]):
    """List of Cognite 360 image models in the writing version."""

    _INSTANCE = Cognite360ImageModelWrite

    @property
    def thumbnail(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList(
            [item.thumbnail for item in self.data if isinstance(item.thumbnail, CogniteFileWrite)]
        )

Cognite360ImageStation

Bases: CogniteDescribableNode

This represents the reading version of Cognite 360 image station.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 360 image station.

required
data_record

The data record of the Cognite 360 image station node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
group_type

Type of group

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_360_image_station.py
class Cognite360ImageStation(CogniteDescribableNode):
    """This represents the reading version of Cognite 360 image station.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 360 image station.
        data_record: The data record of the Cognite 360 image station node.
        aliases: Alternative names for the node
        description: Description of the instance
        group_type: Type of group
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite360ImageStation", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    group_type: Optional[Literal["Station360"]] | str = Field(None, alias="groupType")

    def as_write(self) -> Cognite360ImageStationWrite:
        """Convert this read version of Cognite 360 image station to the writing version."""
        return Cognite360ImageStationWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite 360 image station to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_360_image_station.py
def as_write(self) -> Cognite360ImageStationWrite:
    """Convert this read version of Cognite 360 image station to the writing version."""
    return Cognite360ImageStationWrite.model_validate(as_write_args(self))

Cognite360ImageStationGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite 360 image station, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 360 image station.

required
data_record

The data record of the Cognite 360 image station node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
group_type

Type of group

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_360_image_station.py
class Cognite360ImageStationGraphQL(GraphQLCore):
    """This represents the reading version of Cognite 360 image station, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 360 image station.
        data_record: The data record of the Cognite 360 image station node.
        aliases: Alternative names for the node
        description: Description of the instance
        group_type: Type of group
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite360ImageStation", "v1")
    aliases: Optional[list[str]] = None
    description: Optional[str] = None
    group_type: Optional[Literal["Station360"]] = Field(None, alias="groupType")
    name: Optional[str] = None
    tags: Optional[list[str]] = None

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    def as_read(self) -> Cognite360ImageStation:
        """Convert this GraphQL format of Cognite 360 image station to the reading format."""
        return Cognite360ImageStation.model_validate(as_read_args(self))

    def as_write(self) -> Cognite360ImageStationWrite:
        """Convert this GraphQL format of Cognite 360 image station to the writing format."""
        return Cognite360ImageStationWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite 360 image station to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_360_image_station.py
def as_read(self) -> Cognite360ImageStation:
    """Convert this GraphQL format of Cognite 360 image station to the reading format."""
    return Cognite360ImageStation.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite 360 image station to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_360_image_station.py
def as_write(self) -> Cognite360ImageStationWrite:
    """Convert this GraphQL format of Cognite 360 image station to the writing format."""
    return Cognite360ImageStationWrite.model_validate(as_write_args(self))

Cognite360ImageStationList

Bases: DomainModelList[Cognite360ImageStation]

List of Cognite 360 image stations in the read version.

Source code in examples/cognite_core/data_classes/_cognite_360_image_station.py
class Cognite360ImageStationList(DomainModelList[Cognite360ImageStation]):
    """List of Cognite 360 image stations in the read version."""

    _INSTANCE = Cognite360ImageStation

    def as_write(self) -> Cognite360ImageStationWriteList:
        """Convert these read versions of Cognite 360 image station to the writing versions."""
        return Cognite360ImageStationWriteList([node.as_write() for node in self.data])

as_write()

Convert these read versions of Cognite 360 image station to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_360_image_station.py
def as_write(self) -> Cognite360ImageStationWriteList:
    """Convert these read versions of Cognite 360 image station to the writing versions."""
    return Cognite360ImageStationWriteList([node.as_write() for node in self.data])

Cognite360ImageStationWrite

Bases: CogniteDescribableNodeWrite

This represents the writing version of Cognite 360 image station.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 360 image station.

required
data_record

The data record of the Cognite 360 image station node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
group_type

Type of group

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_360_image_station.py
class Cognite360ImageStationWrite(CogniteDescribableNodeWrite):
    """This represents the writing version of Cognite 360 image station.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 360 image station.
        data_record: The data record of the Cognite 360 image station node.
        aliases: Alternative names for the node
        description: Description of the instance
        group_type: Type of group
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "description",
        "group_type",
        "name",
        "tags",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite360ImageStation", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    group_type: Optional[Literal["Station360"]] = Field(None, alias="groupType")

Cognite360ImageStationWriteList

Bases: DomainModelWriteList[Cognite360ImageStationWrite]

List of Cognite 360 image stations in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_360_image_station.py
class Cognite360ImageStationWriteList(DomainModelWriteList[Cognite360ImageStationWrite]):
    """List of Cognite 360 image stations in the writing version."""

    _INSTANCE = Cognite360ImageStationWrite

Cognite360ImageWrite

Bases: Cognite3DTransformationNodeWrite, CogniteCubeMapWrite

This represents the writing version of Cognite 360 image.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 360 image.

required
data_record

The data record of the Cognite 360 image node.

required
back

Direct relation to a file holding the back projection of the cube map

required
bottom

Direct relation to a file holding the bottom projection of the cube map

required
collection_360

Direct relation to Cognite360ImageCollection

required
euler_rotation_x

The rotation of the object around the X-axis in radians

required
euler_rotation_y

The rotation of the object around the Y-axis in radians

required
euler_rotation_z

The rotation of the object around the Z-axis in radians

required
front

Direct relation to a file holding the front projection of the cube map

required
left

Direct relation to a file holding the left projection of the cube map

required
right

Direct relation to a file holding the right projection of the cube map

required
scale_x

The scaling factor applied to the object along the X-axis

required
scale_y

The scaling factor applied to the object along the Y-axis

required
scale_z

The scaling factor applied to the object along the Z-axis

required
station_360

Direct relation to Cognite3DGroup instance that groups different Cognite360Image instances to the same station

required
taken_at

The timestamp when the 6 photos were taken

required
top

Direct relation to a file holding the top projection of the cube map

required
translation_x

The displacement of the object along the X-axis in the 3D coordinate system

required
translation_y

The displacement of the object along the Y-axis in the 3D coordinate system

required
translation_z

The displacement of the object along the Z-axis in the 3D coordinate system

required
Source code in examples/cognite_core/data_classes/_cognite_360_image.py
class Cognite360ImageWrite(Cognite3DTransformationNodeWrite, CogniteCubeMapWrite):
    """This represents the writing version of Cognite 360 image.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 360 image.
        data_record: The data record of the Cognite 360 image node.
        back: Direct relation to a file holding the back projection of the cube map
        bottom: Direct relation to a file holding the bottom projection of the cube map
        collection_360: Direct relation to Cognite360ImageCollection
        euler_rotation_x: The rotation of the object around the X-axis in radians
        euler_rotation_y: The rotation of the object around the Y-axis in radians
        euler_rotation_z: The rotation of the object around the Z-axis in radians
        front: Direct relation to a file holding the front projection of the cube map
        left: Direct relation to a file holding the left projection of the cube map
        right: Direct relation to a file holding the right projection of the cube map
        scale_x: The scaling factor applied to the object along the X-axis
        scale_y: The scaling factor applied to the object along the Y-axis
        scale_z: The scaling factor applied to the object along the Z-axis
        station_360: Direct relation to Cognite3DGroup instance that groups different Cognite360Image instances to the
            same station
        taken_at: The timestamp when the 6 photos were taken
        top: Direct relation to a file holding the top projection of the cube map
        translation_x: The displacement of the object along the X-axis in the 3D coordinate system
        translation_y: The displacement of the object along the Y-axis in the 3D coordinate system
        translation_z: The displacement of the object along the Z-axis in the 3D coordinate system
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "back",
        "bottom",
        "collection_360",
        "euler_rotation_x",
        "euler_rotation_y",
        "euler_rotation_z",
        "front",
        "left",
        "right",
        "scale_x",
        "scale_y",
        "scale_z",
        "station_360",
        "taken_at",
        "top",
        "translation_x",
        "translation_y",
        "translation_z",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = (
        "back",
        "bottom",
        "collection_360",
        "front",
        "left",
        "right",
        "station_360",
        "top",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite360Image", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    collection_360: Union[Cognite360ImageCollectionWrite, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="collection360"
    )
    station_360: Union[Cognite360ImageStationWrite, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="station360"
    )
    taken_at: Optional[datetime.datetime] = Field(None, alias="takenAt")

    @field_validator("collection_360", "station_360", mode="before")
    def as_node_id(cls, value: Any) -> Any:
        if isinstance(value, dm.DirectRelationReference):
            return dm.NodeId(value.space, value.external_id)
        elif isinstance(value, tuple) and len(value) == 2 and all(isinstance(item, str) for item in value):
            return dm.NodeId(value[0], value[1])
        elif isinstance(value, list):
            return [cls.as_node_id(item) for item in value]
        return value

Cognite360ImageWriteList

Bases: DomainModelWriteList[Cognite360ImageWrite]

List of Cognite 360 images in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_360_image.py
class Cognite360ImageWriteList(DomainModelWriteList[Cognite360ImageWrite]):
    """List of Cognite 360 images in the writing version."""

    _INSTANCE = Cognite360ImageWrite

    @property
    def back(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList([item.back for item in self.data if isinstance(item.back, CogniteFileWrite)])

    @property
    def bottom(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList([item.bottom for item in self.data if isinstance(item.bottom, CogniteFileWrite)])

    @property
    def collection_360(self) -> Cognite360ImageCollectionWriteList:
        from ._cognite_360_image_collection import Cognite360ImageCollectionWrite, Cognite360ImageCollectionWriteList

        return Cognite360ImageCollectionWriteList(
            [
                item.collection_360
                for item in self.data
                if isinstance(item.collection_360, Cognite360ImageCollectionWrite)
            ]
        )

    @property
    def front(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList([item.front for item in self.data if isinstance(item.front, CogniteFileWrite)])

    @property
    def left(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList([item.left for item in self.data if isinstance(item.left, CogniteFileWrite)])

    @property
    def right(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList([item.right for item in self.data if isinstance(item.right, CogniteFileWrite)])

    @property
    def station_360(self) -> Cognite360ImageStationWriteList:
        from ._cognite_360_image_station import Cognite360ImageStationWrite, Cognite360ImageStationWriteList

        return Cognite360ImageStationWriteList(
            [item.station_360 for item in self.data if isinstance(item.station_360, Cognite360ImageStationWrite)]
        )

    @property
    def top(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList([item.top for item in self.data if isinstance(item.top, CogniteFileWrite)])

Cognite3DModel

Bases: CogniteDescribableNode

This represents the reading version of Cognite 3D model.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 3D model.

required
data_record

The data record of the Cognite 3D model node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
thumbnail

Thumbnail of the 3D model

required
type_

CAD, PointCloud or Image360

required
Source code in examples/cognite_core/data_classes/_cognite_3_d_model.py
class Cognite3DModel(CogniteDescribableNode):
    """This represents the reading version of Cognite 3D model.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 3D model.
        data_record: The data record of the Cognite 3D model node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
        thumbnail: Thumbnail of the 3D model
        type_: CAD, PointCloud or Image360
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite3DModel", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    thumbnail: Union[CogniteFile, str, dm.NodeId, None] = Field(default=None, repr=False)
    type_: Optional[Literal["CAD", "Image360", "PointCloud"]] | str = Field(None, alias="type")

    @field_validator("thumbnail", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    def as_write(self) -> Cognite3DModelWrite:
        """Convert this read version of Cognite 3D model to the writing version."""
        return Cognite3DModelWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite 3D model to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_model.py
def as_write(self) -> Cognite3DModelWrite:
    """Convert this read version of Cognite 3D model to the writing version."""
    return Cognite3DModelWrite.model_validate(as_write_args(self))

Cognite3DModelGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite 3D model, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 3D model.

required
data_record

The data record of the Cognite 3D model node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
thumbnail

Thumbnail of the 3D model

required
type_

CAD, PointCloud or Image360

required
Source code in examples/cognite_core/data_classes/_cognite_3_d_model.py
class Cognite3DModelGraphQL(GraphQLCore):
    """This represents the reading version of Cognite 3D model, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 3D model.
        data_record: The data record of the Cognite 3D model node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
        thumbnail: Thumbnail of the 3D model
        type_: CAD, PointCloud or Image360
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite3DModel", "v1")
    aliases: Optional[list[str]] = None
    description: Optional[str] = None
    name: Optional[str] = None
    tags: Optional[list[str]] = None
    thumbnail: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)
    type_: Optional[Literal["CAD", "Image360", "PointCloud"]] = Field(None, alias="type")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("thumbnail", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> Cognite3DModel:
        """Convert this GraphQL format of Cognite 3D model to the reading format."""
        return Cognite3DModel.model_validate(as_read_args(self))

    def as_write(self) -> Cognite3DModelWrite:
        """Convert this GraphQL format of Cognite 3D model to the writing format."""
        return Cognite3DModelWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite 3D model to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_3_d_model.py
def as_read(self) -> Cognite3DModel:
    """Convert this GraphQL format of Cognite 3D model to the reading format."""
    return Cognite3DModel.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite 3D model to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_3_d_model.py
def as_write(self) -> Cognite3DModelWrite:
    """Convert this GraphQL format of Cognite 3D model to the writing format."""
    return Cognite3DModelWrite.model_validate(as_write_args(self))

Cognite3DModelList

Bases: DomainModelList[Cognite3DModel]

List of Cognite 3D models in the read version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_model.py
class Cognite3DModelList(DomainModelList[Cognite3DModel]):
    """List of Cognite 3D models in the read version."""

    _INSTANCE = Cognite3DModel

    def as_write(self) -> Cognite3DModelWriteList:
        """Convert these read versions of Cognite 3D model to the writing versions."""
        return Cognite3DModelWriteList([node.as_write() for node in self.data])

    @property
    def thumbnail(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.thumbnail for item in self.data if isinstance(item.thumbnail, CogniteFile)])

as_write()

Convert these read versions of Cognite 3D model to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_3_d_model.py
def as_write(self) -> Cognite3DModelWriteList:
    """Convert these read versions of Cognite 3D model to the writing versions."""
    return Cognite3DModelWriteList([node.as_write() for node in self.data])

Cognite3DModelWrite

Bases: CogniteDescribableNodeWrite

This represents the writing version of Cognite 3D model.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 3D model.

required
data_record

The data record of the Cognite 3D model node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
thumbnail

Thumbnail of the 3D model

required
type_

CAD, PointCloud or Image360

required
Source code in examples/cognite_core/data_classes/_cognite_3_d_model.py
class Cognite3DModelWrite(CogniteDescribableNodeWrite):
    """This represents the writing version of Cognite 3D model.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 3D model.
        data_record: The data record of the Cognite 3D model node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
        thumbnail: Thumbnail of the 3D model
        type_: CAD, PointCloud or Image360
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "description",
        "name",
        "tags",
        "thumbnail",
        "type_",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = ("thumbnail",)

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite3DModel", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    thumbnail: Union[CogniteFileWrite, str, dm.NodeId, None] = Field(default=None, repr=False)
    type_: Optional[Literal["CAD", "Image360", "PointCloud"]] = Field(None, alias="type")

    @field_validator("thumbnail", mode="before")
    def as_node_id(cls, value: Any) -> Any:
        if isinstance(value, dm.DirectRelationReference):
            return dm.NodeId(value.space, value.external_id)
        elif isinstance(value, tuple) and len(value) == 2 and all(isinstance(item, str) for item in value):
            return dm.NodeId(value[0], value[1])
        elif isinstance(value, list):
            return [cls.as_node_id(item) for item in value]
        return value

Cognite3DModelWriteList

Bases: DomainModelWriteList[Cognite3DModelWrite]

List of Cognite 3D models in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_model.py
class Cognite3DModelWriteList(DomainModelWriteList[Cognite3DModelWrite]):
    """List of Cognite 3D models in the writing version."""

    _INSTANCE = Cognite3DModelWrite

    @property
    def thumbnail(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList(
            [item.thumbnail for item in self.data if isinstance(item.thumbnail, CogniteFileWrite)]
        )

Cognite3DObject

Bases: CogniteDescribableNode

This represents the reading version of Cognite 3D object.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 3D object.

required
data_record

The data record of the Cognite 3D object node.

required
aliases

Alternative names for the node

required
asset

Asset that is tied to this 3D object

required
cad_nodes

List of up to 1000 CADNodes that represents the connected CogniteAsset

required
description

Description of the instance

required
images_360

Edge connection to Cognite360Image annotations that represents the connected CogniteAsset

required
name

Name of the instance

required
point_cloud_volumes

List of up to 1000 PointCloudVolumes that represents the connected CogniteAsset

required
tags

Text based labels for generic use, limited to 1000

required
x_max

Highest X value in bounding box

required
x_min

Lowest X value in bounding box

required
y_max

Highest Y value in bounding box

required
y_min

Lowest Y value in bounding box

required
z_max

Highest Z value in bounding box

required
z_min

Lowest Z value in bounding box

required
Source code in examples/cognite_core/data_classes/_cognite_3_d_object.py
class Cognite3DObject(CogniteDescribableNode):
    """This represents the reading version of Cognite 3D object.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 3D object.
        data_record: The data record of the Cognite 3D object node.
        aliases: Alternative names for the node
        asset: Asset that is tied to this 3D object
        cad_nodes: List of up to 1000 CADNodes that represents the connected CogniteAsset
        description: Description of the instance
        images_360: Edge connection to Cognite360Image annotations that represents the connected CogniteAsset
        name: Name of the instance
        point_cloud_volumes: List of up to 1000 PointCloudVolumes that represents the connected CogniteAsset
        tags: Text based labels for generic use, limited to 1000
        x_max: Highest X value in bounding box
        x_min: Lowest X value in bounding box
        y_max: Highest Y value in bounding box
        y_min: Lowest Y value in bounding box
        z_max: Highest Z value in bounding box
        z_min: Lowest Z value in bounding box
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite3DObject", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    asset: Optional[CogniteAsset] = Field(default=None, repr=False)
    cad_nodes: Optional[list[CogniteCADNode]] = Field(default=None, repr=False, alias="cadNodes")
    images_360: Optional[list[Cognite360ImageAnnotation]] = Field(default=None, repr=False, alias="images360")
    point_cloud_volumes: Optional[list[CognitePointCloudVolume]] = Field(
        default=None, repr=False, alias="pointCloudVolumes"
    )
    x_max: Optional[float] = Field(None, alias="xMax")
    x_min: Optional[float] = Field(None, alias="xMin")
    y_max: Optional[float] = Field(None, alias="yMax")
    y_min: Optional[float] = Field(None, alias="yMin")
    z_max: Optional[float] = Field(None, alias="zMax")
    z_min: Optional[float] = Field(None, alias="zMin")

    @field_validator("asset", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    @field_validator("cad_nodes", "images_360", "point_cloud_volumes", mode="before")
    @classmethod
    def parse_list(cls, value: Any, info: ValidationInfo) -> Any:
        if value is None:
            return None
        return [parse_single_connection(item, info.field_name) for item in value]

    def as_write(self) -> Cognite3DObjectWrite:
        """Convert this read version of Cognite 3D object to the writing version."""
        return Cognite3DObjectWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite 3D object to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_object.py
def as_write(self) -> Cognite3DObjectWrite:
    """Convert this read version of Cognite 3D object to the writing version."""
    return Cognite3DObjectWrite.model_validate(as_write_args(self))

Cognite3DObjectGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite 3D object, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 3D object.

required
data_record

The data record of the Cognite 3D object node.

required
aliases

Alternative names for the node

required
asset

Asset that is tied to this 3D object

required
cad_nodes

List of up to 1000 CADNodes that represents the connected CogniteAsset

required
description

Description of the instance

required
images_360

Edge connection to Cognite360Image annotations that represents the connected CogniteAsset

required
name

Name of the instance

required
point_cloud_volumes

List of up to 1000 PointCloudVolumes that represents the connected CogniteAsset

required
tags

Text based labels for generic use, limited to 1000

required
x_max

Highest X value in bounding box

required
x_min

Lowest X value in bounding box

required
y_max

Highest Y value in bounding box

required
y_min

Lowest Y value in bounding box

required
z_max

Highest Z value in bounding box

required
z_min

Lowest Z value in bounding box

required
Source code in examples/cognite_core/data_classes/_cognite_3_d_object.py
class Cognite3DObjectGraphQL(GraphQLCore):
    """This represents the reading version of Cognite 3D object, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 3D object.
        data_record: The data record of the Cognite 3D object node.
        aliases: Alternative names for the node
        asset: Asset that is tied to this 3D object
        cad_nodes: List of up to 1000 CADNodes that represents the connected CogniteAsset
        description: Description of the instance
        images_360: Edge connection to Cognite360Image annotations that represents the connected CogniteAsset
        name: Name of the instance
        point_cloud_volumes: List of up to 1000 PointCloudVolumes that represents the connected CogniteAsset
        tags: Text based labels for generic use, limited to 1000
        x_max: Highest X value in bounding box
        x_min: Lowest X value in bounding box
        y_max: Highest Y value in bounding box
        y_min: Lowest Y value in bounding box
        z_max: Highest Z value in bounding box
        z_min: Lowest Z value in bounding box
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite3DObject", "v1")
    aliases: Optional[list[str]] = None
    asset: Optional[CogniteAssetGraphQL] = Field(default=None, repr=False)
    cad_nodes: Optional[list[CogniteCADNodeGraphQL]] = Field(default=None, repr=False, alias="cadNodes")
    description: Optional[str] = None
    images_360: Optional[list[Cognite360ImageAnnotationGraphQL]] = Field(default=None, repr=False, alias="images360")
    name: Optional[str] = None
    point_cloud_volumes: Optional[list[CognitePointCloudVolumeGraphQL]] = Field(
        default=None, repr=False, alias="pointCloudVolumes"
    )
    tags: Optional[list[str]] = None
    x_max: Optional[float] = Field(None, alias="xMax")
    x_min: Optional[float] = Field(None, alias="xMin")
    y_max: Optional[float] = Field(None, alias="yMax")
    y_min: Optional[float] = Field(None, alias="yMin")
    z_max: Optional[float] = Field(None, alias="zMax")
    z_min: Optional[float] = Field(None, alias="zMin")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("asset", "cad_nodes", "images_360", "point_cloud_volumes", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> Cognite3DObject:
        """Convert this GraphQL format of Cognite 3D object to the reading format."""
        return Cognite3DObject.model_validate(as_read_args(self))

    def as_write(self) -> Cognite3DObjectWrite:
        """Convert this GraphQL format of Cognite 3D object to the writing format."""
        return Cognite3DObjectWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite 3D object to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_3_d_object.py
def as_read(self) -> Cognite3DObject:
    """Convert this GraphQL format of Cognite 3D object to the reading format."""
    return Cognite3DObject.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite 3D object to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_3_d_object.py
def as_write(self) -> Cognite3DObjectWrite:
    """Convert this GraphQL format of Cognite 3D object to the writing format."""
    return Cognite3DObjectWrite.model_validate(as_write_args(self))

Cognite3DObjectList

Bases: DomainModelList[Cognite3DObject]

List of Cognite 3D objects in the read version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_object.py
class Cognite3DObjectList(DomainModelList[Cognite3DObject]):
    """List of Cognite 3D objects in the read version."""

    _INSTANCE = Cognite3DObject

    def as_write(self) -> Cognite3DObjectWriteList:
        """Convert these read versions of Cognite 3D object to the writing versions."""
        return Cognite3DObjectWriteList([node.as_write() for node in self.data])

    @property
    def asset(self) -> CogniteAssetList:
        from ._cognite_asset import CogniteAsset, CogniteAssetList

        return CogniteAssetList([item.asset for item in self.data if isinstance(item.asset, CogniteAsset)])

    @property
    def cad_nodes(self) -> CogniteCADNodeList:
        from ._cognite_cad_node import CogniteCADNode, CogniteCADNodeList

        return CogniteCADNodeList(
            [item for items in self.data for item in items.cad_nodes or [] if isinstance(item, CogniteCADNode)]
        )

    @property
    def images_360(self) -> Cognite360ImageAnnotationList:
        from ._cognite_360_image_annotation import Cognite360ImageAnnotation, Cognite360ImageAnnotationList

        return Cognite360ImageAnnotationList(
            [
                item
                for items in self.data
                for item in items.images_360 or []
                if isinstance(item, Cognite360ImageAnnotation)
            ]
        )

    @property
    def point_cloud_volumes(self) -> CognitePointCloudVolumeList:
        from ._cognite_point_cloud_volume import CognitePointCloudVolume, CognitePointCloudVolumeList

        return CognitePointCloudVolumeList(
            [
                item
                for items in self.data
                for item in items.point_cloud_volumes or []
                if isinstance(item, CognitePointCloudVolume)
            ]
        )

as_write()

Convert these read versions of Cognite 3D object to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_3_d_object.py
def as_write(self) -> Cognite3DObjectWriteList:
    """Convert these read versions of Cognite 3D object to the writing versions."""
    return Cognite3DObjectWriteList([node.as_write() for node in self.data])

Cognite3DObjectWrite

Bases: CogniteDescribableNodeWrite

This represents the writing version of Cognite 3D object.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 3D object.

required
data_record

The data record of the Cognite 3D object node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
images_360

Edge connection to Cognite360Image annotations that represents the connected CogniteAsset

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
x_max

Highest X value in bounding box

required
x_min

Lowest X value in bounding box

required
y_max

Highest Y value in bounding box

required
y_min

Lowest Y value in bounding box

required
z_max

Highest Z value in bounding box

required
z_min

Lowest Z value in bounding box

required
Source code in examples/cognite_core/data_classes/_cognite_3_d_object.py
class Cognite3DObjectWrite(CogniteDescribableNodeWrite):
    """This represents the writing version of Cognite 3D object.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 3D object.
        data_record: The data record of the Cognite 3D object node.
        aliases: Alternative names for the node
        description: Description of the instance
        images_360: Edge connection to Cognite360Image annotations that represents the connected CogniteAsset
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
        x_max: Highest X value in bounding box
        x_min: Lowest X value in bounding box
        y_max: Highest Y value in bounding box
        y_min: Lowest Y value in bounding box
        z_max: Highest Z value in bounding box
        z_min: Lowest Z value in bounding box
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "description",
        "name",
        "tags",
        "x_max",
        "x_min",
        "y_max",
        "y_min",
        "z_max",
        "z_min",
    )
    _outwards_edges: ClassVar[tuple[tuple[str, dm.DirectRelationReference], ...]] = (
        ("images_360", dm.DirectRelationReference("cdf_cdm", "image-360-annotation")),
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite3DObject", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    images_360: Optional[list[Cognite360ImageAnnotationWrite]] = Field(default=None, repr=False, alias="images360")
    x_max: Optional[float] = Field(None, alias="xMax")
    x_min: Optional[float] = Field(None, alias="xMin")
    y_max: Optional[float] = Field(None, alias="yMax")
    y_min: Optional[float] = Field(None, alias="yMin")
    z_max: Optional[float] = Field(None, alias="zMax")
    z_min: Optional[float] = Field(None, alias="zMin")

    @field_validator("images_360", mode="before")
    def as_node_id(cls, value: Any) -> Any:
        if isinstance(value, dm.DirectRelationReference):
            return dm.NodeId(value.space, value.external_id)
        elif isinstance(value, tuple) and len(value) == 2 and all(isinstance(item, str) for item in value):
            return dm.NodeId(value[0], value[1])
        elif isinstance(value, list):
            return [cls.as_node_id(item) for item in value]
        return value

Cognite3DObjectWriteList

Bases: DomainModelWriteList[Cognite3DObjectWrite]

List of Cognite 3D objects in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_object.py
class Cognite3DObjectWriteList(DomainModelWriteList[Cognite3DObjectWrite]):
    """List of Cognite 3D objects in the writing version."""

    _INSTANCE = Cognite3DObjectWrite

    @property
    def images_360(self) -> Cognite360ImageAnnotationWriteList:
        from ._cognite_360_image_annotation import Cognite360ImageAnnotationWrite, Cognite360ImageAnnotationWriteList

        return Cognite360ImageAnnotationWriteList(
            [
                item
                for items in self.data
                for item in items.images_360 or []
                if isinstance(item, Cognite360ImageAnnotationWrite)
            ]
        )

Cognite3DRevision

Bases: DomainModel

This represents the reading version of Cognite 3D revision.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 3D revision.

required
data_record

The data record of the Cognite 3D revision node.

required
model_3d

The model 3d field.

required
published

The published field.

required
status

The status field.

required
type_

The type field.

required
Source code in examples/cognite_core/data_classes/_cognite_3_d_revision.py
class Cognite3DRevision(DomainModel, protected_namespaces=()):
    """This represents the reading version of Cognite 3D revision.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 3D revision.
        data_record: The data record of the Cognite 3D revision node.
        model_3d: The model 3d field.
        published: The published field.
        status: The status field.
        type_: The type field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite3DRevision", "v1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = None
    model_3d: Union[Cognite3DModel, str, dm.NodeId, None] = Field(default=None, repr=False, alias="model3D")
    published: Optional[bool] = None
    status: Optional[Literal["Done", "Failed", "Processing", "Queued"]] | str = None
    type_: Optional[Literal["CAD", "Image360", "PointCloud"]] | str = Field(None, alias="type")

    @field_validator("model_3d", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    def as_write(self) -> Cognite3DRevisionWrite:
        """Convert this read version of Cognite 3D revision to the writing version."""
        return Cognite3DRevisionWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite 3D revision to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_revision.py
def as_write(self) -> Cognite3DRevisionWrite:
    """Convert this read version of Cognite 3D revision to the writing version."""
    return Cognite3DRevisionWrite.model_validate(as_write_args(self))

Cognite3DRevisionGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite 3D revision, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 3D revision.

required
data_record

The data record of the Cognite 3D revision node.

required
model_3d

The model 3d field.

required
published

The published field.

required
status

The status field.

required
type_

The type field.

required
Source code in examples/cognite_core/data_classes/_cognite_3_d_revision.py
class Cognite3DRevisionGraphQL(GraphQLCore, protected_namespaces=()):
    """This represents the reading version of Cognite 3D revision, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 3D revision.
        data_record: The data record of the Cognite 3D revision node.
        model_3d: The model 3d field.
        published: The published field.
        status: The status field.
        type_: The type field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite3DRevision", "v1")
    model_3d: Optional[Cognite3DModelGraphQL] = Field(default=None, repr=False, alias="model3D")
    published: Optional[bool] = None
    status: Optional[Literal["Done", "Failed", "Processing", "Queued"]] = None
    type_: Optional[Literal["CAD", "Image360", "PointCloud"]] = Field(None, alias="type")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("model_3d", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> Cognite3DRevision:
        """Convert this GraphQL format of Cognite 3D revision to the reading format."""
        return Cognite3DRevision.model_validate(as_read_args(self))

    def as_write(self) -> Cognite3DRevisionWrite:
        """Convert this GraphQL format of Cognite 3D revision to the writing format."""
        return Cognite3DRevisionWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite 3D revision to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_3_d_revision.py
def as_read(self) -> Cognite3DRevision:
    """Convert this GraphQL format of Cognite 3D revision to the reading format."""
    return Cognite3DRevision.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite 3D revision to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_3_d_revision.py
def as_write(self) -> Cognite3DRevisionWrite:
    """Convert this GraphQL format of Cognite 3D revision to the writing format."""
    return Cognite3DRevisionWrite.model_validate(as_write_args(self))

Cognite3DRevisionList

Bases: DomainModelList[Cognite3DRevision]

List of Cognite 3D revisions in the read version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_revision.py
class Cognite3DRevisionList(DomainModelList[Cognite3DRevision]):
    """List of Cognite 3D revisions in the read version."""

    _INSTANCE = Cognite3DRevision

    def as_write(self) -> Cognite3DRevisionWriteList:
        """Convert these read versions of Cognite 3D revision to the writing versions."""
        return Cognite3DRevisionWriteList([node.as_write() for node in self.data])

    @property
    def model_3d(self) -> Cognite3DModelList:
        from ._cognite_3_d_model import Cognite3DModel, Cognite3DModelList

        return Cognite3DModelList([item.model_3d for item in self.data if isinstance(item.model_3d, Cognite3DModel)])

as_write()

Convert these read versions of Cognite 3D revision to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_3_d_revision.py
def as_write(self) -> Cognite3DRevisionWriteList:
    """Convert these read versions of Cognite 3D revision to the writing versions."""
    return Cognite3DRevisionWriteList([node.as_write() for node in self.data])

Cognite3DRevisionWrite

Bases: DomainModelWrite

This represents the writing version of Cognite 3D revision.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 3D revision.

required
data_record

The data record of the Cognite 3D revision node.

required
model_3d

The model 3d field.

required
published

The published field.

required
status

The status field.

required
type_

The type field.

required
Source code in examples/cognite_core/data_classes/_cognite_3_d_revision.py
class Cognite3DRevisionWrite(DomainModelWrite, protected_namespaces=()):
    """This represents the writing version of Cognite 3D revision.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 3D revision.
        data_record: The data record of the Cognite 3D revision node.
        model_3d: The model 3d field.
        published: The published field.
        status: The status field.
        type_: The type field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "model_3d",
        "published",
        "status",
        "type_",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = ("model_3d",)

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite3DRevision", "v1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    model_3d: Union[Cognite3DModelWrite, str, dm.NodeId, None] = Field(default=None, repr=False, alias="model3D")
    published: Optional[bool] = None
    status: Optional[Literal["Done", "Failed", "Processing", "Queued"]] = None
    type_: Optional[Literal["CAD", "Image360", "PointCloud"]] = Field(None, alias="type")

    @field_validator("model_3d", mode="before")
    def as_node_id(cls, value: Any) -> Any:
        if isinstance(value, dm.DirectRelationReference):
            return dm.NodeId(value.space, value.external_id)
        elif isinstance(value, tuple) and len(value) == 2 and all(isinstance(item, str) for item in value):
            return dm.NodeId(value[0], value[1])
        elif isinstance(value, list):
            return [cls.as_node_id(item) for item in value]
        return value

Cognite3DRevisionWriteList

Bases: DomainModelWriteList[Cognite3DRevisionWrite]

List of Cognite 3D revisions in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_revision.py
class Cognite3DRevisionWriteList(DomainModelWriteList[Cognite3DRevisionWrite]):
    """List of Cognite 3D revisions in the writing version."""

    _INSTANCE = Cognite3DRevisionWrite

    @property
    def model_3d(self) -> Cognite3DModelWriteList:
        from ._cognite_3_d_model import Cognite3DModelWrite, Cognite3DModelWriteList

        return Cognite3DModelWriteList(
            [item.model_3d for item in self.data if isinstance(item.model_3d, Cognite3DModelWrite)]
        )

Cognite3DTransformationEdge

Bases: DomainRelation

This represents the reading version of Cognite 3D transformation edge.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 3D transformation edge.

required
data_record

The data record of the Cognite 3D transformation edge edge.

required
end_node

The end node of this edge.

required
euler_rotation_x

The rotation of the object around the X-axis in radians

required
euler_rotation_y

The rotation of the object around the Y-axis in radians

required
euler_rotation_z

The rotation of the object around the Z-axis in radians

required
scale_x

The scaling factor applied to the object along the X-axis

required
scale_y

The scaling factor applied to the object along the Y-axis

required
scale_z

The scaling factor applied to the object along the Z-axis

required
translation_x

The displacement of the object along the X-axis in the 3D coordinate system

required
translation_y

The displacement of the object along the Y-axis in the 3D coordinate system

required
translation_z

The displacement of the object along the Z-axis in the 3D coordinate system

required
Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_edge.py
class Cognite3DTransformationEdge(DomainRelation):
    """This represents the reading version of Cognite 3D transformation edge.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 3D transformation edge.
        data_record: The data record of the Cognite 3D transformation edge edge.
        end_node: The end node of this edge.
        euler_rotation_x: The rotation of the object around the X-axis in radians
        euler_rotation_y: The rotation of the object around the Y-axis in radians
        euler_rotation_z: The rotation of the object around the Z-axis in radians
        scale_x: The scaling factor applied to the object along the X-axis
        scale_y: The scaling factor applied to the object along the Y-axis
        scale_z: The scaling factor applied to the object along the Z-axis
        translation_x: The displacement of the object along the X-axis in the 3D coordinate system
        translation_y: The displacement of the object along the Y-axis in the 3D coordinate system
        translation_z: The displacement of the object along the Z-axis in the 3D coordinate system
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite3DTransformation", "v1")
    space: str = DEFAULT_INSTANCE_SPACE
    end_node: Union[str, dm.NodeId] = Field(alias="endNode")
    euler_rotation_x: Optional[float] = Field(None, alias="eulerRotationX")
    euler_rotation_y: Optional[float] = Field(None, alias="eulerRotationY")
    euler_rotation_z: Optional[float] = Field(None, alias="eulerRotationZ")
    scale_x: Optional[float] = Field(None, alias="scaleX")
    scale_y: Optional[float] = Field(None, alias="scaleY")
    scale_z: Optional[float] = Field(None, alias="scaleZ")
    translation_x: Optional[float] = Field(None, alias="translationX")
    translation_y: Optional[float] = Field(None, alias="translationY")
    translation_z: Optional[float] = Field(None, alias="translationZ")

    def as_write(self) -> Cognite3DTransformationEdgeWrite:
        """Convert this read version of Cognite 3D transformation edge to the writing version."""
        return Cognite3DTransformationEdgeWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite 3D transformation edge to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_edge.py
def as_write(self) -> Cognite3DTransformationEdgeWrite:
    """Convert this read version of Cognite 3D transformation edge to the writing version."""
    return Cognite3DTransformationEdgeWrite.model_validate(as_write_args(self))

Cognite3DTransformationEdgeGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite 3D transformation edge, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 3D transformation edge.

required
data_record

The data record of the Cognite 3D transformation edge node.

required
end_node

The end node of this edge.

required
euler_rotation_x

The rotation of the object around the X-axis in radians

required
euler_rotation_y

The rotation of the object around the Y-axis in radians

required
euler_rotation_z

The rotation of the object around the Z-axis in radians

required
scale_x

The scaling factor applied to the object along the X-axis

required
scale_y

The scaling factor applied to the object along the Y-axis

required
scale_z

The scaling factor applied to the object along the Z-axis

required
translation_x

The displacement of the object along the X-axis in the 3D coordinate system

required
translation_y

The displacement of the object along the Y-axis in the 3D coordinate system

required
translation_z

The displacement of the object along the Z-axis in the 3D coordinate system

required
Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_edge.py
class Cognite3DTransformationEdgeGraphQL(GraphQLCore):
    """This represents the reading version of Cognite 3D transformation edge, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 3D transformation edge.
        data_record: The data record of the Cognite 3D transformation edge node.
        end_node: The end node of this edge.
        euler_rotation_x: The rotation of the object around the X-axis in radians
        euler_rotation_y: The rotation of the object around the Y-axis in radians
        euler_rotation_z: The rotation of the object around the Z-axis in radians
        scale_x: The scaling factor applied to the object along the X-axis
        scale_y: The scaling factor applied to the object along the Y-axis
        scale_z: The scaling factor applied to the object along the Z-axis
        translation_x: The displacement of the object along the X-axis in the 3D coordinate system
        translation_y: The displacement of the object along the Y-axis in the 3D coordinate system
        translation_z: The displacement of the object along the Z-axis in the 3D coordinate system
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite3DTransformation", "v1")
    end_node: Union[dm.NodeId, None] = Field(None, alias="endNode")
    euler_rotation_x: Optional[float] = Field(None, alias="eulerRotationX")
    euler_rotation_y: Optional[float] = Field(None, alias="eulerRotationY")
    euler_rotation_z: Optional[float] = Field(None, alias="eulerRotationZ")
    scale_x: Optional[float] = Field(None, alias="scaleX")
    scale_y: Optional[float] = Field(None, alias="scaleY")
    scale_z: Optional[float] = Field(None, alias="scaleZ")
    translation_x: Optional[float] = Field(None, alias="translationX")
    translation_y: Optional[float] = Field(None, alias="translationY")
    translation_z: Optional[float] = Field(None, alias="translationZ")

    def as_read(self) -> Cognite3DTransformationEdge:
        """Convert this GraphQL format of Cognite 3D transformation edge to the reading format."""
        return Cognite3DTransformationEdge.model_validate(as_read_args(self))

    def as_write(self) -> Cognite3DTransformationEdgeWrite:
        """Convert this GraphQL format of Cognite 3D transformation edge to the writing format."""
        return Cognite3DTransformationEdgeWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite 3D transformation edge to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_edge.py
def as_read(self) -> Cognite3DTransformationEdge:
    """Convert this GraphQL format of Cognite 3D transformation edge to the reading format."""
    return Cognite3DTransformationEdge.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite 3D transformation edge to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_edge.py
def as_write(self) -> Cognite3DTransformationEdgeWrite:
    """Convert this GraphQL format of Cognite 3D transformation edge to the writing format."""
    return Cognite3DTransformationEdgeWrite.model_validate(as_write_args(self))

Cognite3DTransformationEdgeList

Bases: DomainRelationList[Cognite3DTransformationEdge]

List of Cognite 3D transformation edges in the reading version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_edge.py
class Cognite3DTransformationEdgeList(DomainRelationList[Cognite3DTransformationEdge]):
    """List of Cognite 3D transformation edges in the reading version."""

    _INSTANCE = Cognite3DTransformationEdge

    def as_write(self) -> Cognite3DTransformationEdgeWriteList:
        """Convert this read version of Cognite 3D transformation edge list to the writing version."""
        return Cognite3DTransformationEdgeWriteList([edge.as_write() for edge in self])

as_write()

Convert this read version of Cognite 3D transformation edge list to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_edge.py
def as_write(self) -> Cognite3DTransformationEdgeWriteList:
    """Convert this read version of Cognite 3D transformation edge list to the writing version."""
    return Cognite3DTransformationEdgeWriteList([edge.as_write() for edge in self])

Cognite3DTransformationEdgeWrite

Bases: DomainRelationWrite

This represents the writing version of Cognite 3D transformation edge.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 3D transformation edge.

required
data_record

The data record of the Cognite 3D transformation edge edge.

required
end_node

The end node of this edge.

required
euler_rotation_x

The rotation of the object around the X-axis in radians

required
euler_rotation_y

The rotation of the object around the Y-axis in radians

required
euler_rotation_z

The rotation of the object around the Z-axis in radians

required
scale_x

The scaling factor applied to the object along the X-axis

required
scale_y

The scaling factor applied to the object along the Y-axis

required
scale_z

The scaling factor applied to the object along the Z-axis

required
translation_x

The displacement of the object along the X-axis in the 3D coordinate system

required
translation_y

The displacement of the object along the Y-axis in the 3D coordinate system

required
translation_z

The displacement of the object along the Z-axis in the 3D coordinate system

required
Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_edge.py
class Cognite3DTransformationEdgeWrite(DomainRelationWrite):
    """This represents the writing version of Cognite 3D transformation edge.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 3D transformation edge.
        data_record: The data record of the Cognite 3D transformation edge edge.
        end_node: The end node of this edge.
        euler_rotation_x: The rotation of the object around the X-axis in radians
        euler_rotation_y: The rotation of the object around the Y-axis in radians
        euler_rotation_z: The rotation of the object around the Z-axis in radians
        scale_x: The scaling factor applied to the object along the X-axis
        scale_y: The scaling factor applied to the object along the Y-axis
        scale_z: The scaling factor applied to the object along the Z-axis
        translation_x: The displacement of the object along the X-axis in the 3D coordinate system
        translation_y: The displacement of the object along the Y-axis in the 3D coordinate system
        translation_z: The displacement of the object along the Z-axis in the 3D coordinate system
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "euler_rotation_x",
        "euler_rotation_y",
        "euler_rotation_z",
        "scale_x",
        "scale_y",
        "scale_z",
        "translation_x",
        "translation_y",
        "translation_z",
    )
    _validate_end_node = _validate_end_node

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite3DTransformation", "v1")
    end_node: Union[str, dm.NodeId] = Field(alias="endNode")
    euler_rotation_x: Optional[float] = Field(None, alias="eulerRotationX")
    euler_rotation_y: Optional[float] = Field(None, alias="eulerRotationY")
    euler_rotation_z: Optional[float] = Field(None, alias="eulerRotationZ")
    scale_x: Optional[float] = Field(None, alias="scaleX")
    scale_y: Optional[float] = Field(None, alias="scaleY")
    scale_z: Optional[float] = Field(None, alias="scaleZ")
    translation_x: Optional[float] = Field(None, alias="translationX")
    translation_y: Optional[float] = Field(None, alias="translationY")
    translation_z: Optional[float] = Field(None, alias="translationZ")

Cognite3DTransformationEdgeWriteList

Bases: DomainRelationWriteList[Cognite3DTransformationEdgeWrite]

List of Cognite 3D transformation edges in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_edge.py
class Cognite3DTransformationEdgeWriteList(DomainRelationWriteList[Cognite3DTransformationEdgeWrite]):
    """List of Cognite 3D transformation edges in the writing version."""

    _INSTANCE = Cognite3DTransformationEdgeWrite

Cognite3DTransformationNode

Bases: DomainModel

This represents the reading version of Cognite 3D transformation node.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 3D transformation node.

required
data_record

The data record of the Cognite 3D transformation node node.

required
euler_rotation_x

The rotation of the object around the X-axis in radians

required
euler_rotation_y

The rotation of the object around the Y-axis in radians

required
euler_rotation_z

The rotation of the object around the Z-axis in radians

required
scale_x

The scaling factor applied to the object along the X-axis

required
scale_y

The scaling factor applied to the object along the Y-axis

required
scale_z

The scaling factor applied to the object along the Z-axis

required
translation_x

The displacement of the object along the X-axis in the 3D coordinate system

required
translation_y

The displacement of the object along the Y-axis in the 3D coordinate system

required
translation_z

The displacement of the object along the Z-axis in the 3D coordinate system

required
Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_node.py
class Cognite3DTransformationNode(DomainModel):
    """This represents the reading version of Cognite 3D transformation node.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 3D transformation node.
        data_record: The data record of the Cognite 3D transformation node node.
        euler_rotation_x: The rotation of the object around the X-axis in radians
        euler_rotation_y: The rotation of the object around the Y-axis in radians
        euler_rotation_z: The rotation of the object around the Z-axis in radians
        scale_x: The scaling factor applied to the object along the X-axis
        scale_y: The scaling factor applied to the object along the Y-axis
        scale_z: The scaling factor applied to the object along the Z-axis
        translation_x: The displacement of the object along the X-axis in the 3D coordinate system
        translation_y: The displacement of the object along the Y-axis in the 3D coordinate system
        translation_z: The displacement of the object along the Z-axis in the 3D coordinate system
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite3DTransformation", "v1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = None
    euler_rotation_x: Optional[float] = Field(None, alias="eulerRotationX")
    euler_rotation_y: Optional[float] = Field(None, alias="eulerRotationY")
    euler_rotation_z: Optional[float] = Field(None, alias="eulerRotationZ")
    scale_x: Optional[float] = Field(None, alias="scaleX")
    scale_y: Optional[float] = Field(None, alias="scaleY")
    scale_z: Optional[float] = Field(None, alias="scaleZ")
    translation_x: Optional[float] = Field(None, alias="translationX")
    translation_y: Optional[float] = Field(None, alias="translationY")
    translation_z: Optional[float] = Field(None, alias="translationZ")

    def as_write(self) -> Cognite3DTransformationNodeWrite:
        """Convert this read version of Cognite 3D transformation node to the writing version."""
        return Cognite3DTransformationNodeWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite 3D transformation node to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_node.py
def as_write(self) -> Cognite3DTransformationNodeWrite:
    """Convert this read version of Cognite 3D transformation node to the writing version."""
    return Cognite3DTransformationNodeWrite.model_validate(as_write_args(self))

Cognite3DTransformationNodeGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite 3D transformation node, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 3D transformation node.

required
data_record

The data record of the Cognite 3D transformation node node.

required
euler_rotation_x

The rotation of the object around the X-axis in radians

required
euler_rotation_y

The rotation of the object around the Y-axis in radians

required
euler_rotation_z

The rotation of the object around the Z-axis in radians

required
scale_x

The scaling factor applied to the object along the X-axis

required
scale_y

The scaling factor applied to the object along the Y-axis

required
scale_z

The scaling factor applied to the object along the Z-axis

required
translation_x

The displacement of the object along the X-axis in the 3D coordinate system

required
translation_y

The displacement of the object along the Y-axis in the 3D coordinate system

required
translation_z

The displacement of the object along the Z-axis in the 3D coordinate system

required
Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_node.py
class Cognite3DTransformationNodeGraphQL(GraphQLCore):
    """This represents the reading version of Cognite 3D transformation node, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 3D transformation node.
        data_record: The data record of the Cognite 3D transformation node node.
        euler_rotation_x: The rotation of the object around the X-axis in radians
        euler_rotation_y: The rotation of the object around the Y-axis in radians
        euler_rotation_z: The rotation of the object around the Z-axis in radians
        scale_x: The scaling factor applied to the object along the X-axis
        scale_y: The scaling factor applied to the object along the Y-axis
        scale_z: The scaling factor applied to the object along the Z-axis
        translation_x: The displacement of the object along the X-axis in the 3D coordinate system
        translation_y: The displacement of the object along the Y-axis in the 3D coordinate system
        translation_z: The displacement of the object along the Z-axis in the 3D coordinate system
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite3DTransformation", "v1")
    euler_rotation_x: Optional[float] = Field(None, alias="eulerRotationX")
    euler_rotation_y: Optional[float] = Field(None, alias="eulerRotationY")
    euler_rotation_z: Optional[float] = Field(None, alias="eulerRotationZ")
    scale_x: Optional[float] = Field(None, alias="scaleX")
    scale_y: Optional[float] = Field(None, alias="scaleY")
    scale_z: Optional[float] = Field(None, alias="scaleZ")
    translation_x: Optional[float] = Field(None, alias="translationX")
    translation_y: Optional[float] = Field(None, alias="translationY")
    translation_z: Optional[float] = Field(None, alias="translationZ")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    def as_read(self) -> Cognite3DTransformationNode:
        """Convert this GraphQL format of Cognite 3D transformation node to the reading format."""
        return Cognite3DTransformationNode.model_validate(as_read_args(self))

    def as_write(self) -> Cognite3DTransformationNodeWrite:
        """Convert this GraphQL format of Cognite 3D transformation node to the writing format."""
        return Cognite3DTransformationNodeWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite 3D transformation node to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_node.py
def as_read(self) -> Cognite3DTransformationNode:
    """Convert this GraphQL format of Cognite 3D transformation node to the reading format."""
    return Cognite3DTransformationNode.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite 3D transformation node to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_node.py
def as_write(self) -> Cognite3DTransformationNodeWrite:
    """Convert this GraphQL format of Cognite 3D transformation node to the writing format."""
    return Cognite3DTransformationNodeWrite.model_validate(as_write_args(self))

Cognite3DTransformationNodeList

Bases: DomainModelList[Cognite3DTransformationNode]

List of Cognite 3D transformation nodes in the read version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_node.py
class Cognite3DTransformationNodeList(DomainModelList[Cognite3DTransformationNode]):
    """List of Cognite 3D transformation nodes in the read version."""

    _INSTANCE = Cognite3DTransformationNode

    def as_write(self) -> Cognite3DTransformationNodeWriteList:
        """Convert these read versions of Cognite 3D transformation node to the writing versions."""
        return Cognite3DTransformationNodeWriteList([node.as_write() for node in self.data])

as_write()

Convert these read versions of Cognite 3D transformation node to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_node.py
def as_write(self) -> Cognite3DTransformationNodeWriteList:
    """Convert these read versions of Cognite 3D transformation node to the writing versions."""
    return Cognite3DTransformationNodeWriteList([node.as_write() for node in self.data])

Cognite3DTransformationNodeWrite

Bases: DomainModelWrite

This represents the writing version of Cognite 3D transformation node.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite 3D transformation node.

required
data_record

The data record of the Cognite 3D transformation node node.

required
euler_rotation_x

The rotation of the object around the X-axis in radians

required
euler_rotation_y

The rotation of the object around the Y-axis in radians

required
euler_rotation_z

The rotation of the object around the Z-axis in radians

required
scale_x

The scaling factor applied to the object along the X-axis

required
scale_y

The scaling factor applied to the object along the Y-axis

required
scale_z

The scaling factor applied to the object along the Z-axis

required
translation_x

The displacement of the object along the X-axis in the 3D coordinate system

required
translation_y

The displacement of the object along the Y-axis in the 3D coordinate system

required
translation_z

The displacement of the object along the Z-axis in the 3D coordinate system

required
Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_node.py
class Cognite3DTransformationNodeWrite(DomainModelWrite):
    """This represents the writing version of Cognite 3D transformation node.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite 3D transformation node.
        data_record: The data record of the Cognite 3D transformation node node.
        euler_rotation_x: The rotation of the object around the X-axis in radians
        euler_rotation_y: The rotation of the object around the Y-axis in radians
        euler_rotation_z: The rotation of the object around the Z-axis in radians
        scale_x: The scaling factor applied to the object along the X-axis
        scale_y: The scaling factor applied to the object along the Y-axis
        scale_z: The scaling factor applied to the object along the Z-axis
        translation_x: The displacement of the object along the X-axis in the 3D coordinate system
        translation_y: The displacement of the object along the Y-axis in the 3D coordinate system
        translation_z: The displacement of the object along the Z-axis in the 3D coordinate system
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "euler_rotation_x",
        "euler_rotation_y",
        "euler_rotation_z",
        "scale_x",
        "scale_y",
        "scale_z",
        "translation_x",
        "translation_y",
        "translation_z",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "Cognite3DTransformation", "v1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    euler_rotation_x: Optional[float] = Field(None, alias="eulerRotationX")
    euler_rotation_y: Optional[float] = Field(None, alias="eulerRotationY")
    euler_rotation_z: Optional[float] = Field(None, alias="eulerRotationZ")
    scale_x: Optional[float] = Field(None, alias="scaleX")
    scale_y: Optional[float] = Field(None, alias="scaleY")
    scale_z: Optional[float] = Field(None, alias="scaleZ")
    translation_x: Optional[float] = Field(None, alias="translationX")
    translation_y: Optional[float] = Field(None, alias="translationY")
    translation_z: Optional[float] = Field(None, alias="translationZ")

Cognite3DTransformationNodeWriteList

Bases: DomainModelWriteList[Cognite3DTransformationNodeWrite]

List of Cognite 3D transformation nodes in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_3_d_transformation_node.py
class Cognite3DTransformationNodeWriteList(DomainModelWriteList[Cognite3DTransformationNodeWrite]):
    """List of Cognite 3D transformation nodes in the writing version."""

    _INSTANCE = Cognite3DTransformationNodeWrite

CogniteActivity

Bases: CogniteDescribableNode, CogniteSourceableNode, CogniteSchedulable

This represents the reading version of Cognite activity.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite activity.

required
data_record

The data record of the Cognite activity node.

required
aliases

Alternative names for the node

required
assets

A list of assets the activity is related to.

required
description

Description of the instance

required
end_time

The actual end time of an activity (or similar that extends this)

required
equipment

A list of equipment the activity is related to.

required
name

Name of the instance

required
scheduled_end_time

The planned end time of an activity (or similar that extends this)

required
scheduled_start_time

The planned start time of an activity (or similar that extends this)

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
start_time

The actual start time of an activity (or similar that extends this)

required
tags

Text based labels for generic use, limited to 1000

required
time_series

A list of time series the activity is related to.

required
Source code in examples/cognite_core/data_classes/_cognite_activity.py
class CogniteActivity(CogniteDescribableNode, CogniteSourceableNode, CogniteSchedulable):
    """This represents the reading version of Cognite activity.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite activity.
        data_record: The data record of the Cognite activity node.
        aliases: Alternative names for the node
        assets: A list of assets the activity is related to.
        description: Description of the instance
        end_time: The actual end time of an activity (or similar that extends this)
        equipment: A list of equipment the activity is related to.
        name: Name of the instance
        scheduled_end_time: The planned end time of an activity (or similar that extends this)
        scheduled_start_time: The planned start time of an activity (or similar that extends this)
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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: The actual start time of an activity (or similar that extends this)
        tags: Text based labels for generic use, limited to 1000
        time_series: A list of time series the activity is related to.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteActivity", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    assets: Optional[list[Union[CogniteAsset, str, dm.NodeId]]] = Field(default=None, repr=False)
    equipment: Optional[list[Union[CogniteEquipment, str, dm.NodeId]]] = Field(default=None, repr=False)
    time_series: Optional[list[Union[CogniteTimeSeries, str, dm.NodeId]]] = Field(
        default=None, repr=False, alias="timeSeries"
    )

    @field_validator("source", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    @field_validator("assets", "equipment", "time_series", mode="before")
    @classmethod
    def parse_list(cls, value: Any, info: ValidationInfo) -> Any:
        if value is None:
            return None
        return [parse_single_connection(item, info.field_name) for item in value]

    def as_write(self) -> CogniteActivityWrite:
        """Convert this read version of Cognite activity to the writing version."""
        return CogniteActivityWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite activity to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_activity.py
def as_write(self) -> CogniteActivityWrite:
    """Convert this read version of Cognite activity to the writing version."""
    return CogniteActivityWrite.model_validate(as_write_args(self))

CogniteActivityGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite activity, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite activity.

required
data_record

The data record of the Cognite activity node.

required
aliases

Alternative names for the node

required
assets

A list of assets the activity is related to.

required
description

Description of the instance

required
end_time

The actual end time of an activity (or similar that extends this)

required
equipment

A list of equipment the activity is related to.

required
name

Name of the instance

required
scheduled_end_time

The planned end time of an activity (or similar that extends this)

required
scheduled_start_time

The planned start time of an activity (or similar that extends this)

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
start_time

The actual start time of an activity (or similar that extends this)

required
tags

Text based labels for generic use, limited to 1000

required
time_series

A list of time series the activity is related to.

required
Source code in examples/cognite_core/data_classes/_cognite_activity.py
class CogniteActivityGraphQL(GraphQLCore):
    """This represents the reading version of Cognite activity, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite activity.
        data_record: The data record of the Cognite activity node.
        aliases: Alternative names for the node
        assets: A list of assets the activity is related to.
        description: Description of the instance
        end_time: The actual end time of an activity (or similar that extends this)
        equipment: A list of equipment the activity is related to.
        name: Name of the instance
        scheduled_end_time: The planned end time of an activity (or similar that extends this)
        scheduled_start_time: The planned start time of an activity (or similar that extends this)
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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: The actual start time of an activity (or similar that extends this)
        tags: Text based labels for generic use, limited to 1000
        time_series: A list of time series the activity is related to.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteActivity", "v1")
    aliases: Optional[list[str]] = None
    assets: Optional[list[CogniteAssetGraphQL]] = Field(default=None, repr=False)
    description: Optional[str] = None
    end_time: Optional[datetime.datetime] = Field(None, alias="endTime")
    equipment: Optional[list[CogniteEquipmentGraphQL]] = Field(default=None, repr=False)
    name: Optional[str] = None
    scheduled_end_time: Optional[datetime.datetime] = Field(None, alias="scheduledEndTime")
    scheduled_start_time: Optional[datetime.datetime] = Field(None, alias="scheduledStartTime")
    source: Optional[CogniteSourceSystemGraphQL] = Field(default=None, repr=False)
    source_context: Optional[str] = Field(None, alias="sourceContext")
    source_created_time: Optional[datetime.datetime] = Field(None, alias="sourceCreatedTime")
    source_created_user: Optional[str] = Field(None, alias="sourceCreatedUser")
    source_id: Optional[str] = Field(None, alias="sourceId")
    source_updated_time: Optional[datetime.datetime] = Field(None, alias="sourceUpdatedTime")
    source_updated_user: Optional[str] = Field(None, alias="sourceUpdatedUser")
    start_time: Optional[datetime.datetime] = Field(None, alias="startTime")
    tags: Optional[list[str]] = None
    time_series: Optional[list[CogniteTimeSeriesGraphQL]] = Field(default=None, repr=False, alias="timeSeries")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("assets", "equipment", "source", "time_series", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> CogniteActivity:
        """Convert this GraphQL format of Cognite activity to the reading format."""
        return CogniteActivity.model_validate(as_read_args(self))

    def as_write(self) -> CogniteActivityWrite:
        """Convert this GraphQL format of Cognite activity to the writing format."""
        return CogniteActivityWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite activity to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_activity.py
def as_read(self) -> CogniteActivity:
    """Convert this GraphQL format of Cognite activity to the reading format."""
    return CogniteActivity.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite activity to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_activity.py
def as_write(self) -> CogniteActivityWrite:
    """Convert this GraphQL format of Cognite activity to the writing format."""
    return CogniteActivityWrite.model_validate(as_write_args(self))

CogniteActivityList

Bases: DomainModelList[CogniteActivity]

List of Cognite activities in the read version.

Source code in examples/cognite_core/data_classes/_cognite_activity.py
class CogniteActivityList(DomainModelList[CogniteActivity]):
    """List of Cognite activities in the read version."""

    _INSTANCE = CogniteActivity

    def as_write(self) -> CogniteActivityWriteList:
        """Convert these read versions of Cognite activity to the writing versions."""
        return CogniteActivityWriteList([node.as_write() for node in self.data])

    @property
    def assets(self) -> CogniteAssetList:
        from ._cognite_asset import CogniteAsset, CogniteAssetList

        return CogniteAssetList(
            [item for items in self.data for item in items.assets or [] if isinstance(item, CogniteAsset)]
        )

    @property
    def equipment(self) -> CogniteEquipmentList:
        from ._cognite_equipment import CogniteEquipment, CogniteEquipmentList

        return CogniteEquipmentList(
            [item for items in self.data for item in items.equipment or [] if isinstance(item, CogniteEquipment)]
        )

    @property
    def source(self) -> CogniteSourceSystemList:
        from ._cognite_source_system import CogniteSourceSystem, CogniteSourceSystemList

        return CogniteSourceSystemList(
            [item.source for item in self.data if isinstance(item.source, CogniteSourceSystem)]
        )

    @property
    def time_series(self) -> CogniteTimeSeriesList:
        from ._cognite_time_series import CogniteTimeSeries, CogniteTimeSeriesList

        return CogniteTimeSeriesList(
            [item for items in self.data for item in items.time_series or [] if isinstance(item, CogniteTimeSeries)]
        )

as_write()

Convert these read versions of Cognite activity to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_activity.py
def as_write(self) -> CogniteActivityWriteList:
    """Convert these read versions of Cognite activity to the writing versions."""
    return CogniteActivityWriteList([node.as_write() for node in self.data])

CogniteActivityWrite

Bases: CogniteDescribableNodeWrite, CogniteSourceableNodeWrite, CogniteSchedulableWrite

This represents the writing version of Cognite activity.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite activity.

required
data_record

The data record of the Cognite activity node.

required
aliases

Alternative names for the node

required
assets

A list of assets the activity is related to.

required
description

Description of the instance

required
end_time

The actual end time of an activity (or similar that extends this)

required
equipment

A list of equipment the activity is related to.

required
name

Name of the instance

required
scheduled_end_time

The planned end time of an activity (or similar that extends this)

required
scheduled_start_time

The planned start time of an activity (or similar that extends this)

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
start_time

The actual start time of an activity (or similar that extends this)

required
tags

Text based labels for generic use, limited to 1000

required
time_series

A list of time series the activity is related to.

required
Source code in examples/cognite_core/data_classes/_cognite_activity.py
class CogniteActivityWrite(CogniteDescribableNodeWrite, CogniteSourceableNodeWrite, CogniteSchedulableWrite):
    """This represents the writing version of Cognite activity.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite activity.
        data_record: The data record of the Cognite activity node.
        aliases: Alternative names for the node
        assets: A list of assets the activity is related to.
        description: Description of the instance
        end_time: The actual end time of an activity (or similar that extends this)
        equipment: A list of equipment the activity is related to.
        name: Name of the instance
        scheduled_end_time: The planned end time of an activity (or similar that extends this)
        scheduled_start_time: The planned start time of an activity (or similar that extends this)
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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: The actual start time of an activity (or similar that extends this)
        tags: Text based labels for generic use, limited to 1000
        time_series: A list of time series the activity is related to.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "assets",
        "description",
        "end_time",
        "equipment",
        "name",
        "scheduled_end_time",
        "scheduled_start_time",
        "source",
        "source_context",
        "source_created_time",
        "source_created_user",
        "source_id",
        "source_updated_time",
        "source_updated_user",
        "start_time",
        "tags",
        "time_series",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = (
        "assets",
        "equipment",
        "source",
        "time_series",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteActivity", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    assets: Optional[list[Union[CogniteAssetWrite, str, dm.NodeId]]] = Field(default=None, repr=False)
    equipment: Optional[list[Union[CogniteEquipmentWrite, str, dm.NodeId]]] = Field(default=None, repr=False)
    time_series: Optional[list[Union[CogniteTimeSeriesWrite, str, dm.NodeId]]] = Field(
        default=None, repr=False, alias="timeSeries"
    )

    @field_validator("assets", "equipment", "time_series", mode="before")
    def as_node_id(cls, value: Any) -> Any:
        if isinstance(value, dm.DirectRelationReference):
            return dm.NodeId(value.space, value.external_id)
        elif isinstance(value, tuple) and len(value) == 2 and all(isinstance(item, str) for item in value):
            return dm.NodeId(value[0], value[1])
        elif isinstance(value, list):
            return [cls.as_node_id(item) for item in value]
        return value

CogniteActivityWriteList

Bases: DomainModelWriteList[CogniteActivityWrite]

List of Cognite activities in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_activity.py
class CogniteActivityWriteList(DomainModelWriteList[CogniteActivityWrite]):
    """List of Cognite activities in the writing version."""

    _INSTANCE = CogniteActivityWrite

    @property
    def assets(self) -> CogniteAssetWriteList:
        from ._cognite_asset import CogniteAssetWrite, CogniteAssetWriteList

        return CogniteAssetWriteList(
            [item for items in self.data for item in items.assets or [] if isinstance(item, CogniteAssetWrite)]
        )

    @property
    def equipment(self) -> CogniteEquipmentWriteList:
        from ._cognite_equipment import CogniteEquipmentWrite, CogniteEquipmentWriteList

        return CogniteEquipmentWriteList(
            [item for items in self.data for item in items.equipment or [] if isinstance(item, CogniteEquipmentWrite)]
        )

    @property
    def source(self) -> CogniteSourceSystemWriteList:
        from ._cognite_source_system import CogniteSourceSystemWrite, CogniteSourceSystemWriteList

        return CogniteSourceSystemWriteList(
            [item.source for item in self.data if isinstance(item.source, CogniteSourceSystemWrite)]
        )

    @property
    def time_series(self) -> CogniteTimeSeriesWriteList:
        from ._cognite_time_series import CogniteTimeSeriesWrite, CogniteTimeSeriesWriteList

        return CogniteTimeSeriesWriteList(
            [
                item
                for items in self.data
                for item in items.time_series or []
                if isinstance(item, CogniteTimeSeriesWrite)
            ]
        )

CogniteAnnotation

Bases: CogniteDescribableEdge, CogniteSourceableEdge

This represents the reading version of Cognite annotation.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite annotation.

required
data_record

The data record of the Cognite annotation edge.

required
end_node

The end node of this edge.

required
aliases

Alternative names for the node

required
confidence

The confidence that the annotation is a good match

required
description

Description of the instance

required
name

Name of the instance

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
status

The status of the annotation

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_annotation.py
class CogniteAnnotation(CogniteDescribableEdge, CogniteSourceableEdge):
    """This represents the reading version of Cognite annotation.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite annotation.
        data_record: The data record of the Cognite annotation edge.
        end_node: The end node of this edge.
        aliases: Alternative names for the node
        confidence: The confidence that the annotation is a good match
        description: Description of the instance
        name: Name of the instance
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        status: The status of the annotation
        tags: Text based labels for generic use, limited to 1000
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteAnnotation", "v1")
    space: str = DEFAULT_INSTANCE_SPACE
    confidence: Optional[float] = None
    status: Optional[Literal["Approved", "Rejected", "Suggested"]] | str = None

    def as_write(self) -> CogniteAnnotationWrite:
        """Convert this read version of Cognite annotation to the writing version."""
        return CogniteAnnotationWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite annotation to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_annotation.py
def as_write(self) -> CogniteAnnotationWrite:
    """Convert this read version of Cognite annotation to the writing version."""
    return CogniteAnnotationWrite.model_validate(as_write_args(self))

CogniteAnnotationGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite annotation, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite annotation.

required
data_record

The data record of the Cognite annotation node.

required
end_node

The end node of this edge.

required
aliases

Alternative names for the node

required
confidence

The confidence that the annotation is a good match

required
description

Description of the instance

required
name

Name of the instance

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
status

The status of the annotation

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_annotation.py
class CogniteAnnotationGraphQL(GraphQLCore):
    """This represents the reading version of Cognite annotation, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite annotation.
        data_record: The data record of the Cognite annotation node.
        end_node: The end node of this edge.
        aliases: Alternative names for the node
        confidence: The confidence that the annotation is a good match
        description: Description of the instance
        name: Name of the instance
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        status: The status of the annotation
        tags: Text based labels for generic use, limited to 1000
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteAnnotation", "v1")
    end_node: Union[dm.NodeId, None] = Field(None, alias="endNode")
    aliases: Optional[list[str]] = None
    confidence: Optional[float] = None
    description: Optional[str] = None
    name: Optional[str] = None
    source: Optional[CogniteSourceSystemGraphQL] = Field(default=None, repr=False)
    source_context: Optional[str] = Field(None, alias="sourceContext")
    source_created_time: Optional[datetime.datetime] = Field(None, alias="sourceCreatedTime")
    source_created_user: Optional[str] = Field(None, alias="sourceCreatedUser")
    source_id: Optional[str] = Field(None, alias="sourceId")
    source_updated_time: Optional[datetime.datetime] = Field(None, alias="sourceUpdatedTime")
    source_updated_user: Optional[str] = Field(None, alias="sourceUpdatedUser")
    status: Optional[Literal["Approved", "Rejected", "Suggested"]] = None
    tags: Optional[list[str]] = None

    def as_read(self) -> CogniteAnnotation:
        """Convert this GraphQL format of Cognite annotation to the reading format."""
        return CogniteAnnotation.model_validate(as_read_args(self))

    def as_write(self) -> CogniteAnnotationWrite:
        """Convert this GraphQL format of Cognite annotation to the writing format."""
        return CogniteAnnotationWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite annotation to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_annotation.py
def as_read(self) -> CogniteAnnotation:
    """Convert this GraphQL format of Cognite annotation to the reading format."""
    return CogniteAnnotation.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite annotation to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_annotation.py
def as_write(self) -> CogniteAnnotationWrite:
    """Convert this GraphQL format of Cognite annotation to the writing format."""
    return CogniteAnnotationWrite.model_validate(as_write_args(self))

CogniteAnnotationList

Bases: DomainRelationList[CogniteAnnotation]

List of Cognite annotations in the reading version.

Source code in examples/cognite_core/data_classes/_cognite_annotation.py
class CogniteAnnotationList(DomainRelationList[CogniteAnnotation]):
    """List of Cognite annotations in the reading version."""

    _INSTANCE = CogniteAnnotation

    def as_write(self) -> CogniteAnnotationWriteList:
        """Convert this read version of Cognite annotation list to the writing version."""
        return CogniteAnnotationWriteList([edge.as_write() for edge in self])

as_write()

Convert this read version of Cognite annotation list to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_annotation.py
def as_write(self) -> CogniteAnnotationWriteList:
    """Convert this read version of Cognite annotation list to the writing version."""
    return CogniteAnnotationWriteList([edge.as_write() for edge in self])

CogniteAnnotationWrite

Bases: CogniteDescribableEdgeWrite, CogniteSourceableEdgeWrite

This represents the writing version of Cognite annotation.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite annotation.

required
data_record

The data record of the Cognite annotation edge.

required
end_node

The end node of this edge.

required
aliases

Alternative names for the node

required
confidence

The confidence that the annotation is a good match

required
description

Description of the instance

required
name

Name of the instance

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
status

The status of the annotation

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_annotation.py
class CogniteAnnotationWrite(CogniteDescribableEdgeWrite, CogniteSourceableEdgeWrite):
    """This represents the writing version of Cognite annotation.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite annotation.
        data_record: The data record of the Cognite annotation edge.
        end_node: The end node of this edge.
        aliases: Alternative names for the node
        confidence: The confidence that the annotation is a good match
        description: Description of the instance
        name: Name of the instance
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        status: The status of the annotation
        tags: Text based labels for generic use, limited to 1000
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "confidence",
        "description",
        "name",
        "source",
        "source_context",
        "source_created_time",
        "source_created_user",
        "source_id",
        "source_updated_time",
        "source_updated_user",
        "status",
        "tags",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = ("source",)
    _validate_end_node = _validate_end_node

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteAnnotation", "v1")
    confidence: Optional[float] = None
    status: Optional[Literal["Approved", "Rejected", "Suggested"]] = None

CogniteAnnotationWriteList

Bases: DomainRelationWriteList[CogniteAnnotationWrite]

List of Cognite annotations in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_annotation.py
class CogniteAnnotationWriteList(DomainRelationWriteList[CogniteAnnotationWrite]):
    """List of Cognite annotations in the writing version."""

    _INSTANCE = CogniteAnnotationWrite

CogniteAsset

Bases: CogniteVisualizable, CogniteDescribableNode, CogniteSourceableNode

This represents the reading version of Cognite asset.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite asset.

required
data_record

The data record of the Cognite asset node.

required
activities

An automatically updated list of activities related to the asset.

required
aliases

Alternative names for the node

required
asset_class

Specifies the class of the asset. It's a direct relation to CogniteAssetClass.

required
children

An automatically updated list of assets with this asset as their parent.

required
description

Description of the instance

required
equipment

An automatically updated list of equipment related to the asset.

required
files

An automatically updated list of files related to the asset.

required
name

Name of the instance

required
object_3d

Direct relation to an Object3D instance representing the 3D resource

required
parent

The parent of the asset.

required
path

An automatically updated ordered list of this asset's ancestors, starting with the root asset. Enables subtree filtering to find all assets under a parent.

required
path_last_updated_time

The last time the path was updated for this asset.

required
root

An automatically updated reference to the top-level asset of the hierarchy.

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
tags

Text based labels for generic use, limited to 1000

required
time_series

An automatically updated list of time series related to the asset.

required
type_

Specifies the type of the asset. It's a direct relation to CogniteAssetType.

required
Source code in examples/cognite_core/data_classes/_cognite_asset.py
class CogniteAsset(CogniteVisualizable, CogniteDescribableNode, CogniteSourceableNode):
    """This represents the reading version of Cognite asset.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite asset.
        data_record: The data record of the Cognite asset node.
        activities: An automatically updated list of activities related to the asset.
        aliases: Alternative names for the node
        asset_class: Specifies the class of the asset. It's a direct relation to CogniteAssetClass.
        children: An automatically updated list of assets with this asset as their parent.
        description: Description of the instance
        equipment: An automatically updated list of equipment related to the asset.
        files: An automatically updated list of files related to the asset.
        name: Name of the instance
        object_3d: Direct relation to an Object3D instance representing the 3D resource
        parent: The parent of the asset.
        path: An automatically updated ordered list of this asset's ancestors, starting with the root asset. Enables
            subtree filtering to find all assets under a parent.
        path_last_updated_time: The last time the path was updated for this asset.
        root: An automatically updated reference to the top-level asset of the hierarchy.
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        tags: Text based labels for generic use, limited to 1000
        time_series: An automatically updated list of time series related to the asset.
        type_: Specifies the type of the asset. It's a direct relation to CogniteAssetType.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteAsset", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    activities: Optional[list[CogniteActivity]] = Field(default=None, repr=False)
    asset_class: Union[CogniteAssetClass, str, dm.NodeId, None] = Field(default=None, repr=False, alias="assetClass")
    children: Optional[list[CogniteAsset]] = Field(default=None, repr=False)
    equipment: Optional[list[CogniteEquipment]] = Field(default=None, repr=False)
    files: Optional[list[CogniteFile]] = Field(default=None, repr=False)
    parent: Union[CogniteAsset, str, dm.NodeId, None] = Field(default=None, repr=False)
    path: Optional[list[Union[CogniteAsset, str, dm.NodeId]]] = Field(default=None, repr=False)
    path_last_updated_time: Optional[datetime.datetime] = Field(None, alias="pathLastUpdatedTime")
    root: Union[CogniteAsset, str, dm.NodeId, None] = Field(default=None, repr=False)
    time_series: Optional[list[CogniteTimeSeries]] = Field(default=None, repr=False, alias="timeSeries")
    type_: Union[CogniteAssetType, str, dm.NodeId, None] = Field(default=None, repr=False, alias="type")

    @field_validator("asset_class", "object_3d", "parent", "root", "source", "type_", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    @field_validator("activities", "children", "equipment", "files", "path", "time_series", mode="before")
    @classmethod
    def parse_list(cls, value: Any, info: ValidationInfo) -> Any:
        if value is None:
            return None
        return [parse_single_connection(item, info.field_name) for item in value]

    def as_write(self) -> CogniteAssetWrite:
        """Convert this read version of Cognite asset to the writing version."""
        return CogniteAssetWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite asset to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_asset.py
def as_write(self) -> CogniteAssetWrite:
    """Convert this read version of Cognite asset to the writing version."""
    return CogniteAssetWrite.model_validate(as_write_args(self))

CogniteAssetClass

Bases: CogniteDescribableNode

This represents the reading version of Cognite asset clas.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite asset clas.

required
data_record

The data record of the Cognite asset clas node.

required
aliases

Alternative names for the node

required
code

A unique identifier for the class of asset.

required
description

Description of the instance

required
name

Name of the instance

required
standard

A text string to specify which standard the class is from.

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_asset_class.py
class CogniteAssetClass(CogniteDescribableNode):
    """This represents the reading version of Cognite asset clas.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite asset clas.
        data_record: The data record of the Cognite asset clas node.
        aliases: Alternative names for the node
        code: A unique identifier for the class of asset.
        description: Description of the instance
        name: Name of the instance
        standard: A text string to specify which standard the class is from.
        tags: Text based labels for generic use, limited to 1000
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteAssetClass", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    code: Optional[str] = None
    standard: Optional[str] = None

    def as_write(self) -> CogniteAssetClassWrite:
        """Convert this read version of Cognite asset clas to the writing version."""
        return CogniteAssetClassWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite asset clas to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_asset_class.py
def as_write(self) -> CogniteAssetClassWrite:
    """Convert this read version of Cognite asset clas to the writing version."""
    return CogniteAssetClassWrite.model_validate(as_write_args(self))

CogniteAssetClassGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite asset clas, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite asset clas.

required
data_record

The data record of the Cognite asset clas node.

required
aliases

Alternative names for the node

required
code

A unique identifier for the class of asset.

required
description

Description of the instance

required
name

Name of the instance

required
standard

A text string to specify which standard the class is from.

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_asset_class.py
class CogniteAssetClassGraphQL(GraphQLCore):
    """This represents the reading version of Cognite asset clas, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite asset clas.
        data_record: The data record of the Cognite asset clas node.
        aliases: Alternative names for the node
        code: A unique identifier for the class of asset.
        description: Description of the instance
        name: Name of the instance
        standard: A text string to specify which standard the class is from.
        tags: Text based labels for generic use, limited to 1000
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteAssetClass", "v1")
    aliases: Optional[list[str]] = None
    code: Optional[str] = None
    description: Optional[str] = None
    name: Optional[str] = None
    standard: Optional[str] = None
    tags: Optional[list[str]] = None

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    def as_read(self) -> CogniteAssetClass:
        """Convert this GraphQL format of Cognite asset clas to the reading format."""
        return CogniteAssetClass.model_validate(as_read_args(self))

    def as_write(self) -> CogniteAssetClassWrite:
        """Convert this GraphQL format of Cognite asset clas to the writing format."""
        return CogniteAssetClassWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite asset clas to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_asset_class.py
def as_read(self) -> CogniteAssetClass:
    """Convert this GraphQL format of Cognite asset clas to the reading format."""
    return CogniteAssetClass.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite asset clas to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_asset_class.py
def as_write(self) -> CogniteAssetClassWrite:
    """Convert this GraphQL format of Cognite asset clas to the writing format."""
    return CogniteAssetClassWrite.model_validate(as_write_args(self))

CogniteAssetClassList

Bases: DomainModelList[CogniteAssetClass]

List of Cognite asset class in the read version.

Source code in examples/cognite_core/data_classes/_cognite_asset_class.py
class CogniteAssetClassList(DomainModelList[CogniteAssetClass]):
    """List of Cognite asset class in the read version."""

    _INSTANCE = CogniteAssetClass

    def as_write(self) -> CogniteAssetClassWriteList:
        """Convert these read versions of Cognite asset clas to the writing versions."""
        return CogniteAssetClassWriteList([node.as_write() for node in self.data])

as_write()

Convert these read versions of Cognite asset clas to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_asset_class.py
def as_write(self) -> CogniteAssetClassWriteList:
    """Convert these read versions of Cognite asset clas to the writing versions."""
    return CogniteAssetClassWriteList([node.as_write() for node in self.data])

CogniteAssetClassWrite

Bases: CogniteDescribableNodeWrite

This represents the writing version of Cognite asset clas.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite asset clas.

required
data_record

The data record of the Cognite asset clas node.

required
aliases

Alternative names for the node

required
code

A unique identifier for the class of asset.

required
description

Description of the instance

required
name

Name of the instance

required
standard

A text string to specify which standard the class is from.

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_asset_class.py
class CogniteAssetClassWrite(CogniteDescribableNodeWrite):
    """This represents the writing version of Cognite asset clas.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite asset clas.
        data_record: The data record of the Cognite asset clas node.
        aliases: Alternative names for the node
        code: A unique identifier for the class of asset.
        description: Description of the instance
        name: Name of the instance
        standard: A text string to specify which standard the class is from.
        tags: Text based labels for generic use, limited to 1000
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "code",
        "description",
        "name",
        "standard",
        "tags",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteAssetClass", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    code: Optional[str] = None
    standard: Optional[str] = None

CogniteAssetClassWriteList

Bases: DomainModelWriteList[CogniteAssetClassWrite]

List of Cognite asset class in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_asset_class.py
class CogniteAssetClassWriteList(DomainModelWriteList[CogniteAssetClassWrite]):
    """List of Cognite asset class in the writing version."""

    _INSTANCE = CogniteAssetClassWrite

CogniteAssetGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite asset, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite asset.

required
data_record

The data record of the Cognite asset node.

required
activities

An automatically updated list of activities related to the asset.

required
aliases

Alternative names for the node

required
asset_class

Specifies the class of the asset. It's a direct relation to CogniteAssetClass.

required
children

An automatically updated list of assets with this asset as their parent.

required
description

Description of the instance

required
equipment

An automatically updated list of equipment related to the asset.

required
files

An automatically updated list of files related to the asset.

required
name

Name of the instance

required
object_3d

Direct relation to an Object3D instance representing the 3D resource

required
parent

The parent of the asset.

required
path

An automatically updated ordered list of this asset's ancestors, starting with the root asset. Enables subtree filtering to find all assets under a parent.

required
path_last_updated_time

The last time the path was updated for this asset.

required
root

An automatically updated reference to the top-level asset of the hierarchy.

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
tags

Text based labels for generic use, limited to 1000

required
time_series

An automatically updated list of time series related to the asset.

required
type_

Specifies the type of the asset. It's a direct relation to CogniteAssetType.

required
Source code in examples/cognite_core/data_classes/_cognite_asset.py
class CogniteAssetGraphQL(GraphQLCore):
    """This represents the reading version of Cognite asset, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite asset.
        data_record: The data record of the Cognite asset node.
        activities: An automatically updated list of activities related to the asset.
        aliases: Alternative names for the node
        asset_class: Specifies the class of the asset. It's a direct relation to CogniteAssetClass.
        children: An automatically updated list of assets with this asset as their parent.
        description: Description of the instance
        equipment: An automatically updated list of equipment related to the asset.
        files: An automatically updated list of files related to the asset.
        name: Name of the instance
        object_3d: Direct relation to an Object3D instance representing the 3D resource
        parent: The parent of the asset.
        path: An automatically updated ordered list of this asset's ancestors, starting with the root asset. Enables
            subtree filtering to find all assets under a parent.
        path_last_updated_time: The last time the path was updated for this asset.
        root: An automatically updated reference to the top-level asset of the hierarchy.
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        tags: Text based labels for generic use, limited to 1000
        time_series: An automatically updated list of time series related to the asset.
        type_: Specifies the type of the asset. It's a direct relation to CogniteAssetType.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteAsset", "v1")
    activities: Optional[list[CogniteActivityGraphQL]] = Field(default=None, repr=False)
    aliases: Optional[list[str]] = None
    asset_class: Optional[CogniteAssetClassGraphQL] = Field(default=None, repr=False, alias="assetClass")
    children: Optional[list[CogniteAssetGraphQL]] = Field(default=None, repr=False)
    description: Optional[str] = None
    equipment: Optional[list[CogniteEquipmentGraphQL]] = Field(default=None, repr=False)
    files: Optional[list[CogniteFileGraphQL]] = Field(default=None, repr=False)
    name: Optional[str] = None
    object_3d: Optional[Cognite3DObjectGraphQL] = Field(default=None, repr=False, alias="object3D")
    parent: Optional[CogniteAssetGraphQL] = Field(default=None, repr=False)
    path: Optional[list[CogniteAssetGraphQL]] = Field(default=None, repr=False)
    path_last_updated_time: Optional[datetime.datetime] = Field(None, alias="pathLastUpdatedTime")
    root: Optional[CogniteAssetGraphQL] = Field(default=None, repr=False)
    source: Optional[CogniteSourceSystemGraphQL] = Field(default=None, repr=False)
    source_context: Optional[str] = Field(None, alias="sourceContext")
    source_created_time: Optional[datetime.datetime] = Field(None, alias="sourceCreatedTime")
    source_created_user: Optional[str] = Field(None, alias="sourceCreatedUser")
    source_id: Optional[str] = Field(None, alias="sourceId")
    source_updated_time: Optional[datetime.datetime] = Field(None, alias="sourceUpdatedTime")
    source_updated_user: Optional[str] = Field(None, alias="sourceUpdatedUser")
    tags: Optional[list[str]] = None
    time_series: Optional[list[CogniteTimeSeriesGraphQL]] = Field(default=None, repr=False, alias="timeSeries")
    type_: Optional[CogniteAssetTypeGraphQL] = Field(default=None, repr=False, alias="type")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator(
        "activities",
        "asset_class",
        "children",
        "equipment",
        "files",
        "object_3d",
        "parent",
        "path",
        "root",
        "source",
        "time_series",
        "type_",
        mode="before",
    )
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> CogniteAsset:
        """Convert this GraphQL format of Cognite asset to the reading format."""
        return CogniteAsset.model_validate(as_read_args(self))

    def as_write(self) -> CogniteAssetWrite:
        """Convert this GraphQL format of Cognite asset to the writing format."""
        return CogniteAssetWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite asset to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_asset.py
def as_read(self) -> CogniteAsset:
    """Convert this GraphQL format of Cognite asset to the reading format."""
    return CogniteAsset.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite asset to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_asset.py
def as_write(self) -> CogniteAssetWrite:
    """Convert this GraphQL format of Cognite asset to the writing format."""
    return CogniteAssetWrite.model_validate(as_write_args(self))

CogniteAssetList

Bases: DomainModelList[CogniteAsset]

List of Cognite assets in the read version.

Source code in examples/cognite_core/data_classes/_cognite_asset.py
class CogniteAssetList(DomainModelList[CogniteAsset]):
    """List of Cognite assets in the read version."""

    _INSTANCE = CogniteAsset

    def as_write(self) -> CogniteAssetWriteList:
        """Convert these read versions of Cognite asset to the writing versions."""
        return CogniteAssetWriteList([node.as_write() for node in self.data])

    @property
    def activities(self) -> CogniteActivityList:
        from ._cognite_activity import CogniteActivity, CogniteActivityList

        return CogniteActivityList(
            [item for items in self.data for item in items.activities or [] if isinstance(item, CogniteActivity)]
        )

    @property
    def asset_class(self) -> CogniteAssetClassList:
        from ._cognite_asset_class import CogniteAssetClass, CogniteAssetClassList

        return CogniteAssetClassList(
            [item.asset_class for item in self.data if isinstance(item.asset_class, CogniteAssetClass)]
        )

    @property
    def children(self) -> CogniteAssetList:
        return CogniteAssetList(
            [item for items in self.data for item in items.children or [] if isinstance(item, CogniteAsset)]
        )

    @property
    def equipment(self) -> CogniteEquipmentList:
        from ._cognite_equipment import CogniteEquipment, CogniteEquipmentList

        return CogniteEquipmentList(
            [item for items in self.data for item in items.equipment or [] if isinstance(item, CogniteEquipment)]
        )

    @property
    def files(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList(
            [item for items in self.data for item in items.files or [] if isinstance(item, CogniteFile)]
        )

    @property
    def object_3d(self) -> Cognite3DObjectList:
        from ._cognite_3_d_object import Cognite3DObject, Cognite3DObjectList

        return Cognite3DObjectList(
            [item.object_3d for item in self.data if isinstance(item.object_3d, Cognite3DObject)]
        )

    @property
    def parent(self) -> CogniteAssetList:
        return CogniteAssetList([item.parent for item in self.data if isinstance(item.parent, CogniteAsset)])

    @property
    def path(self) -> CogniteAssetList:
        return CogniteAssetList(
            [item for items in self.data for item in items.path or [] if isinstance(item, CogniteAsset)]
        )

    @property
    def root(self) -> CogniteAssetList:
        return CogniteAssetList([item.root for item in self.data if isinstance(item.root, CogniteAsset)])

    @property
    def source(self) -> CogniteSourceSystemList:
        from ._cognite_source_system import CogniteSourceSystem, CogniteSourceSystemList

        return CogniteSourceSystemList(
            [item.source for item in self.data if isinstance(item.source, CogniteSourceSystem)]
        )

    @property
    def time_series(self) -> CogniteTimeSeriesList:
        from ._cognite_time_series import CogniteTimeSeries, CogniteTimeSeriesList

        return CogniteTimeSeriesList(
            [item for items in self.data for item in items.time_series or [] if isinstance(item, CogniteTimeSeries)]
        )

    @property
    def type_(self) -> CogniteAssetTypeList:
        from ._cognite_asset_type import CogniteAssetType, CogniteAssetTypeList

        return CogniteAssetTypeList([item.type_ for item in self.data if isinstance(item.type_, CogniteAssetType)])

as_write()

Convert these read versions of Cognite asset to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_asset.py
def as_write(self) -> CogniteAssetWriteList:
    """Convert these read versions of Cognite asset to the writing versions."""
    return CogniteAssetWriteList([node.as_write() for node in self.data])

CogniteAssetType

Bases: CogniteDescribableNode

This represents the reading version of Cognite asset type.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite asset type.

required
data_record

The data record of the Cognite asset type node.

required
aliases

Alternative names for the node

required
asset_class

Specifies the class the type belongs to. It's a direct relation to CogniteAssetClass.

required
code

A unique identifier for the type of asset.

required
description

Description of the instance

required
name

Name of the instance

required
standard

A text string to specify which standard the type is from.

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_asset_type.py
class CogniteAssetType(CogniteDescribableNode):
    """This represents the reading version of Cognite asset type.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite asset type.
        data_record: The data record of the Cognite asset type node.
        aliases: Alternative names for the node
        asset_class: Specifies the class the type belongs to. It's a direct relation to CogniteAssetClass.
        code: A unique identifier for the type of asset.
        description: Description of the instance
        name: Name of the instance
        standard: A text string to specify which standard the type is from.
        tags: Text based labels for generic use, limited to 1000
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteAssetType", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    asset_class: Union[CogniteAssetClass, str, dm.NodeId, None] = Field(default=None, repr=False, alias="assetClass")
    code: Optional[str] = None
    standard: Optional[str] = None

    @field_validator("asset_class", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    def as_write(self) -> CogniteAssetTypeWrite:
        """Convert this read version of Cognite asset type to the writing version."""
        return CogniteAssetTypeWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite asset type to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_asset_type.py
def as_write(self) -> CogniteAssetTypeWrite:
    """Convert this read version of Cognite asset type to the writing version."""
    return CogniteAssetTypeWrite.model_validate(as_write_args(self))

CogniteAssetTypeGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite asset type, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite asset type.

required
data_record

The data record of the Cognite asset type node.

required
aliases

Alternative names for the node

required
asset_class

Specifies the class the type belongs to. It's a direct relation to CogniteAssetClass.

required
code

A unique identifier for the type of asset.

required
description

Description of the instance

required
name

Name of the instance

required
standard

A text string to specify which standard the type is from.

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_asset_type.py
class CogniteAssetTypeGraphQL(GraphQLCore):
    """This represents the reading version of Cognite asset type, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite asset type.
        data_record: The data record of the Cognite asset type node.
        aliases: Alternative names for the node
        asset_class: Specifies the class the type belongs to. It's a direct relation to CogniteAssetClass.
        code: A unique identifier for the type of asset.
        description: Description of the instance
        name: Name of the instance
        standard: A text string to specify which standard the type is from.
        tags: Text based labels for generic use, limited to 1000
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteAssetType", "v1")
    aliases: Optional[list[str]] = None
    asset_class: Optional[CogniteAssetClassGraphQL] = Field(default=None, repr=False, alias="assetClass")
    code: Optional[str] = None
    description: Optional[str] = None
    name: Optional[str] = None
    standard: Optional[str] = None
    tags: Optional[list[str]] = None

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("asset_class", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> CogniteAssetType:
        """Convert this GraphQL format of Cognite asset type to the reading format."""
        return CogniteAssetType.model_validate(as_read_args(self))

    def as_write(self) -> CogniteAssetTypeWrite:
        """Convert this GraphQL format of Cognite asset type to the writing format."""
        return CogniteAssetTypeWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite asset type to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_asset_type.py
def as_read(self) -> CogniteAssetType:
    """Convert this GraphQL format of Cognite asset type to the reading format."""
    return CogniteAssetType.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite asset type to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_asset_type.py
def as_write(self) -> CogniteAssetTypeWrite:
    """Convert this GraphQL format of Cognite asset type to the writing format."""
    return CogniteAssetTypeWrite.model_validate(as_write_args(self))

CogniteAssetTypeList

Bases: DomainModelList[CogniteAssetType]

List of Cognite asset types in the read version.

Source code in examples/cognite_core/data_classes/_cognite_asset_type.py
class CogniteAssetTypeList(DomainModelList[CogniteAssetType]):
    """List of Cognite asset types in the read version."""

    _INSTANCE = CogniteAssetType

    def as_write(self) -> CogniteAssetTypeWriteList:
        """Convert these read versions of Cognite asset type to the writing versions."""
        return CogniteAssetTypeWriteList([node.as_write() for node in self.data])

    @property
    def asset_class(self) -> CogniteAssetClassList:
        from ._cognite_asset_class import CogniteAssetClass, CogniteAssetClassList

        return CogniteAssetClassList(
            [item.asset_class for item in self.data if isinstance(item.asset_class, CogniteAssetClass)]
        )

as_write()

Convert these read versions of Cognite asset type to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_asset_type.py
def as_write(self) -> CogniteAssetTypeWriteList:
    """Convert these read versions of Cognite asset type to the writing versions."""
    return CogniteAssetTypeWriteList([node.as_write() for node in self.data])

CogniteAssetTypeWrite

Bases: CogniteDescribableNodeWrite

This represents the writing version of Cognite asset type.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite asset type.

required
data_record

The data record of the Cognite asset type node.

required
aliases

Alternative names for the node

required
asset_class

Specifies the class the type belongs to. It's a direct relation to CogniteAssetClass.

required
code

A unique identifier for the type of asset.

required
description

Description of the instance

required
name

Name of the instance

required
standard

A text string to specify which standard the type is from.

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_asset_type.py
class CogniteAssetTypeWrite(CogniteDescribableNodeWrite):
    """This represents the writing version of Cognite asset type.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite asset type.
        data_record: The data record of the Cognite asset type node.
        aliases: Alternative names for the node
        asset_class: Specifies the class the type belongs to. It's a direct relation to CogniteAssetClass.
        code: A unique identifier for the type of asset.
        description: Description of the instance
        name: Name of the instance
        standard: A text string to specify which standard the type is from.
        tags: Text based labels for generic use, limited to 1000
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "asset_class",
        "code",
        "description",
        "name",
        "standard",
        "tags",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = ("asset_class",)

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteAssetType", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    asset_class: Union[CogniteAssetClassWrite, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="assetClass"
    )
    code: Optional[str] = None
    standard: Optional[str] = None

    @field_validator("asset_class", mode="before")
    def as_node_id(cls, value: Any) -> Any:
        if isinstance(value, dm.DirectRelationReference):
            return dm.NodeId(value.space, value.external_id)
        elif isinstance(value, tuple) and len(value) == 2 and all(isinstance(item, str) for item in value):
            return dm.NodeId(value[0], value[1])
        elif isinstance(value, list):
            return [cls.as_node_id(item) for item in value]
        return value

CogniteAssetTypeWriteList

Bases: DomainModelWriteList[CogniteAssetTypeWrite]

List of Cognite asset types in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_asset_type.py
class CogniteAssetTypeWriteList(DomainModelWriteList[CogniteAssetTypeWrite]):
    """List of Cognite asset types in the writing version."""

    _INSTANCE = CogniteAssetTypeWrite

    @property
    def asset_class(self) -> CogniteAssetClassWriteList:
        from ._cognite_asset_class import CogniteAssetClassWrite, CogniteAssetClassWriteList

        return CogniteAssetClassWriteList(
            [item.asset_class for item in self.data if isinstance(item.asset_class, CogniteAssetClassWrite)]
        )

CogniteAssetWrite

Bases: CogniteVisualizableWrite, CogniteDescribableNodeWrite, CogniteSourceableNodeWrite

This represents the writing version of Cognite asset.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite asset.

required
data_record

The data record of the Cognite asset node.

required
aliases

Alternative names for the node

required
asset_class

Specifies the class of the asset. It's a direct relation to CogniteAssetClass.

required
description

Description of the instance

required
name

Name of the instance

required
object_3d

Direct relation to an Object3D instance representing the 3D resource

required
parent

The parent of the asset.

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
tags

Text based labels for generic use, limited to 1000

required
type_

Specifies the type of the asset. It's a direct relation to CogniteAssetType.

required
Source code in examples/cognite_core/data_classes/_cognite_asset.py
class CogniteAssetWrite(CogniteVisualizableWrite, CogniteDescribableNodeWrite, CogniteSourceableNodeWrite):
    """This represents the writing version of Cognite asset.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite asset.
        data_record: The data record of the Cognite asset node.
        aliases: Alternative names for the node
        asset_class: Specifies the class of the asset. It's a direct relation to CogniteAssetClass.
        description: Description of the instance
        name: Name of the instance
        object_3d: Direct relation to an Object3D instance representing the 3D resource
        parent: The parent of the asset.
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        tags: Text based labels for generic use, limited to 1000
        type_: Specifies the type of the asset. It's a direct relation to CogniteAssetType.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "asset_class",
        "description",
        "name",
        "object_3d",
        "parent",
        "source",
        "source_context",
        "source_created_time",
        "source_created_user",
        "source_id",
        "source_updated_time",
        "source_updated_user",
        "tags",
        "type_",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = (
        "asset_class",
        "object_3d",
        "parent",
        "path",
        "root",
        "source",
        "type_",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteAsset", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    asset_class: Union[CogniteAssetClassWrite, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="assetClass"
    )
    parent: Union[CogniteAssetWrite, str, dm.NodeId, None] = Field(default=None, repr=False)
    type_: Union[CogniteAssetTypeWrite, str, dm.NodeId, None] = Field(default=None, repr=False, alias="type")

    @field_validator("asset_class", "parent", "type_", mode="before")
    def as_node_id(cls, value: Any) -> Any:
        if isinstance(value, dm.DirectRelationReference):
            return dm.NodeId(value.space, value.external_id)
        elif isinstance(value, tuple) and len(value) == 2 and all(isinstance(item, str) for item in value):
            return dm.NodeId(value[0], value[1])
        elif isinstance(value, list):
            return [cls.as_node_id(item) for item in value]
        return value

CogniteAssetWriteList

Bases: DomainModelWriteList[CogniteAssetWrite]

List of Cognite assets in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_asset.py
class CogniteAssetWriteList(DomainModelWriteList[CogniteAssetWrite]):
    """List of Cognite assets in the writing version."""

    _INSTANCE = CogniteAssetWrite

    @property
    def asset_class(self) -> CogniteAssetClassWriteList:
        from ._cognite_asset_class import CogniteAssetClassWrite, CogniteAssetClassWriteList

        return CogniteAssetClassWriteList(
            [item.asset_class for item in self.data if isinstance(item.asset_class, CogniteAssetClassWrite)]
        )

    @property
    def object_3d(self) -> Cognite3DObjectWriteList:
        from ._cognite_3_d_object import Cognite3DObjectWrite, Cognite3DObjectWriteList

        return Cognite3DObjectWriteList(
            [item.object_3d for item in self.data if isinstance(item.object_3d, Cognite3DObjectWrite)]
        )

    @property
    def parent(self) -> CogniteAssetWriteList:
        return CogniteAssetWriteList([item.parent for item in self.data if isinstance(item.parent, CogniteAssetWrite)])

    @property
    def source(self) -> CogniteSourceSystemWriteList:
        from ._cognite_source_system import CogniteSourceSystemWrite, CogniteSourceSystemWriteList

        return CogniteSourceSystemWriteList(
            [item.source for item in self.data if isinstance(item.source, CogniteSourceSystemWrite)]
        )

    @property
    def type_(self) -> CogniteAssetTypeWriteList:
        from ._cognite_asset_type import CogniteAssetTypeWrite, CogniteAssetTypeWriteList

        return CogniteAssetTypeWriteList(
            [item.type_ for item in self.data if isinstance(item.type_, CogniteAssetTypeWrite)]
        )

CogniteCADModel

Bases: Cognite3DModel

This represents the reading version of Cognite cad model.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite cad model.

required
data_record

The data record of the Cognite cad model node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
revisions

List of revisions for this CAD model

required
tags

Text based labels for generic use, limited to 1000

required
thumbnail

Thumbnail of the 3D model

required
type_

CAD, PointCloud or Image360

required
Source code in examples/cognite_core/data_classes/_cognite_cad_model.py
class CogniteCADModel(Cognite3DModel):
    """This represents the reading version of Cognite cad model.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite cad model.
        data_record: The data record of the Cognite cad model node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        revisions: List of revisions for this CAD model
        tags: Text based labels for generic use, limited to 1000
        thumbnail: Thumbnail of the 3D model
        type_: CAD, PointCloud or Image360
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteCADModel", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    revisions: Optional[list[CogniteCADRevision]] = Field(default=None, repr=False)

    @field_validator("thumbnail", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    @field_validator("revisions", mode="before")
    @classmethod
    def parse_list(cls, value: Any, info: ValidationInfo) -> Any:
        if value is None:
            return None
        return [parse_single_connection(item, info.field_name) for item in value]

    def as_write(self) -> CogniteCADModelWrite:
        """Convert this read version of Cognite cad model to the writing version."""
        return CogniteCADModelWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite cad model to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_cad_model.py
def as_write(self) -> CogniteCADModelWrite:
    """Convert this read version of Cognite cad model to the writing version."""
    return CogniteCADModelWrite.model_validate(as_write_args(self))

CogniteCADModelGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite cad model, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite cad model.

required
data_record

The data record of the Cognite cad model node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
revisions

List of revisions for this CAD model

required
tags

Text based labels for generic use, limited to 1000

required
thumbnail

Thumbnail of the 3D model

required
type_

CAD, PointCloud or Image360

required
Source code in examples/cognite_core/data_classes/_cognite_cad_model.py
class CogniteCADModelGraphQL(GraphQLCore):
    """This represents the reading version of Cognite cad model, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite cad model.
        data_record: The data record of the Cognite cad model node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        revisions: List of revisions for this CAD model
        tags: Text based labels for generic use, limited to 1000
        thumbnail: Thumbnail of the 3D model
        type_: CAD, PointCloud or Image360
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteCADModel", "v1")
    aliases: Optional[list[str]] = None
    description: Optional[str] = None
    name: Optional[str] = None
    revisions: Optional[list[CogniteCADRevisionGraphQL]] = Field(default=None, repr=False)
    tags: Optional[list[str]] = None
    thumbnail: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)
    type_: Optional[Literal["CAD", "Image360", "PointCloud"]] = Field(None, alias="type")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("revisions", "thumbnail", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> CogniteCADModel:
        """Convert this GraphQL format of Cognite cad model to the reading format."""
        return CogniteCADModel.model_validate(as_read_args(self))

    def as_write(self) -> CogniteCADModelWrite:
        """Convert this GraphQL format of Cognite cad model to the writing format."""
        return CogniteCADModelWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite cad model to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_cad_model.py
def as_read(self) -> CogniteCADModel:
    """Convert this GraphQL format of Cognite cad model to the reading format."""
    return CogniteCADModel.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite cad model to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_cad_model.py
def as_write(self) -> CogniteCADModelWrite:
    """Convert this GraphQL format of Cognite cad model to the writing format."""
    return CogniteCADModelWrite.model_validate(as_write_args(self))

CogniteCADModelList

Bases: DomainModelList[CogniteCADModel]

List of Cognite cad models in the read version.

Source code in examples/cognite_core/data_classes/_cognite_cad_model.py
class CogniteCADModelList(DomainModelList[CogniteCADModel]):
    """List of Cognite cad models in the read version."""

    _INSTANCE = CogniteCADModel

    def as_write(self) -> CogniteCADModelWriteList:
        """Convert these read versions of Cognite cad model to the writing versions."""
        return CogniteCADModelWriteList([node.as_write() for node in self.data])

    @property
    def revisions(self) -> CogniteCADRevisionList:
        from ._cognite_cad_revision import CogniteCADRevision, CogniteCADRevisionList

        return CogniteCADRevisionList(
            [item for items in self.data for item in items.revisions or [] if isinstance(item, CogniteCADRevision)]
        )

    @property
    def thumbnail(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.thumbnail for item in self.data if isinstance(item.thumbnail, CogniteFile)])

as_write()

Convert these read versions of Cognite cad model to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_cad_model.py
def as_write(self) -> CogniteCADModelWriteList:
    """Convert these read versions of Cognite cad model to the writing versions."""
    return CogniteCADModelWriteList([node.as_write() for node in self.data])

CogniteCADModelWrite

Bases: Cognite3DModelWrite

This represents the writing version of Cognite cad model.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite cad model.

required
data_record

The data record of the Cognite cad model node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
thumbnail

Thumbnail of the 3D model

required
type_

CAD, PointCloud or Image360

required
Source code in examples/cognite_core/data_classes/_cognite_cad_model.py
class CogniteCADModelWrite(Cognite3DModelWrite):
    """This represents the writing version of Cognite cad model.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite cad model.
        data_record: The data record of the Cognite cad model node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
        thumbnail: Thumbnail of the 3D model
        type_: CAD, PointCloud or Image360
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "description",
        "name",
        "tags",
        "thumbnail",
        "type_",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = ("thumbnail",)

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteCADModel", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None

CogniteCADModelWriteList

Bases: DomainModelWriteList[CogniteCADModelWrite]

List of Cognite cad models in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_cad_model.py
class CogniteCADModelWriteList(DomainModelWriteList[CogniteCADModelWrite]):
    """List of Cognite cad models in the writing version."""

    _INSTANCE = CogniteCADModelWrite

    @property
    def thumbnail(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList(
            [item.thumbnail for item in self.data if isinstance(item.thumbnail, CogniteFileWrite)]
        )

CogniteCADNode

Bases: CogniteDescribableNode

This represents the reading version of Cognite cad node.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite cad node.

required
data_record

The data record of the Cognite cad node node.

required
aliases

Alternative names for the node

required
cad_node_reference

Reference to a node within a CAD model from the 3D API

required
description

Description of the instance

required
model_3d

Direct relation to Cognite3DModel

required
name

Name of the instance

required
object_3d

Direct relation to object3D grouping for this node

required
revisions

List of direct relations to instances of Cognite3DRevision which this CogniteCADNode exists in.

required
sub_tree_sizes

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

required
tags

Text based labels for generic use, limited to 1000

required
tree_indexes

List of tree indexes in the same order as revisions. Used by Reveal and similar applications to map from CogniteCADNode to tree index

required
Source code in examples/cognite_core/data_classes/_cognite_cad_node.py
class CogniteCADNode(CogniteDescribableNode, protected_namespaces=()):
    """This represents the reading version of Cognite cad node.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite cad node.
        data_record: The data record of the Cognite cad node node.
        aliases: Alternative names for the node
        cad_node_reference: Reference to a node within a CAD model from the 3D API
        description: Description of the instance
        model_3d: Direct relation to Cognite3DModel
        name: Name of the instance
        object_3d: Direct relation to object3D grouping for this node
        revisions: List of direct relations to instances of Cognite3DRevision which this CogniteCADNode exists in.
        sub_tree_sizes: 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
        tags: Text based labels for generic use, limited to 1000
        tree_indexes: List of tree indexes in the same order as revisions. Used by Reveal and similar applications to
            map from CogniteCADNode to tree index
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteCADNode", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    cad_node_reference: Optional[str] = Field(None, alias="cadNodeReference")
    model_3d: Union[CogniteCADModel, str, dm.NodeId, None] = Field(default=None, repr=False, alias="model3D")
    object_3d: Union[Cognite3DObject, str, dm.NodeId, None] = Field(default=None, repr=False, alias="object3D")
    revisions: Optional[list[Union[CogniteCADRevision, str, dm.NodeId]]] = Field(default=None, repr=False)
    sub_tree_sizes: Optional[list[int]] = Field(None, alias="subTreeSizes")
    tree_indexes: Optional[list[int]] = Field(None, alias="treeIndexes")

    @field_validator("model_3d", "object_3d", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    @field_validator("revisions", mode="before")
    @classmethod
    def parse_list(cls, value: Any, info: ValidationInfo) -> Any:
        if value is None:
            return None
        return [parse_single_connection(item, info.field_name) for item in value]

    def as_write(self) -> CogniteCADNodeWrite:
        """Convert this read version of Cognite cad node to the writing version."""
        return CogniteCADNodeWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite cad node to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_cad_node.py
def as_write(self) -> CogniteCADNodeWrite:
    """Convert this read version of Cognite cad node to the writing version."""
    return CogniteCADNodeWrite.model_validate(as_write_args(self))

CogniteCADNodeGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite cad node, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite cad node.

required
data_record

The data record of the Cognite cad node node.

required
aliases

Alternative names for the node

required
cad_node_reference

Reference to a node within a CAD model from the 3D API

required
description

Description of the instance

required
model_3d

Direct relation to Cognite3DModel

required
name

Name of the instance

required
object_3d

Direct relation to object3D grouping for this node

required
revisions

List of direct relations to instances of Cognite3DRevision which this CogniteCADNode exists in.

required
sub_tree_sizes

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

required
tags

Text based labels for generic use, limited to 1000

required
tree_indexes

List of tree indexes in the same order as revisions. Used by Reveal and similar applications to map from CogniteCADNode to tree index

required
Source code in examples/cognite_core/data_classes/_cognite_cad_node.py
class CogniteCADNodeGraphQL(GraphQLCore, protected_namespaces=()):
    """This represents the reading version of Cognite cad node, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite cad node.
        data_record: The data record of the Cognite cad node node.
        aliases: Alternative names for the node
        cad_node_reference: Reference to a node within a CAD model from the 3D API
        description: Description of the instance
        model_3d: Direct relation to Cognite3DModel
        name: Name of the instance
        object_3d: Direct relation to object3D grouping for this node
        revisions: List of direct relations to instances of Cognite3DRevision which this CogniteCADNode exists in.
        sub_tree_sizes: 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
        tags: Text based labels for generic use, limited to 1000
        tree_indexes: List of tree indexes in the same order as revisions. Used by Reveal and similar applications to
            map from CogniteCADNode to tree index
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteCADNode", "v1")
    aliases: Optional[list[str]] = None
    cad_node_reference: Optional[str] = Field(None, alias="cadNodeReference")
    description: Optional[str] = None
    model_3d: Optional[CogniteCADModelGraphQL] = Field(default=None, repr=False, alias="model3D")
    name: Optional[str] = None
    object_3d: Optional[Cognite3DObjectGraphQL] = Field(default=None, repr=False, alias="object3D")
    revisions: Optional[list[CogniteCADRevisionGraphQL]] = Field(default=None, repr=False)
    sub_tree_sizes: Optional[list[int]] = Field(None, alias="subTreeSizes")
    tags: Optional[list[str]] = None
    tree_indexes: Optional[list[int]] = Field(None, alias="treeIndexes")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("model_3d", "object_3d", "revisions", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> CogniteCADNode:
        """Convert this GraphQL format of Cognite cad node to the reading format."""
        return CogniteCADNode.model_validate(as_read_args(self))

    def as_write(self) -> CogniteCADNodeWrite:
        """Convert this GraphQL format of Cognite cad node to the writing format."""
        return CogniteCADNodeWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite cad node to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_cad_node.py
def as_read(self) -> CogniteCADNode:
    """Convert this GraphQL format of Cognite cad node to the reading format."""
    return CogniteCADNode.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite cad node to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_cad_node.py
def as_write(self) -> CogniteCADNodeWrite:
    """Convert this GraphQL format of Cognite cad node to the writing format."""
    return CogniteCADNodeWrite.model_validate(as_write_args(self))

CogniteCADNodeList

Bases: DomainModelList[CogniteCADNode]

List of Cognite cad nodes in the read version.

Source code in examples/cognite_core/data_classes/_cognite_cad_node.py
class CogniteCADNodeList(DomainModelList[CogniteCADNode]):
    """List of Cognite cad nodes in the read version."""

    _INSTANCE = CogniteCADNode

    def as_write(self) -> CogniteCADNodeWriteList:
        """Convert these read versions of Cognite cad node to the writing versions."""
        return CogniteCADNodeWriteList([node.as_write() for node in self.data])

    @property
    def model_3d(self) -> CogniteCADModelList:
        from ._cognite_cad_model import CogniteCADModel, CogniteCADModelList

        return CogniteCADModelList([item.model_3d for item in self.data if isinstance(item.model_3d, CogniteCADModel)])

    @property
    def object_3d(self) -> Cognite3DObjectList:
        from ._cognite_3_d_object import Cognite3DObject, Cognite3DObjectList

        return Cognite3DObjectList(
            [item.object_3d for item in self.data if isinstance(item.object_3d, Cognite3DObject)]
        )

    @property
    def revisions(self) -> CogniteCADRevisionList:
        from ._cognite_cad_revision import CogniteCADRevision, CogniteCADRevisionList

        return CogniteCADRevisionList(
            [item for items in self.data for item in items.revisions or [] if isinstance(item, CogniteCADRevision)]
        )

as_write()

Convert these read versions of Cognite cad node to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_cad_node.py
def as_write(self) -> CogniteCADNodeWriteList:
    """Convert these read versions of Cognite cad node to the writing versions."""
    return CogniteCADNodeWriteList([node.as_write() for node in self.data])

CogniteCADNodeWrite

Bases: CogniteDescribableNodeWrite

This represents the writing version of Cognite cad node.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite cad node.

required
data_record

The data record of the Cognite cad node node.

required
aliases

Alternative names for the node

required
cad_node_reference

Reference to a node within a CAD model from the 3D API

required
description

Description of the instance

required
model_3d

Direct relation to Cognite3DModel

required
name

Name of the instance

required
object_3d

Direct relation to object3D grouping for this node

required
revisions

List of direct relations to instances of Cognite3DRevision which this CogniteCADNode exists in.

required
sub_tree_sizes

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

required
tags

Text based labels for generic use, limited to 1000

required
tree_indexes

List of tree indexes in the same order as revisions. Used by Reveal and similar applications to map from CogniteCADNode to tree index

required
Source code in examples/cognite_core/data_classes/_cognite_cad_node.py
class CogniteCADNodeWrite(CogniteDescribableNodeWrite, protected_namespaces=()):
    """This represents the writing version of Cognite cad node.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite cad node.
        data_record: The data record of the Cognite cad node node.
        aliases: Alternative names for the node
        cad_node_reference: Reference to a node within a CAD model from the 3D API
        description: Description of the instance
        model_3d: Direct relation to Cognite3DModel
        name: Name of the instance
        object_3d: Direct relation to object3D grouping for this node
        revisions: List of direct relations to instances of Cognite3DRevision which this CogniteCADNode exists in.
        sub_tree_sizes: 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
        tags: Text based labels for generic use, limited to 1000
        tree_indexes: List of tree indexes in the same order as revisions. Used by Reveal and similar applications to
            map from CogniteCADNode to tree index
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "cad_node_reference",
        "description",
        "model_3d",
        "name",
        "object_3d",
        "revisions",
        "sub_tree_sizes",
        "tags",
        "tree_indexes",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = (
        "model_3d",
        "object_3d",
        "revisions",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteCADNode", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    cad_node_reference: Optional[str] = Field(None, alias="cadNodeReference")
    model_3d: Union[CogniteCADModelWrite, str, dm.NodeId, None] = Field(default=None, repr=False, alias="model3D")
    object_3d: Union[Cognite3DObjectWrite, str, dm.NodeId, None] = Field(default=None, repr=False, alias="object3D")
    revisions: Optional[list[Union[CogniteCADRevisionWrite, str, dm.NodeId]]] = Field(default=None, repr=False)
    sub_tree_sizes: Optional[list[int]] = Field(None, alias="subTreeSizes")
    tree_indexes: Optional[list[int]] = Field(None, alias="treeIndexes")

    @field_validator("model_3d", "object_3d", "revisions", mode="before")
    def as_node_id(cls, value: Any) -> Any:
        if isinstance(value, dm.DirectRelationReference):
            return dm.NodeId(value.space, value.external_id)
        elif isinstance(value, tuple) and len(value) == 2 and all(isinstance(item, str) for item in value):
            return dm.NodeId(value[0], value[1])
        elif isinstance(value, list):
            return [cls.as_node_id(item) for item in value]
        return value

CogniteCADNodeWriteList

Bases: DomainModelWriteList[CogniteCADNodeWrite]

List of Cognite cad nodes in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_cad_node.py
class CogniteCADNodeWriteList(DomainModelWriteList[CogniteCADNodeWrite]):
    """List of Cognite cad nodes in the writing version."""

    _INSTANCE = CogniteCADNodeWrite

    @property
    def model_3d(self) -> CogniteCADModelWriteList:
        from ._cognite_cad_model import CogniteCADModelWrite, CogniteCADModelWriteList

        return CogniteCADModelWriteList(
            [item.model_3d for item in self.data if isinstance(item.model_3d, CogniteCADModelWrite)]
        )

    @property
    def object_3d(self) -> Cognite3DObjectWriteList:
        from ._cognite_3_d_object import Cognite3DObjectWrite, Cognite3DObjectWriteList

        return Cognite3DObjectWriteList(
            [item.object_3d for item in self.data if isinstance(item.object_3d, Cognite3DObjectWrite)]
        )

    @property
    def revisions(self) -> CogniteCADRevisionWriteList:
        from ._cognite_cad_revision import CogniteCADRevisionWrite, CogniteCADRevisionWriteList

        return CogniteCADRevisionWriteList(
            [item for items in self.data for item in items.revisions or [] if isinstance(item, CogniteCADRevisionWrite)]
        )

CogniteCADRevision

Bases: Cognite3DRevision

This represents the reading version of Cognite cad revision.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite cad revision.

required
data_record

The data record of the Cognite cad revision node.

required
model_3d

.

required
published

The published field.

required
revision_id

The 3D API revision identifier for this CAD model

required
status

The status field.

required
type_

The type field.

required
Source code in examples/cognite_core/data_classes/_cognite_cad_revision.py
class CogniteCADRevision(Cognite3DRevision, protected_namespaces=()):
    """This represents the reading version of Cognite cad revision.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite cad revision.
        data_record: The data record of the Cognite cad revision node.
        model_3d: .
        published: The published field.
        revision_id: The 3D API revision identifier for this CAD model
        status: The status field.
        type_: The type field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteCADRevision", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    revision_id: Optional[int] = Field(None, alias="revisionId")

    @field_validator("model_3d", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    def as_write(self) -> CogniteCADRevisionWrite:
        """Convert this read version of Cognite cad revision to the writing version."""
        return CogniteCADRevisionWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite cad revision to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_cad_revision.py
def as_write(self) -> CogniteCADRevisionWrite:
    """Convert this read version of Cognite cad revision to the writing version."""
    return CogniteCADRevisionWrite.model_validate(as_write_args(self))

CogniteCADRevisionGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite cad revision, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite cad revision.

required
data_record

The data record of the Cognite cad revision node.

required
model_3d

.

required
published

The published field.

required
revision_id

The 3D API revision identifier for this CAD model

required
status

The status field.

required
type_

The type field.

required
Source code in examples/cognite_core/data_classes/_cognite_cad_revision.py
class CogniteCADRevisionGraphQL(GraphQLCore, protected_namespaces=()):
    """This represents the reading version of Cognite cad revision, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite cad revision.
        data_record: The data record of the Cognite cad revision node.
        model_3d: .
        published: The published field.
        revision_id: The 3D API revision identifier for this CAD model
        status: The status field.
        type_: The type field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteCADRevision", "v1")
    model_3d: Optional[CogniteCADModelGraphQL] = Field(default=None, repr=False, alias="model3D")
    published: Optional[bool] = None
    revision_id: Optional[int] = Field(None, alias="revisionId")
    status: Optional[Literal["Done", "Failed", "Processing", "Queued"]] = None
    type_: Optional[Literal["CAD", "Image360", "PointCloud"]] = Field(None, alias="type")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("model_3d", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> CogniteCADRevision:
        """Convert this GraphQL format of Cognite cad revision to the reading format."""
        return CogniteCADRevision.model_validate(as_read_args(self))

    def as_write(self) -> CogniteCADRevisionWrite:
        """Convert this GraphQL format of Cognite cad revision to the writing format."""
        return CogniteCADRevisionWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite cad revision to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_cad_revision.py
def as_read(self) -> CogniteCADRevision:
    """Convert this GraphQL format of Cognite cad revision to the reading format."""
    return CogniteCADRevision.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite cad revision to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_cad_revision.py
def as_write(self) -> CogniteCADRevisionWrite:
    """Convert this GraphQL format of Cognite cad revision to the writing format."""
    return CogniteCADRevisionWrite.model_validate(as_write_args(self))

CogniteCADRevisionList

Bases: DomainModelList[CogniteCADRevision]

List of Cognite cad revisions in the read version.

Source code in examples/cognite_core/data_classes/_cognite_cad_revision.py
class CogniteCADRevisionList(DomainModelList[CogniteCADRevision]):
    """List of Cognite cad revisions in the read version."""

    _INSTANCE = CogniteCADRevision

    def as_write(self) -> CogniteCADRevisionWriteList:
        """Convert these read versions of Cognite cad revision to the writing versions."""
        return CogniteCADRevisionWriteList([node.as_write() for node in self.data])

    @property
    def model_3d(self) -> CogniteCADModelList:
        from ._cognite_cad_model import CogniteCADModel, CogniteCADModelList

        return CogniteCADModelList([item.model_3d for item in self.data if isinstance(item.model_3d, CogniteCADModel)])

as_write()

Convert these read versions of Cognite cad revision to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_cad_revision.py
def as_write(self) -> CogniteCADRevisionWriteList:
    """Convert these read versions of Cognite cad revision to the writing versions."""
    return CogniteCADRevisionWriteList([node.as_write() for node in self.data])

CogniteCADRevisionWrite

Bases: Cognite3DRevisionWrite

This represents the writing version of Cognite cad revision.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite cad revision.

required
data_record

The data record of the Cognite cad revision node.

required
model_3d

.

required
published

The published field.

required
revision_id

The 3D API revision identifier for this CAD model

required
status

The status field.

required
type_

The type field.

required
Source code in examples/cognite_core/data_classes/_cognite_cad_revision.py
class CogniteCADRevisionWrite(Cognite3DRevisionWrite, protected_namespaces=()):
    """This represents the writing version of Cognite cad revision.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite cad revision.
        data_record: The data record of the Cognite cad revision node.
        model_3d: .
        published: The published field.
        revision_id: The 3D API revision identifier for this CAD model
        status: The status field.
        type_: The type field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "model_3d",
        "published",
        "revision_id",
        "status",
        "type_",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = ("model_3d",)

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteCADRevision", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    revision_id: Optional[int] = Field(None, alias="revisionId")

CogniteCADRevisionWriteList

Bases: DomainModelWriteList[CogniteCADRevisionWrite]

List of Cognite cad revisions in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_cad_revision.py
class CogniteCADRevisionWriteList(DomainModelWriteList[CogniteCADRevisionWrite]):
    """List of Cognite cad revisions in the writing version."""

    _INSTANCE = CogniteCADRevisionWrite

    @property
    def model_3d(self) -> CogniteCADModelWriteList:
        from ._cognite_cad_model import CogniteCADModelWrite, CogniteCADModelWriteList

        return CogniteCADModelWriteList(
            [item.model_3d for item in self.data if isinstance(item.model_3d, CogniteCADModelWrite)]
        )

CogniteCubeMap

Bases: DomainModel

This represents the reading version of Cognite cube map.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite cube map.

required
data_record

The data record of the Cognite cube map node.

required
back

Direct relation to a file holding the back projection of the cube map

required
bottom

Direct relation to a file holding the bottom projection of the cube map

required
front

Direct relation to a file holding the front projection of the cube map

required
left

Direct relation to a file holding the left projection of the cube map

required
right

Direct relation to a file holding the right projection of the cube map

required
top

Direct relation to a file holding the top projection of the cube map

required
Source code in examples/cognite_core/data_classes/_cognite_cube_map.py
class CogniteCubeMap(DomainModel):
    """This represents the reading version of Cognite cube map.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite cube map.
        data_record: The data record of the Cognite cube map node.
        back: Direct relation to a file holding the back projection of the cube map
        bottom: Direct relation to a file holding the bottom projection of the cube map
        front: Direct relation to a file holding the front projection of the cube map
        left: Direct relation to a file holding the left projection of the cube map
        right: Direct relation to a file holding the right projection of the cube map
        top: Direct relation to a file holding the top projection of the cube map
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteCubeMap", "v1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = None
    back: Union[CogniteFile, str, dm.NodeId, None] = Field(default=None, repr=False)
    bottom: Union[CogniteFile, str, dm.NodeId, None] = Field(default=None, repr=False)
    front: Union[CogniteFile, str, dm.NodeId, None] = Field(default=None, repr=False)
    left: Union[CogniteFile, str, dm.NodeId, None] = Field(default=None, repr=False)
    right: Union[CogniteFile, str, dm.NodeId, None] = Field(default=None, repr=False)
    top: Union[CogniteFile, str, dm.NodeId, None] = Field(default=None, repr=False)

    @field_validator("back", "bottom", "front", "left", "right", "top", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    def as_write(self) -> CogniteCubeMapWrite:
        """Convert this read version of Cognite cube map to the writing version."""
        return CogniteCubeMapWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite cube map to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_cube_map.py
def as_write(self) -> CogniteCubeMapWrite:
    """Convert this read version of Cognite cube map to the writing version."""
    return CogniteCubeMapWrite.model_validate(as_write_args(self))

CogniteCubeMapGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite cube map, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite cube map.

required
data_record

The data record of the Cognite cube map node.

required
back

Direct relation to a file holding the back projection of the cube map

required
bottom

Direct relation to a file holding the bottom projection of the cube map

required
front

Direct relation to a file holding the front projection of the cube map

required
left

Direct relation to a file holding the left projection of the cube map

required
right

Direct relation to a file holding the right projection of the cube map

required
top

Direct relation to a file holding the top projection of the cube map

required
Source code in examples/cognite_core/data_classes/_cognite_cube_map.py
class CogniteCubeMapGraphQL(GraphQLCore):
    """This represents the reading version of Cognite cube map, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite cube map.
        data_record: The data record of the Cognite cube map node.
        back: Direct relation to a file holding the back projection of the cube map
        bottom: Direct relation to a file holding the bottom projection of the cube map
        front: Direct relation to a file holding the front projection of the cube map
        left: Direct relation to a file holding the left projection of the cube map
        right: Direct relation to a file holding the right projection of the cube map
        top: Direct relation to a file holding the top projection of the cube map
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteCubeMap", "v1")
    back: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)
    bottom: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)
    front: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)
    left: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)
    right: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)
    top: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("back", "bottom", "front", "left", "right", "top", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> CogniteCubeMap:
        """Convert this GraphQL format of Cognite cube map to the reading format."""
        return CogniteCubeMap.model_validate(as_read_args(self))

    def as_write(self) -> CogniteCubeMapWrite:
        """Convert this GraphQL format of Cognite cube map to the writing format."""
        return CogniteCubeMapWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite cube map to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_cube_map.py
def as_read(self) -> CogniteCubeMap:
    """Convert this GraphQL format of Cognite cube map to the reading format."""
    return CogniteCubeMap.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite cube map to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_cube_map.py
def as_write(self) -> CogniteCubeMapWrite:
    """Convert this GraphQL format of Cognite cube map to the writing format."""
    return CogniteCubeMapWrite.model_validate(as_write_args(self))

CogniteCubeMapList

Bases: DomainModelList[CogniteCubeMap]

List of Cognite cube maps in the read version.

Source code in examples/cognite_core/data_classes/_cognite_cube_map.py
class CogniteCubeMapList(DomainModelList[CogniteCubeMap]):
    """List of Cognite cube maps in the read version."""

    _INSTANCE = CogniteCubeMap

    def as_write(self) -> CogniteCubeMapWriteList:
        """Convert these read versions of Cognite cube map to the writing versions."""
        return CogniteCubeMapWriteList([node.as_write() for node in self.data])

    @property
    def back(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.back for item in self.data if isinstance(item.back, CogniteFile)])

    @property
    def bottom(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.bottom for item in self.data if isinstance(item.bottom, CogniteFile)])

    @property
    def front(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.front for item in self.data if isinstance(item.front, CogniteFile)])

    @property
    def left(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.left for item in self.data if isinstance(item.left, CogniteFile)])

    @property
    def right(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.right for item in self.data if isinstance(item.right, CogniteFile)])

    @property
    def top(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.top for item in self.data if isinstance(item.top, CogniteFile)])

as_write()

Convert these read versions of Cognite cube map to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_cube_map.py
def as_write(self) -> CogniteCubeMapWriteList:
    """Convert these read versions of Cognite cube map to the writing versions."""
    return CogniteCubeMapWriteList([node.as_write() for node in self.data])

CogniteCubeMapWrite

Bases: DomainModelWrite

This represents the writing version of Cognite cube map.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite cube map.

required
data_record

The data record of the Cognite cube map node.

required
back

Direct relation to a file holding the back projection of the cube map

required
bottom

Direct relation to a file holding the bottom projection of the cube map

required
front

Direct relation to a file holding the front projection of the cube map

required
left

Direct relation to a file holding the left projection of the cube map

required
right

Direct relation to a file holding the right projection of the cube map

required
top

Direct relation to a file holding the top projection of the cube map

required
Source code in examples/cognite_core/data_classes/_cognite_cube_map.py
class CogniteCubeMapWrite(DomainModelWrite):
    """This represents the writing version of Cognite cube map.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite cube map.
        data_record: The data record of the Cognite cube map node.
        back: Direct relation to a file holding the back projection of the cube map
        bottom: Direct relation to a file holding the bottom projection of the cube map
        front: Direct relation to a file holding the front projection of the cube map
        left: Direct relation to a file holding the left projection of the cube map
        right: Direct relation to a file holding the right projection of the cube map
        top: Direct relation to a file holding the top projection of the cube map
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "back",
        "bottom",
        "front",
        "left",
        "right",
        "top",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = (
        "back",
        "bottom",
        "front",
        "left",
        "right",
        "top",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteCubeMap", "v1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    back: Union[CogniteFileWrite, str, dm.NodeId, None] = Field(default=None, repr=False)
    bottom: Union[CogniteFileWrite, str, dm.NodeId, None] = Field(default=None, repr=False)
    front: Union[CogniteFileWrite, str, dm.NodeId, None] = Field(default=None, repr=False)
    left: Union[CogniteFileWrite, str, dm.NodeId, None] = Field(default=None, repr=False)
    right: Union[CogniteFileWrite, str, dm.NodeId, None] = Field(default=None, repr=False)
    top: Union[CogniteFileWrite, str, dm.NodeId, None] = Field(default=None, repr=False)

    @field_validator("back", "bottom", "front", "left", "right", "top", mode="before")
    def as_node_id(cls, value: Any) -> Any:
        if isinstance(value, dm.DirectRelationReference):
            return dm.NodeId(value.space, value.external_id)
        elif isinstance(value, tuple) and len(value) == 2 and all(isinstance(item, str) for item in value):
            return dm.NodeId(value[0], value[1])
        elif isinstance(value, list):
            return [cls.as_node_id(item) for item in value]
        return value

CogniteCubeMapWriteList

Bases: DomainModelWriteList[CogniteCubeMapWrite]

List of Cognite cube maps in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_cube_map.py
class CogniteCubeMapWriteList(DomainModelWriteList[CogniteCubeMapWrite]):
    """List of Cognite cube maps in the writing version."""

    _INSTANCE = CogniteCubeMapWrite

    @property
    def back(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList([item.back for item in self.data if isinstance(item.back, CogniteFileWrite)])

    @property
    def bottom(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList([item.bottom for item in self.data if isinstance(item.bottom, CogniteFileWrite)])

    @property
    def front(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList([item.front for item in self.data if isinstance(item.front, CogniteFileWrite)])

    @property
    def left(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList([item.left for item in self.data if isinstance(item.left, CogniteFileWrite)])

    @property
    def right(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList([item.right for item in self.data if isinstance(item.right, CogniteFileWrite)])

    @property
    def top(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList([item.top for item in self.data if isinstance(item.top, CogniteFileWrite)])

CogniteDescribableEdge

Bases: DomainRelation

This represents the reading version of Cognite describable edge.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite describable edge.

required
data_record

The data record of the Cognite describable edge edge.

required
end_node

The end node of this edge.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_describable_edge.py
class CogniteDescribableEdge(DomainRelation):
    """This represents the reading version of Cognite describable edge.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite describable edge.
        data_record: The data record of the Cognite describable edge edge.
        end_node: The end node of this edge.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteDescribable", "v1")
    space: str = DEFAULT_INSTANCE_SPACE
    end_node: Union[str, dm.NodeId] = Field(alias="endNode")
    aliases: Optional[list[str]] = None
    description: Optional[str] = None
    name: Optional[str] = None
    tags: Optional[list[str]] = None

    def as_write(self) -> CogniteDescribableEdgeWrite:
        """Convert this read version of Cognite describable edge to the writing version."""
        return CogniteDescribableEdgeWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite describable edge to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_describable_edge.py
def as_write(self) -> CogniteDescribableEdgeWrite:
    """Convert this read version of Cognite describable edge to the writing version."""
    return CogniteDescribableEdgeWrite.model_validate(as_write_args(self))

CogniteDescribableEdgeGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite describable edge, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite describable edge.

required
data_record

The data record of the Cognite describable edge node.

required
end_node

The end node of this edge.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_describable_edge.py
class CogniteDescribableEdgeGraphQL(GraphQLCore):
    """This represents the reading version of Cognite describable edge, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite describable edge.
        data_record: The data record of the Cognite describable edge node.
        end_node: The end node of this edge.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteDescribable", "v1")
    end_node: Union[dm.NodeId, None] = Field(None, alias="endNode")
    aliases: Optional[list[str]] = None
    description: Optional[str] = None
    name: Optional[str] = None
    tags: Optional[list[str]] = None

    def as_read(self) -> CogniteDescribableEdge:
        """Convert this GraphQL format of Cognite describable edge to the reading format."""
        return CogniteDescribableEdge.model_validate(as_read_args(self))

    def as_write(self) -> CogniteDescribableEdgeWrite:
        """Convert this GraphQL format of Cognite describable edge to the writing format."""
        return CogniteDescribableEdgeWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite describable edge to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_describable_edge.py
def as_read(self) -> CogniteDescribableEdge:
    """Convert this GraphQL format of Cognite describable edge to the reading format."""
    return CogniteDescribableEdge.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite describable edge to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_describable_edge.py
def as_write(self) -> CogniteDescribableEdgeWrite:
    """Convert this GraphQL format of Cognite describable edge to the writing format."""
    return CogniteDescribableEdgeWrite.model_validate(as_write_args(self))

CogniteDescribableEdgeList

Bases: DomainRelationList[CogniteDescribableEdge]

List of Cognite describable edges in the reading version.

Source code in examples/cognite_core/data_classes/_cognite_describable_edge.py
class CogniteDescribableEdgeList(DomainRelationList[CogniteDescribableEdge]):
    """List of Cognite describable edges in the reading version."""

    _INSTANCE = CogniteDescribableEdge

    def as_write(self) -> CogniteDescribableEdgeWriteList:
        """Convert this read version of Cognite describable edge list to the writing version."""
        return CogniteDescribableEdgeWriteList([edge.as_write() for edge in self])

as_write()

Convert this read version of Cognite describable edge list to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_describable_edge.py
def as_write(self) -> CogniteDescribableEdgeWriteList:
    """Convert this read version of Cognite describable edge list to the writing version."""
    return CogniteDescribableEdgeWriteList([edge.as_write() for edge in self])

CogniteDescribableEdgeWrite

Bases: DomainRelationWrite

This represents the writing version of Cognite describable edge.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite describable edge.

required
data_record

The data record of the Cognite describable edge edge.

required
end_node

The end node of this edge.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_describable_edge.py
class CogniteDescribableEdgeWrite(DomainRelationWrite):
    """This represents the writing version of Cognite describable edge.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite describable edge.
        data_record: The data record of the Cognite describable edge edge.
        end_node: The end node of this edge.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "description",
        "name",
        "tags",
    )
    _validate_end_node = _validate_end_node

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteDescribable", "v1")
    end_node: Union[str, dm.NodeId] = Field(alias="endNode")
    aliases: Optional[list[str]] = None
    description: Optional[str] = None
    name: Optional[str] = None
    tags: Optional[list[str]] = None

CogniteDescribableEdgeWriteList

Bases: DomainRelationWriteList[CogniteDescribableEdgeWrite]

List of Cognite describable edges in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_describable_edge.py
class CogniteDescribableEdgeWriteList(DomainRelationWriteList[CogniteDescribableEdgeWrite]):
    """List of Cognite describable edges in the writing version."""

    _INSTANCE = CogniteDescribableEdgeWrite

CogniteDescribableNode

Bases: DomainModel

This represents the reading version of Cognite describable node.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite describable node.

required
data_record

The data record of the Cognite describable node node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_describable_node.py
class CogniteDescribableNode(DomainModel):
    """This represents the reading version of Cognite describable node.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite describable node.
        data_record: The data record of the Cognite describable node node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteDescribable", "v1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = None
    aliases: Optional[list[str]] = None
    description: Optional[str] = None
    name: Optional[str] = None
    tags: Optional[list[str]] = None

    def as_write(self) -> CogniteDescribableNodeWrite:
        """Convert this read version of Cognite describable node to the writing version."""
        return CogniteDescribableNodeWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite describable node to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_describable_node.py
def as_write(self) -> CogniteDescribableNodeWrite:
    """Convert this read version of Cognite describable node to the writing version."""
    return CogniteDescribableNodeWrite.model_validate(as_write_args(self))

CogniteDescribableNodeGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite describable node, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite describable node.

required
data_record

The data record of the Cognite describable node node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_describable_node.py
class CogniteDescribableNodeGraphQL(GraphQLCore):
    """This represents the reading version of Cognite describable node, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite describable node.
        data_record: The data record of the Cognite describable node node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteDescribable", "v1")
    aliases: Optional[list[str]] = None
    description: Optional[str] = None
    name: Optional[str] = None
    tags: Optional[list[str]] = None

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    def as_read(self) -> CogniteDescribableNode:
        """Convert this GraphQL format of Cognite describable node to the reading format."""
        return CogniteDescribableNode.model_validate(as_read_args(self))

    def as_write(self) -> CogniteDescribableNodeWrite:
        """Convert this GraphQL format of Cognite describable node to the writing format."""
        return CogniteDescribableNodeWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite describable node to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_describable_node.py
def as_read(self) -> CogniteDescribableNode:
    """Convert this GraphQL format of Cognite describable node to the reading format."""
    return CogniteDescribableNode.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite describable node to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_describable_node.py
def as_write(self) -> CogniteDescribableNodeWrite:
    """Convert this GraphQL format of Cognite describable node to the writing format."""
    return CogniteDescribableNodeWrite.model_validate(as_write_args(self))

CogniteDescribableNodeList

Bases: DomainModelList[CogniteDescribableNode]

List of Cognite describable nodes in the read version.

Source code in examples/cognite_core/data_classes/_cognite_describable_node.py
class CogniteDescribableNodeList(DomainModelList[CogniteDescribableNode]):
    """List of Cognite describable nodes in the read version."""

    _INSTANCE = CogniteDescribableNode

    def as_write(self) -> CogniteDescribableNodeWriteList:
        """Convert these read versions of Cognite describable node to the writing versions."""
        return CogniteDescribableNodeWriteList([node.as_write() for node in self.data])

as_write()

Convert these read versions of Cognite describable node to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_describable_node.py
def as_write(self) -> CogniteDescribableNodeWriteList:
    """Convert these read versions of Cognite describable node to the writing versions."""
    return CogniteDescribableNodeWriteList([node.as_write() for node in self.data])

CogniteDescribableNodeWrite

Bases: DomainModelWrite

This represents the writing version of Cognite describable node.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite describable node.

required
data_record

The data record of the Cognite describable node node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_describable_node.py
class CogniteDescribableNodeWrite(DomainModelWrite):
    """This represents the writing version of Cognite describable node.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite describable node.
        data_record: The data record of the Cognite describable node node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "description",
        "name",
        "tags",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteDescribable", "v1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    aliases: Optional[list[str]] = None
    description: Optional[str] = None
    name: Optional[str] = None
    tags: Optional[list[str]] = None

CogniteDescribableNodeWriteList

Bases: DomainModelWriteList[CogniteDescribableNodeWrite]

List of Cognite describable nodes in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_describable_node.py
class CogniteDescribableNodeWriteList(DomainModelWriteList[CogniteDescribableNodeWrite]):
    """List of Cognite describable nodes in the writing version."""

    _INSTANCE = CogniteDescribableNodeWrite

CogniteDiagramAnnotation

Bases: CogniteAnnotation

This represents the reading version of Cognite diagram annotation.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite diagram annotation.

required
data_record

The data record of the Cognite diagram annotation edge.

required
end_node

The end node of this edge.

required
aliases

Alternative names for the node

required
confidence

The confidence that the annotation is a good match

required
description

Description of the instance

required
end_node_page_number

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

required
end_node_text

The text extracted from within the bounding box on the endNode. Only applicable if an endNode is defined

required
end_node_x_max

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

required
end_node_x_min

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

required
end_node_y_max

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

required
end_node_y_min

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

required
name

Name of the instance

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
start_node_page_number

The number of the page on which this annotation is located in startNode File. The first page has number 1

required
start_node_text

The text extracted from within the bounding box on the startNode

required
start_node_x_max

Value between [0,1]. Maximum abscissa of the bounding box (right edge). Must be strictly more than startNodeXMin

required
start_node_x_min

Value between [0,1]. Minimum abscissa of the bounding box (left edge). Must be strictly less than startNodeXMax

required
start_node_y_max

Value between [0,1]. Maximum ordinate of the bounding box (top edge). Must be strictly more than startNodeYMin

required
start_node_y_min

Value between [0,1]. Minimum ordinate of the bounding box (bottom edge). Must be strictly less than startNodeYMax

required
status

The status of the annotation

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_diagram_annotation.py
class CogniteDiagramAnnotation(CogniteAnnotation):
    """This represents the reading version of Cognite diagram annotation.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite diagram annotation.
        data_record: The data record of the Cognite diagram annotation edge.
        end_node: The end node of this edge.
        aliases: Alternative names for the node
        confidence: The confidence that the annotation is a good match
        description: Description of the instance
        end_node_page_number: 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
        end_node_text: The text extracted from within the bounding box on the endNode. Only applicable if an endNode is
            defined
        end_node_x_max: 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_x_min: 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_y_max: 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_y_min: 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
        name: Name of the instance
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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_node_page_number: The number of the page on which this annotation is located in `startNode` File. The
            first page has number 1
        start_node_text: The text extracted from within the bounding box on the startNode
        start_node_x_max: Value between [0,1]. Maximum abscissa of the bounding box (right edge). Must be strictly more
            than startNodeXMin
        start_node_x_min: Value between [0,1]. Minimum abscissa of the bounding box (left edge). Must be strictly less
            than startNodeXMax
        start_node_y_max: Value between [0,1]. Maximum ordinate of the bounding box (top edge). Must be strictly more
            than startNodeYMin
        start_node_y_min: Value between [0,1]. Minimum ordinate of the bounding box (bottom edge). Must be strictly
            less than startNodeYMax
        status: The status of the annotation
        tags: Text based labels for generic use, limited to 1000
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteDiagramAnnotation", "v1")
    space: str = DEFAULT_INSTANCE_SPACE
    end_node_page_number: Optional[int] = Field(None, alias="endNodePageNumber")
    end_node_text: Optional[str] = Field(None, alias="endNodeText")
    end_node_x_max: Optional[float] = Field(None, alias="endNodeXMax")
    end_node_x_min: Optional[float] = Field(None, alias="endNodeXMin")
    end_node_y_max: Optional[float] = Field(None, alias="endNodeYMax")
    end_node_y_min: Optional[float] = Field(None, alias="endNodeYMin")
    start_node_page_number: Optional[int] = Field(None, alias="startNodePageNumber")
    start_node_text: Optional[str] = Field(None, alias="startNodeText")
    start_node_x_max: Optional[float] = Field(None, alias="startNodeXMax")
    start_node_x_min: Optional[float] = Field(None, alias="startNodeXMin")
    start_node_y_max: Optional[float] = Field(None, alias="startNodeYMax")
    start_node_y_min: Optional[float] = Field(None, alias="startNodeYMin")

    def as_write(self) -> CogniteDiagramAnnotationWrite:
        """Convert this read version of Cognite diagram annotation to the writing version."""
        return CogniteDiagramAnnotationWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite diagram annotation to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_diagram_annotation.py
def as_write(self) -> CogniteDiagramAnnotationWrite:
    """Convert this read version of Cognite diagram annotation to the writing version."""
    return CogniteDiagramAnnotationWrite.model_validate(as_write_args(self))

CogniteDiagramAnnotationGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite diagram annotation, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite diagram annotation.

required
data_record

The data record of the Cognite diagram annotation node.

required
end_node

The end node of this edge.

required
aliases

Alternative names for the node

required
confidence

The confidence that the annotation is a good match

required
description

Description of the instance

required
end_node_page_number

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

required
end_node_text

The text extracted from within the bounding box on the endNode. Only applicable if an endNode is defined

required
end_node_x_max

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

required
end_node_x_min

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

required
end_node_y_max

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

required
end_node_y_min

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

required
name

Name of the instance

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
start_node_page_number

The number of the page on which this annotation is located in startNode File. The first page has number 1

required
start_node_text

The text extracted from within the bounding box on the startNode

required
start_node_x_max

Value between [0,1]. Maximum abscissa of the bounding box (right edge). Must be strictly more than startNodeXMin

required
start_node_x_min

Value between [0,1]. Minimum abscissa of the bounding box (left edge). Must be strictly less than startNodeXMax

required
start_node_y_max

Value between [0,1]. Maximum ordinate of the bounding box (top edge). Must be strictly more than startNodeYMin

required
start_node_y_min

Value between [0,1]. Minimum ordinate of the bounding box (bottom edge). Must be strictly less than startNodeYMax

required
status

The status of the annotation

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_diagram_annotation.py
class CogniteDiagramAnnotationGraphQL(GraphQLCore):
    """This represents the reading version of Cognite diagram annotation, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite diagram annotation.
        data_record: The data record of the Cognite diagram annotation node.
        end_node: The end node of this edge.
        aliases: Alternative names for the node
        confidence: The confidence that the annotation is a good match
        description: Description of the instance
        end_node_page_number: 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
        end_node_text: The text extracted from within the bounding box on the endNode. Only applicable if an endNode is
            defined
        end_node_x_max: 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_x_min: 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_y_max: 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_y_min: 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
        name: Name of the instance
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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_node_page_number: The number of the page on which this annotation is located in `startNode` File. The
            first page has number 1
        start_node_text: The text extracted from within the bounding box on the startNode
        start_node_x_max: Value between [0,1]. Maximum abscissa of the bounding box (right edge). Must be strictly more
            than startNodeXMin
        start_node_x_min: Value between [0,1]. Minimum abscissa of the bounding box (left edge). Must be strictly less
            than startNodeXMax
        start_node_y_max: Value between [0,1]. Maximum ordinate of the bounding box (top edge). Must be strictly more
            than startNodeYMin
        start_node_y_min: Value between [0,1]. Minimum ordinate of the bounding box (bottom edge). Must be strictly
            less than startNodeYMax
        status: The status of the annotation
        tags: Text based labels for generic use, limited to 1000
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteDiagramAnnotation", "v1")
    end_node: Union[dm.NodeId, None] = Field(None, alias="endNode")
    aliases: Optional[list[str]] = None
    confidence: Optional[float] = None
    description: Optional[str] = None
    end_node_page_number: Optional[int] = Field(None, alias="endNodePageNumber")
    end_node_text: Optional[str] = Field(None, alias="endNodeText")
    end_node_x_max: Optional[float] = Field(None, alias="endNodeXMax")
    end_node_x_min: Optional[float] = Field(None, alias="endNodeXMin")
    end_node_y_max: Optional[float] = Field(None, alias="endNodeYMax")
    end_node_y_min: Optional[float] = Field(None, alias="endNodeYMin")
    name: Optional[str] = None
    source: Optional[CogniteSourceSystemGraphQL] = Field(default=None, repr=False)
    source_context: Optional[str] = Field(None, alias="sourceContext")
    source_created_time: Optional[datetime.datetime] = Field(None, alias="sourceCreatedTime")
    source_created_user: Optional[str] = Field(None, alias="sourceCreatedUser")
    source_id: Optional[str] = Field(None, alias="sourceId")
    source_updated_time: Optional[datetime.datetime] = Field(None, alias="sourceUpdatedTime")
    source_updated_user: Optional[str] = Field(None, alias="sourceUpdatedUser")
    start_node_page_number: Optional[int] = Field(None, alias="startNodePageNumber")
    start_node_text: Optional[str] = Field(None, alias="startNodeText")
    start_node_x_max: Optional[float] = Field(None, alias="startNodeXMax")
    start_node_x_min: Optional[float] = Field(None, alias="startNodeXMin")
    start_node_y_max: Optional[float] = Field(None, alias="startNodeYMax")
    start_node_y_min: Optional[float] = Field(None, alias="startNodeYMin")
    status: Optional[Literal["Approved", "Rejected", "Suggested"]] = None
    tags: Optional[list[str]] = None

    def as_read(self) -> CogniteDiagramAnnotation:
        """Convert this GraphQL format of Cognite diagram annotation to the reading format."""
        return CogniteDiagramAnnotation.model_validate(as_read_args(self))

    def as_write(self) -> CogniteDiagramAnnotationWrite:
        """Convert this GraphQL format of Cognite diagram annotation to the writing format."""
        return CogniteDiagramAnnotationWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite diagram annotation to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_diagram_annotation.py
def as_read(self) -> CogniteDiagramAnnotation:
    """Convert this GraphQL format of Cognite diagram annotation to the reading format."""
    return CogniteDiagramAnnotation.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite diagram annotation to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_diagram_annotation.py
def as_write(self) -> CogniteDiagramAnnotationWrite:
    """Convert this GraphQL format of Cognite diagram annotation to the writing format."""
    return CogniteDiagramAnnotationWrite.model_validate(as_write_args(self))

CogniteDiagramAnnotationList

Bases: DomainRelationList[CogniteDiagramAnnotation]

List of Cognite diagram annotations in the reading version.

Source code in examples/cognite_core/data_classes/_cognite_diagram_annotation.py
class CogniteDiagramAnnotationList(DomainRelationList[CogniteDiagramAnnotation]):
    """List of Cognite diagram annotations in the reading version."""

    _INSTANCE = CogniteDiagramAnnotation

    def as_write(self) -> CogniteDiagramAnnotationWriteList:
        """Convert this read version of Cognite diagram annotation list to the writing version."""
        return CogniteDiagramAnnotationWriteList([edge.as_write() for edge in self])

as_write()

Convert this read version of Cognite diagram annotation list to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_diagram_annotation.py
def as_write(self) -> CogniteDiagramAnnotationWriteList:
    """Convert this read version of Cognite diagram annotation list to the writing version."""
    return CogniteDiagramAnnotationWriteList([edge.as_write() for edge in self])

CogniteDiagramAnnotationWrite

Bases: CogniteAnnotationWrite

This represents the writing version of Cognite diagram annotation.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite diagram annotation.

required
data_record

The data record of the Cognite diagram annotation edge.

required
end_node

The end node of this edge.

required
aliases

Alternative names for the node

required
confidence

The confidence that the annotation is a good match

required
description

Description of the instance

required
end_node_page_number

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

required
end_node_text

The text extracted from within the bounding box on the endNode. Only applicable if an endNode is defined

required
end_node_x_max

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

required
end_node_x_min

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

required
end_node_y_max

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

required
end_node_y_min

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

required
name

Name of the instance

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
start_node_page_number

The number of the page on which this annotation is located in startNode File. The first page has number 1

required
start_node_text

The text extracted from within the bounding box on the startNode

required
start_node_x_max

Value between [0,1]. Maximum abscissa of the bounding box (right edge). Must be strictly more than startNodeXMin

required
start_node_x_min

Value between [0,1]. Minimum abscissa of the bounding box (left edge). Must be strictly less than startNodeXMax

required
start_node_y_max

Value between [0,1]. Maximum ordinate of the bounding box (top edge). Must be strictly more than startNodeYMin

required
start_node_y_min

Value between [0,1]. Minimum ordinate of the bounding box (bottom edge). Must be strictly less than startNodeYMax

required
status

The status of the annotation

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_diagram_annotation.py
class CogniteDiagramAnnotationWrite(CogniteAnnotationWrite):
    """This represents the writing version of Cognite diagram annotation.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite diagram annotation.
        data_record: The data record of the Cognite diagram annotation edge.
        end_node: The end node of this edge.
        aliases: Alternative names for the node
        confidence: The confidence that the annotation is a good match
        description: Description of the instance
        end_node_page_number: 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
        end_node_text: The text extracted from within the bounding box on the endNode. Only applicable if an endNode is
            defined
        end_node_x_max: 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_x_min: 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_y_max: 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_y_min: 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
        name: Name of the instance
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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_node_page_number: The number of the page on which this annotation is located in `startNode` File. The
            first page has number 1
        start_node_text: The text extracted from within the bounding box on the startNode
        start_node_x_max: Value between [0,1]. Maximum abscissa of the bounding box (right edge). Must be strictly more
            than startNodeXMin
        start_node_x_min: Value between [0,1]. Minimum abscissa of the bounding box (left edge). Must be strictly less
            than startNodeXMax
        start_node_y_max: Value between [0,1]. Maximum ordinate of the bounding box (top edge). Must be strictly more
            than startNodeYMin
        start_node_y_min: Value between [0,1]. Minimum ordinate of the bounding box (bottom edge). Must be strictly
            less than startNodeYMax
        status: The status of the annotation
        tags: Text based labels for generic use, limited to 1000
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "confidence",
        "description",
        "end_node_page_number",
        "end_node_text",
        "end_node_x_max",
        "end_node_x_min",
        "end_node_y_max",
        "end_node_y_min",
        "name",
        "source",
        "source_context",
        "source_created_time",
        "source_created_user",
        "source_id",
        "source_updated_time",
        "source_updated_user",
        "start_node_page_number",
        "start_node_text",
        "start_node_x_max",
        "start_node_x_min",
        "start_node_y_max",
        "start_node_y_min",
        "status",
        "tags",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = ("source",)
    _validate_end_node = _validate_end_node

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteDiagramAnnotation", "v1")
    end_node_page_number: Optional[int] = Field(None, alias="endNodePageNumber")
    end_node_text: Optional[str] = Field(None, alias="endNodeText")
    end_node_x_max: Optional[float] = Field(None, alias="endNodeXMax")
    end_node_x_min: Optional[float] = Field(None, alias="endNodeXMin")
    end_node_y_max: Optional[float] = Field(None, alias="endNodeYMax")
    end_node_y_min: Optional[float] = Field(None, alias="endNodeYMin")
    start_node_page_number: Optional[int] = Field(None, alias="startNodePageNumber")
    start_node_text: Optional[str] = Field(None, alias="startNodeText")
    start_node_x_max: Optional[float] = Field(None, alias="startNodeXMax")
    start_node_x_min: Optional[float] = Field(None, alias="startNodeXMin")
    start_node_y_max: Optional[float] = Field(None, alias="startNodeYMax")
    start_node_y_min: Optional[float] = Field(None, alias="startNodeYMin")

CogniteDiagramAnnotationWriteList

Bases: DomainRelationWriteList[CogniteDiagramAnnotationWrite]

List of Cognite diagram annotations in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_diagram_annotation.py
class CogniteDiagramAnnotationWriteList(DomainRelationWriteList[CogniteDiagramAnnotationWrite]):
    """List of Cognite diagram annotations in the writing version."""

    _INSTANCE = CogniteDiagramAnnotationWrite

CogniteEquipment

Bases: CogniteDescribableNode, CogniteSourceableNode

This represents the reading version of Cognite equipment.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite equipment.

required
data_record

The data record of the Cognite equipment node.

required
activities

An automatically updated list of activities related to the equipment.

required
aliases

Alternative names for the node

required
asset

The asset the equipment is related to.

required
description

Description of the instance

required
equipment_type

Specifies the type of the equipment. It's a direct relation to CogniteEquipmentType.

required
files

A list of files the equipment relates to.

required
manufacturer

The manufacturer of the equipment.

required
name

Name of the instance

required
serial_number

The serial number of the equipment.

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
tags

Text based labels for generic use, limited to 1000

required
time_series

An automatically updated list of time series related to the equipment.

required
Source code in examples/cognite_core/data_classes/_cognite_equipment.py
class CogniteEquipment(CogniteDescribableNode, CogniteSourceableNode):
    """This represents the reading version of Cognite equipment.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite equipment.
        data_record: The data record of the Cognite equipment node.
        activities: An automatically updated list of activities related to the equipment.
        aliases: Alternative names for the node
        asset: The asset the equipment is related to.
        description: Description of the instance
        equipment_type: Specifies the type of the equipment. It's a direct relation to CogniteEquipmentType.
        files: A list of files the equipment relates to.
        manufacturer: The manufacturer of the equipment.
        name: Name of the instance
        serial_number: The serial number of the equipment.
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        tags: Text based labels for generic use, limited to 1000
        time_series: An automatically updated list of time series related to the equipment.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteEquipment", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    activities: Optional[list[CogniteActivity]] = Field(default=None, repr=False)
    asset: Union[CogniteAsset, str, dm.NodeId, None] = Field(default=None, repr=False)
    equipment_type: Union[CogniteEquipmentType, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="equipmentType"
    )
    files: Optional[list[Union[CogniteFile, str, dm.NodeId]]] = Field(default=None, repr=False)
    manufacturer: Optional[str] = None
    serial_number: Optional[str] = Field(None, alias="serialNumber")
    time_series: Optional[list[CogniteTimeSeries]] = Field(default=None, repr=False, alias="timeSeries")

    @field_validator("asset", "equipment_type", "source", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    @field_validator("activities", "files", "time_series", mode="before")
    @classmethod
    def parse_list(cls, value: Any, info: ValidationInfo) -> Any:
        if value is None:
            return None
        return [parse_single_connection(item, info.field_name) for item in value]

    def as_write(self) -> CogniteEquipmentWrite:
        """Convert this read version of Cognite equipment to the writing version."""
        return CogniteEquipmentWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite equipment to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_equipment.py
def as_write(self) -> CogniteEquipmentWrite:
    """Convert this read version of Cognite equipment to the writing version."""
    return CogniteEquipmentWrite.model_validate(as_write_args(self))

CogniteEquipmentGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite equipment, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite equipment.

required
data_record

The data record of the Cognite equipment node.

required
activities

An automatically updated list of activities related to the equipment.

required
aliases

Alternative names for the node

required
asset

The asset the equipment is related to.

required
description

Description of the instance

required
equipment_type

Specifies the type of the equipment. It's a direct relation to CogniteEquipmentType.

required
files

A list of files the equipment relates to.

required
manufacturer

The manufacturer of the equipment.

required
name

Name of the instance

required
serial_number

The serial number of the equipment.

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
tags

Text based labels for generic use, limited to 1000

required
time_series

An automatically updated list of time series related to the equipment.

required
Source code in examples/cognite_core/data_classes/_cognite_equipment.py
class CogniteEquipmentGraphQL(GraphQLCore):
    """This represents the reading version of Cognite equipment, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite equipment.
        data_record: The data record of the Cognite equipment node.
        activities: An automatically updated list of activities related to the equipment.
        aliases: Alternative names for the node
        asset: The asset the equipment is related to.
        description: Description of the instance
        equipment_type: Specifies the type of the equipment. It's a direct relation to CogniteEquipmentType.
        files: A list of files the equipment relates to.
        manufacturer: The manufacturer of the equipment.
        name: Name of the instance
        serial_number: The serial number of the equipment.
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        tags: Text based labels for generic use, limited to 1000
        time_series: An automatically updated list of time series related to the equipment.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteEquipment", "v1")
    activities: Optional[list[CogniteActivityGraphQL]] = Field(default=None, repr=False)
    aliases: Optional[list[str]] = None
    asset: Optional[CogniteAssetGraphQL] = Field(default=None, repr=False)
    description: Optional[str] = None
    equipment_type: Optional[CogniteEquipmentTypeGraphQL] = Field(default=None, repr=False, alias="equipmentType")
    files: Optional[list[CogniteFileGraphQL]] = Field(default=None, repr=False)
    manufacturer: Optional[str] = None
    name: Optional[str] = None
    serial_number: Optional[str] = Field(None, alias="serialNumber")
    source: Optional[CogniteSourceSystemGraphQL] = Field(default=None, repr=False)
    source_context: Optional[str] = Field(None, alias="sourceContext")
    source_created_time: Optional[datetime.datetime] = Field(None, alias="sourceCreatedTime")
    source_created_user: Optional[str] = Field(None, alias="sourceCreatedUser")
    source_id: Optional[str] = Field(None, alias="sourceId")
    source_updated_time: Optional[datetime.datetime] = Field(None, alias="sourceUpdatedTime")
    source_updated_user: Optional[str] = Field(None, alias="sourceUpdatedUser")
    tags: Optional[list[str]] = None
    time_series: Optional[list[CogniteTimeSeriesGraphQL]] = Field(default=None, repr=False, alias="timeSeries")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("activities", "asset", "equipment_type", "files", "source", "time_series", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> CogniteEquipment:
        """Convert this GraphQL format of Cognite equipment to the reading format."""
        return CogniteEquipment.model_validate(as_read_args(self))

    def as_write(self) -> CogniteEquipmentWrite:
        """Convert this GraphQL format of Cognite equipment to the writing format."""
        return CogniteEquipmentWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite equipment to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_equipment.py
def as_read(self) -> CogniteEquipment:
    """Convert this GraphQL format of Cognite equipment to the reading format."""
    return CogniteEquipment.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite equipment to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_equipment.py
def as_write(self) -> CogniteEquipmentWrite:
    """Convert this GraphQL format of Cognite equipment to the writing format."""
    return CogniteEquipmentWrite.model_validate(as_write_args(self))

CogniteEquipmentList

Bases: DomainModelList[CogniteEquipment]

List of Cognite equipments in the read version.

Source code in examples/cognite_core/data_classes/_cognite_equipment.py
class CogniteEquipmentList(DomainModelList[CogniteEquipment]):
    """List of Cognite equipments in the read version."""

    _INSTANCE = CogniteEquipment

    def as_write(self) -> CogniteEquipmentWriteList:
        """Convert these read versions of Cognite equipment to the writing versions."""
        return CogniteEquipmentWriteList([node.as_write() for node in self.data])

    @property
    def activities(self) -> CogniteActivityList:
        from ._cognite_activity import CogniteActivity, CogniteActivityList

        return CogniteActivityList(
            [item for items in self.data for item in items.activities or [] if isinstance(item, CogniteActivity)]
        )

    @property
    def asset(self) -> CogniteAssetList:
        from ._cognite_asset import CogniteAsset, CogniteAssetList

        return CogniteAssetList([item.asset for item in self.data if isinstance(item.asset, CogniteAsset)])

    @property
    def equipment_type(self) -> CogniteEquipmentTypeList:
        from ._cognite_equipment_type import CogniteEquipmentType, CogniteEquipmentTypeList

        return CogniteEquipmentTypeList(
            [item.equipment_type for item in self.data if isinstance(item.equipment_type, CogniteEquipmentType)]
        )

    @property
    def files(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList(
            [item for items in self.data for item in items.files or [] if isinstance(item, CogniteFile)]
        )

    @property
    def source(self) -> CogniteSourceSystemList:
        from ._cognite_source_system import CogniteSourceSystem, CogniteSourceSystemList

        return CogniteSourceSystemList(
            [item.source for item in self.data if isinstance(item.source, CogniteSourceSystem)]
        )

    @property
    def time_series(self) -> CogniteTimeSeriesList:
        from ._cognite_time_series import CogniteTimeSeries, CogniteTimeSeriesList

        return CogniteTimeSeriesList(
            [item for items in self.data for item in items.time_series or [] if isinstance(item, CogniteTimeSeries)]
        )

as_write()

Convert these read versions of Cognite equipment to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_equipment.py
def as_write(self) -> CogniteEquipmentWriteList:
    """Convert these read versions of Cognite equipment to the writing versions."""
    return CogniteEquipmentWriteList([node.as_write() for node in self.data])

CogniteEquipmentType

Bases: CogniteDescribableNode

This represents the reading version of Cognite equipment type.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite equipment type.

required
data_record

The data record of the Cognite equipment type node.

required
aliases

Alternative names for the node

required
code

A unique identifier for the type of equipment.

required
description

Description of the instance

required
equipment_class

Represents the class of equipment.

required
name

Name of the instance

required
standard

An identifier for the standard this equipment type is sourced from, for example, ISO14224.

required
standard_reference

A reference to the source of the equipment standard.

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_equipment_type.py
class CogniteEquipmentType(CogniteDescribableNode):
    """This represents the reading version of Cognite equipment type.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite equipment type.
        data_record: The data record of the Cognite equipment type node.
        aliases: Alternative names for the node
        code: A unique identifier for the type of equipment.
        description: Description of the instance
        equipment_class: Represents the class of equipment.
        name: Name of the instance
        standard: An identifier for the standard this equipment type is sourced from, for example, ISO14224.
        standard_reference: A reference to the source of the equipment standard.
        tags: Text based labels for generic use, limited to 1000
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteEquipmentType", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    code: Optional[str] = None
    equipment_class: Optional[str] = Field(None, alias="equipmentClass")
    standard: Optional[str] = None
    standard_reference: Optional[str] = Field(None, alias="standardReference")

    def as_write(self) -> CogniteEquipmentTypeWrite:
        """Convert this read version of Cognite equipment type to the writing version."""
        return CogniteEquipmentTypeWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite equipment type to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_equipment_type.py
def as_write(self) -> CogniteEquipmentTypeWrite:
    """Convert this read version of Cognite equipment type to the writing version."""
    return CogniteEquipmentTypeWrite.model_validate(as_write_args(self))

CogniteEquipmentTypeGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite equipment type, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite equipment type.

required
data_record

The data record of the Cognite equipment type node.

required
aliases

Alternative names for the node

required
code

A unique identifier for the type of equipment.

required
description

Description of the instance

required
equipment_class

Represents the class of equipment.

required
name

Name of the instance

required
standard

An identifier for the standard this equipment type is sourced from, for example, ISO14224.

required
standard_reference

A reference to the source of the equipment standard.

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_equipment_type.py
class CogniteEquipmentTypeGraphQL(GraphQLCore):
    """This represents the reading version of Cognite equipment type, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite equipment type.
        data_record: The data record of the Cognite equipment type node.
        aliases: Alternative names for the node
        code: A unique identifier for the type of equipment.
        description: Description of the instance
        equipment_class: Represents the class of equipment.
        name: Name of the instance
        standard: An identifier for the standard this equipment type is sourced from, for example, ISO14224.
        standard_reference: A reference to the source of the equipment standard.
        tags: Text based labels for generic use, limited to 1000
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteEquipmentType", "v1")
    aliases: Optional[list[str]] = None
    code: Optional[str] = None
    description: Optional[str] = None
    equipment_class: Optional[str] = Field(None, alias="equipmentClass")
    name: Optional[str] = None
    standard: Optional[str] = None
    standard_reference: Optional[str] = Field(None, alias="standardReference")
    tags: Optional[list[str]] = None

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    def as_read(self) -> CogniteEquipmentType:
        """Convert this GraphQL format of Cognite equipment type to the reading format."""
        return CogniteEquipmentType.model_validate(as_read_args(self))

    def as_write(self) -> CogniteEquipmentTypeWrite:
        """Convert this GraphQL format of Cognite equipment type to the writing format."""
        return CogniteEquipmentTypeWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite equipment type to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_equipment_type.py
def as_read(self) -> CogniteEquipmentType:
    """Convert this GraphQL format of Cognite equipment type to the reading format."""
    return CogniteEquipmentType.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite equipment type to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_equipment_type.py
def as_write(self) -> CogniteEquipmentTypeWrite:
    """Convert this GraphQL format of Cognite equipment type to the writing format."""
    return CogniteEquipmentTypeWrite.model_validate(as_write_args(self))

CogniteEquipmentTypeList

Bases: DomainModelList[CogniteEquipmentType]

List of Cognite equipment types in the read version.

Source code in examples/cognite_core/data_classes/_cognite_equipment_type.py
class CogniteEquipmentTypeList(DomainModelList[CogniteEquipmentType]):
    """List of Cognite equipment types in the read version."""

    _INSTANCE = CogniteEquipmentType

    def as_write(self) -> CogniteEquipmentTypeWriteList:
        """Convert these read versions of Cognite equipment type to the writing versions."""
        return CogniteEquipmentTypeWriteList([node.as_write() for node in self.data])

as_write()

Convert these read versions of Cognite equipment type to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_equipment_type.py
def as_write(self) -> CogniteEquipmentTypeWriteList:
    """Convert these read versions of Cognite equipment type to the writing versions."""
    return CogniteEquipmentTypeWriteList([node.as_write() for node in self.data])

CogniteEquipmentTypeWrite

Bases: CogniteDescribableNodeWrite

This represents the writing version of Cognite equipment type.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite equipment type.

required
data_record

The data record of the Cognite equipment type node.

required
aliases

Alternative names for the node

required
code

A unique identifier for the type of equipment.

required
description

Description of the instance

required
equipment_class

Represents the class of equipment.

required
name

Name of the instance

required
standard

An identifier for the standard this equipment type is sourced from, for example, ISO14224.

required
standard_reference

A reference to the source of the equipment standard.

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_equipment_type.py
class CogniteEquipmentTypeWrite(CogniteDescribableNodeWrite):
    """This represents the writing version of Cognite equipment type.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite equipment type.
        data_record: The data record of the Cognite equipment type node.
        aliases: Alternative names for the node
        code: A unique identifier for the type of equipment.
        description: Description of the instance
        equipment_class: Represents the class of equipment.
        name: Name of the instance
        standard: An identifier for the standard this equipment type is sourced from, for example, ISO14224.
        standard_reference: A reference to the source of the equipment standard.
        tags: Text based labels for generic use, limited to 1000
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "code",
        "description",
        "equipment_class",
        "name",
        "standard",
        "standard_reference",
        "tags",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteEquipmentType", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    code: Optional[str] = None
    equipment_class: Optional[str] = Field(None, alias="equipmentClass")
    standard: Optional[str] = None
    standard_reference: Optional[str] = Field(None, alias="standardReference")

CogniteEquipmentTypeWriteList

Bases: DomainModelWriteList[CogniteEquipmentTypeWrite]

List of Cognite equipment types in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_equipment_type.py
class CogniteEquipmentTypeWriteList(DomainModelWriteList[CogniteEquipmentTypeWrite]):
    """List of Cognite equipment types in the writing version."""

    _INSTANCE = CogniteEquipmentTypeWrite

CogniteEquipmentWrite

Bases: CogniteDescribableNodeWrite, CogniteSourceableNodeWrite

This represents the writing version of Cognite equipment.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite equipment.

required
data_record

The data record of the Cognite equipment node.

required
aliases

Alternative names for the node

required
asset

The asset the equipment is related to.

required
description

Description of the instance

required
equipment_type

Specifies the type of the equipment. It's a direct relation to CogniteEquipmentType.

required
files

A list of files the equipment relates to.

required
manufacturer

The manufacturer of the equipment.

required
name

Name of the instance

required
serial_number

The serial number of the equipment.

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_equipment.py
class CogniteEquipmentWrite(CogniteDescribableNodeWrite, CogniteSourceableNodeWrite):
    """This represents the writing version of Cognite equipment.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite equipment.
        data_record: The data record of the Cognite equipment node.
        aliases: Alternative names for the node
        asset: The asset the equipment is related to.
        description: Description of the instance
        equipment_type: Specifies the type of the equipment. It's a direct relation to CogniteEquipmentType.
        files: A list of files the equipment relates to.
        manufacturer: The manufacturer of the equipment.
        name: Name of the instance
        serial_number: The serial number of the equipment.
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        tags: Text based labels for generic use, limited to 1000
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "asset",
        "description",
        "equipment_type",
        "files",
        "manufacturer",
        "name",
        "serial_number",
        "source",
        "source_context",
        "source_created_time",
        "source_created_user",
        "source_id",
        "source_updated_time",
        "source_updated_user",
        "tags",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = (
        "asset",
        "equipment_type",
        "files",
        "source",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteEquipment", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    asset: Union[CogniteAssetWrite, str, dm.NodeId, None] = Field(default=None, repr=False)
    equipment_type: Union[CogniteEquipmentTypeWrite, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="equipmentType"
    )
    files: Optional[list[Union[CogniteFileWrite, str, dm.NodeId]]] = Field(default=None, repr=False)
    manufacturer: Optional[str] = None
    serial_number: Optional[str] = Field(None, alias="serialNumber")

    @field_validator("asset", "equipment_type", "files", mode="before")
    def as_node_id(cls, value: Any) -> Any:
        if isinstance(value, dm.DirectRelationReference):
            return dm.NodeId(value.space, value.external_id)
        elif isinstance(value, tuple) and len(value) == 2 and all(isinstance(item, str) for item in value):
            return dm.NodeId(value[0], value[1])
        elif isinstance(value, list):
            return [cls.as_node_id(item) for item in value]
        return value

CogniteEquipmentWriteList

Bases: DomainModelWriteList[CogniteEquipmentWrite]

List of Cognite equipments in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_equipment.py
class CogniteEquipmentWriteList(DomainModelWriteList[CogniteEquipmentWrite]):
    """List of Cognite equipments in the writing version."""

    _INSTANCE = CogniteEquipmentWrite

    @property
    def asset(self) -> CogniteAssetWriteList:
        from ._cognite_asset import CogniteAssetWrite, CogniteAssetWriteList

        return CogniteAssetWriteList([item.asset for item in self.data if isinstance(item.asset, CogniteAssetWrite)])

    @property
    def equipment_type(self) -> CogniteEquipmentTypeWriteList:
        from ._cognite_equipment_type import CogniteEquipmentTypeWrite, CogniteEquipmentTypeWriteList

        return CogniteEquipmentTypeWriteList(
            [item.equipment_type for item in self.data if isinstance(item.equipment_type, CogniteEquipmentTypeWrite)]
        )

    @property
    def files(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList(
            [item for items in self.data for item in items.files or [] if isinstance(item, CogniteFileWrite)]
        )

    @property
    def source(self) -> CogniteSourceSystemWriteList:
        from ._cognite_source_system import CogniteSourceSystemWrite, CogniteSourceSystemWriteList

        return CogniteSourceSystemWriteList(
            [item.source for item in self.data if isinstance(item.source, CogniteSourceSystemWrite)]
        )

CogniteFile

Bases: CogniteDescribableNode, CogniteSourceableNode

This represents the reading version of Cognite file.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite file.

required
data_record

The data record of the Cognite file node.

required
aliases

Alternative names for the node

required
assets

A list of assets this file is related to.

required
category

Specifies the detected category the file belongs to. It's a direct relation to an instance of CogniteFileCategory.

required
description

Description of the instance

required
directory

Contains the path elements from the source (if the source system has a file system hierarchy or similar.)

required
equipment

An automatically updated list of equipment this file is related to.

required
is_uploaded

Specifies if the file content has been uploaded to Cognite Data Fusion or not.

required
mime_type

The MIME type of the file.

required
name

Name of the instance

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
tags

Text based labels for generic use, limited to 1000

required
uploaded_time

The time the file upload completed.

required
Source code in examples/cognite_core/data_classes/_cognite_file.py
class CogniteFile(CogniteDescribableNode, CogniteSourceableNode):
    """This represents the reading version of Cognite file.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite file.
        data_record: The data record of the Cognite file node.
        aliases: Alternative names for the node
        assets: A list of assets this file is related to.
        category: Specifies the detected category the file belongs to. It's a direct relation to an instance of
            CogniteFileCategory.
        description: Description of the instance
        directory: Contains the path elements from the source (if the source system has a file system hierarchy or
            similar.)
        equipment: An automatically updated list of equipment this file is related to.
        is_uploaded: Specifies if the file content has been uploaded to Cognite Data Fusion or not.
        mime_type: The MIME type of the file.
        name: Name of the instance
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        tags: Text based labels for generic use, limited to 1000
        uploaded_time: The time the file upload completed.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteFile", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    assets: Optional[list[Union[CogniteAsset, str, dm.NodeId]]] = Field(default=None, repr=False)
    category: Union[CogniteFileCategory, str, dm.NodeId, None] = Field(default=None, repr=False)
    directory: Optional[str] = None
    equipment: Optional[list[CogniteEquipment]] = Field(default=None, repr=False)
    is_uploaded: Optional[bool] = Field(None, alias="isUploaded")
    mime_type: Optional[str] = Field(None, alias="mimeType")
    uploaded_time: Optional[datetime.datetime] = Field(None, alias="uploadedTime")

    @field_validator("category", "source", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    @field_validator("assets", "equipment", mode="before")
    @classmethod
    def parse_list(cls, value: Any, info: ValidationInfo) -> Any:
        if value is None:
            return None
        return [parse_single_connection(item, info.field_name) for item in value]

    def as_write(self) -> CogniteFileWrite:
        """Convert this read version of Cognite file to the writing version."""
        return CogniteFileWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite file to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_file.py
def as_write(self) -> CogniteFileWrite:
    """Convert this read version of Cognite file to the writing version."""
    return CogniteFileWrite.model_validate(as_write_args(self))

CogniteFileCategory

Bases: CogniteDescribableNode

This represents the reading version of Cognite file category.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite file category.

required
data_record

The data record of the Cognite file category node.

required
aliases

Alternative names for the node

required
code

An identifier for the category, for example, 'AA' for Accounting (from Norsok.)

required
description

Description of the instance

required
name

Name of the instance

required
standard

The name of the standard the category originates from, for example, 'Norsok'.

required
standard_reference

A reference to the source of the category standard.

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_file_category.py
class CogniteFileCategory(CogniteDescribableNode):
    """This represents the reading version of Cognite file category.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite file category.
        data_record: The data record of the Cognite file category node.
        aliases: Alternative names for the node
        code: An identifier for the category, for example, 'AA' for Accounting (from Norsok.)
        description: Description of the instance
        name: Name of the instance
        standard: The name of the standard the category originates from, for example, 'Norsok'.
        standard_reference: A reference to the source of the category standard.
        tags: Text based labels for generic use, limited to 1000
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteFileCategory", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    code: str
    standard: Optional[str] = None
    standard_reference: Optional[str] = Field(None, alias="standardReference")

    def as_write(self) -> CogniteFileCategoryWrite:
        """Convert this read version of Cognite file category to the writing version."""
        return CogniteFileCategoryWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite file category to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_file_category.py
def as_write(self) -> CogniteFileCategoryWrite:
    """Convert this read version of Cognite file category to the writing version."""
    return CogniteFileCategoryWrite.model_validate(as_write_args(self))

CogniteFileCategoryGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite file category, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite file category.

required
data_record

The data record of the Cognite file category node.

required
aliases

Alternative names for the node

required
code

An identifier for the category, for example, 'AA' for Accounting (from Norsok.)

required
description

Description of the instance

required
name

Name of the instance

required
standard

The name of the standard the category originates from, for example, 'Norsok'.

required
standard_reference

A reference to the source of the category standard.

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_file_category.py
class CogniteFileCategoryGraphQL(GraphQLCore):
    """This represents the reading version of Cognite file category, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite file category.
        data_record: The data record of the Cognite file category node.
        aliases: Alternative names for the node
        code: An identifier for the category, for example, 'AA' for Accounting (from Norsok.)
        description: Description of the instance
        name: Name of the instance
        standard: The name of the standard the category originates from, for example, 'Norsok'.
        standard_reference: A reference to the source of the category standard.
        tags: Text based labels for generic use, limited to 1000
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteFileCategory", "v1")
    aliases: Optional[list[str]] = None
    code: Optional[str] = None
    description: Optional[str] = None
    name: Optional[str] = None
    standard: Optional[str] = None
    standard_reference: Optional[str] = Field(None, alias="standardReference")
    tags: Optional[list[str]] = None

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    def as_read(self) -> CogniteFileCategory:
        """Convert this GraphQL format of Cognite file category to the reading format."""
        return CogniteFileCategory.model_validate(as_read_args(self))

    def as_write(self) -> CogniteFileCategoryWrite:
        """Convert this GraphQL format of Cognite file category to the writing format."""
        return CogniteFileCategoryWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite file category to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_file_category.py
def as_read(self) -> CogniteFileCategory:
    """Convert this GraphQL format of Cognite file category to the reading format."""
    return CogniteFileCategory.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite file category to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_file_category.py
def as_write(self) -> CogniteFileCategoryWrite:
    """Convert this GraphQL format of Cognite file category to the writing format."""
    return CogniteFileCategoryWrite.model_validate(as_write_args(self))

CogniteFileCategoryList

Bases: DomainModelList[CogniteFileCategory]

List of Cognite file categories in the read version.

Source code in examples/cognite_core/data_classes/_cognite_file_category.py
class CogniteFileCategoryList(DomainModelList[CogniteFileCategory]):
    """List of Cognite file categories in the read version."""

    _INSTANCE = CogniteFileCategory

    def as_write(self) -> CogniteFileCategoryWriteList:
        """Convert these read versions of Cognite file category to the writing versions."""
        return CogniteFileCategoryWriteList([node.as_write() for node in self.data])

as_write()

Convert these read versions of Cognite file category to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_file_category.py
def as_write(self) -> CogniteFileCategoryWriteList:
    """Convert these read versions of Cognite file category to the writing versions."""
    return CogniteFileCategoryWriteList([node.as_write() for node in self.data])

CogniteFileCategoryWrite

Bases: CogniteDescribableNodeWrite

This represents the writing version of Cognite file category.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite file category.

required
data_record

The data record of the Cognite file category node.

required
aliases

Alternative names for the node

required
code

An identifier for the category, for example, 'AA' for Accounting (from Norsok.)

required
description

Description of the instance

required
name

Name of the instance

required
standard

The name of the standard the category originates from, for example, 'Norsok'.

required
standard_reference

A reference to the source of the category standard.

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_file_category.py
class CogniteFileCategoryWrite(CogniteDescribableNodeWrite):
    """This represents the writing version of Cognite file category.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite file category.
        data_record: The data record of the Cognite file category node.
        aliases: Alternative names for the node
        code: An identifier for the category, for example, 'AA' for Accounting (from Norsok.)
        description: Description of the instance
        name: Name of the instance
        standard: The name of the standard the category originates from, for example, 'Norsok'.
        standard_reference: A reference to the source of the category standard.
        tags: Text based labels for generic use, limited to 1000
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "code",
        "description",
        "name",
        "standard",
        "standard_reference",
        "tags",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteFileCategory", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    code: str
    standard: Optional[str] = None
    standard_reference: Optional[str] = Field(None, alias="standardReference")

CogniteFileCategoryWriteList

Bases: DomainModelWriteList[CogniteFileCategoryWrite]

List of Cognite file categories in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_file_category.py
class CogniteFileCategoryWriteList(DomainModelWriteList[CogniteFileCategoryWrite]):
    """List of Cognite file categories in the writing version."""

    _INSTANCE = CogniteFileCategoryWrite

CogniteFileGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite file, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite file.

required
data_record

The data record of the Cognite file node.

required
aliases

Alternative names for the node

required
assets

A list of assets this file is related to.

required
category

Specifies the detected category the file belongs to. It's a direct relation to an instance of CogniteFileCategory.

required
description

Description of the instance

required
directory

Contains the path elements from the source (if the source system has a file system hierarchy or similar.)

required
equipment

An automatically updated list of equipment this file is related to.

required
is_uploaded

Specifies if the file content has been uploaded to Cognite Data Fusion or not.

required
mime_type

The MIME type of the file.

required
name

Name of the instance

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
tags

Text based labels for generic use, limited to 1000

required
uploaded_time

The time the file upload completed.

required
Source code in examples/cognite_core/data_classes/_cognite_file.py
class CogniteFileGraphQL(GraphQLCore):
    """This represents the reading version of Cognite file, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite file.
        data_record: The data record of the Cognite file node.
        aliases: Alternative names for the node
        assets: A list of assets this file is related to.
        category: Specifies the detected category the file belongs to. It's a direct relation to an instance of
            CogniteFileCategory.
        description: Description of the instance
        directory: Contains the path elements from the source (if the source system has a file system hierarchy or
            similar.)
        equipment: An automatically updated list of equipment this file is related to.
        is_uploaded: Specifies if the file content has been uploaded to Cognite Data Fusion or not.
        mime_type: The MIME type of the file.
        name: Name of the instance
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        tags: Text based labels for generic use, limited to 1000
        uploaded_time: The time the file upload completed.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteFile", "v1")
    aliases: Optional[list[str]] = None
    assets: Optional[list[CogniteAssetGraphQL]] = Field(default=None, repr=False)
    category: Optional[CogniteFileCategoryGraphQL] = Field(default=None, repr=False)
    description: Optional[str] = None
    directory: Optional[str] = None
    equipment: Optional[list[CogniteEquipmentGraphQL]] = Field(default=None, repr=False)
    is_uploaded: Optional[bool] = Field(None, alias="isUploaded")
    mime_type: Optional[str] = Field(None, alias="mimeType")
    name: Optional[str] = None
    source: Optional[CogniteSourceSystemGraphQL] = Field(default=None, repr=False)
    source_context: Optional[str] = Field(None, alias="sourceContext")
    source_created_time: Optional[datetime.datetime] = Field(None, alias="sourceCreatedTime")
    source_created_user: Optional[str] = Field(None, alias="sourceCreatedUser")
    source_id: Optional[str] = Field(None, alias="sourceId")
    source_updated_time: Optional[datetime.datetime] = Field(None, alias="sourceUpdatedTime")
    source_updated_user: Optional[str] = Field(None, alias="sourceUpdatedUser")
    tags: Optional[list[str]] = None
    uploaded_time: Optional[datetime.datetime] = Field(None, alias="uploadedTime")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("assets", "category", "equipment", "source", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> CogniteFile:
        """Convert this GraphQL format of Cognite file to the reading format."""
        return CogniteFile.model_validate(as_read_args(self))

    def as_write(self) -> CogniteFileWrite:
        """Convert this GraphQL format of Cognite file to the writing format."""
        return CogniteFileWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite file to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_file.py
def as_read(self) -> CogniteFile:
    """Convert this GraphQL format of Cognite file to the reading format."""
    return CogniteFile.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite file to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_file.py
def as_write(self) -> CogniteFileWrite:
    """Convert this GraphQL format of Cognite file to the writing format."""
    return CogniteFileWrite.model_validate(as_write_args(self))

CogniteFileList

Bases: DomainModelList[CogniteFile]

List of Cognite files in the read version.

Source code in examples/cognite_core/data_classes/_cognite_file.py
class CogniteFileList(DomainModelList[CogniteFile]):
    """List of Cognite files in the read version."""

    _INSTANCE = CogniteFile

    def as_write(self) -> CogniteFileWriteList:
        """Convert these read versions of Cognite file to the writing versions."""
        return CogniteFileWriteList([node.as_write() for node in self.data])

    @property
    def assets(self) -> CogniteAssetList:
        from ._cognite_asset import CogniteAsset, CogniteAssetList

        return CogniteAssetList(
            [item for items in self.data for item in items.assets or [] if isinstance(item, CogniteAsset)]
        )

    @property
    def category(self) -> CogniteFileCategoryList:
        from ._cognite_file_category import CogniteFileCategory, CogniteFileCategoryList

        return CogniteFileCategoryList(
            [item.category for item in self.data if isinstance(item.category, CogniteFileCategory)]
        )

    @property
    def equipment(self) -> CogniteEquipmentList:
        from ._cognite_equipment import CogniteEquipment, CogniteEquipmentList

        return CogniteEquipmentList(
            [item for items in self.data for item in items.equipment or [] if isinstance(item, CogniteEquipment)]
        )

    @property
    def source(self) -> CogniteSourceSystemList:
        from ._cognite_source_system import CogniteSourceSystem, CogniteSourceSystemList

        return CogniteSourceSystemList(
            [item.source for item in self.data if isinstance(item.source, CogniteSourceSystem)]
        )

as_write()

Convert these read versions of Cognite file to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_file.py
def as_write(self) -> CogniteFileWriteList:
    """Convert these read versions of Cognite file to the writing versions."""
    return CogniteFileWriteList([node.as_write() for node in self.data])

CogniteFileWrite

Bases: CogniteDescribableNodeWrite, CogniteSourceableNodeWrite

This represents the writing version of Cognite file.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite file.

required
data_record

The data record of the Cognite file node.

required
aliases

Alternative names for the node

required
assets

A list of assets this file is related to.

required
category

Specifies the detected category the file belongs to. It's a direct relation to an instance of CogniteFileCategory.

required
description

Description of the instance

required
directory

Contains the path elements from the source (if the source system has a file system hierarchy or similar.)

required
mime_type

The MIME type of the file.

required
name

Name of the instance

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_file.py
class CogniteFileWrite(CogniteDescribableNodeWrite, CogniteSourceableNodeWrite):
    """This represents the writing version of Cognite file.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite file.
        data_record: The data record of the Cognite file node.
        aliases: Alternative names for the node
        assets: A list of assets this file is related to.
        category: Specifies the detected category the file belongs to. It's a direct relation to an instance of
            CogniteFileCategory.
        description: Description of the instance
        directory: Contains the path elements from the source (if the source system has a file system hierarchy or
            similar.)
        mime_type: The MIME type of the file.
        name: Name of the instance
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        tags: Text based labels for generic use, limited to 1000
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "assets",
        "category",
        "description",
        "directory",
        "mime_type",
        "name",
        "source",
        "source_context",
        "source_created_time",
        "source_created_user",
        "source_id",
        "source_updated_time",
        "source_updated_user",
        "tags",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = (
        "assets",
        "category",
        "source",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteFile", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    assets: Optional[list[Union[CogniteAssetWrite, str, dm.NodeId]]] = Field(default=None, repr=False)
    category: Union[CogniteFileCategoryWrite, str, dm.NodeId, None] = Field(default=None, repr=False)
    directory: Optional[str] = None
    mime_type: Optional[str] = Field(None, alias="mimeType")

    @field_validator("assets", "category", mode="before")
    def as_node_id(cls, value: Any) -> Any:
        if isinstance(value, dm.DirectRelationReference):
            return dm.NodeId(value.space, value.external_id)
        elif isinstance(value, tuple) and len(value) == 2 and all(isinstance(item, str) for item in value):
            return dm.NodeId(value[0], value[1])
        elif isinstance(value, list):
            return [cls.as_node_id(item) for item in value]
        return value

CogniteFileWriteList

Bases: DomainModelWriteList[CogniteFileWrite]

List of Cognite files in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_file.py
class CogniteFileWriteList(DomainModelWriteList[CogniteFileWrite]):
    """List of Cognite files in the writing version."""

    _INSTANCE = CogniteFileWrite

    @property
    def assets(self) -> CogniteAssetWriteList:
        from ._cognite_asset import CogniteAssetWrite, CogniteAssetWriteList

        return CogniteAssetWriteList(
            [item for items in self.data for item in items.assets or [] if isinstance(item, CogniteAssetWrite)]
        )

    @property
    def category(self) -> CogniteFileCategoryWriteList:
        from ._cognite_file_category import CogniteFileCategoryWrite, CogniteFileCategoryWriteList

        return CogniteFileCategoryWriteList(
            [item.category for item in self.data if isinstance(item.category, CogniteFileCategoryWrite)]
        )

    @property
    def source(self) -> CogniteSourceSystemWriteList:
        from ._cognite_source_system import CogniteSourceSystemWrite, CogniteSourceSystemWriteList

        return CogniteSourceSystemWriteList(
            [item.source for item in self.data if isinstance(item.source, CogniteSourceSystemWrite)]
        )

CognitePointCloudModel

Bases: Cognite3DModel

This represents the reading version of Cognite point cloud model.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite point cloud model.

required
data_record

The data record of the Cognite point cloud model node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
revisions

List of revisions for this PointCloud model

required
tags

Text based labels for generic use, limited to 1000

required
thumbnail

Thumbnail of the 3D model

required
type_

CAD, PointCloud or Image360

required
Source code in examples/cognite_core/data_classes/_cognite_point_cloud_model.py
class CognitePointCloudModel(Cognite3DModel):
    """This represents the reading version of Cognite point cloud model.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite point cloud model.
        data_record: The data record of the Cognite point cloud model node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        revisions: List of revisions for this PointCloud model
        tags: Text based labels for generic use, limited to 1000
        thumbnail: Thumbnail of the 3D model
        type_: CAD, PointCloud or Image360
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CognitePointCloudModel", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    revisions: Optional[list[CognitePointCloudRevision]] = Field(default=None, repr=False)

    @field_validator("thumbnail", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    @field_validator("revisions", mode="before")
    @classmethod
    def parse_list(cls, value: Any, info: ValidationInfo) -> Any:
        if value is None:
            return None
        return [parse_single_connection(item, info.field_name) for item in value]

    def as_write(self) -> CognitePointCloudModelWrite:
        """Convert this read version of Cognite point cloud model to the writing version."""
        return CognitePointCloudModelWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite point cloud model to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_model.py
def as_write(self) -> CognitePointCloudModelWrite:
    """Convert this read version of Cognite point cloud model to the writing version."""
    return CognitePointCloudModelWrite.model_validate(as_write_args(self))

CognitePointCloudModelGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite point cloud model, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite point cloud model.

required
data_record

The data record of the Cognite point cloud model node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
revisions

List of revisions for this PointCloud model

required
tags

Text based labels for generic use, limited to 1000

required
thumbnail

Thumbnail of the 3D model

required
type_

CAD, PointCloud or Image360

required
Source code in examples/cognite_core/data_classes/_cognite_point_cloud_model.py
class CognitePointCloudModelGraphQL(GraphQLCore):
    """This represents the reading version of Cognite point cloud model, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite point cloud model.
        data_record: The data record of the Cognite point cloud model node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        revisions: List of revisions for this PointCloud model
        tags: Text based labels for generic use, limited to 1000
        thumbnail: Thumbnail of the 3D model
        type_: CAD, PointCloud or Image360
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CognitePointCloudModel", "v1")
    aliases: Optional[list[str]] = None
    description: Optional[str] = None
    name: Optional[str] = None
    revisions: Optional[list[CognitePointCloudRevisionGraphQL]] = Field(default=None, repr=False)
    tags: Optional[list[str]] = None
    thumbnail: Optional[CogniteFileGraphQL] = Field(default=None, repr=False)
    type_: Optional[Literal["CAD", "Image360", "PointCloud"]] = Field(None, alias="type")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("revisions", "thumbnail", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> CognitePointCloudModel:
        """Convert this GraphQL format of Cognite point cloud model to the reading format."""
        return CognitePointCloudModel.model_validate(as_read_args(self))

    def as_write(self) -> CognitePointCloudModelWrite:
        """Convert this GraphQL format of Cognite point cloud model to the writing format."""
        return CognitePointCloudModelWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite point cloud model to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_model.py
def as_read(self) -> CognitePointCloudModel:
    """Convert this GraphQL format of Cognite point cloud model to the reading format."""
    return CognitePointCloudModel.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite point cloud model to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_model.py
def as_write(self) -> CognitePointCloudModelWrite:
    """Convert this GraphQL format of Cognite point cloud model to the writing format."""
    return CognitePointCloudModelWrite.model_validate(as_write_args(self))

CognitePointCloudModelList

Bases: DomainModelList[CognitePointCloudModel]

List of Cognite point cloud models in the read version.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_model.py
class CognitePointCloudModelList(DomainModelList[CognitePointCloudModel]):
    """List of Cognite point cloud models in the read version."""

    _INSTANCE = CognitePointCloudModel

    def as_write(self) -> CognitePointCloudModelWriteList:
        """Convert these read versions of Cognite point cloud model to the writing versions."""
        return CognitePointCloudModelWriteList([node.as_write() for node in self.data])

    @property
    def revisions(self) -> CognitePointCloudRevisionList:
        from ._cognite_point_cloud_revision import CognitePointCloudRevision, CognitePointCloudRevisionList

        return CognitePointCloudRevisionList(
            [
                item
                for items in self.data
                for item in items.revisions or []
                if isinstance(item, CognitePointCloudRevision)
            ]
        )

    @property
    def thumbnail(self) -> CogniteFileList:
        from ._cognite_file import CogniteFile, CogniteFileList

        return CogniteFileList([item.thumbnail for item in self.data if isinstance(item.thumbnail, CogniteFile)])

as_write()

Convert these read versions of Cognite point cloud model to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_model.py
def as_write(self) -> CognitePointCloudModelWriteList:
    """Convert these read versions of Cognite point cloud model to the writing versions."""
    return CognitePointCloudModelWriteList([node.as_write() for node in self.data])

CognitePointCloudModelWrite

Bases: Cognite3DModelWrite

This represents the writing version of Cognite point cloud model.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite point cloud model.

required
data_record

The data record of the Cognite point cloud model node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
thumbnail

Thumbnail of the 3D model

required
type_

CAD, PointCloud or Image360

required
Source code in examples/cognite_core/data_classes/_cognite_point_cloud_model.py
class CognitePointCloudModelWrite(Cognite3DModelWrite):
    """This represents the writing version of Cognite point cloud model.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite point cloud model.
        data_record: The data record of the Cognite point cloud model node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
        thumbnail: Thumbnail of the 3D model
        type_: CAD, PointCloud or Image360
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "description",
        "name",
        "tags",
        "thumbnail",
        "type_",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = ("thumbnail",)

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CognitePointCloudModel", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None

CognitePointCloudModelWriteList

Bases: DomainModelWriteList[CognitePointCloudModelWrite]

List of Cognite point cloud models in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_model.py
class CognitePointCloudModelWriteList(DomainModelWriteList[CognitePointCloudModelWrite]):
    """List of Cognite point cloud models in the writing version."""

    _INSTANCE = CognitePointCloudModelWrite

    @property
    def thumbnail(self) -> CogniteFileWriteList:
        from ._cognite_file import CogniteFileWrite, CogniteFileWriteList

        return CogniteFileWriteList(
            [item.thumbnail for item in self.data if isinstance(item.thumbnail, CogniteFileWrite)]
        )

CognitePointCloudRevision

Bases: Cognite3DRevision

This represents the reading version of Cognite point cloud revision.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite point cloud revision.

required
data_record

The data record of the Cognite point cloud revision node.

required
model_3d

.

required
published

The published field.

required
revision_id

The 3D API revision identifier for this PointCloud model

required
status

The status field.

required
type_

The type field.

required
Source code in examples/cognite_core/data_classes/_cognite_point_cloud_revision.py
class CognitePointCloudRevision(Cognite3DRevision, protected_namespaces=()):
    """This represents the reading version of Cognite point cloud revision.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite point cloud revision.
        data_record: The data record of the Cognite point cloud revision node.
        model_3d: .
        published: The published field.
        revision_id: The 3D API revision identifier for this PointCloud model
        status: The status field.
        type_: The type field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CognitePointCloudRevision", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    revision_id: Optional[int] = Field(None, alias="revisionId")

    @field_validator("model_3d", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    def as_write(self) -> CognitePointCloudRevisionWrite:
        """Convert this read version of Cognite point cloud revision to the writing version."""
        return CognitePointCloudRevisionWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite point cloud revision to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_revision.py
def as_write(self) -> CognitePointCloudRevisionWrite:
    """Convert this read version of Cognite point cloud revision to the writing version."""
    return CognitePointCloudRevisionWrite.model_validate(as_write_args(self))

CognitePointCloudRevisionGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite point cloud revision, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite point cloud revision.

required
data_record

The data record of the Cognite point cloud revision node.

required
model_3d

.

required
published

The published field.

required
revision_id

The 3D API revision identifier for this PointCloud model

required
status

The status field.

required
type_

The type field.

required
Source code in examples/cognite_core/data_classes/_cognite_point_cloud_revision.py
class CognitePointCloudRevisionGraphQL(GraphQLCore, protected_namespaces=()):
    """This represents the reading version of Cognite point cloud revision, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite point cloud revision.
        data_record: The data record of the Cognite point cloud revision node.
        model_3d: .
        published: The published field.
        revision_id: The 3D API revision identifier for this PointCloud model
        status: The status field.
        type_: The type field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CognitePointCloudRevision", "v1")
    model_3d: Optional[CognitePointCloudModelGraphQL] = Field(default=None, repr=False, alias="model3D")
    published: Optional[bool] = None
    revision_id: Optional[int] = Field(None, alias="revisionId")
    status: Optional[Literal["Done", "Failed", "Processing", "Queued"]] = None
    type_: Optional[Literal["CAD", "Image360", "PointCloud"]] = Field(None, alias="type")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("model_3d", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> CognitePointCloudRevision:
        """Convert this GraphQL format of Cognite point cloud revision to the reading format."""
        return CognitePointCloudRevision.model_validate(as_read_args(self))

    def as_write(self) -> CognitePointCloudRevisionWrite:
        """Convert this GraphQL format of Cognite point cloud revision to the writing format."""
        return CognitePointCloudRevisionWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite point cloud revision to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_revision.py
def as_read(self) -> CognitePointCloudRevision:
    """Convert this GraphQL format of Cognite point cloud revision to the reading format."""
    return CognitePointCloudRevision.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite point cloud revision to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_revision.py
def as_write(self) -> CognitePointCloudRevisionWrite:
    """Convert this GraphQL format of Cognite point cloud revision to the writing format."""
    return CognitePointCloudRevisionWrite.model_validate(as_write_args(self))

CognitePointCloudRevisionList

Bases: DomainModelList[CognitePointCloudRevision]

List of Cognite point cloud revisions in the read version.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_revision.py
class CognitePointCloudRevisionList(DomainModelList[CognitePointCloudRevision]):
    """List of Cognite point cloud revisions in the read version."""

    _INSTANCE = CognitePointCloudRevision

    def as_write(self) -> CognitePointCloudRevisionWriteList:
        """Convert these read versions of Cognite point cloud revision to the writing versions."""
        return CognitePointCloudRevisionWriteList([node.as_write() for node in self.data])

    @property
    def model_3d(self) -> CognitePointCloudModelList:
        from ._cognite_point_cloud_model import CognitePointCloudModel, CognitePointCloudModelList

        return CognitePointCloudModelList(
            [item.model_3d for item in self.data if isinstance(item.model_3d, CognitePointCloudModel)]
        )

as_write()

Convert these read versions of Cognite point cloud revision to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_revision.py
def as_write(self) -> CognitePointCloudRevisionWriteList:
    """Convert these read versions of Cognite point cloud revision to the writing versions."""
    return CognitePointCloudRevisionWriteList([node.as_write() for node in self.data])

CognitePointCloudRevisionWrite

Bases: Cognite3DRevisionWrite

This represents the writing version of Cognite point cloud revision.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite point cloud revision.

required
data_record

The data record of the Cognite point cloud revision node.

required
model_3d

.

required
published

The published field.

required
revision_id

The 3D API revision identifier for this PointCloud model

required
status

The status field.

required
type_

The type field.

required
Source code in examples/cognite_core/data_classes/_cognite_point_cloud_revision.py
class CognitePointCloudRevisionWrite(Cognite3DRevisionWrite, protected_namespaces=()):
    """This represents the writing version of Cognite point cloud revision.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite point cloud revision.
        data_record: The data record of the Cognite point cloud revision node.
        model_3d: .
        published: The published field.
        revision_id: The 3D API revision identifier for this PointCloud model
        status: The status field.
        type_: The type field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "model_3d",
        "published",
        "revision_id",
        "status",
        "type_",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = ("model_3d",)

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CognitePointCloudRevision", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    revision_id: Optional[int] = Field(None, alias="revisionId")

CognitePointCloudRevisionWriteList

Bases: DomainModelWriteList[CognitePointCloudRevisionWrite]

List of Cognite point cloud revisions in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_revision.py
class CognitePointCloudRevisionWriteList(DomainModelWriteList[CognitePointCloudRevisionWrite]):
    """List of Cognite point cloud revisions in the writing version."""

    _INSTANCE = CognitePointCloudRevisionWrite

    @property
    def model_3d(self) -> CognitePointCloudModelWriteList:
        from ._cognite_point_cloud_model import CognitePointCloudModelWrite, CognitePointCloudModelWriteList

        return CognitePointCloudModelWriteList(
            [item.model_3d for item in self.data if isinstance(item.model_3d, CognitePointCloudModelWrite)]
        )

CognitePointCloudVolume

Bases: CogniteDescribableNode

This represents the reading version of Cognite point cloud volume.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite point cloud volume.

required
data_record

The data record of the Cognite point cloud volume node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
format_version

Specifies the version the 'volume' field is following. Volume definition is today 9 floats (property volume)

required
model_3d

Direct relation to Cognite3DModel instance

required
name

Name of the instance

required
object_3d

Direct relation to object3D grouping for this node

required
revisions

List of direct relations to revision information

required
tags

Text based labels for generic use, limited to 1000

required
volume

Relevant coordinates for the volume type, 9 floats in total, that defines the volume

required
volume_references

Unique volume metric hashes used to access the 3D specialized data storage

required
volume_type

Type of volume (Cylinder or Box)

required
Source code in examples/cognite_core/data_classes/_cognite_point_cloud_volume.py
class CognitePointCloudVolume(CogniteDescribableNode, protected_namespaces=()):
    """This represents the reading version of Cognite point cloud volume.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite point cloud volume.
        data_record: The data record of the Cognite point cloud volume node.
        aliases: Alternative names for the node
        description: Description of the instance
        format_version: Specifies the version the 'volume' field is following. Volume definition is today 9 floats
            (property volume)
        model_3d: Direct relation to Cognite3DModel instance
        name: Name of the instance
        object_3d: Direct relation to object3D grouping for this node
        revisions: List of direct relations to revision information
        tags: Text based labels for generic use, limited to 1000
        volume: Relevant coordinates for the volume type, 9 floats in total, that defines the volume
        volume_references: Unique volume metric hashes used to access the 3D specialized data storage
        volume_type: Type of volume (Cylinder or Box)
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CognitePointCloudVolume", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    format_version: Optional[str] = Field(None, alias="formatVersion")
    model_3d: Union[CogniteCADModel, str, dm.NodeId, None] = Field(default=None, repr=False, alias="model3D")
    object_3d: Union[Cognite3DObject, str, dm.NodeId, None] = Field(default=None, repr=False, alias="object3D")
    revisions: Optional[list[Union[CogniteCADRevision, str, dm.NodeId]]] = Field(default=None, repr=False)
    volume: Optional[list[float]] = None
    volume_references: Optional[list[str]] = Field(None, alias="volumeReferences")
    volume_type: Optional[Literal["Box", "Cylinder"]] | str = Field(None, alias="volumeType")

    @field_validator("model_3d", "object_3d", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    @field_validator("revisions", mode="before")
    @classmethod
    def parse_list(cls, value: Any, info: ValidationInfo) -> Any:
        if value is None:
            return None
        return [parse_single_connection(item, info.field_name) for item in value]

    def as_write(self) -> CognitePointCloudVolumeWrite:
        """Convert this read version of Cognite point cloud volume to the writing version."""
        return CognitePointCloudVolumeWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite point cloud volume to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_volume.py
def as_write(self) -> CognitePointCloudVolumeWrite:
    """Convert this read version of Cognite point cloud volume to the writing version."""
    return CognitePointCloudVolumeWrite.model_validate(as_write_args(self))

CognitePointCloudVolumeGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite point cloud volume, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite point cloud volume.

required
data_record

The data record of the Cognite point cloud volume node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
format_version

Specifies the version the 'volume' field is following. Volume definition is today 9 floats (property volume)

required
model_3d

Direct relation to Cognite3DModel instance

required
name

Name of the instance

required
object_3d

Direct relation to object3D grouping for this node

required
revisions

List of direct relations to revision information

required
tags

Text based labels for generic use, limited to 1000

required
volume

Relevant coordinates for the volume type, 9 floats in total, that defines the volume

required
volume_references

Unique volume metric hashes used to access the 3D specialized data storage

required
volume_type

Type of volume (Cylinder or Box)

required
Source code in examples/cognite_core/data_classes/_cognite_point_cloud_volume.py
class CognitePointCloudVolumeGraphQL(GraphQLCore, protected_namespaces=()):
    """This represents the reading version of Cognite point cloud volume, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite point cloud volume.
        data_record: The data record of the Cognite point cloud volume node.
        aliases: Alternative names for the node
        description: Description of the instance
        format_version: Specifies the version the 'volume' field is following. Volume definition is today 9 floats
            (property volume)
        model_3d: Direct relation to Cognite3DModel instance
        name: Name of the instance
        object_3d: Direct relation to object3D grouping for this node
        revisions: List of direct relations to revision information
        tags: Text based labels for generic use, limited to 1000
        volume: Relevant coordinates for the volume type, 9 floats in total, that defines the volume
        volume_references: Unique volume metric hashes used to access the 3D specialized data storage
        volume_type: Type of volume (Cylinder or Box)
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CognitePointCloudVolume", "v1")
    aliases: Optional[list[str]] = None
    description: Optional[str] = None
    format_version: Optional[str] = Field(None, alias="formatVersion")
    model_3d: Optional[CogniteCADModelGraphQL] = Field(default=None, repr=False, alias="model3D")
    name: Optional[str] = None
    object_3d: Optional[Cognite3DObjectGraphQL] = Field(default=None, repr=False, alias="object3D")
    revisions: Optional[list[CogniteCADRevisionGraphQL]] = Field(default=None, repr=False)
    tags: Optional[list[str]] = None
    volume: Optional[list[float]] = None
    volume_references: Optional[list[str]] = Field(None, alias="volumeReferences")
    volume_type: Optional[Literal["Box", "Cylinder"]] = Field(None, alias="volumeType")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("model_3d", "object_3d", "revisions", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> CognitePointCloudVolume:
        """Convert this GraphQL format of Cognite point cloud volume to the reading format."""
        return CognitePointCloudVolume.model_validate(as_read_args(self))

    def as_write(self) -> CognitePointCloudVolumeWrite:
        """Convert this GraphQL format of Cognite point cloud volume to the writing format."""
        return CognitePointCloudVolumeWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite point cloud volume to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_volume.py
def as_read(self) -> CognitePointCloudVolume:
    """Convert this GraphQL format of Cognite point cloud volume to the reading format."""
    return CognitePointCloudVolume.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite point cloud volume to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_volume.py
def as_write(self) -> CognitePointCloudVolumeWrite:
    """Convert this GraphQL format of Cognite point cloud volume to the writing format."""
    return CognitePointCloudVolumeWrite.model_validate(as_write_args(self))

CognitePointCloudVolumeList

Bases: DomainModelList[CognitePointCloudVolume]

List of Cognite point cloud volumes in the read version.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_volume.py
class CognitePointCloudVolumeList(DomainModelList[CognitePointCloudVolume]):
    """List of Cognite point cloud volumes in the read version."""

    _INSTANCE = CognitePointCloudVolume

    def as_write(self) -> CognitePointCloudVolumeWriteList:
        """Convert these read versions of Cognite point cloud volume to the writing versions."""
        return CognitePointCloudVolumeWriteList([node.as_write() for node in self.data])

    @property
    def model_3d(self) -> CogniteCADModelList:
        from ._cognite_cad_model import CogniteCADModel, CogniteCADModelList

        return CogniteCADModelList([item.model_3d for item in self.data if isinstance(item.model_3d, CogniteCADModel)])

    @property
    def object_3d(self) -> Cognite3DObjectList:
        from ._cognite_3_d_object import Cognite3DObject, Cognite3DObjectList

        return Cognite3DObjectList(
            [item.object_3d for item in self.data if isinstance(item.object_3d, Cognite3DObject)]
        )

    @property
    def revisions(self) -> CogniteCADRevisionList:
        from ._cognite_cad_revision import CogniteCADRevision, CogniteCADRevisionList

        return CogniteCADRevisionList(
            [item for items in self.data for item in items.revisions or [] if isinstance(item, CogniteCADRevision)]
        )

as_write()

Convert these read versions of Cognite point cloud volume to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_volume.py
def as_write(self) -> CognitePointCloudVolumeWriteList:
    """Convert these read versions of Cognite point cloud volume to the writing versions."""
    return CognitePointCloudVolumeWriteList([node.as_write() for node in self.data])

CognitePointCloudVolumeWrite

Bases: CogniteDescribableNodeWrite

This represents the writing version of Cognite point cloud volume.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite point cloud volume.

required
data_record

The data record of the Cognite point cloud volume node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
format_version

Specifies the version the 'volume' field is following. Volume definition is today 9 floats (property volume)

required
model_3d

Direct relation to Cognite3DModel instance

required
name

Name of the instance

required
object_3d

Direct relation to object3D grouping for this node

required
revisions

List of direct relations to revision information

required
tags

Text based labels for generic use, limited to 1000

required
volume

Relevant coordinates for the volume type, 9 floats in total, that defines the volume

required
volume_references

Unique volume metric hashes used to access the 3D specialized data storage

required
volume_type

Type of volume (Cylinder or Box)

required
Source code in examples/cognite_core/data_classes/_cognite_point_cloud_volume.py
class CognitePointCloudVolumeWrite(CogniteDescribableNodeWrite, protected_namespaces=()):
    """This represents the writing version of Cognite point cloud volume.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite point cloud volume.
        data_record: The data record of the Cognite point cloud volume node.
        aliases: Alternative names for the node
        description: Description of the instance
        format_version: Specifies the version the 'volume' field is following. Volume definition is today 9 floats
            (property volume)
        model_3d: Direct relation to Cognite3DModel instance
        name: Name of the instance
        object_3d: Direct relation to object3D grouping for this node
        revisions: List of direct relations to revision information
        tags: Text based labels for generic use, limited to 1000
        volume: Relevant coordinates for the volume type, 9 floats in total, that defines the volume
        volume_references: Unique volume metric hashes used to access the 3D specialized data storage
        volume_type: Type of volume (Cylinder or Box)
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "description",
        "format_version",
        "model_3d",
        "name",
        "object_3d",
        "revisions",
        "tags",
        "volume",
        "volume_references",
        "volume_type",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = (
        "model_3d",
        "object_3d",
        "revisions",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CognitePointCloudVolume", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    format_version: Optional[str] = Field(None, alias="formatVersion")
    model_3d: Union[CogniteCADModelWrite, str, dm.NodeId, None] = Field(default=None, repr=False, alias="model3D")
    object_3d: Union[Cognite3DObjectWrite, str, dm.NodeId, None] = Field(default=None, repr=False, alias="object3D")
    revisions: Optional[list[Union[CogniteCADRevisionWrite, str, dm.NodeId]]] = Field(default=None, repr=False)
    volume: Optional[list[float]] = None
    volume_references: Optional[list[str]] = Field(None, alias="volumeReferences")
    volume_type: Optional[Literal["Box", "Cylinder"]] = Field(None, alias="volumeType")

    @field_validator("model_3d", "object_3d", "revisions", mode="before")
    def as_node_id(cls, value: Any) -> Any:
        if isinstance(value, dm.DirectRelationReference):
            return dm.NodeId(value.space, value.external_id)
        elif isinstance(value, tuple) and len(value) == 2 and all(isinstance(item, str) for item in value):
            return dm.NodeId(value[0], value[1])
        elif isinstance(value, list):
            return [cls.as_node_id(item) for item in value]
        return value

CognitePointCloudVolumeWriteList

Bases: DomainModelWriteList[CognitePointCloudVolumeWrite]

List of Cognite point cloud volumes in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_point_cloud_volume.py
class CognitePointCloudVolumeWriteList(DomainModelWriteList[CognitePointCloudVolumeWrite]):
    """List of Cognite point cloud volumes in the writing version."""

    _INSTANCE = CognitePointCloudVolumeWrite

    @property
    def model_3d(self) -> CogniteCADModelWriteList:
        from ._cognite_cad_model import CogniteCADModelWrite, CogniteCADModelWriteList

        return CogniteCADModelWriteList(
            [item.model_3d for item in self.data if isinstance(item.model_3d, CogniteCADModelWrite)]
        )

    @property
    def object_3d(self) -> Cognite3DObjectWriteList:
        from ._cognite_3_d_object import Cognite3DObjectWrite, Cognite3DObjectWriteList

        return Cognite3DObjectWriteList(
            [item.object_3d for item in self.data if isinstance(item.object_3d, Cognite3DObjectWrite)]
        )

    @property
    def revisions(self) -> CogniteCADRevisionWriteList:
        from ._cognite_cad_revision import CogniteCADRevisionWrite, CogniteCADRevisionWriteList

        return CogniteCADRevisionWriteList(
            [item for items in self.data for item in items.revisions or [] if isinstance(item, CogniteCADRevisionWrite)]
        )

CogniteSchedulable

Bases: DomainModel

This represents the reading version of Cognite schedulable.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite schedulable.

required
data_record

The data record of the Cognite schedulable node.

required
end_time

The actual end time of an activity (or similar that extends this)

required
scheduled_end_time

The planned end time of an activity (or similar that extends this)

required
scheduled_start_time

The planned start time of an activity (or similar that extends this)

required
start_time

The actual start time of an activity (or similar that extends this)

required
Source code in examples/cognite_core/data_classes/_cognite_schedulable.py
class CogniteSchedulable(DomainModel):
    """This represents the reading version of Cognite schedulable.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite schedulable.
        data_record: The data record of the Cognite schedulable node.
        end_time: The actual end time of an activity (or similar that extends this)
        scheduled_end_time: The planned end time of an activity (or similar that extends this)
        scheduled_start_time: The planned start time of an activity (or similar that extends this)
        start_time: The actual start time of an activity (or similar that extends this)
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteSchedulable", "v1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = None
    end_time: Optional[datetime.datetime] = Field(None, alias="endTime")
    scheduled_end_time: Optional[datetime.datetime] = Field(None, alias="scheduledEndTime")
    scheduled_start_time: Optional[datetime.datetime] = Field(None, alias="scheduledStartTime")
    start_time: Optional[datetime.datetime] = Field(None, alias="startTime")

    def as_write(self) -> CogniteSchedulableWrite:
        """Convert this read version of Cognite schedulable to the writing version."""
        return CogniteSchedulableWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite schedulable to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_schedulable.py
def as_write(self) -> CogniteSchedulableWrite:
    """Convert this read version of Cognite schedulable to the writing version."""
    return CogniteSchedulableWrite.model_validate(as_write_args(self))

CogniteSchedulableGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite schedulable, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite schedulable.

required
data_record

The data record of the Cognite schedulable node.

required
end_time

The actual end time of an activity (or similar that extends this)

required
scheduled_end_time

The planned end time of an activity (or similar that extends this)

required
scheduled_start_time

The planned start time of an activity (or similar that extends this)

required
start_time

The actual start time of an activity (or similar that extends this)

required
Source code in examples/cognite_core/data_classes/_cognite_schedulable.py
class CogniteSchedulableGraphQL(GraphQLCore):
    """This represents the reading version of Cognite schedulable, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite schedulable.
        data_record: The data record of the Cognite schedulable node.
        end_time: The actual end time of an activity (or similar that extends this)
        scheduled_end_time: The planned end time of an activity (or similar that extends this)
        scheduled_start_time: The planned start time of an activity (or similar that extends this)
        start_time: The actual start time of an activity (or similar that extends this)
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteSchedulable", "v1")
    end_time: Optional[datetime.datetime] = Field(None, alias="endTime")
    scheduled_end_time: Optional[datetime.datetime] = Field(None, alias="scheduledEndTime")
    scheduled_start_time: Optional[datetime.datetime] = Field(None, alias="scheduledStartTime")
    start_time: Optional[datetime.datetime] = Field(None, alias="startTime")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    def as_read(self) -> CogniteSchedulable:
        """Convert this GraphQL format of Cognite schedulable to the reading format."""
        return CogniteSchedulable.model_validate(as_read_args(self))

    def as_write(self) -> CogniteSchedulableWrite:
        """Convert this GraphQL format of Cognite schedulable to the writing format."""
        return CogniteSchedulableWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite schedulable to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_schedulable.py
def as_read(self) -> CogniteSchedulable:
    """Convert this GraphQL format of Cognite schedulable to the reading format."""
    return CogniteSchedulable.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite schedulable to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_schedulable.py
def as_write(self) -> CogniteSchedulableWrite:
    """Convert this GraphQL format of Cognite schedulable to the writing format."""
    return CogniteSchedulableWrite.model_validate(as_write_args(self))

CogniteSchedulableList

Bases: DomainModelList[CogniteSchedulable]

List of Cognite schedulables in the read version.

Source code in examples/cognite_core/data_classes/_cognite_schedulable.py
class CogniteSchedulableList(DomainModelList[CogniteSchedulable]):
    """List of Cognite schedulables in the read version."""

    _INSTANCE = CogniteSchedulable

    def as_write(self) -> CogniteSchedulableWriteList:
        """Convert these read versions of Cognite schedulable to the writing versions."""
        return CogniteSchedulableWriteList([node.as_write() for node in self.data])

as_write()

Convert these read versions of Cognite schedulable to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_schedulable.py
def as_write(self) -> CogniteSchedulableWriteList:
    """Convert these read versions of Cognite schedulable to the writing versions."""
    return CogniteSchedulableWriteList([node.as_write() for node in self.data])

CogniteSchedulableWrite

Bases: DomainModelWrite

This represents the writing version of Cognite schedulable.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite schedulable.

required
data_record

The data record of the Cognite schedulable node.

required
end_time

The actual end time of an activity (or similar that extends this)

required
scheduled_end_time

The planned end time of an activity (or similar that extends this)

required
scheduled_start_time

The planned start time of an activity (or similar that extends this)

required
start_time

The actual start time of an activity (or similar that extends this)

required
Source code in examples/cognite_core/data_classes/_cognite_schedulable.py
class CogniteSchedulableWrite(DomainModelWrite):
    """This represents the writing version of Cognite schedulable.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite schedulable.
        data_record: The data record of the Cognite schedulable node.
        end_time: The actual end time of an activity (or similar that extends this)
        scheduled_end_time: The planned end time of an activity (or similar that extends this)
        scheduled_start_time: The planned start time of an activity (or similar that extends this)
        start_time: The actual start time of an activity (or similar that extends this)
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "end_time",
        "scheduled_end_time",
        "scheduled_start_time",
        "start_time",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteSchedulable", "v1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    end_time: Optional[datetime.datetime] = Field(None, alias="endTime")
    scheduled_end_time: Optional[datetime.datetime] = Field(None, alias="scheduledEndTime")
    scheduled_start_time: Optional[datetime.datetime] = Field(None, alias="scheduledStartTime")
    start_time: Optional[datetime.datetime] = Field(None, alias="startTime")

CogniteSchedulableWriteList

Bases: DomainModelWriteList[CogniteSchedulableWrite]

List of Cognite schedulables in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_schedulable.py
class CogniteSchedulableWriteList(DomainModelWriteList[CogniteSchedulableWrite]):
    """List of Cognite schedulables in the writing version."""

    _INSTANCE = CogniteSchedulableWrite

CogniteSourceSystem

Bases: CogniteDescribableNode

This represents the reading version of Cognite source system.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite source system.

required
data_record

The data record of the Cognite source system node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
manufacturer

Manufacturer of the source system

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
version_

Version identifier for the source system

required
Source code in examples/cognite_core/data_classes/_cognite_source_system.py
class CogniteSourceSystem(CogniteDescribableNode):
    """This represents the reading version of Cognite source system.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite source system.
        data_record: The data record of the Cognite source system node.
        aliases: Alternative names for the node
        description: Description of the instance
        manufacturer: Manufacturer of the source system
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
        version_: Version identifier for the source system
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteSourceSystem", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    manufacturer: Optional[str] = None
    version_: Optional[str] = Field(None, alias="version")

    def as_write(self) -> CogniteSourceSystemWrite:
        """Convert this read version of Cognite source system to the writing version."""
        return CogniteSourceSystemWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite source system to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_source_system.py
def as_write(self) -> CogniteSourceSystemWrite:
    """Convert this read version of Cognite source system to the writing version."""
    return CogniteSourceSystemWrite.model_validate(as_write_args(self))

CogniteSourceSystemGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite source system, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite source system.

required
data_record

The data record of the Cognite source system node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
manufacturer

Manufacturer of the source system

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
version_

Version identifier for the source system

required
Source code in examples/cognite_core/data_classes/_cognite_source_system.py
class CogniteSourceSystemGraphQL(GraphQLCore):
    """This represents the reading version of Cognite source system, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite source system.
        data_record: The data record of the Cognite source system node.
        aliases: Alternative names for the node
        description: Description of the instance
        manufacturer: Manufacturer of the source system
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
        version_: Version identifier for the source system
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteSourceSystem", "v1")
    aliases: Optional[list[str]] = None
    description: Optional[str] = None
    manufacturer: Optional[str] = None
    name: Optional[str] = None
    tags: Optional[list[str]] = None
    version_: Optional[str] = Field(None, alias="version")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    def as_read(self) -> CogniteSourceSystem:
        """Convert this GraphQL format of Cognite source system to the reading format."""
        return CogniteSourceSystem.model_validate(as_read_args(self))

    def as_write(self) -> CogniteSourceSystemWrite:
        """Convert this GraphQL format of Cognite source system to the writing format."""
        return CogniteSourceSystemWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite source system to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_source_system.py
def as_read(self) -> CogniteSourceSystem:
    """Convert this GraphQL format of Cognite source system to the reading format."""
    return CogniteSourceSystem.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite source system to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_source_system.py
def as_write(self) -> CogniteSourceSystemWrite:
    """Convert this GraphQL format of Cognite source system to the writing format."""
    return CogniteSourceSystemWrite.model_validate(as_write_args(self))

CogniteSourceSystemList

Bases: DomainModelList[CogniteSourceSystem]

List of Cognite source systems in the read version.

Source code in examples/cognite_core/data_classes/_cognite_source_system.py
class CogniteSourceSystemList(DomainModelList[CogniteSourceSystem]):
    """List of Cognite source systems in the read version."""

    _INSTANCE = CogniteSourceSystem

    def as_write(self) -> CogniteSourceSystemWriteList:
        """Convert these read versions of Cognite source system to the writing versions."""
        return CogniteSourceSystemWriteList([node.as_write() for node in self.data])

as_write()

Convert these read versions of Cognite source system to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_source_system.py
def as_write(self) -> CogniteSourceSystemWriteList:
    """Convert these read versions of Cognite source system to the writing versions."""
    return CogniteSourceSystemWriteList([node.as_write() for node in self.data])

CogniteSourceSystemWrite

Bases: CogniteDescribableNodeWrite

This represents the writing version of Cognite source system.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite source system.

required
data_record

The data record of the Cognite source system node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
manufacturer

Manufacturer of the source system

required
name

Name of the instance

required
tags

Text based labels for generic use, limited to 1000

required
version_

Version identifier for the source system

required
Source code in examples/cognite_core/data_classes/_cognite_source_system.py
class CogniteSourceSystemWrite(CogniteDescribableNodeWrite):
    """This represents the writing version of Cognite source system.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite source system.
        data_record: The data record of the Cognite source system node.
        aliases: Alternative names for the node
        description: Description of the instance
        manufacturer: Manufacturer of the source system
        name: Name of the instance
        tags: Text based labels for generic use, limited to 1000
        version_: Version identifier for the source system
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "description",
        "manufacturer",
        "name",
        "tags",
        "version_",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteSourceSystem", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    manufacturer: Optional[str] = None
    version_: Optional[str] = Field(None, alias="version")

CogniteSourceSystemWriteList

Bases: DomainModelWriteList[CogniteSourceSystemWrite]

List of Cognite source systems in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_source_system.py
class CogniteSourceSystemWriteList(DomainModelWriteList[CogniteSourceSystemWrite]):
    """List of Cognite source systems in the writing version."""

    _INSTANCE = CogniteSourceSystemWrite

CogniteSourceableEdge

Bases: DomainRelation

This represents the reading version of Cognite sourceable edge.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite sourceable edge.

required
data_record

The data record of the Cognite sourceable edge edge.

required
end_node

The end node of this edge.

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
Source code in examples/cognite_core/data_classes/_cognite_sourceable_edge.py
class CogniteSourceableEdge(DomainRelation):
    """This represents the reading version of Cognite sourceable edge.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite sourceable edge.
        data_record: The data record of the Cognite sourceable edge edge.
        end_node: The end node of this edge.
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteSourceable", "v1")
    space: str = DEFAULT_INSTANCE_SPACE
    end_node: Union[str, dm.NodeId] = Field(alias="endNode")
    source: Union[CogniteSourceSystem, str, dm.NodeId, None] = Field(default=None, repr=False)
    source_context: Optional[str] = Field(None, alias="sourceContext")
    source_created_time: Optional[datetime.datetime] = Field(None, alias="sourceCreatedTime")
    source_created_user: Optional[str] = Field(None, alias="sourceCreatedUser")
    source_id: Optional[str] = Field(None, alias="sourceId")
    source_updated_time: Optional[datetime.datetime] = Field(None, alias="sourceUpdatedTime")
    source_updated_user: Optional[str] = Field(None, alias="sourceUpdatedUser")

    def as_write(self) -> CogniteSourceableEdgeWrite:
        """Convert this read version of Cognite sourceable edge to the writing version."""
        return CogniteSourceableEdgeWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite sourceable edge to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_sourceable_edge.py
def as_write(self) -> CogniteSourceableEdgeWrite:
    """Convert this read version of Cognite sourceable edge to the writing version."""
    return CogniteSourceableEdgeWrite.model_validate(as_write_args(self))

CogniteSourceableEdgeGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite sourceable edge, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite sourceable edge.

required
data_record

The data record of the Cognite sourceable edge node.

required
end_node

The end node of this edge.

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
Source code in examples/cognite_core/data_classes/_cognite_sourceable_edge.py
class CogniteSourceableEdgeGraphQL(GraphQLCore):
    """This represents the reading version of Cognite sourceable edge, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite sourceable edge.
        data_record: The data record of the Cognite sourceable edge node.
        end_node: The end node of this edge.
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteSourceable", "v1")
    end_node: Union[dm.NodeId, None] = Field(None, alias="endNode")
    source: Optional[CogniteSourceSystemGraphQL] = Field(default=None, repr=False)
    source_context: Optional[str] = Field(None, alias="sourceContext")
    source_created_time: Optional[datetime.datetime] = Field(None, alias="sourceCreatedTime")
    source_created_user: Optional[str] = Field(None, alias="sourceCreatedUser")
    source_id: Optional[str] = Field(None, alias="sourceId")
    source_updated_time: Optional[datetime.datetime] = Field(None, alias="sourceUpdatedTime")
    source_updated_user: Optional[str] = Field(None, alias="sourceUpdatedUser")

    def as_read(self) -> CogniteSourceableEdge:
        """Convert this GraphQL format of Cognite sourceable edge to the reading format."""
        return CogniteSourceableEdge.model_validate(as_read_args(self))

    def as_write(self) -> CogniteSourceableEdgeWrite:
        """Convert this GraphQL format of Cognite sourceable edge to the writing format."""
        return CogniteSourceableEdgeWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite sourceable edge to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_sourceable_edge.py
def as_read(self) -> CogniteSourceableEdge:
    """Convert this GraphQL format of Cognite sourceable edge to the reading format."""
    return CogniteSourceableEdge.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite sourceable edge to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_sourceable_edge.py
def as_write(self) -> CogniteSourceableEdgeWrite:
    """Convert this GraphQL format of Cognite sourceable edge to the writing format."""
    return CogniteSourceableEdgeWrite.model_validate(as_write_args(self))

CogniteSourceableEdgeList

Bases: DomainRelationList[CogniteSourceableEdge]

List of Cognite sourceable edges in the reading version.

Source code in examples/cognite_core/data_classes/_cognite_sourceable_edge.py
class CogniteSourceableEdgeList(DomainRelationList[CogniteSourceableEdge]):
    """List of Cognite sourceable edges in the reading version."""

    _INSTANCE = CogniteSourceableEdge

    def as_write(self) -> CogniteSourceableEdgeWriteList:
        """Convert this read version of Cognite sourceable edge list to the writing version."""
        return CogniteSourceableEdgeWriteList([edge.as_write() for edge in self])

as_write()

Convert this read version of Cognite sourceable edge list to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_sourceable_edge.py
def as_write(self) -> CogniteSourceableEdgeWriteList:
    """Convert this read version of Cognite sourceable edge list to the writing version."""
    return CogniteSourceableEdgeWriteList([edge.as_write() for edge in self])

CogniteSourceableEdgeWrite

Bases: DomainRelationWrite

This represents the writing version of Cognite sourceable edge.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite sourceable edge.

required
data_record

The data record of the Cognite sourceable edge edge.

required
end_node

The end node of this edge.

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
Source code in examples/cognite_core/data_classes/_cognite_sourceable_edge.py
class CogniteSourceableEdgeWrite(DomainRelationWrite):
    """This represents the writing version of Cognite sourceable edge.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite sourceable edge.
        data_record: The data record of the Cognite sourceable edge edge.
        end_node: The end node of this edge.
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "source",
        "source_context",
        "source_created_time",
        "source_created_user",
        "source_id",
        "source_updated_time",
        "source_updated_user",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = ("source",)
    _validate_end_node = _validate_end_node

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteSourceable", "v1")
    end_node: Union[str, dm.NodeId] = Field(alias="endNode")
    source: Union[CogniteSourceSystemWrite, str, dm.NodeId, None] = Field(default=None, repr=False)
    source_context: Optional[str] = Field(None, alias="sourceContext")
    source_created_time: Optional[datetime.datetime] = Field(None, alias="sourceCreatedTime")
    source_created_user: Optional[str] = Field(None, alias="sourceCreatedUser")
    source_id: Optional[str] = Field(None, alias="sourceId")
    source_updated_time: Optional[datetime.datetime] = Field(None, alias="sourceUpdatedTime")
    source_updated_user: Optional[str] = Field(None, alias="sourceUpdatedUser")

CogniteSourceableEdgeWriteList

Bases: DomainRelationWriteList[CogniteSourceableEdgeWrite]

List of Cognite sourceable edges in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_sourceable_edge.py
class CogniteSourceableEdgeWriteList(DomainRelationWriteList[CogniteSourceableEdgeWrite]):
    """List of Cognite sourceable edges in the writing version."""

    _INSTANCE = CogniteSourceableEdgeWrite

CogniteSourceableNode

Bases: DomainModel

This represents the reading version of Cognite sourceable node.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite sourceable node.

required
data_record

The data record of the Cognite sourceable node node.

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
Source code in examples/cognite_core/data_classes/_cognite_sourceable_node.py
class CogniteSourceableNode(DomainModel):
    """This represents the reading version of Cognite sourceable node.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite sourceable node.
        data_record: The data record of the Cognite sourceable node node.
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteSourceable", "v1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = None
    source: Union[CogniteSourceSystem, str, dm.NodeId, None] = Field(default=None, repr=False)
    source_context: Optional[str] = Field(None, alias="sourceContext")
    source_created_time: Optional[datetime.datetime] = Field(None, alias="sourceCreatedTime")
    source_created_user: Optional[str] = Field(None, alias="sourceCreatedUser")
    source_id: Optional[str] = Field(None, alias="sourceId")
    source_updated_time: Optional[datetime.datetime] = Field(None, alias="sourceUpdatedTime")
    source_updated_user: Optional[str] = Field(None, alias="sourceUpdatedUser")

    @field_validator("source", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    def as_write(self) -> CogniteSourceableNodeWrite:
        """Convert this read version of Cognite sourceable node to the writing version."""
        return CogniteSourceableNodeWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite sourceable node to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_sourceable_node.py
def as_write(self) -> CogniteSourceableNodeWrite:
    """Convert this read version of Cognite sourceable node to the writing version."""
    return CogniteSourceableNodeWrite.model_validate(as_write_args(self))

CogniteSourceableNodeGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite sourceable node, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite sourceable node.

required
data_record

The data record of the Cognite sourceable node node.

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
Source code in examples/cognite_core/data_classes/_cognite_sourceable_node.py
class CogniteSourceableNodeGraphQL(GraphQLCore):
    """This represents the reading version of Cognite sourceable node, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite sourceable node.
        data_record: The data record of the Cognite sourceable node node.
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteSourceable", "v1")
    source: Optional[CogniteSourceSystemGraphQL] = Field(default=None, repr=False)
    source_context: Optional[str] = Field(None, alias="sourceContext")
    source_created_time: Optional[datetime.datetime] = Field(None, alias="sourceCreatedTime")
    source_created_user: Optional[str] = Field(None, alias="sourceCreatedUser")
    source_id: Optional[str] = Field(None, alias="sourceId")
    source_updated_time: Optional[datetime.datetime] = Field(None, alias="sourceUpdatedTime")
    source_updated_user: Optional[str] = Field(None, alias="sourceUpdatedUser")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("source", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> CogniteSourceableNode:
        """Convert this GraphQL format of Cognite sourceable node to the reading format."""
        return CogniteSourceableNode.model_validate(as_read_args(self))

    def as_write(self) -> CogniteSourceableNodeWrite:
        """Convert this GraphQL format of Cognite sourceable node to the writing format."""
        return CogniteSourceableNodeWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite sourceable node to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_sourceable_node.py
def as_read(self) -> CogniteSourceableNode:
    """Convert this GraphQL format of Cognite sourceable node to the reading format."""
    return CogniteSourceableNode.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite sourceable node to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_sourceable_node.py
def as_write(self) -> CogniteSourceableNodeWrite:
    """Convert this GraphQL format of Cognite sourceable node to the writing format."""
    return CogniteSourceableNodeWrite.model_validate(as_write_args(self))

CogniteSourceableNodeList

Bases: DomainModelList[CogniteSourceableNode]

List of Cognite sourceable nodes in the read version.

Source code in examples/cognite_core/data_classes/_cognite_sourceable_node.py
class CogniteSourceableNodeList(DomainModelList[CogniteSourceableNode]):
    """List of Cognite sourceable nodes in the read version."""

    _INSTANCE = CogniteSourceableNode

    def as_write(self) -> CogniteSourceableNodeWriteList:
        """Convert these read versions of Cognite sourceable node to the writing versions."""
        return CogniteSourceableNodeWriteList([node.as_write() for node in self.data])

    @property
    def source(self) -> CogniteSourceSystemList:
        from ._cognite_source_system import CogniteSourceSystem, CogniteSourceSystemList

        return CogniteSourceSystemList(
            [item.source for item in self.data if isinstance(item.source, CogniteSourceSystem)]
        )

as_write()

Convert these read versions of Cognite sourceable node to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_sourceable_node.py
def as_write(self) -> CogniteSourceableNodeWriteList:
    """Convert these read versions of Cognite sourceable node to the writing versions."""
    return CogniteSourceableNodeWriteList([node.as_write() for node in self.data])

CogniteSourceableNodeWrite

Bases: DomainModelWrite

This represents the writing version of Cognite sourceable node.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite sourceable node.

required
data_record

The data record of the Cognite sourceable node node.

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
Source code in examples/cognite_core/data_classes/_cognite_sourceable_node.py
class CogniteSourceableNodeWrite(DomainModelWrite):
    """This represents the writing version of Cognite sourceable node.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite sourceable node.
        data_record: The data record of the Cognite sourceable node node.
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "source",
        "source_context",
        "source_created_time",
        "source_created_user",
        "source_id",
        "source_updated_time",
        "source_updated_user",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = ("source",)

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteSourceable", "v1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    source: Union[CogniteSourceSystemWrite, str, dm.NodeId, None] = Field(default=None, repr=False)
    source_context: Optional[str] = Field(None, alias="sourceContext")
    source_created_time: Optional[datetime.datetime] = Field(None, alias="sourceCreatedTime")
    source_created_user: Optional[str] = Field(None, alias="sourceCreatedUser")
    source_id: Optional[str] = Field(None, alias="sourceId")
    source_updated_time: Optional[datetime.datetime] = Field(None, alias="sourceUpdatedTime")
    source_updated_user: Optional[str] = Field(None, alias="sourceUpdatedUser")

    @field_validator("source", mode="before")
    def as_node_id(cls, value: Any) -> Any:
        if isinstance(value, dm.DirectRelationReference):
            return dm.NodeId(value.space, value.external_id)
        elif isinstance(value, tuple) and len(value) == 2 and all(isinstance(item, str) for item in value):
            return dm.NodeId(value[0], value[1])
        elif isinstance(value, list):
            return [cls.as_node_id(item) for item in value]
        return value

CogniteSourceableNodeWriteList

Bases: DomainModelWriteList[CogniteSourceableNodeWrite]

List of Cognite sourceable nodes in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_sourceable_node.py
class CogniteSourceableNodeWriteList(DomainModelWriteList[CogniteSourceableNodeWrite]):
    """List of Cognite sourceable nodes in the writing version."""

    _INSTANCE = CogniteSourceableNodeWrite

    @property
    def source(self) -> CogniteSourceSystemWriteList:
        from ._cognite_source_system import CogniteSourceSystemWrite, CogniteSourceSystemWriteList

        return CogniteSourceSystemWriteList(
            [item.source for item in self.data if isinstance(item.source, CogniteSourceSystemWrite)]
        )

CogniteTimeSeries

Bases: CogniteDescribableNode, CogniteSourceableNode

This represents the reading version of Cognite time series.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite time series.

required
data_record

The data record of the Cognite time series node.

required
activities

An automatically updated list of activities the time series is related to.

required
aliases

Alternative names for the node

required
assets

A list of assets the time series is related to.

required
description

Description of the instance

required
equipment

A list of equipment the time series is related to.

required
is_step

Specifies whether the time series is a step time series or not.

required
name

Name of the instance

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_unit

The unit specified in the source system.

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
tags

Text based labels for generic use, limited to 1000

required
type_

Specifies the data type of the data points.

required
unit

The unit of the time series.

required
Source code in examples/cognite_core/data_classes/_cognite_time_series.py
class CogniteTimeSeries(CogniteDescribableNode, CogniteSourceableNode):
    """This represents the reading version of Cognite time series.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite time series.
        data_record: The data record of the Cognite time series node.
        activities: An automatically updated list of activities the time series is related to.
        aliases: Alternative names for the node
        assets: A list of assets the time series is related to.
        description: Description of the instance
        equipment: A list of equipment the time series is related to.
        is_step: Specifies whether the time series is a step time series or not.
        name: Name of the instance
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_unit: The unit specified in the source system.
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        tags: Text based labels for generic use, limited to 1000
        type_: Specifies the data type of the data points.
        unit: The unit of the time series.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteTimeSeries", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    activities: Optional[list[CogniteActivity]] = Field(default=None, repr=False)
    assets: Optional[list[Union[CogniteAsset, str, dm.NodeId]]] = Field(default=None, repr=False)
    equipment: Optional[list[Union[CogniteEquipment, str, dm.NodeId]]] = Field(default=None, repr=False)
    is_step: bool = Field(alias="isStep")
    source_unit: Optional[str] = Field(None, alias="sourceUnit")
    type_: Literal["numeric", "string"] | str = Field(alias="type")
    unit: Union[CogniteUnit, str, dm.NodeId, None] = Field(default=None, repr=False)

    @field_validator("source", "unit", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    @field_validator("activities", "assets", "equipment", mode="before")
    @classmethod
    def parse_list(cls, value: Any, info: ValidationInfo) -> Any:
        if value is None:
            return None
        return [parse_single_connection(item, info.field_name) for item in value]

    def as_write(self) -> CogniteTimeSeriesWrite:
        """Convert this read version of Cognite time series to the writing version."""
        return CogniteTimeSeriesWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite time series to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_time_series.py
def as_write(self) -> CogniteTimeSeriesWrite:
    """Convert this read version of Cognite time series to the writing version."""
    return CogniteTimeSeriesWrite.model_validate(as_write_args(self))

CogniteTimeSeriesGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite time series, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite time series.

required
data_record

The data record of the Cognite time series node.

required
activities

An automatically updated list of activities the time series is related to.

required
aliases

Alternative names for the node

required
assets

A list of assets the time series is related to.

required
description

Description of the instance

required
equipment

A list of equipment the time series is related to.

required
is_step

Specifies whether the time series is a step time series or not.

required
name

Name of the instance

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_unit

The unit specified in the source system.

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
tags

Text based labels for generic use, limited to 1000

required
type_

Specifies the data type of the data points.

required
unit

The unit of the time series.

required
Source code in examples/cognite_core/data_classes/_cognite_time_series.py
class CogniteTimeSeriesGraphQL(GraphQLCore):
    """This represents the reading version of Cognite time series, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite time series.
        data_record: The data record of the Cognite time series node.
        activities: An automatically updated list of activities the time series is related to.
        aliases: Alternative names for the node
        assets: A list of assets the time series is related to.
        description: Description of the instance
        equipment: A list of equipment the time series is related to.
        is_step: Specifies whether the time series is a step time series or not.
        name: Name of the instance
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_unit: The unit specified in the source system.
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        tags: Text based labels for generic use, limited to 1000
        type_: Specifies the data type of the data points.
        unit: The unit of the time series.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteTimeSeries", "v1")
    activities: Optional[list[CogniteActivityGraphQL]] = Field(default=None, repr=False)
    aliases: Optional[list[str]] = None
    assets: Optional[list[CogniteAssetGraphQL]] = Field(default=None, repr=False)
    description: Optional[str] = None
    equipment: Optional[list[CogniteEquipmentGraphQL]] = Field(default=None, repr=False)
    is_step: Optional[bool] = Field(None, alias="isStep")
    name: Optional[str] = None
    source: Optional[CogniteSourceSystemGraphQL] = Field(default=None, repr=False)
    source_context: Optional[str] = Field(None, alias="sourceContext")
    source_created_time: Optional[datetime.datetime] = Field(None, alias="sourceCreatedTime")
    source_created_user: Optional[str] = Field(None, alias="sourceCreatedUser")
    source_id: Optional[str] = Field(None, alias="sourceId")
    source_unit: Optional[str] = Field(None, alias="sourceUnit")
    source_updated_time: Optional[datetime.datetime] = Field(None, alias="sourceUpdatedTime")
    source_updated_user: Optional[str] = Field(None, alias="sourceUpdatedUser")
    tags: Optional[list[str]] = None
    type_: Optional[Literal["numeric", "string"]] = Field(None, alias="type")
    unit: Optional[CogniteUnitGraphQL] = Field(default=None, repr=False)

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("activities", "assets", "equipment", "source", "unit", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> CogniteTimeSeries:
        """Convert this GraphQL format of Cognite time series to the reading format."""
        return CogniteTimeSeries.model_validate(as_read_args(self))

    def as_write(self) -> CogniteTimeSeriesWrite:
        """Convert this GraphQL format of Cognite time series to the writing format."""
        return CogniteTimeSeriesWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite time series to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_time_series.py
def as_read(self) -> CogniteTimeSeries:
    """Convert this GraphQL format of Cognite time series to the reading format."""
    return CogniteTimeSeries.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite time series to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_time_series.py
def as_write(self) -> CogniteTimeSeriesWrite:
    """Convert this GraphQL format of Cognite time series to the writing format."""
    return CogniteTimeSeriesWrite.model_validate(as_write_args(self))

CogniteTimeSeriesList

Bases: DomainModelList[CogniteTimeSeries]

List of Cognite time series in the read version.

Source code in examples/cognite_core/data_classes/_cognite_time_series.py
class CogniteTimeSeriesList(DomainModelList[CogniteTimeSeries]):
    """List of Cognite time series in the read version."""

    _INSTANCE = CogniteTimeSeries

    def as_write(self) -> CogniteTimeSeriesWriteList:
        """Convert these read versions of Cognite time series to the writing versions."""
        return CogniteTimeSeriesWriteList([node.as_write() for node in self.data])

    @property
    def activities(self) -> CogniteActivityList:
        from ._cognite_activity import CogniteActivity, CogniteActivityList

        return CogniteActivityList(
            [item for items in self.data for item in items.activities or [] if isinstance(item, CogniteActivity)]
        )

    @property
    def assets(self) -> CogniteAssetList:
        from ._cognite_asset import CogniteAsset, CogniteAssetList

        return CogniteAssetList(
            [item for items in self.data for item in items.assets or [] if isinstance(item, CogniteAsset)]
        )

    @property
    def equipment(self) -> CogniteEquipmentList:
        from ._cognite_equipment import CogniteEquipment, CogniteEquipmentList

        return CogniteEquipmentList(
            [item for items in self.data for item in items.equipment or [] if isinstance(item, CogniteEquipment)]
        )

    @property
    def source(self) -> CogniteSourceSystemList:
        from ._cognite_source_system import CogniteSourceSystem, CogniteSourceSystemList

        return CogniteSourceSystemList(
            [item.source for item in self.data if isinstance(item.source, CogniteSourceSystem)]
        )

    @property
    def unit(self) -> CogniteUnitList:
        from ._cognite_unit import CogniteUnit, CogniteUnitList

        return CogniteUnitList([item.unit for item in self.data if isinstance(item.unit, CogniteUnit)])

as_write()

Convert these read versions of Cognite time series to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_time_series.py
def as_write(self) -> CogniteTimeSeriesWriteList:
    """Convert these read versions of Cognite time series to the writing versions."""
    return CogniteTimeSeriesWriteList([node.as_write() for node in self.data])

CogniteTimeSeriesWrite

Bases: CogniteDescribableNodeWrite, CogniteSourceableNodeWrite

This represents the writing version of Cognite time series.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite time series.

required
data_record

The data record of the Cognite time series node.

required
aliases

Alternative names for the node

required
assets

A list of assets the time series is related to.

required
description

Description of the instance

required
equipment

A list of equipment the time series is related to.

required
is_step

Specifies whether the time series is a step time series or not.

required
name

Name of the instance

required
source

Direct relation to a source system

required
source_context

Context of the source id. For systems where the sourceId is globally unique, the sourceContext is expected to not be set.

required
source_created_time

When the instance was created in source system (if available)

required
source_created_user

User identifier from the source system on who created the source data. This identifier is not guaranteed to match the user identifiers in CDF

required
source_id

Identifier from the source system

required
source_unit

The unit specified in the source system.

required
source_updated_time

When the instance was last updated in the source system (if available)

required
source_updated_user

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

required
tags

Text based labels for generic use, limited to 1000

required
type_

Specifies the data type of the data points.

required
unit

The unit of the time series.

required
Source code in examples/cognite_core/data_classes/_cognite_time_series.py
class CogniteTimeSeriesWrite(CogniteDescribableNodeWrite, CogniteSourceableNodeWrite):
    """This represents the writing version of Cognite time series.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite time series.
        data_record: The data record of the Cognite time series node.
        aliases: Alternative names for the node
        assets: A list of assets the time series is related to.
        description: Description of the instance
        equipment: A list of equipment the time series is related to.
        is_step: Specifies whether the time series is a step time series or not.
        name: Name of the instance
        source: Direct relation to a source system
        source_context: Context of the source id. For systems where the sourceId is globally unique, the sourceContext
            is expected to not be set.
        source_created_time: When the instance was created in source system (if available)
        source_created_user: 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_id: Identifier from the source system
        source_unit: The unit specified in the source system.
        source_updated_time: When the instance was last updated in the source system (if available)
        source_updated_user: 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
        tags: Text based labels for generic use, limited to 1000
        type_: Specifies the data type of the data points.
        unit: The unit of the time series.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "assets",
        "description",
        "equipment",
        "is_step",
        "name",
        "source",
        "source_context",
        "source_created_time",
        "source_created_user",
        "source_id",
        "source_unit",
        "source_updated_time",
        "source_updated_user",
        "tags",
        "type_",
        "unit",
    )
    _direct_relations: ClassVar[tuple[str, ...]] = (
        "assets",
        "equipment",
        "source",
        "unit",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteTimeSeries", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    assets: Optional[list[Union[CogniteAssetWrite, str, dm.NodeId]]] = Field(default=None, repr=False)
    equipment: Optional[list[Union[CogniteEquipmentWrite, str, dm.NodeId]]] = Field(default=None, repr=False)
    is_step: bool = Field(alias="isStep")
    source_unit: Optional[str] = Field(None, alias="sourceUnit")
    type_: Literal["numeric", "string"] = Field(alias="type")
    unit: Union[CogniteUnitWrite, str, dm.NodeId, None] = Field(default=None, repr=False)

    @field_validator("assets", "equipment", "unit", mode="before")
    def as_node_id(cls, value: Any) -> Any:
        if isinstance(value, dm.DirectRelationReference):
            return dm.NodeId(value.space, value.external_id)
        elif isinstance(value, tuple) and len(value) == 2 and all(isinstance(item, str) for item in value):
            return dm.NodeId(value[0], value[1])
        elif isinstance(value, list):
            return [cls.as_node_id(item) for item in value]
        return value

CogniteTimeSeriesWriteList

Bases: DomainModelWriteList[CogniteTimeSeriesWrite]

List of Cognite time series in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_time_series.py
class CogniteTimeSeriesWriteList(DomainModelWriteList[CogniteTimeSeriesWrite]):
    """List of Cognite time series in the writing version."""

    _INSTANCE = CogniteTimeSeriesWrite

    @property
    def assets(self) -> CogniteAssetWriteList:
        from ._cognite_asset import CogniteAssetWrite, CogniteAssetWriteList

        return CogniteAssetWriteList(
            [item for items in self.data for item in items.assets or [] if isinstance(item, CogniteAssetWrite)]
        )

    @property
    def equipment(self) -> CogniteEquipmentWriteList:
        from ._cognite_equipment import CogniteEquipmentWrite, CogniteEquipmentWriteList

        return CogniteEquipmentWriteList(
            [item for items in self.data for item in items.equipment or [] if isinstance(item, CogniteEquipmentWrite)]
        )

    @property
    def source(self) -> CogniteSourceSystemWriteList:
        from ._cognite_source_system import CogniteSourceSystemWrite, CogniteSourceSystemWriteList

        return CogniteSourceSystemWriteList(
            [item.source for item in self.data if isinstance(item.source, CogniteSourceSystemWrite)]
        )

    @property
    def unit(self) -> CogniteUnitWriteList:
        from ._cognite_unit import CogniteUnitWrite, CogniteUnitWriteList

        return CogniteUnitWriteList([item.unit for item in self.data if isinstance(item.unit, CogniteUnitWrite)])

CogniteUnit

Bases: CogniteDescribableNode

This represents the reading version of Cognite unit.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite unit.

required
data_record

The data record of the Cognite unit node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
quantity

Specifies the physical quantity the unit measures

required
source

Source of the unit definition

required
source_reference

Reference to the source of the unit definition

required
symbol

The symbol for the unit of measurement

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_unit.py
class CogniteUnit(CogniteDescribableNode):
    """This represents the reading version of Cognite unit.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite unit.
        data_record: The data record of the Cognite unit node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        quantity: Specifies the physical quantity the unit measures
        source: Source of the unit definition
        source_reference: Reference to the source of the unit definition
        symbol: The symbol for the unit of measurement
        tags: Text based labels for generic use, limited to 1000
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteUnit", "v1")

    node_type: Union[dm.DirectRelationReference, None] = None
    quantity: Optional[str] = None
    source: Optional[str] = None
    source_reference: Optional[str] = Field(None, alias="sourceReference")
    symbol: Optional[str] = None

    def as_write(self) -> CogniteUnitWrite:
        """Convert this read version of Cognite unit to the writing version."""
        return CogniteUnitWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite unit to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_unit.py
def as_write(self) -> CogniteUnitWrite:
    """Convert this read version of Cognite unit to the writing version."""
    return CogniteUnitWrite.model_validate(as_write_args(self))

CogniteUnitGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite unit, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite unit.

required
data_record

The data record of the Cognite unit node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
quantity

Specifies the physical quantity the unit measures

required
source

Source of the unit definition

required
source_reference

Reference to the source of the unit definition

required
symbol

The symbol for the unit of measurement

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_unit.py
class CogniteUnitGraphQL(GraphQLCore):
    """This represents the reading version of Cognite unit, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite unit.
        data_record: The data record of the Cognite unit node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        quantity: Specifies the physical quantity the unit measures
        source: Source of the unit definition
        source_reference: Reference to the source of the unit definition
        symbol: The symbol for the unit of measurement
        tags: Text based labels for generic use, limited to 1000
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteUnit", "v1")
    aliases: Optional[list[str]] = None
    description: Optional[str] = None
    name: Optional[str] = None
    quantity: Optional[str] = None
    source: Optional[str] = None
    source_reference: Optional[str] = Field(None, alias="sourceReference")
    symbol: Optional[str] = None
    tags: Optional[list[str]] = None

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    def as_read(self) -> CogniteUnit:
        """Convert this GraphQL format of Cognite unit to the reading format."""
        return CogniteUnit.model_validate(as_read_args(self))

    def as_write(self) -> CogniteUnitWrite:
        """Convert this GraphQL format of Cognite unit to the writing format."""
        return CogniteUnitWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite unit to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_unit.py
def as_read(self) -> CogniteUnit:
    """Convert this GraphQL format of Cognite unit to the reading format."""
    return CogniteUnit.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite unit to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_unit.py
def as_write(self) -> CogniteUnitWrite:
    """Convert this GraphQL format of Cognite unit to the writing format."""
    return CogniteUnitWrite.model_validate(as_write_args(self))

CogniteUnitList

Bases: DomainModelList[CogniteUnit]

List of Cognite units in the read version.

Source code in examples/cognite_core/data_classes/_cognite_unit.py
class CogniteUnitList(DomainModelList[CogniteUnit]):
    """List of Cognite units in the read version."""

    _INSTANCE = CogniteUnit

    def as_write(self) -> CogniteUnitWriteList:
        """Convert these read versions of Cognite unit to the writing versions."""
        return CogniteUnitWriteList([node.as_write() for node in self.data])

as_write()

Convert these read versions of Cognite unit to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_unit.py
def as_write(self) -> CogniteUnitWriteList:
    """Convert these read versions of Cognite unit to the writing versions."""
    return CogniteUnitWriteList([node.as_write() for node in self.data])

CogniteUnitWrite

Bases: CogniteDescribableNodeWrite

This represents the writing version of Cognite unit.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite unit.

required
data_record

The data record of the Cognite unit node.

required
aliases

Alternative names for the node

required
description

Description of the instance

required
name

Name of the instance

required
quantity

Specifies the physical quantity the unit measures

required
source

Source of the unit definition

required
source_reference

Reference to the source of the unit definition

required
symbol

The symbol for the unit of measurement

required
tags

Text based labels for generic use, limited to 1000

required
Source code in examples/cognite_core/data_classes/_cognite_unit.py
class CogniteUnitWrite(CogniteDescribableNodeWrite):
    """This represents the writing version of Cognite unit.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite unit.
        data_record: The data record of the Cognite unit node.
        aliases: Alternative names for the node
        description: Description of the instance
        name: Name of the instance
        quantity: Specifies the physical quantity the unit measures
        source: Source of the unit definition
        source_reference: Reference to the source of the unit definition
        symbol: The symbol for the unit of measurement
        tags: Text based labels for generic use, limited to 1000
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "aliases",
        "description",
        "name",
        "quantity",
        "source",
        "source_reference",
        "symbol",
        "tags",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteUnit", "v1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    quantity: Optional[str] = None
    source: Optional[str] = None
    source_reference: Optional[str] = Field(None, alias="sourceReference")
    symbol: Optional[str] = None

CogniteUnitWriteList

Bases: DomainModelWriteList[CogniteUnitWrite]

List of Cognite units in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_unit.py
class CogniteUnitWriteList(DomainModelWriteList[CogniteUnitWrite]):
    """List of Cognite units in the writing version."""

    _INSTANCE = CogniteUnitWrite

CogniteVisualizable

Bases: DomainModel

This represents the reading version of Cognite visualizable.

It is used to when data is retrieved from CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite visualizable.

required
data_record

The data record of the Cognite visualizable node.

required
object_3d

Direct relation to an Object3D instance representing the 3D resource

required
Source code in examples/cognite_core/data_classes/_cognite_visualizable.py
class CogniteVisualizable(DomainModel):
    """This represents the reading version of Cognite visualizable.

    It is used to when data is retrieved from CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite visualizable.
        data_record: The data record of the Cognite visualizable node.
        object_3d: Direct relation to an Object3D instance representing the 3D resource
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteVisualizable", "v1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = None
    object_3d: Union[Cognite3DObject, str, dm.NodeId, None] = Field(default=None, repr=False, alias="object3D")

    @field_validator("object_3d", mode="before")
    @classmethod
    def parse_single(cls, value: Any, info: ValidationInfo) -> Any:
        return parse_single_connection(value, info.field_name)

    def as_write(self) -> CogniteVisualizableWrite:
        """Convert this read version of Cognite visualizable to the writing version."""
        return CogniteVisualizableWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of Cognite visualizable to the writing version.

Source code in examples/cognite_core/data_classes/_cognite_visualizable.py
def as_write(self) -> CogniteVisualizableWrite:
    """Convert this read version of Cognite visualizable to the writing version."""
    return CogniteVisualizableWrite.model_validate(as_write_args(self))

CogniteVisualizableGraphQL

Bases: GraphQLCore

This represents the reading version of Cognite visualizable, used when data is retrieved from CDF using GraphQL.

It is used when retrieving data from CDF using GraphQL.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite visualizable.

required
data_record

The data record of the Cognite visualizable node.

required
object_3d

Direct relation to an Object3D instance representing the 3D resource

required
Source code in examples/cognite_core/data_classes/_cognite_visualizable.py
class CogniteVisualizableGraphQL(GraphQLCore):
    """This represents the reading version of Cognite visualizable, used
    when data is retrieved from CDF using GraphQL.

    It is used when retrieving data from CDF using GraphQL.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite visualizable.
        data_record: The data record of the Cognite visualizable node.
        object_3d: Direct relation to an Object3D instance representing the 3D resource
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteVisualizable", "v1")
    object_3d: Optional[Cognite3DObjectGraphQL] = Field(default=None, repr=False, alias="object3D")

    @model_validator(mode="before")
    def parse_data_record(cls, values: Any) -> Any:
        if not isinstance(values, dict):
            return values
        if "lastUpdatedTime" in values or "createdTime" in values:
            values["dataRecord"] = DataRecordGraphQL(
                created_time=values.pop("createdTime", None),
                last_updated_time=values.pop("lastUpdatedTime", None),
            )
        return values

    @field_validator("object_3d", mode="before")
    def parse_graphql(cls, value: Any) -> Any:
        if not isinstance(value, dict):
            return value
        if "items" in value:
            return value["items"]
        return value

    def as_read(self) -> CogniteVisualizable:
        """Convert this GraphQL format of Cognite visualizable to the reading format."""
        return CogniteVisualizable.model_validate(as_read_args(self))

    def as_write(self) -> CogniteVisualizableWrite:
        """Convert this GraphQL format of Cognite visualizable to the writing format."""
        return CogniteVisualizableWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of Cognite visualizable to the reading format.

Source code in examples/cognite_core/data_classes/_cognite_visualizable.py
def as_read(self) -> CogniteVisualizable:
    """Convert this GraphQL format of Cognite visualizable to the reading format."""
    return CogniteVisualizable.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of Cognite visualizable to the writing format.

Source code in examples/cognite_core/data_classes/_cognite_visualizable.py
def as_write(self) -> CogniteVisualizableWrite:
    """Convert this GraphQL format of Cognite visualizable to the writing format."""
    return CogniteVisualizableWrite.model_validate(as_write_args(self))

CogniteVisualizableList

Bases: DomainModelList[CogniteVisualizable]

List of Cognite visualizables in the read version.

Source code in examples/cognite_core/data_classes/_cognite_visualizable.py
class CogniteVisualizableList(DomainModelList[CogniteVisualizable]):
    """List of Cognite visualizables in the read version."""

    _INSTANCE = CogniteVisualizable

    def as_write(self) -> CogniteVisualizableWriteList:
        """Convert these read versions of Cognite visualizable to the writing versions."""
        return CogniteVisualizableWriteList([node.as_write() for node in self.data])

    @property
    def object_3d(self) -> Cognite3DObjectList:
        from ._cognite_3_d_object import Cognite3DObject, Cognite3DObjectList

        return Cognite3DObjectList(
            [item.object_3d for item in self.data if isinstance(item.object_3d, Cognite3DObject)]
        )

as_write()

Convert these read versions of Cognite visualizable to the writing versions.

Source code in examples/cognite_core/data_classes/_cognite_visualizable.py
def as_write(self) -> CogniteVisualizableWriteList:
    """Convert these read versions of Cognite visualizable to the writing versions."""
    return CogniteVisualizableWriteList([node.as_write() for node in self.data])

CogniteVisualizableWrite

Bases: DomainModelWrite

This represents the writing version of Cognite visualizable.

It is used to when data is sent to CDF.

Parameters:

Name Type Description Default
space

The space where the node is located.

required
external_id

The external id of the Cognite visualizable.

required
data_record

The data record of the Cognite visualizable node.

required
object_3d

Direct relation to an Object3D instance representing the 3D resource

required
Source code in examples/cognite_core/data_classes/_cognite_visualizable.py
class CogniteVisualizableWrite(DomainModelWrite):
    """This represents the writing version of Cognite visualizable.

    It is used to when data is sent to CDF.

    Args:
        space: The space where the node is located.
        external_id: The external id of the Cognite visualizable.
        data_record: The data record of the Cognite visualizable node.
        object_3d: Direct relation to an Object3D instance representing the 3D resource
    """

    _container_fields: ClassVar[tuple[str, ...]] = ("object_3d",)
    _direct_relations: ClassVar[tuple[str, ...]] = ("object_3d",)

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("cdf_cdm", "CogniteVisualizable", "v1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    object_3d: Union[Cognite3DObjectWrite, str, dm.NodeId, None] = Field(default=None, repr=False, alias="object3D")

    @field_validator("object_3d", mode="before")
    def as_node_id(cls, value: Any) -> Any:
        if isinstance(value, dm.DirectRelationReference):
            return dm.NodeId(value.space, value.external_id)
        elif isinstance(value, tuple) and len(value) == 2 and all(isinstance(item, str) for item in value):
            return dm.NodeId(value[0], value[1])
        elif isinstance(value, list):
            return [cls.as_node_id(item) for item in value]
        return value

CogniteVisualizableWriteList

Bases: DomainModelWriteList[CogniteVisualizableWrite]

List of Cognite visualizables in the writing version.

Source code in examples/cognite_core/data_classes/_cognite_visualizable.py
class CogniteVisualizableWriteList(DomainModelWriteList[CogniteVisualizableWrite]):
    """List of Cognite visualizables in the writing version."""

    _INSTANCE = CogniteVisualizableWrite

    @property
    def object_3d(self) -> Cognite3DObjectWriteList:
        from ._cognite_3_d_object import Cognite3DObjectWrite, Cognite3DObjectWriteList

        return Cognite3DObjectWriteList(
            [item.object_3d for item in self.data if isinstance(item.object_3d, Cognite3DObjectWrite)]
        )