/* * 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"; /** * Response containing a LiveKit access token, server URL, and the generated room name. */ export type LivekitTokenResponse = { /** * JWT access token for authenticating with the LiveKit room */ token: string; /** * LiveKit server WebSocket URL to connect to (e.g., wss://apigw.mka1.com/api/v1/livekit) */ url: string; /** * Auto-generated UUID room name assigned to this session */ roomName: string; }; /** @internal */ export const LivekitTokenResponse$inboundSchema: z.ZodType< LivekitTokenResponse, z.ZodTypeDef, unknown > = z.object({ token: z.string(), url: z.string(), roomName: z.string(), }); /** @internal */ export type LivekitTokenResponse$Outbound = { token: string; url: string; roomName: string; }; /** @internal */ export const LivekitTokenResponse$outboundSchema: z.ZodType< LivekitTokenResponse$Outbound, z.ZodTypeDef, LivekitTokenResponse > = z.object({ token: z.string(), url: z.string(), roomName: z.string(), }); export function livekitTokenResponseToJSON( livekitTokenResponse: LivekitTokenResponse, ): string { return JSON.stringify( LivekitTokenResponse$outboundSchema.parse(livekitTokenResponse), ); } export function livekitTokenResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LivekitTokenResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LivekitTokenResponse' from JSON`, ); }