@finalclass AmountWhat a line item’s cost can be: an estimate, or unpriced.
A class rather than a union, because a union in Python is a documentation convention
and this has to be something a caller can branch on. kind is the stable tag
("estimated-usd" / "unpriced"), usd is None for the unpriced case, and
unpriced is None for the priced one — so exactly one of the two is present and a
reader who checks either has handled both.
Constructor
Section titled “Constructor”Amount declares no __new__ or __init__, so it is not constructed directly: an instance comes back from another call in this package.
Properties
Section titled “Properties”kind: str"estimated-usd" or "unpriced" — the tag cli.py puts in amount.kind.
unpriced
Section titled “unpriced”unpriced: Unpriced | NoneThe unpriced half, or None when the line was priced.
usd: EstimatedUsd | NoneThe estimate, or None when there is no published rate.
None rather than a zero, which is the same decision as the JSON omitting the
usd key: a zero gets summed by anything permissive, and that is the one
arithmetic this module refuses to enable.
Special methods
Section titled “Special methods”__repr__
Section titled “__repr__”def __repr__() -> str__str__
Section titled “__str__”def __str__() -> strProvenance
Section titled “Provenance”This page is generated from bindings/microvms-py/microvms.pyi by Griffe 2.3.0, run from site/scripts/gen-reference.mjs on every pnpm run sync, so an edit made here is overwritten by the next run.
To change the page, change the doc comment in the binding’s Rust source, then regenerate the declarations with mise run stubs. mise run stubs:check fails when the committed file no longer matches the source.