/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { lazySchema as lazySchema$ } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; /** * The accounting method used for the report: cash or accrual. */ export const TrialBalanceFilterAccountingMethod = { Cash: "cash", Accrual: "accrual", } as const; /** * The accounting method used for the report: cash or accrual. */ export type TrialBalanceFilterAccountingMethod = OpenEnum< typeof TrialBalanceFilterAccountingMethod >; export type TrialBalanceFilter = { /** * The date the balances are reported as of (YYYY-MM-DD). Defaults to today (UTC). Connectors that only report per period round it up to the end of its period; the response `end_date` is the date used. */ endDate?: string | undefined; /** * The accounting method used for the report: cash or accrual. */ accountingMethod?: TrialBalanceFilterAccountingMethod | undefined; }; /** @internal */ export const TrialBalanceFilterAccountingMethod$outboundSchema: z.ZodType< string, z.ZodTypeDef, TrialBalanceFilterAccountingMethod > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(TrialBalanceFilterAccountingMethod) ); /** @internal */ export type TrialBalanceFilter$Outbound = { end_date?: string | undefined; accounting_method?: string | undefined; }; /** @internal */ export const TrialBalanceFilter$outboundSchema: z.ZodType< TrialBalanceFilter$Outbound, z.ZodTypeDef, TrialBalanceFilter > = /* @__PURE__ */ lazySchema$(() => z.object({ endDate: z.string().optional(), accountingMethod: TrialBalanceFilterAccountingMethod$outboundSchema .optional(), }).transform((v) => { return remap$(v, { endDate: "end_date", accountingMethod: "accounting_method", }); }) ); export function trialBalanceFilterToJSON( trialBalanceFilter: TrialBalanceFilter, ): string { return JSON.stringify( TrialBalanceFilter$outboundSchema.parse(trialBalanceFilter), ); }