/* * 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 CrmCompaniesDeleteGlobals = { /** * 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 CrmCompaniesDeleteRequest = { /** * ID of the record you are acting upon. */ id: string; /** * 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; }; export type CrmCompaniesDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Company deleted */ deleteCompanyResponse?: components.DeleteCompanyResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const CrmCompaniesDeleteGlobals$inboundSchema: z.ZodType< CrmCompaniesDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type CrmCompaniesDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const CrmCompaniesDeleteGlobals$outboundSchema: z.ZodType< CrmCompaniesDeleteGlobals$Outbound, z.ZodTypeDef, CrmCompaniesDeleteGlobals > = 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 CrmCompaniesDeleteGlobals$ { /** @deprecated use `CrmCompaniesDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = CrmCompaniesDeleteGlobals$inboundSchema; /** @deprecated use `CrmCompaniesDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = CrmCompaniesDeleteGlobals$outboundSchema; /** @deprecated use `CrmCompaniesDeleteGlobals$Outbound` instead. */ export type Outbound = CrmCompaniesDeleteGlobals$Outbound; } export function crmCompaniesDeleteGlobalsToJSON( crmCompaniesDeleteGlobals: CrmCompaniesDeleteGlobals, ): string { return JSON.stringify( CrmCompaniesDeleteGlobals$outboundSchema.parse(crmCompaniesDeleteGlobals), ); } export function crmCompaniesDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmCompaniesDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmCompaniesDeleteGlobals' from JSON`, ); } /** @internal */ export const CrmCompaniesDeleteRequest$inboundSchema: z.ZodType< CrmCompaniesDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), raw: z.boolean().default(false), serviceId: z.string().optional(), }); /** @internal */ export type CrmCompaniesDeleteRequest$Outbound = { id: string; raw: boolean; serviceId?: string | undefined; }; /** @internal */ export const CrmCompaniesDeleteRequest$outboundSchema: z.ZodType< CrmCompaniesDeleteRequest$Outbound, z.ZodTypeDef, CrmCompaniesDeleteRequest > = z.object({ id: z.string(), raw: z.boolean().default(false), serviceId: 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 CrmCompaniesDeleteRequest$ { /** @deprecated use `CrmCompaniesDeleteRequest$inboundSchema` instead. */ export const inboundSchema = CrmCompaniesDeleteRequest$inboundSchema; /** @deprecated use `CrmCompaniesDeleteRequest$outboundSchema` instead. */ export const outboundSchema = CrmCompaniesDeleteRequest$outboundSchema; /** @deprecated use `CrmCompaniesDeleteRequest$Outbound` instead. */ export type Outbound = CrmCompaniesDeleteRequest$Outbound; } export function crmCompaniesDeleteRequestToJSON( crmCompaniesDeleteRequest: CrmCompaniesDeleteRequest, ): string { return JSON.stringify( CrmCompaniesDeleteRequest$outboundSchema.parse(crmCompaniesDeleteRequest), ); } export function crmCompaniesDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmCompaniesDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmCompaniesDeleteRequest' from JSON`, ); } /** @internal */ export const CrmCompaniesDeleteResponse$inboundSchema: z.ZodType< CrmCompaniesDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteCompanyResponse: components.DeleteCompanyResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteCompanyResponse": "deleteCompanyResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type CrmCompaniesDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteCompanyResponse?: components.DeleteCompanyResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const CrmCompaniesDeleteResponse$outboundSchema: z.ZodType< CrmCompaniesDeleteResponse$Outbound, z.ZodTypeDef, CrmCompaniesDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteCompanyResponse: components.DeleteCompanyResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteCompanyResponse: "DeleteCompanyResponse", 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 CrmCompaniesDeleteResponse$ { /** @deprecated use `CrmCompaniesDeleteResponse$inboundSchema` instead. */ export const inboundSchema = CrmCompaniesDeleteResponse$inboundSchema; /** @deprecated use `CrmCompaniesDeleteResponse$outboundSchema` instead. */ export const outboundSchema = CrmCompaniesDeleteResponse$outboundSchema; /** @deprecated use `CrmCompaniesDeleteResponse$Outbound` instead. */ export type Outbound = CrmCompaniesDeleteResponse$Outbound; } export function crmCompaniesDeleteResponseToJSON( crmCompaniesDeleteResponse: CrmCompaniesDeleteResponse, ): string { return JSON.stringify( CrmCompaniesDeleteResponse$outboundSchema.parse(crmCompaniesDeleteResponse), ); } export function crmCompaniesDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmCompaniesDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmCompaniesDeleteResponse' from JSON`, ); }