/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CrmActivitiesAddGlobals = { /** * ID of the consumer which you want to get or push data from */ consumerId?: string | undefined; /** * The ID of your Unify application */ appId?: string | undefined; }; export type CrmActivitiesAddRequest = { /** * Include raw response. Mostly used for debugging purposes */ raw?: boolean | undefined; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ serviceId?: string | undefined; activity: components.ActivityInput; }; export type CrmActivitiesAddResponse = { httpMeta: components.HTTPMetadata; /** * Activity created */ createActivityResponse?: components.CreateActivityResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const CrmActivitiesAddGlobals$inboundSchema: z.ZodType< CrmActivitiesAddGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type CrmActivitiesAddGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const CrmActivitiesAddGlobals$outboundSchema: z.ZodType< CrmActivitiesAddGlobals$Outbound, z.ZodTypeDef, CrmActivitiesAddGlobals > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CrmActivitiesAddGlobals$ { /** @deprecated use `CrmActivitiesAddGlobals$inboundSchema` instead. */ export const inboundSchema = CrmActivitiesAddGlobals$inboundSchema; /** @deprecated use `CrmActivitiesAddGlobals$outboundSchema` instead. */ export const outboundSchema = CrmActivitiesAddGlobals$outboundSchema; /** @deprecated use `CrmActivitiesAddGlobals$Outbound` instead. */ export type Outbound = CrmActivitiesAddGlobals$Outbound; } export function crmActivitiesAddGlobalsToJSON( crmActivitiesAddGlobals: CrmActivitiesAddGlobals, ): string { return JSON.stringify( CrmActivitiesAddGlobals$outboundSchema.parse(crmActivitiesAddGlobals), ); } export function crmActivitiesAddGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmActivitiesAddGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmActivitiesAddGlobals' from JSON`, ); } /** @internal */ export const CrmActivitiesAddRequest$inboundSchema: z.ZodType< CrmActivitiesAddRequest, z.ZodTypeDef, unknown > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), Activity: components.ActivityInput$inboundSchema, }).transform((v) => { return remap$(v, { "Activity": "activity", }); }); /** @internal */ export type CrmActivitiesAddRequest$Outbound = { raw: boolean; serviceId?: string | undefined; Activity: components.ActivityInput$Outbound; }; /** @internal */ export const CrmActivitiesAddRequest$outboundSchema: z.ZodType< CrmActivitiesAddRequest$Outbound, z.ZodTypeDef, CrmActivitiesAddRequest > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), activity: components.ActivityInput$outboundSchema, }).transform((v) => { return remap$(v, { activity: "Activity", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CrmActivitiesAddRequest$ { /** @deprecated use `CrmActivitiesAddRequest$inboundSchema` instead. */ export const inboundSchema = CrmActivitiesAddRequest$inboundSchema; /** @deprecated use `CrmActivitiesAddRequest$outboundSchema` instead. */ export const outboundSchema = CrmActivitiesAddRequest$outboundSchema; /** @deprecated use `CrmActivitiesAddRequest$Outbound` instead. */ export type Outbound = CrmActivitiesAddRequest$Outbound; } export function crmActivitiesAddRequestToJSON( crmActivitiesAddRequest: CrmActivitiesAddRequest, ): string { return JSON.stringify( CrmActivitiesAddRequest$outboundSchema.parse(crmActivitiesAddRequest), ); } export function crmActivitiesAddRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmActivitiesAddRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmActivitiesAddRequest' from JSON`, ); } /** @internal */ export const CrmActivitiesAddResponse$inboundSchema: z.ZodType< CrmActivitiesAddResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, CreateActivityResponse: components.CreateActivityResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "CreateActivityResponse": "createActivityResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type CrmActivitiesAddResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; CreateActivityResponse?: | components.CreateActivityResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const CrmActivitiesAddResponse$outboundSchema: z.ZodType< CrmActivitiesAddResponse$Outbound, z.ZodTypeDef, CrmActivitiesAddResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, createActivityResponse: components.CreateActivityResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", createActivityResponse: "CreateActivityResponse", unexpectedErrorResponse: "UnexpectedErrorResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CrmActivitiesAddResponse$ { /** @deprecated use `CrmActivitiesAddResponse$inboundSchema` instead. */ export const inboundSchema = CrmActivitiesAddResponse$inboundSchema; /** @deprecated use `CrmActivitiesAddResponse$outboundSchema` instead. */ export const outboundSchema = CrmActivitiesAddResponse$outboundSchema; /** @deprecated use `CrmActivitiesAddResponse$Outbound` instead. */ export type Outbound = CrmActivitiesAddResponse$Outbound; } export function crmActivitiesAddResponseToJSON( crmActivitiesAddResponse: CrmActivitiesAddResponse, ): string { return JSON.stringify( CrmActivitiesAddResponse$outboundSchema.parse(crmActivitiesAddResponse), ); } export function crmActivitiesAddResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmActivitiesAddResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmActivitiesAddResponse' from JSON`, ); }