/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 9b0f0e3404d0 */ 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 { Person, Person$inboundSchema, Person$Outbound, Person$outboundSchema, } from "./person.js"; export const ResponseStatus = { Accepted: "ACCEPTED", Declined: "DECLINED", NoResponse: "NO_RESPONSE", Tentative: "TENTATIVE", } as const; export type ResponseStatus = OpenEnum; export type CalendarAttendee = { /** * Whether or not this attendee is an organizer. */ isOrganizer?: boolean | undefined; /** * Whether or not this attendee is in a group. Needed temporarily at least to support both flat attendees and tree for compatibility. */ isInGroup?: boolean | undefined; person: Person; /** * If this attendee is a group, represents the list of individual attendees in the group. */ groupAttendees?: Array | undefined; responseStatus?: ResponseStatus | undefined; }; /** @internal */ export const ResponseStatus$inboundSchema: z.ZodType< ResponseStatus, z.ZodTypeDef, unknown > = openEnums.inboundSchema(ResponseStatus); /** @internal */ export const ResponseStatus$outboundSchema: z.ZodType< string, z.ZodTypeDef, ResponseStatus > = openEnums.outboundSchema(ResponseStatus); /** @internal */ export const CalendarAttendee$inboundSchema: z.ZodType< CalendarAttendee, z.ZodTypeDef, unknown > = z.object({ isOrganizer: z.boolean().optional(), isInGroup: z.boolean().optional(), person: z.lazy(() => Person$inboundSchema), groupAttendees: z.array(z.lazy(() => CalendarAttendee$inboundSchema)) .optional(), responseStatus: ResponseStatus$inboundSchema.optional(), }); /** @internal */ export type CalendarAttendee$Outbound = { isOrganizer?: boolean | undefined; isInGroup?: boolean | undefined; person: Person$Outbound; groupAttendees?: Array | undefined; responseStatus?: string | undefined; }; /** @internal */ export const CalendarAttendee$outboundSchema: z.ZodType< CalendarAttendee$Outbound, z.ZodTypeDef, CalendarAttendee > = z.object({ isOrganizer: z.boolean().optional(), isInGroup: z.boolean().optional(), person: z.lazy(() => Person$outboundSchema), groupAttendees: z.array(z.lazy(() => CalendarAttendee$outboundSchema)) .optional(), responseStatus: ResponseStatus$outboundSchema.optional(), }); export function calendarAttendeeToJSON( calendarAttendee: CalendarAttendee, ): string { return JSON.stringify( CalendarAttendee$outboundSchema.parse(calendarAttendee), ); } export function calendarAttendeeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CalendarAttendee$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CalendarAttendee' from JSON`, ); }