/* 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 } from '../runtime'; import { IoK8sApiResourceV1beta2DeviceSubRequest, IoK8sApiResourceV1beta2DeviceSubRequestFromJSON, IoK8sApiResourceV1beta2DeviceSubRequestToJSON, IoK8sApiResourceV1beta2ExactDeviceRequest, IoK8sApiResourceV1beta2ExactDeviceRequestFromJSON, IoK8sApiResourceV1beta2ExactDeviceRequestToJSON, } from './'; /** * DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices. With FirstAvailable it is also possible to provide a prioritized list of requests. * @export * @interface IoK8sApiResourceV1beta2DeviceRequest */ export interface IoK8sApiResourceV1beta2DeviceRequest { /** * * @type {IoK8sApiResourceV1beta2ExactDeviceRequest} * @memberof IoK8sApiResourceV1beta2DeviceRequest */ exactly?: IoK8sApiResourceV1beta2ExactDeviceRequest; /** * FirstAvailable contains subrequests, of which exactly one will be selected by the scheduler. It tries to satisfy them in the order in which they are listed here. So if there are two entries in the list, the scheduler will only check the second one if it determines that the first one can not be used. * * DRA does not yet implement scoring, so the scheduler will select the first set of devices that satisfies all the requests in the claim. And if the requirements can be satisfied on more than one node, other scheduling features will determine which node is chosen. This means that the set of devices allocated to a claim might not be the optimal set available to the cluster. Scoring will be implemented later. * @type {Array} * @memberof IoK8sApiResourceV1beta2DeviceRequest */ firstAvailable?: Array; /** * Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim. * * References using the name in the DeviceRequest will uniquely identify a request when the Exactly field is set. When the FirstAvailable field is set, a reference to the name of the DeviceRequest will match whatever subrequest is chosen by the scheduler. * * Must be a DNS label. * @type {string} * @memberof IoK8sApiResourceV1beta2DeviceRequest */ name: string; } export function IoK8sApiResourceV1beta2DeviceRequestFromJSON( json: any, ): IoK8sApiResourceV1beta2DeviceRequest { return IoK8sApiResourceV1beta2DeviceRequestFromJSONTyped(json, false); } export function IoK8sApiResourceV1beta2DeviceRequestFromJSONTyped( json: any, _ignoreDiscriminator: boolean, ): IoK8sApiResourceV1beta2DeviceRequest { if (json === undefined || json === null) { return json; } return { exactly: !exists(json, 'exactly') ? undefined : IoK8sApiResourceV1beta2ExactDeviceRequestFromJSON(json['exactly']), firstAvailable: !exists(json, 'firstAvailable') ? undefined : (json['firstAvailable'] as Array).map(IoK8sApiResourceV1beta2DeviceSubRequestFromJSON), name: json['name'], }; } export function IoK8sApiResourceV1beta2DeviceRequestToJSON( value?: IoK8sApiResourceV1beta2DeviceRequest | null, ): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { exactly: IoK8sApiResourceV1beta2ExactDeviceRequestToJSON(value.exactly), firstAvailable: value.firstAvailable === undefined ? undefined : (value.firstAvailable as Array).map(IoK8sApiResourceV1beta2DeviceSubRequestToJSON), name: value.name, }; }