/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { RFCDate } from "../../types/rfcdate.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { BankAccount, BankAccount$inboundSchema, BankAccount$Outbound, BankAccount$outboundSchema, } from "./bankaccount.js"; import { Currency, Currency$inboundSchema, Currency$outboundSchema, } from "./currency.js"; import { CustomMappings, CustomMappings$inboundSchema, CustomMappings$Outbound, CustomMappings$outboundSchema, } from "./custommappings.js"; import { LinkedTaxRate, LinkedTaxRate$inboundSchema, LinkedTaxRate$Outbound, LinkedTaxRate$outboundSchema, } from "./linkedtaxrate.js"; import { LinkedTaxRateInput, LinkedTaxRateInput$inboundSchema, LinkedTaxRateInput$Outbound, LinkedTaxRateInput$outboundSchema, } from "./linkedtaxrateinput.js"; import { PassThroughBody, PassThroughBody$inboundSchema, PassThroughBody$Outbound, PassThroughBody$outboundSchema, } from "./passthroughbody.js"; /** * The classification of account. */ export const Classification = { Asset: "asset", Equity: "equity", Expense: "expense", Liability: "liability", Revenue: "revenue", Income: "income", OtherIncome: "other_income", OtherExpense: "other_expense", CostsOfSales: "costs_of_sales", Other: "other", } as const; /** * The classification of account. */ export type Classification = ClosedEnum; /** * The type of account. */ export const LedgerAccountType = { AccountsReceivable: "accounts_receivable", Revenue: "revenue", Sales: "sales", OtherIncome: "other_income", Bank: "bank", CurrentAsset: "current_asset", FixedAsset: "fixed_asset", NonCurrentAsset: "non_current_asset", OtherAsset: "other_asset", Balancesheet: "balancesheet", Equity: "equity", Expense: "expense", OtherExpense: "other_expense", CostsOfSales: "costs_of_sales", AccountsPayable: "accounts_payable", CreditCard: "credit_card", CurrentLiability: "current_liability", NonCurrentLiability: "non_current_liability", OtherLiability: "other_liability", Other: "other", } as const; /** * The type of account. */ export type LedgerAccountType = ClosedEnum; /** * The status of the account. */ export const AccountStatus = { Active: "active", Inactive: "inactive", Archived: "archived", } as const; /** * The status of the account. */ export type AccountStatus = ClosedEnum; export type Categories = { id?: string | undefined; /** * The name of the category. */ name?: string | undefined; }; export type ParentAccount = { /** * The ID of the parent account. */ id?: string | undefined; /** * The name of the parent account. */ name?: string | undefined; /** * The human readable display ID used when displaying the parent account */ displayId?: string | undefined; }; export type SubAccounts = { /** * The ID of the sub account. */ id?: string | undefined; /** * The name of the sub account. */ accountSubName?: string | undefined; }; export type Subsidiaries = { /** * The ID of the subsidiary. */ id?: string | undefined; }; export type LedgerAccount = { /** * A unique identifier for an object. */ id?: string | undefined; /** * The human readable display ID used when displaying the account */ displayId?: string | undefined; /** * The nominal code of the ledger account. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ nominalCode?: string | null | undefined; /** * The code assigned to the account. */ code?: string | null | undefined; /** * The classification of account. */ classification?: Classification | null | undefined; /** * The type of account. */ type?: LedgerAccountType | undefined; /** * The sub type of account. */ subType?: string | null | undefined; /** * The name of the account. */ name?: string | null | undefined; /** * The fully qualified name of the account. */ fullyQualifiedName?: string | null | undefined; /** * The description of the account. */ description?: string | null | undefined; /** * The opening balance of the account. */ openingBalance?: number | null | undefined; /** * The current balance of the account. */ currentBalance?: number | null | undefined; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ currency?: Currency | null | undefined; /** * The tax type of the account. */ taxType?: string | null | undefined; taxRate?: LinkedTaxRate | undefined; level?: number | null | undefined; /** * Whether the account is active or not. */ active?: boolean | null | undefined; /** * The status of the account. */ status?: AccountStatus | null | undefined; /** * Whether the account is a header or not. */ header?: boolean | null | undefined; bankAccount?: BankAccount | undefined; /** * The categories of the account. */ categories?: Array | undefined; parentAccount?: ParentAccount | undefined; /** * Whether the account is a sub account or not. */ subAccount?: boolean | null | undefined; /** * The sub accounts of the account. */ subAccounts?: Array | undefined; /** * Reconciliation Date means the last calendar day of each Reconciliation Period. */ lastReconciliationDate?: RFCDate | null | undefined; /** * The subsidiaries the account belongs to. */ subsidiaries?: Array | undefined; /** * When custom mappings are configured on the resource, the result is included here. */ customMappings?: CustomMappings | null | undefined; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ rowVersion?: string | null | undefined; /** * The user who last updated the object. */ updatedBy?: string | null | undefined; /** * The user who created the object. */ createdBy?: string | null | undefined; /** * The date and time when the object was last updated. */ updatedAt?: Date | null | undefined; /** * The date and time when the object was created. */ createdAt?: Date | null | undefined; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ passThrough?: Array | undefined; }; export type LedgerAccountInput = { /** * The human readable display ID used when displaying the account */ displayId?: string | undefined; /** * The nominal code of the ledger account. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ nominalCode?: string | null | undefined; /** * The code assigned to the account. */ code?: string | null | undefined; /** * The classification of account. */ classification?: Classification | null | undefined; /** * The type of account. */ type?: LedgerAccountType | undefined; /** * The sub type of account. */ subType?: string | null | undefined; /** * The name of the account. */ name?: string | null | undefined; /** * The fully qualified name of the account. */ fullyQualifiedName?: string | null | undefined; /** * The description of the account. */ description?: string | null | undefined; /** * The opening balance of the account. */ openingBalance?: number | null | undefined; /** * The current balance of the account. */ currentBalance?: number | null | undefined; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ currency?: Currency | null | undefined; /** * The tax type of the account. */ taxType?: string | null | undefined; taxRate?: LinkedTaxRateInput | undefined; level?: number | null | undefined; /** * Whether the account is active or not. */ active?: boolean | null | undefined; /** * The status of the account. */ status?: AccountStatus | null | undefined; /** * Whether the account is a header or not. */ header?: boolean | null | undefined; bankAccount?: BankAccount | undefined; parentAccount?: ParentAccount | undefined; /** * Whether the account is a sub account or not. */ subAccount?: boolean | null | undefined; /** * Reconciliation Date means the last calendar day of each Reconciliation Period. */ lastReconciliationDate?: RFCDate | null | undefined; /** * The subsidiaries the account belongs to. */ subsidiaries?: Array | undefined; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ rowVersion?: string | null | undefined; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ passThrough?: Array | undefined; }; /** @internal */ export const Classification$inboundSchema: z.ZodNativeEnum< typeof Classification > = z.nativeEnum(Classification); /** @internal */ export const Classification$outboundSchema: z.ZodNativeEnum< typeof Classification > = Classification$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Classification$ { /** @deprecated use `Classification$inboundSchema` instead. */ export const inboundSchema = Classification$inboundSchema; /** @deprecated use `Classification$outboundSchema` instead. */ export const outboundSchema = Classification$outboundSchema; } /** @internal */ export const LedgerAccountType$inboundSchema: z.ZodNativeEnum< typeof LedgerAccountType > = z.nativeEnum(LedgerAccountType); /** @internal */ export const LedgerAccountType$outboundSchema: z.ZodNativeEnum< typeof LedgerAccountType > = LedgerAccountType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LedgerAccountType$ { /** @deprecated use `LedgerAccountType$inboundSchema` instead. */ export const inboundSchema = LedgerAccountType$inboundSchema; /** @deprecated use `LedgerAccountType$outboundSchema` instead. */ export const outboundSchema = LedgerAccountType$outboundSchema; } /** @internal */ export const AccountStatus$inboundSchema: z.ZodNativeEnum< typeof AccountStatus > = z.nativeEnum(AccountStatus); /** @internal */ export const AccountStatus$outboundSchema: z.ZodNativeEnum< typeof AccountStatus > = AccountStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountStatus$ { /** @deprecated use `AccountStatus$inboundSchema` instead. */ export const inboundSchema = AccountStatus$inboundSchema; /** @deprecated use `AccountStatus$outboundSchema` instead. */ export const outboundSchema = AccountStatus$outboundSchema; } /** @internal */ export const Categories$inboundSchema: z.ZodType< Categories, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), name: z.string().optional(), }); /** @internal */ export type Categories$Outbound = { id?: string | undefined; name?: string | undefined; }; /** @internal */ export const Categories$outboundSchema: z.ZodType< Categories$Outbound, z.ZodTypeDef, Categories > = z.object({ id: z.string().optional(), name: 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 Categories$ { /** @deprecated use `Categories$inboundSchema` instead. */ export const inboundSchema = Categories$inboundSchema; /** @deprecated use `Categories$outboundSchema` instead. */ export const outboundSchema = Categories$outboundSchema; /** @deprecated use `Categories$Outbound` instead. */ export type Outbound = Categories$Outbound; } export function categoriesToJSON(categories: Categories): string { return JSON.stringify(Categories$outboundSchema.parse(categories)); } export function categoriesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Categories$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Categories' from JSON`, ); } /** @internal */ export const ParentAccount$inboundSchema: z.ZodType< ParentAccount, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), name: z.string().optional(), display_id: z.string().optional(), }).transform((v) => { return remap$(v, { "display_id": "displayId", }); }); /** @internal */ export type ParentAccount$Outbound = { id?: string | undefined; name?: string | undefined; display_id?: string | undefined; }; /** @internal */ export const ParentAccount$outboundSchema: z.ZodType< ParentAccount$Outbound, z.ZodTypeDef, ParentAccount > = z.object({ id: z.string().optional(), name: z.string().optional(), displayId: z.string().optional(), }).transform((v) => { return remap$(v, { displayId: "display_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ParentAccount$ { /** @deprecated use `ParentAccount$inboundSchema` instead. */ export const inboundSchema = ParentAccount$inboundSchema; /** @deprecated use `ParentAccount$outboundSchema` instead. */ export const outboundSchema = ParentAccount$outboundSchema; /** @deprecated use `ParentAccount$Outbound` instead. */ export type Outbound = ParentAccount$Outbound; } export function parentAccountToJSON(parentAccount: ParentAccount): string { return JSON.stringify(ParentAccount$outboundSchema.parse(parentAccount)); } export function parentAccountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ParentAccount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ParentAccount' from JSON`, ); } /** @internal */ export const SubAccounts$inboundSchema: z.ZodType< SubAccounts, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), account_sub_name: z.string().optional(), }).transform((v) => { return remap$(v, { "account_sub_name": "accountSubName", }); }); /** @internal */ export type SubAccounts$Outbound = { id?: string | undefined; account_sub_name?: string | undefined; }; /** @internal */ export const SubAccounts$outboundSchema: z.ZodType< SubAccounts$Outbound, z.ZodTypeDef, SubAccounts > = z.object({ id: z.string().optional(), accountSubName: z.string().optional(), }).transform((v) => { return remap$(v, { accountSubName: "account_sub_name", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SubAccounts$ { /** @deprecated use `SubAccounts$inboundSchema` instead. */ export const inboundSchema = SubAccounts$inboundSchema; /** @deprecated use `SubAccounts$outboundSchema` instead. */ export const outboundSchema = SubAccounts$outboundSchema; /** @deprecated use `SubAccounts$Outbound` instead. */ export type Outbound = SubAccounts$Outbound; } export function subAccountsToJSON(subAccounts: SubAccounts): string { return JSON.stringify(SubAccounts$outboundSchema.parse(subAccounts)); } export function subAccountsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SubAccounts$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubAccounts' from JSON`, ); } /** @internal */ export const Subsidiaries$inboundSchema: z.ZodType< Subsidiaries, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), }); /** @internal */ export type Subsidiaries$Outbound = { id?: string | undefined; }; /** @internal */ export const Subsidiaries$outboundSchema: z.ZodType< Subsidiaries$Outbound, z.ZodTypeDef, Subsidiaries > = z.object({ id: 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 Subsidiaries$ { /** @deprecated use `Subsidiaries$inboundSchema` instead. */ export const inboundSchema = Subsidiaries$inboundSchema; /** @deprecated use `Subsidiaries$outboundSchema` instead. */ export const outboundSchema = Subsidiaries$outboundSchema; /** @deprecated use `Subsidiaries$Outbound` instead. */ export type Outbound = Subsidiaries$Outbound; } export function subsidiariesToJSON(subsidiaries: Subsidiaries): string { return JSON.stringify(Subsidiaries$outboundSchema.parse(subsidiaries)); } export function subsidiariesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Subsidiaries$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Subsidiaries' from JSON`, ); } /** @internal */ export const LedgerAccount$inboundSchema: z.ZodType< LedgerAccount, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), display_id: z.string().optional(), nominal_code: z.nullable(z.string()).optional(), code: z.nullable(z.string()).optional(), classification: z.nullable(Classification$inboundSchema).optional(), type: LedgerAccountType$inboundSchema.optional(), sub_type: z.nullable(z.string()).optional(), name: z.nullable(z.string()).optional(), fully_qualified_name: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), opening_balance: z.nullable(z.number()).optional(), current_balance: z.nullable(z.number()).optional(), currency: z.nullable(Currency$inboundSchema).optional(), tax_type: z.nullable(z.string()).optional(), tax_rate: LinkedTaxRate$inboundSchema.optional(), level: z.nullable(z.number()).optional(), active: z.nullable(z.boolean()).optional(), status: z.nullable(AccountStatus$inboundSchema).optional(), header: z.nullable(z.boolean()).optional(), bank_account: BankAccount$inboundSchema.optional(), categories: z.array(z.lazy(() => Categories$inboundSchema)).optional(), parent_account: z.lazy(() => ParentAccount$inboundSchema).optional(), sub_account: z.nullable(z.boolean()).optional(), sub_accounts: z.array(z.lazy(() => SubAccounts$inboundSchema)).optional(), last_reconciliation_date: z.nullable( z.string().transform(v => new RFCDate(v)), ).optional(), subsidiaries: z.array(z.lazy(() => Subsidiaries$inboundSchema)).optional(), custom_mappings: z.nullable(CustomMappings$inboundSchema).optional(), row_version: z.nullable(z.string()).optional(), updated_by: z.nullable(z.string()).optional(), created_by: z.nullable(z.string()).optional(), updated_at: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), created_at: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), pass_through: z.array(PassThroughBody$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "display_id": "displayId", "nominal_code": "nominalCode", "sub_type": "subType", "fully_qualified_name": "fullyQualifiedName", "opening_balance": "openingBalance", "current_balance": "currentBalance", "tax_type": "taxType", "tax_rate": "taxRate", "bank_account": "bankAccount", "parent_account": "parentAccount", "sub_account": "subAccount", "sub_accounts": "subAccounts", "last_reconciliation_date": "lastReconciliationDate", "custom_mappings": "customMappings", "row_version": "rowVersion", "updated_by": "updatedBy", "created_by": "createdBy", "updated_at": "updatedAt", "created_at": "createdAt", "pass_through": "passThrough", }); }); /** @internal */ export type LedgerAccount$Outbound = { id?: string | undefined; display_id?: string | undefined; nominal_code?: string | null | undefined; code?: string | null | undefined; classification?: string | null | undefined; type?: string | undefined; sub_type?: string | null | undefined; name?: string | null | undefined; fully_qualified_name?: string | null | undefined; description?: string | null | undefined; opening_balance?: number | null | undefined; current_balance?: number | null | undefined; currency?: string | null | undefined; tax_type?: string | null | undefined; tax_rate?: LinkedTaxRate$Outbound | undefined; level?: number | null | undefined; active?: boolean | null | undefined; status?: string | null | undefined; header?: boolean | null | undefined; bank_account?: BankAccount$Outbound | undefined; categories?: Array | undefined; parent_account?: ParentAccount$Outbound | undefined; sub_account?: boolean | null | undefined; sub_accounts?: Array | undefined; last_reconciliation_date?: string | null | undefined; subsidiaries?: Array | undefined; custom_mappings?: CustomMappings$Outbound | null | undefined; row_version?: string | null | undefined; updated_by?: string | null | undefined; created_by?: string | null | undefined; updated_at?: string | null | undefined; created_at?: string | null | undefined; pass_through?: Array | undefined; }; /** @internal */ export const LedgerAccount$outboundSchema: z.ZodType< LedgerAccount$Outbound, z.ZodTypeDef, LedgerAccount > = z.object({ id: z.string().optional(), displayId: z.string().optional(), nominalCode: z.nullable(z.string()).optional(), code: z.nullable(z.string()).optional(), classification: z.nullable(Classification$outboundSchema).optional(), type: LedgerAccountType$outboundSchema.optional(), subType: z.nullable(z.string()).optional(), name: z.nullable(z.string()).optional(), fullyQualifiedName: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), openingBalance: z.nullable(z.number()).optional(), currentBalance: z.nullable(z.number()).optional(), currency: z.nullable(Currency$outboundSchema).optional(), taxType: z.nullable(z.string()).optional(), taxRate: LinkedTaxRate$outboundSchema.optional(), level: z.nullable(z.number()).optional(), active: z.nullable(z.boolean()).optional(), status: z.nullable(AccountStatus$outboundSchema).optional(), header: z.nullable(z.boolean()).optional(), bankAccount: BankAccount$outboundSchema.optional(), categories: z.array(z.lazy(() => Categories$outboundSchema)).optional(), parentAccount: z.lazy(() => ParentAccount$outboundSchema).optional(), subAccount: z.nullable(z.boolean()).optional(), subAccounts: z.array(z.lazy(() => SubAccounts$outboundSchema)).optional(), lastReconciliationDate: z.nullable( z.instanceof(RFCDate).transform(v => v.toString()), ).optional(), subsidiaries: z.array(z.lazy(() => Subsidiaries$outboundSchema)).optional(), customMappings: z.nullable(CustomMappings$outboundSchema).optional(), rowVersion: z.nullable(z.string()).optional(), updatedBy: z.nullable(z.string()).optional(), createdBy: z.nullable(z.string()).optional(), updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), passThrough: z.array(PassThroughBody$outboundSchema).optional(), }).transform((v) => { return remap$(v, { displayId: "display_id", nominalCode: "nominal_code", subType: "sub_type", fullyQualifiedName: "fully_qualified_name", openingBalance: "opening_balance", currentBalance: "current_balance", taxType: "tax_type", taxRate: "tax_rate", bankAccount: "bank_account", parentAccount: "parent_account", subAccount: "sub_account", subAccounts: "sub_accounts", lastReconciliationDate: "last_reconciliation_date", customMappings: "custom_mappings", rowVersion: "row_version", updatedBy: "updated_by", createdBy: "created_by", updatedAt: "updated_at", createdAt: "created_at", passThrough: "pass_through", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LedgerAccount$ { /** @deprecated use `LedgerAccount$inboundSchema` instead. */ export const inboundSchema = LedgerAccount$inboundSchema; /** @deprecated use `LedgerAccount$outboundSchema` instead. */ export const outboundSchema = LedgerAccount$outboundSchema; /** @deprecated use `LedgerAccount$Outbound` instead. */ export type Outbound = LedgerAccount$Outbound; } export function ledgerAccountToJSON(ledgerAccount: LedgerAccount): string { return JSON.stringify(LedgerAccount$outboundSchema.parse(ledgerAccount)); } export function ledgerAccountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LedgerAccount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LedgerAccount' from JSON`, ); } /** @internal */ export const LedgerAccountInput$inboundSchema: z.ZodType< LedgerAccountInput, z.ZodTypeDef, unknown > = z.object({ display_id: z.string().optional(), nominal_code: z.nullable(z.string()).optional(), code: z.nullable(z.string()).optional(), classification: z.nullable(Classification$inboundSchema).optional(), type: LedgerAccountType$inboundSchema.optional(), sub_type: z.nullable(z.string()).optional(), name: z.nullable(z.string()).optional(), fully_qualified_name: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), opening_balance: z.nullable(z.number()).optional(), current_balance: z.nullable(z.number()).optional(), currency: z.nullable(Currency$inboundSchema).optional(), tax_type: z.nullable(z.string()).optional(), tax_rate: LinkedTaxRateInput$inboundSchema.optional(), level: z.nullable(z.number()).optional(), active: z.nullable(z.boolean()).optional(), status: z.nullable(AccountStatus$inboundSchema).optional(), header: z.nullable(z.boolean()).optional(), bank_account: BankAccount$inboundSchema.optional(), parent_account: z.lazy(() => ParentAccount$inboundSchema).optional(), sub_account: z.nullable(z.boolean()).optional(), last_reconciliation_date: z.nullable( z.string().transform(v => new RFCDate(v)), ).optional(), subsidiaries: z.array(z.lazy(() => Subsidiaries$inboundSchema)).optional(), row_version: z.nullable(z.string()).optional(), pass_through: z.array(PassThroughBody$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "display_id": "displayId", "nominal_code": "nominalCode", "sub_type": "subType", "fully_qualified_name": "fullyQualifiedName", "opening_balance": "openingBalance", "current_balance": "currentBalance", "tax_type": "taxType", "tax_rate": "taxRate", "bank_account": "bankAccount", "parent_account": "parentAccount", "sub_account": "subAccount", "last_reconciliation_date": "lastReconciliationDate", "row_version": "rowVersion", "pass_through": "passThrough", }); }); /** @internal */ export type LedgerAccountInput$Outbound = { display_id?: string | undefined; nominal_code?: string | null | undefined; code?: string | null | undefined; classification?: string | null | undefined; type?: string | undefined; sub_type?: string | null | undefined; name?: string | null | undefined; fully_qualified_name?: string | null | undefined; description?: string | null | undefined; opening_balance?: number | null | undefined; current_balance?: number | null | undefined; currency?: string | null | undefined; tax_type?: string | null | undefined; tax_rate?: LinkedTaxRateInput$Outbound | undefined; level?: number | null | undefined; active?: boolean | null | undefined; status?: string | null | undefined; header?: boolean | null | undefined; bank_account?: BankAccount$Outbound | undefined; parent_account?: ParentAccount$Outbound | undefined; sub_account?: boolean | null | undefined; last_reconciliation_date?: string | null | undefined; subsidiaries?: Array | undefined; row_version?: string | null | undefined; pass_through?: Array | undefined; }; /** @internal */ export const LedgerAccountInput$outboundSchema: z.ZodType< LedgerAccountInput$Outbound, z.ZodTypeDef, LedgerAccountInput > = z.object({ displayId: z.string().optional(), nominalCode: z.nullable(z.string()).optional(), code: z.nullable(z.string()).optional(), classification: z.nullable(Classification$outboundSchema).optional(), type: LedgerAccountType$outboundSchema.optional(), subType: z.nullable(z.string()).optional(), name: z.nullable(z.string()).optional(), fullyQualifiedName: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), openingBalance: z.nullable(z.number()).optional(), currentBalance: z.nullable(z.number()).optional(), currency: z.nullable(Currency$outboundSchema).optional(), taxType: z.nullable(z.string()).optional(), taxRate: LinkedTaxRateInput$outboundSchema.optional(), level: z.nullable(z.number()).optional(), active: z.nullable(z.boolean()).optional(), status: z.nullable(AccountStatus$outboundSchema).optional(), header: z.nullable(z.boolean()).optional(), bankAccount: BankAccount$outboundSchema.optional(), parentAccount: z.lazy(() => ParentAccount$outboundSchema).optional(), subAccount: z.nullable(z.boolean()).optional(), lastReconciliationDate: z.nullable( z.instanceof(RFCDate).transform(v => v.toString()), ).optional(), subsidiaries: z.array(z.lazy(() => Subsidiaries$outboundSchema)).optional(), rowVersion: z.nullable(z.string()).optional(), passThrough: z.array(PassThroughBody$outboundSchema).optional(), }).transform((v) => { return remap$(v, { displayId: "display_id", nominalCode: "nominal_code", subType: "sub_type", fullyQualifiedName: "fully_qualified_name", openingBalance: "opening_balance", currentBalance: "current_balance", taxType: "tax_type", taxRate: "tax_rate", bankAccount: "bank_account", parentAccount: "parent_account", subAccount: "sub_account", lastReconciliationDate: "last_reconciliation_date", rowVersion: "row_version", passThrough: "pass_through", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LedgerAccountInput$ { /** @deprecated use `LedgerAccountInput$inboundSchema` instead. */ export const inboundSchema = LedgerAccountInput$inboundSchema; /** @deprecated use `LedgerAccountInput$outboundSchema` instead. */ export const outboundSchema = LedgerAccountInput$outboundSchema; /** @deprecated use `LedgerAccountInput$Outbound` instead. */ export type Outbound = LedgerAccountInput$Outbound; } export function ledgerAccountInputToJSON( ledgerAccountInput: LedgerAccountInput, ): string { return JSON.stringify( LedgerAccountInput$outboundSchema.parse(ledgerAccountInput), ); } export function ledgerAccountInputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LedgerAccountInput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LedgerAccountInput' from JSON`, ); }