/* * 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"; /** * Metadata on an allocated instance of a room. */ export type RoomAllocation = { unscheduledAt: Date | null; scheduledAt: Date; /** * System generated unique identifier to a runtime instance of your game server. */ processId: string; /** * System generated unique identifier to an allocated instance of a room. */ roomAllocationId: string; }; /** @internal */ export const RoomAllocation$inboundSchema: z.ZodType< RoomAllocation, z.ZodTypeDef, unknown > = z.object({ unscheduledAt: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ), scheduledAt: z.string().datetime({ offset: true }).transform(v => new Date(v) ), processId: z.string(), roomAllocationId: z.string(), }); export function roomAllocationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RoomAllocation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RoomAllocation' from JSON`, ); }