Skip to content

Omni Data Classes

examples.omni.data_classes

CDFExternalReferences

Bases: DomainModel

This represents the reading version of cdf external reference.

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 cdf external reference.

required
data_record

The data record of the cdf external reference node.

required
file

The file field.

required
sequence

The sequence field.

required
timeseries

The timesery field.

required
Source code in examples/omni/data_classes/_cdf_external_references.py
class CDFExternalReferences(DomainModel):
    """This represents the reading version of cdf external reference.

    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 cdf external reference.
        data_record: The data record of the cdf external reference node.
        file: The file field.
        sequence: The sequence field.
        timeseries: The timesery field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "CDFExternalReferences", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = None
    file: Union[FileMetadata, str, None] = None
    sequence: Union[SequenceRead, str, None] = None
    timeseries: Union[TimeSeries, str, None] = None

    def as_write(self) -> CDFExternalReferencesWrite:
        """Convert this read version of cdf external reference to the writing version."""
        return CDFExternalReferencesWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of cdf external reference to the writing version.

Source code in examples/omni/data_classes/_cdf_external_references.py
def as_write(self) -> CDFExternalReferencesWrite:
    """Convert this read version of cdf external reference to the writing version."""
    return CDFExternalReferencesWrite.model_validate(as_write_args(self))

CDFExternalReferencesGraphQL

Bases: GraphQLCore

This represents the reading version of cdf external reference, 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 cdf external reference.

required
data_record

The data record of the cdf external reference node.

required
file

The file field.

required
sequence

The sequence field.

required
timeseries

The timesery field.

required
Source code in examples/omni/data_classes/_cdf_external_references.py
class CDFExternalReferencesGraphQL(GraphQLCore):
    """This represents the reading version of cdf external reference, 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 cdf external reference.
        data_record: The data record of the cdf external reference node.
        file: The file field.
        sequence: The sequence field.
        timeseries: The timesery field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "CDFExternalReferences", "1")
    file: Optional[FileMetadataGraphQL] = None
    sequence: Optional[SequenceGraphQL] = None
    timeseries: Optional[TimeSeriesGraphQL] = 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) -> CDFExternalReferences:
        """Convert this GraphQL format of cdf external reference to the reading format."""
        return CDFExternalReferences.model_validate(as_read_args(self))

    def as_write(self) -> CDFExternalReferencesWrite:
        """Convert this GraphQL format of cdf external reference to the writing format."""
        return CDFExternalReferencesWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of cdf external reference to the reading format.

Source code in examples/omni/data_classes/_cdf_external_references.py
def as_read(self) -> CDFExternalReferences:
    """Convert this GraphQL format of cdf external reference to the reading format."""
    return CDFExternalReferences.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of cdf external reference to the writing format.

Source code in examples/omni/data_classes/_cdf_external_references.py
def as_write(self) -> CDFExternalReferencesWrite:
    """Convert this GraphQL format of cdf external reference to the writing format."""
    return CDFExternalReferencesWrite.model_validate(as_write_args(self))

CDFExternalReferencesList

Bases: DomainModelList[CDFExternalReferences]

List of cdf external references in the read version.

Source code in examples/omni/data_classes/_cdf_external_references.py
class CDFExternalReferencesList(DomainModelList[CDFExternalReferences]):
    """List of cdf external references in the read version."""

    _INSTANCE = CDFExternalReferences

    def as_write(self) -> CDFExternalReferencesWriteList:
        """Convert these read versions of cdf external reference to the writing versions."""
        return CDFExternalReferencesWriteList([node.as_write() for node in self.data])

as_write()

Convert these read versions of cdf external reference to the writing versions.

Source code in examples/omni/data_classes/_cdf_external_references.py
def as_write(self) -> CDFExternalReferencesWriteList:
    """Convert these read versions of cdf external reference to the writing versions."""
    return CDFExternalReferencesWriteList([node.as_write() for node in self.data])

CDFExternalReferencesListed

Bases: DomainModel

This represents the reading version of cdf external references listed.

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 cdf external references listed.

required
data_record

The data record of the cdf external references listed node.

required
files

The file field.

required
sequences

The sequence field.

required
timeseries

The timesery field.

required
Source code in examples/omni/data_classes/_cdf_external_references_listed.py
class CDFExternalReferencesListed(DomainModel):
    """This represents the reading version of cdf external references listed.

    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 cdf external references listed.
        data_record: The data record of the cdf external references listed node.
        files: The file field.
        sequences: The sequence field.
        timeseries: The timesery field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "CDFExternalReferencesListed", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = None
    files: Optional[list[Union[FileMetadata, str]]] = None
    sequences: Optional[list[Union[SequenceRead, str]]] = None
    timeseries: Optional[list[Union[TimeSeries, str]]] = None

    def as_write(self) -> CDFExternalReferencesListedWrite:
        """Convert this read version of cdf external references listed to the writing version."""
        return CDFExternalReferencesListedWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of cdf external references listed to the writing version.

Source code in examples/omni/data_classes/_cdf_external_references_listed.py
def as_write(self) -> CDFExternalReferencesListedWrite:
    """Convert this read version of cdf external references listed to the writing version."""
    return CDFExternalReferencesListedWrite.model_validate(as_write_args(self))

CDFExternalReferencesListedGraphQL

Bases: GraphQLCore

This represents the reading version of cdf external references listed, 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 cdf external references listed.

required
data_record

The data record of the cdf external references listed node.

required
files

The file field.

required
sequences

The sequence field.

required
timeseries

The timesery field.

required
Source code in examples/omni/data_classes/_cdf_external_references_listed.py
class CDFExternalReferencesListedGraphQL(GraphQLCore):
    """This represents the reading version of cdf external references listed, 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 cdf external references listed.
        data_record: The data record of the cdf external references listed node.
        files: The file field.
        sequences: The sequence field.
        timeseries: The timesery field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "CDFExternalReferencesListed", "1")
    files: Optional[list[FileMetadataGraphQL]] = None
    sequences: Optional[list[SequenceGraphQL]] = None
    timeseries: Optional[list[TimeSeriesGraphQL]] = 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("files", "sequences", "timeseries", mode="before")
    def clean_list(cls, value: Any) -> Any:
        if isinstance(value, list):
            return [v for v in value if v is not None] or None
        return value

    def as_read(self) -> CDFExternalReferencesListed:
        """Convert this GraphQL format of cdf external references listed to the reading format."""
        return CDFExternalReferencesListed.model_validate(as_read_args(self))

    def as_write(self) -> CDFExternalReferencesListedWrite:
        """Convert this GraphQL format of cdf external references listed to the writing format."""
        return CDFExternalReferencesListedWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of cdf external references listed to the reading format.

Source code in examples/omni/data_classes/_cdf_external_references_listed.py
def as_read(self) -> CDFExternalReferencesListed:
    """Convert this GraphQL format of cdf external references listed to the reading format."""
    return CDFExternalReferencesListed.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of cdf external references listed to the writing format.

Source code in examples/omni/data_classes/_cdf_external_references_listed.py
def as_write(self) -> CDFExternalReferencesListedWrite:
    """Convert this GraphQL format of cdf external references listed to the writing format."""
    return CDFExternalReferencesListedWrite.model_validate(as_write_args(self))

CDFExternalReferencesListedList

Bases: DomainModelList[CDFExternalReferencesListed]

List of cdf external references listeds in the read version.

Source code in examples/omni/data_classes/_cdf_external_references_listed.py
class CDFExternalReferencesListedList(DomainModelList[CDFExternalReferencesListed]):
    """List of cdf external references listeds in the read version."""

    _INSTANCE = CDFExternalReferencesListed

    def as_write(self) -> CDFExternalReferencesListedWriteList:
        """Convert these read versions of cdf external references listed to the writing versions."""
        return CDFExternalReferencesListedWriteList([node.as_write() for node in self.data])

as_write()

Convert these read versions of cdf external references listed to the writing versions.

Source code in examples/omni/data_classes/_cdf_external_references_listed.py
def as_write(self) -> CDFExternalReferencesListedWriteList:
    """Convert these read versions of cdf external references listed to the writing versions."""
    return CDFExternalReferencesListedWriteList([node.as_write() for node in self.data])

CDFExternalReferencesListedWrite

Bases: DomainModelWrite

This represents the writing version of cdf external references listed.

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 cdf external references listed.

required
data_record

The data record of the cdf external references listed node.

required
files

The file field.

required
sequences

The sequence field.

required
timeseries

The timesery field.

required
Source code in examples/omni/data_classes/_cdf_external_references_listed.py
class CDFExternalReferencesListedWrite(DomainModelWrite):
    """This represents the writing version of cdf external references listed.

    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 cdf external references listed.
        data_record: The data record of the cdf external references listed node.
        files: The file field.
        sequences: The sequence field.
        timeseries: The timesery field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "files",
        "sequences",
        "timeseries",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "CDFExternalReferencesListed", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    files: Optional[list[Union[FileMetadataWrite, str]]] = None
    sequences: Optional[list[Union[SequenceWrite, str]]] = None
    timeseries: Optional[list[Union[TimeSeriesWrite, str]]] = None

CDFExternalReferencesListedWriteList

Bases: DomainModelWriteList[CDFExternalReferencesListedWrite]

List of cdf external references listeds in the writing version.

Source code in examples/omni/data_classes/_cdf_external_references_listed.py
class CDFExternalReferencesListedWriteList(DomainModelWriteList[CDFExternalReferencesListedWrite]):
    """List of cdf external references listeds in the writing version."""

    _INSTANCE = CDFExternalReferencesListedWrite

CDFExternalReferencesWrite

Bases: DomainModelWrite

This represents the writing version of cdf external reference.

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 cdf external reference.

required
data_record

The data record of the cdf external reference node.

required
file

The file field.

required
sequence

The sequence field.

required
timeseries

The timesery field.

required
Source code in examples/omni/data_classes/_cdf_external_references.py
class CDFExternalReferencesWrite(DomainModelWrite):
    """This represents the writing version of cdf external reference.

    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 cdf external reference.
        data_record: The data record of the cdf external reference node.
        file: The file field.
        sequence: The sequence field.
        timeseries: The timesery field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "file",
        "sequence",
        "timeseries",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "CDFExternalReferences", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    file: Union[FileMetadataWrite, str, None] = None
    sequence: Union[SequenceWrite, str, None] = None
    timeseries: Union[TimeSeriesWrite, str, None] = None

CDFExternalReferencesWriteList

Bases: DomainModelWriteList[CDFExternalReferencesWrite]

List of cdf external references in the writing version.

Source code in examples/omni/data_classes/_cdf_external_references.py
class CDFExternalReferencesWriteList(DomainModelWriteList[CDFExternalReferencesWrite]):
    """List of cdf external references in the writing version."""

    _INSTANCE = CDFExternalReferencesWrite

ConnectionEdgeA

Bases: DomainRelation

This represents the reading version of connection edge a.

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 connection edge a.

required
data_record

The data record of the connection edge a edge.

required
end_node

The end node of this edge.

required
end_time

The end time field.

required
name

The name field.

required
start_time

The start time field.

required
Source code in examples/omni/data_classes/_connection_edge_a.py
class ConnectionEdgeA(DomainRelation):
    """This represents the reading version of connection edge a.

    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 connection edge a.
        data_record: The data record of the connection edge a edge.
        end_node: The end node of this edge.
        end_time: The end time field.
        name: The name field.
        start_time: The start time field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionEdgeA", "1")
    space: str = DEFAULT_INSTANCE_SPACE
    end_node: Union[ConnectionItemE, ConnectionItemF, ConnectionItemG, str, dm.NodeId] = Field(alias="endNode")
    end_time: Optional[datetime.datetime] = Field(None, alias="endTime")
    name: Optional[str] = None
    start_time: Optional[datetime.datetime] = Field(None, alias="startTime")

    def as_write(self) -> ConnectionEdgeAWrite:
        """Convert this read version of connection edge a to the writing version."""
        return ConnectionEdgeAWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of connection edge a to the writing version.

Source code in examples/omni/data_classes/_connection_edge_a.py
def as_write(self) -> ConnectionEdgeAWrite:
    """Convert this read version of connection edge a to the writing version."""
    return ConnectionEdgeAWrite.model_validate(as_write_args(self))

ConnectionEdgeAGraphQL

Bases: GraphQLCore

This represents the reading version of connection edge a, 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 connection edge a.

required
data_record

The data record of the connection edge a node.

required
end_node

The end node of this edge.

required
end_time

The end time field.

required
name

The name field.

required
start_time

The start time field.

required
Source code in examples/omni/data_classes/_connection_edge_a.py
class ConnectionEdgeAGraphQL(GraphQLCore):
    """This represents the reading version of connection edge a, 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 connection edge a.
        data_record: The data record of the connection edge a node.
        end_node: The end node of this edge.
        end_time: The end time field.
        name: The name field.
        start_time: The start time field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionEdgeA", "1")
    end_node: Union[ConnectionItemEGraphQL, ConnectionItemFGraphQL, ConnectionItemGGraphQL, None] = Field(
        None, alias="endNode"
    )
    end_time: Optional[datetime.datetime] = Field(None, alias="endTime")
    name: Optional[str] = None
    start_time: Optional[datetime.datetime] = Field(None, alias="startTime")

    def as_read(self) -> ConnectionEdgeA:
        """Convert this GraphQL format of connection edge a to the reading format."""
        return ConnectionEdgeA.model_validate(as_read_args(self))

    def as_write(self) -> ConnectionEdgeAWrite:
        """Convert this GraphQL format of connection edge a to the writing format."""
        return ConnectionEdgeAWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of connection edge a to the reading format.

Source code in examples/omni/data_classes/_connection_edge_a.py
def as_read(self) -> ConnectionEdgeA:
    """Convert this GraphQL format of connection edge a to the reading format."""
    return ConnectionEdgeA.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of connection edge a to the writing format.

Source code in examples/omni/data_classes/_connection_edge_a.py
def as_write(self) -> ConnectionEdgeAWrite:
    """Convert this GraphQL format of connection edge a to the writing format."""
    return ConnectionEdgeAWrite.model_validate(as_write_args(self))

ConnectionEdgeAList

Bases: DomainRelationList[ConnectionEdgeA]

List of connection edge as in the reading version.

Source code in examples/omni/data_classes/_connection_edge_a.py
class ConnectionEdgeAList(DomainRelationList[ConnectionEdgeA]):
    """List of connection edge as in the reading version."""

    _INSTANCE = ConnectionEdgeA

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

as_write()

Convert this read version of connection edge a list to the writing version.

Source code in examples/omni/data_classes/_connection_edge_a.py
def as_write(self) -> ConnectionEdgeAWriteList:
    """Convert this read version of connection edge a list to the writing version."""
    return ConnectionEdgeAWriteList([edge.as_write() for edge in self])

ConnectionEdgeAWrite

Bases: DomainRelationWrite

This represents the writing version of connection edge a.

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 connection edge a.

required
data_record

The data record of the connection edge a edge.

required
end_node

The end node of this edge.

required
end_time

The end time field.

required
name

The name field.

required
start_time

The start time field.

required
Source code in examples/omni/data_classes/_connection_edge_a.py
class ConnectionEdgeAWrite(DomainRelationWrite):
    """This represents the writing version of connection edge a.

    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 connection edge a.
        data_record: The data record of the connection edge a edge.
        end_node: The end node of this edge.
        end_time: The end time field.
        name: The name field.
        start_time: The start time field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "end_time",
        "name",
        "start_time",
    )
    _validate_end_node = _validate_end_node

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionEdgeA", "1")
    end_node: Union[ConnectionItemEWrite, ConnectionItemFWrite, ConnectionItemGWrite, str, dm.NodeId] = Field(
        alias="endNode"
    )
    end_time: Optional[datetime.datetime] = Field(None, alias="endTime")
    name: Optional[str] = None
    start_time: Optional[datetime.datetime] = Field(None, alias="startTime")

ConnectionEdgeAWriteList

Bases: DomainRelationWriteList[ConnectionEdgeAWrite]

List of connection edge as in the writing version.

Source code in examples/omni/data_classes/_connection_edge_a.py
class ConnectionEdgeAWriteList(DomainRelationWriteList[ConnectionEdgeAWrite]):
    """List of connection edge as in the writing version."""

    _INSTANCE = ConnectionEdgeAWrite

ConnectionItemA

Bases: DomainModel

This represents the reading version of connection item a.

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 connection item a.

required
data_record

The data record of the connection item a node.

required
name

The name field.

required
other_direct

The other direct field.

required
outwards

The outward field.

required
self_direct

The self direct field.

required
Source code in examples/omni/data_classes/_connection_item_a.py
class ConnectionItemA(DomainModel):
    """This represents the reading version of connection item a.

    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 connection item a.
        data_record: The data record of the connection item a node.
        name: The name field.
        other_direct: The other direct field.
        outwards: The outward field.
        self_direct: The self direct field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemA", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = dm.DirectRelationReference(
        "sp_pygen_models", "ConnectionItemA"
    )
    name: Optional[str] = None
    other_direct: Union[ConnectionItemCNode, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="otherDirect"
    )
    outwards: Optional[list[Union[ConnectionItemB, str, dm.NodeId]]] = Field(default=None, repr=False)
    self_direct: Union[ConnectionItemA, str, dm.NodeId, None] = Field(default=None, repr=False, alias="selfDirect")

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

    @field_validator("outwards", 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) -> ConnectionItemAWrite:
        """Convert this read version of connection item a to the writing version."""
        return ConnectionItemAWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of connection item a to the writing version.

Source code in examples/omni/data_classes/_connection_item_a.py
def as_write(self) -> ConnectionItemAWrite:
    """Convert this read version of connection item a to the writing version."""
    return ConnectionItemAWrite.model_validate(as_write_args(self))

ConnectionItemAGraphQL

Bases: GraphQLCore

This represents the reading version of connection item a, 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 connection item a.

required
data_record

The data record of the connection item a node.

required
name

The name field.

required
other_direct

The other direct field.

required
outwards

The outward field.

required
self_direct

The self direct field.

required
Source code in examples/omni/data_classes/_connection_item_a.py
class ConnectionItemAGraphQL(GraphQLCore):
    """This represents the reading version of connection item a, 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 connection item a.
        data_record: The data record of the connection item a node.
        name: The name field.
        other_direct: The other direct field.
        outwards: The outward field.
        self_direct: The self direct field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemA", "1")
    name: Optional[str] = None
    other_direct: Optional[ConnectionItemCNodeGraphQL] = Field(default=None, repr=False, alias="otherDirect")
    outwards: Optional[list[ConnectionItemBGraphQL]] = Field(default=None, repr=False)
    self_direct: Optional[ConnectionItemAGraphQL] = Field(default=None, repr=False, alias="selfDirect")

    @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("other_direct", "outwards", "self_direct", 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) -> ConnectionItemA:
        """Convert this GraphQL format of connection item a to the reading format."""
        return ConnectionItemA.model_validate(as_read_args(self))

    def as_write(self) -> ConnectionItemAWrite:
        """Convert this GraphQL format of connection item a to the writing format."""
        return ConnectionItemAWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of connection item a to the reading format.

Source code in examples/omni/data_classes/_connection_item_a.py
def as_read(self) -> ConnectionItemA:
    """Convert this GraphQL format of connection item a to the reading format."""
    return ConnectionItemA.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of connection item a to the writing format.

Source code in examples/omni/data_classes/_connection_item_a.py
def as_write(self) -> ConnectionItemAWrite:
    """Convert this GraphQL format of connection item a to the writing format."""
    return ConnectionItemAWrite.model_validate(as_write_args(self))

ConnectionItemAList

Bases: DomainModelList[ConnectionItemA]

List of connection item as in the read version.

Source code in examples/omni/data_classes/_connection_item_a.py
class ConnectionItemAList(DomainModelList[ConnectionItemA]):
    """List of connection item as in the read version."""

    _INSTANCE = ConnectionItemA

    def as_write(self) -> ConnectionItemAWriteList:
        """Convert these read versions of connection item a to the writing versions."""
        return ConnectionItemAWriteList([node.as_write() for node in self.data])

    @property
    def other_direct(self) -> ConnectionItemCNodeList:
        from ._connection_item_c_node import ConnectionItemCNode, ConnectionItemCNodeList

        return ConnectionItemCNodeList(
            [item.other_direct for item in self.data if isinstance(item.other_direct, ConnectionItemCNode)]
        )

    @property
    def outwards(self) -> ConnectionItemBList:
        from ._connection_item_b import ConnectionItemB, ConnectionItemBList

        return ConnectionItemBList(
            [item for items in self.data for item in items.outwards or [] if isinstance(item, ConnectionItemB)]
        )

    @property
    def self_direct(self) -> ConnectionItemAList:
        return ConnectionItemAList(
            [item.self_direct for item in self.data if isinstance(item.self_direct, ConnectionItemA)]
        )

as_write()

Convert these read versions of connection item a to the writing versions.

Source code in examples/omni/data_classes/_connection_item_a.py
def as_write(self) -> ConnectionItemAWriteList:
    """Convert these read versions of connection item a to the writing versions."""
    return ConnectionItemAWriteList([node.as_write() for node in self.data])

ConnectionItemAWrite

Bases: DomainModelWrite

This represents the writing version of connection item a.

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 connection item a.

required
data_record

The data record of the connection item a node.

required
name

The name field.

required
other_direct

The other direct field.

required
outwards

The outward field.

required
self_direct

The self direct field.

required
Source code in examples/omni/data_classes/_connection_item_a.py
class ConnectionItemAWrite(DomainModelWrite):
    """This represents the writing version of connection item a.

    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 connection item a.
        data_record: The data record of the connection item a node.
        name: The name field.
        other_direct: The other direct field.
        outwards: The outward field.
        self_direct: The self direct field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "name",
        "other_direct",
        "self_direct",
    )
    _outwards_edges: ClassVar[tuple[tuple[str, dm.DirectRelationReference], ...]] = (
        ("outwards", dm.DirectRelationReference("sp_pygen_models", "bidirectional")),
    )
    _direct_relations: ClassVar[tuple[str, ...]] = (
        "other_direct",
        "self_direct",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemA", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = dm.DirectRelationReference(
        "sp_pygen_models", "ConnectionItemA"
    )
    name: Optional[str] = None
    other_direct: Union[ConnectionItemCNodeWrite, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="otherDirect"
    )
    outwards: Optional[list[Union[ConnectionItemBWrite, str, dm.NodeId]]] = Field(default=None, repr=False)
    self_direct: Union[ConnectionItemAWrite, str, dm.NodeId, None] = Field(default=None, repr=False, alias="selfDirect")

    @field_validator("other_direct", "outwards", "self_direct", 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

ConnectionItemAWriteList

Bases: DomainModelWriteList[ConnectionItemAWrite]

List of connection item as in the writing version.

Source code in examples/omni/data_classes/_connection_item_a.py
class ConnectionItemAWriteList(DomainModelWriteList[ConnectionItemAWrite]):
    """List of connection item as in the writing version."""

    _INSTANCE = ConnectionItemAWrite

    @property
    def other_direct(self) -> ConnectionItemCNodeWriteList:
        from ._connection_item_c_node import ConnectionItemCNodeWrite, ConnectionItemCNodeWriteList

        return ConnectionItemCNodeWriteList(
            [item.other_direct for item in self.data if isinstance(item.other_direct, ConnectionItemCNodeWrite)]
        )

    @property
    def outwards(self) -> ConnectionItemBWriteList:
        from ._connection_item_b import ConnectionItemBWrite, ConnectionItemBWriteList

        return ConnectionItemBWriteList(
            [item for items in self.data for item in items.outwards or [] if isinstance(item, ConnectionItemBWrite)]
        )

    @property
    def self_direct(self) -> ConnectionItemAWriteList:
        return ConnectionItemAWriteList(
            [item.self_direct for item in self.data if isinstance(item.self_direct, ConnectionItemAWrite)]
        )

ConnectionItemB

Bases: DomainModel

This represents the reading version of connection item b.

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 connection item b.

required
data_record

The data record of the connection item b node.

required
inwards

The inward field.

required
name

The name field.

required
self_edge

The self edge field.

required
Source code in examples/omni/data_classes/_connection_item_b.py
class ConnectionItemB(DomainModel):
    """This represents the reading version of connection item b.

    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 connection item b.
        data_record: The data record of the connection item b node.
        inwards: The inward field.
        name: The name field.
        self_edge: The self edge field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemB", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = dm.DirectRelationReference(
        "sp_pygen_models", "ConnectionItemB"
    )
    inwards: Optional[list[Union[ConnectionItemA, str, dm.NodeId]]] = Field(default=None, repr=False)
    name: Optional[str] = None
    self_edge: Optional[list[Union[ConnectionItemB, str, dm.NodeId]]] = Field(
        default=None, repr=False, alias="selfEdge"
    )

    @field_validator("inwards", "self_edge", 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) -> ConnectionItemBWrite:
        """Convert this read version of connection item b to the writing version."""
        return ConnectionItemBWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of connection item b to the writing version.

Source code in examples/omni/data_classes/_connection_item_b.py
def as_write(self) -> ConnectionItemBWrite:
    """Convert this read version of connection item b to the writing version."""
    return ConnectionItemBWrite.model_validate(as_write_args(self))

ConnectionItemBGraphQL

Bases: GraphQLCore

This represents the reading version of connection item b, 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 connection item b.

required
data_record

The data record of the connection item b node.

required
inwards

The inward field.

required
name

The name field.

required
self_edge

The self edge field.

required
Source code in examples/omni/data_classes/_connection_item_b.py
class ConnectionItemBGraphQL(GraphQLCore):
    """This represents the reading version of connection item b, 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 connection item b.
        data_record: The data record of the connection item b node.
        inwards: The inward field.
        name: The name field.
        self_edge: The self edge field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemB", "1")
    inwards: Optional[list[ConnectionItemAGraphQL]] = Field(default=None, repr=False)
    name: Optional[str] = None
    self_edge: Optional[list[ConnectionItemBGraphQL]] = Field(default=None, repr=False, alias="selfEdge")

    @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("inwards", "self_edge", 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) -> ConnectionItemB:
        """Convert this GraphQL format of connection item b to the reading format."""
        return ConnectionItemB.model_validate(as_read_args(self))

    def as_write(self) -> ConnectionItemBWrite:
        """Convert this GraphQL format of connection item b to the writing format."""
        return ConnectionItemBWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of connection item b to the reading format.

Source code in examples/omni/data_classes/_connection_item_b.py
def as_read(self) -> ConnectionItemB:
    """Convert this GraphQL format of connection item b to the reading format."""
    return ConnectionItemB.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of connection item b to the writing format.

Source code in examples/omni/data_classes/_connection_item_b.py
def as_write(self) -> ConnectionItemBWrite:
    """Convert this GraphQL format of connection item b to the writing format."""
    return ConnectionItemBWrite.model_validate(as_write_args(self))

ConnectionItemBList

Bases: DomainModelList[ConnectionItemB]

List of connection item bs in the read version.

Source code in examples/omni/data_classes/_connection_item_b.py
class ConnectionItemBList(DomainModelList[ConnectionItemB]):
    """List of connection item bs in the read version."""

    _INSTANCE = ConnectionItemB

    def as_write(self) -> ConnectionItemBWriteList:
        """Convert these read versions of connection item b to the writing versions."""
        return ConnectionItemBWriteList([node.as_write() for node in self.data])

    @property
    def inwards(self) -> ConnectionItemAList:
        from ._connection_item_a import ConnectionItemA, ConnectionItemAList

        return ConnectionItemAList(
            [item for items in self.data for item in items.inwards or [] if isinstance(item, ConnectionItemA)]
        )

    @property
    def self_edge(self) -> ConnectionItemBList:
        return ConnectionItemBList(
            [item for items in self.data for item in items.self_edge or [] if isinstance(item, ConnectionItemB)]
        )

as_write()

Convert these read versions of connection item b to the writing versions.

Source code in examples/omni/data_classes/_connection_item_b.py
def as_write(self) -> ConnectionItemBWriteList:
    """Convert these read versions of connection item b to the writing versions."""
    return ConnectionItemBWriteList([node.as_write() for node in self.data])

ConnectionItemBWrite

Bases: DomainModelWrite

This represents the writing version of connection item b.

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 connection item b.

required
data_record

The data record of the connection item b node.

required
inwards

The inward field.

required
name

The name field.

required
self_edge

The self edge field.

required
Source code in examples/omni/data_classes/_connection_item_b.py
class ConnectionItemBWrite(DomainModelWrite):
    """This represents the writing version of connection item b.

    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 connection item b.
        data_record: The data record of the connection item b node.
        inwards: The inward field.
        name: The name field.
        self_edge: The self edge field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = ("name",)
    _outwards_edges: ClassVar[tuple[tuple[str, dm.DirectRelationReference], ...]] = (
        ("self_edge", dm.DirectRelationReference("sp_pygen_models", "reflexive")),
    )
    _inwards_edges: ClassVar[tuple[tuple[str, dm.DirectRelationReference], ...]] = (
        ("inwards", dm.DirectRelationReference("sp_pygen_models", "bidirectional")),
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemB", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = dm.DirectRelationReference(
        "sp_pygen_models", "ConnectionItemB"
    )
    inwards: Optional[list[Union[ConnectionItemAWrite, str, dm.NodeId]]] = Field(default=None, repr=False)
    name: Optional[str] = None
    self_edge: Optional[list[Union[ConnectionItemBWrite, str, dm.NodeId]]] = Field(
        default=None, repr=False, alias="selfEdge"
    )

    @field_validator("inwards", "self_edge", 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

ConnectionItemBWriteList

Bases: DomainModelWriteList[ConnectionItemBWrite]

List of connection item bs in the writing version.

Source code in examples/omni/data_classes/_connection_item_b.py
class ConnectionItemBWriteList(DomainModelWriteList[ConnectionItemBWrite]):
    """List of connection item bs in the writing version."""

    _INSTANCE = ConnectionItemBWrite

    @property
    def inwards(self) -> ConnectionItemAWriteList:
        from ._connection_item_a import ConnectionItemAWrite, ConnectionItemAWriteList

        return ConnectionItemAWriteList(
            [item for items in self.data for item in items.inwards or [] if isinstance(item, ConnectionItemAWrite)]
        )

    @property
    def self_edge(self) -> ConnectionItemBWriteList:
        return ConnectionItemBWriteList(
            [item for items in self.data for item in items.self_edge or [] if isinstance(item, ConnectionItemBWrite)]
        )

ConnectionItemCEdge

Bases: DomainRelation

This represents the reading version of connection item c 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 connection item c edge.

required
data_record

The data record of the connection item c edge edge.

required
end_node

The end node of this edge.

required
connection_item_a

The connection item a field.

required
connection_item_b

The connection item b field.

required
Source code in examples/omni/data_classes/_connection_item_c_edge.py
class ConnectionItemCEdge(DomainRelation):
    """This represents the reading version of connection item c 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 connection item c edge.
        data_record: The data record of the connection item c edge edge.
        end_node: The end node of this edge.
        connection_item_a: The connection item a field.
        connection_item_b: The connection item b field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemC", "1")
    space: str = DEFAULT_INSTANCE_SPACE
    end_node: Union[str, dm.NodeId] = Field(alias="endNode")
    connection_item_a: Optional[list[Union[ConnectionItemA, str, dm.NodeId]]] = Field(
        default=None, repr=False, alias="connectionItemA"
    )
    connection_item_b: Optional[list[Union[ConnectionItemB, str, dm.NodeId]]] = Field(
        default=None, repr=False, alias="connectionItemB"
    )

ConnectionItemCEdgeGraphQL

Bases: GraphQLCore

This represents the reading version of connection item c 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 connection item c edge.

required
data_record

The data record of the connection item c edge node.

required
end_node

The end node of this edge.

required
connection_item_a

The connection item a field.

required
connection_item_b

The connection item b field.

required
Source code in examples/omni/data_classes/_connection_item_c_edge.py
class ConnectionItemCEdgeGraphQL(GraphQLCore):
    """This represents the reading version of connection item c 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 connection item c edge.
        data_record: The data record of the connection item c edge node.
        end_node: The end node of this edge.
        connection_item_a: The connection item a field.
        connection_item_b: The connection item b field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemC", "1")
    end_node: Union[dm.NodeId, None] = Field(None, alias="endNode")
    connection_item_a: Optional[list[ConnectionItemAGraphQL]] = Field(default=None, repr=False, alias="connectionItemA")
    connection_item_b: Optional[list[ConnectionItemBGraphQL]] = Field(default=None, repr=False, alias="connectionItemB")

    def as_read(self) -> ConnectionItemCEdge:
        """Convert this GraphQL format of connection item c edge to the reading format."""
        return ConnectionItemCEdge.model_validate(as_read_args(self))

as_read()

Convert this GraphQL format of connection item c edge to the reading format.

Source code in examples/omni/data_classes/_connection_item_c_edge.py
def as_read(self) -> ConnectionItemCEdge:
    """Convert this GraphQL format of connection item c edge to the reading format."""
    return ConnectionItemCEdge.model_validate(as_read_args(self))

ConnectionItemCEdgeList

Bases: DomainRelationList[ConnectionItemCEdge]

List of connection item c edges in the reading version.

Source code in examples/omni/data_classes/_connection_item_c_edge.py
class ConnectionItemCEdgeList(DomainRelationList[ConnectionItemCEdge]):
    """List of connection item c edges in the reading version."""

    _INSTANCE = ConnectionItemCEdge

ConnectionItemCNode

Bases: DomainModel

This represents the reading version of connection item c 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 connection item c node.

required
data_record

The data record of the connection item c node node.

required
connection_item_a

The connection item a field.

required
connection_item_b

The connection item b field.

required
Source code in examples/omni/data_classes/_connection_item_c_node.py
class ConnectionItemCNode(DomainModel):
    """This represents the reading version of connection item c 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 connection item c node.
        data_record: The data record of the connection item c node node.
        connection_item_a: The connection item a field.
        connection_item_b: The connection item b field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemC", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = dm.DirectRelationReference(
        "sp_pygen_models", "ConnectionItemC"
    )
    connection_item_a: Optional[list[Union[ConnectionItemA, str, dm.NodeId]]] = Field(
        default=None, repr=False, alias="connectionItemA"
    )
    connection_item_b: Optional[list[Union[ConnectionItemB, str, dm.NodeId]]] = Field(
        default=None, repr=False, alias="connectionItemB"
    )

    @field_validator("connection_item_a", "connection_item_b", 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) -> ConnectionItemCNodeWrite:
        """Convert this read version of connection item c node to the writing version."""
        return ConnectionItemCNodeWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of connection item c node to the writing version.

Source code in examples/omni/data_classes/_connection_item_c_node.py
def as_write(self) -> ConnectionItemCNodeWrite:
    """Convert this read version of connection item c node to the writing version."""
    return ConnectionItemCNodeWrite.model_validate(as_write_args(self))

ConnectionItemCNodeGraphQL

Bases: GraphQLCore

This represents the reading version of connection item c 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 connection item c node.

required
data_record

The data record of the connection item c node node.

required
connection_item_a

The connection item a field.

required
connection_item_b

The connection item b field.

required
Source code in examples/omni/data_classes/_connection_item_c_node.py
class ConnectionItemCNodeGraphQL(GraphQLCore):
    """This represents the reading version of connection item c 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 connection item c node.
        data_record: The data record of the connection item c node node.
        connection_item_a: The connection item a field.
        connection_item_b: The connection item b field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemC", "1")
    connection_item_a: Optional[list[ConnectionItemAGraphQL]] = Field(default=None, repr=False, alias="connectionItemA")
    connection_item_b: Optional[list[ConnectionItemBGraphQL]] = Field(default=None, repr=False, alias="connectionItemB")

    @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("connection_item_a", "connection_item_b", 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) -> ConnectionItemCNode:
        """Convert this GraphQL format of connection item c node to the reading format."""
        return ConnectionItemCNode.model_validate(as_read_args(self))

    def as_write(self) -> ConnectionItemCNodeWrite:
        """Convert this GraphQL format of connection item c node to the writing format."""
        return ConnectionItemCNodeWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of connection item c node to the reading format.

Source code in examples/omni/data_classes/_connection_item_c_node.py
def as_read(self) -> ConnectionItemCNode:
    """Convert this GraphQL format of connection item c node to the reading format."""
    return ConnectionItemCNode.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of connection item c node to the writing format.

Source code in examples/omni/data_classes/_connection_item_c_node.py
def as_write(self) -> ConnectionItemCNodeWrite:
    """Convert this GraphQL format of connection item c node to the writing format."""
    return ConnectionItemCNodeWrite.model_validate(as_write_args(self))

ConnectionItemCNodeList

Bases: DomainModelList[ConnectionItemCNode]

List of connection item c nodes in the read version.

Source code in examples/omni/data_classes/_connection_item_c_node.py
class ConnectionItemCNodeList(DomainModelList[ConnectionItemCNode]):
    """List of connection item c nodes in the read version."""

    _INSTANCE = ConnectionItemCNode

    def as_write(self) -> ConnectionItemCNodeWriteList:
        """Convert these read versions of connection item c node to the writing versions."""
        return ConnectionItemCNodeWriteList([node.as_write() for node in self.data])

    @property
    def connection_item_a(self) -> ConnectionItemAList:
        from ._connection_item_a import ConnectionItemA, ConnectionItemAList

        return ConnectionItemAList(
            [item for items in self.data for item in items.connection_item_a or [] if isinstance(item, ConnectionItemA)]
        )

    @property
    def connection_item_b(self) -> ConnectionItemBList:
        from ._connection_item_b import ConnectionItemB, ConnectionItemBList

        return ConnectionItemBList(
            [item for items in self.data for item in items.connection_item_b or [] if isinstance(item, ConnectionItemB)]
        )

as_write()

Convert these read versions of connection item c node to the writing versions.

Source code in examples/omni/data_classes/_connection_item_c_node.py
def as_write(self) -> ConnectionItemCNodeWriteList:
    """Convert these read versions of connection item c node to the writing versions."""
    return ConnectionItemCNodeWriteList([node.as_write() for node in self.data])

ConnectionItemCNodeWrite

Bases: DomainModelWrite

This represents the writing version of connection item c 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 connection item c node.

required
data_record

The data record of the connection item c node node.

required
connection_item_a

The connection item a field.

required
connection_item_b

The connection item b field.

required
Source code in examples/omni/data_classes/_connection_item_c_node.py
class ConnectionItemCNodeWrite(DomainModelWrite):
    """This represents the writing version of connection item c 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 connection item c node.
        data_record: The data record of the connection item c node node.
        connection_item_a: The connection item a field.
        connection_item_b: The connection item b field.
    """

    _outwards_edges: ClassVar[tuple[tuple[str, dm.DirectRelationReference], ...]] = (
        ("connection_item_a", dm.DirectRelationReference("sp_pygen_models", "unidirectional")),
        ("connection_item_b", dm.DirectRelationReference("sp_pygen_models", "unidirectional")),
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemC", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = dm.DirectRelationReference(
        "sp_pygen_models", "ConnectionItemC"
    )
    connection_item_a: Optional[list[Union[ConnectionItemAWrite, str, dm.NodeId]]] = Field(
        default=None, repr=False, alias="connectionItemA"
    )
    connection_item_b: Optional[list[Union[ConnectionItemBWrite, str, dm.NodeId]]] = Field(
        default=None, repr=False, alias="connectionItemB"
    )

    @field_validator("connection_item_a", "connection_item_b", 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

ConnectionItemCNodeWriteList

Bases: DomainModelWriteList[ConnectionItemCNodeWrite]

List of connection item c nodes in the writing version.

Source code in examples/omni/data_classes/_connection_item_c_node.py
class ConnectionItemCNodeWriteList(DomainModelWriteList[ConnectionItemCNodeWrite]):
    """List of connection item c nodes in the writing version."""

    _INSTANCE = ConnectionItemCNodeWrite

    @property
    def connection_item_a(self) -> ConnectionItemAWriteList:
        from ._connection_item_a import ConnectionItemAWrite, ConnectionItemAWriteList

        return ConnectionItemAWriteList(
            [
                item
                for items in self.data
                for item in items.connection_item_a or []
                if isinstance(item, ConnectionItemAWrite)
            ]
        )

    @property
    def connection_item_b(self) -> ConnectionItemBWriteList:
        from ._connection_item_b import ConnectionItemBWrite, ConnectionItemBWriteList

        return ConnectionItemBWriteList(
            [
                item
                for items in self.data
                for item in items.connection_item_b or []
                if isinstance(item, ConnectionItemBWrite)
            ]
        )

ConnectionItemD

Bases: DomainModel

This represents the reading version of connection item d.

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 connection item d.

required
data_record

The data record of the connection item d node.

required
direct_multi

The direct multi field.

required
direct_single

The direct single field.

required
name

The name field.

required
outwards_single

The outwards single field.

required
Source code in examples/omni/data_classes/_connection_item_d.py
class ConnectionItemD(DomainModel):
    """This represents the reading version of connection item d.

    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 connection item d.
        data_record: The data record of the connection item d node.
        direct_multi: The direct multi field.
        direct_single: The direct single field.
        name: The name field.
        outwards_single: The outwards single field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemD", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = dm.DirectRelationReference(
        "sp_pygen_models", "ConnectionItemD"
    )
    direct_multi: Optional[list[Union[ConnectionItemE, str, dm.NodeId]]] = Field(
        default=None, repr=False, alias="directMulti"
    )
    direct_single: Union[ConnectionItemE, str, dm.NodeId, None] = Field(default=None, repr=False, alias="directSingle")
    name: Optional[str] = None
    outwards_single: Union[ConnectionItemE, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="outwardsSingle"
    )

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

    @field_validator("direct_multi", 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) -> ConnectionItemDWrite:
        """Convert this read version of connection item d to the writing version."""
        return ConnectionItemDWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of connection item d to the writing version.

Source code in examples/omni/data_classes/_connection_item_d.py
def as_write(self) -> ConnectionItemDWrite:
    """Convert this read version of connection item d to the writing version."""
    return ConnectionItemDWrite.model_validate(as_write_args(self))

ConnectionItemDGraphQL

Bases: GraphQLCore

This represents the reading version of connection item d, 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 connection item d.

required
data_record

The data record of the connection item d node.

required
direct_multi

The direct multi field.

required
direct_single

The direct single field.

required
name

The name field.

required
outwards_single

The outwards single field.

required
Source code in examples/omni/data_classes/_connection_item_d.py
class ConnectionItemDGraphQL(GraphQLCore):
    """This represents the reading version of connection item d, 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 connection item d.
        data_record: The data record of the connection item d node.
        direct_multi: The direct multi field.
        direct_single: The direct single field.
        name: The name field.
        outwards_single: The outwards single field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemD", "1")
    direct_multi: Optional[list[ConnectionItemEGraphQL]] = Field(default=None, repr=False, alias="directMulti")
    direct_single: Optional[ConnectionItemEGraphQL] = Field(default=None, repr=False, alias="directSingle")
    name: Optional[str] = None
    outwards_single: Optional[ConnectionItemEGraphQL] = Field(default=None, repr=False, alias="outwardsSingle")

    @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("direct_multi", "direct_single", "outwards_single", 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) -> ConnectionItemD:
        """Convert this GraphQL format of connection item d to the reading format."""
        return ConnectionItemD.model_validate(as_read_args(self))

    def as_write(self) -> ConnectionItemDWrite:
        """Convert this GraphQL format of connection item d to the writing format."""
        return ConnectionItemDWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of connection item d to the reading format.

Source code in examples/omni/data_classes/_connection_item_d.py
def as_read(self) -> ConnectionItemD:
    """Convert this GraphQL format of connection item d to the reading format."""
    return ConnectionItemD.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of connection item d to the writing format.

Source code in examples/omni/data_classes/_connection_item_d.py
def as_write(self) -> ConnectionItemDWrite:
    """Convert this GraphQL format of connection item d to the writing format."""
    return ConnectionItemDWrite.model_validate(as_write_args(self))

ConnectionItemDList

Bases: DomainModelList[ConnectionItemD]

List of connection item ds in the read version.

Source code in examples/omni/data_classes/_connection_item_d.py
class ConnectionItemDList(DomainModelList[ConnectionItemD]):
    """List of connection item ds in the read version."""

    _INSTANCE = ConnectionItemD

    def as_write(self) -> ConnectionItemDWriteList:
        """Convert these read versions of connection item d to the writing versions."""
        return ConnectionItemDWriteList([node.as_write() for node in self.data])

    @property
    def direct_multi(self) -> ConnectionItemEList:
        from ._connection_item_e import ConnectionItemE, ConnectionItemEList

        return ConnectionItemEList(
            [item for items in self.data for item in items.direct_multi or [] if isinstance(item, ConnectionItemE)]
        )

    @property
    def direct_single(self) -> ConnectionItemEList:
        from ._connection_item_e import ConnectionItemE, ConnectionItemEList

        return ConnectionItemEList(
            [item.direct_single for item in self.data if isinstance(item.direct_single, ConnectionItemE)]
        )

    @property
    def outwards_single(self) -> ConnectionItemEList:
        from ._connection_item_e import ConnectionItemE, ConnectionItemEList

        return ConnectionItemEList(
            [item.outwards_single for item in self.data if isinstance(item.outwards_single, ConnectionItemE)]
        )

as_write()

Convert these read versions of connection item d to the writing versions.

Source code in examples/omni/data_classes/_connection_item_d.py
def as_write(self) -> ConnectionItemDWriteList:
    """Convert these read versions of connection item d to the writing versions."""
    return ConnectionItemDWriteList([node.as_write() for node in self.data])

ConnectionItemDWrite

Bases: DomainModelWrite

This represents the writing version of connection item d.

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 connection item d.

required
data_record

The data record of the connection item d node.

required
direct_multi

The direct multi field.

required
direct_single

The direct single field.

required
name

The name field.

required
outwards_single

The outwards single field.

required
Source code in examples/omni/data_classes/_connection_item_d.py
class ConnectionItemDWrite(DomainModelWrite):
    """This represents the writing version of connection item d.

    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 connection item d.
        data_record: The data record of the connection item d node.
        direct_multi: The direct multi field.
        direct_single: The direct single field.
        name: The name field.
        outwards_single: The outwards single field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "direct_multi",
        "direct_single",
        "name",
    )
    _outwards_edges: ClassVar[tuple[tuple[str, dm.DirectRelationReference], ...]] = (
        ("outwards_single", dm.DirectRelationReference("sp_pygen_models", "bidirectionalSingle")),
    )
    _direct_relations: ClassVar[tuple[str, ...]] = (
        "direct_multi",
        "direct_single",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemD", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = dm.DirectRelationReference(
        "sp_pygen_models", "ConnectionItemD"
    )
    direct_multi: Optional[list[Union[ConnectionItemEWrite, str, dm.NodeId]]] = Field(
        default=None, repr=False, alias="directMulti"
    )
    direct_single: Union[ConnectionItemEWrite, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="directSingle"
    )
    name: Optional[str] = None
    outwards_single: Union[ConnectionItemEWrite, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="outwardsSingle"
    )

    @field_validator("direct_multi", "direct_single", "outwards_single", 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

ConnectionItemDWriteList

Bases: DomainModelWriteList[ConnectionItemDWrite]

List of connection item ds in the writing version.

Source code in examples/omni/data_classes/_connection_item_d.py
class ConnectionItemDWriteList(DomainModelWriteList[ConnectionItemDWrite]):
    """List of connection item ds in the writing version."""

    _INSTANCE = ConnectionItemDWrite

    @property
    def direct_multi(self) -> ConnectionItemEWriteList:
        from ._connection_item_e import ConnectionItemEWrite, ConnectionItemEWriteList

        return ConnectionItemEWriteList(
            [item for items in self.data for item in items.direct_multi or [] if isinstance(item, ConnectionItemEWrite)]
        )

    @property
    def direct_single(self) -> ConnectionItemEWriteList:
        from ._connection_item_e import ConnectionItemEWrite, ConnectionItemEWriteList

        return ConnectionItemEWriteList(
            [item.direct_single for item in self.data if isinstance(item.direct_single, ConnectionItemEWrite)]
        )

    @property
    def outwards_single(self) -> ConnectionItemEWriteList:
        from ._connection_item_e import ConnectionItemEWrite, ConnectionItemEWriteList

        return ConnectionItemEWriteList(
            [item.outwards_single for item in self.data if isinstance(item.outwards_single, ConnectionItemEWrite)]
        )

ConnectionItemE

Bases: DomainModel

This represents the reading version of connection item e.

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 connection item e.

required
data_record

The data record of the connection item e node.

required
direct_list_no_source

The direct list no source field.

required
direct_no_source

The direct no source field.

required
direct_reverse_multi

The direct reverse multi field.

required
direct_reverse_single

The direct reverse single field.

required
inwards_single

The inwards single field.

required
inwards_single_property

The inwards single property field.

required
name

The name field.

required
Source code in examples/omni/data_classes/_connection_item_e.py
class ConnectionItemE(DomainModel):
    """This represents the reading version of connection item e.

    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 connection item e.
        data_record: The data record of the connection item e node.
        direct_list_no_source: The direct list no source field.
        direct_no_source: The direct no source field.
        direct_reverse_multi: The direct reverse multi field.
        direct_reverse_single: The direct reverse single field.
        inwards_single: The inwards single field.
        inwards_single_property: The inwards single property field.
        name: The name field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemE", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = dm.DirectRelationReference(
        "sp_pygen_models", "ConnectionItemE"
    )
    direct_list_no_source: Optional[list[Union[str, dm.NodeId]]] = Field(default=None, alias="directListNoSource")
    direct_no_source: Union[str, dm.NodeId, None] = Field(default=None, alias="directNoSource")
    direct_reverse_multi: Optional[list[ConnectionItemD]] = Field(default=None, repr=False, alias="directReverseMulti")
    direct_reverse_single: Optional[ConnectionItemD] = Field(default=None, repr=False, alias="directReverseSingle")
    inwards_single: Union[ConnectionItemD, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="inwardsSingle"
    )
    inwards_single_property: Optional[ConnectionEdgeA] = Field(default=None, repr=False, alias="inwardsSingleProperty")
    name: Optional[str] = None

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

    @field_validator("direct_list_no_source", "direct_reverse_multi", 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) -> ConnectionItemEWrite:
        """Convert this read version of connection item e to the writing version."""
        return ConnectionItemEWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of connection item e to the writing version.

Source code in examples/omni/data_classes/_connection_item_e.py
def as_write(self) -> ConnectionItemEWrite:
    """Convert this read version of connection item e to the writing version."""
    return ConnectionItemEWrite.model_validate(as_write_args(self))

ConnectionItemEGraphQL

Bases: GraphQLCore

This represents the reading version of connection item e, 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 connection item e.

required
data_record

The data record of the connection item e node.

required
direct_list_no_source

The direct list no source field.

required
direct_no_source

The direct no source field.

required
direct_reverse_multi

The direct reverse multi field.

required
direct_reverse_single

The direct reverse single field.

required
inwards_single

The inwards single field.

required
inwards_single_property

The inwards single property field.

required
name

The name field.

required
Source code in examples/omni/data_classes/_connection_item_e.py
class ConnectionItemEGraphQL(GraphQLCore):
    """This represents the reading version of connection item e, 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 connection item e.
        data_record: The data record of the connection item e node.
        direct_list_no_source: The direct list no source field.
        direct_no_source: The direct no source field.
        direct_reverse_multi: The direct reverse multi field.
        direct_reverse_single: The direct reverse single field.
        inwards_single: The inwards single field.
        inwards_single_property: The inwards single property field.
        name: The name field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemE", "1")
    direct_list_no_source: Optional[list[dict]] = Field(default=None, alias="directListNoSource")
    direct_no_source: Optional[dict] = Field(default=None, alias="directNoSource")
    direct_reverse_multi: Optional[list[ConnectionItemDGraphQL]] = Field(
        default=None, repr=False, alias="directReverseMulti"
    )
    direct_reverse_single: Optional[ConnectionItemDGraphQL] = Field(
        default=None, repr=False, alias="directReverseSingle"
    )
    inwards_single: Optional[ConnectionItemDGraphQL] = Field(default=None, repr=False, alias="inwardsSingle")
    inwards_single_property: Optional[ConnectionEdgeAGraphQL] = Field(
        default=None, repr=False, alias="inwardsSingleProperty"
    )
    name: Optional[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(
        "direct_list_no_source",
        "direct_no_source",
        "direct_reverse_multi",
        "direct_reverse_single",
        "inwards_single",
        "inwards_single_property",
        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) -> ConnectionItemE:
        """Convert this GraphQL format of connection item e to the reading format."""
        return ConnectionItemE.model_validate(as_read_args(self))

    def as_write(self) -> ConnectionItemEWrite:
        """Convert this GraphQL format of connection item e to the writing format."""
        return ConnectionItemEWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of connection item e to the reading format.

Source code in examples/omni/data_classes/_connection_item_e.py
def as_read(self) -> ConnectionItemE:
    """Convert this GraphQL format of connection item e to the reading format."""
    return ConnectionItemE.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of connection item e to the writing format.

Source code in examples/omni/data_classes/_connection_item_e.py
def as_write(self) -> ConnectionItemEWrite:
    """Convert this GraphQL format of connection item e to the writing format."""
    return ConnectionItemEWrite.model_validate(as_write_args(self))

ConnectionItemEList

Bases: DomainModelList[ConnectionItemE]

List of connection item es in the read version.

Source code in examples/omni/data_classes/_connection_item_e.py
class ConnectionItemEList(DomainModelList[ConnectionItemE]):
    """List of connection item es in the read version."""

    _INSTANCE = ConnectionItemE

    def as_write(self) -> ConnectionItemEWriteList:
        """Convert these read versions of connection item e to the writing versions."""
        return ConnectionItemEWriteList([node.as_write() for node in self.data])

    @property
    def direct_reverse_multi(self) -> ConnectionItemDList:
        from ._connection_item_d import ConnectionItemD, ConnectionItemDList

        return ConnectionItemDList(
            [
                item
                for items in self.data
                for item in items.direct_reverse_multi or []
                if isinstance(item, ConnectionItemD)
            ]
        )

    @property
    def direct_reverse_single(self) -> ConnectionItemDList:
        from ._connection_item_d import ConnectionItemD, ConnectionItemDList

        return ConnectionItemDList(
            [
                item.direct_reverse_single
                for item in self.data
                if isinstance(item.direct_reverse_single, ConnectionItemD)
            ]
        )

    @property
    def inwards_single(self) -> ConnectionItemDList:
        from ._connection_item_d import ConnectionItemD, ConnectionItemDList

        return ConnectionItemDList(
            [item.inwards_single for item in self.data if isinstance(item.inwards_single, ConnectionItemD)]
        )

    @property
    def inwards_single_property(self) -> ConnectionEdgeAList:
        from ._connection_edge_a import ConnectionEdgeA, ConnectionEdgeAList

        return ConnectionEdgeAList(
            [
                item.inwards_single_property
                for item in self.data
                if isinstance(item.inwards_single_property, ConnectionEdgeA)
            ]
        )

as_write()

Convert these read versions of connection item e to the writing versions.

Source code in examples/omni/data_classes/_connection_item_e.py
def as_write(self) -> ConnectionItemEWriteList:
    """Convert these read versions of connection item e to the writing versions."""
    return ConnectionItemEWriteList([node.as_write() for node in self.data])

ConnectionItemEWrite

Bases: DomainModelWrite

This represents the writing version of connection item e.

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 connection item e.

required
data_record

The data record of the connection item e node.

required
direct_list_no_source

The direct list no source field.

required
direct_no_source

The direct no source field.

required
inwards_single

The inwards single field.

required
inwards_single_property

The inwards single property field.

required
name

The name field.

required
Source code in examples/omni/data_classes/_connection_item_e.py
class ConnectionItemEWrite(DomainModelWrite):
    """This represents the writing version of connection item e.

    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 connection item e.
        data_record: The data record of the connection item e node.
        direct_list_no_source: The direct list no source field.
        direct_no_source: The direct no source field.
        inwards_single: The inwards single field.
        inwards_single_property: The inwards single property field.
        name: The name field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "direct_list_no_source",
        "direct_no_source",
        "name",
    )
    _inwards_edges: ClassVar[tuple[tuple[str, dm.DirectRelationReference], ...]] = (
        ("inwards_single", dm.DirectRelationReference("sp_pygen_models", "bidirectionalSingle")),
        ("inwards_single_property", dm.DirectRelationReference("sp_pygen_models", "multiProperty")),
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemE", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = dm.DirectRelationReference(
        "sp_pygen_models", "ConnectionItemE"
    )
    direct_list_no_source: Optional[list[Union[str, dm.NodeId]]] = Field(default=None, alias="directListNoSource")
    direct_no_source: Union[str, dm.NodeId, None] = Field(default=None, alias="directNoSource")
    inwards_single: Union[ConnectionItemDWrite, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="inwardsSingle"
    )
    inwards_single_property: Optional[ConnectionEdgeAWrite] = Field(
        default=None, repr=False, alias="inwardsSingleProperty"
    )
    name: Optional[str] = None

    @field_validator("inwards_single", "inwards_single_property", 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

ConnectionItemEWriteList

Bases: DomainModelWriteList[ConnectionItemEWrite]

List of connection item es in the writing version.

Source code in examples/omni/data_classes/_connection_item_e.py
class ConnectionItemEWriteList(DomainModelWriteList[ConnectionItemEWrite]):
    """List of connection item es in the writing version."""

    _INSTANCE = ConnectionItemEWrite

    @property
    def inwards_single(self) -> ConnectionItemDWriteList:
        from ._connection_item_d import ConnectionItemDWrite, ConnectionItemDWriteList

        return ConnectionItemDWriteList(
            [item.inwards_single for item in self.data if isinstance(item.inwards_single, ConnectionItemDWrite)]
        )

    @property
    def inwards_single_property(self) -> ConnectionEdgeAWriteList:
        from ._connection_edge_a import ConnectionEdgeAWrite, ConnectionEdgeAWriteList

        return ConnectionEdgeAWriteList(
            [
                item.inwards_single_property
                for item in self.data
                if isinstance(item.inwards_single_property, ConnectionEdgeAWrite)
            ]
        )

ConnectionItemF

Bases: DomainModel

This represents the reading version of connection item f.

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 connection item f.

required
data_record

The data record of the connection item f node.

required
direct_list

The direct list field.

required
name

The name field.

required
outwards_multi

The outwards multi field.

required
outwards_single

The outwards single field.

required
Source code in examples/omni/data_classes/_connection_item_f.py
class ConnectionItemF(DomainModel):
    """This represents the reading version of connection item f.

    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 connection item f.
        data_record: The data record of the connection item f node.
        direct_list: The direct list field.
        name: The name field.
        outwards_multi: The outwards multi field.
        outwards_single: The outwards single field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemF", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = dm.DirectRelationReference(
        "sp_pygen_models", "ConnectionItemF"
    )
    direct_list: Optional[list[Union[ConnectionItemD, str, dm.NodeId]]] = Field(
        default=None, repr=False, alias="directList"
    )
    name: Optional[str] = None
    outwards_multi: Optional[list[ConnectionEdgeA]] = Field(default=None, repr=False, alias="outwardsMulti")
    outwards_single: Optional[ConnectionEdgeA] = Field(default=None, repr=False, alias="outwardsSingle")

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

    @field_validator("direct_list", "outwards_multi", 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) -> ConnectionItemFWrite:
        """Convert this read version of connection item f to the writing version."""
        return ConnectionItemFWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of connection item f to the writing version.

Source code in examples/omni/data_classes/_connection_item_f.py
def as_write(self) -> ConnectionItemFWrite:
    """Convert this read version of connection item f to the writing version."""
    return ConnectionItemFWrite.model_validate(as_write_args(self))

ConnectionItemFGraphQL

Bases: GraphQLCore

This represents the reading version of connection item f, 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 connection item f.

required
data_record

The data record of the connection item f node.

required
direct_list

The direct list field.

required
name

The name field.

required
outwards_multi

The outwards multi field.

required
outwards_single

The outwards single field.

required
Source code in examples/omni/data_classes/_connection_item_f.py
class ConnectionItemFGraphQL(GraphQLCore):
    """This represents the reading version of connection item f, 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 connection item f.
        data_record: The data record of the connection item f node.
        direct_list: The direct list field.
        name: The name field.
        outwards_multi: The outwards multi field.
        outwards_single: The outwards single field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemF", "1")
    direct_list: Optional[list[ConnectionItemDGraphQL]] = Field(default=None, repr=False, alias="directList")
    name: Optional[str] = None
    outwards_multi: Optional[list[ConnectionEdgeAGraphQL]] = Field(default=None, repr=False, alias="outwardsMulti")
    outwards_single: Optional[ConnectionEdgeAGraphQL] = Field(default=None, repr=False, alias="outwardsSingle")

    @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("direct_list", "outwards_multi", "outwards_single", 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) -> ConnectionItemF:
        """Convert this GraphQL format of connection item f to the reading format."""
        return ConnectionItemF.model_validate(as_read_args(self))

    def as_write(self) -> ConnectionItemFWrite:
        """Convert this GraphQL format of connection item f to the writing format."""
        return ConnectionItemFWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of connection item f to the reading format.

Source code in examples/omni/data_classes/_connection_item_f.py
def as_read(self) -> ConnectionItemF:
    """Convert this GraphQL format of connection item f to the reading format."""
    return ConnectionItemF.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of connection item f to the writing format.

Source code in examples/omni/data_classes/_connection_item_f.py
def as_write(self) -> ConnectionItemFWrite:
    """Convert this GraphQL format of connection item f to the writing format."""
    return ConnectionItemFWrite.model_validate(as_write_args(self))

ConnectionItemFList

Bases: DomainModelList[ConnectionItemF]

List of connection item fs in the read version.

Source code in examples/omni/data_classes/_connection_item_f.py
class ConnectionItemFList(DomainModelList[ConnectionItemF]):
    """List of connection item fs in the read version."""

    _INSTANCE = ConnectionItemF

    def as_write(self) -> ConnectionItemFWriteList:
        """Convert these read versions of connection item f to the writing versions."""
        return ConnectionItemFWriteList([node.as_write() for node in self.data])

    @property
    def direct_list(self) -> ConnectionItemDList:
        from ._connection_item_d import ConnectionItemD, ConnectionItemDList

        return ConnectionItemDList(
            [item for items in self.data for item in items.direct_list or [] if isinstance(item, ConnectionItemD)]
        )

    @property
    def outwards_multi(self) -> ConnectionEdgeAList:
        from ._connection_edge_a import ConnectionEdgeA, ConnectionEdgeAList

        return ConnectionEdgeAList(
            [item for items in self.data for item in items.outwards_multi or [] if isinstance(item, ConnectionEdgeA)]
        )

    @property
    def outwards_single(self) -> ConnectionEdgeAList:
        from ._connection_edge_a import ConnectionEdgeA, ConnectionEdgeAList

        return ConnectionEdgeAList(
            [item.outwards_single for item in self.data if isinstance(item.outwards_single, ConnectionEdgeA)]
        )

as_write()

Convert these read versions of connection item f to the writing versions.

Source code in examples/omni/data_classes/_connection_item_f.py
def as_write(self) -> ConnectionItemFWriteList:
    """Convert these read versions of connection item f to the writing versions."""
    return ConnectionItemFWriteList([node.as_write() for node in self.data])

ConnectionItemFWrite

Bases: DomainModelWrite

This represents the writing version of connection item f.

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 connection item f.

required
data_record

The data record of the connection item f node.

required
direct_list

The direct list field.

required
name

The name field.

required
outwards_multi

The outwards multi field.

required
outwards_single

The outwards single field.

required
Source code in examples/omni/data_classes/_connection_item_f.py
class ConnectionItemFWrite(DomainModelWrite):
    """This represents the writing version of connection item f.

    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 connection item f.
        data_record: The data record of the connection item f node.
        direct_list: The direct list field.
        name: The name field.
        outwards_multi: The outwards multi field.
        outwards_single: The outwards single field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "direct_list",
        "name",
    )
    _outwards_edges: ClassVar[tuple[tuple[str, dm.DirectRelationReference], ...]] = (
        ("outwards_multi", dm.DirectRelationReference("sp_pygen_models", "multiProperty")),
        ("outwards_single", dm.DirectRelationReference("sp_pygen_models", "singleProperty")),
    )
    _direct_relations: ClassVar[tuple[str, ...]] = ("direct_list",)

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemF", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = dm.DirectRelationReference(
        "sp_pygen_models", "ConnectionItemF"
    )
    direct_list: Optional[list[Union[ConnectionItemDWrite, str, dm.NodeId]]] = Field(
        default=None, repr=False, alias="directList"
    )
    name: Optional[str] = None
    outwards_multi: Optional[list[ConnectionEdgeAWrite]] = Field(default=None, repr=False, alias="outwardsMulti")
    outwards_single: Optional[ConnectionEdgeAWrite] = Field(default=None, repr=False, alias="outwardsSingle")

    @field_validator("direct_list", "outwards_multi", "outwards_single", 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

ConnectionItemFWriteList

Bases: DomainModelWriteList[ConnectionItemFWrite]

List of connection item fs in the writing version.

Source code in examples/omni/data_classes/_connection_item_f.py
class ConnectionItemFWriteList(DomainModelWriteList[ConnectionItemFWrite]):
    """List of connection item fs in the writing version."""

    _INSTANCE = ConnectionItemFWrite

    @property
    def direct_list(self) -> ConnectionItemDWriteList:
        from ._connection_item_d import ConnectionItemDWrite, ConnectionItemDWriteList

        return ConnectionItemDWriteList(
            [item for items in self.data for item in items.direct_list or [] if isinstance(item, ConnectionItemDWrite)]
        )

    @property
    def outwards_multi(self) -> ConnectionEdgeAWriteList:
        from ._connection_edge_a import ConnectionEdgeAWrite, ConnectionEdgeAWriteList

        return ConnectionEdgeAWriteList(
            [
                item
                for items in self.data
                for item in items.outwards_multi or []
                if isinstance(item, ConnectionEdgeAWrite)
            ]
        )

    @property
    def outwards_single(self) -> ConnectionEdgeAWriteList:
        from ._connection_edge_a import ConnectionEdgeAWrite, ConnectionEdgeAWriteList

        return ConnectionEdgeAWriteList(
            [item.outwards_single for item in self.data if isinstance(item.outwards_single, ConnectionEdgeAWrite)]
        )

ConnectionItemG

Bases: DomainModel

This represents the reading version of connection item g.

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 connection item g.

required
data_record

The data record of the connection item g node.

required
inwards_multi_property

The inwards multi property field.

required
name

The name field.

required
Source code in examples/omni/data_classes/_connection_item_g.py
class ConnectionItemG(DomainModel):
    """This represents the reading version of connection item g.

    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 connection item g.
        data_record: The data record of the connection item g node.
        inwards_multi_property: The inwards multi property field.
        name: The name field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemG", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = dm.DirectRelationReference(
        "sp_pygen_models", "ConnectionItemG"
    )
    inwards_multi_property: Optional[list[ConnectionEdgeA]] = Field(
        default=None, repr=False, alias="inwardsMultiProperty"
    )
    name: Optional[str] = None

    @field_validator("inwards_multi_property", 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) -> ConnectionItemGWrite:
        """Convert this read version of connection item g to the writing version."""
        return ConnectionItemGWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of connection item g to the writing version.

Source code in examples/omni/data_classes/_connection_item_g.py
def as_write(self) -> ConnectionItemGWrite:
    """Convert this read version of connection item g to the writing version."""
    return ConnectionItemGWrite.model_validate(as_write_args(self))

ConnectionItemGGraphQL

Bases: GraphQLCore

This represents the reading version of connection item g, 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 connection item g.

required
data_record

The data record of the connection item g node.

required
inwards_multi_property

The inwards multi property field.

required
name

The name field.

required
Source code in examples/omni/data_classes/_connection_item_g.py
class ConnectionItemGGraphQL(GraphQLCore):
    """This represents the reading version of connection item g, 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 connection item g.
        data_record: The data record of the connection item g node.
        inwards_multi_property: The inwards multi property field.
        name: The name field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemG", "1")
    inwards_multi_property: Optional[list[ConnectionEdgeAGraphQL]] = Field(
        default=None, repr=False, alias="inwardsMultiProperty"
    )
    name: Optional[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("inwards_multi_property", 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) -> ConnectionItemG:
        """Convert this GraphQL format of connection item g to the reading format."""
        return ConnectionItemG.model_validate(as_read_args(self))

    def as_write(self) -> ConnectionItemGWrite:
        """Convert this GraphQL format of connection item g to the writing format."""
        return ConnectionItemGWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of connection item g to the reading format.

Source code in examples/omni/data_classes/_connection_item_g.py
def as_read(self) -> ConnectionItemG:
    """Convert this GraphQL format of connection item g to the reading format."""
    return ConnectionItemG.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of connection item g to the writing format.

Source code in examples/omni/data_classes/_connection_item_g.py
def as_write(self) -> ConnectionItemGWrite:
    """Convert this GraphQL format of connection item g to the writing format."""
    return ConnectionItemGWrite.model_validate(as_write_args(self))

ConnectionItemGList

Bases: DomainModelList[ConnectionItemG]

List of connection item gs in the read version.

Source code in examples/omni/data_classes/_connection_item_g.py
class ConnectionItemGList(DomainModelList[ConnectionItemG]):
    """List of connection item gs in the read version."""

    _INSTANCE = ConnectionItemG

    def as_write(self) -> ConnectionItemGWriteList:
        """Convert these read versions of connection item g to the writing versions."""
        return ConnectionItemGWriteList([node.as_write() for node in self.data])

    @property
    def inwards_multi_property(self) -> ConnectionEdgeAList:
        from ._connection_edge_a import ConnectionEdgeA, ConnectionEdgeAList

        return ConnectionEdgeAList(
            [
                item
                for items in self.data
                for item in items.inwards_multi_property or []
                if isinstance(item, ConnectionEdgeA)
            ]
        )

as_write()

Convert these read versions of connection item g to the writing versions.

Source code in examples/omni/data_classes/_connection_item_g.py
def as_write(self) -> ConnectionItemGWriteList:
    """Convert these read versions of connection item g to the writing versions."""
    return ConnectionItemGWriteList([node.as_write() for node in self.data])

ConnectionItemGWrite

Bases: DomainModelWrite

This represents the writing version of connection item g.

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 connection item g.

required
data_record

The data record of the connection item g node.

required
inwards_multi_property

The inwards multi property field.

required
name

The name field.

required
Source code in examples/omni/data_classes/_connection_item_g.py
class ConnectionItemGWrite(DomainModelWrite):
    """This represents the writing version of connection item g.

    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 connection item g.
        data_record: The data record of the connection item g node.
        inwards_multi_property: The inwards multi property field.
        name: The name field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = ("name",)
    _inwards_edges: ClassVar[tuple[tuple[str, dm.DirectRelationReference], ...]] = (
        ("inwards_multi_property", dm.DirectRelationReference("sp_pygen_models", "multiProperty")),
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "ConnectionItemG", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = dm.DirectRelationReference(
        "sp_pygen_models", "ConnectionItemG"
    )
    inwards_multi_property: Optional[list[ConnectionEdgeAWrite]] = Field(
        default=None, repr=False, alias="inwardsMultiProperty"
    )
    name: Optional[str] = None

    @field_validator("inwards_multi_property", 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

ConnectionItemGWriteList

Bases: DomainModelWriteList[ConnectionItemGWrite]

List of connection item gs in the writing version.

Source code in examples/omni/data_classes/_connection_item_g.py
class ConnectionItemGWriteList(DomainModelWriteList[ConnectionItemGWrite]):
    """List of connection item gs in the writing version."""

    _INSTANCE = ConnectionItemGWrite

    @property
    def inwards_multi_property(self) -> ConnectionEdgeAWriteList:
        from ._connection_edge_a import ConnectionEdgeAWrite, ConnectionEdgeAWriteList

        return ConnectionEdgeAWriteList(
            [
                item
                for items in self.data
                for item in items.inwards_multi_property or []
                if isinstance(item, ConnectionEdgeAWrite)
            ]
        )

DependentOnNonWritable

Bases: DomainModel

This represents the reading version of dependent on non writable.

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 dependent on non writable.

required
data_record

The data record of the dependent on non writable node.

required
a_value

The a value field.

required
to_non_writable

The to non writable field.

required
Source code in examples/omni/data_classes/_dependent_on_non_writable.py
class DependentOnNonWritable(DomainModel):
    """This represents the reading version of dependent on non writable.

    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 dependent on non writable.
        data_record: The data record of the dependent on non writable node.
        a_value: The a value field.
        to_non_writable: The to non writable field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "DependentOnNonWritable", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = dm.DirectRelationReference(
        "sp_pygen_models", "DependentOnNonWritable"
    )
    a_value: Optional[str] = Field(None, alias="aValue")
    to_non_writable: Optional[list[Union[Implementation1NonWriteable, str, dm.NodeId]]] = Field(
        default=None, repr=False, alias="toNonWritable"
    )

    @field_validator("to_non_writable", 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) -> DependentOnNonWritableWrite:
        """Convert this read version of dependent on non writable to the writing version."""
        return DependentOnNonWritableWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of dependent on non writable to the writing version.

Source code in examples/omni/data_classes/_dependent_on_non_writable.py
def as_write(self) -> DependentOnNonWritableWrite:
    """Convert this read version of dependent on non writable to the writing version."""
    return DependentOnNonWritableWrite.model_validate(as_write_args(self))

DependentOnNonWritableGraphQL

Bases: GraphQLCore

This represents the reading version of dependent on non writable, 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 dependent on non writable.

required
data_record

The data record of the dependent on non writable node.

required
a_value

The a value field.

required
to_non_writable

The to non writable field.

required
Source code in examples/omni/data_classes/_dependent_on_non_writable.py
class DependentOnNonWritableGraphQL(GraphQLCore):
    """This represents the reading version of dependent on non writable, 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 dependent on non writable.
        data_record: The data record of the dependent on non writable node.
        a_value: The a value field.
        to_non_writable: The to non writable field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "DependentOnNonWritable", "1")
    a_value: Optional[str] = Field(None, alias="aValue")
    to_non_writable: Optional[list[Implementation1NonWriteableGraphQL]] = Field(
        default=None, repr=False, alias="toNonWritable"
    )

    @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("to_non_writable", 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) -> DependentOnNonWritable:
        """Convert this GraphQL format of dependent on non writable to the reading format."""
        return DependentOnNonWritable.model_validate(as_read_args(self))

    def as_write(self) -> DependentOnNonWritableWrite:
        """Convert this GraphQL format of dependent on non writable to the writing format."""
        return DependentOnNonWritableWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of dependent on non writable to the reading format.

Source code in examples/omni/data_classes/_dependent_on_non_writable.py
def as_read(self) -> DependentOnNonWritable:
    """Convert this GraphQL format of dependent on non writable to the reading format."""
    return DependentOnNonWritable.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of dependent on non writable to the writing format.

Source code in examples/omni/data_classes/_dependent_on_non_writable.py
def as_write(self) -> DependentOnNonWritableWrite:
    """Convert this GraphQL format of dependent on non writable to the writing format."""
    return DependentOnNonWritableWrite.model_validate(as_write_args(self))

DependentOnNonWritableList

Bases: DomainModelList[DependentOnNonWritable]

List of dependent on non writables in the read version.

Source code in examples/omni/data_classes/_dependent_on_non_writable.py
class DependentOnNonWritableList(DomainModelList[DependentOnNonWritable]):
    """List of dependent on non writables in the read version."""

    _INSTANCE = DependentOnNonWritable

    def as_write(self) -> DependentOnNonWritableWriteList:
        """Convert these read versions of dependent on non writable to the writing versions."""
        return DependentOnNonWritableWriteList([node.as_write() for node in self.data])

    @property
    def to_non_writable(self) -> Implementation1NonWriteableList:
        from ._implementation_1_non_writeable import Implementation1NonWriteable, Implementation1NonWriteableList

        return Implementation1NonWriteableList(
            [
                item
                for items in self.data
                for item in items.to_non_writable or []
                if isinstance(item, Implementation1NonWriteable)
            ]
        )

as_write()

Convert these read versions of dependent on non writable to the writing versions.

Source code in examples/omni/data_classes/_dependent_on_non_writable.py
def as_write(self) -> DependentOnNonWritableWriteList:
    """Convert these read versions of dependent on non writable to the writing versions."""
    return DependentOnNonWritableWriteList([node.as_write() for node in self.data])

DependentOnNonWritableWrite

Bases: DomainModelWrite

This represents the writing version of dependent on non writable.

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 dependent on non writable.

required
data_record

The data record of the dependent on non writable node.

required
a_value

The a value field.

required
to_non_writable

The to non writable field.

required
Source code in examples/omni/data_classes/_dependent_on_non_writable.py
class DependentOnNonWritableWrite(DomainModelWrite):
    """This represents the writing version of dependent on non writable.

    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 dependent on non writable.
        data_record: The data record of the dependent on non writable node.
        a_value: The a value field.
        to_non_writable: The to non writable field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = ("a_value",)
    _outwards_edges: ClassVar[tuple[tuple[str, dm.DirectRelationReference], ...]] = (
        ("to_non_writable", dm.DirectRelationReference("sp_pygen_models", "toNonWritable")),
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "DependentOnNonWritable", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = dm.DirectRelationReference(
        "sp_pygen_models", "DependentOnNonWritable"
    )
    a_value: Optional[str] = Field(None, alias="aValue")
    to_non_writable: Optional[list[Union[str, dm.NodeId]]] = Field(default=None, alias="toNonWritable")

    @field_validator("to_non_writable", 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

DependentOnNonWritableWriteList

Bases: DomainModelWriteList[DependentOnNonWritableWrite]

List of dependent on non writables in the writing version.

Source code in examples/omni/data_classes/_dependent_on_non_writable.py
class DependentOnNonWritableWriteList(DomainModelWriteList[DependentOnNonWritableWrite]):
    """List of dependent on non writables in the writing version."""

    _INSTANCE = DependentOnNonWritableWrite

Empty

Bases: DomainModel

This represents the reading version of empty.

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 empty.

required
data_record

The data record of the empty node.

required
boolean

The boolean field.

required
date

The date field.

required
float_32

The float 32 field.

required
float_64

The float 64 field.

required
int_32

The int 32 field.

required
int_64

The int 64 field.

required
json_

The json field.

required
text

The text field.

required
timestamp

The timestamp field.

required
Source code in examples/omni/data_classes/_empty.py
class Empty(DomainModel):
    """This represents the reading version of empty.

    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 empty.
        data_record: The data record of the empty node.
        boolean: The boolean field.
        date: The date field.
        float_32: The float 32 field.
        float_64: The float 64 field.
        int_32: The int 32 field.
        int_64: The int 64 field.
        json_: The json field.
        text: The text field.
        timestamp: The timestamp field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "Empty", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = dm.DirectRelationReference("sp_pygen_models", "Empty")
    boolean: Optional[bool] = None
    date: Optional[datetime.date] = None
    float_32: Optional[float] = Field(None, alias="float32")
    float_64: Optional[float] = Field(None, alias="float64")
    int_32: Optional[int] = Field(None, alias="int32")
    int_64: Optional[int] = Field(None, alias="int64")
    json_: Optional[dict] = Field(None, alias="json")
    text: Optional[str] = None
    timestamp: Optional[datetime.datetime] = None

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

as_write()

Convert this read version of empty to the writing version.

Source code in examples/omni/data_classes/_empty.py
def as_write(self) -> EmptyWrite:
    """Convert this read version of empty to the writing version."""
    return EmptyWrite.model_validate(as_write_args(self))

EmptyGraphQL

Bases: GraphQLCore

This represents the reading version of empty, 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 empty.

required
data_record

The data record of the empty node.

required
boolean

The boolean field.

required
date

The date field.

required
float_32

The float 32 field.

required
float_64

The float 64 field.

required
int_32

The int 32 field.

required
int_64

The int 64 field.

required
json_

The json field.

required
text

The text field.

required
timestamp

The timestamp field.

required
Source code in examples/omni/data_classes/_empty.py
class EmptyGraphQL(GraphQLCore):
    """This represents the reading version of empty, 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 empty.
        data_record: The data record of the empty node.
        boolean: The boolean field.
        date: The date field.
        float_32: The float 32 field.
        float_64: The float 64 field.
        int_32: The int 32 field.
        int_64: The int 64 field.
        json_: The json field.
        text: The text field.
        timestamp: The timestamp field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "Empty", "1")
    boolean: Optional[bool] = None
    date: Optional[datetime.date] = None
    float_32: Optional[float] = Field(None, alias="float32")
    float_64: Optional[float] = Field(None, alias="float64")
    int_32: Optional[int] = Field(None, alias="int32")
    int_64: Optional[int] = Field(None, alias="int64")
    json_: Optional[dict] = Field(None, alias="json")
    text: Optional[str] = None
    timestamp: Optional[datetime.datetime] = 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) -> Empty:
        """Convert this GraphQL format of empty to the reading format."""
        return Empty.model_validate(as_read_args(self))

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

as_read()

Convert this GraphQL format of empty to the reading format.

Source code in examples/omni/data_classes/_empty.py
def as_read(self) -> Empty:
    """Convert this GraphQL format of empty to the reading format."""
    return Empty.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of empty to the writing format.

Source code in examples/omni/data_classes/_empty.py
def as_write(self) -> EmptyWrite:
    """Convert this GraphQL format of empty to the writing format."""
    return EmptyWrite.model_validate(as_write_args(self))

EmptyList

Bases: DomainModelList[Empty]

List of empties in the read version.

Source code in examples/omni/data_classes/_empty.py
class EmptyList(DomainModelList[Empty]):
    """List of empties in the read version."""

    _INSTANCE = Empty

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

as_write()

Convert these read versions of empty to the writing versions.

Source code in examples/omni/data_classes/_empty.py
def as_write(self) -> EmptyWriteList:
    """Convert these read versions of empty to the writing versions."""
    return EmptyWriteList([node.as_write() for node in self.data])

EmptyWrite

Bases: DomainModelWrite

This represents the writing version of empty.

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 empty.

required
data_record

The data record of the empty node.

required
boolean

The boolean field.

required
date

The date field.

required
float_32

The float 32 field.

required
float_64

The float 64 field.

required
int_32

The int 32 field.

required
int_64

The int 64 field.

required
json_

The json field.

required
text

The text field.

required
timestamp

The timestamp field.

required
Source code in examples/omni/data_classes/_empty.py
class EmptyWrite(DomainModelWrite):
    """This represents the writing version of empty.

    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 empty.
        data_record: The data record of the empty node.
        boolean: The boolean field.
        date: The date field.
        float_32: The float 32 field.
        float_64: The float 64 field.
        int_32: The int 32 field.
        int_64: The int 64 field.
        json_: The json field.
        text: The text field.
        timestamp: The timestamp field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "boolean",
        "date",
        "float_32",
        "float_64",
        "int_32",
        "int_64",
        "json_",
        "text",
        "timestamp",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "Empty", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = dm.DirectRelationReference(
        "sp_pygen_models", "Empty"
    )
    boolean: Optional[bool] = None
    date: Optional[datetime.date] = None
    float_32: Optional[float] = Field(None, alias="float32")
    float_64: Optional[float] = Field(None, alias="float64")
    int_32: Optional[int] = Field(None, alias="int32")
    int_64: Optional[int] = Field(None, alias="int64")
    json_: Optional[dict] = Field(None, alias="json")
    text: Optional[str] = None
    timestamp: Optional[datetime.datetime] = None

EmptyWriteList

Bases: DomainModelWriteList[EmptyWrite]

List of empties in the writing version.

Source code in examples/omni/data_classes/_empty.py
class EmptyWriteList(DomainModelWriteList[EmptyWrite]):
    """List of empties in the writing version."""

    _INSTANCE = EmptyWrite

Implementation1

Bases: SubInterface

This represents the reading version of implementation 1.

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 implementation 1.

required
data_record

The data record of the implementation 1 node.

required
main_value

The main value field.

required
sub_value

The sub value field.

required
value_1

The value 1 field.

required
value_2

The value 2 field.

required
Source code in examples/omni/data_classes/_implementation_1.py
class Implementation1(SubInterface):
    """This represents the reading version of implementation 1.

    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 implementation 1.
        data_record: The data record of the implementation 1 node.
        main_value: The main value field.
        sub_value: The sub value field.
        value_1: The value 1 field.
        value_2: The value 2 field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "Implementation1", "1")

    node_type: Union[dm.DirectRelationReference, None] = dm.DirectRelationReference(
        "sp_pygen_models", "Implementation1"
    )
    value_1: Optional[str] = Field(None, alias="value1")
    value_2: str = Field(alias="value2")

    def as_write(self) -> Implementation1Write:
        """Convert this read version of implementation 1 to the writing version."""
        return Implementation1Write.model_validate(as_write_args(self))

as_write()

Convert this read version of implementation 1 to the writing version.

Source code in examples/omni/data_classes/_implementation_1.py
def as_write(self) -> Implementation1Write:
    """Convert this read version of implementation 1 to the writing version."""
    return Implementation1Write.model_validate(as_write_args(self))

Implementation1GraphQL

Bases: GraphQLCore

This represents the reading version of implementation 1, 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 implementation 1.

required
data_record

The data record of the implementation 1 node.

required
main_value

The main value field.

required
sub_value

The sub value field.

required
value_1

The value 1 field.

required
value_2

The value 2 field.

required
Source code in examples/omni/data_classes/_implementation_1.py
class Implementation1GraphQL(GraphQLCore):
    """This represents the reading version of implementation 1, 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 implementation 1.
        data_record: The data record of the implementation 1 node.
        main_value: The main value field.
        sub_value: The sub value field.
        value_1: The value 1 field.
        value_2: The value 2 field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "Implementation1", "1")
    main_value: Optional[str] = Field(None, alias="mainValue")
    sub_value: Optional[str] = Field(None, alias="subValue")
    value_1: Optional[str] = Field(None, alias="value1")
    value_2: Optional[str] = Field(None, alias="value2")

    @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) -> Implementation1:
        """Convert this GraphQL format of implementation 1 to the reading format."""
        return Implementation1.model_validate(as_read_args(self))

    def as_write(self) -> Implementation1Write:
        """Convert this GraphQL format of implementation 1 to the writing format."""
        return Implementation1Write.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of implementation 1 to the reading format.

Source code in examples/omni/data_classes/_implementation_1.py
def as_read(self) -> Implementation1:
    """Convert this GraphQL format of implementation 1 to the reading format."""
    return Implementation1.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of implementation 1 to the writing format.

Source code in examples/omni/data_classes/_implementation_1.py
def as_write(self) -> Implementation1Write:
    """Convert this GraphQL format of implementation 1 to the writing format."""
    return Implementation1Write.model_validate(as_write_args(self))

Implementation1List

Bases: DomainModelList[Implementation1]

List of implementation 1 in the read version.

Source code in examples/omni/data_classes/_implementation_1.py
class Implementation1List(DomainModelList[Implementation1]):
    """List of implementation 1 in the read version."""

    _INSTANCE = Implementation1

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

as_write()

Convert these read versions of implementation 1 to the writing versions.

Source code in examples/omni/data_classes/_implementation_1.py
def as_write(self) -> Implementation1WriteList:
    """Convert these read versions of implementation 1 to the writing versions."""
    return Implementation1WriteList([node.as_write() for node in self.data])

Implementation1NonWriteable

Bases: SubInterface

This represents the reading version of implementation 1 non writeable.

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 implementation 1 non writeable.

required
data_record

The data record of the implementation 1 non writeable node.

required
connection_value

The connection value field.

required
main_value

The main value field.

required
sub_value

The sub value field.

required
value_1

The value 1 field.

required
Source code in examples/omni/data_classes/_implementation_1_non_writeable.py
class Implementation1NonWriteable(SubInterface):
    """This represents the reading version of implementation 1 non writeable.

    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 implementation 1 non writeable.
        data_record: The data record of the implementation 1 non writeable node.
        connection_value: The connection value field.
        main_value: The main value field.
        sub_value: The sub value field.
        value_1: The value 1 field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "Implementation1NonWriteable", "1")

    node_type: Union[dm.DirectRelationReference, None] = dm.DirectRelationReference(
        "sp_pygen_models", "Implementation1"
    )
    connection_value: Union[Implementation1, str, dm.NodeId, None] = Field(
        default=None, repr=False, alias="connectionValue"
    )
    value_1: Optional[str] = Field(None, alias="value1")

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

Implementation1NonWriteableGraphQL

Bases: GraphQLCore

This represents the reading version of implementation 1 non writeable, 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 implementation 1 non writeable.

required
data_record

The data record of the implementation 1 non writeable node.

required
connection_value

The connection value field.

required
main_value

The main value field.

required
sub_value

The sub value field.

required
value_1

The value 1 field.

required
Source code in examples/omni/data_classes/_implementation_1_non_writeable.py
class Implementation1NonWriteableGraphQL(GraphQLCore):
    """This represents the reading version of implementation 1 non writeable, 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 implementation 1 non writeable.
        data_record: The data record of the implementation 1 non writeable node.
        connection_value: The connection value field.
        main_value: The main value field.
        sub_value: The sub value field.
        value_1: The value 1 field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "Implementation1NonWriteable", "1")
    connection_value: Optional[Implementation1GraphQL] = Field(default=None, repr=False, alias="connectionValue")
    main_value: Optional[str] = Field(None, alias="mainValue")
    sub_value: Optional[str] = Field(None, alias="subValue")
    value_1: Optional[str] = Field(None, alias="value1")

    @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("connection_value", 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) -> Implementation1NonWriteable:
        """Convert this GraphQL format of implementation 1 non writeable to the reading format."""
        return Implementation1NonWriteable.model_validate(as_read_args(self))

as_read()

Convert this GraphQL format of implementation 1 non writeable to the reading format.

Source code in examples/omni/data_classes/_implementation_1_non_writeable.py
def as_read(self) -> Implementation1NonWriteable:
    """Convert this GraphQL format of implementation 1 non writeable to the reading format."""
    return Implementation1NonWriteable.model_validate(as_read_args(self))

Implementation1NonWriteableList

Bases: DomainModelList[Implementation1NonWriteable]

List of implementation 1 non writeables in the read version.

Source code in examples/omni/data_classes/_implementation_1_non_writeable.py
class Implementation1NonWriteableList(DomainModelList[Implementation1NonWriteable]):
    """List of implementation 1 non writeables in the read version."""

    _INSTANCE = Implementation1NonWriteable

Implementation1Write

Bases: SubInterfaceWrite

This represents the writing version of implementation 1.

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 implementation 1.

required
data_record

The data record of the implementation 1 node.

required
main_value

The main value field.

required
sub_value

The sub value field.

required
value_1

The value 1 field.

required
value_2

The value 2 field.

required
Source code in examples/omni/data_classes/_implementation_1.py
class Implementation1Write(SubInterfaceWrite):
    """This represents the writing version of implementation 1.

    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 implementation 1.
        data_record: The data record of the implementation 1 node.
        main_value: The main value field.
        sub_value: The sub value field.
        value_1: The value 1 field.
        value_2: The value 2 field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "main_value",
        "sub_value",
        "value_1",
        "value_2",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "Implementation1", "1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = dm.DirectRelationReference(
        "sp_pygen_models", "Implementation1"
    )
    value_1: Optional[str] = Field(None, alias="value1")
    value_2: str = Field(alias="value2")

Implementation1WriteList

Bases: DomainModelWriteList[Implementation1Write]

List of implementation 1 in the writing version.

Source code in examples/omni/data_classes/_implementation_1.py
class Implementation1WriteList(DomainModelWriteList[Implementation1Write]):
    """List of implementation 1 in the writing version."""

    _INSTANCE = Implementation1Write

Implementation2

Bases: SubInterface

This represents the reading version of implementation 2.

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 implementation 2.

required
data_record

The data record of the implementation 2 node.

required
main_value

The main value field.

required
sub_value

The sub value field.

required
Source code in examples/omni/data_classes/_implementation_2.py
class Implementation2(SubInterface):
    """This represents the reading version of implementation 2.

    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 implementation 2.
        data_record: The data record of the implementation 2 node.
        main_value: The main value field.
        sub_value: The sub value field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "Implementation2", "1")

    node_type: Union[dm.DirectRelationReference, None] = dm.DirectRelationReference(
        "sp_pygen_models", "Implementation2"
    )

    def as_write(self) -> Implementation2Write:
        """Convert this read version of implementation 2 to the writing version."""
        return Implementation2Write.model_validate(as_write_args(self))

as_write()

Convert this read version of implementation 2 to the writing version.

Source code in examples/omni/data_classes/_implementation_2.py
def as_write(self) -> Implementation2Write:
    """Convert this read version of implementation 2 to the writing version."""
    return Implementation2Write.model_validate(as_write_args(self))

Implementation2GraphQL

Bases: GraphQLCore

This represents the reading version of implementation 2, 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 implementation 2.

required
data_record

The data record of the implementation 2 node.

required
main_value

The main value field.

required
sub_value

The sub value field.

required
Source code in examples/omni/data_classes/_implementation_2.py
class Implementation2GraphQL(GraphQLCore):
    """This represents the reading version of implementation 2, 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 implementation 2.
        data_record: The data record of the implementation 2 node.
        main_value: The main value field.
        sub_value: The sub value field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "Implementation2", "1")
    main_value: Optional[str] = Field(None, alias="mainValue")
    sub_value: Optional[str] = Field(None, alias="subValue")

    @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) -> Implementation2:
        """Convert this GraphQL format of implementation 2 to the reading format."""
        return Implementation2.model_validate(as_read_args(self))

    def as_write(self) -> Implementation2Write:
        """Convert this GraphQL format of implementation 2 to the writing format."""
        return Implementation2Write.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of implementation 2 to the reading format.

Source code in examples/omni/data_classes/_implementation_2.py
def as_read(self) -> Implementation2:
    """Convert this GraphQL format of implementation 2 to the reading format."""
    return Implementation2.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of implementation 2 to the writing format.

Source code in examples/omni/data_classes/_implementation_2.py
def as_write(self) -> Implementation2Write:
    """Convert this GraphQL format of implementation 2 to the writing format."""
    return Implementation2Write.model_validate(as_write_args(self))

Implementation2List

Bases: DomainModelList[Implementation2]

List of implementation 2 in the read version.

Source code in examples/omni/data_classes/_implementation_2.py
class Implementation2List(DomainModelList[Implementation2]):
    """List of implementation 2 in the read version."""

    _INSTANCE = Implementation2

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

as_write()

Convert these read versions of implementation 2 to the writing versions.

Source code in examples/omni/data_classes/_implementation_2.py
def as_write(self) -> Implementation2WriteList:
    """Convert these read versions of implementation 2 to the writing versions."""
    return Implementation2WriteList([node.as_write() for node in self.data])

Implementation2Write

Bases: SubInterfaceWrite

This represents the writing version of implementation 2.

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 implementation 2.

required
data_record

The data record of the implementation 2 node.

required
main_value

The main value field.

required
sub_value

The sub value field.

required
Source code in examples/omni/data_classes/_implementation_2.py
class Implementation2Write(SubInterfaceWrite):
    """This represents the writing version of implementation 2.

    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 implementation 2.
        data_record: The data record of the implementation 2 node.
        main_value: The main value field.
        sub_value: The sub value field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "main_value",
        "sub_value",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "Implementation2", "1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = dm.DirectRelationReference(
        "sp_pygen_models", "Implementation2"
    )

Implementation2WriteList

Bases: DomainModelWriteList[Implementation2Write]

List of implementation 2 in the writing version.

Source code in examples/omni/data_classes/_implementation_2.py
class Implementation2WriteList(DomainModelWriteList[Implementation2Write]):
    """List of implementation 2 in the writing version."""

    _INSTANCE = Implementation2Write

MainInterface

Bases: DomainModel

This represents the reading version of main interface.

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 main interface.

required
data_record

The data record of the main interface node.

required
main_value

The main value field.

required
Source code in examples/omni/data_classes/_main_interface.py
class MainInterface(DomainModel):
    """This represents the reading version of main interface.

    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 main interface.
        data_record: The data record of the main interface node.
        main_value: The main value field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "MainInterface", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = None
    main_value: Optional[str] = Field(None, alias="mainValue")

    def as_write(self) -> MainInterfaceWrite:
        """Convert this read version of main interface to the writing version."""
        return MainInterfaceWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of main interface to the writing version.

Source code in examples/omni/data_classes/_main_interface.py
def as_write(self) -> MainInterfaceWrite:
    """Convert this read version of main interface to the writing version."""
    return MainInterfaceWrite.model_validate(as_write_args(self))

MainInterfaceGraphQL

Bases: GraphQLCore

This represents the reading version of main interface, 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 main interface.

required
data_record

The data record of the main interface node.

required
main_value

The main value field.

required
Source code in examples/omni/data_classes/_main_interface.py
class MainInterfaceGraphQL(GraphQLCore):
    """This represents the reading version of main interface, 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 main interface.
        data_record: The data record of the main interface node.
        main_value: The main value field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "MainInterface", "1")
    main_value: Optional[str] = Field(None, alias="mainValue")

    @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) -> MainInterface:
        """Convert this GraphQL format of main interface to the reading format."""
        return MainInterface.model_validate(as_read_args(self))

    def as_write(self) -> MainInterfaceWrite:
        """Convert this GraphQL format of main interface to the writing format."""
        return MainInterfaceWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of main interface to the reading format.

Source code in examples/omni/data_classes/_main_interface.py
def as_read(self) -> MainInterface:
    """Convert this GraphQL format of main interface to the reading format."""
    return MainInterface.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of main interface to the writing format.

Source code in examples/omni/data_classes/_main_interface.py
def as_write(self) -> MainInterfaceWrite:
    """Convert this GraphQL format of main interface to the writing format."""
    return MainInterfaceWrite.model_validate(as_write_args(self))

MainInterfaceList

Bases: DomainModelList[MainInterface]

List of main interfaces in the read version.

Source code in examples/omni/data_classes/_main_interface.py
class MainInterfaceList(DomainModelList[MainInterface]):
    """List of main interfaces in the read version."""

    _INSTANCE = MainInterface

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

as_write()

Convert these read versions of main interface to the writing versions.

Source code in examples/omni/data_classes/_main_interface.py
def as_write(self) -> MainInterfaceWriteList:
    """Convert these read versions of main interface to the writing versions."""
    return MainInterfaceWriteList([node.as_write() for node in self.data])

MainInterfaceWrite

Bases: DomainModelWrite

This represents the writing version of main interface.

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 main interface.

required
data_record

The data record of the main interface node.

required
main_value

The main value field.

required
Source code in examples/omni/data_classes/_main_interface.py
class MainInterfaceWrite(DomainModelWrite):
    """This represents the writing version of main interface.

    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 main interface.
        data_record: The data record of the main interface node.
        main_value: The main value field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = ("main_value",)

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "MainInterface", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    main_value: Optional[str] = Field(None, alias="mainValue")

MainInterfaceWriteList

Bases: DomainModelWriteList[MainInterfaceWrite]

List of main interfaces in the writing version.

Source code in examples/omni/data_classes/_main_interface.py
class MainInterfaceWriteList(DomainModelWriteList[MainInterfaceWrite]):
    """List of main interfaces in the writing version."""

    _INSTANCE = MainInterfaceWrite

PrimitiveNullable

Bases: DomainModel

This represents the reading version of primitive nullable.

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 primitive nullable.

required
data_record

The data record of the primitive nullable node.

required
boolean

The boolean field.

required
date

The date field.

required
float_32

The float 32 field.

required
float_64

The float 64 field.

required
int_32

The int 32 field.

required
int_64

The int 64 field.

required
json_

The json field.

required
text

The text field.

required
timestamp

The timestamp field.

required
Source code in examples/omni/data_classes/_primitive_nullable.py
class PrimitiveNullable(DomainModel):
    """This represents the reading version of primitive nullable.

    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 primitive nullable.
        data_record: The data record of the primitive nullable node.
        boolean: The boolean field.
        date: The date field.
        float_32: The float 32 field.
        float_64: The float 64 field.
        int_32: The int 32 field.
        int_64: The int 64 field.
        json_: The json field.
        text: The text field.
        timestamp: The timestamp field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "PrimitiveNullable", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = None
    boolean: Optional[bool] = None
    date: Optional[datetime.date] = None
    float_32: Optional[float] = Field(None, alias="float32")
    float_64: Optional[float] = Field(None, alias="float64")
    int_32: Optional[int] = Field(None, alias="int32")
    int_64: Optional[int] = Field(None, alias="int64")
    json_: Optional[dict] = Field(None, alias="json")
    text: Optional[str] = None
    timestamp: Optional[datetime.datetime] = None

    def as_write(self) -> PrimitiveNullableWrite:
        """Convert this read version of primitive nullable to the writing version."""
        return PrimitiveNullableWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of primitive nullable to the writing version.

Source code in examples/omni/data_classes/_primitive_nullable.py
def as_write(self) -> PrimitiveNullableWrite:
    """Convert this read version of primitive nullable to the writing version."""
    return PrimitiveNullableWrite.model_validate(as_write_args(self))

PrimitiveNullableGraphQL

Bases: GraphQLCore

This represents the reading version of primitive nullable, 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 primitive nullable.

required
data_record

The data record of the primitive nullable node.

required
boolean

The boolean field.

required
date

The date field.

required
float_32

The float 32 field.

required
float_64

The float 64 field.

required
int_32

The int 32 field.

required
int_64

The int 64 field.

required
json_

The json field.

required
text

The text field.

required
timestamp

The timestamp field.

required
Source code in examples/omni/data_classes/_primitive_nullable.py
class PrimitiveNullableGraphQL(GraphQLCore):
    """This represents the reading version of primitive nullable, 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 primitive nullable.
        data_record: The data record of the primitive nullable node.
        boolean: The boolean field.
        date: The date field.
        float_32: The float 32 field.
        float_64: The float 64 field.
        int_32: The int 32 field.
        int_64: The int 64 field.
        json_: The json field.
        text: The text field.
        timestamp: The timestamp field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "PrimitiveNullable", "1")
    boolean: Optional[bool] = None
    date: Optional[datetime.date] = None
    float_32: Optional[float] = Field(None, alias="float32")
    float_64: Optional[float] = Field(None, alias="float64")
    int_32: Optional[int] = Field(None, alias="int32")
    int_64: Optional[int] = Field(None, alias="int64")
    json_: Optional[dict] = Field(None, alias="json")
    text: Optional[str] = None
    timestamp: Optional[datetime.datetime] = 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) -> PrimitiveNullable:
        """Convert this GraphQL format of primitive nullable to the reading format."""
        return PrimitiveNullable.model_validate(as_read_args(self))

    def as_write(self) -> PrimitiveNullableWrite:
        """Convert this GraphQL format of primitive nullable to the writing format."""
        return PrimitiveNullableWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of primitive nullable to the reading format.

Source code in examples/omni/data_classes/_primitive_nullable.py
def as_read(self) -> PrimitiveNullable:
    """Convert this GraphQL format of primitive nullable to the reading format."""
    return PrimitiveNullable.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of primitive nullable to the writing format.

Source code in examples/omni/data_classes/_primitive_nullable.py
def as_write(self) -> PrimitiveNullableWrite:
    """Convert this GraphQL format of primitive nullable to the writing format."""
    return PrimitiveNullableWrite.model_validate(as_write_args(self))

PrimitiveNullableList

Bases: DomainModelList[PrimitiveNullable]

List of primitive nullables in the read version.

Source code in examples/omni/data_classes/_primitive_nullable.py
class PrimitiveNullableList(DomainModelList[PrimitiveNullable]):
    """List of primitive nullables in the read version."""

    _INSTANCE = PrimitiveNullable

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

as_write()

Convert these read versions of primitive nullable to the writing versions.

Source code in examples/omni/data_classes/_primitive_nullable.py
def as_write(self) -> PrimitiveNullableWriteList:
    """Convert these read versions of primitive nullable to the writing versions."""
    return PrimitiveNullableWriteList([node.as_write() for node in self.data])

PrimitiveNullableListed

Bases: DomainModel

This represents the reading version of primitive nullable listed.

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 primitive nullable listed.

required
data_record

The data record of the primitive nullable listed node.

required
boolean

The boolean field.

required
date

The date field.

required
float_32

The float 32 field.

required
float_64

The float 64 field.

required
int_32

The int 32 field.

required
int_64

The int 64 field.

required
json_

The json field.

required
text

The text field.

required
timestamp

The timestamp field.

required
Source code in examples/omni/data_classes/_primitive_nullable_listed.py
class PrimitiveNullableListed(DomainModel):
    """This represents the reading version of primitive nullable listed.

    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 primitive nullable listed.
        data_record: The data record of the primitive nullable listed node.
        boolean: The boolean field.
        date: The date field.
        float_32: The float 32 field.
        float_64: The float 64 field.
        int_32: The int 32 field.
        int_64: The int 64 field.
        json_: The json field.
        text: The text field.
        timestamp: The timestamp field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "PrimitiveNullableListed", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = None
    boolean: Optional[list[bool]] = None
    date: Optional[list[datetime.date]] = None
    float_32: Optional[list[float]] = Field(None, alias="float32")
    float_64: Optional[list[float]] = Field(None, alias="float64")
    int_32: Optional[list[int]] = Field(None, alias="int32")
    int_64: Optional[list[int]] = Field(None, alias="int64")
    json_: Optional[list[dict]] = Field(None, alias="json")
    text: Optional[list[str]] = None
    timestamp: Optional[list[datetime.datetime]] = None

    def as_write(self) -> PrimitiveNullableListedWrite:
        """Convert this read version of primitive nullable listed to the writing version."""
        return PrimitiveNullableListedWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of primitive nullable listed to the writing version.

Source code in examples/omni/data_classes/_primitive_nullable_listed.py
def as_write(self) -> PrimitiveNullableListedWrite:
    """Convert this read version of primitive nullable listed to the writing version."""
    return PrimitiveNullableListedWrite.model_validate(as_write_args(self))

PrimitiveNullableListedGraphQL

Bases: GraphQLCore

This represents the reading version of primitive nullable listed, 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 primitive nullable listed.

required
data_record

The data record of the primitive nullable listed node.

required
boolean

The boolean field.

required
date

The date field.

required
float_32

The float 32 field.

required
float_64

The float 64 field.

required
int_32

The int 32 field.

required
int_64

The int 64 field.

required
json_

The json field.

required
text

The text field.

required
timestamp

The timestamp field.

required
Source code in examples/omni/data_classes/_primitive_nullable_listed.py
class PrimitiveNullableListedGraphQL(GraphQLCore):
    """This represents the reading version of primitive nullable listed, 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 primitive nullable listed.
        data_record: The data record of the primitive nullable listed node.
        boolean: The boolean field.
        date: The date field.
        float_32: The float 32 field.
        float_64: The float 64 field.
        int_32: The int 32 field.
        int_64: The int 64 field.
        json_: The json field.
        text: The text field.
        timestamp: The timestamp field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "PrimitiveNullableListed", "1")
    boolean: Optional[list[bool]] = None
    date: Optional[list[datetime.date]] = None
    float_32: Optional[list[float]] = Field(None, alias="float32")
    float_64: Optional[list[float]] = Field(None, alias="float64")
    int_32: Optional[list[int]] = Field(None, alias="int32")
    int_64: Optional[list[int]] = Field(None, alias="int64")
    json_: Optional[list[dict]] = Field(None, alias="json")
    text: Optional[list[str]] = None
    timestamp: Optional[list[datetime.datetime]] = 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) -> PrimitiveNullableListed:
        """Convert this GraphQL format of primitive nullable listed to the reading format."""
        return PrimitiveNullableListed.model_validate(as_read_args(self))

    def as_write(self) -> PrimitiveNullableListedWrite:
        """Convert this GraphQL format of primitive nullable listed to the writing format."""
        return PrimitiveNullableListedWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of primitive nullable listed to the reading format.

Source code in examples/omni/data_classes/_primitive_nullable_listed.py
def as_read(self) -> PrimitiveNullableListed:
    """Convert this GraphQL format of primitive nullable listed to the reading format."""
    return PrimitiveNullableListed.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of primitive nullable listed to the writing format.

Source code in examples/omni/data_classes/_primitive_nullable_listed.py
def as_write(self) -> PrimitiveNullableListedWrite:
    """Convert this GraphQL format of primitive nullable listed to the writing format."""
    return PrimitiveNullableListedWrite.model_validate(as_write_args(self))

PrimitiveNullableListedList

Bases: DomainModelList[PrimitiveNullableListed]

List of primitive nullable listeds in the read version.

Source code in examples/omni/data_classes/_primitive_nullable_listed.py
class PrimitiveNullableListedList(DomainModelList[PrimitiveNullableListed]):
    """List of primitive nullable listeds in the read version."""

    _INSTANCE = PrimitiveNullableListed

    def as_write(self) -> PrimitiveNullableListedWriteList:
        """Convert these read versions of primitive nullable listed to the writing versions."""
        return PrimitiveNullableListedWriteList([node.as_write() for node in self.data])

as_write()

Convert these read versions of primitive nullable listed to the writing versions.

Source code in examples/omni/data_classes/_primitive_nullable_listed.py
def as_write(self) -> PrimitiveNullableListedWriteList:
    """Convert these read versions of primitive nullable listed to the writing versions."""
    return PrimitiveNullableListedWriteList([node.as_write() for node in self.data])

PrimitiveNullableListedWrite

Bases: DomainModelWrite

This represents the writing version of primitive nullable listed.

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 primitive nullable listed.

required
data_record

The data record of the primitive nullable listed node.

required
boolean

The boolean field.

required
date

The date field.

required
float_32

The float 32 field.

required
float_64

The float 64 field.

required
int_32

The int 32 field.

required
int_64

The int 64 field.

required
json_

The json field.

required
text

The text field.

required
timestamp

The timestamp field.

required
Source code in examples/omni/data_classes/_primitive_nullable_listed.py
class PrimitiveNullableListedWrite(DomainModelWrite):
    """This represents the writing version of primitive nullable listed.

    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 primitive nullable listed.
        data_record: The data record of the primitive nullable listed node.
        boolean: The boolean field.
        date: The date field.
        float_32: The float 32 field.
        float_64: The float 64 field.
        int_32: The int 32 field.
        int_64: The int 64 field.
        json_: The json field.
        text: The text field.
        timestamp: The timestamp field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "boolean",
        "date",
        "float_32",
        "float_64",
        "int_32",
        "int_64",
        "json_",
        "text",
        "timestamp",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "PrimitiveNullableListed", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    boolean: Optional[list[bool]] = None
    date: Optional[list[datetime.date]] = None
    float_32: Optional[list[float]] = Field(None, alias="float32")
    float_64: Optional[list[float]] = Field(None, alias="float64")
    int_32: Optional[list[int]] = Field(None, alias="int32")
    int_64: Optional[list[int]] = Field(None, alias="int64")
    json_: Optional[list[dict]] = Field(None, alias="json")
    text: Optional[list[str]] = None
    timestamp: Optional[list[datetime.datetime]] = None

PrimitiveNullableListedWriteList

Bases: DomainModelWriteList[PrimitiveNullableListedWrite]

List of primitive nullable listeds in the writing version.

Source code in examples/omni/data_classes/_primitive_nullable_listed.py
class PrimitiveNullableListedWriteList(DomainModelWriteList[PrimitiveNullableListedWrite]):
    """List of primitive nullable listeds in the writing version."""

    _INSTANCE = PrimitiveNullableListedWrite

PrimitiveNullableWrite

Bases: DomainModelWrite

This represents the writing version of primitive nullable.

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 primitive nullable.

required
data_record

The data record of the primitive nullable node.

required
boolean

The boolean field.

required
date

The date field.

required
float_32

The float 32 field.

required
float_64

The float 64 field.

required
int_32

The int 32 field.

required
int_64

The int 64 field.

required
json_

The json field.

required
text

The text field.

required
timestamp

The timestamp field.

required
Source code in examples/omni/data_classes/_primitive_nullable.py
class PrimitiveNullableWrite(DomainModelWrite):
    """This represents the writing version of primitive nullable.

    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 primitive nullable.
        data_record: The data record of the primitive nullable node.
        boolean: The boolean field.
        date: The date field.
        float_32: The float 32 field.
        float_64: The float 64 field.
        int_32: The int 32 field.
        int_64: The int 64 field.
        json_: The json field.
        text: The text field.
        timestamp: The timestamp field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "boolean",
        "date",
        "float_32",
        "float_64",
        "int_32",
        "int_64",
        "json_",
        "text",
        "timestamp",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "PrimitiveNullable", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    boolean: Optional[bool] = None
    date: Optional[datetime.date] = None
    float_32: Optional[float] = Field(None, alias="float32")
    float_64: Optional[float] = Field(None, alias="float64")
    int_32: Optional[int] = Field(None, alias="int32")
    int_64: Optional[int] = Field(None, alias="int64")
    json_: Optional[dict] = Field(None, alias="json")
    text: Optional[str] = None
    timestamp: Optional[datetime.datetime] = None

PrimitiveNullableWriteList

Bases: DomainModelWriteList[PrimitiveNullableWrite]

List of primitive nullables in the writing version.

Source code in examples/omni/data_classes/_primitive_nullable.py
class PrimitiveNullableWriteList(DomainModelWriteList[PrimitiveNullableWrite]):
    """List of primitive nullables in the writing version."""

    _INSTANCE = PrimitiveNullableWrite

PrimitiveRequired

Bases: DomainModel

This represents the reading version of primitive required.

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 primitive required.

required
data_record

The data record of the primitive required node.

required
boolean

The boolean field.

required
date

The date field.

required
float_32

The float 32 field.

required
float_64

The float 64 field.

required
int_32

The int 32 field.

required
int_64

The int 64 field.

required
json_

The json field.

required
text

The text field.

required
timestamp

The timestamp field.

required
Source code in examples/omni/data_classes/_primitive_required.py
class PrimitiveRequired(DomainModel):
    """This represents the reading version of primitive required.

    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 primitive required.
        data_record: The data record of the primitive required node.
        boolean: The boolean field.
        date: The date field.
        float_32: The float 32 field.
        float_64: The float 64 field.
        int_32: The int 32 field.
        int_64: The int 64 field.
        json_: The json field.
        text: The text field.
        timestamp: The timestamp field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "PrimitiveRequired", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = None
    boolean: bool
    date: datetime.date
    float_32: float = Field(alias="float32")
    float_64: float = Field(alias="float64")
    int_32: int = Field(alias="int32")
    int_64: int = Field(alias="int64")
    json_: dict = Field(alias="json")
    text: str
    timestamp: datetime.datetime

    def as_write(self) -> PrimitiveRequiredWrite:
        """Convert this read version of primitive required to the writing version."""
        return PrimitiveRequiredWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of primitive required to the writing version.

Source code in examples/omni/data_classes/_primitive_required.py
def as_write(self) -> PrimitiveRequiredWrite:
    """Convert this read version of primitive required to the writing version."""
    return PrimitiveRequiredWrite.model_validate(as_write_args(self))

PrimitiveRequiredGraphQL

Bases: GraphQLCore

This represents the reading version of primitive required, 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 primitive required.

required
data_record

The data record of the primitive required node.

required
boolean

The boolean field.

required
date

The date field.

required
float_32

The float 32 field.

required
float_64

The float 64 field.

required
int_32

The int 32 field.

required
int_64

The int 64 field.

required
json_

The json field.

required
text

The text field.

required
timestamp

The timestamp field.

required
Source code in examples/omni/data_classes/_primitive_required.py
class PrimitiveRequiredGraphQL(GraphQLCore):
    """This represents the reading version of primitive required, 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 primitive required.
        data_record: The data record of the primitive required node.
        boolean: The boolean field.
        date: The date field.
        float_32: The float 32 field.
        float_64: The float 64 field.
        int_32: The int 32 field.
        int_64: The int 64 field.
        json_: The json field.
        text: The text field.
        timestamp: The timestamp field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "PrimitiveRequired", "1")
    boolean: Optional[bool] = None
    date: Optional[datetime.date] = None
    float_32: Optional[float] = Field(None, alias="float32")
    float_64: Optional[float] = Field(None, alias="float64")
    int_32: Optional[int] = Field(None, alias="int32")
    int_64: Optional[int] = Field(None, alias="int64")
    json_: Optional[dict] = Field(None, alias="json")
    text: Optional[str] = None
    timestamp: Optional[datetime.datetime] = 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) -> PrimitiveRequired:
        """Convert this GraphQL format of primitive required to the reading format."""
        return PrimitiveRequired.model_validate(as_read_args(self))

    def as_write(self) -> PrimitiveRequiredWrite:
        """Convert this GraphQL format of primitive required to the writing format."""
        return PrimitiveRequiredWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of primitive required to the reading format.

Source code in examples/omni/data_classes/_primitive_required.py
def as_read(self) -> PrimitiveRequired:
    """Convert this GraphQL format of primitive required to the reading format."""
    return PrimitiveRequired.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of primitive required to the writing format.

Source code in examples/omni/data_classes/_primitive_required.py
def as_write(self) -> PrimitiveRequiredWrite:
    """Convert this GraphQL format of primitive required to the writing format."""
    return PrimitiveRequiredWrite.model_validate(as_write_args(self))

PrimitiveRequiredList

Bases: DomainModelList[PrimitiveRequired]

List of primitive requireds in the read version.

Source code in examples/omni/data_classes/_primitive_required.py
class PrimitiveRequiredList(DomainModelList[PrimitiveRequired]):
    """List of primitive requireds in the read version."""

    _INSTANCE = PrimitiveRequired

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

as_write()

Convert these read versions of primitive required to the writing versions.

Source code in examples/omni/data_classes/_primitive_required.py
def as_write(self) -> PrimitiveRequiredWriteList:
    """Convert these read versions of primitive required to the writing versions."""
    return PrimitiveRequiredWriteList([node.as_write() for node in self.data])

PrimitiveRequiredListed

Bases: DomainModel

This represents the reading version of primitive required listed.

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 primitive required listed.

required
data_record

The data record of the primitive required listed node.

required
boolean

The boolean field.

required
date

The date field.

required
float_32

The float 32 field.

required
float_64

The float 64 field.

required
int_32

The int 32 field.

required
int_64

The int 64 field.

required
json_

The json field.

required
text

The text field.

required
timestamp

The timestamp field.

required
Source code in examples/omni/data_classes/_primitive_required_listed.py
class PrimitiveRequiredListed(DomainModel):
    """This represents the reading version of primitive required listed.

    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 primitive required listed.
        data_record: The data record of the primitive required listed node.
        boolean: The boolean field.
        date: The date field.
        float_32: The float 32 field.
        float_64: The float 64 field.
        int_32: The int 32 field.
        int_64: The int 64 field.
        json_: The json field.
        text: The text field.
        timestamp: The timestamp field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "PrimitiveRequiredListed", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = None
    boolean: list[bool]
    date: list[datetime.date]
    float_32: list[float] = Field(alias="float32")
    float_64: list[float] = Field(alias="float64")
    int_32: list[int] = Field(alias="int32")
    int_64: list[int] = Field(alias="int64")
    json_: list[dict] = Field(alias="json")
    text: list[str]
    timestamp: list[datetime.datetime]

    def as_write(self) -> PrimitiveRequiredListedWrite:
        """Convert this read version of primitive required listed to the writing version."""
        return PrimitiveRequiredListedWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of primitive required listed to the writing version.

Source code in examples/omni/data_classes/_primitive_required_listed.py
def as_write(self) -> PrimitiveRequiredListedWrite:
    """Convert this read version of primitive required listed to the writing version."""
    return PrimitiveRequiredListedWrite.model_validate(as_write_args(self))

PrimitiveRequiredListedGraphQL

Bases: GraphQLCore

This represents the reading version of primitive required listed, 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 primitive required listed.

required
data_record

The data record of the primitive required listed node.

required
boolean

The boolean field.

required
date

The date field.

required
float_32

The float 32 field.

required
float_64

The float 64 field.

required
int_32

The int 32 field.

required
int_64

The int 64 field.

required
json_

The json field.

required
text

The text field.

required
timestamp

The timestamp field.

required
Source code in examples/omni/data_classes/_primitive_required_listed.py
class PrimitiveRequiredListedGraphQL(GraphQLCore):
    """This represents the reading version of primitive required listed, 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 primitive required listed.
        data_record: The data record of the primitive required listed node.
        boolean: The boolean field.
        date: The date field.
        float_32: The float 32 field.
        float_64: The float 64 field.
        int_32: The int 32 field.
        int_64: The int 64 field.
        json_: The json field.
        text: The text field.
        timestamp: The timestamp field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "PrimitiveRequiredListed", "1")
    boolean: Optional[list[bool]] = None
    date: Optional[list[datetime.date]] = None
    float_32: Optional[list[float]] = Field(None, alias="float32")
    float_64: Optional[list[float]] = Field(None, alias="float64")
    int_32: Optional[list[int]] = Field(None, alias="int32")
    int_64: Optional[list[int]] = Field(None, alias="int64")
    json_: Optional[list[dict]] = Field(None, alias="json")
    text: Optional[list[str]] = None
    timestamp: Optional[list[datetime.datetime]] = 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) -> PrimitiveRequiredListed:
        """Convert this GraphQL format of primitive required listed to the reading format."""
        return PrimitiveRequiredListed.model_validate(as_read_args(self))

    def as_write(self) -> PrimitiveRequiredListedWrite:
        """Convert this GraphQL format of primitive required listed to the writing format."""
        return PrimitiveRequiredListedWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of primitive required listed to the reading format.

Source code in examples/omni/data_classes/_primitive_required_listed.py
def as_read(self) -> PrimitiveRequiredListed:
    """Convert this GraphQL format of primitive required listed to the reading format."""
    return PrimitiveRequiredListed.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of primitive required listed to the writing format.

Source code in examples/omni/data_classes/_primitive_required_listed.py
def as_write(self) -> PrimitiveRequiredListedWrite:
    """Convert this GraphQL format of primitive required listed to the writing format."""
    return PrimitiveRequiredListedWrite.model_validate(as_write_args(self))

PrimitiveRequiredListedList

Bases: DomainModelList[PrimitiveRequiredListed]

List of primitive required listeds in the read version.

Source code in examples/omni/data_classes/_primitive_required_listed.py
class PrimitiveRequiredListedList(DomainModelList[PrimitiveRequiredListed]):
    """List of primitive required listeds in the read version."""

    _INSTANCE = PrimitiveRequiredListed

    def as_write(self) -> PrimitiveRequiredListedWriteList:
        """Convert these read versions of primitive required listed to the writing versions."""
        return PrimitiveRequiredListedWriteList([node.as_write() for node in self.data])

as_write()

Convert these read versions of primitive required listed to the writing versions.

Source code in examples/omni/data_classes/_primitive_required_listed.py
def as_write(self) -> PrimitiveRequiredListedWriteList:
    """Convert these read versions of primitive required listed to the writing versions."""
    return PrimitiveRequiredListedWriteList([node.as_write() for node in self.data])

PrimitiveRequiredListedWrite

Bases: DomainModelWrite

This represents the writing version of primitive required listed.

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 primitive required listed.

required
data_record

The data record of the primitive required listed node.

required
boolean

The boolean field.

required
date

The date field.

required
float_32

The float 32 field.

required
float_64

The float 64 field.

required
int_32

The int 32 field.

required
int_64

The int 64 field.

required
json_

The json field.

required
text

The text field.

required
timestamp

The timestamp field.

required
Source code in examples/omni/data_classes/_primitive_required_listed.py
class PrimitiveRequiredListedWrite(DomainModelWrite):
    """This represents the writing version of primitive required listed.

    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 primitive required listed.
        data_record: The data record of the primitive required listed node.
        boolean: The boolean field.
        date: The date field.
        float_32: The float 32 field.
        float_64: The float 64 field.
        int_32: The int 32 field.
        int_64: The int 64 field.
        json_: The json field.
        text: The text field.
        timestamp: The timestamp field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "boolean",
        "date",
        "float_32",
        "float_64",
        "int_32",
        "int_64",
        "json_",
        "text",
        "timestamp",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "PrimitiveRequiredListed", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    boolean: list[bool]
    date: list[datetime.date]
    float_32: list[float] = Field(alias="float32")
    float_64: list[float] = Field(alias="float64")
    int_32: list[int] = Field(alias="int32")
    int_64: list[int] = Field(alias="int64")
    json_: list[dict] = Field(alias="json")
    text: list[str]
    timestamp: list[datetime.datetime]

PrimitiveRequiredListedWriteList

Bases: DomainModelWriteList[PrimitiveRequiredListedWrite]

List of primitive required listeds in the writing version.

Source code in examples/omni/data_classes/_primitive_required_listed.py
class PrimitiveRequiredListedWriteList(DomainModelWriteList[PrimitiveRequiredListedWrite]):
    """List of primitive required listeds in the writing version."""

    _INSTANCE = PrimitiveRequiredListedWrite

PrimitiveRequiredWrite

Bases: DomainModelWrite

This represents the writing version of primitive required.

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 primitive required.

required
data_record

The data record of the primitive required node.

required
boolean

The boolean field.

required
date

The date field.

required
float_32

The float 32 field.

required
float_64

The float 64 field.

required
int_32

The int 32 field.

required
int_64

The int 64 field.

required
json_

The json field.

required
text

The text field.

required
timestamp

The timestamp field.

required
Source code in examples/omni/data_classes/_primitive_required.py
class PrimitiveRequiredWrite(DomainModelWrite):
    """This represents the writing version of primitive required.

    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 primitive required.
        data_record: The data record of the primitive required node.
        boolean: The boolean field.
        date: The date field.
        float_32: The float 32 field.
        float_64: The float 64 field.
        int_32: The int 32 field.
        int_64: The int 64 field.
        json_: The json field.
        text: The text field.
        timestamp: The timestamp field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "boolean",
        "date",
        "float_32",
        "float_64",
        "int_32",
        "int_64",
        "json_",
        "text",
        "timestamp",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "PrimitiveRequired", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    boolean: bool
    date: datetime.date
    float_32: float = Field(alias="float32")
    float_64: float = Field(alias="float64")
    int_32: int = Field(alias="int32")
    int_64: int = Field(alias="int64")
    json_: dict = Field(alias="json")
    text: str
    timestamp: datetime.datetime

PrimitiveRequiredWriteList

Bases: DomainModelWriteList[PrimitiveRequiredWrite]

List of primitive requireds in the writing version.

Source code in examples/omni/data_classes/_primitive_required.py
class PrimitiveRequiredWriteList(DomainModelWriteList[PrimitiveRequiredWrite]):
    """List of primitive requireds in the writing version."""

    _INSTANCE = PrimitiveRequiredWrite

PrimitiveWithDefaults

Bases: DomainModel

This represents the reading version of primitive with default.

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 primitive with default.

required
data_record

The data record of the primitive with default node.

required
auto_increment_int_32

The auto increment int 32 field.

required
default_boolean

The default boolean field.

required
default_float_32

The default float 32 field.

required
default_object

The default object field.

required
default_string

The default string field.

required
Source code in examples/omni/data_classes/_primitive_with_defaults.py
class PrimitiveWithDefaults(DomainModel):
    """This represents the reading version of primitive with default.

    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 primitive with default.
        data_record: The data record of the primitive with default node.
        auto_increment_int_32: The auto increment int 32 field.
        default_boolean: The default boolean field.
        default_float_32: The default float 32 field.
        default_object: The default object field.
        default_string: The default string field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "PrimitiveWithDefaults", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, None] = None
    auto_increment_int_32: int = Field(alias="autoIncrementInt32")
    default_boolean: Optional[bool] = Field(None, alias="defaultBoolean")
    default_float_32: Optional[float] = Field(None, alias="defaultFloat32")
    default_object: Optional[dict] = Field(None, alias="defaultObject")
    default_string: Optional[str] = Field(None, alias="defaultString")

    def as_write(self) -> PrimitiveWithDefaultsWrite:
        """Convert this read version of primitive with default to the writing version."""
        return PrimitiveWithDefaultsWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of primitive with default to the writing version.

Source code in examples/omni/data_classes/_primitive_with_defaults.py
def as_write(self) -> PrimitiveWithDefaultsWrite:
    """Convert this read version of primitive with default to the writing version."""
    return PrimitiveWithDefaultsWrite.model_validate(as_write_args(self))

PrimitiveWithDefaultsGraphQL

Bases: GraphQLCore

This represents the reading version of primitive with default, 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 primitive with default.

required
data_record

The data record of the primitive with default node.

required
auto_increment_int_32

The auto increment int 32 field.

required
default_boolean

The default boolean field.

required
default_float_32

The default float 32 field.

required
default_object

The default object field.

required
default_string

The default string field.

required
Source code in examples/omni/data_classes/_primitive_with_defaults.py
class PrimitiveWithDefaultsGraphQL(GraphQLCore):
    """This represents the reading version of primitive with default, 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 primitive with default.
        data_record: The data record of the primitive with default node.
        auto_increment_int_32: The auto increment int 32 field.
        default_boolean: The default boolean field.
        default_float_32: The default float 32 field.
        default_object: The default object field.
        default_string: The default string field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "PrimitiveWithDefaults", "1")
    auto_increment_int_32: Optional[int] = Field(None, alias="autoIncrementInt32")
    default_boolean: Optional[bool] = Field(None, alias="defaultBoolean")
    default_float_32: Optional[float] = Field(None, alias="defaultFloat32")
    default_object: Optional[dict] = Field(None, alias="defaultObject")
    default_string: Optional[str] = Field(None, alias="defaultString")

    @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) -> PrimitiveWithDefaults:
        """Convert this GraphQL format of primitive with default to the reading format."""
        return PrimitiveWithDefaults.model_validate(as_read_args(self))

    def as_write(self) -> PrimitiveWithDefaultsWrite:
        """Convert this GraphQL format of primitive with default to the writing format."""
        return PrimitiveWithDefaultsWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of primitive with default to the reading format.

Source code in examples/omni/data_classes/_primitive_with_defaults.py
def as_read(self) -> PrimitiveWithDefaults:
    """Convert this GraphQL format of primitive with default to the reading format."""
    return PrimitiveWithDefaults.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of primitive with default to the writing format.

Source code in examples/omni/data_classes/_primitive_with_defaults.py
def as_write(self) -> PrimitiveWithDefaultsWrite:
    """Convert this GraphQL format of primitive with default to the writing format."""
    return PrimitiveWithDefaultsWrite.model_validate(as_write_args(self))

PrimitiveWithDefaultsList

Bases: DomainModelList[PrimitiveWithDefaults]

List of primitive with defaults in the read version.

Source code in examples/omni/data_classes/_primitive_with_defaults.py
class PrimitiveWithDefaultsList(DomainModelList[PrimitiveWithDefaults]):
    """List of primitive with defaults in the read version."""

    _INSTANCE = PrimitiveWithDefaults

    def as_write(self) -> PrimitiveWithDefaultsWriteList:
        """Convert these read versions of primitive with default to the writing versions."""
        return PrimitiveWithDefaultsWriteList([node.as_write() for node in self.data])

as_write()

Convert these read versions of primitive with default to the writing versions.

Source code in examples/omni/data_classes/_primitive_with_defaults.py
def as_write(self) -> PrimitiveWithDefaultsWriteList:
    """Convert these read versions of primitive with default to the writing versions."""
    return PrimitiveWithDefaultsWriteList([node.as_write() for node in self.data])

PrimitiveWithDefaultsWrite

Bases: DomainModelWrite

This represents the writing version of primitive with default.

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 primitive with default.

required
data_record

The data record of the primitive with default node.

required
auto_increment_int_32

The auto increment int 32 field.

required
default_boolean

The default boolean field.

required
default_float_32

The default float 32 field.

required
default_object

The default object field.

required
default_string

The default string field.

required
Source code in examples/omni/data_classes/_primitive_with_defaults.py
class PrimitiveWithDefaultsWrite(DomainModelWrite):
    """This represents the writing version of primitive with default.

    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 primitive with default.
        data_record: The data record of the primitive with default node.
        auto_increment_int_32: The auto increment int 32 field.
        default_boolean: The default boolean field.
        default_float_32: The default float 32 field.
        default_object: The default object field.
        default_string: The default string field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "auto_increment_int_32",
        "default_boolean",
        "default_float_32",
        "default_object",
        "default_string",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "PrimitiveWithDefaults", "1")

    space: str = DEFAULT_INSTANCE_SPACE
    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    auto_increment_int_32: int = Field(alias="autoIncrementInt32")
    default_boolean: Optional[bool] = Field(True, alias="defaultBoolean")
    default_float_32: Optional[float] = Field(0.42, alias="defaultFloat32")
    default_object: Optional[dict] = Field({"foo": "bar"}, alias="defaultObject")
    default_string: Optional[str] = Field("my default text", alias="defaultString")

PrimitiveWithDefaultsWriteList

Bases: DomainModelWriteList[PrimitiveWithDefaultsWrite]

List of primitive with defaults in the writing version.

Source code in examples/omni/data_classes/_primitive_with_defaults.py
class PrimitiveWithDefaultsWriteList(DomainModelWriteList[PrimitiveWithDefaultsWrite]):
    """List of primitive with defaults in the writing version."""

    _INSTANCE = PrimitiveWithDefaultsWrite

SubInterface

Bases: MainInterface

This represents the reading version of sub interface.

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 sub interface.

required
data_record

The data record of the sub interface node.

required
main_value

The main value field.

required
sub_value

The sub value field.

required
Source code in examples/omni/data_classes/_sub_interface.py
class SubInterface(MainInterface):
    """This represents the reading version of sub interface.

    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 sub interface.
        data_record: The data record of the sub interface node.
        main_value: The main value field.
        sub_value: The sub value field.
    """

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "SubInterface", "1")

    node_type: Union[dm.DirectRelationReference, None] = None
    sub_value: Optional[str] = Field(None, alias="subValue")

    def as_write(self) -> SubInterfaceWrite:
        """Convert this read version of sub interface to the writing version."""
        return SubInterfaceWrite.model_validate(as_write_args(self))

as_write()

Convert this read version of sub interface to the writing version.

Source code in examples/omni/data_classes/_sub_interface.py
def as_write(self) -> SubInterfaceWrite:
    """Convert this read version of sub interface to the writing version."""
    return SubInterfaceWrite.model_validate(as_write_args(self))

SubInterfaceGraphQL

Bases: GraphQLCore

This represents the reading version of sub interface, 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 sub interface.

required
data_record

The data record of the sub interface node.

required
main_value

The main value field.

required
sub_value

The sub value field.

required
Source code in examples/omni/data_classes/_sub_interface.py
class SubInterfaceGraphQL(GraphQLCore):
    """This represents the reading version of sub interface, 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 sub interface.
        data_record: The data record of the sub interface node.
        main_value: The main value field.
        sub_value: The sub value field.
    """

    view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "SubInterface", "1")
    main_value: Optional[str] = Field(None, alias="mainValue")
    sub_value: Optional[str] = Field(None, alias="subValue")

    @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) -> SubInterface:
        """Convert this GraphQL format of sub interface to the reading format."""
        return SubInterface.model_validate(as_read_args(self))

    def as_write(self) -> SubInterfaceWrite:
        """Convert this GraphQL format of sub interface to the writing format."""
        return SubInterfaceWrite.model_validate(as_write_args(self))

as_read()

Convert this GraphQL format of sub interface to the reading format.

Source code in examples/omni/data_classes/_sub_interface.py
def as_read(self) -> SubInterface:
    """Convert this GraphQL format of sub interface to the reading format."""
    return SubInterface.model_validate(as_read_args(self))

as_write()

Convert this GraphQL format of sub interface to the writing format.

Source code in examples/omni/data_classes/_sub_interface.py
def as_write(self) -> SubInterfaceWrite:
    """Convert this GraphQL format of sub interface to the writing format."""
    return SubInterfaceWrite.model_validate(as_write_args(self))

SubInterfaceList

Bases: DomainModelList[SubInterface]

List of sub interfaces in the read version.

Source code in examples/omni/data_classes/_sub_interface.py
class SubInterfaceList(DomainModelList[SubInterface]):
    """List of sub interfaces in the read version."""

    _INSTANCE = SubInterface

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

as_write()

Convert these read versions of sub interface to the writing versions.

Source code in examples/omni/data_classes/_sub_interface.py
def as_write(self) -> SubInterfaceWriteList:
    """Convert these read versions of sub interface to the writing versions."""
    return SubInterfaceWriteList([node.as_write() for node in self.data])

SubInterfaceWrite

Bases: MainInterfaceWrite

This represents the writing version of sub interface.

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 sub interface.

required
data_record

The data record of the sub interface node.

required
main_value

The main value field.

required
sub_value

The sub value field.

required
Source code in examples/omni/data_classes/_sub_interface.py
class SubInterfaceWrite(MainInterfaceWrite):
    """This represents the writing version of sub interface.

    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 sub interface.
        data_record: The data record of the sub interface node.
        main_value: The main value field.
        sub_value: The sub value field.
    """

    _container_fields: ClassVar[tuple[str, ...]] = (
        "main_value",
        "sub_value",
    )

    _view_id: ClassVar[dm.ViewId] = dm.ViewId("sp_pygen_models", "SubInterface", "1")

    node_type: Union[dm.DirectRelationReference, dm.NodeId, tuple[str, str], None] = None
    sub_value: Optional[str] = Field(None, alias="subValue")

SubInterfaceWriteList

Bases: DomainModelWriteList[SubInterfaceWrite]

List of sub interfaces in the writing version.

Source code in examples/omni/data_classes/_sub_interface.py
class SubInterfaceWriteList(DomainModelWriteList[SubInterfaceWrite]):
    """List of sub interfaces in the writing version."""

    _INSTANCE = SubInterfaceWrite