/* * 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 AccountingBillPaymentsDeleteGlobals = { /** * 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 AccountingBillPaymentsDeleteRequest = { /** * 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 AccountingBillPaymentsDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Bill Payment deleted */ deleteBillPaymentResponse?: components.DeleteBillPaymentResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingBillPaymentsDeleteGlobals$inboundSchema: z.ZodType< AccountingBillPaymentsDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingBillPaymentsDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingBillPaymentsDeleteGlobals$outboundSchema: z.ZodType< AccountingBillPaymentsDeleteGlobals$Outbound, z.ZodTypeDef, AccountingBillPaymentsDeleteGlobals > = 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 AccountingBillPaymentsDeleteGlobals$ { /** @deprecated use `AccountingBillPaymentsDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingBillPaymentsDeleteGlobals$inboundSchema; /** @deprecated use `AccountingBillPaymentsDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingBillPaymentsDeleteGlobals$outboundSchema; /** @deprecated use `AccountingBillPaymentsDeleteGlobals$Outbound` instead. */ export type Outbound = AccountingBillPaymentsDeleteGlobals$Outbound; } export function accountingBillPaymentsDeleteGlobalsToJSON( accountingBillPaymentsDeleteGlobals: AccountingBillPaymentsDeleteGlobals, ): string { return JSON.stringify( AccountingBillPaymentsDeleteGlobals$outboundSchema.parse( accountingBillPaymentsDeleteGlobals, ), ); } export function accountingBillPaymentsDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingBillPaymentsDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingBillPaymentsDeleteGlobals' from JSON`, ); } /** @internal */ export const AccountingBillPaymentsDeleteRequest$inboundSchema: z.ZodType< AccountingBillPaymentsDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type AccountingBillPaymentsDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const AccountingBillPaymentsDeleteRequest$outboundSchema: z.ZodType< AccountingBillPaymentsDeleteRequest$Outbound, z.ZodTypeDef, AccountingBillPaymentsDeleteRequest > = 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 AccountingBillPaymentsDeleteRequest$ { /** @deprecated use `AccountingBillPaymentsDeleteRequest$inboundSchema` instead. */ export const inboundSchema = AccountingBillPaymentsDeleteRequest$inboundSchema; /** @deprecated use `AccountingBillPaymentsDeleteRequest$outboundSchema` instead. */ export const outboundSchema = AccountingBillPaymentsDeleteRequest$outboundSchema; /** @deprecated use `AccountingBillPaymentsDeleteRequest$Outbound` instead. */ export type Outbound = AccountingBillPaymentsDeleteRequest$Outbound; } export function accountingBillPaymentsDeleteRequestToJSON( accountingBillPaymentsDeleteRequest: AccountingBillPaymentsDeleteRequest, ): string { return JSON.stringify( AccountingBillPaymentsDeleteRequest$outboundSchema.parse( accountingBillPaymentsDeleteRequest, ), ); } export function accountingBillPaymentsDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingBillPaymentsDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingBillPaymentsDeleteRequest' from JSON`, ); } /** @internal */ export const AccountingBillPaymentsDeleteResponse$inboundSchema: z.ZodType< AccountingBillPaymentsDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteBillPaymentResponse: components.DeleteBillPaymentResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteBillPaymentResponse": "deleteBillPaymentResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingBillPaymentsDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteBillPaymentResponse?: | components.DeleteBillPaymentResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingBillPaymentsDeleteResponse$outboundSchema: z.ZodType< AccountingBillPaymentsDeleteResponse$Outbound, z.ZodTypeDef, AccountingBillPaymentsDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteBillPaymentResponse: components.DeleteBillPaymentResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteBillPaymentResponse: "DeleteBillPaymentResponse", 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 AccountingBillPaymentsDeleteResponse$ { /** @deprecated use `AccountingBillPaymentsDeleteResponse$inboundSchema` instead. */ export const inboundSchema = AccountingBillPaymentsDeleteResponse$inboundSchema; /** @deprecated use `AccountingBillPaymentsDeleteResponse$outboundSchema` instead. */ export const outboundSchema = AccountingBillPaymentsDeleteResponse$outboundSchema; /** @deprecated use `AccountingBillPaymentsDeleteResponse$Outbound` instead. */ export type Outbound = AccountingBillPaymentsDeleteResponse$Outbound; } export function accountingBillPaymentsDeleteResponseToJSON( accountingBillPaymentsDeleteResponse: AccountingBillPaymentsDeleteResponse, ): string { return JSON.stringify( AccountingBillPaymentsDeleteResponse$outboundSchema.parse( accountingBillPaymentsDeleteResponse, ), ); } export function accountingBillPaymentsDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingBillPaymentsDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingBillPaymentsDeleteResponse' from JSON`, ); }