/* tslint:disable */ /* eslint-disable */ /** * Hathora Cloud API * Welcome to the Hathora Cloud API documentation! Learn how to use the Hathora Cloud APIs to build and scale your game servers globally. * * The version of the OpenAPI document: 0.0.1 * * * 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 type { ContainerPort } from './ContainerPort'; import { ContainerPortFromJSON, ContainerPortFromJSONTyped, ContainerPortToJSON, } from './ContainerPort'; import type { DeploymentV2EnvInner } from './DeploymentV2EnvInner'; import { DeploymentV2EnvInnerFromJSON, DeploymentV2EnvInnerFromJSONTyped, DeploymentV2EnvInnerToJSON, } from './DeploymentV2EnvInner'; import type { PlanName } from './PlanName'; import { PlanNameFromJSON, PlanNameFromJSONTyped, PlanNameToJSON, } from './PlanName'; import type { TransportType } from './TransportType'; import { TransportTypeFromJSON, TransportTypeFromJSONTyped, TransportTypeToJSON, } from './TransportType'; /** * User specified deployment configuration for your application at runtime. * @export * @interface DeploymentConfig */ export interface DeploymentConfig { /** * Option to shut down processes that have had no new connections or rooms * for five minutes. * @type {boolean} * @memberof DeploymentConfig */ idleTimeoutEnabled?: boolean; /** * The environment variable that our process will have access to at runtime. * @type {Array} * @memberof DeploymentConfig */ env: Array; /** * Governs how many [rooms](https://hathora.dev/docs/concepts/hathora-entities#room) can be scheduled in a process. * @type {number} * @memberof DeploymentConfig */ roomsPerProcess: number; /** * * @type {PlanName} * @memberof DeploymentConfig */ planName: PlanName; /** * Additional ports your server listens on. * @type {Array} * @memberof DeploymentConfig */ additionalContainerPorts?: Array; /** * * @type {TransportType} * @memberof DeploymentConfig */ transportType: TransportType; /** * Default port the server listens on. * @type {number} * @memberof DeploymentConfig */ containerPort: number; } /** * Check if a given object implements the DeploymentConfig interface. */ export function instanceOfDeploymentConfig(value: object): boolean { let isInstance = true; isInstance = isInstance && "env" in value; isInstance = isInstance && "roomsPerProcess" in value; isInstance = isInstance && "planName" in value; isInstance = isInstance && "transportType" in value; isInstance = isInstance && "containerPort" in value; return isInstance; } export function DeploymentConfigFromJSON(json: any): DeploymentConfig { return DeploymentConfigFromJSONTyped(json, false); } export function DeploymentConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeploymentConfig { if ((json === undefined) || (json === null)) { return json; } return { 'idleTimeoutEnabled': !exists(json, 'idleTimeoutEnabled') ? undefined : json['idleTimeoutEnabled'], 'env': ((json['env'] as Array).map(DeploymentV2EnvInnerFromJSON)), 'roomsPerProcess': json['roomsPerProcess'], 'planName': PlanNameFromJSON(json['planName']), 'additionalContainerPorts': !exists(json, 'additionalContainerPorts') ? undefined : ((json['additionalContainerPorts'] as Array).map(ContainerPortFromJSON)), 'transportType': TransportTypeFromJSON(json['transportType']), 'containerPort': json['containerPort'], }; } export function DeploymentConfigToJSON(value?: DeploymentConfig | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'idleTimeoutEnabled': value.idleTimeoutEnabled, 'env': ((value.env as Array).map(DeploymentV2EnvInnerToJSON)), 'roomsPerProcess': value.roomsPerProcess, 'planName': PlanNameToJSON(value.planName), 'additionalContainerPorts': value.additionalContainerPorts === undefined ? undefined : ((value.additionalContainerPorts as Array).map(ContainerPortToJSON)), 'transportType': TransportTypeToJSON(value.transportType), 'containerPort': value.containerPort, }; }