/* * 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 AccountingPaymentsUpdateGlobals = { /** * 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 AccountingPaymentsUpdateRequest = { /** * 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; payment: components.PaymentInput; }; export type AccountingPaymentsUpdateResponse = { httpMeta: components.HTTPMetadata; /** * Payment Updated */ updatePaymentResponse?: components.UpdatePaymentResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingPaymentsUpdateGlobals$inboundSchema: z.ZodType< AccountingPaymentsUpdateGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingPaymentsUpdateGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingPaymentsUpdateGlobals$outboundSchema: z.ZodType< AccountingPaymentsUpdateGlobals$Outbound, z.ZodTypeDef, AccountingPaymentsUpdateGlobals > = 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 AccountingPaymentsUpdateGlobals$ { /** @deprecated use `AccountingPaymentsUpdateGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingPaymentsUpdateGlobals$inboundSchema; /** @deprecated use `AccountingPaymentsUpdateGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingPaymentsUpdateGlobals$outboundSchema; /** @deprecated use `AccountingPaymentsUpdateGlobals$Outbound` instead. */ export type Outbound = AccountingPaymentsUpdateGlobals$Outbound; } export function accountingPaymentsUpdateGlobalsToJSON( accountingPaymentsUpdateGlobals: AccountingPaymentsUpdateGlobals, ): string { return JSON.stringify( AccountingPaymentsUpdateGlobals$outboundSchema.parse( accountingPaymentsUpdateGlobals, ), ); } export function accountingPaymentsUpdateGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingPaymentsUpdateGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingPaymentsUpdateGlobals' from JSON`, ); } /** @internal */ export const AccountingPaymentsUpdateRequest$inboundSchema: z.ZodType< AccountingPaymentsUpdateRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), Payment: components.PaymentInput$inboundSchema, }).transform((v) => { return remap$(v, { "Payment": "payment", }); }); /** @internal */ export type AccountingPaymentsUpdateRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; Payment: components.PaymentInput$Outbound; }; /** @internal */ export const AccountingPaymentsUpdateRequest$outboundSchema: z.ZodType< AccountingPaymentsUpdateRequest$Outbound, z.ZodTypeDef, AccountingPaymentsUpdateRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), payment: components.PaymentInput$outboundSchema, }).transform((v) => { return remap$(v, { payment: "Payment", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountingPaymentsUpdateRequest$ { /** @deprecated use `AccountingPaymentsUpdateRequest$inboundSchema` instead. */ export const inboundSchema = AccountingPaymentsUpdateRequest$inboundSchema; /** @deprecated use `AccountingPaymentsUpdateRequest$outboundSchema` instead. */ export const outboundSchema = AccountingPaymentsUpdateRequest$outboundSchema; /** @deprecated use `AccountingPaymentsUpdateRequest$Outbound` instead. */ export type Outbound = AccountingPaymentsUpdateRequest$Outbound; } export function accountingPaymentsUpdateRequestToJSON( accountingPaymentsUpdateRequest: AccountingPaymentsUpdateRequest, ): string { return JSON.stringify( AccountingPaymentsUpdateRequest$outboundSchema.parse( accountingPaymentsUpdateRequest, ), ); } export function accountingPaymentsUpdateRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingPaymentsUpdateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingPaymentsUpdateRequest' from JSON`, ); } /** @internal */ export const AccountingPaymentsUpdateResponse$inboundSchema: z.ZodType< AccountingPaymentsUpdateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, UpdatePaymentResponse: components.UpdatePaymentResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "UpdatePaymentResponse": "updatePaymentResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingPaymentsUpdateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; UpdatePaymentResponse?: components.UpdatePaymentResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingPaymentsUpdateResponse$outboundSchema: z.ZodType< AccountingPaymentsUpdateResponse$Outbound, z.ZodTypeDef, AccountingPaymentsUpdateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, updatePaymentResponse: components.UpdatePaymentResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", updatePaymentResponse: "UpdatePaymentResponse", 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 AccountingPaymentsUpdateResponse$ { /** @deprecated use `AccountingPaymentsUpdateResponse$inboundSchema` instead. */ export const inboundSchema = AccountingPaymentsUpdateResponse$inboundSchema; /** @deprecated use `AccountingPaymentsUpdateResponse$outboundSchema` instead. */ export const outboundSchema = AccountingPaymentsUpdateResponse$outboundSchema; /** @deprecated use `AccountingPaymentsUpdateResponse$Outbound` instead. */ export type Outbound = AccountingPaymentsUpdateResponse$Outbound; } export function accountingPaymentsUpdateResponseToJSON( accountingPaymentsUpdateResponse: AccountingPaymentsUpdateResponse, ): string { return JSON.stringify( AccountingPaymentsUpdateResponse$outboundSchema.parse( accountingPaymentsUpdateResponse, ), ); } export function accountingPaymentsUpdateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingPaymentsUpdateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingPaymentsUpdateResponse' from JSON`, ); }