/* 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 { ActiveConnectionInfo } from './ActiveConnectionInfo'; import { ActiveConnectionInfoFromJSON, ActiveConnectionInfoFromJSONTyped, ActiveConnectionInfoToJSON, } from './ActiveConnectionInfo'; import type { StartingConnectionInfo } from './StartingConnectionInfo'; import { StartingConnectionInfoFromJSON, StartingConnectionInfoFromJSONTyped, StartingConnectionInfoToJSON, } from './StartingConnectionInfo'; import type { TransportType } from './TransportType'; import { TransportTypeFromJSON, TransportTypeFromJSONTyped, TransportTypeToJSON, } from './TransportType'; /** * Connection information to the default port. * @export * @interface ConnectionInfo */ export interface ConnectionInfo { /** * * @type {string} * @memberof ConnectionInfo */ status: ConnectionInfoStatusEnum; /** * Unique identifier to a game session or match. Use the default system generated ID or overwrite it with your own. * Note: error will be returned if `roomId` is not globally unique. * @type {string} * @memberof ConnectionInfo */ roomId: string; /** * * @type {TransportType} * @memberof ConnectionInfo */ transportType: TransportType; /** * * @type {number} * @memberof ConnectionInfo */ port: number; /** * * @type {string} * @memberof ConnectionInfo */ host: string; } /** * @export */ export const ConnectionInfoStatusEnum = { Active: 'active' } as const; export type ConnectionInfoStatusEnum = typeof ConnectionInfoStatusEnum[keyof typeof ConnectionInfoStatusEnum]; /** * Check if a given object implements the ConnectionInfo interface. */ export function instanceOfConnectionInfo(value: object): boolean { let isInstance = true; isInstance = isInstance && "status" in value; isInstance = isInstance && "roomId" in value; isInstance = isInstance && "transportType" in value; isInstance = isInstance && "port" in value; isInstance = isInstance && "host" in value; return isInstance; } export function ConnectionInfoFromJSON(json: any): ConnectionInfo { return ConnectionInfoFromJSONTyped(json, false); } export function ConnectionInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConnectionInfo { if ((json === undefined) || (json === null)) { return json; } return { 'status': json['status'], 'roomId': json['roomId'], 'transportType': TransportTypeFromJSON(json['transportType']), 'port': json['port'], 'host': json['host'], }; } export function ConnectionInfoToJSON(value?: ConnectionInfo | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'status': value.status, 'roomId': value.roomId, 'transportType': TransportTypeToJSON(value.transportType), 'port': value.port, 'host': value.host, }; }