Skip to content

catalogs API

pynteracta.api.catalogs.CatalogsAPI

Bases: ResourceClient

Client for post-definition catalog endpoints.

list(catalog_ids=None, *, load_entries=False)

POST /communication/settings/post-definition/catalogs.

Retrieve catalog header information for the given catalog IDs.

Parameters:

Name Type Description Default
catalog_ids list[int] | None

Optional list of catalog identifiers to filter by.

None
load_entries bool

When True, include catalog entries in the response.

False

list_raw(req, *, load_entries=False)

POST catalog list with a pre-built request DTO (escape hatch).

entries(catalog_id, *, page_token=None, page_size=None, calculate_total_items_count=None, label=None, order_by=None, order_desc=None, **filters)

POST /communication/settings/post-definition/catalogs/{catalogId}/entries.

Retrieve a page of entries for the given catalog.

Parameters:

Name Type Description Default
catalog_id int

Unique catalog identifier.

required
page_token str | None

Pagination token from a previous response.

None
page_size int | None

Number of entries per page.

None
calculate_total_items_count bool | None

Include total count in the response when True.

None
label str | None

Filter entries by label substring.

None
order_by str | None

Sort field (label or externalId).

None
order_desc bool | None

Sort descending when True.

None

entries_raw(catalog_id, req)

POST catalog entries with a pre-built request DTO (escape hatch).

iterate_entries(catalog_id, *, page_size=None, **filters)

Lazy iterator over all pages of :meth:entries.

Parameters:

Name Type Description Default
catalog_id int

Unique catalog identifier.

required
page_size int | None

Number of entries per page.

None

Facade models

pynteracta.models.facade.catalogs.CatalogList

Facade over :class:~generated.GetPostDefinitionCatalogsResponseDTO.

Attributes:

Name Type Description
raw

The underlying generated DTO.

Source code in src/pynteracta/models/facade/catalogs.py
class CatalogList:
    """Facade over :class:`~generated.GetPostDefinitionCatalogsResponseDTO`.

    Attributes:
        raw: The underlying generated DTO.
    """

    def __init__(self, raw: generated.GetPostDefinitionCatalogsResponseDTO) -> None:
        self.raw = raw

    @property
    def items(self) -> list[generated.CatalogDTO]:
        """Raw catalog items (generated stubs)."""
        return self.raw.catalogs or []

    @property
    def items_typed(self) -> list[Catalog]:
        """Catalog items re-validated as typed :class:`Catalog` facades."""
        result = []
        for stub in self.items:
            typed = generated.CatalogDTOModel.model_validate(stub.root)
            result.append(Catalog(typed))
        return result

    @classmethod
    def from_dict(cls, data: dict) -> CatalogList:  # type: ignore[type-arg]
        """Parse from a raw API response dict."""
        return cls(generated.GetPostDefinitionCatalogsResponseDTO.model_validate(data))

items property

Raw catalog items (generated stubs).

items_typed property

Catalog items re-validated as typed :class:Catalog facades.

from_dict(data) classmethod

Parse from a raw API response dict.

Source code in src/pynteracta/models/facade/catalogs.py
@classmethod
def from_dict(cls, data: dict) -> CatalogList:  # type: ignore[type-arg]
    """Parse from a raw API response dict."""
    return cls(generated.GetPostDefinitionCatalogsResponseDTO.model_validate(data))

pynteracta.models.facade.catalogs.Catalog

Narrow facade over :class:~generated.CatalogDTOModel.

Attributes:

Name Type Description
raw

The underlying generated DTO; access additional fields via this escape hatch.

Source code in src/pynteracta/models/facade/catalogs.py
class Catalog:
    """Narrow facade over :class:`~generated.CatalogDTOModel`.

    Attributes:
        raw: The underlying generated DTO; access additional fields via this escape hatch.
    """

    def __init__(self, raw: generated.CatalogDTOModel) -> None:
        self.raw = raw

    @property
    def id(self) -> int | None:
        """Unique catalog identifier."""
        return self.raw.id

    @property
    def name(self) -> str | None:
        """Catalog name."""
        return self.raw.name

    @property
    def paged(self) -> bool | None:
        """Whether this catalog is paginated."""
        return self.raw.paged

    @classmethod
    def from_raw(cls, raw: generated.CatalogDTOModel) -> Catalog:
        """Wrap a generated DTO."""
        return cls(raw)

id property

Unique catalog identifier.

name property

Catalog name.

paged property

Whether this catalog is paginated.

from_raw(raw) classmethod

Wrap a generated DTO.

Source code in src/pynteracta/models/facade/catalogs.py
@classmethod
def from_raw(cls, raw: generated.CatalogDTOModel) -> Catalog:
    """Wrap a generated DTO."""
    return cls(raw)

pynteracta.models.facade.catalogs.CatalogEntryList

Facade over :class:~generated.ListPostDefinitionCatalogEntriesResponseDTO.

Attributes:

Name Type Description
raw

The underlying generated DTO.

Source code in src/pynteracta/models/facade/catalogs.py
class CatalogEntryList:
    """Facade over :class:`~generated.ListPostDefinitionCatalogEntriesResponseDTO`.

    Attributes:
        raw: The underlying generated DTO.
    """

    def __init__(self, raw: generated.ListPostDefinitionCatalogEntriesResponseDTO) -> None:
        self.raw = raw

    @property
    def items(self) -> list[generated.CatalogEntryDTO]:
        """Raw entry items (generated stubs)."""
        return self.raw.items or []

    @property
    def items_typed(self) -> list[CatalogEntry]:
        """Entry items re-validated as typed :class:`CatalogEntry` facades."""
        result = []
        for stub in self.items:
            typed = generated.CatalogEntryDTO1.model_validate(stub.root)
            result.append(CatalogEntry(typed))
        return result

    @property
    def next_page_token(self) -> str | None:
        """Token for the next page, or ``None`` on the last page."""
        return self.raw.nextPageToken

    @property
    def total_items_count(self) -> int | None:
        """Total entry count (present only when ``calculateTotalItemsCount`` was requested)."""
        return self.raw.totalItemsCount

    @classmethod
    def from_dict(cls, data: dict) -> CatalogEntryList:  # type: ignore[type-arg]
        """Parse from a raw API response dict."""
        return cls(generated.ListPostDefinitionCatalogEntriesResponseDTO.model_validate(data))

items property

Raw entry items (generated stubs).

items_typed property

Entry items re-validated as typed :class:CatalogEntry facades.

next_page_token property

Token for the next page, or None on the last page.

total_items_count property

Total entry count (present only when calculateTotalItemsCount was requested).

from_dict(data) classmethod

Parse from a raw API response dict.

Source code in src/pynteracta/models/facade/catalogs.py
@classmethod
def from_dict(cls, data: dict) -> CatalogEntryList:  # type: ignore[type-arg]
    """Parse from a raw API response dict."""
    return cls(generated.ListPostDefinitionCatalogEntriesResponseDTO.model_validate(data))

pynteracta.models.facade.catalogs.CatalogEntry

Narrow facade over :class:~generated.CatalogEntryDTO1.

Attributes:

Name Type Description
raw

The underlying generated DTO.

Source code in src/pynteracta/models/facade/catalogs.py
class CatalogEntry:
    """Narrow facade over :class:`~generated.CatalogEntryDTO1`.

    Attributes:
        raw: The underlying generated DTO.
    """

    def __init__(self, raw: generated.CatalogEntryDTO1) -> None:
        self.raw = raw

    @property
    def id(self) -> int | None:
        """Unique entry identifier."""
        return self.raw.id

    @property
    def label(self) -> str | None:
        """Entry label (display value)."""
        return self.raw.label

    @property
    def external_id(self) -> str | None:
        """External identifier for this entry."""
        return self.raw.externalId

    @property
    def parent_ids(self) -> list[int] | None:
        """Parent entry identifiers (for hierarchical catalogs)."""
        return self.raw.parentIds

    @classmethod
    def from_raw(cls, raw: generated.CatalogEntryDTO1) -> CatalogEntry:
        """Wrap a generated DTO."""
        return cls(raw)

external_id property

External identifier for this entry.

id property

Unique entry identifier.

label property

Entry label (display value).

parent_ids property

Parent entry identifiers (for hierarchical catalogs).

from_raw(raw) classmethod

Wrap a generated DTO.

Source code in src/pynteracta/models/facade/catalogs.py
@classmethod
def from_raw(cls, raw: generated.CatalogEntryDTO1) -> CatalogEntry:
    """Wrap a generated DTO."""
    return cls(raw)