inttegro.request

Per-request controls shared by Inttegro resource operations.

1"""Per-request controls shared by Inttegro resource operations."""
2
3from inttegro.request.response import Response
4from inttegro.request.selection import Omit, Pick, PropertySelection
5
6__all__ = ["Omit", "Pick", "PropertySelection", "Response"]
@dataclass(frozen=True, slots=True, kw_only=True)
class Omit(inttegro._request_base.ApiRequest):
26@dataclass(frozen=True, slots=True, kw_only=True)
27class Omit(ApiRequest):
28    """Exclude the named public property paths from one response resource.
29
30    Omitting a property also omits all of its descendants.
31    """
32
33    omit: Sequence[str]
34
35    def __post_init__(self) -> None:
36        object.__setattr__(self, "omit", _property_paths("omit", self.omit))

Exclude the named public property paths from one response resource.

Omitting a property also omits all of its descendants.

Omit(*, omit: Sequence[str])
omit: Sequence[str]
@dataclass(frozen=True, slots=True, kw_only=True)
class Pick(inttegro._request_base.ApiRequest):
12@dataclass(frozen=True, slots=True, kw_only=True)
13class Pick(ApiRequest):
14    """Include only the named public property paths for one response resource.
15
16    Ancestors needed to contain a selected descendant remain present. Selecting
17    a parent includes its complete caller-visible subtree.
18    """
19
20    pick: Sequence[str]
21
22    def __post_init__(self) -> None:
23        object.__setattr__(self, "pick", _property_paths("pick", self.pick))

Include only the named public property paths for one response resource.

Ancestors needed to contain a selected descendant remain present. Selecting a parent includes its complete caller-visible subtree.

Pick(*, pick: Sequence[str])
pick: Sequence[str]
PropertySelection = Pick | Omit
@dataclass(frozen=True, slots=True, kw_only=True)
class Response(inttegro._request_base.ApiRequest):
13@dataclass(frozen=True, slots=True, kw_only=True)
14class Response(ApiRequest):
15    """Select public response properties by endpoint-defined resource name.
16
17    Resources omitted from ``projection`` keep their complete caller-visible
18    representation. The endpoint reference defines valid resource names and
19    property paths.
20    """
21
22    projection: Mapping[str, PropertySelection]

Select public response properties by endpoint-defined resource name.

Resources omitted from projection keep their complete caller-visible representation. The endpoint reference defines valid resource names and property paths.

Response( *, projection: Mapping[str, Pick | Omit])
projection: Mapping[str, Pick | Omit]