EntityHandle#

class ansys.bdm.api.entity_handle.EntityHandle(/, **data: Any)#

Bases: pydantic.BaseModel

A handle to a entity stored by a BDM provider and the associated lightweight data about it.

This lightweight, immutable object is intended to be easy to serialize and pass around across processes, services, and hosts. The actual behavior of the entity contents is up to the IStorageScope or IAsyncStorageScope.

Overview#

is_blob

True if this entity refers to a blob. False if it refers to a collection of blobs.

original_name

The original filename of the entity.

entity_id

A unique id that identifies the entity.

opaque_identifier

A custom identifier that the IStorageScope can use to identify the

mime_type

The mime type of the data, if it is known. None otherwise.

encoding

The Internet Assigned Numbers Authority (IANA) registered encoding name used for textual data.

size

Size of the data in bytes, if known.

Import detail#

from ansys.bdm.api.entity_handle import EntityHandle

Attribute detail#

EntityHandle.is_blob: bool#

True if this entity refers to a blob. False if it refers to a collection of blobs.

EntityHandle.original_name: str | None = None#

The original filename of the entity.

This is just the filename and does not include the path. May be None or empty if not known. May not refer to a file on the local system.

EntityHandle.entity_id: uuid.UUID#

A unique id that identifies the entity.

Typically this value is a new, random Guid created at the moment that the Entityandle is created from contents such as a file on disk. It should be preserved across clone and save/load operations. It is not guaranteed to be the same value if you read the same contents into an BlobHandle twice.

The UUID ‘00000000-0000-0000-0000-000000000000’ is reserved for NO_ENTITY.

EntityHandle.opaque_identifier: str#

A custom identifier that the IStorageScope can use to identify the handle. Opaque as each BDM system may have its own form for this field. Consumers are not to assume anything about this field, even if it looks parseable.

EntityHandle.mime_type: str | None = None#

The mime type of the data, if it is known. None otherwise.

EntityHandle.encoding: str | None = None#

The Internet Assigned Numbers Authority (IANA) registered encoding name used for textual data.

This may be None if not known and should not be set for binary mime types.

This encoding name may be passed to other languages and implementations. IANA registered encoding names MUST be used.

EntityHandle.size: int | None = None#

Size of the data in bytes, if known.

Size must be None if is_blob is False.

Note that 0 is a valid blob size and has a different meaning than None.

Method detail#

EntityHandle.__eq__(__value: object, /) → bool#
EntityHandle.__hash__() → int#