/* * 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 CrmPipelinesDeleteGlobals = { /** * 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 CrmPipelinesDeleteRequest = { /** * 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 CrmPipelinesDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Pipeline deleted */ deletePipelineResponse?: components.DeletePipelineResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const CrmPipelinesDeleteGlobals$inboundSchema: z.ZodType< CrmPipelinesDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type CrmPipelinesDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const CrmPipelinesDeleteGlobals$outboundSchema: z.ZodType< CrmPipelinesDeleteGlobals$Outbound, z.ZodTypeDef, CrmPipelinesDeleteGlobals > = 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 CrmPipelinesDeleteGlobals$ { /** @deprecated use `CrmPipelinesDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = CrmPipelinesDeleteGlobals$inboundSchema; /** @deprecated use `CrmPipelinesDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = CrmPipelinesDeleteGlobals$outboundSchema; /** @deprecated use `CrmPipelinesDeleteGlobals$Outbound` instead. */ export type Outbound = CrmPipelinesDeleteGlobals$Outbound; } export function crmPipelinesDeleteGlobalsToJSON( crmPipelinesDeleteGlobals: CrmPipelinesDeleteGlobals, ): string { return JSON.stringify( CrmPipelinesDeleteGlobals$outboundSchema.parse(crmPipelinesDeleteGlobals), ); } export function crmPipelinesDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmPipelinesDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmPipelinesDeleteGlobals' from JSON`, ); } /** @internal */ export const CrmPipelinesDeleteRequest$inboundSchema: z.ZodType< CrmPipelinesDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type CrmPipelinesDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const CrmPipelinesDeleteRequest$outboundSchema: z.ZodType< CrmPipelinesDeleteRequest$Outbound, z.ZodTypeDef, CrmPipelinesDeleteRequest > = 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 CrmPipelinesDeleteRequest$ { /** @deprecated use `CrmPipelinesDeleteRequest$inboundSchema` instead. */ export const inboundSchema = CrmPipelinesDeleteRequest$inboundSchema; /** @deprecated use `CrmPipelinesDeleteRequest$outboundSchema` instead. */ export const outboundSchema = CrmPipelinesDeleteRequest$outboundSchema; /** @deprecated use `CrmPipelinesDeleteRequest$Outbound` instead. */ export type Outbound = CrmPipelinesDeleteRequest$Outbound; } export function crmPipelinesDeleteRequestToJSON( crmPipelinesDeleteRequest: CrmPipelinesDeleteRequest, ): string { return JSON.stringify( CrmPipelinesDeleteRequest$outboundSchema.parse(crmPipelinesDeleteRequest), ); } export function crmPipelinesDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmPipelinesDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmPipelinesDeleteRequest' from JSON`, ); } /** @internal */ export const CrmPipelinesDeleteResponse$inboundSchema: z.ZodType< CrmPipelinesDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeletePipelineResponse: components.DeletePipelineResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeletePipelineResponse": "deletePipelineResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type CrmPipelinesDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeletePipelineResponse?: | components.DeletePipelineResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const CrmPipelinesDeleteResponse$outboundSchema: z.ZodType< CrmPipelinesDeleteResponse$Outbound, z.ZodTypeDef, CrmPipelinesDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deletePipelineResponse: components.DeletePipelineResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deletePipelineResponse: "DeletePipelineResponse", 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 CrmPipelinesDeleteResponse$ { /** @deprecated use `CrmPipelinesDeleteResponse$inboundSchema` instead. */ export const inboundSchema = CrmPipelinesDeleteResponse$inboundSchema; /** @deprecated use `CrmPipelinesDeleteResponse$outboundSchema` instead. */ export const outboundSchema = CrmPipelinesDeleteResponse$outboundSchema; /** @deprecated use `CrmPipelinesDeleteResponse$Outbound` instead. */ export type Outbound = CrmPipelinesDeleteResponse$Outbound; } export function crmPipelinesDeleteResponseToJSON( crmPipelinesDeleteResponse: CrmPipelinesDeleteResponse, ): string { return JSON.stringify( CrmPipelinesDeleteResponse$outboundSchema.parse(crmPipelinesDeleteResponse), ); } export function crmPipelinesDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmPipelinesDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmPipelinesDeleteResponse' from JSON`, ); }