angzarr_client.wrappers¶
User-facing wrappers around Angzarr framework proto types.
Each wrapper takes the underlying proto in its constructor and exposes
domain accessors as methods. The raw proto is reachable via the
Wrapped.proto() interface method (wrapper.proto()) when
callers need direct field access.
Cover-bearing wrappers (Cover, EventBook,
CommandBook, Query) inherit shared accessors from
CoverBearer. Page wrappers (EventPage,
CommandPage) and CommandResponse are not Cover-bearers
and define their own surface.
Naming: wrapper class names shadow the proto type names. Internal code
that wants the raw proto imports it from
angzarr_client.proto.angzarr directly; user code reaches for the
wrapper from angzarr_client.
Attributes¶
Classes¶
Interface every angzarr wrapper implements. |
|
Shared accessors for proto types that carry a |
|
Wrapper for the |
|
Wrapper for the |
|
Wrapper for the |
|
Wrapper for the |
|
Wrapper for the |
|
Wrapper for the |
|
Wrapper for the |
Module Contents¶
- angzarr_client.wrappers.T¶
- angzarr_client.wrappers.UNKNOWN_DOMAIN = 'unknown'¶
- angzarr_client.wrappers.TYPE_URL_PREFIX = 'type.googleapis.com/'¶
- class angzarr_client.wrappers.Wrapped¶
Bases:
abc.ABCInterface every angzarr wrapper implements.
Wrappers expose two surfaces:
Method-style accessors for common needs (e.g.
Cover.domain()).The raw proto for everything else, via
proto().
Cross-language note:
proto()is the documented escape hatch for callers that want direct proto field access (e.g. for serialization, for fields that don’t have a wrapper accessor, for proto-specific methods likeHasField). Other languages will provide an equivalent method (e.g. JavaCover.proto()).- abstractmethod proto()¶
Return the wrapped proto message.
- class angzarr_client.wrappers.CoverBearer¶
Bases:
WrappedShared accessors for proto types that carry a
Coverfield.Subclasses set
self._protoand override_cover_proto()to return the embedded Cover (orNoneif missing). The default implementation assumesself._protois itself a Cover — onlyCoverrelies on the default; the others override.- domain() str¶
Get the domain, falling back to
UNKNOWN_DOMAIN.
- class angzarr_client.wrappers.Cover(proto: angzarr_client.proto.angzarr.Cover)¶
Bases:
CoverBearerWrapper for the
Coverproto.- proto() angzarr_client.proto.angzarr.Cover¶
Return the wrapped proto message.
- class angzarr_client.wrappers.EventBook(proto: angzarr_client.proto.angzarr.EventBook)¶
Bases:
CoverBearerWrapper for the
EventBookproto.- proto() angzarr_client.proto.angzarr.EventBook¶
Return the wrapped proto message.
- cover() Cover¶
The wrapped cover.
Always returns a
Cover— when the underlying proto has no cover field set, the wrapper is built around the proto’s default-instance cover, so accessors like.domain()still work (returning the canonical empty responses, e.g.UNKNOWN_DOMAIN).
- class angzarr_client.wrappers.CommandBook(proto: angzarr_client.proto.angzarr.CommandBook)¶
Bases:
CoverBearerWrapper for the
CommandBookproto.- proto() angzarr_client.proto.angzarr.CommandBook¶
Return the wrapped proto message.
- cover() Cover¶
The wrapped cover (always present; default-instance if not set).
See
EventBook.cover()for the rationale.
- pages() list[CommandPage]¶
All command pages, wrapped.
- first_command() CommandPage | None¶
First command page, or None when empty.
- merge_strategy() angzarr_client.proto.angzarr.MergeStrategy¶
Merge strategy of the first page; defaults to commutative.
- class angzarr_client.wrappers.Query(proto: angzarr_client.proto.angzarr.Query)¶
Bases:
CoverBearerWrapper for the
Queryproto.- proto() angzarr_client.proto.angzarr.Query¶
Return the wrapped proto message.
- cover() Cover¶
The wrapped cover (always present; default-instance if not set).
See
EventBook.cover()for the rationale.
- class angzarr_client.wrappers.EventPage(proto: angzarr_client.proto.angzarr.EventPage)¶
Bases:
WrappedWrapper for the
EventPageproto.- proto() angzarr_client.proto.angzarr.EventPage¶
Return the wrapped proto message.
- class angzarr_client.wrappers.CommandPage(proto: angzarr_client.proto.angzarr.CommandPage)¶
Bases:
WrappedWrapper for the
CommandPageproto.- proto() angzarr_client.proto.angzarr.CommandPage¶
Return the wrapped proto message.
- merge_strategy() angzarr_client.proto.angzarr.MergeStrategy¶
Per-page merge strategy.