/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 950dacafad50 */ 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"; import { CalendarAttendees, CalendarAttendees$inboundSchema, CalendarAttendees$Outbound, CalendarAttendees$outboundSchema, } from "./calendarattendees.js"; export type Meeting = { id?: string | undefined; title?: string | undefined; description?: string | undefined; url?: string | undefined; startTime?: Date | undefined; endTime?: Date | undefined; attendees?: CalendarAttendees | undefined; /** * Whether the meeting has been cancelled */ isCancelled?: boolean | undefined; /** * The location/venue of the meeting */ location?: string | undefined; /** * The current user's response status (accepted, declined, tentativelyAccepted, none) */ responseStatus?: string | undefined; /** * The meeting join link (Teams, Zoom, etc.) */ conferenceUri?: string | undefined; /** * The conference provider (e.g., "Microsoft Teams", "Zoom") */ conferenceProvider?: string | undefined; }; /** @internal */ export const Meeting$inboundSchema: z.ZodType = z.object({ id: z.string().optional(), title: z.string().optional(), description: z.string().optional(), url: z.string().optional(), startTime: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), endTime: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), attendees: z.lazy(() => CalendarAttendees$inboundSchema).optional(), isCancelled: z.boolean().optional(), location: z.string().optional(), responseStatus: z.string().optional(), conferenceUri: z.string().optional(), conferenceProvider: z.string().optional(), }); /** @internal */ export type Meeting$Outbound = { id?: string | undefined; title?: string | undefined; description?: string | undefined; url?: string | undefined; startTime?: string | undefined; endTime?: string | undefined; attendees?: CalendarAttendees$Outbound | undefined; isCancelled?: boolean | undefined; location?: string | undefined; responseStatus?: string | undefined; conferenceUri?: string | undefined; conferenceProvider?: string | undefined; }; /** @internal */ export const Meeting$outboundSchema: z.ZodType< Meeting$Outbound, z.ZodTypeDef, Meeting > = z.object({ id: z.string().optional(), title: z.string().optional(), description: z.string().optional(), url: z.string().optional(), startTime: z.date().transform(v => v.toISOString()).optional(), endTime: z.date().transform(v => v.toISOString()).optional(), attendees: z.lazy(() => CalendarAttendees$outboundSchema).optional(), isCancelled: z.boolean().optional(), location: z.string().optional(), responseStatus: z.string().optional(), conferenceUri: z.string().optional(), conferenceProvider: z.string().optional(), }); export function meetingToJSON(meeting: Meeting): string { return JSON.stringify(Meeting$outboundSchema.parse(meeting)); } export function meetingFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Meeting$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Meeting' from JSON`, ); }