Skip to content
ocx
install

BuildReceipt

BuildReceiptclassdataclass#

Re-exported from ocx_sdk._resultsView source
class BuildReceipt(platform: str | None = None, identifier: str | None = None)

The <bundle-stem>-receipt.json sidecar ocx package create writes.

ocx package receipt <bundle> prints what create was told — the platform it resolved against and the identifier the bundle will publish under — so push and test need not restate either. Both keys are absent when the build recorded neither, never null, so both are read with .get.

The receipt file itself (<stem>-receipt.json, build_receipt.rs) is ocx’s; this SDK never reads it directly. Its format version stays behind the command, which answers exit 65 for a file it cannot read and exit 79 for a bundle with no receipt beside it.

Attributes

NameTypeDescription
platformstr | NoneThe --platform recorded, canonical grammar, when given.
identifierstr | NoneThe --identifier recorded, resolved against the default registry, when given.

identifierattributeclass attributeinstance attribute#

identifier: str | None = None

platformattributeclass attributeinstance attribute#

platform: str | None = None

refproperty#

ref: PackageRef | None

The recorded identifier as a PackageRef, or None when none was recorded.

from_dictmethodclassmethod#

def from_dict(data: Mapping[str, Any]) -> BuildReceipt

Build from the decoded report.

from_jsonmethodclassmethod#

def from_json(raw: str) -> BuildReceipt

Parse ocx --format json package receipt output.