/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Status of the attendee */ export const ActivityAttendeeStatus = { Accepted: "accepted", Tentative: "tentative", Declined: "declined", } as const; /** * Status of the attendee */ export type ActivityAttendeeStatus = ClosedEnum; export type ActivityAttendee = { /** * Unique identifier for the attendee */ id?: string | null | undefined; /** * Full name of the attendee */ name?: string | null | undefined; /** * First name of the attendee */ firstName?: string | null | undefined; /** * Middle name of the attendee */ middleName?: string | null | undefined; /** * Last name of the attendee */ lastName?: string | null | undefined; /** * Prefix of the attendee */ prefix?: string | null | undefined; /** * Suffix of the attendee */ suffix?: string | null | undefined; /** * Email address of the attendee */ emailAddress?: string | null | undefined; /** * Whether the attendee is the organizer of the activity */ isOrganizer?: boolean | null | undefined; /** * Status of the attendee */ status?: ActivityAttendeeStatus | null | undefined; /** * The identifier for a related user */ userId?: string | null | undefined; /** * The identifier for a related contact */ contactId?: string | null | undefined; /** * The last time the attendee was updated (ISO 8601) */ updatedAt?: Date | null | undefined; /** * The time the attendee was created (ISO 8601) */ createdAt?: Date | null | undefined; }; export type ActivityAttendeeInput = { /** * Full name of the attendee */ name?: string | null | undefined; /** * First name of the attendee */ firstName?: string | null | undefined; /** * Middle name of the attendee */ middleName?: string | null | undefined; /** * Last name of the attendee */ lastName?: string | null | undefined; /** * Prefix of the attendee */ prefix?: string | null | undefined; /** * Suffix of the attendee */ suffix?: string | null | undefined; /** * Email address of the attendee */ emailAddress?: string | null | undefined; /** * Whether the attendee is the organizer of the activity */ isOrganizer?: boolean | null | undefined; /** * Status of the attendee */ status?: ActivityAttendeeStatus | null | undefined; }; /** @internal */ export const ActivityAttendeeStatus$inboundSchema: z.ZodNativeEnum< typeof ActivityAttendeeStatus > = z.nativeEnum(ActivityAttendeeStatus); /** @internal */ export const ActivityAttendeeStatus$outboundSchema: z.ZodNativeEnum< typeof ActivityAttendeeStatus > = ActivityAttendeeStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ActivityAttendeeStatus$ { /** @deprecated use `ActivityAttendeeStatus$inboundSchema` instead. */ export const inboundSchema = ActivityAttendeeStatus$inboundSchema; /** @deprecated use `ActivityAttendeeStatus$outboundSchema` instead. */ export const outboundSchema = ActivityAttendeeStatus$outboundSchema; } /** @internal */ export const ActivityAttendee$inboundSchema: z.ZodType< ActivityAttendee, z.ZodTypeDef, unknown > = z.object({ id: z.nullable(z.string()).optional(), name: z.nullable(z.string()).optional(), first_name: z.nullable(z.string()).optional(), middle_name: z.nullable(z.string()).optional(), last_name: z.nullable(z.string()).optional(), prefix: z.nullable(z.string()).optional(), suffix: z.nullable(z.string()).optional(), email_address: z.nullable(z.string()).optional(), is_organizer: z.nullable(z.boolean()).optional(), status: z.nullable(ActivityAttendeeStatus$inboundSchema).optional(), user_id: z.nullable(z.string()).optional(), contact_id: z.nullable(z.string()).optional(), updated_at: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), created_at: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), }).transform((v) => { return remap$(v, { "first_name": "firstName", "middle_name": "middleName", "last_name": "lastName", "email_address": "emailAddress", "is_organizer": "isOrganizer", "user_id": "userId", "contact_id": "contactId", "updated_at": "updatedAt", "created_at": "createdAt", }); }); /** @internal */ export type ActivityAttendee$Outbound = { id?: string | null | undefined; name?: string | null | undefined; first_name?: string | null | undefined; middle_name?: string | null | undefined; last_name?: string | null | undefined; prefix?: string | null | undefined; suffix?: string | null | undefined; email_address?: string | null | undefined; is_organizer?: boolean | null | undefined; status?: string | null | undefined; user_id?: string | null | undefined; contact_id?: string | null | undefined; updated_at?: string | null | undefined; created_at?: string | null | undefined; }; /** @internal */ export const ActivityAttendee$outboundSchema: z.ZodType< ActivityAttendee$Outbound, z.ZodTypeDef, ActivityAttendee > = z.object({ id: z.nullable(z.string()).optional(), name: z.nullable(z.string()).optional(), firstName: z.nullable(z.string()).optional(), middleName: z.nullable(z.string()).optional(), lastName: z.nullable(z.string()).optional(), prefix: z.nullable(z.string()).optional(), suffix: z.nullable(z.string()).optional(), emailAddress: z.nullable(z.string()).optional(), isOrganizer: z.nullable(z.boolean()).optional(), status: z.nullable(ActivityAttendeeStatus$outboundSchema).optional(), userId: z.nullable(z.string()).optional(), contactId: z.nullable(z.string()).optional(), updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), }).transform((v) => { return remap$(v, { firstName: "first_name", middleName: "middle_name", lastName: "last_name", emailAddress: "email_address", isOrganizer: "is_organizer", userId: "user_id", contactId: "contact_id", updatedAt: "updated_at", createdAt: "created_at", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ActivityAttendee$ { /** @deprecated use `ActivityAttendee$inboundSchema` instead. */ export const inboundSchema = ActivityAttendee$inboundSchema; /** @deprecated use `ActivityAttendee$outboundSchema` instead. */ export const outboundSchema = ActivityAttendee$outboundSchema; /** @deprecated use `ActivityAttendee$Outbound` instead. */ export type Outbound = ActivityAttendee$Outbound; } export function activityAttendeeToJSON( activityAttendee: ActivityAttendee, ): string { return JSON.stringify( ActivityAttendee$outboundSchema.parse(activityAttendee), ); } export function activityAttendeeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ActivityAttendee$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ActivityAttendee' from JSON`, ); } /** @internal */ export const ActivityAttendeeInput$inboundSchema: z.ZodType< ActivityAttendeeInput, z.ZodTypeDef, unknown > = z.object({ name: z.nullable(z.string()).optional(), first_name: z.nullable(z.string()).optional(), middle_name: z.nullable(z.string()).optional(), last_name: z.nullable(z.string()).optional(), prefix: z.nullable(z.string()).optional(), suffix: z.nullable(z.string()).optional(), email_address: z.nullable(z.string()).optional(), is_organizer: z.nullable(z.boolean()).optional(), status: z.nullable(ActivityAttendeeStatus$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "first_name": "firstName", "middle_name": "middleName", "last_name": "lastName", "email_address": "emailAddress", "is_organizer": "isOrganizer", }); }); /** @internal */ export type ActivityAttendeeInput$Outbound = { name?: string | null | undefined; first_name?: string | null | undefined; middle_name?: string | null | undefined; last_name?: string | null | undefined; prefix?: string | null | undefined; suffix?: string | null | undefined; email_address?: string | null | undefined; is_organizer?: boolean | null | undefined; status?: string | null | undefined; }; /** @internal */ export const ActivityAttendeeInput$outboundSchema: z.ZodType< ActivityAttendeeInput$Outbound, z.ZodTypeDef, ActivityAttendeeInput > = z.object({ name: z.nullable(z.string()).optional(), firstName: z.nullable(z.string()).optional(), middleName: z.nullable(z.string()).optional(), lastName: z.nullable(z.string()).optional(), prefix: z.nullable(z.string()).optional(), suffix: z.nullable(z.string()).optional(), emailAddress: z.nullable(z.string()).optional(), isOrganizer: z.nullable(z.boolean()).optional(), status: z.nullable(ActivityAttendeeStatus$outboundSchema).optional(), }).transform((v) => { return remap$(v, { firstName: "first_name", middleName: "middle_name", lastName: "last_name", emailAddress: "email_address", isOrganizer: "is_organizer", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ActivityAttendeeInput$ { /** @deprecated use `ActivityAttendeeInput$inboundSchema` instead. */ export const inboundSchema = ActivityAttendeeInput$inboundSchema; /** @deprecated use `ActivityAttendeeInput$outboundSchema` instead. */ export const outboundSchema = ActivityAttendeeInput$outboundSchema; /** @deprecated use `ActivityAttendeeInput$Outbound` instead. */ export type Outbound = ActivityAttendeeInput$Outbound; } export function activityAttendeeInputToJSON( activityAttendeeInput: ActivityAttendeeInput, ): string { return JSON.stringify( ActivityAttendeeInput$outboundSchema.parse(activityAttendeeInput), ); } export function activityAttendeeInputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ActivityAttendeeInput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ActivityAttendeeInput' from JSON`, ); }