OperationBuilder
Class: warmhub.OperationBuilder
OperationBuilder(submit: SubmitCallable, *, options: CommitOptions | None = None, shapes: Mapping[str, ShapeFields] | None = None)Fluent builder for composing, validating, and submitting operations.
The blocking half of the pair. commit() returns a
SubmitResult — no await, and none accepted:
batch = repo.batch(message="seed")batch.add("probe-1", shapes=["Reading"], data={"temp_celsius": 21.0})result = batch.commit()The builder is not awaitable and has no build(). Finish a batch by
calling commit, which validates, submits, and seals it. Reusing a
sealed builder raises.
Methods
Section titled “Methods”add(name: str, *, shapes: Sequence[str] | Unset = UNSET, shapeless: bool | Unset = UNSET, data: JsonValue | Unset = UNSET, affirmed_targets: Sequence[str] | Unset = UNSET, skip_existing: bool | Unset = UNSET)Queue an add of the Thing name, stating its Shapes with
shapes or shapeless. Returns self so calls chain.
revise
Section titled “revise”revise(name: str, *, shapes: Sequence[str] | Unset = UNSET, shapeless: bool | Unset = UNSET, keep_shapes: bool | Unset = UNSET, data: JsonValue | Unset = UNSET, affirmed_targets: Sequence[str] | Unset = UNSET, expected_version: int | Unset = UNSET, lease_id: str | Unset = UNSET)Queue a revise of the Thing name, stating its Shapes with
shapes, shapeless or keep_shapes. Returns self.
keep_shapes reads the current set and version at submit and sends
the version as expectedVersion. It sends the Shapes bare, so the
revise re-certifies under each Shape’s head version. keep_shapes pins
the version it read; a cross-process resubmit of the same
submission_id can conflict; explicit shapes is the retry-safe form.
retract
Section titled “retract”retract(name: str, *, reason: str | Unset = UNSET, expected_version: int | Unset = UNSET, lease_id: str | Unset = UNSET)Queue a retract of name. Returns self so calls chain.
restore
Section titled “restore”restore(name: str, *, new_name: str | Unset = UNSET, expected_version: int | Unset = UNSET, lease_id: str | Unset = UNSET)Queue a restore of a retracted Thing, by durable ID.
Returns self so calls chain.
reaffirm
Section titled “reaffirm”reaffirm(name: str, *, add: Sequence[str] | Unset = UNSET, remove: Sequence[str] | Unset = UNSET, expected_version: int | Unset = UNSET, lease_id: str | Unset = UNSET)Queue a reaffirm. Returns self so calls chain.
Edits which pinned target versions the assertion’s claim is affirmed
for, without changing claim data. add and remove compose in
one operation; already-present and already-absent targets are
reported as ignored rather than failing.
rename
Section titled “rename”rename(name: str, new_name: str)Queue a rename of name to new_name, both full names. A Shape
renames to a Shape. Returns self so calls chain.
has(name: str)Whether an add for name is already queued.
validate
Section titled “validate”validate()Run client-side validation without contacting the server.
commit
Section titled “commit”commit(*, extra_headers: Omittable[Mapping[str, str]] = UNSET, extra_query: Omittable[Mapping[str, str]] = UNSET)Validate, submit, and seal the builder.
extra_headers and extra_query apply to every chunk request. There
is no extra_body; see SubmitCallable.
Validation failures raise before any request is issued. Ambiguous
failures surface as PartialStreamSubmissionError; a deterministic
all-failed batch surfaces as AllStreamOperationsFailedError.
Properties and attributes
Section titled “Properties and attributes”operations
Section titled “operations”operationsThe queued operations, as an immutable snapshot.
sizeDocumentation is not yet available.
submitted
Section titled “submitted”submittedDocumentation is not yet available.