/* * 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 AccountingBillPaymentsOneGlobals = { /** * 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 AccountingBillPaymentsOneRequest = { /** * 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; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ fields?: string | null | undefined; }; export type AccountingBillPaymentsOneResponse = { httpMeta: components.HTTPMetadata; /** * Bill Payment */ getBillPaymentResponse?: components.GetBillPaymentResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingBillPaymentsOneGlobals$inboundSchema: z.ZodType< AccountingBillPaymentsOneGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingBillPaymentsOneGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingBillPaymentsOneGlobals$outboundSchema: z.ZodType< AccountingBillPaymentsOneGlobals$Outbound, z.ZodTypeDef, AccountingBillPaymentsOneGlobals > = 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 AccountingBillPaymentsOneGlobals$ { /** @deprecated use `AccountingBillPaymentsOneGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingBillPaymentsOneGlobals$inboundSchema; /** @deprecated use `AccountingBillPaymentsOneGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingBillPaymentsOneGlobals$outboundSchema; /** @deprecated use `AccountingBillPaymentsOneGlobals$Outbound` instead. */ export type Outbound = AccountingBillPaymentsOneGlobals$Outbound; } export function accountingBillPaymentsOneGlobalsToJSON( accountingBillPaymentsOneGlobals: AccountingBillPaymentsOneGlobals, ): string { return JSON.stringify( AccountingBillPaymentsOneGlobals$outboundSchema.parse( accountingBillPaymentsOneGlobals, ), ); } export function accountingBillPaymentsOneGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingBillPaymentsOneGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingBillPaymentsOneGlobals' from JSON`, ); } /** @internal */ export const AccountingBillPaymentsOneRequest$inboundSchema: z.ZodType< AccountingBillPaymentsOneRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), fields: z.nullable(z.string()).optional(), }); /** @internal */ export type AccountingBillPaymentsOneRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; fields?: string | null | undefined; }; /** @internal */ export const AccountingBillPaymentsOneRequest$outboundSchema: z.ZodType< AccountingBillPaymentsOneRequest$Outbound, z.ZodTypeDef, AccountingBillPaymentsOneRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), fields: z.nullable(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 AccountingBillPaymentsOneRequest$ { /** @deprecated use `AccountingBillPaymentsOneRequest$inboundSchema` instead. */ export const inboundSchema = AccountingBillPaymentsOneRequest$inboundSchema; /** @deprecated use `AccountingBillPaymentsOneRequest$outboundSchema` instead. */ export const outboundSchema = AccountingBillPaymentsOneRequest$outboundSchema; /** @deprecated use `AccountingBillPaymentsOneRequest$Outbound` instead. */ export type Outbound = AccountingBillPaymentsOneRequest$Outbound; } export function accountingBillPaymentsOneRequestToJSON( accountingBillPaymentsOneRequest: AccountingBillPaymentsOneRequest, ): string { return JSON.stringify( AccountingBillPaymentsOneRequest$outboundSchema.parse( accountingBillPaymentsOneRequest, ), ); } export function accountingBillPaymentsOneRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingBillPaymentsOneRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingBillPaymentsOneRequest' from JSON`, ); } /** @internal */ export const AccountingBillPaymentsOneResponse$inboundSchema: z.ZodType< AccountingBillPaymentsOneResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetBillPaymentResponse: components.GetBillPaymentResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetBillPaymentResponse": "getBillPaymentResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingBillPaymentsOneResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetBillPaymentResponse?: | components.GetBillPaymentResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingBillPaymentsOneResponse$outboundSchema: z.ZodType< AccountingBillPaymentsOneResponse$Outbound, z.ZodTypeDef, AccountingBillPaymentsOneResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getBillPaymentResponse: components.GetBillPaymentResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getBillPaymentResponse: "GetBillPaymentResponse", 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 AccountingBillPaymentsOneResponse$ { /** @deprecated use `AccountingBillPaymentsOneResponse$inboundSchema` instead. */ export const inboundSchema = AccountingBillPaymentsOneResponse$inboundSchema; /** @deprecated use `AccountingBillPaymentsOneResponse$outboundSchema` instead. */ export const outboundSchema = AccountingBillPaymentsOneResponse$outboundSchema; /** @deprecated use `AccountingBillPaymentsOneResponse$Outbound` instead. */ export type Outbound = AccountingBillPaymentsOneResponse$Outbound; } export function accountingBillPaymentsOneResponseToJSON( accountingBillPaymentsOneResponse: AccountingBillPaymentsOneResponse, ): string { return JSON.stringify( AccountingBillPaymentsOneResponse$outboundSchema.parse( accountingBillPaymentsOneResponse, ), ); } export function accountingBillPaymentsOneResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingBillPaymentsOneResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingBillPaymentsOneResponse' from JSON`, ); }