/* 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'; /** * * @export * @interface Box */ export interface Box { /** * * @type {string} * @memberof Box */ id: string; /** * * @type {string} * @memberof Box */ name: string; /** * * @type {BoxStateEnum} * @memberof Box */ state: BoxStateEnum; /** * Current machine size: what the box was created with, or the size it was last resumed or forked onto. Legacy bare-metal boxes read as `default`. * @type {BoxTypeEnum} * @memberof Box */ type?: BoxTypeEnum; /** * vCPUs guaranteed by this box's type. * @type {number} * @memberof Box */ vcpu?: number; /** * RAM in GB guaranteed by this box's type. * @type {number} * @memberof Box */ memoryGB?: number; /** * Rate at which this box consumes machine time. 0.5 for `small`, 1 for `default`, 2 for `large`, and 50/9 for `xlarge`. * @type {number} * @memberof Box */ billingMultiplier?: number; /** * Machine URL when assigned. * @type {string} * @memberof Box */ url?: string | null; /** * Machine IPv6 or IPv4 address when assigned. * @type {string} * @memberof Box */ ip?: string | null; /** * * @type {Date} * @memberof Box */ createdAt?: Date | null; /** * * @type {Date} * @memberof Box */ updatedAt?: Date | null; /** * Automatic archival time, or null when auto-stop is disabled. * @type {Date} * @memberof Box */ archiveAfter?: Date | null; /** * * @type {boolean} * @memberof Box */ desktopAvailable: boolean; /** * Secret-bearing desktop stream URL when available. Redact from logs. * @type {string} * @memberof Box */ desktopUrl?: string | null; /** * * @type {boolean} * @memberof Box */ snapshotAvailable: boolean; /** * Timestamp of the most recent successfully completed snapshot, or null. * @type {Date} * @memberof Box */ snapshotCompletedAt?: Date | null; /** * The box's stable three-word subdomain slug (e.g. "frazil-pneuma-rallye"), or null before one is assigned. * @type {string} * @memberof Box */ subdomain?: string | null; /** * Timestamp of the most recent snapshot attempt of any status (queued, in_progress, completed, failed, cancelled), or null. Use with snapshotCompletedAt to detect snapshots that keep failing. * @type {Date} * @memberof Box */ lastSnapshotAttemptAt?: Date | null; /** * Status of the most recent snapshot attempt, or null if none. A value other than completed while snapshotCompletedAt stays stale indicates failing snapshots. * @type {BoxLastSnapshotStatusEnum} * @memberof Box */ lastSnapshotStatus?: BoxLastSnapshotStatusEnum | null; /** * Outcome of the create-time `setupScript`: `pending` (stored, not yet started), `running` (executing on the box in the background), `done` (exit code 0) or `failed` (non-zero exit, or the box lost track of the process). Null when the box was created without a setup script. * @type {BoxSetupStatusEnum} * @memberof Box */ setupStatus?: BoxSetupStatusEnum | null; /** * Short failure detail (exit code plus a stderr tail) when `setupStatus` is `failed`; while `pending`, may carry the last start/upload error from a retry in progress. Otherwise null. * @type {string} * @memberof Box */ setupError?: string | null; /** * Name of the Boat environment this box is running, or null if it is attached to none (a `noEnv` box, or one whose environment was deleted). A box freezes onto one environment version when it starts and keeps it for life, so this is what the box actually holds, not what the environment says today. * @type {string} * @memberof Box */ environment?: string | null; /** * Version number of `environment` that this box is pinned to. Compare it against the environment's latest version to see whether an upgrade is pending: a box below the latest is still running the older configuration until someone calls `POST /environments/{environmentId}/upgrade`. * @type {number} * @memberof Box */ environmentVersion?: number | null; } /** * @export */ export const BoxStateEnum = { Init: 'init', Provisioning: 'provisioning', Provisioned: 'provisioned', Cloning: 'cloning', Ready: 'ready', Idle: 'idle', Running: 'running', Archiving: 'archiving', Archived: 'archived', Error: 'error' } as const; export type BoxStateEnum = typeof BoxStateEnum[keyof typeof BoxStateEnum]; /** * @export */ export const BoxTypeEnum = { Small: 'small', Default: 'default', Large: 'large', Xlarge: 'xlarge' } as const; export type BoxTypeEnum = typeof BoxTypeEnum[keyof typeof BoxTypeEnum]; /** * @export */ export const BoxLastSnapshotStatusEnum = { Queued: 'queued', InProgress: 'in_progress', Completed: 'completed', Failed: 'failed', Cancelled: 'cancelled' } as const; export type BoxLastSnapshotStatusEnum = typeof BoxLastSnapshotStatusEnum[keyof typeof BoxLastSnapshotStatusEnum]; /** * @export */ export const BoxSetupStatusEnum = { Pending: 'pending', Running: 'running', Done: 'done', Failed: 'failed' } as const; export type BoxSetupStatusEnum = typeof BoxSetupStatusEnum[keyof typeof BoxSetupStatusEnum]; /** * Check if a given object implements the Box interface. */ export function instanceOfBox(value: object): value is Box { if (!('id' in value) || value['id'] === undefined) return false; if (!('name' in value) || value['name'] === undefined) return false; if (!('state' in value) || value['state'] === undefined) return false; if (!('desktopAvailable' in value) || value['desktopAvailable'] === undefined) return false; if (!('snapshotAvailable' in value) || value['snapshotAvailable'] === undefined) return false; return true; } export function BoxFromJSON(json: any): Box { return BoxFromJSONTyped(json, false); } export function BoxFromJSONTyped(json: any, ignoreDiscriminator: boolean): Box { if (json == null) { return json; } return { 'id': json['id'], 'name': json['name'], 'state': json['state'], 'type': json['type'] == null ? undefined : json['type'], 'vcpu': json['vcpu'] == null ? undefined : json['vcpu'], 'memoryGB': json['memoryGB'] == null ? undefined : json['memoryGB'], 'billingMultiplier': json['billingMultiplier'] == null ? undefined : json['billingMultiplier'], 'url': json['url'] == null ? undefined : json['url'], 'ip': json['ip'] == null ? undefined : json['ip'], 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), 'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])), 'archiveAfter': json['archiveAfter'] == null ? undefined : (new Date(json['archiveAfter'])), 'desktopAvailable': json['desktopAvailable'], 'desktopUrl': json['desktopUrl'] == null ? undefined : json['desktopUrl'], 'snapshotAvailable': json['snapshotAvailable'], 'snapshotCompletedAt': json['snapshotCompletedAt'] == null ? undefined : (new Date(json['snapshotCompletedAt'])), 'subdomain': json['subdomain'] == null ? undefined : json['subdomain'], 'lastSnapshotAttemptAt': json['lastSnapshotAttemptAt'] == null ? undefined : (new Date(json['lastSnapshotAttemptAt'])), 'lastSnapshotStatus': json['lastSnapshotStatus'] == null ? undefined : json['lastSnapshotStatus'], 'setupStatus': json['setupStatus'] == null ? undefined : json['setupStatus'], 'setupError': json['setupError'] == null ? undefined : json['setupError'], 'environment': json['environment'] == null ? undefined : json['environment'], 'environmentVersion': json['environmentVersion'] == null ? undefined : json['environmentVersion'], }; } export function BoxToJSON(json: any): Box { return BoxToJSONTyped(json, false); } export function BoxToJSONTyped(value?: Box | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'id': value['id'], 'name': value['name'], 'state': value['state'], 'type': value['type'], 'vcpu': value['vcpu'], 'memoryGB': value['memoryGB'], 'billingMultiplier': value['billingMultiplier'], 'url': value['url'], 'ip': value['ip'], 'createdAt': value['createdAt'] == null ? value['createdAt'] : value['createdAt'].toISOString(), 'updatedAt': value['updatedAt'] == null ? value['updatedAt'] : value['updatedAt'].toISOString(), 'archiveAfter': value['archiveAfter'] == null ? value['archiveAfter'] : value['archiveAfter'].toISOString(), 'desktopAvailable': value['desktopAvailable'], 'desktopUrl': value['desktopUrl'], 'snapshotAvailable': value['snapshotAvailable'], 'snapshotCompletedAt': value['snapshotCompletedAt'] == null ? value['snapshotCompletedAt'] : value['snapshotCompletedAt'].toISOString(), 'subdomain': value['subdomain'], 'lastSnapshotAttemptAt': value['lastSnapshotAttemptAt'] == null ? value['lastSnapshotAttemptAt'] : value['lastSnapshotAttemptAt'].toISOString(), 'lastSnapshotStatus': value['lastSnapshotStatus'], 'setupStatus': value['setupStatus'], 'setupError': value['setupError'], 'environment': value['environment'], 'environmentVersion': value['environmentVersion'], }; }