/* * 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"; /** * Filter by account classification. */ 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; /** * Filter by account classification. */ export type Classification = OpenEnum; /** * Filter by account status. Supported only on a subset of connectors (e.g. NetSuite); connectors that do not support it reject `filter[status]` with a `400 UnsupportedFiltersError` — read the account's `status` field in the response and filter client-side instead. See the error's `supported_filters` or the connector's supported filters. */ export const LedgerAccountsFilterStatus = { Active: "active", Inactive: "inactive", } as const; /** * Filter by account status. Supported only on a subset of connectors (e.g. NetSuite); connectors that do not support it reject `filter[status]` with a `400 UnsupportedFiltersError` — read the account's `status` field in the response and filter client-side instead. See the error's `supported_filters` or the connector's supported filters. */ export type LedgerAccountsFilterStatus = OpenEnum< typeof LedgerAccountsFilterStatus >; export type LedgerAccountsFilter = { /** * Filter by ledger account name */ name?: string | undefined; updatedSince?: Date | undefined; /** * Filter by account classification. */ classification?: Classification | undefined; /** * Filter by account status. Supported only on a subset of connectors (e.g. NetSuite); connectors that do not support it reject `filter[status]` with a `400 UnsupportedFiltersError` — read the account's `status` field in the response and filter client-side instead. See the error's `supported_filters` or the connector's supported filters. */ status?: LedgerAccountsFilterStatus | undefined; /** * Filter by the subsidiary (legal entity) the record belongs to. Only honored on connectors that support multi-entity scoping (e.g. NetSuite OneWorld); ignored elsewhere. */ subsidiaryId?: string | undefined; }; /** @internal */ export const Classification$outboundSchema: z.ZodType< string, z.ZodTypeDef, Classification > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(Classification)); /** @internal */ export const LedgerAccountsFilterStatus$outboundSchema: z.ZodType< string, z.ZodTypeDef, LedgerAccountsFilterStatus > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(LedgerAccountsFilterStatus) ); /** @internal */ export type LedgerAccountsFilter$Outbound = { name?: string | undefined; updated_since?: string | undefined; classification?: string | undefined; status?: string | undefined; subsidiary_id?: string | undefined; }; /** @internal */ export const LedgerAccountsFilter$outboundSchema: z.ZodType< LedgerAccountsFilter$Outbound, z.ZodTypeDef, LedgerAccountsFilter > = /* @__PURE__ */ lazySchema$(() => z.object({ name: z.string().optional(), updatedSince: z.date().transform(v => v.toISOString()).optional(), classification: Classification$outboundSchema.optional(), status: LedgerAccountsFilterStatus$outboundSchema.optional(), subsidiaryId: z.string().optional(), }).transform((v) => { return remap$(v, { updatedSince: "updated_since", subsidiaryId: "subsidiary_id", }); }) ); export function ledgerAccountsFilterToJSON( ledgerAccountsFilter: LedgerAccountsFilter, ): string { return JSON.stringify( LedgerAccountsFilter$outboundSchema.parse(ledgerAccountsFilter), ); }