/* 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 { RoomAllocation } from './RoomAllocation'; import { RoomAllocationFromJSON, RoomAllocationFromJSONTyped, RoomAllocationToJSON, } from './RoomAllocation'; import type { RoomStatus } from './RoomStatus'; import { RoomStatusFromJSON, RoomStatusFromJSONTyped, RoomStatusToJSON, } from './RoomStatus'; /** * A room object represents a game session or match. * @export * @interface Room */ export interface Room { /** * * @type {RoomAllocation} * @memberof Room */ currentAllocation: RoomAllocation | null; /** * * @type {RoomStatus} * @memberof Room */ status: RoomStatus; /** * * @type {Array} * @memberof Room */ allocations: Array; /** * Optional configuration parameters for the room. Can be any string including stringified JSON. It is accessible from the room via [`GetRoomInfo()`](https://hathora.dev/api#tag/RoomV2/operation/GetRoomInfo). * @type {string} * @memberof Room */ roomConfig: string | null; /** * 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 Room */ roomId: string; /** * System generated unique identifier for an application. * @type {string} * @memberof Room */ appId: string; } /** * Check if a given object implements the Room interface. */ export function instanceOfRoom(value: object): boolean { let isInstance = true; isInstance = isInstance && "currentAllocation" in value; isInstance = isInstance && "status" in value; isInstance = isInstance && "allocations" in value; isInstance = isInstance && "roomConfig" in value; isInstance = isInstance && "roomId" in value; isInstance = isInstance && "appId" in value; return isInstance; } export function RoomFromJSON(json: any): Room { return RoomFromJSONTyped(json, false); } export function RoomFromJSONTyped(json: any, ignoreDiscriminator: boolean): Room { if ((json === undefined) || (json === null)) { return json; } return { 'currentAllocation': RoomAllocationFromJSON(json['currentAllocation']), 'status': RoomStatusFromJSON(json['status']), 'allocations': ((json['allocations'] as Array).map(RoomAllocationFromJSON)), 'roomConfig': json['roomConfig'], 'roomId': json['roomId'], 'appId': json['appId'], }; } export function RoomToJSON(value?: Room | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'currentAllocation': RoomAllocationToJSON(value.currentAllocation), 'status': RoomStatusToJSON(value.status), 'allocations': ((value.allocations as Array).map(RoomAllocationToJSON)), 'roomConfig': value.roomConfig, 'roomId': value.roomId, 'appId': value.appId, }; }