/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 7cffb5a471db */ 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 { CalendarAttendee, CalendarAttendee$inboundSchema, CalendarAttendee$Outbound, CalendarAttendee$outboundSchema, } from "./calendarattendee.js"; export type CalendarAttendees = { /** * Full details of some of the attendees of this event */ people?: Array | undefined; /** * Whether the total count of the people returned is at the retrieval limit. */ isLimit?: boolean | undefined; /** * Total number of attendees in this event. */ total?: number | undefined; /** * Total number of attendees who have accepted this event. */ numAccepted?: number | undefined; /** * Total number of attendees who have declined this event. */ numDeclined?: number | undefined; /** * Total number of attendees who have not responded to this event. */ numNoResponse?: number | undefined; /** * Total number of attendees who have responded tentatively (i.e. responded maybe) to this event. */ numTentative?: number | undefined; }; /** @internal */ export const CalendarAttendees$inboundSchema: z.ZodType< CalendarAttendees, z.ZodTypeDef, unknown > = z.object({ people: z.array(z.lazy(() => CalendarAttendee$inboundSchema)).optional(), isLimit: z.boolean().optional(), total: z.number().int().optional(), numAccepted: z.number().int().optional(), numDeclined: z.number().int().optional(), numNoResponse: z.number().int().optional(), numTentative: z.number().int().optional(), }); /** @internal */ export type CalendarAttendees$Outbound = { people?: Array | undefined; isLimit?: boolean | undefined; total?: number | undefined; numAccepted?: number | undefined; numDeclined?: number | undefined; numNoResponse?: number | undefined; numTentative?: number | undefined; }; /** @internal */ export const CalendarAttendees$outboundSchema: z.ZodType< CalendarAttendees$Outbound, z.ZodTypeDef, CalendarAttendees > = z.object({ people: z.array(z.lazy(() => CalendarAttendee$outboundSchema)).optional(), isLimit: z.boolean().optional(), total: z.number().int().optional(), numAccepted: z.number().int().optional(), numDeclined: z.number().int().optional(), numNoResponse: z.number().int().optional(), numTentative: z.number().int().optional(), }); export function calendarAttendeesToJSON( calendarAttendees: CalendarAttendees, ): string { return JSON.stringify( CalendarAttendees$outboundSchema.parse(calendarAttendees), ); } export function calendarAttendeesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CalendarAttendees$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CalendarAttendees' from JSON`, ); }