base
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| AnnotatedObject aclientp.schema.v2.base A v2 object with the ``_meta`` extension point. |
||
| Schema aclientp.schema.v2.base Base class of all v2 models. |
||
| Unknown aclientp.schema.v2.base Base of fallback variants of open unions: a custom or future variant. |
🛈 DocStrings¶
Base classes of the ACP v2 models.
Wire rules, matching the v2 schema's patch semantics:
- Optional fields default to :data:
~pydantic.MISSINGand are left out when serializing.Noneis only accepted where the schema allowsnull, and is sent asnull. On upserts, a left out field is unchanged andnullclears it. - Serialize with :func:
to_wire(by_alias, noexclude_none), so explicitnullvalues reach the peer. MISSINGis truthy. Test fields with :func:is_set(oris MISSING), never withif field:.
OTHER_TAG
module-attribute
¶
Tag of the fallback variant of an open union.
Not a possible protocol value, so it cannot clash with real tags such as the
unknown session state.
JsonValue
¶
A JSON value: the params and results of custom (_-prefixed) methods.
AnnotatedObject
¶
Bases: Schema
A v2 object with the _meta extension point.
Source code in src/aclientp/schema/v2/base.py
field_meta
class-attribute
instance-attribute
¶
Extension point for implementations. Omitted and null mean no metadata.
On upserts, _meta is a patch: omitted leaves it unchanged, null clears it,
and an object patches the stored metadata by top-level key (a key set to null
is removed, any other value replaces that key).
Schema
¶
Unknown
¶
Bases: AnnotatedObject
Base of fallback variants of open unions: a custom or future variant.
Keeps all fields of the payload, so messages can be passed on unchanged.
Source code in src/aclientp/schema/v2/base.py
is_set
¶
Whether a field was given (None counts as given): narrows T | MISSING to T.
MISSING is truthy, so if field: does not work for this.
open_discriminator
¶
Discriminator of an open union tagged by prop.
prop is the wire name; model instances are read through the matching Python
attribute (sessionUpdate -> session_update). Known values select their variant
(a malformed payload is an error, it does not fall back); any other value selects
the variant tagged :data:OTHER_TAG.
Source code in src/aclientp/schema/v2/base.py
to_wire
¶
Serialize a v2 model: wire names, MISSING left out, None sent as null.