/* 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'; /** * A named snapshot: a frozen copy of a box's disk at one moment, saved under a name you pick. Independent of the source box's later life: the box can change, stop, or be deleted and the named snapshot still deploys. Named snapshots never expire; re-saving a name replaces its artifact. * @export * @interface NamedSnapshot */ export interface NamedSnapshot { /** * The user-chosen handle, unique within your account. * @type {string} * @memberof NamedSnapshot */ name: string; /** * `saving` while the capture and pin are in flight (a live source box takes a fresh snapshot first, which can run minutes), `ready` when deployable, `failed` if the save did not complete (see `error`; save again to retry). * @type {NamedSnapshotStatusEnum} * @memberof NamedSnapshot */ status: NamedSnapshotStatusEnum; /** * Failure reason. Only present when `status` is `failed`. * @type {string} * @memberof NamedSnapshot */ error?: string; /** * The box this snapshot was saved from (display only). * @type {string} * @memberof NamedSnapshot */ sourceBoxId: string; /** * The frozen artifact behind the name. Present once `status` is `ready`. Accepted by `GET /api/box/snapshots/{snapshotId}/tree` to browse its files. * @type {string} * @memberof NamedSnapshot */ snapshotId?: string; /** * Box type the snapshot was saved from. Deploys default to it. * @type {string} * @memberof NamedSnapshot */ type?: string; /** * Restored content size of the frozen state, in bytes. * @type {number} * @memberof NamedSnapshot */ sizeBytes?: number; /** * * @type {Date} * @memberof NamedSnapshot */ createdAt: Date; } /** * @export */ export const NamedSnapshotStatusEnum = { Saving: 'saving', Ready: 'ready', Failed: 'failed' } as const; export type NamedSnapshotStatusEnum = typeof NamedSnapshotStatusEnum[keyof typeof NamedSnapshotStatusEnum]; /** * Check if a given object implements the NamedSnapshot interface. */ export function instanceOfNamedSnapshot(value: object): value is NamedSnapshot { if (!('name' in value) || value['name'] === undefined) return false; if (!('status' in value) || value['status'] === undefined) return false; if (!('sourceBoxId' in value) || value['sourceBoxId'] === undefined) return false; if (!('createdAt' in value) || value['createdAt'] === undefined) return false; return true; } export function NamedSnapshotFromJSON(json: any): NamedSnapshot { return NamedSnapshotFromJSONTyped(json, false); } export function NamedSnapshotFromJSONTyped(json: any, ignoreDiscriminator: boolean): NamedSnapshot { if (json == null) { return json; } return { 'name': json['name'], 'status': json['status'], 'error': json['error'] == null ? undefined : json['error'], 'sourceBoxId': json['sourceBoxId'], 'snapshotId': json['snapshotId'] == null ? undefined : json['snapshotId'], 'type': json['type'] == null ? undefined : json['type'], 'sizeBytes': json['sizeBytes'] == null ? undefined : json['sizeBytes'], 'createdAt': (new Date(json['createdAt'])), }; } export function NamedSnapshotToJSON(json: any): NamedSnapshot { return NamedSnapshotToJSONTyped(json, false); } export function NamedSnapshotToJSONTyped(value?: NamedSnapshot | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'name': value['name'], 'status': value['status'], 'error': value['error'], 'sourceBoxId': value['sourceBoxId'], 'snapshotId': value['snapshotId'], 'type': value['type'], 'sizeBytes': value['sizeBytes'], 'createdAt': value['createdAt'].toISOString(), }; }