/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 4856eacf072c */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { CalendarAttendees, CalendarAttendees$inboundSchema, } from "./calendarattendees.js"; import { ConferenceData, ConferenceData$inboundSchema, } from "./conferencedata.js"; import { EventClassification, EventClassification$inboundSchema, } from "./eventclassification.js"; import { GeneratedAttachment, GeneratedAttachment$inboundSchema, } from "./generatedattachment.js"; import { TimeInterval, TimeInterval$inboundSchema } from "./timeinterval.js"; /** * The nature of the event, for example "out of office". */ export const CalendarEventEventType = { Default: "DEFAULT", OutOfOffice: "OUT_OF_OFFICE", } as const; /** * The nature of the event, for example "out of office". */ export type CalendarEventEventType = OpenEnum; /** * A generic, light-weight calendar event. */ export type CalendarEvent = { time?: TimeInterval | undefined; /** * The nature of the event, for example "out of office". */ eventType?: CalendarEventEventType | undefined; /** * The calendar event id */ id: string; /** * A permalink for this calendar event */ url: string; attendees?: CalendarAttendees | undefined; /** * The location that this event is taking place at. */ location?: string | undefined; conferenceData?: ConferenceData | undefined; /** * The HTML description of the event. */ description?: string | undefined; /** * The app or other repository type from which the event was extracted */ datasource?: string | undefined; /** * The event has a transcript associated with it enabling features like summarization */ hasTranscript?: boolean | undefined; /** * A link to the transcript of the event */ transcriptUrl?: string | undefined; classifications?: Array | undefined; generatedAttachments?: Array | undefined; }; /** @internal */ export const CalendarEventEventType$inboundSchema: z.ZodType< CalendarEventEventType, z.ZodTypeDef, unknown > = openEnums.inboundSchema(CalendarEventEventType); /** @internal */ export const CalendarEvent$inboundSchema: z.ZodType< CalendarEvent, z.ZodTypeDef, unknown > = z.object({ time: TimeInterval$inboundSchema.optional(), eventType: CalendarEventEventType$inboundSchema.optional(), id: z.string(), url: z.string(), attendees: CalendarAttendees$inboundSchema.optional(), location: z.string().optional(), conferenceData: ConferenceData$inboundSchema.optional(), description: z.string().optional(), datasource: z.string().optional(), hasTranscript: z.boolean().optional(), transcriptUrl: z.string().optional(), classifications: z.array(EventClassification$inboundSchema).optional(), generatedAttachments: z.array(GeneratedAttachment$inboundSchema).optional(), }); export function calendarEventFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CalendarEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CalendarEvent' from JSON`, ); }