/* 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'; import type { SnapshotChunk } from './SnapshotChunk'; import { SnapshotChunkFromJSON, SnapshotChunkFromJSONTyped, SnapshotChunkToJSON, SnapshotChunkToJSONTyped, } from './SnapshotChunk'; import type { SnapshotDownloadResponseAllOfInventory } from './SnapshotDownloadResponseAllOfInventory'; import { SnapshotDownloadResponseAllOfInventoryFromJSON, SnapshotDownloadResponseAllOfInventoryFromJSONTyped, SnapshotDownloadResponseAllOfInventoryToJSON, SnapshotDownloadResponseAllOfInventoryToJSONTyped, } from './SnapshotDownloadResponseAllOfInventory'; /** * * @export * @interface SnapshotDownloadResponse */ export interface SnapshotDownloadResponse { /** * * @type {boolean} * @memberof SnapshotDownloadResponse */ ok: boolean; /** * * @type {SnapshotDownloadResponseTypeEnum} * @memberof SnapshotDownloadResponse */ type: SnapshotDownloadResponseTypeEnum; /** * * @type {string} * @memberof SnapshotDownloadResponse */ snapshotId: string; /** * * @type {string} * @memberof SnapshotDownloadResponse */ boxId: string; /** * * @type {SnapshotDownloadResponseKindEnum} * @memberof SnapshotDownloadResponse */ kind: SnapshotDownloadResponseKindEnum; /** * * @type {number} * @memberof SnapshotDownloadResponse */ generation: number; /** * Lifetime of every `signedUrl` in this response. * @type {number} * @memberof SnapshotDownloadResponse */ expiresInSeconds: number; /** * Human-readable note on how to reassemble the chunks into a filesystem. * @type {string} * @memberof SnapshotDownloadResponse */ reconstruct: string; /** * * @type {SnapshotDownloadResponseAllOfInventory} * @memberof SnapshotDownloadResponse */ inventory?: SnapshotDownloadResponseAllOfInventory | null; /** * Every chunk across the chain (all generations up to and including this snapshot), ordered by `(generation, chunkIndex)`. * @type {Array} * @memberof SnapshotDownloadResponse */ chunks: Array; } /** * @export */ export const SnapshotDownloadResponseTypeEnum = { SnapshotDownload: 'snapshot.download' } as const; export type SnapshotDownloadResponseTypeEnum = typeof SnapshotDownloadResponseTypeEnum[keyof typeof SnapshotDownloadResponseTypeEnum]; /** * @export */ export const SnapshotDownloadResponseKindEnum = { Base: 'base', Incremental: 'incremental', Legacy: 'legacy' } as const; export type SnapshotDownloadResponseKindEnum = typeof SnapshotDownloadResponseKindEnum[keyof typeof SnapshotDownloadResponseKindEnum]; /** * Check if a given object implements the SnapshotDownloadResponse interface. */ export function instanceOfSnapshotDownloadResponse(value: object): value is SnapshotDownloadResponse { if (!('ok' in value) || value['ok'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; if (!('snapshotId' in value) || value['snapshotId'] === undefined) return false; if (!('boxId' in value) || value['boxId'] === undefined) return false; if (!('kind' in value) || value['kind'] === undefined) return false; if (!('generation' in value) || value['generation'] === undefined) return false; if (!('expiresInSeconds' in value) || value['expiresInSeconds'] === undefined) return false; if (!('reconstruct' in value) || value['reconstruct'] === undefined) return false; if (!('chunks' in value) || value['chunks'] === undefined) return false; return true; } export function SnapshotDownloadResponseFromJSON(json: any): SnapshotDownloadResponse { return SnapshotDownloadResponseFromJSONTyped(json, false); } export function SnapshotDownloadResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SnapshotDownloadResponse { if (json == null) { return json; } return { 'ok': json['ok'], 'type': json['type'], 'snapshotId': json['snapshotId'], 'boxId': json['boxId'], 'kind': json['kind'], 'generation': json['generation'], 'expiresInSeconds': json['expiresInSeconds'], 'reconstruct': json['reconstruct'], 'inventory': json['inventory'] == null ? undefined : SnapshotDownloadResponseAllOfInventoryFromJSON(json['inventory']), 'chunks': ((json['chunks'] as Array).map(SnapshotChunkFromJSON)), }; } export function SnapshotDownloadResponseToJSON(json: any): SnapshotDownloadResponse { return SnapshotDownloadResponseToJSONTyped(json, false); } export function SnapshotDownloadResponseToJSONTyped(value?: SnapshotDownloadResponse | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'ok': value['ok'], 'type': value['type'], 'snapshotId': value['snapshotId'], 'boxId': value['boxId'], 'kind': value['kind'], 'generation': value['generation'], 'expiresInSeconds': value['expiresInSeconds'], 'reconstruct': value['reconstruct'], 'inventory': SnapshotDownloadResponseAllOfInventoryToJSON(value['inventory']), 'chunks': ((value['chunks'] as Array).map(SnapshotChunkToJSON)), }; }