/* * 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 type of period to include in the resource: month, quarter, year. */ export const PeriodType = { Month: "month", Quarter: "quarter", Year: "year", } as const; /** * The type of period to include in the resource: month, quarter, year. */ export type PeriodType = OpenEnum; /** * The accounting method used for the report: cash or accrual. */ export const BalanceSheetFilterAccountingMethod = { Cash: "cash", Accrual: "accrual", } as const; /** * The accounting method used for the report: cash or accrual. */ export type BalanceSheetFilterAccountingMethod = OpenEnum< typeof BalanceSheetFilterAccountingMethod >; export type BalanceSheetFilter = { /** * The start date of the period to include in the resource. * * @deprecated field: This field is deprecated and may be removed in a future version.. */ startDate?: string | undefined; /** * The end date of the period to include in the resource. */ endDate?: string | undefined; /** * The number of periods to include in the resource. */ periodCount?: number | undefined; /** * The type of period to include in the resource: month, quarter, year. */ periodType?: PeriodType | undefined; /** * The ID of the location to include in the resource. */ locationId?: string | undefined; /** * The accounting method used for the report: cash or accrual. */ accountingMethod?: BalanceSheetFilterAccountingMethod | undefined; }; /** @internal */ export const PeriodType$outboundSchema: z.ZodType< string, z.ZodTypeDef, PeriodType > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(PeriodType)); /** @internal */ export const BalanceSheetFilterAccountingMethod$outboundSchema: z.ZodType< string, z.ZodTypeDef, BalanceSheetFilterAccountingMethod > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(BalanceSheetFilterAccountingMethod) ); /** @internal */ export type BalanceSheetFilter$Outbound = { start_date?: string | undefined; end_date?: string | undefined; period_count?: number | undefined; period_type?: string | undefined; location_id?: string | undefined; accounting_method?: string | undefined; }; /** @internal */ export const BalanceSheetFilter$outboundSchema: z.ZodType< BalanceSheetFilter$Outbound, z.ZodTypeDef, BalanceSheetFilter > = /* @__PURE__ */ lazySchema$(() => z.object({ startDate: z.string().optional(), endDate: z.string().optional(), periodCount: z.number().int().optional(), periodType: PeriodType$outboundSchema.optional(), locationId: z.string().optional(), accountingMethod: BalanceSheetFilterAccountingMethod$outboundSchema .optional(), }).transform((v) => { return remap$(v, { startDate: "start_date", endDate: "end_date", periodCount: "period_count", periodType: "period_type", locationId: "location_id", accountingMethod: "accounting_method", }); }) ); export function balanceSheetFilterToJSON( balanceSheetFilter: BalanceSheetFilter, ): string { return JSON.stringify( BalanceSheetFilter$outboundSchema.parse(balanceSheetFilter), ); }