/* * 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 { ClosedEnum } from "../../types/enums.js"; /** * The breakdown of the report. Use 'default' for no split. */ export const Aggregation = { Default: "default", Job: "job", Department: "department", Integration: "integration", } as const; /** * The breakdown of the report. Use 'default' for no split. */ export type Aggregation = ClosedEnum; export const IntegrationType = { Xero: "xero", Qbo: "qbo", } as const; export type IntegrationType = ClosedEnum; /** * Request body for generating a general ledger report. The report can be aggregated by different dimensions such as job or department. */ export type GeneralLedgerReportBody = { /** * The breakdown of the report. Use 'default' for no split. */ aggregation: Aggregation; /** * The kind of integration set up for the company. Required when `aggregation` is 'integration'. Must be null if `aggregation` is not 'integration'. */ integrationType?: IntegrationType | null | undefined; }; /** @internal */ export const Aggregation$outboundSchema: z.ZodNativeEnum = z .nativeEnum(Aggregation); /** @internal */ export const IntegrationType$outboundSchema: z.ZodNativeEnum< typeof IntegrationType > = z.nativeEnum(IntegrationType); /** @internal */ export type GeneralLedgerReportBody$Outbound = { aggregation: string; integration_type?: string | null | undefined; }; /** @internal */ export const GeneralLedgerReportBody$outboundSchema: z.ZodType< GeneralLedgerReportBody$Outbound, z.ZodTypeDef, GeneralLedgerReportBody > = z.object({ aggregation: Aggregation$outboundSchema, integrationType: z.nullable(IntegrationType$outboundSchema).optional(), }).transform((v) => { return remap$(v, { integrationType: "integration_type", }); }); export function generalLedgerReportBodyToJSON( generalLedgerReportBody: GeneralLedgerReportBody, ): string { return JSON.stringify( GeneralLedgerReportBody$outboundSchema.parse(generalLedgerReportBody), ); }