polarion_rest_api_client.clients package

Implementations for all project specific clients.

Submodules

polarion_rest_api_client.clients.base_classes module

Base classes for client implementations on project Level.

class polarion_rest_api_client.clients.base_classes.BaseClient(project_id: str, client: polarion_client.PolarionClient)

Bases: Generic

The overall base client for all project related clients.

none_to_unset(value: None) Unset
none_to_unset(value: NT) NT

Return UNSET if value is None, else the value.

unset_to_none(value: Unset) None
unset_to_none(value: UT) UT

Return None if value is Unset, else the value.

class polarion_rest_api_client.clients.base_classes.CreateClient(project_id: str, client: polarion_client.PolarionClient)

Bases: BaseClient[T], ABC

A client for items of a project, which can be created.

async async_create(items: T | list[T]) None

Create one or multiple items.

create(items: T | list[T]) None

Create one or multiple items.

class polarion_rest_api_client.clients.base_classes.DeleteClient(project_id: str, client: polarion_client.PolarionClient)

Bases: BaseClient[T], ABC

A client for items of a project, which can be created.

async async_delete(items: T | list[T]) None

Delete one or multiple items.

delete(items: T | list[T]) None

Delete one or multiple items.

class polarion_rest_api_client.clients.base_classes.MultiGetClient(project_id: str, client: polarion_client.PolarionClient)

Bases: BaseClient[T], ABC

A client for items of a project, which can be created.

async async_get_all(*args: Any, **kwargs: Any) list[T]

Return all matching items using get_multi with auto pagination.

abstractmethod async async_get_multi(*args: Any, page_size: int = 100, page_number: int = 1, **kwargs: Any) tuple[list[T], bool]

Get multiple matching items for a specific page.

In addition, a flag whether a next page is available is returned.

get_all(*args: Any, **kwargs: Any) list[T]

Return all matching items using get_multi with auto pagination.

abstractmethod get_multi(*args: Any, page_size: int = 100, page_number: int = 1, **kwargs: Any) tuple[list[T], bool]

Get multiple matching items for a specific page.

In addition, a flag whether a next page is available is returned.

class polarion_rest_api_client.clients.base_classes.SingleGetClient(project_id: str, client: polarion_client.PolarionClient)

Bases: BaseClient[T], ABC

A client for items of a project, which can be created.

abstractmethod async async_get(*args: Any, **kwargs: Any) T | None

Get a specific single item.

abstractmethod get(*args: Any, **kwargs: Any) T | None

Get a specific single item.

class polarion_rest_api_client.clients.base_classes.StatusItemClient(project_id: str, client: polarion_client.PolarionClient, delete_status: str | None = None)

Bases: UpdateClient[ST], DeleteClient[ST], ABC

A client for items, which have a status.

We support to set a specific status for these instead of deleting them. This status has to be provided on initialization.

async async_delete(items: ST | list[ST]) None

Delete the item if no delete_status was set, else update status.

delete(items: ST | list[ST]) None

Delete the item if no delete_status was set, else update status.

item_cls: type[ST]
class polarion_rest_api_client.clients.base_classes.UpdateClient(project_id: str, client: polarion_client.PolarionClient)

Bases: BaseClient[T], ABC

A client for items which can also be updated.

async async_update(items: T | list[T]) None

Update the provided item or items.

update(items: T | list[T]) None

Update the provided item or items.

polarion_rest_api_client.clients.documents module

Implementation of the documents client.

class polarion_rest_api_client.clients.documents.Documents(project_id: str, client: polarion_client.PolarionClient)

Bases: SingleGetClient, CreateClient, UpdateClient[Document]

A client to work with documents in Polarion.

async async_get(space_id: str, document_name: str, fields: dict[str, str] | None = None, include: str | None | Unset = None, revision: str | None | Unset = None) Document | None

Return the document with the given document_name and space_id.

get(space_id: str, document_name: str, fields: dict[str, str] | None = None, include: str | None | Unset = None, revision: str | None | Unset = None) Document | None

Return the document with the given document_name and space_id.

polarion_rest_api_client.clients.projects module

A client for a specific project, using the session of PolarionClient.

class polarion_rest_api_client.clients.projects.ProjectClient(project_id: str, client: polarion_client.PolarionClient, delete_status: str | None = None)

Bases: BaseClient

A client for a specific project.

exists() bool

Return True, if the clients project exists.

polarion_rest_api_client.clients.test_parameters module

Clients to handle test parameters.

class polarion_rest_api_client.clients.test_parameters.TestRecordParameters(project_id: str, client: polarion_client.PolarionClient)

Bases: MultiGetClient[TestRecordParameter], CreateClient[TestRecordParameter], DeleteClient[TestRecordParameter]

Clients to handle TestParameters of a TestRecord.

async async_get_multi(test_record: TestRecord, *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None) tuple[list[TestRecordParameter], bool]

Get multiple matching items for a specific page.

In addition, a flag whether a next page is available is returned.

get_multi(test_record: TestRecord, *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None) tuple[list[TestRecordParameter], bool]

Get multiple matching items for a specific page.

In addition, a flag whether a next page is available is returned.

class polarion_rest_api_client.clients.test_parameters.TestRunParameters(project_id: str, client: polarion_client.PolarionClient)

Bases: MultiGetClient[TestRunParameter], CreateClient[TestRunParameter], DeleteClient[TestRunParameter]

Client to handle TestParameters of a TestRun.

async async_get_multi(test_run_id: str, *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None) tuple[list[TestRunParameter], bool]

Get multiple matching items for a specific page.

In addition, a flag whether a next page is available is returned.

get_multi(test_run_id: str, *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None) tuple[list[TestRunParameter], bool]

Get multiple matching items for a specific page.

In addition, a flag whether a next page is available is returned.

polarion_rest_api_client.clients.test_records module

class polarion_rest_api_client.clients.test_records.TestRecords(project_id: str, client: polarion_client.PolarionClient)

Bases: CreateClient[TestRecord], MultiGetClient[TestRecord], DeleteClient[TestRecord], UpdateClient[TestRecord]

async async_get_multi(test_run_id: str, *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None) tuple[list[TestRecord], bool]

Get multiple matching items for a specific page.

In addition, a flag whether a next page is available is returned.

get_multi(test_run_id: str, *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None) tuple[list[TestRecord], bool]

Get multiple matching items for a specific page.

In addition, a flag whether a next page is available is returned.

polarion_rest_api_client.clients.test_runs module

class polarion_rest_api_client.clients.test_runs.TestRuns(project_id: str, client: polarion_client.PolarionClient)

Bases: MultiGetClient[TestRun], UpdateClient[TestRun], CreateClient[TestRun], DeleteClient[TestRun]

async async_get_multi(query: str = '', *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None) tuple[list[TestRun], bool]

Return the test runs on a defined page matching the given query.

In addition, a flag whether a next page is available is returned. Define a fields dictionary as described in the Polarion API documentation to get certain fields.

get_multi(query: str = '', *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None) tuple[list[TestRun], bool]

Return the test runs on a defined page matching the given query.

In addition, a flag whether a next page is available is returned. Define a fields dictionary as described in the Polarion API documentation to get certain fields.

polarion_rest_api_client.clients.test_steps module

class polarion_rest_api_client.clients.test_steps.TestSteps(project_id: str, client: polarion_client.PolarionClient)

Bases: MultiGetClient[TestStep], UpdateClient[TestStep], DeleteClient[TestStep], CreateClient[TestStep]

async async_get_multi(work_item_id: str, *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None, revision: str | None = None) tuple[list[TestStep], bool]

Get multiple matching items for a specific page.

In addition, a flag whether a next page is available is returned.

get_multi(work_item_id: str, *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None, revision: str | None = None) tuple[list[TestStep], bool]

Get multiple matching items for a specific page.

In addition, a flag whether a next page is available is returned.

polarion_rest_api_client.clients.work_item_attachments module

Implementations of WorkItemAttachment relates functions.

class polarion_rest_api_client.clients.work_item_attachments.WorkItemAttachments(project_id: str, client: polarion_client.PolarionClient)

Bases: UpdateClient[WorkItemAttachment], MultiGetClient[WorkItemAttachment], CreateClient[WorkItemAttachment], DeleteClient[WorkItemAttachment]

A class to handle WorkItemAttachments.

async async_get_multi(work_item_id: str, *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None, revision: str | None = None) tuple[list[WorkItemAttachment], bool]

Return the attachments for a given work item on a defined page.

In addition, a flag whether a next page is available is returned. Define a fields dictionary as described in the Polarion API documentation to get certain fields.

get_multi(work_item_id: str, *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None, revision: str | None = None) tuple[list[WorkItemAttachment], bool]

Return the attachments for a given work item on a defined page.

In addition, a flag whether a next page is available is returned. Define a fields dictionary as described in the Polarion API documentation to get certain fields.

polarion_rest_api_client.clients.work_items module

Implementation of a client providing work item specific functions.

class polarion_rest_api_client.clients.work_items.WorkItems(project_id: str, client: polarion_client.PolarionClient, delete_status: str | None = None)

Bases: StatusItemClient, MultiGetClient, SingleGetClient, DeleteClient, CreateClient

A project specific client for work item operations.

async async_create(items: WorkItem | list[WorkItem]) None

Create WorkItems and respect the max body size of the server.

async async_get(work_item_id: str, work_item_cls: type[WT], revision: str | None = None) WT | None
async async_get(work_item_id: str, *, revision: str | None = None) WorkItem | None

Return one specific work item with all fields.

This also includes all linked work items and attachments. If there are to many of these to get them in one request, the truncated flags for linked_work_items and attachments will be set to True.

async async_get_multi(query: str = '', *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None, work_item_cls: type[WT], revision: str | None = None) tuple[list[WT], bool]
async async_get_multi(query: str = '', *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None, revision: str | None = None) tuple[list[WorkItem], bool]

Return the work items on a defined page matching the given query.

In addition, a flag whether a next page is available is returned. Define a fields dictionary as described in the Polarion API documentation to get certain fields.

async async_update(items: WorkItem | list[WorkItem]) None

Update WorkItems and respect max body size and batch limits.

create(items: WorkItem | list[WorkItem]) None

Create WorkItems and respect the max body size of the server.

get(work_item_id: str, work_item_cls: type[WT], revision: str | None = None) WT | None
get(work_item_id: str, *, revision: str | None = None) WorkItem | None

Return one specific work item with all fields.

This also includes all linked work items and attachments. If there are to many of these to get them in one request, the truncated flags for linked_work_items and attachments will be set to True.

get_multi(query: str = '', *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None, work_item_cls: type[WT], revision: str | None = None) tuple[list[WT], bool]
get_multi(query: str = '', *, page_size: int = 100, page_number: int = 1, fields: dict[str, str] | None = None, revision: str | None = None) tuple[list[WorkItem], bool]

Return the work items on a defined page matching the given query.

In addition, a flag whether a next page is available is returned. Define a fields dictionary as described in the Polarion API documentation to get certain fields.

update(items: WorkItem | list[WorkItem]) None

Update WorkItems and respect max body size and batch limits.