cayu.budgets.binding
Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.
BudgetBinding
Section titled “BudgetBinding”from cayu.budgets import BudgetBindingImmutable authority for one common-root budget domain.
Construction does not authenticate a caller. Applications must obtain instances from a registered trusted receiver and persist the resulting digest with every reservation and settlement.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
protocol_version |
StrictStr |
'cayu:budget-binding:v1' |
binding_id |
StrictStr |
required |
application_scope |
StrictStr |
required |
initiator |
StrictStr |
required |
sponsor |
StrictStr |
required |
purpose |
StrictStr |
required |
root_budget_id |
StrictStr |
required |
ancestor_budget_ids |
tuple[StrictStr, ...] |
() |
limits |
tuple[BudgetLimit, ...] |
Field(min_length=1) |
ledger_owner |
StrictStr |
required |
receiver_id |
StrictStr |
required |
receiver_generation |
StrictInt |
Field(ge=0) |
allowance |
StrictInt |
Field(gt=0, le=MAX_DURABLE_JSON_INTEGER) |
retention_policy |
StrictStr |
required |
settlement_policy |
StrictStr |
required |
provider_name |
StrictStr | None |
None |
model |
StrictStr | None |
None |
environment_name |
StrictStr | None |
None |
validate_text (method)
Section titled “validate_text (method)”BudgetBinding.validate_text(value: str | None, info) -> str | Nonevalidate_ancestors (method)
Section titled “validate_ancestors (method)”BudgetBinding.validate_ancestors(value: tuple[str, ...]) -> tuple[str, ...]copy_limits (method)
Section titled “copy_limits (method)”BudgetBinding.copy_limits(value: object) -> tuple[BudgetLimit, ...]require_root_ceiling (method)
Section titled “require_root_ceiling (method)”BudgetBinding.require_root_ceiling() -> BudgetBindingauthority_digest (property)
Section titled “authority_digest (property)”BudgetBinding.authority_digest() -> strReturn the stable digest of every decision-bearing authority field.
exact_match (method)
Section titled “exact_match (method)”BudgetBinding.exact_match(other: BudgetBinding) -> boolCompare complete authority, not only the binding identifier.
Release source · Runtime guarantees · Capability guides
BudgetBindingError
Section titled “BudgetBindingError”from cayu.budgets import BudgetBindingErrorRaised when a common-root binding is malformed or conflicts.
Bases: ValueError.
This type’s implementation and inherited behavior are available in the linked release source.
Release source · Runtime guarantees · Capability guides
BudgetBindingReceiver
Section titled “BudgetBindingReceiver”from cayu.budgets import BudgetBindingReceiverTrusted application/runtime receiver for common-root bindings.
Decorators: @runtime_checkable.
Bases: Protocol.
resolve_budget_binding (method)
Section titled “resolve_budget_binding (method)”async BudgetBindingReceiver.resolve_budget_binding(*, request: Any) -> BudgetBindingResolve authenticated authority; caller-shaped values are not enough.
Receivers may expose a register method with the same signature;
runtime admission prefers that registration boundary when present.