/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetRoomUserResponse = { /** * The ID of the user */ id?: string | undefined; /** * Timestamp (in milliseconds) at which the user joined */ joinedAt?: number | undefined; /** * The display name of the user */ name?: string | undefined; /** * Whether a user is allowed to publish audio/video tracks */ isPublisher?: boolean | undefined; /** * User defined payload to store for the participant */ metadata?: string | undefined; }; /** @internal */ export const GetRoomUserResponse$inboundSchema: z.ZodType< GetRoomUserResponse, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), joinedAt: z.number().int().optional(), name: z.string().optional(), isPublisher: z.boolean().default(true), metadata: z.string().optional(), }); /** @internal */ export type GetRoomUserResponse$Outbound = { id?: string | undefined; joinedAt?: number | undefined; name?: string | undefined; isPublisher: boolean; metadata?: string | undefined; }; /** @internal */ export const GetRoomUserResponse$outboundSchema: z.ZodType< GetRoomUserResponse$Outbound, z.ZodTypeDef, GetRoomUserResponse > = z.object({ id: z.string().optional(), joinedAt: z.number().int().optional(), name: z.string().optional(), isPublisher: z.boolean().default(true), metadata: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetRoomUserResponse$ { /** @deprecated use `GetRoomUserResponse$inboundSchema` instead. */ export const inboundSchema = GetRoomUserResponse$inboundSchema; /** @deprecated use `GetRoomUserResponse$outboundSchema` instead. */ export const outboundSchema = GetRoomUserResponse$outboundSchema; /** @deprecated use `GetRoomUserResponse$Outbound` instead. */ export type Outbound = GetRoomUserResponse$Outbound; } export function getRoomUserResponseToJSON( getRoomUserResponse: GetRoomUserResponse, ): string { return JSON.stringify( GetRoomUserResponse$outboundSchema.parse(getRoomUserResponse), ); } export function getRoomUserResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetRoomUserResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetRoomUserResponse' from JSON`, ); }