Skip to content
View as Markdown
class MacModelService()

The Mac model registry (GET /mac-models).

def __init__(impl: AsyncMacModelService, bridge: SyncBridge) -> None
def catalog(*, region: Optional[str] = None) -> MacCatalog

Free Macs and prices per Mac model (GET /mac-catalog). available is advisory; price is null on a cell without billing.

def list() -> List[MacModel]

Every registered Mac model, ordered by id.

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.

def __init__(transport: AsyncTransport) -> None
async def list() -> List[MacModel]

Every registered Mac model, ordered by id.

async def catalog(*, region: Optional[str] = None) -> MacCatalog

Free Macs and prices per Mac model (GET /mac-catalog). available is advisory; price is null on a cell without billing.

class MacModel(BaseModel)

A Mac model.

Attributes:

  • disk_mib StrictInt = Field(description=‘Physical SSD capacity in MiB, not free space or a per-sandbox disk allowance.’)
  • id StrictStr = Field(description=‘Mac model slug accepted by POST /reservations.’)
  • layouts List[MacModelLayout] = Field(description=‘The layouts this model is sold in, split before whole. Empty when the model is not sold.’)
  • memory_mib StrictInt = Field(description=‘Physical memory in MiB.’)
  • name StrictStr = Field(description=‘Display name of the Mac model.’)
  • sandbox_disk_mib StrictInt = 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.”)
  • vcpus StrictInt = Field(description=‘Whole vCPUs in the Mac.’)
  • additional_properties Dict[str, Any] = {}
model_config = ConfigDict(populate_by_name=True, validate_assignment=True, protected_namespaces=())
def to_str() -> str

Returns the string representation of the model using alias

def to_json() -> str

Returns the JSON representation of the model using alias

@classmethod
def from_json(json_str: str) -> Optional[Self]

Create an instance of MacModel from a JSON string

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):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
  • Fields in self.additional_properties are added to the output dict.
@classmethod
def from_dict(obj: Optional[Dict[str, Any]]) -> Optional[Self]

Create an instance of MacModel from a dict

class MacCatalog(BaseModel)

Free Macs and prices per Mac model, per region.

Attributes:

  • regions List[MacCatalogRegion] = Field(description=‘Every region the answer covers, in catalog order.’)
  • additional_properties Dict[str, Any] = {}
model_config = ConfigDict(populate_by_name=True, validate_assignment=True, protected_namespaces=())
def to_str() -> str

Returns the string representation of the model using alias

def to_json() -> str

Returns the JSON representation of the model using alias

@classmethod
def from_json(json_str: str) -> Optional[Self]

Create an instance of MacCatalog from a JSON string

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):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
  • Fields in self.additional_properties are added to the output dict.
@classmethod
def from_dict(obj: Optional[Dict[str, Any]]) -> Optional[Self]

Create an instance of MacCatalog from a dict