/* * 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 AccountingLedgerAccountsUpdateGlobals = { /** * 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 AccountingLedgerAccountsUpdateRequest = { /** * 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; ledgerAccount: components.LedgerAccountInput; }; export type AccountingLedgerAccountsUpdateResponse = { httpMeta: components.HTTPMetadata; /** * LedgerAccount updated */ updateLedgerAccountResponse?: | components.UpdateLedgerAccountResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingLedgerAccountsUpdateGlobals$inboundSchema: z.ZodType< AccountingLedgerAccountsUpdateGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingLedgerAccountsUpdateGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingLedgerAccountsUpdateGlobals$outboundSchema: z.ZodType< AccountingLedgerAccountsUpdateGlobals$Outbound, z.ZodTypeDef, AccountingLedgerAccountsUpdateGlobals > = 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 AccountingLedgerAccountsUpdateGlobals$ { /** @deprecated use `AccountingLedgerAccountsUpdateGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingLedgerAccountsUpdateGlobals$inboundSchema; /** @deprecated use `AccountingLedgerAccountsUpdateGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingLedgerAccountsUpdateGlobals$outboundSchema; /** @deprecated use `AccountingLedgerAccountsUpdateGlobals$Outbound` instead. */ export type Outbound = AccountingLedgerAccountsUpdateGlobals$Outbound; } export function accountingLedgerAccountsUpdateGlobalsToJSON( accountingLedgerAccountsUpdateGlobals: AccountingLedgerAccountsUpdateGlobals, ): string { return JSON.stringify( AccountingLedgerAccountsUpdateGlobals$outboundSchema.parse( accountingLedgerAccountsUpdateGlobals, ), ); } export function accountingLedgerAccountsUpdateGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingLedgerAccountsUpdateGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingLedgerAccountsUpdateGlobals' from JSON`, ); } /** @internal */ export const AccountingLedgerAccountsUpdateRequest$inboundSchema: z.ZodType< AccountingLedgerAccountsUpdateRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), LedgerAccount: components.LedgerAccountInput$inboundSchema, }).transform((v) => { return remap$(v, { "LedgerAccount": "ledgerAccount", }); }); /** @internal */ export type AccountingLedgerAccountsUpdateRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; LedgerAccount: components.LedgerAccountInput$Outbound; }; /** @internal */ export const AccountingLedgerAccountsUpdateRequest$outboundSchema: z.ZodType< AccountingLedgerAccountsUpdateRequest$Outbound, z.ZodTypeDef, AccountingLedgerAccountsUpdateRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), ledgerAccount: components.LedgerAccountInput$outboundSchema, }).transform((v) => { return remap$(v, { ledgerAccount: "LedgerAccount", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountingLedgerAccountsUpdateRequest$ { /** @deprecated use `AccountingLedgerAccountsUpdateRequest$inboundSchema` instead. */ export const inboundSchema = AccountingLedgerAccountsUpdateRequest$inboundSchema; /** @deprecated use `AccountingLedgerAccountsUpdateRequest$outboundSchema` instead. */ export const outboundSchema = AccountingLedgerAccountsUpdateRequest$outboundSchema; /** @deprecated use `AccountingLedgerAccountsUpdateRequest$Outbound` instead. */ export type Outbound = AccountingLedgerAccountsUpdateRequest$Outbound; } export function accountingLedgerAccountsUpdateRequestToJSON( accountingLedgerAccountsUpdateRequest: AccountingLedgerAccountsUpdateRequest, ): string { return JSON.stringify( AccountingLedgerAccountsUpdateRequest$outboundSchema.parse( accountingLedgerAccountsUpdateRequest, ), ); } export function accountingLedgerAccountsUpdateRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingLedgerAccountsUpdateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingLedgerAccountsUpdateRequest' from JSON`, ); } /** @internal */ export const AccountingLedgerAccountsUpdateResponse$inboundSchema: z.ZodType< AccountingLedgerAccountsUpdateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, UpdateLedgerAccountResponse: components .UpdateLedgerAccountResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "UpdateLedgerAccountResponse": "updateLedgerAccountResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingLedgerAccountsUpdateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; UpdateLedgerAccountResponse?: | components.UpdateLedgerAccountResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingLedgerAccountsUpdateResponse$outboundSchema: z.ZodType< AccountingLedgerAccountsUpdateResponse$Outbound, z.ZodTypeDef, AccountingLedgerAccountsUpdateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, updateLedgerAccountResponse: components .UpdateLedgerAccountResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", updateLedgerAccountResponse: "UpdateLedgerAccountResponse", 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 AccountingLedgerAccountsUpdateResponse$ { /** @deprecated use `AccountingLedgerAccountsUpdateResponse$inboundSchema` instead. */ export const inboundSchema = AccountingLedgerAccountsUpdateResponse$inboundSchema; /** @deprecated use `AccountingLedgerAccountsUpdateResponse$outboundSchema` instead. */ export const outboundSchema = AccountingLedgerAccountsUpdateResponse$outboundSchema; /** @deprecated use `AccountingLedgerAccountsUpdateResponse$Outbound` instead. */ export type Outbound = AccountingLedgerAccountsUpdateResponse$Outbound; } export function accountingLedgerAccountsUpdateResponseToJSON( accountingLedgerAccountsUpdateResponse: AccountingLedgerAccountsUpdateResponse, ): string { return JSON.stringify( AccountingLedgerAccountsUpdateResponse$outboundSchema.parse( accountingLedgerAccountsUpdateResponse, ), ); } export function accountingLedgerAccountsUpdateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingLedgerAccountsUpdateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingLedgerAccountsUpdateResponse' from JSON`, ); }