/* tslint:disable */ /* eslint-disable */ /** * Boat Public API v1 * Public JSON API for creating, operating, prompting, observing, and exposing Boat sandboxes from backend services, CI jobs, hosted workers, and Boat automation products. The v1 reference intentionally documents the developer integration surface only. Dashboard billing actions are not part of v1. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { mapValues } from '../runtime'; /** * Options for provisioning a new cloud computer. * @export * @interface CreateBoxRequest */ export interface CreateBoxRequest { /** * Machine size. `small` consumes machine time at half rate and `large` at twice the default rate (see the Billing guide). `xlarge` costs $0.20 per running hour, requires the effective $100 plan or higher, and requires an explicit bare-metal operator allocation. A fork inherits the source box's type unless the fork request passes its own, and resume and fork can move a box between sizes. * @type {CreateBoxRequestTypeEnum} * @memberof CreateBoxRequest */ type?: CreateBoxRequestTypeEnum; /** * Number of seconds before automatic archival. `null` disables auto-stop. The backend also accepts the string `infinite` for legacy compatibility; new clients should send null. * @type {number} * @memberof CreateBoxRequest */ ttlSeconds?: number | null; /** * Per-box environment variables injected into the box's tool environment, on top of the account environment's variables (per-box values win on conflicts). Keys must match `[A-Za-z_][A-Za-z0-9_]{0,127}`; at most 100 variables and 64KB total. Reserved names (`ASCII_TOKEN`, `ASCII_API_URL`, `AGENT_ID`, `PRODUCT_MODE`, `ENVIRONMENT_ID`, `BOX_ID`, `SERVICE_PREVIEW_TOKEN`, `BOX_CLI_TOKEN`) are rejected with `invalid_env`. Forked boxes inherit the source box's env unless the fork request supplies its own `env`. * @type {{ [key: string]: string; }} * @memberof CreateBoxRequest */ env?: { [key: string]: string; }; /** * Name of the Boat environment to attach to this box. Environments are managed in the Boat dashboard and bundle the repositories, secrets, and credential toggles a box gets. Omit to use your default environment (`base` unless you changed it). Unknown names are rejected with `unknown_environment`. An environment marked "safe for third parties" passes nothing to the box, exactly like `noEnv`. * @type {string} * @memberof CreateBoxRequest */ environment?: string; /** * Create a box with none of the secrets attached to your account (no environment variables, secret files, or credentials), confined to itself so it cannot act on your account or other boxes. For boxes you give to your own users. SSH, SCP, desktop, snapshots, and public URLs still work; pass `env` to give the box a secret of its own. A fork of a no-env box is always no-env. Equivalent to attaching an environment marked "safe for third parties". * @type {boolean} * @memberof CreateBoxRequest */ noEnv?: boolean; /** * Shell script that runs on the box after it is ready. Ready means "ready to accept the user", not "setup done": the script starts in the background once provisioning completes and never blocks the box becoming usable. It runs as the box user via `bash`, with the box's environment applied, and its output goes to a log file on the box. Observe the outcome as `setupStatus` (pending/running/done/failed) and `setupError` on the box. Rejected with a 400 `invalid_setup_script` error when it is not a string or exceeds 64KB. * @type {string} * @memberof CreateBoxRequest */ setupScript?: string; /** * Bill this box to a team you belong to (the team's shared wallet). Your own account id means personal billing. Listing, snapshots, and environments stay yours: the org is a wallet, not a shared workspace. Takes precedence over `teamId` and over the `X-Box-Org` / `?org=` request scope. * @type {string} * @memberof CreateBoxRequest */ org?: string; /** * Legacy alias for `org`. Ignored when `org` is also set. * @type {string} * @memberof CreateBoxRequest */ teamId?: string; /** * Create the box from a named snapshot (saved with `POST /named-snapshots`, or `box snapshot ` in the CLI). The box starts from that exact frozen state. Omitting `type` inherits the type the snapshot was saved from; env and no-env inherit from the snapshot's source box unless the request passes its own, with the same rules as forking. * @type {string} * @memberof CreateBoxRequest */ from?: string; } /** * @export */ export const CreateBoxRequestTypeEnum = { Small: 'small', Default: 'default', Large: 'large', Xlarge: 'xlarge' } as const; export type CreateBoxRequestTypeEnum = typeof CreateBoxRequestTypeEnum[keyof typeof CreateBoxRequestTypeEnum]; /** * Check if a given object implements the CreateBoxRequest interface. */ export function instanceOfCreateBoxRequest(value: object): value is CreateBoxRequest { return true; } export function CreateBoxRequestFromJSON(json: any): CreateBoxRequest { return CreateBoxRequestFromJSONTyped(json, false); } export function CreateBoxRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateBoxRequest { if (json == null) { return json; } return { 'type': json['type'] == null ? undefined : json['type'], 'ttlSeconds': json['ttlSeconds'] == null ? undefined : json['ttlSeconds'], 'env': json['env'] == null ? undefined : json['env'], 'environment': json['environment'] == null ? undefined : json['environment'], 'noEnv': json['noEnv'] == null ? undefined : json['noEnv'], 'setupScript': json['setupScript'] == null ? undefined : json['setupScript'], 'org': json['org'] == null ? undefined : json['org'], 'teamId': json['teamId'] == null ? undefined : json['teamId'], 'from': json['from'] == null ? undefined : json['from'], }; } export function CreateBoxRequestToJSON(json: any): CreateBoxRequest { return CreateBoxRequestToJSONTyped(json, false); } export function CreateBoxRequestToJSONTyped(value?: CreateBoxRequest | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'type': value['type'], 'ttlSeconds': value['ttlSeconds'], 'env': value['env'], 'environment': value['environment'], 'noEnv': value['noEnv'], 'setupScript': value['setupScript'], 'org': value['org'], 'teamId': value['teamId'], 'from': value['from'], }; }