/* * 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 CrmOpportunitiesDeleteGlobals = { /** * 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 CrmOpportunitiesDeleteRequest = { /** * 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 CrmOpportunitiesDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Opportunity deleted */ deleteOpportunityResponse?: components.DeleteOpportunityResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const CrmOpportunitiesDeleteGlobals$inboundSchema: z.ZodType< CrmOpportunitiesDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type CrmOpportunitiesDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const CrmOpportunitiesDeleteGlobals$outboundSchema: z.ZodType< CrmOpportunitiesDeleteGlobals$Outbound, z.ZodTypeDef, CrmOpportunitiesDeleteGlobals > = 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 CrmOpportunitiesDeleteGlobals$ { /** @deprecated use `CrmOpportunitiesDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = CrmOpportunitiesDeleteGlobals$inboundSchema; /** @deprecated use `CrmOpportunitiesDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = CrmOpportunitiesDeleteGlobals$outboundSchema; /** @deprecated use `CrmOpportunitiesDeleteGlobals$Outbound` instead. */ export type Outbound = CrmOpportunitiesDeleteGlobals$Outbound; } export function crmOpportunitiesDeleteGlobalsToJSON( crmOpportunitiesDeleteGlobals: CrmOpportunitiesDeleteGlobals, ): string { return JSON.stringify( CrmOpportunitiesDeleteGlobals$outboundSchema.parse( crmOpportunitiesDeleteGlobals, ), ); } export function crmOpportunitiesDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmOpportunitiesDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmOpportunitiesDeleteGlobals' from JSON`, ); } /** @internal */ export const CrmOpportunitiesDeleteRequest$inboundSchema: z.ZodType< CrmOpportunitiesDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type CrmOpportunitiesDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const CrmOpportunitiesDeleteRequest$outboundSchema: z.ZodType< CrmOpportunitiesDeleteRequest$Outbound, z.ZodTypeDef, CrmOpportunitiesDeleteRequest > = 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 CrmOpportunitiesDeleteRequest$ { /** @deprecated use `CrmOpportunitiesDeleteRequest$inboundSchema` instead. */ export const inboundSchema = CrmOpportunitiesDeleteRequest$inboundSchema; /** @deprecated use `CrmOpportunitiesDeleteRequest$outboundSchema` instead. */ export const outboundSchema = CrmOpportunitiesDeleteRequest$outboundSchema; /** @deprecated use `CrmOpportunitiesDeleteRequest$Outbound` instead. */ export type Outbound = CrmOpportunitiesDeleteRequest$Outbound; } export function crmOpportunitiesDeleteRequestToJSON( crmOpportunitiesDeleteRequest: CrmOpportunitiesDeleteRequest, ): string { return JSON.stringify( CrmOpportunitiesDeleteRequest$outboundSchema.parse( crmOpportunitiesDeleteRequest, ), ); } export function crmOpportunitiesDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmOpportunitiesDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmOpportunitiesDeleteRequest' from JSON`, ); } /** @internal */ export const CrmOpportunitiesDeleteResponse$inboundSchema: z.ZodType< CrmOpportunitiesDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteOpportunityResponse: components.DeleteOpportunityResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteOpportunityResponse": "deleteOpportunityResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type CrmOpportunitiesDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteOpportunityResponse?: | components.DeleteOpportunityResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const CrmOpportunitiesDeleteResponse$outboundSchema: z.ZodType< CrmOpportunitiesDeleteResponse$Outbound, z.ZodTypeDef, CrmOpportunitiesDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteOpportunityResponse: components.DeleteOpportunityResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteOpportunityResponse: "DeleteOpportunityResponse", 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 CrmOpportunitiesDeleteResponse$ { /** @deprecated use `CrmOpportunitiesDeleteResponse$inboundSchema` instead. */ export const inboundSchema = CrmOpportunitiesDeleteResponse$inboundSchema; /** @deprecated use `CrmOpportunitiesDeleteResponse$outboundSchema` instead. */ export const outboundSchema = CrmOpportunitiesDeleteResponse$outboundSchema; /** @deprecated use `CrmOpportunitiesDeleteResponse$Outbound` instead. */ export type Outbound = CrmOpportunitiesDeleteResponse$Outbound; } export function crmOpportunitiesDeleteResponseToJSON( crmOpportunitiesDeleteResponse: CrmOpportunitiesDeleteResponse, ): string { return JSON.stringify( CrmOpportunitiesDeleteResponse$outboundSchema.parse( crmOpportunitiesDeleteResponse, ), ); } export function crmOpportunitiesDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmOpportunitiesDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmOpportunitiesDeleteResponse' from JSON`, ); }