/* * 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 AccountingPaymentsDeleteGlobals = { /** * 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 AccountingPaymentsDeleteRequest = { /** * 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 AccountingPaymentsDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Payment deleted */ deletePaymentResponse?: components.DeletePaymentResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingPaymentsDeleteGlobals$inboundSchema: z.ZodType< AccountingPaymentsDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingPaymentsDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingPaymentsDeleteGlobals$outboundSchema: z.ZodType< AccountingPaymentsDeleteGlobals$Outbound, z.ZodTypeDef, AccountingPaymentsDeleteGlobals > = 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 AccountingPaymentsDeleteGlobals$ { /** @deprecated use `AccountingPaymentsDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingPaymentsDeleteGlobals$inboundSchema; /** @deprecated use `AccountingPaymentsDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingPaymentsDeleteGlobals$outboundSchema; /** @deprecated use `AccountingPaymentsDeleteGlobals$Outbound` instead. */ export type Outbound = AccountingPaymentsDeleteGlobals$Outbound; } export function accountingPaymentsDeleteGlobalsToJSON( accountingPaymentsDeleteGlobals: AccountingPaymentsDeleteGlobals, ): string { return JSON.stringify( AccountingPaymentsDeleteGlobals$outboundSchema.parse( accountingPaymentsDeleteGlobals, ), ); } export function accountingPaymentsDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingPaymentsDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingPaymentsDeleteGlobals' from JSON`, ); } /** @internal */ export const AccountingPaymentsDeleteRequest$inboundSchema: z.ZodType< AccountingPaymentsDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type AccountingPaymentsDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const AccountingPaymentsDeleteRequest$outboundSchema: z.ZodType< AccountingPaymentsDeleteRequest$Outbound, z.ZodTypeDef, AccountingPaymentsDeleteRequest > = 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 AccountingPaymentsDeleteRequest$ { /** @deprecated use `AccountingPaymentsDeleteRequest$inboundSchema` instead. */ export const inboundSchema = AccountingPaymentsDeleteRequest$inboundSchema; /** @deprecated use `AccountingPaymentsDeleteRequest$outboundSchema` instead. */ export const outboundSchema = AccountingPaymentsDeleteRequest$outboundSchema; /** @deprecated use `AccountingPaymentsDeleteRequest$Outbound` instead. */ export type Outbound = AccountingPaymentsDeleteRequest$Outbound; } export function accountingPaymentsDeleteRequestToJSON( accountingPaymentsDeleteRequest: AccountingPaymentsDeleteRequest, ): string { return JSON.stringify( AccountingPaymentsDeleteRequest$outboundSchema.parse( accountingPaymentsDeleteRequest, ), ); } export function accountingPaymentsDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingPaymentsDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingPaymentsDeleteRequest' from JSON`, ); } /** @internal */ export const AccountingPaymentsDeleteResponse$inboundSchema: z.ZodType< AccountingPaymentsDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeletePaymentResponse: components.DeletePaymentResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeletePaymentResponse": "deletePaymentResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingPaymentsDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeletePaymentResponse?: components.DeletePaymentResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingPaymentsDeleteResponse$outboundSchema: z.ZodType< AccountingPaymentsDeleteResponse$Outbound, z.ZodTypeDef, AccountingPaymentsDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deletePaymentResponse: components.DeletePaymentResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deletePaymentResponse: "DeletePaymentResponse", 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 AccountingPaymentsDeleteResponse$ { /** @deprecated use `AccountingPaymentsDeleteResponse$inboundSchema` instead. */ export const inboundSchema = AccountingPaymentsDeleteResponse$inboundSchema; /** @deprecated use `AccountingPaymentsDeleteResponse$outboundSchema` instead. */ export const outboundSchema = AccountingPaymentsDeleteResponse$outboundSchema; /** @deprecated use `AccountingPaymentsDeleteResponse$Outbound` instead. */ export type Outbound = AccountingPaymentsDeleteResponse$Outbound; } export function accountingPaymentsDeleteResponseToJSON( accountingPaymentsDeleteResponse: AccountingPaymentsDeleteResponse, ): string { return JSON.stringify( AccountingPaymentsDeleteResponse$outboundSchema.parse( accountingPaymentsDeleteResponse, ), ); } export function accountingPaymentsDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingPaymentsDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingPaymentsDeleteResponse' from JSON`, ); }