MacModelService
Section titled “MacModelService”class MacModelService()The Mac model registry (GET /mac-models).
MacModelService.__init__
Section titled “MacModelService.__init__”def __init__(impl: AsyncMacModelService, bridge: SyncBridge) -> NoneMacModelService.catalog
Section titled “MacModelService.catalog”def catalog(*, region: Optional[str] = None) -> MacCatalogFree Macs and prices per Mac model (GET /mac-catalog). available is advisory; price is null on a cell without billing.
MacModelService.list
Section titled “MacModelService.list”def list() -> List[MacModel]Every registered Mac model, ordered by id.
AsyncMacModelService
Section titled “AsyncMacModelService”class AsyncMacModelService()The Mac model registry (GET /mac-models).
Lists the models reservations.create(model=...) accepts, with each
model’s whole vCPUs, physical memory, physical SSD capacity and sandbox
disk room in MiB, and the layouts it offers. catalog() adds free Macs
and prices.
AsyncMacModelService.__init__
Section titled “AsyncMacModelService.__init__”def __init__(transport: AsyncTransport) -> NoneAsyncMacModelService.list
Section titled “AsyncMacModelService.list”async def list() -> List[MacModel]Every registered Mac model, ordered by id.
AsyncMacModelService.catalog
Section titled “AsyncMacModelService.catalog”async def catalog(*, region: Optional[str] = None) -> MacCatalogFree Macs and prices per Mac model (GET /mac-catalog). available is advisory; price is null on a cell without billing.
MacModel
Section titled “MacModel”class MacModel(BaseModel)A Mac model.
Attributes:
disk_mibStrictInt = Field(description=‘Physical SSD capacity in MiB, not free space or a per-sandbox disk allowance.’)idStrictStr = Field(description=‘Mac model slug accepted by POST /reservations.’)layoutsList[MacModelLayout] = Field(description=‘The layouts this model is sold in, split before whole. Empty when the model is not sold.’)memory_mibStrictInt = Field(description=‘Physical memory in MiB.’)nameStrictStr = Field(description=‘Display name of the Mac model.’)sandbox_disk_mibStrictInt = Field(description=“Disk room for sandboxes on one Mac of this model, in MiB. The disks of all sandboxes on the Mac, stopped sandboxes included, add up to at most this. Zero until the model’s disk room is measured.”)vcpusStrictInt = Field(description=‘Whole vCPUs in the Mac.’)additional_propertiesDict[str, Any] = {}
model_config
Section titled “model_config”model_config = ConfigDict(populate_by_name=True, validate_assignment=True, protected_namespaces=())MacModel.to_str
Section titled “MacModel.to_str”def to_str() -> strReturns the string representation of the model using alias
MacModel.to_json
Section titled “MacModel.to_json”def to_json() -> strReturns the JSON representation of the model using alias
MacModel.from_json
Section titled “MacModel.from_json”@classmethoddef from_json(json_str: str) -> Optional[Self]Create an instance of MacModel from a JSON string
MacModel.to_dict
Section titled “MacModel.to_dict”def to_dict() -> Dict[str, Any]Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s
self.model_dump(by_alias=True):
Noneis only added to the output dict for nullable fields that were set at model initialization. Other fields with valueNoneare ignored.- Fields in
self.additional_propertiesare added to the output dict.
MacModel.from_dict
Section titled “MacModel.from_dict”@classmethoddef from_dict(obj: Optional[Dict[str, Any]]) -> Optional[Self]Create an instance of MacModel from a dict
MacCatalog
Section titled “MacCatalog”class MacCatalog(BaseModel)Free Macs and prices per Mac model, per region.
Attributes:
regionsList[MacCatalogRegion] = Field(description=‘Every region the answer covers, in catalog order.’)additional_propertiesDict[str, Any] = {}
model_config
Section titled “model_config”model_config = ConfigDict(populate_by_name=True, validate_assignment=True, protected_namespaces=())MacCatalog.to_str
Section titled “MacCatalog.to_str”def to_str() -> strReturns the string representation of the model using alias
MacCatalog.to_json
Section titled “MacCatalog.to_json”def to_json() -> strReturns the JSON representation of the model using alias
MacCatalog.from_json
Section titled “MacCatalog.from_json”@classmethoddef from_json(json_str: str) -> Optional[Self]Create an instance of MacCatalog from a JSON string
MacCatalog.to_dict
Section titled “MacCatalog.to_dict”def to_dict() -> Dict[str, Any]Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s
self.model_dump(by_alias=True):
Noneis only added to the output dict for nullable fields that were set at model initialization. Other fields with valueNoneare ignored.- Fields in
self.additional_propertiesare added to the output dict.
MacCatalog.from_dict
Section titled “MacCatalog.from_dict”@classmethoddef from_dict(obj: Optional[Dict[str, Any]]) -> Optional[Self]Create an instance of MacCatalog from a dict