Skip to content

LineItem

@final
class LineItem

One phase’s one billing line: what was consumed, and what that costs.

quantity is a string for the same reason EstimatedUsd.amount is: division by 730 hours yields 28 significant digits and the exact figure is what lets a reader check the arithmetic against the rate table, which is the only defence against a rate that drifts without anyone noticing.

LineItem declares no __new__ or __init__, so it is not constructed directly: an instance comes back from another call in this package.

amount: Amount
display_quantity: str

The quantity at display precision, for a column a human scans.

duration: Duration | None
line: str | None

The AWS billing line, or None for a phase with no published rate to attribute it to.

note: str
phase: str

The lifecycle phase, as the Python StrEnum spells it.

quantity: str

The consumed quantity, exact, as a string.

unit: str
def to_dict() -> dict

Core’s JSON shape for a line item, as a dict. An unpriced line has no usd key at all.

def __repr__() -> str
def __str__() -> str

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.