/* tslint:disable */ /* eslint-disable */ /** * Assisted Migration Agent API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1 * * * 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.js'; import type { Datastore } from './Datastore.js'; import { DatastoreFromJSON, DatastoreFromJSONTyped, DatastoreToJSON, DatastoreToJSONTyped, } from './Datastore.js'; import type { Network } from './Network.js'; import { NetworkFromJSON, NetworkFromJSONTyped, NetworkToJSON, NetworkToJSONTyped, } from './Network.js'; import type { Host } from './Host.js'; import { HostFromJSON, HostFromJSONTyped, HostToJSON, HostToJSONTyped, } from './Host.js'; /** * * @export * @interface Infra */ export interface Infra { /** * * @type {number} * @memberof Infra */ totalHosts: number; /** * * @type {number} * @memberof Infra */ totalDatacenters?: number; /** * * @type {number} * @memberof Infra * @deprecated */ totalClusters?: number; /** * * @type {Array} * @memberof Infra */ clustersPerDatacenter?: Array; /** * CPU Overcommitment Ratio. Calculated as total Allocated vCPUs / Total Physical Cores * @type {number} * @memberof Infra */ cpuOverCommitment?: number; /** * RAM memory Overcommitment Ratio. Calculated as total Allocated memory / Total memory available * @type {number} * @memberof Infra */ memoryOverCommitment?: number; /** * * @type {Array} * @memberof Infra */ hosts?: Array; /** * * @type {Array} * @memberof Infra * @deprecated */ hostsPerCluster?: Array; /** * * @type {Array} * @memberof Infra * @deprecated */ vmsPerCluster?: Array; /** * * @type {{ [key: string]: number; }} * @memberof Infra */ hostPowerStates: { [key: string]: number; }; /** * * @type {Array} * @memberof Infra */ networks: Array; /** * * @type {Array} * @memberof Infra */ datastores: Array; } /** * Check if a given object implements the Infra interface. */ export function instanceOfInfra(value: object): value is Infra { if (!('totalHosts' in value) || value['totalHosts'] === undefined) return false; if (!('hostPowerStates' in value) || value['hostPowerStates'] === undefined) return false; if (!('networks' in value) || value['networks'] === undefined) return false; if (!('datastores' in value) || value['datastores'] === undefined) return false; return true; } export function InfraFromJSON(json: any): Infra { return InfraFromJSONTyped(json, false); } export function InfraFromJSONTyped(json: any, ignoreDiscriminator: boolean): Infra { if (json == null) { return json; } return { 'totalHosts': json['totalHosts'], 'totalDatacenters': json['totalDatacenters'] == null ? undefined : json['totalDatacenters'], 'totalClusters': json['totalClusters'] == null ? undefined : json['totalClusters'], 'clustersPerDatacenter': json['clustersPerDatacenter'] == null ? undefined : json['clustersPerDatacenter'], 'cpuOverCommitment': json['cpuOverCommitment'] == null ? undefined : json['cpuOverCommitment'], 'memoryOverCommitment': json['memoryOverCommitment'] == null ? undefined : json['memoryOverCommitment'], 'hosts': json['hosts'] == null ? undefined : ((json['hosts'] as Array).map(HostFromJSON)), 'hostsPerCluster': json['hostsPerCluster'] == null ? undefined : json['hostsPerCluster'], 'vmsPerCluster': json['vmsPerCluster'] == null ? undefined : json['vmsPerCluster'], 'hostPowerStates': json['hostPowerStates'], 'networks': ((json['networks'] as Array).map(NetworkFromJSON)), 'datastores': ((json['datastores'] as Array).map(DatastoreFromJSON)), }; } export function InfraToJSON(json: any): Infra { return InfraToJSONTyped(json, false); } export function InfraToJSONTyped(value?: Infra | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'totalHosts': value['totalHosts'], 'totalDatacenters': value['totalDatacenters'], 'totalClusters': value['totalClusters'], 'clustersPerDatacenter': value['clustersPerDatacenter'], 'cpuOverCommitment': value['cpuOverCommitment'], 'memoryOverCommitment': value['memoryOverCommitment'], 'hosts': value['hosts'] == null ? undefined : ((value['hosts'] as Array).map(HostToJSON)), 'hostsPerCluster': value['hostsPerCluster'], 'vmsPerCluster': value['vmsPerCluster'], 'hostPowerStates': value['hostPowerStates'], 'networks': ((value['networks'] as Array).map(NetworkToJSON)), 'datastores': ((value['datastores'] as Array).map(DatastoreToJSON)), }; }