Skip to content

sift_py.asset.service

CLASS DESCRIPTION
AssetService

A service for managing assets. Allows for creating, updating, and retrieving assets in the Sift API.

AssetService

AssetService(channel: SiftChannel)

A service for managing assets. Allows for creating, updating, and retrieving assets in the Sift API.

METHOD DESCRIPTION
delete_asset

Deletes an asset by its ID.

get_asset

Retrieves an asset by its ID.

list_assets

Lists assets in an organization.

update_asset

Updates an existing asset.

delete_asset

delete_asset(asset_id: str) -> None

Deletes an asset by its ID.

get_asset

get_asset(asset_id: str) -> Optional[AssetConfig]

Retrieves an asset by its ID.

PARAMETER DESCRIPTION
asset_id

The ID of the asset to retrieve.

TYPE: str

RETURNS DESCRIPTION
Optional[AssetConfig]

The Asset if found, None otherwise.

list_assets

list_assets(
    names: Optional[List[str]] = None,
    ids: Optional[List[str]] = None,
) -> List[AssetConfig]

Lists assets in an organization.

PARAMETER DESCRIPTION
names

Optional list of names to filter by.

TYPE: Optional[List[str]] DEFAULT: None

ids

Optional list of IDs to filter by.

TYPE: Optional[List[str]] DEFAULT: None

RETURNS DESCRIPTION
List[AssetConfig]

A list of assets matching the criteria.

update_asset

update_asset(
    asset: AssetConfig,
    update_tags: bool = True,
    update_metadata: bool = True,
) -> AssetConfig

Updates an existing asset.

PARAMETER DESCRIPTION
asset

The asset to update.

TYPE: AssetConfig

update_tags

Whether to update the tags.

TYPE: bool DEFAULT: True

update_metadata

Whether to update the metadata.

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
AssetConfig

The updated AssetConfig.