/* 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 { SnapshotTreeEntry } from './SnapshotTreeEntry'; import { SnapshotTreeEntryFromJSON, SnapshotTreeEntryFromJSONTyped, SnapshotTreeEntryToJSON, SnapshotTreeEntryToJSONTyped, } from './SnapshotTreeEntry'; /** * * @export * @interface SnapshotTreeResponse */ export interface SnapshotTreeResponse { /** * * @type {boolean} * @memberof SnapshotTreeResponse */ ok: boolean; /** * * @type {SnapshotTreeResponseTypeEnum} * @memberof SnapshotTreeResponse */ type: SnapshotTreeResponseTypeEnum; /** * * @type {string} * @memberof SnapshotTreeResponse */ snapshotId: string; /** * * @type {string} * @memberof SnapshotTreeResponse */ boxId: string; /** * * @type {number} * @memberof SnapshotTreeResponse */ generation: number; /** * `false` for legacy snapshots or inventories too large to expand; see `reason`. * @type {boolean} * @memberof SnapshotTreeResponse */ treeAvailable: boolean; /** * `true` when the file list was capped; not every entry is returned. * @type {boolean} * @memberof SnapshotTreeResponse */ truncated: boolean; /** * Number of your files in this snapshot (base-image system files excluded). * @type {number} * @memberof SnapshotTreeResponse */ fileCount: number; /** * Total bytes of your data in this snapshot (base-image system files excluded). * @type {number} * @memberof SnapshotTreeResponse */ totalSizeBytes: number; /** * Exactly the files/dirs a resume or download returns, your data only; base-image system entries are not listed. * @type {Array} * @memberof SnapshotTreeResponse */ entries: Array; /** * Why the tree is unavailable, when `treeAvailable` is `false`. * @type {string} * @memberof SnapshotTreeResponse */ reason?: string; } /** * @export */ export const SnapshotTreeResponseTypeEnum = { SnapshotTree: 'snapshot.tree' } as const; export type SnapshotTreeResponseTypeEnum = typeof SnapshotTreeResponseTypeEnum[keyof typeof SnapshotTreeResponseTypeEnum]; /** * Check if a given object implements the SnapshotTreeResponse interface. */ export function instanceOfSnapshotTreeResponse(value: object): value is SnapshotTreeResponse { 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 (!('generation' in value) || value['generation'] === undefined) return false; if (!('treeAvailable' in value) || value['treeAvailable'] === undefined) return false; if (!('truncated' in value) || value['truncated'] === undefined) return false; if (!('fileCount' in value) || value['fileCount'] === undefined) return false; if (!('totalSizeBytes' in value) || value['totalSizeBytes'] === undefined) return false; if (!('entries' in value) || value['entries'] === undefined) return false; return true; } export function SnapshotTreeResponseFromJSON(json: any): SnapshotTreeResponse { return SnapshotTreeResponseFromJSONTyped(json, false); } export function SnapshotTreeResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SnapshotTreeResponse { if (json == null) { return json; } return { 'ok': json['ok'], 'type': json['type'], 'snapshotId': json['snapshotId'], 'boxId': json['boxId'], 'generation': json['generation'], 'treeAvailable': json['treeAvailable'], 'truncated': json['truncated'], 'fileCount': json['fileCount'], 'totalSizeBytes': json['totalSizeBytes'], 'entries': ((json['entries'] as Array).map(SnapshotTreeEntryFromJSON)), 'reason': json['reason'] == null ? undefined : json['reason'], }; } export function SnapshotTreeResponseToJSON(json: any): SnapshotTreeResponse { return SnapshotTreeResponseToJSONTyped(json, false); } export function SnapshotTreeResponseToJSONTyped(value?: SnapshotTreeResponse | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'ok': value['ok'], 'type': value['type'], 'snapshotId': value['snapshotId'], 'boxId': value['boxId'], 'generation': value['generation'], 'treeAvailable': value['treeAvailable'], 'truncated': value['truncated'], 'fileCount': value['fileCount'], 'totalSizeBytes': value['totalSizeBytes'], 'entries': ((value['entries'] as Array).map(SnapshotTreeEntryToJSON)), 'reason': value['reason'], }; }