/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { lazySchema as lazySchema$, 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 * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ActivityAttendee, ActivityAttendee$inboundSchema, ActivityAttendeeInput, ActivityAttendeeInput$Outbound, ActivityAttendeeInput$outboundSchema, } from "./activityattendee.js"; import { Address, Address$inboundSchema, Address$Outbound, Address$outboundSchema, } from "./address.js"; import { CustomField, CustomField$inboundSchema, CustomField$Outbound, CustomField$outboundSchema, } from "./customfield.js"; import { PassThroughBody, PassThroughBody$inboundSchema, PassThroughBody$Outbound, PassThroughBody$outboundSchema, } from "./passthroughbody.js"; /** * The type of the activity */ export const ActivityType = { Call: "call", Meeting: "meeting", Email: "email", Note: "note", Task: "task", Deadline: "deadline", SendLetter: "send-letter", SendQuote: "send-quote", Other: "other", } as const; /** * The type of the activity */ export type ActivityType = OpenEnum; export const ShowAs = { Free: "free", Busy: "busy", } as const; export type ShowAs = OpenEnum; export type Activity = { /** * The unique identifier of the activity */ id?: string | undefined; /** * The third-party API ID of original entity */ downstreamId?: string | null | undefined; /** * The date and time of the activity */ activityDatetime?: string | null | undefined; /** * The duration of the activity in seconds */ durationSeconds?: number | null | undefined; /** * The user related to the activity */ userId?: string | null | undefined; /** * The account related to the activity */ accountId?: string | null | undefined; /** * The contact related to the activity */ contactId?: string | null | undefined; /** * The company related to the activity */ companyId?: string | null | undefined; /** * The opportunity related to the activity */ opportunityId?: string | null | undefined; /** * The lead related to the activity */ leadId?: string | null | undefined; /** * The owner of the activity */ ownerId?: string | null | undefined; /** * The campaign related to the activity */ campaignId?: string | null | undefined; /** * The case related to the activity */ caseId?: string | null | undefined; /** * The asset related to the activity */ assetId?: string | null | undefined; /** * The contract related to the activity */ contractId?: string | null | undefined; /** * The product related to the activity */ productId?: string | null | undefined; /** * The solution related to the activity */ solutionId?: string | null | undefined; /** * The custom object related to the activity */ customObjectId?: string | null | undefined; /** * The type of the activity */ type: ActivityType | null; /** * The title of the activity */ title?: string | null | undefined; /** * A description of the activity */ description?: string | null | undefined; /** * An internal note about the activity */ note?: string | null | undefined; /** * The location of the activity */ location?: string | null | undefined; locationAddress?: Address | undefined; /** * Whether the Activity is an all day event or not */ allDayEvent?: boolean | null | undefined; /** * Whether the Activity is private or not */ private?: boolean | null | undefined; /** * Whether the Activity is a group event or not */ groupEvent?: boolean | null | undefined; /** * The sub type of the group event */ eventSubType?: string | null | undefined; /** * The type of the group event */ groupEventType?: string | null | undefined; /** * Whether the activity is a child of another activity or not */ child?: boolean | null | undefined; /** * Whether the activity is archived or not */ archived?: boolean | null | undefined; /** * Whether the activity is deleted or not */ deleted?: boolean | null | undefined; showAs?: ShowAs | null | undefined; /** * Whether the Activity is done or not */ done?: boolean | null | undefined; /** * The start date and time of the activity */ startDatetime?: string | null | undefined; /** * The end date and time of the activity */ endDatetime?: string | null | undefined; /** * The duration of the activity in minutes */ durationMinutes?: number | null | undefined; /** * The date of the activity */ activityDate?: string | null | undefined; /** * The end date of the activity */ endDate?: string | null | undefined; /** * Whether the activity is recurrent or not */ recurrent?: boolean | undefined; /** * The date and time of the reminder */ reminderDatetime?: string | null | undefined; /** * Whether the reminder is set or not */ reminderSet?: boolean | null | undefined; /** * The URL of the video conference */ videoConferenceUrl?: string | null | undefined; /** * The ID of the video conference */ videoConferenceId?: string | null | undefined; /** * Custom fields of the activity */ customFields?: Array | undefined; attendees?: Array | undefined; /** * When custom mappings are configured on the resource, the result is included here. */ customMappings?: { [k: string]: any } | null | undefined; /** * The user who last updated the activity */ updatedBy?: string | null | undefined; /** * The user who created the activity */ createdBy?: string | null | undefined; /** * The date and time when the activity was last updated */ updatedAt?: string | null | undefined; /** * The date and time when the activity was created */ createdAt?: string | null | undefined; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ passThrough?: Array | undefined; }; export type ActivityInput = { /** * The date and time of the activity */ activityDatetime?: string | null | undefined; /** * The duration of the activity in seconds */ durationSeconds?: number | null | undefined; /** * The user related to the activity */ userId?: string | null | undefined; /** * The account related to the activity */ accountId?: string | null | undefined; /** * The contact related to the activity */ contactId?: string | null | undefined; /** * The company related to the activity */ companyId?: string | null | undefined; /** * The opportunity related to the activity */ opportunityId?: string | null | undefined; /** * The lead related to the activity */ leadId?: string | null | undefined; /** * The owner of the activity */ ownerId?: string | null | undefined; /** * The campaign related to the activity */ campaignId?: string | null | undefined; /** * The case related to the activity */ caseId?: string | null | undefined; /** * The asset related to the activity */ assetId?: string | null | undefined; /** * The contract related to the activity */ contractId?: string | null | undefined; /** * The product related to the activity */ productId?: string | null | undefined; /** * The solution related to the activity */ solutionId?: string | null | undefined; /** * The custom object related to the activity */ customObjectId?: string | null | undefined; /** * The type of the activity */ type: ActivityType | null; /** * The title of the activity */ title?: string | null | undefined; /** * A description of the activity */ description?: string | null | undefined; /** * An internal note about the activity */ note?: string | null | undefined; /** * The location of the activity */ location?: string | null | undefined; locationAddress?: Address | undefined; /** * Whether the Activity is an all day event or not */ allDayEvent?: boolean | null | undefined; /** * Whether the Activity is private or not */ private?: boolean | null | undefined; /** * Whether the Activity is a group event or not */ groupEvent?: boolean | null | undefined; /** * The sub type of the group event */ eventSubType?: string | null | undefined; /** * The type of the group event */ groupEventType?: string | null | undefined; /** * Whether the activity is a child of another activity or not */ child?: boolean | null | undefined; /** * Whether the activity is archived or not */ archived?: boolean | null | undefined; /** * Whether the activity is deleted or not */ deleted?: boolean | null | undefined; showAs?: ShowAs | null | undefined; /** * Whether the Activity is done or not */ done?: boolean | null | undefined; /** * The start date and time of the activity */ startDatetime?: string | null | undefined; /** * The end date and time of the activity */ endDatetime?: string | null | undefined; /** * The date of the activity */ activityDate?: string | null | undefined; /** * The end date of the activity */ endDate?: string | null | undefined; /** * Whether the activity is recurrent or not */ recurrent?: boolean | undefined; /** * The date and time of the reminder */ reminderDatetime?: string | null | undefined; /** * Whether the reminder is set or not */ reminderSet?: boolean | null | undefined; /** * The URL of the video conference */ videoConferenceUrl?: string | null | undefined; /** * The ID of the video conference */ videoConferenceId?: string | null | undefined; /** * Custom fields of the activity */ customFields?: Array | undefined; attendees?: Array | undefined; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ passThrough?: Array | undefined; }; /** @internal */ export const ActivityType$inboundSchema: z.ZodType< ActivityType, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => openEnums.inboundSchema(ActivityType)); /** @internal */ export const ActivityType$outboundSchema: z.ZodType< string, z.ZodTypeDef, ActivityType > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(ActivityType)); /** @internal */ export const ShowAs$inboundSchema: z.ZodType = /* @__PURE__ */ lazySchema$(() => openEnums.inboundSchema(ShowAs)); /** @internal */ export const ShowAs$outboundSchema: z.ZodType = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(ShowAs)); /** @internal */ export const Activity$inboundSchema: z.ZodType< Activity, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.optional(types.string()), downstream_id: z.nullable(types.string()).optional(), activity_datetime: z.nullable(types.string()).optional(), duration_seconds: z.nullable(types.number()).optional(), user_id: z.nullable(types.string()).optional(), account_id: z.nullable(types.string()).optional(), contact_id: z.nullable(types.string()).optional(), company_id: z.nullable(types.string()).optional(), opportunity_id: z.nullable(types.string()).optional(), lead_id: z.nullable(types.string()).optional(), owner_id: z.nullable(types.string()).optional(), campaign_id: z.nullable(types.string()).optional(), case_id: z.nullable(types.string()).optional(), asset_id: z.nullable(types.string()).optional(), contract_id: z.nullable(types.string()).optional(), product_id: z.nullable(types.string()).optional(), solution_id: z.nullable(types.string()).optional(), custom_object_id: z.nullable(types.string()).optional(), type: types.nullable(ActivityType$inboundSchema), title: z.nullable(types.string()).optional(), description: z.nullable(types.string()).optional(), note: z.nullable(types.string()).optional(), location: z.nullable(types.string()).optional(), location_address: types.optional(Address$inboundSchema), all_day_event: z.nullable(types.boolean()).optional(), private: z.nullable(types.boolean()).optional(), group_event: z.nullable(types.boolean()).optional(), event_sub_type: z.nullable(types.string()).optional(), group_event_type: z.nullable(types.string()).optional(), child: z.nullable(types.boolean()).optional(), archived: z.nullable(types.boolean()).optional(), deleted: z.nullable(types.boolean()).optional(), show_as: z.nullable(ShowAs$inboundSchema).optional(), done: z.nullable(types.boolean()).optional(), start_datetime: z.nullable(types.string()).optional(), end_datetime: z.nullable(types.string()).optional(), duration_minutes: z.nullable(types.number()).optional(), activity_date: z.nullable(types.string()).optional(), end_date: z.nullable(types.string()).optional(), recurrent: types.optional(types.boolean()), reminder_datetime: z.nullable(types.string()).optional(), reminder_set: z.nullable(types.boolean()).optional(), video_conference_url: z.nullable(types.string()).optional(), video_conference_id: z.nullable(types.string()).optional(), custom_fields: types.optional(z.array(CustomField$inboundSchema)), attendees: types.optional(z.array(ActivityAttendee$inboundSchema)), custom_mappings: z.nullable(z.record(z.any())).optional(), updated_by: z.nullable(types.string()).optional(), created_by: z.nullable(types.string()).optional(), updated_at: z.nullable(types.string()).optional(), created_at: z.nullable(types.string()).optional(), pass_through: types.optional(z.array(PassThroughBody$inboundSchema)), }).transform((v) => { return remap$(v, { "downstream_id": "downstreamId", "activity_datetime": "activityDatetime", "duration_seconds": "durationSeconds", "user_id": "userId", "account_id": "accountId", "contact_id": "contactId", "company_id": "companyId", "opportunity_id": "opportunityId", "lead_id": "leadId", "owner_id": "ownerId", "campaign_id": "campaignId", "case_id": "caseId", "asset_id": "assetId", "contract_id": "contractId", "product_id": "productId", "solution_id": "solutionId", "custom_object_id": "customObjectId", "location_address": "locationAddress", "all_day_event": "allDayEvent", "group_event": "groupEvent", "event_sub_type": "eventSubType", "group_event_type": "groupEventType", "show_as": "showAs", "start_datetime": "startDatetime", "end_datetime": "endDatetime", "duration_minutes": "durationMinutes", "activity_date": "activityDate", "end_date": "endDate", "reminder_datetime": "reminderDatetime", "reminder_set": "reminderSet", "video_conference_url": "videoConferenceUrl", "video_conference_id": "videoConferenceId", "custom_fields": "customFields", "custom_mappings": "customMappings", "updated_by": "updatedBy", "created_by": "createdBy", "updated_at": "updatedAt", "created_at": "createdAt", "pass_through": "passThrough", }); }) ); export function activityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Activity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Activity' from JSON`, ); } /** @internal */ export type ActivityInput$Outbound = { activity_datetime?: string | null | undefined; duration_seconds?: number | null | undefined; user_id?: string | null | undefined; account_id?: string | null | undefined; contact_id?: string | null | undefined; company_id?: string | null | undefined; opportunity_id?: string | null | undefined; lead_id?: string | null | undefined; owner_id?: string | null | undefined; campaign_id?: string | null | undefined; case_id?: string | null | undefined; asset_id?: string | null | undefined; contract_id?: string | null | undefined; product_id?: string | null | undefined; solution_id?: string | null | undefined; custom_object_id?: string | null | undefined; type: string | null; title?: string | null | undefined; description?: string | null | undefined; note?: string | null | undefined; location?: string | null | undefined; location_address?: Address$Outbound | undefined; all_day_event?: boolean | null | undefined; private?: boolean | null | undefined; group_event?: boolean | null | undefined; event_sub_type?: string | null | undefined; group_event_type?: string | null | undefined; child?: boolean | null | undefined; archived?: boolean | null | undefined; deleted?: boolean | null | undefined; show_as?: string | null | undefined; done?: boolean | null | undefined; start_datetime?: string | null | undefined; end_datetime?: string | null | undefined; activity_date?: string | null | undefined; end_date?: string | null | undefined; recurrent?: boolean | undefined; reminder_datetime?: string | null | undefined; reminder_set?: boolean | null | undefined; video_conference_url?: string | null | undefined; video_conference_id?: string | null | undefined; custom_fields?: Array | undefined; attendees?: Array | undefined; pass_through?: Array | undefined; }; /** @internal */ export const ActivityInput$outboundSchema: z.ZodType< ActivityInput$Outbound, z.ZodTypeDef, ActivityInput > = /* @__PURE__ */ lazySchema$(() => z.object({ activityDatetime: z.nullable(z.string()).optional(), durationSeconds: z.nullable(z.number().int()).optional(), userId: z.nullable(z.string()).optional(), accountId: z.nullable(z.string()).optional(), contactId: z.nullable(z.string()).optional(), companyId: z.nullable(z.string()).optional(), opportunityId: z.nullable(z.string()).optional(), leadId: z.nullable(z.string()).optional(), ownerId: z.nullable(z.string()).optional(), campaignId: z.nullable(z.string()).optional(), caseId: z.nullable(z.string()).optional(), assetId: z.nullable(z.string()).optional(), contractId: z.nullable(z.string()).optional(), productId: z.nullable(z.string()).optional(), solutionId: z.nullable(z.string()).optional(), customObjectId: z.nullable(z.string()).optional(), type: z.nullable(ActivityType$outboundSchema), title: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), note: z.nullable(z.string()).optional(), location: z.nullable(z.string()).optional(), locationAddress: Address$outboundSchema.optional(), allDayEvent: z.nullable(z.boolean()).optional(), private: z.nullable(z.boolean()).optional(), groupEvent: z.nullable(z.boolean()).optional(), eventSubType: z.nullable(z.string()).optional(), groupEventType: z.nullable(z.string()).optional(), child: z.nullable(z.boolean()).optional(), archived: z.nullable(z.boolean()).optional(), deleted: z.nullable(z.boolean()).optional(), showAs: z.nullable(ShowAs$outboundSchema).optional(), done: z.nullable(z.boolean()).optional(), startDatetime: z.nullable(z.string()).optional(), endDatetime: z.nullable(z.string()).optional(), activityDate: z.nullable(z.string()).optional(), endDate: z.nullable(z.string()).optional(), recurrent: z.boolean().optional(), reminderDatetime: z.nullable(z.string()).optional(), reminderSet: z.nullable(z.boolean()).optional(), videoConferenceUrl: z.nullable(z.string()).optional(), videoConferenceId: z.nullable(z.string()).optional(), customFields: z.array(CustomField$outboundSchema).optional(), attendees: z.array(ActivityAttendeeInput$outboundSchema).optional(), passThrough: z.array(PassThroughBody$outboundSchema).optional(), }).transform((v) => { return remap$(v, { activityDatetime: "activity_datetime", durationSeconds: "duration_seconds", userId: "user_id", accountId: "account_id", contactId: "contact_id", companyId: "company_id", opportunityId: "opportunity_id", leadId: "lead_id", ownerId: "owner_id", campaignId: "campaign_id", caseId: "case_id", assetId: "asset_id", contractId: "contract_id", productId: "product_id", solutionId: "solution_id", customObjectId: "custom_object_id", locationAddress: "location_address", allDayEvent: "all_day_event", groupEvent: "group_event", eventSubType: "event_sub_type", groupEventType: "group_event_type", showAs: "show_as", startDatetime: "start_datetime", endDatetime: "end_datetime", activityDate: "activity_date", endDate: "end_date", reminderDatetime: "reminder_datetime", reminderSet: "reminder_set", videoConferenceUrl: "video_conference_url", videoConferenceId: "video_conference_id", customFields: "custom_fields", passThrough: "pass_through", }); }) ); export function activityInputToJSON(activityInput: ActivityInput): string { return JSON.stringify(ActivityInput$outboundSchema.parse(activityInput)); }