Sign Up

MacModelService

class MacModelService()

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

MacModelService.__init__

def __init__(impl: AsyncMacModelService, bridge: SyncBridge) -> None

MacModelService.catalog

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.

MacModelService.list

def list() -> List[MacModel]

Every registered Mac model, ordered by id.

AsyncMacModelService

class AsyncMacModelService()

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

Lists the models reservations.create(model=...) accepts, with each model's CPU cores, physical memory, physical SSD capacity and sandbox disk room in MiB, maximum sandbox count, and default sandbox size. catalog() adds free Macs and prices.

AsyncMacModelService.__init__

def __init__(transport: AsyncTransport) -> None

AsyncMacModelService.list

async def list() -> List[MacModel]

Every registered Mac model, ordered by id.

AsyncMacModelService.catalog

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.

MacModel

class MacModel(BaseModel)

A Mac model.

Attributes:

  • default_size Optional[MacResources]
  • 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.')
  • max_sandboxes StrictInt = Field(description='Most sandboxes a Mac of this model runs at once: 2 when its cores, memory, and sandbox disk room each fit two minimum-sized sandboxes (4 cores, 4096 MiB, 81920 MiB of disk), 1 when they fit one, and 0 when they fit none. The sizes of the running sandboxes must also fit the Mac.')
  • 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='CPU cores in the Mac.')
  • additional_properties Dict[str, Any] = {}
model_config
model_config = ConfigDict(populate_by_name=True, validate_assignment=True, protected_namespaces=())

MacModel.to_str

def to_str() -> str

Returns the string representation of the model using alias

MacModel.to_json

def to_json() -> str

Returns the JSON representation of the model using alias

MacModel.from_json

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

Create an instance of MacModel from a JSON string

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

  • 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.

MacModel.from_dict

@classmethod
def from_dict(obj: Optional[Dict[str, Any]]) -> Optional[Self]

Create an instance of MacModel from a dict

MacCatalog

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
model_config = ConfigDict(populate_by_name=True, validate_assignment=True, protected_namespaces=())

MacCatalog.to_str

def to_str() -> str

Returns the string representation of the model using alias

MacCatalog.to_json

def to_json() -> str

Returns the JSON representation of the model using alias

MacCatalog.from_json

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

Create an instance of MacCatalog from a JSON string

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

  • 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.

MacCatalog.from_dict

@classmethod
def from_dict(obj: Optional[Dict[str, Any]]) -> Optional[Self]

Create an instance of MacCatalog from a dict