/* * 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 { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The breakdown level used for the report. */ export const GeneralLedgerReportAggregation = { Default: "default", Job: "job", Department: "department", Integration: "integration", } as const; /** * The breakdown level used for the report. */ export type GeneralLedgerReportAggregation = ClosedEnum< typeof GeneralLedgerReportAggregation >; /** * A request for a general ledger report. The report is generated asynchronously and the URL is available via the report GET endpoint using the returned `request_uuid`. */ export type GeneralLedgerReport = { /** * The UUID of the payroll record for which the report was generated. */ payrollUuid?: string | undefined; /** * The breakdown level used for the report. */ aggregation?: GeneralLedgerReportAggregation | undefined; /** * The `integration_type` used for the report when `aggregation` is 'integration' (e.g., `xero`, `qbo`). Otherwise, this will be null or an empty string. */ integrationType?: string | null | undefined; /** * UUID to use for polling the report status. */ requestUuid?: string | undefined; }; /** @internal */ export const GeneralLedgerReportAggregation$inboundSchema: z.ZodNativeEnum< typeof GeneralLedgerReportAggregation > = z.nativeEnum(GeneralLedgerReportAggregation); /** @internal */ export const GeneralLedgerReport$inboundSchema: z.ZodType< GeneralLedgerReport, z.ZodTypeDef, unknown > = z.object({ payroll_uuid: z.string().optional(), aggregation: GeneralLedgerReportAggregation$inboundSchema.optional(), integration_type: z.nullable(z.string()).optional(), request_uuid: z.string().optional(), }).transform((v) => { return remap$(v, { "payroll_uuid": "payrollUuid", "integration_type": "integrationType", "request_uuid": "requestUuid", }); }); export function generalLedgerReportFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GeneralLedgerReport$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GeneralLedgerReport' from JSON`, ); }