/* tslint:disable */ /* eslint-disable */ /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: unversioned * * * 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, mapValues } from '../runtime'; import { IoK8sApiCoreV1NodeSelector, IoK8sApiCoreV1NodeSelectorFromJSON, IoK8sApiCoreV1NodeSelectorToJSON, IoK8sApiResourceV1alpha3DeviceAttribute, IoK8sApiResourceV1alpha3DeviceAttributeFromJSON, IoK8sApiResourceV1alpha3DeviceAttributeToJSON, IoK8sApiResourceV1alpha3DeviceCounterConsumption, IoK8sApiResourceV1alpha3DeviceCounterConsumptionFromJSON, IoK8sApiResourceV1alpha3DeviceCounterConsumptionToJSON, IoK8sApiResourceV1alpha3DeviceTaint, IoK8sApiResourceV1alpha3DeviceTaintFromJSON, IoK8sApiResourceV1alpha3DeviceTaintToJSON, } from './'; /** * BasicDevice defines one device instance. * @export * @interface IoK8sApiResourceV1alpha3BasicDevice */ export interface IoK8sApiResourceV1alpha3BasicDevice { /** * AllNodes indicates that all nodes have access to the device. * * Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. * @type {boolean} * @memberof IoK8sApiResourceV1alpha3BasicDevice */ allNodes?: boolean; /** * Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set. * * The maximum number of attributes and capacities combined is 32. * @type {{ [key: string]: IoK8sApiResourceV1alpha3DeviceAttribute; }} * @memberof IoK8sApiResourceV1alpha3BasicDevice */ attributes?: { [key: string]: IoK8sApiResourceV1alpha3DeviceAttribute }; /** * Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set. * * The maximum number of attributes and capacities combined is 32. * @type {{ [key: string]: string; }} * @memberof IoK8sApiResourceV1alpha3BasicDevice */ capacity?: { [key: string]: string }; /** * ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets. * * There can only be a single entry per counterSet. * * The total number of device counter consumption entries must be <= 32. In addition, the total number in the entire ResourceSlice must be <= 1024 (for example, 64 devices with 16 counters each). * @type {Array} * @memberof IoK8sApiResourceV1alpha3BasicDevice */ consumesCounters?: Array; /** * NodeName identifies the node where the device is available. * * Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. * @type {string} * @memberof IoK8sApiResourceV1alpha3BasicDevice */ nodeName?: string; /** * * @type {IoK8sApiCoreV1NodeSelector} * @memberof IoK8sApiResourceV1alpha3BasicDevice */ nodeSelector?: IoK8sApiCoreV1NodeSelector; /** * If specified, these are the driver-defined taints. * * The maximum number of taints is 4. * * This is an alpha field and requires enabling the DRADeviceTaints feature gate. * @type {Array} * @memberof IoK8sApiResourceV1alpha3BasicDevice */ taints?: Array; } export function IoK8sApiResourceV1alpha3BasicDeviceFromJSON( json: any, ): IoK8sApiResourceV1alpha3BasicDevice { return IoK8sApiResourceV1alpha3BasicDeviceFromJSONTyped(json, false); } export function IoK8sApiResourceV1alpha3BasicDeviceFromJSONTyped( json: any, _ignoreDiscriminator: boolean, ): IoK8sApiResourceV1alpha3BasicDevice { if (json === undefined || json === null) { return json; } return { allNodes: !exists(json, 'allNodes') ? undefined : json['allNodes'], attributes: !exists(json, 'attributes') ? undefined : mapValues(json['attributes'], IoK8sApiResourceV1alpha3DeviceAttributeFromJSON), capacity: !exists(json, 'capacity') ? undefined : json['capacity'], consumesCounters: !exists(json, 'consumesCounters') ? undefined : (json['consumesCounters'] as Array).map( IoK8sApiResourceV1alpha3DeviceCounterConsumptionFromJSON, ), nodeName: !exists(json, 'nodeName') ? undefined : json['nodeName'], nodeSelector: !exists(json, 'nodeSelector') ? undefined : IoK8sApiCoreV1NodeSelectorFromJSON(json['nodeSelector']), taints: !exists(json, 'taints') ? undefined : (json['taints'] as Array).map(IoK8sApiResourceV1alpha3DeviceTaintFromJSON), }; } export function IoK8sApiResourceV1alpha3BasicDeviceToJSON( value?: IoK8sApiResourceV1alpha3BasicDevice | null, ): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { allNodes: value.allNodes, attributes: value.attributes === undefined ? undefined : mapValues(value.attributes, IoK8sApiResourceV1alpha3DeviceAttributeToJSON), capacity: value.capacity, consumesCounters: value.consumesCounters === undefined ? undefined : (value.consumesCounters as Array).map( IoK8sApiResourceV1alpha3DeviceCounterConsumptionToJSON, ), nodeName: value.nodeName, nodeSelector: IoK8sApiCoreV1NodeSelectorToJSON(value.nodeSelector), taints: value.taints === undefined ? undefined : (value.taints as Array).map(IoK8sApiResourceV1alpha3DeviceTaintToJSON), }; }