/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetAnalyticsWebinarsWebinarIdHistogramsRequest = { /** * The hashed ID of the webinar. */ webinarId: string; }; /** * Success response with webinar histogram data. */ export type GetAnalyticsWebinarsWebinarIdHistogramsResponse = { /** * Per-time-bucket attendee counts. Each element represents the number of attendees in a 10-second bucket. */ attendeesHistogram?: Array | undefined; /** * Per-time-bucket chat message counts. Each element represents the number of chat messages in a 10-second bucket. */ chatHistogram?: Array | undefined; /** * Per-time-bucket visual focus counts. Each element represents the number of attendees with the tab focused in a 10-second bucket. */ visualFocusPlayedHistogram?: Array | undefined; }; /** @internal */ export type GetAnalyticsWebinarsWebinarIdHistogramsRequest$Outbound = { webinarId: string; }; /** @internal */ export const GetAnalyticsWebinarsWebinarIdHistogramsRequest$outboundSchema: z.ZodType< GetAnalyticsWebinarsWebinarIdHistogramsRequest$Outbound, z.ZodTypeDef, GetAnalyticsWebinarsWebinarIdHistogramsRequest > = z.object({ webinarId: z.string(), }); export function getAnalyticsWebinarsWebinarIdHistogramsRequestToJSON( getAnalyticsWebinarsWebinarIdHistogramsRequest: GetAnalyticsWebinarsWebinarIdHistogramsRequest, ): string { return JSON.stringify( GetAnalyticsWebinarsWebinarIdHistogramsRequest$outboundSchema.parse( getAnalyticsWebinarsWebinarIdHistogramsRequest, ), ); } /** @internal */ export const GetAnalyticsWebinarsWebinarIdHistogramsResponse$inboundSchema: z.ZodType< GetAnalyticsWebinarsWebinarIdHistogramsResponse, z.ZodTypeDef, unknown > = z.object({ attendees_histogram: z.array(z.number()).optional(), chat_histogram: z.array(z.number()).optional(), visual_focus_played_histogram: z.array(z.number()).optional(), }).transform((v) => { return remap$(v, { "attendees_histogram": "attendeesHistogram", "chat_histogram": "chatHistogram", "visual_focus_played_histogram": "visualFocusPlayedHistogram", }); }); export function getAnalyticsWebinarsWebinarIdHistogramsResponseFromJSON( jsonString: string, ): SafeParseResult< GetAnalyticsWebinarsWebinarIdHistogramsResponse, SDKValidationError > { return safeParse( jsonString, (x) => GetAnalyticsWebinarsWebinarIdHistogramsResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetAnalyticsWebinarsWebinarIdHistogramsResponse' from JSON`, ); }