/* * 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 AccountingBillsUpdateGlobals = { /** * 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 AccountingBillsUpdateRequest = { /** * 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; bill: components.BillInput; }; export type AccountingBillsUpdateResponse = { httpMeta: components.HTTPMetadata; /** * Bill Updated */ updateBillResponse?: components.UpdateBillResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingBillsUpdateGlobals$inboundSchema: z.ZodType< AccountingBillsUpdateGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingBillsUpdateGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingBillsUpdateGlobals$outboundSchema: z.ZodType< AccountingBillsUpdateGlobals$Outbound, z.ZodTypeDef, AccountingBillsUpdateGlobals > = 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 AccountingBillsUpdateGlobals$ { /** @deprecated use `AccountingBillsUpdateGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingBillsUpdateGlobals$inboundSchema; /** @deprecated use `AccountingBillsUpdateGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingBillsUpdateGlobals$outboundSchema; /** @deprecated use `AccountingBillsUpdateGlobals$Outbound` instead. */ export type Outbound = AccountingBillsUpdateGlobals$Outbound; } export function accountingBillsUpdateGlobalsToJSON( accountingBillsUpdateGlobals: AccountingBillsUpdateGlobals, ): string { return JSON.stringify( AccountingBillsUpdateGlobals$outboundSchema.parse( accountingBillsUpdateGlobals, ), ); } export function accountingBillsUpdateGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingBillsUpdateGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingBillsUpdateGlobals' from JSON`, ); } /** @internal */ export const AccountingBillsUpdateRequest$inboundSchema: z.ZodType< AccountingBillsUpdateRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), Bill: components.BillInput$inboundSchema, }).transform((v) => { return remap$(v, { "Bill": "bill", }); }); /** @internal */ export type AccountingBillsUpdateRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; Bill: components.BillInput$Outbound; }; /** @internal */ export const AccountingBillsUpdateRequest$outboundSchema: z.ZodType< AccountingBillsUpdateRequest$Outbound, z.ZodTypeDef, AccountingBillsUpdateRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), bill: components.BillInput$outboundSchema, }).transform((v) => { return remap$(v, { bill: "Bill", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountingBillsUpdateRequest$ { /** @deprecated use `AccountingBillsUpdateRequest$inboundSchema` instead. */ export const inboundSchema = AccountingBillsUpdateRequest$inboundSchema; /** @deprecated use `AccountingBillsUpdateRequest$outboundSchema` instead. */ export const outboundSchema = AccountingBillsUpdateRequest$outboundSchema; /** @deprecated use `AccountingBillsUpdateRequest$Outbound` instead. */ export type Outbound = AccountingBillsUpdateRequest$Outbound; } export function accountingBillsUpdateRequestToJSON( accountingBillsUpdateRequest: AccountingBillsUpdateRequest, ): string { return JSON.stringify( AccountingBillsUpdateRequest$outboundSchema.parse( accountingBillsUpdateRequest, ), ); } export function accountingBillsUpdateRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingBillsUpdateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingBillsUpdateRequest' from JSON`, ); } /** @internal */ export const AccountingBillsUpdateResponse$inboundSchema: z.ZodType< AccountingBillsUpdateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, UpdateBillResponse: components.UpdateBillResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "UpdateBillResponse": "updateBillResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingBillsUpdateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; UpdateBillResponse?: components.UpdateBillResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingBillsUpdateResponse$outboundSchema: z.ZodType< AccountingBillsUpdateResponse$Outbound, z.ZodTypeDef, AccountingBillsUpdateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, updateBillResponse: components.UpdateBillResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", updateBillResponse: "UpdateBillResponse", 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 AccountingBillsUpdateResponse$ { /** @deprecated use `AccountingBillsUpdateResponse$inboundSchema` instead. */ export const inboundSchema = AccountingBillsUpdateResponse$inboundSchema; /** @deprecated use `AccountingBillsUpdateResponse$outboundSchema` instead. */ export const outboundSchema = AccountingBillsUpdateResponse$outboundSchema; /** @deprecated use `AccountingBillsUpdateResponse$Outbound` instead. */ export type Outbound = AccountingBillsUpdateResponse$Outbound; } export function accountingBillsUpdateResponseToJSON( accountingBillsUpdateResponse: AccountingBillsUpdateResponse, ): string { return JSON.stringify( AccountingBillsUpdateResponse$outboundSchema.parse( accountingBillsUpdateResponse, ), ); } export function accountingBillsUpdateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingBillsUpdateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingBillsUpdateResponse' from JSON`, ); }