/* 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'; /** * Deployment is a versioned configuration for a build that describes runtime behavior. * @export * @interface Deployment */ export interface Deployment { /** * Option to shut down processes that have had no new connections or rooms * for five minutes. * @type {boolean} * @memberof Deployment */ idleTimeoutEnabled?: boolean; /** * The environment variable that our process will have access to at runtime. * @type {Array} * @memberof Deployment */ env: Array; /** * Governs how many [rooms](https://hathora.dev/docs/concepts/hathora-entities#room) can be scheduled in a process. * @type {number} * @memberof Deployment */ roomsPerProcess: number; /** * * @type {PlanName} * @memberof Deployment */ planName: PlanName; /** * Additional ports your server listens on. * @type {Array} * @memberof Deployment */ additionalContainerPorts: Array; /** * * @type {ContainerPort} * @memberof Deployment */ defaultContainerPort: ContainerPort; /** * * @type {string} * @memberof Deployment * @deprecated */ transportType: DeploymentTransportTypeEnum; /** * * @type {number} * @memberof Deployment * @deprecated */ containerPort: number; /** * When the deployment was created. * @type {Date} * @memberof Deployment */ createdAt: Date; /** * UserId or email address for the user that created the deployment. * @type {string} * @memberof Deployment */ createdBy: string; /** * The amount of memory allocated to your process. * @type {number} * @memberof Deployment */ requestedMemoryMB: number; /** * The number of cores allocated to your process. * @type {number} * @memberof Deployment */ requestedCPU: number; /** * System generated id for a deployment. Increments by 1. * @type {number} * @memberof Deployment */ deploymentId: number; /** * System generated id for a build. Increments by 1. * @type {number} * @memberof Deployment */ buildId: number; /** * System generated unique identifier for an application. * @type {string} * @memberof Deployment */ appId: string; } /** * @export */ export const DeploymentTransportTypeEnum = { Tcp: 'tcp', Udp: 'udp', Tls: 'tls' } as const; export type DeploymentTransportTypeEnum = typeof DeploymentTransportTypeEnum[keyof typeof DeploymentTransportTypeEnum]; /** * Check if a given object implements the Deployment interface. */ export function instanceOfDeployment(value: object): boolean { let isInstance = true; isInstance = isInstance && "env" in value; isInstance = isInstance && "roomsPerProcess" in value; isInstance = isInstance && "planName" in value; isInstance = isInstance && "additionalContainerPorts" in value; isInstance = isInstance && "defaultContainerPort" in value; isInstance = isInstance && "transportType" in value; isInstance = isInstance && "containerPort" in value; isInstance = isInstance && "createdAt" in value; isInstance = isInstance && "createdBy" in value; isInstance = isInstance && "requestedMemoryMB" in value; isInstance = isInstance && "requestedCPU" in value; isInstance = isInstance && "deploymentId" in value; isInstance = isInstance && "buildId" in value; isInstance = isInstance && "appId" in value; return isInstance; } export function DeploymentFromJSON(json: any): Deployment { return DeploymentFromJSONTyped(json, false); } export function DeploymentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Deployment { 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': ((json['additionalContainerPorts'] as Array).map(ContainerPortFromJSON)), 'defaultContainerPort': ContainerPortFromJSON(json['defaultContainerPort']), 'transportType': json['transportType'], 'containerPort': json['containerPort'], 'createdAt': (new Date(json['createdAt'])), 'createdBy': json['createdBy'], 'requestedMemoryMB': json['requestedMemoryMB'], 'requestedCPU': json['requestedCPU'], 'deploymentId': json['deploymentId'], 'buildId': json['buildId'], 'appId': json['appId'], }; } export function DeploymentToJSON(value?: Deployment | 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 as Array).map(ContainerPortToJSON)), 'defaultContainerPort': ContainerPortToJSON(value.defaultContainerPort), 'transportType': value.transportType, 'containerPort': value.containerPort, 'createdAt': (value.createdAt.toISOString()), 'createdBy': value.createdBy, 'requestedMemoryMB': value.requestedMemoryMB, 'requestedCPU': value.requestedCPU, 'deploymentId': value.deploymentId, 'buildId': value.buildId, 'appId': value.appId, }; }