/* 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 { LobbyCreatedBy } from './LobbyCreatedBy'; import { LobbyCreatedByFromJSON, LobbyCreatedByFromJSONTyped, LobbyCreatedByToJSON, } from './LobbyCreatedBy'; import type { LobbyVisibility } from './LobbyVisibility'; import { LobbyVisibilityFromJSON, LobbyVisibilityFromJSONTyped, LobbyVisibilityToJSON, } from './LobbyVisibility'; import type { Region } from './Region'; import { RegionFromJSON, RegionFromJSONTyped, RegionToJSON, } from './Region'; /** * A lobby object allows you to store and manage metadata for your rooms. * @export * @interface Lobby */ export interface Lobby { /** * User-defined identifier for a lobby. * @type {string} * @memberof Lobby */ shortCode: string | null; /** * JSON blob to store metadata for a room. Must be smaller than 1MB. * @type {any} * @memberof Lobby */ state?: any | null; /** * User input to initialize the game state. Object must be smaller than 64KB. * @type {any} * @memberof Lobby */ initialConfig: any | null; /** * When the lobby was created. * @type {Date} * @memberof Lobby */ createdAt: Date; /** * * @type {LobbyCreatedBy} * @memberof Lobby */ createdBy: LobbyCreatedBy; /** * * @type {boolean} * @memberof Lobby * @deprecated */ local: boolean; /** * * @type {LobbyVisibility} * @memberof Lobby */ visibility: LobbyVisibility; /** * * @type {Region} * @memberof Lobby */ region: Region; /** * 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 Lobby */ roomId: string; /** * System generated unique identifier for an application. * @type {string} * @memberof Lobby */ appId: string; } /** * Check if a given object implements the Lobby interface. */ export function instanceOfLobby(value: object): boolean { let isInstance = true; isInstance = isInstance && "shortCode" in value; isInstance = isInstance && "initialConfig" in value; isInstance = isInstance && "createdAt" in value; isInstance = isInstance && "createdBy" in value; isInstance = isInstance && "local" in value; isInstance = isInstance && "visibility" in value; isInstance = isInstance && "region" in value; isInstance = isInstance && "roomId" in value; isInstance = isInstance && "appId" in value; return isInstance; } export function LobbyFromJSON(json: any): Lobby { return LobbyFromJSONTyped(json, false); } export function LobbyFromJSONTyped(json: any, ignoreDiscriminator: boolean): Lobby { if ((json === undefined) || (json === null)) { return json; } return { 'shortCode': json['shortCode'], 'state': !exists(json, 'state') ? undefined : json['state'], 'initialConfig': json['initialConfig'], 'createdAt': (new Date(json['createdAt'])), 'createdBy': LobbyCreatedByFromJSON(json['createdBy']), 'local': json['local'], 'visibility': LobbyVisibilityFromJSON(json['visibility']), 'region': RegionFromJSON(json['region']), 'roomId': json['roomId'], 'appId': json['appId'], }; } export function LobbyToJSON(value?: Lobby | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'shortCode': value.shortCode, 'state': value.state, 'initialConfig': value.initialConfig, 'createdAt': (value.createdAt.toISOString()), 'createdBy': LobbyCreatedByToJSON(value.createdBy), 'local': value.local, 'visibility': LobbyVisibilityToJSON(value.visibility), 'region': RegionToJSON(value.region), 'roomId': value.roomId, 'appId': value.appId, }; }