/* tslint:disable */ /* eslint-disable */ /** * KubeVirt API * This is KubeVirt API an add-on for Kubernetes. * * The version of the OpenAPI document: 1.0.0 * Contact: kubevirt-dev@googlegroups.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { exists } from '../runtime'; import { K8sIoApiCoreV1TypedLocalObjectReference, K8sIoApiCoreV1TypedLocalObjectReferenceFromJSON, K8sIoApiCoreV1TypedLocalObjectReferenceToJSON, V1beta1VolumeRestoreOverride, V1beta1VolumeRestoreOverrideFromJSON, V1beta1VolumeRestoreOverrideToJSON, } from './'; /** * VirtualMachineRestoreSpec is the spec for a VirtualMachineRestore resource * @export * @interface V1beta1VirtualMachineRestoreSpec */ export interface V1beta1VirtualMachineRestoreSpec { /** * If the target for the restore does not exist, it will be created. Patches holds JSON patches that would be applied to the target manifest before it's created. Patches should fit the target's Kind. * * Example for a patch: {"op": "replace", "path": "/metadata/name", "value": "new-vm-name"} * @type {Array} * @memberof V1beta1VirtualMachineRestoreSpec */ patches?: Array; /** * * @type {K8sIoApiCoreV1TypedLocalObjectReference} * @memberof V1beta1VirtualMachineRestoreSpec */ target: K8sIoApiCoreV1TypedLocalObjectReference; /** * * @type {string} * @memberof V1beta1VirtualMachineRestoreSpec */ targetReadinessPolicy?: string; /** * * @type {string} * @memberof V1beta1VirtualMachineRestoreSpec */ virtualMachineSnapshotName: string; /** * VolumeRestoreOverrides gives the option to change properties of each restored volume For example, specifying the name of the restored volume, or adding labels/annotations to it * @type {Array} * @memberof V1beta1VirtualMachineRestoreSpec */ volumeRestoreOverrides?: Array; /** * * @type {string} * @memberof V1beta1VirtualMachineRestoreSpec */ volumeRestorePolicy?: string; } export function V1beta1VirtualMachineRestoreSpecFromJSON( json: any, ): V1beta1VirtualMachineRestoreSpec { return V1beta1VirtualMachineRestoreSpecFromJSONTyped(json, false); } export function V1beta1VirtualMachineRestoreSpecFromJSONTyped( json: any, _ignoreDiscriminator: boolean, ): V1beta1VirtualMachineRestoreSpec { if (json === undefined || json === null) { return json; } return { patches: !exists(json, 'patches') ? undefined : json['patches'], target: K8sIoApiCoreV1TypedLocalObjectReferenceFromJSON(json['target']), targetReadinessPolicy: !exists(json, 'targetReadinessPolicy') ? undefined : json['targetReadinessPolicy'], virtualMachineSnapshotName: json['virtualMachineSnapshotName'], volumeRestoreOverrides: !exists(json, 'volumeRestoreOverrides') ? undefined : (json['volumeRestoreOverrides'] as Array).map(V1beta1VolumeRestoreOverrideFromJSON), volumeRestorePolicy: !exists(json, 'volumeRestorePolicy') ? undefined : json['volumeRestorePolicy'], }; } export function V1beta1VirtualMachineRestoreSpecToJSON( value?: V1beta1VirtualMachineRestoreSpec | null, ): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { patches: value.patches, target: K8sIoApiCoreV1TypedLocalObjectReferenceToJSON(value.target), targetReadinessPolicy: value.targetReadinessPolicy, virtualMachineSnapshotName: value.virtualMachineSnapshotName, volumeRestoreOverrides: value.volumeRestoreOverrides === undefined ? undefined : (value.volumeRestoreOverrides as Array).map(V1beta1VolumeRestoreOverrideToJSON), volumeRestorePolicy: value.volumeRestorePolicy, }; }