citrine.resources.design_workflow module

class citrine.resources.design_workflow.DesignWorkflowCollection(project_id: UUID, session: Session, *, branch_root_id: UUID | None = None, branch_version: int | None = None)

Bases: Collection[DesignWorkflow]

A collection of DesignWorkflows.

archive(uid: UUID | str)

Archive a design workflow.

Parameters:

uid (Union[UUID, str]) – Unique identifier of the workflow to archive

build(data: dict) DesignWorkflow

Build an individual design workflow from a dictionary.

Parameters:

data (dict) – A dictionary representing the design workflow.

Returns:

The design workflow created from data.

Return type:

DesignWorkflow

delete(uid: UUID | str) Response

Design Workflows cannot be deleted; they can be archived instead.

get(uid: UUID | str) ResourceType

Get a particular element of the collection.

list(*, per_page: int = 100) Iterator[ResourceType]

Paginate over the elements of the collection.

Leaving page and per_page as default values will yield all elements in the collection, paginating over all available pages.

Parameters:

per_page (int, optional) – Max number of results to return per page. Default is 100. This parameter is used when making requests to the backend service. If the page parameter is specified it limits the maximum number of elements in the response.

Returns:

An iterator that can be used to loop over all the resources in this collection. Use list() to force evaluation of all results into an in-memory list.

Return type:

Iterator[ResourceType]

list_archived(*, per_page: int = 500) Iterable[DesignWorkflow]

List archived Design Workflows.

register(model: DesignWorkflow) DesignWorkflow

Upload a new design workflow.

The model’s branch root ID and branch version are ignored in favor of this collection’s. If this collection has a null branch root ID or branch version, an exception is raised directing the caller to use one.

Parameters:

model (DesignWorkflow) – The design workflow to be uploaded.

Returns:

The newly created design workflow.

Return type:

DesignWorkflow

restore(uid: UUID | str)

Restore an archived design workflow.

Parameters:

uid (Union[UUID, str]) – Unique identifier of the workflow to restore

update(model: DesignWorkflow) DesignWorkflow

Update a design workflow.

Identifies the workflow by its uid. It must have a branch_root_id and branch_version, and if this collection also has a branch_root_id and branch_version, they must match. Prefer updating a workflow through Project.design_workflows.update.

Parameters:

model (DesignWorkflow) – The design workflow values that are desired, identified by the uid.

Returns:

The design workflow resulting from the update.

Return type:

DesignWorkflow