Skip to content

media_asset

konigle.managers.core.media_asset

Media asset managers for the Konigle SDK.

This module provides managers for Image, Video, and Document assets. All three types use the same backend endpoint but are differentiated by mime_type filtering.

AsyncDocumentManager

Bases: BaseDocumentManager, BaseAsyncManager

Async manager for document assets.

create(data) async

Create a new document asset.

search(query, page=1, page_size=10) async

Search for documents by a text query.

PARAMETER DESCRIPTION
query

The search query string.

TYPE: str

page

The page number for pagination.

TYPE: int DEFAULT: 1

page_size

The number of items per page.

TYPE: int DEFAULT: 10

Returns: List of document assets matching the query.

update(id_, data) async

Update an existing document asset.

AsyncImageManager

Bases: BaseImageManager, BaseAsyncManager

Async manager for image assets.

create(data) async

Create a new image asset.

generate(data) async

Generate an image from a text prompt.

PARAMETER DESCRIPTION
data

Image generation parameters including prompt and options

TYPE: ImageGenerate

RETURNS DESCRIPTION
Image

Generated image asset

search(query, page=1, page_size=10) async

Search for images by a text query.

PARAMETER DESCRIPTION
query

The search query string.

TYPE: str

page

The page number for pagination.

TYPE: int DEFAULT: 1

page_size

The number of items per page.

TYPE: int DEFAULT: 10

Returns: List of image assets matching the query.

update(id_, data) async

Update an existing image asset.

AsyncVideoManager

Bases: BaseVideoManager, BaseAsyncManager

Async manager for video assets.

create(data) async

Create a new video asset.

search(query, page=1, page_size=10) async

Search for videos by a text query.

PARAMETER DESCRIPTION
query

The search query string.

TYPE: str

page

The page number for pagination.

TYPE: int DEFAULT: 1

page_size

The number of items per page.

TYPE: int DEFAULT: 10

Returns: List of video assets matching the query.

update(id_, data) async

Update an existing video asset.

BaseDocumentManager

base_path = '/admin/api/storefront-assets' class-attribute instance-attribute

The API base path for this resource type.

filter_class = DocumentFilters class-attribute instance-attribute

The filter model class for this resource type.

resource_class = Document class-attribute instance-attribute

The resource model class this manager handles.

resource_update_class = DocumentUpdate class-attribute instance-attribute

The resource update model class this manager handles.

BaseImageManager

base_path = '/admin/api/storefront-assets' class-attribute instance-attribute

The API base path for this resource type.

filter_class = ImageFilters class-attribute instance-attribute

The filter model class for this resource type.

resource_class = Image class-attribute instance-attribute

The resource model class this manager handles.

resource_update_class = ImageUpdate class-attribute instance-attribute

The resource update model class this manager handles.

BaseVideoManager

base_path = '/admin/api/storefront-assets' class-attribute instance-attribute

The API base path for this resource type.

filter_class = VideoFilters class-attribute instance-attribute

The filter model class for this resource type.

resource_class = Video class-attribute instance-attribute

The resource model class this manager handles.

resource_update_class = VideoUpdate class-attribute instance-attribute

The resource update model class this manager handles.

DocumentManager

Bases: BaseDocumentManager, BaseSyncManager

Manager for document assets.

create(data)

Create a new document asset.

search(query, page=1, page_size=10)

Search for documents by a text query.

PARAMETER DESCRIPTION
query

The search query string.

TYPE: str

page

The page number for pagination.

TYPE: int DEFAULT: 1

page_size

The number of items per page.

TYPE: int DEFAULT: 10

Returns: List of document assets matching the query.

update(id_, data)

Update an existing document asset.

ImageManager

Bases: BaseImageManager, BaseSyncManager

Manager for image assets.

create(data)

Create a new image asset.

generate(data)

Generate an image from a text prompt.

PARAMETER DESCRIPTION
data

Image generation parameters including prompt and options

TYPE: ImageGenerate

RETURNS DESCRIPTION
Image

Generated image asset

search(query, page=1, page_size=10)

Search for images by a text query.

PARAMETER DESCRIPTION
query

The search query string.

TYPE: str

page

The page number for pagination.

TYPE: int DEFAULT: 1

page_size

The number of items per page.

TYPE: int DEFAULT: 10

Returns: List of image assets matching the query.

update(id_, data)

Update an existing image asset.

VideoManager

Bases: BaseVideoManager, BaseSyncManager

Manager for video assets.

create(data)

Create a new video asset.

search(query, page=1, page_size=10)

Search for videos by a text query.

PARAMETER DESCRIPTION
query

The search query string.

TYPE: str

page

The page number for pagination.

TYPE: int DEFAULT: 1

page_size

The number of items per page.

TYPE: int DEFAULT: 10

Returns: List of video assets matching the query.

update(id_, data)

Update an existing video asset.