sams_client.schemas.assets – Assets

class AssetStates(DRAFT: str, INTERNAL: str, PUBLIC: str)

Named tuple for Asset states

The state of an Asset defines the available actions on it. An Asset can be in any one of the following states:

DRAFT: str

Marks an Asset as not ready for use

INTERNAL: str

Marks an Asset for internal use only

PUBLIC: str

Marks an Asset for public consumption

ASSET_STATES: sams_client.schemas.assets.AssetStates = AssetStates(DRAFT='draft', INTERNAL='internal', PUBLIC='public')

Asset states

class IAssetTag(_typename, _fields=None, /, **kwargs)

Tags that can be associated with an Asset

code: str

String representing the unique id for this Tag

name: str

A human readable string for the Tag

class IAssetRenditionArgs(_typename, _fields=None, /, **kwargs)

Arguments used when requesting a rendition to be created

New in version 0.3.0.

height: int

Height of the image rendition

keep_proportions: bool

Keep image’s original aspect ratio

width: int

Width of the image rendition

class IAssetRendition(_typename, _fields=None, /, **kwargs)

Asset rendition metadata

New in version 0.3.0.

filename: str

Generated filename of this rendition

height: int

Actual height of the image rendition

length: int

Storage size of this rendition

params: sams_client.schemas.assets.IAssetRenditionArgs

Parameters used when this rendition was created

versioncreated: datetime.datetime

Date/time this rendition was created

width: int

Actual width of the image rendition

class IAsset(_typename, _fields=None, /, **kwargs)

Asset metadata

_id: Union[bson.objectid.ObjectId, str]

Globally unique id, generated automatically by the system

_media_id: str

Globally unique id for the asset binary. This ID is generated by the StorageProvider

original_creator: str

A field to store the id of the user who uploaded the asset

New in version 0.2.0.

version_creator: str

A field to store the id of the user who updated the asset

New in version 0.2.0.

firstcreated: datetime.datetime

A field to store time, when asset is created

New in version 0.2.0.

versioncreated: datetime.datetime

A field to store time, when asset is updated

New in version 0.2.0.

_version: int

An auto-incrementing version field

set_id: bson.objectid.ObjectId

The ID of the Set where the Asset is to be stored

parent_id: bson.objectid.ObjectId

An optional ID of a parent Asset

state: str

The state of the Asset (defaults to draft). Can be one of draft, internal or public

filename: str

The file name of the Asset Binary

length: int

The size in bytes of the Asset Binary (calculated by the service)

mimetype: str

The mimetype of the Asset Binary (calculated by the service)

name: str

A name to give to the Asset

description: str

A short description describing the Asset

tags: List[sams_client.schemas.assets.IAssetTag]

A list of code/name combinations so Assets can be grouped together through tags

extra: Dict[str, Any]

An extra dictionary to store further information about the Asset

binary: bson.objectid.ObjectId

A special case attribute containing the actual binary data to be uploaded. This attribute will be removed from the metadata document before saving/updating

lock_user: str

If locked, ID of the external user who locked this asset

New in version 0.2.0.

lock_session: str

If locked, ID of the exernal user session who locked this asset

New in version 0.2.0.

lock_action: str

If locked, name of the action that for this lock (i.e. edit)

New in version 0.2.0.

lock_time: datetime.datetime

If locked, the date and time this asset was locked

New in version 0.2.0.

renditions: List[sams_client.schemas.assets.IAssetRendition]

The list of renditions for this Asset (if it is an image)

New in version 0.3.0.