/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ExposedPort, ExposedPort$inboundSchema } from "./exposedport.js"; import { RoomReadyStatus, RoomReadyStatus$inboundSchema, } from "./roomreadystatus.js"; /** * Connection information for the default and additional ports. */ export type RoomAllocationData = { additionalExposedPorts: Array; /** * Connection details for an active process. */ exposedPort?: ExposedPort | undefined; status: RoomReadyStatus; /** * Unique identifier to a game session or match. Use the default system generated ID or overwrite it with your own. * * @remarks * Note: error will be returned if `roomId` is not globally unique. */ roomId: string; /** * System generated unique identifier to a runtime instance of your game server. */ processId?: string | undefined; }; /** @internal */ export const RoomAllocationData$inboundSchema: z.ZodType< RoomAllocationData, z.ZodTypeDef, unknown > = z.object({ additionalExposedPorts: z.array(ExposedPort$inboundSchema), exposedPort: ExposedPort$inboundSchema.optional(), status: RoomReadyStatus$inboundSchema, roomId: z.string(), processId: z.string().optional(), }); export function roomAllocationDataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RoomAllocationData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RoomAllocationData' from JSON`, ); }