/* * 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 PutWebinarsIdWebinar = { /** * The title of the webinar */ title?: string | undefined; /** * The description of the webinar */ description?: string | undefined; /** * The scheduled start time in W3C format with timezone */ scheduledFor?: Date | undefined; /** * Duration of the webinar in minutes (minimum 15) */ eventDuration?: number | undefined; }; export type PutWebinarsIdRequestBody = { webinar?: PutWebinarsIdWebinar | undefined; }; export type PutWebinarsIdRequest = { /** * The hashed ID of the webinar */ id: string; requestBody: PutWebinarsIdRequestBody; }; /** * A webinar is an event which allows you to stream a video * * @remarks * to multiple participants. See our [Webinars Guide](https://support.wistia.com/en/articles/8288501-getting-started-with-webinars) * for more info. */ export type PutWebinarsIdResponse = { /** * The hashed ID of the webinar */ id: string; /** * The title of the webinar */ title: string; /** * The description of the webinar */ description?: string | null | undefined; /** * The scheduled start time in W3C format with timezone */ scheduledFor?: Date | null | undefined; /** * Duration of the webinar in minutes */ eventDuration?: number | null | undefined; /** * Current lifecycle status of the event */ lifecycleStatus: string; /** * Registration status of the event */ registrationStatus: string; /** * When the event was created (UTC) */ createdAt: Date; /** * When the event was last updated (UTC) */ updatedAt: Date; /** * Link for the audience to join the event */ audienceLink: string; /** * Link for the host to manage the event */ hostLink: string; /** * Link for panelists to join the event */ panelistLink: string; }; /** @internal */ export type PutWebinarsIdWebinar$Outbound = { title?: string | undefined; description?: string | undefined; scheduled_for?: string | undefined; event_duration?: number | undefined; }; /** @internal */ export const PutWebinarsIdWebinar$outboundSchema: z.ZodType< PutWebinarsIdWebinar$Outbound, z.ZodTypeDef, PutWebinarsIdWebinar > = z.object({ title: z.string().optional(), description: z.string().optional(), scheduledFor: z.date().transform(v => v.toISOString()).optional(), eventDuration: z.number().int().optional(), }).transform((v) => { return remap$(v, { scheduledFor: "scheduled_for", eventDuration: "event_duration", }); }); export function putWebinarsIdWebinarToJSON( putWebinarsIdWebinar: PutWebinarsIdWebinar, ): string { return JSON.stringify( PutWebinarsIdWebinar$outboundSchema.parse(putWebinarsIdWebinar), ); } /** @internal */ export type PutWebinarsIdRequestBody$Outbound = { webinar?: PutWebinarsIdWebinar$Outbound | undefined; }; /** @internal */ export const PutWebinarsIdRequestBody$outboundSchema: z.ZodType< PutWebinarsIdRequestBody$Outbound, z.ZodTypeDef, PutWebinarsIdRequestBody > = z.object({ webinar: z.lazy(() => PutWebinarsIdWebinar$outboundSchema).optional(), }); export function putWebinarsIdRequestBodyToJSON( putWebinarsIdRequestBody: PutWebinarsIdRequestBody, ): string { return JSON.stringify( PutWebinarsIdRequestBody$outboundSchema.parse(putWebinarsIdRequestBody), ); } /** @internal */ export type PutWebinarsIdRequest$Outbound = { id: string; RequestBody: PutWebinarsIdRequestBody$Outbound; }; /** @internal */ export const PutWebinarsIdRequest$outboundSchema: z.ZodType< PutWebinarsIdRequest$Outbound, z.ZodTypeDef, PutWebinarsIdRequest > = z.object({ id: z.string(), requestBody: z.lazy(() => PutWebinarsIdRequestBody$outboundSchema), }).transform((v) => { return remap$(v, { requestBody: "RequestBody", }); }); export function putWebinarsIdRequestToJSON( putWebinarsIdRequest: PutWebinarsIdRequest, ): string { return JSON.stringify( PutWebinarsIdRequest$outboundSchema.parse(putWebinarsIdRequest), ); } /** @internal */ export const PutWebinarsIdResponse$inboundSchema: z.ZodType< PutWebinarsIdResponse, z.ZodTypeDef, unknown > = z.object({ id: z.string(), title: z.string(), description: z.nullable(z.string()).optional(), scheduled_for: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), event_duration: z.nullable(z.number().int()).optional(), lifecycle_status: z.string(), registration_status: z.string(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), audience_link: z.string(), host_link: z.string(), panelist_link: z.string(), }).transform((v) => { return remap$(v, { "scheduled_for": "scheduledFor", "event_duration": "eventDuration", "lifecycle_status": "lifecycleStatus", "registration_status": "registrationStatus", "created_at": "createdAt", "updated_at": "updatedAt", "audience_link": "audienceLink", "host_link": "hostLink", "panelist_link": "panelistLink", }); }); export function putWebinarsIdResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PutWebinarsIdResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutWebinarsIdResponse' from JSON`, ); }