/* 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 { ExposedPort } from './ExposedPort'; import { ExposedPortFromJSON, ExposedPortFromJSONTyped, ExposedPortToJSON, } from './ExposedPort'; import type { Region } from './Region'; import { RegionFromJSON, RegionFromJSONTyped, RegionToJSON, } from './Region'; /** * A process object represents a runtime instance of your game server and its metadata. * @export * @interface Process */ export interface Process { /** * Measures network traffic leaving the process in bytes. * @type {number} * @memberof Process */ egressedBytes: number; /** * * @type {Date} * @memberof Process * @deprecated */ idleSince: Date | null; /** * * @type {Date} * @memberof Process * @deprecated */ activeConnectionsUpdatedAt: Date; /** * Tracks the number of active connections to a process. * @type {number} * @memberof Process * @deprecated */ activeConnections: number; /** * * @type {Date} * @memberof Process */ roomsAllocatedUpdatedAt: Date; /** * Tracks the number of rooms that have been allocated to the process. * @type {number} * @memberof Process */ roomsAllocated: number; /** * * @type {Date} * @memberof Process * @deprecated */ roomSlotsAvailableUpdatedAt: Date; /** * * @type {number} * @memberof Process * @deprecated */ roomSlotsAvailable: number; /** * Process in drain will not accept any new rooms. * @type {boolean} * @memberof Process */ draining: boolean; /** * When the process has been terminated. * @type {Date} * @memberof Process */ terminatedAt: Date | null; /** * When the process is issued to stop. We use this to determine when we should stop billing. * @type {Date} * @memberof Process */ stoppingAt: Date | null; /** * When the process bound to the specified port. We use this to determine when we should start billing. * @type {Date} * @memberof Process */ startedAt: Date | null; /** * When the process started being provisioned. * @type {Date} * @memberof Process */ startingAt: Date; /** * Governs how many [rooms](https://hathora.dev/docs/concepts/hathora-entities#room) can be scheduled in a process. * @type {number} * @memberof Process */ roomsPerProcess: number; /** * * @type {Array} * @memberof Process */ additionalExposedPorts: Array; /** * * @type {ExposedPort} * @memberof Process */ exposedPort: ExposedPort | null; /** * * @type {number} * @memberof Process * @deprecated */ port: number; /** * * @type {string} * @memberof Process * @deprecated */ host: string; /** * * @type {Region} * @memberof Process */ region: Region; /** * System generated unique identifier to a runtime instance of your game server. * @type {string} * @memberof Process */ processId: string; /** * System generated id for a deployment. Increments by 1. * @type {number} * @memberof Process */ deploymentId: number; /** * System generated unique identifier for an application. * @type {string} * @memberof Process */ appId: string; } /** * Check if a given object implements the Process interface. */ export function instanceOfProcess(value: object): boolean { let isInstance = true; isInstance = isInstance && "egressedBytes" in value; isInstance = isInstance && "idleSince" in value; isInstance = isInstance && "activeConnectionsUpdatedAt" in value; isInstance = isInstance && "activeConnections" in value; isInstance = isInstance && "roomsAllocatedUpdatedAt" in value; isInstance = isInstance && "roomsAllocated" in value; isInstance = isInstance && "roomSlotsAvailableUpdatedAt" in value; isInstance = isInstance && "roomSlotsAvailable" in value; isInstance = isInstance && "draining" in value; isInstance = isInstance && "terminatedAt" in value; isInstance = isInstance && "stoppingAt" in value; isInstance = isInstance && "startedAt" in value; isInstance = isInstance && "startingAt" in value; isInstance = isInstance && "roomsPerProcess" in value; isInstance = isInstance && "additionalExposedPorts" in value; isInstance = isInstance && "exposedPort" in value; isInstance = isInstance && "port" in value; isInstance = isInstance && "host" in value; isInstance = isInstance && "region" in value; isInstance = isInstance && "processId" in value; isInstance = isInstance && "deploymentId" in value; isInstance = isInstance && "appId" in value; return isInstance; } export function ProcessFromJSON(json: any): Process { return ProcessFromJSONTyped(json, false); } export function ProcessFromJSONTyped(json: any, ignoreDiscriminator: boolean): Process { if ((json === undefined) || (json === null)) { return json; } return { 'egressedBytes': json['egressedBytes'], 'idleSince': (json['idleSince'] === null ? null : new Date(json['idleSince'])), 'activeConnectionsUpdatedAt': (new Date(json['activeConnectionsUpdatedAt'])), 'activeConnections': json['activeConnections'], 'roomsAllocatedUpdatedAt': (new Date(json['roomsAllocatedUpdatedAt'])), 'roomsAllocated': json['roomsAllocated'], 'roomSlotsAvailableUpdatedAt': (new Date(json['roomSlotsAvailableUpdatedAt'])), 'roomSlotsAvailable': json['roomSlotsAvailable'], 'draining': json['draining'], 'terminatedAt': (json['terminatedAt'] === null ? null : new Date(json['terminatedAt'])), 'stoppingAt': (json['stoppingAt'] === null ? null : new Date(json['stoppingAt'])), 'startedAt': (json['startedAt'] === null ? null : new Date(json['startedAt'])), 'startingAt': (new Date(json['startingAt'])), 'roomsPerProcess': json['roomsPerProcess'], 'additionalExposedPorts': ((json['additionalExposedPorts'] as Array).map(ExposedPortFromJSON)), 'exposedPort': ExposedPortFromJSON(json['exposedPort']), 'port': json['port'], 'host': json['host'], 'region': RegionFromJSON(json['region']), 'processId': json['processId'], 'deploymentId': json['deploymentId'], 'appId': json['appId'], }; } export function ProcessToJSON(value?: Process | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'egressedBytes': value.egressedBytes, 'idleSince': (value.idleSince === null ? null : value.idleSince.toISOString()), 'activeConnectionsUpdatedAt': (value.activeConnectionsUpdatedAt.toISOString()), 'activeConnections': value.activeConnections, 'roomsAllocatedUpdatedAt': (value.roomsAllocatedUpdatedAt.toISOString()), 'roomsAllocated': value.roomsAllocated, 'roomSlotsAvailableUpdatedAt': (value.roomSlotsAvailableUpdatedAt.toISOString()), 'roomSlotsAvailable': value.roomSlotsAvailable, 'draining': value.draining, 'terminatedAt': (value.terminatedAt === null ? null : value.terminatedAt.toISOString()), 'stoppingAt': (value.stoppingAt === null ? null : value.stoppingAt.toISOString()), 'startedAt': (value.startedAt === null ? null : value.startedAt.toISOString()), 'startingAt': (value.startingAt.toISOString()), 'roomsPerProcess': value.roomsPerProcess, 'additionalExposedPorts': ((value.additionalExposedPorts as Array).map(ExposedPortToJSON)), 'exposedPort': ExposedPortToJSON(value.exposedPort), 'port': value.port, 'host': value.host, 'region': RegionToJSON(value.region), 'processId': value.processId, 'deploymentId': value.deploymentId, 'appId': value.appId, }; }