/* * 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 CrmContactsDeleteGlobals = { /** * 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 CrmContactsDeleteRequest = { /** * ID of the record you are acting upon. */ id: string; /** * 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; /** * Include raw response. Mostly used for debugging purposes */ raw?: boolean | undefined; }; export type CrmContactsDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Contact deleted */ deleteContactResponse?: components.DeleteContactResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const CrmContactsDeleteGlobals$inboundSchema: z.ZodType< CrmContactsDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type CrmContactsDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const CrmContactsDeleteGlobals$outboundSchema: z.ZodType< CrmContactsDeleteGlobals$Outbound, z.ZodTypeDef, CrmContactsDeleteGlobals > = 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 CrmContactsDeleteGlobals$ { /** @deprecated use `CrmContactsDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = CrmContactsDeleteGlobals$inboundSchema; /** @deprecated use `CrmContactsDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = CrmContactsDeleteGlobals$outboundSchema; /** @deprecated use `CrmContactsDeleteGlobals$Outbound` instead. */ export type Outbound = CrmContactsDeleteGlobals$Outbound; } export function crmContactsDeleteGlobalsToJSON( crmContactsDeleteGlobals: CrmContactsDeleteGlobals, ): string { return JSON.stringify( CrmContactsDeleteGlobals$outboundSchema.parse(crmContactsDeleteGlobals), ); } export function crmContactsDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmContactsDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmContactsDeleteGlobals' from JSON`, ); } /** @internal */ export const CrmContactsDeleteRequest$inboundSchema: z.ZodType< CrmContactsDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type CrmContactsDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const CrmContactsDeleteRequest$outboundSchema: z.ZodType< CrmContactsDeleteRequest$Outbound, z.ZodTypeDef, CrmContactsDeleteRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CrmContactsDeleteRequest$ { /** @deprecated use `CrmContactsDeleteRequest$inboundSchema` instead. */ export const inboundSchema = CrmContactsDeleteRequest$inboundSchema; /** @deprecated use `CrmContactsDeleteRequest$outboundSchema` instead. */ export const outboundSchema = CrmContactsDeleteRequest$outboundSchema; /** @deprecated use `CrmContactsDeleteRequest$Outbound` instead. */ export type Outbound = CrmContactsDeleteRequest$Outbound; } export function crmContactsDeleteRequestToJSON( crmContactsDeleteRequest: CrmContactsDeleteRequest, ): string { return JSON.stringify( CrmContactsDeleteRequest$outboundSchema.parse(crmContactsDeleteRequest), ); } export function crmContactsDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmContactsDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmContactsDeleteRequest' from JSON`, ); } /** @internal */ export const CrmContactsDeleteResponse$inboundSchema: z.ZodType< CrmContactsDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteContactResponse: components.DeleteContactResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteContactResponse": "deleteContactResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type CrmContactsDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteContactResponse?: components.DeleteContactResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const CrmContactsDeleteResponse$outboundSchema: z.ZodType< CrmContactsDeleteResponse$Outbound, z.ZodTypeDef, CrmContactsDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteContactResponse: components.DeleteContactResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteContactResponse: "DeleteContactResponse", 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 CrmContactsDeleteResponse$ { /** @deprecated use `CrmContactsDeleteResponse$inboundSchema` instead. */ export const inboundSchema = CrmContactsDeleteResponse$inboundSchema; /** @deprecated use `CrmContactsDeleteResponse$outboundSchema` instead. */ export const outboundSchema = CrmContactsDeleteResponse$outboundSchema; /** @deprecated use `CrmContactsDeleteResponse$Outbound` instead. */ export type Outbound = CrmContactsDeleteResponse$Outbound; } export function crmContactsDeleteResponseToJSON( crmContactsDeleteResponse: CrmContactsDeleteResponse, ): string { return JSON.stringify( CrmContactsDeleteResponse$outboundSchema.parse(crmContactsDeleteResponse), ); } export function crmContactsDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmContactsDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmContactsDeleteResponse' from JSON`, ); }