/* * 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 { AccountsReceivablesReportSpec, AccountsReceivablesReportSpec$Outbound, AccountsReceivablesReportSpec$outboundSchema, } from "./accountsreceivablesreportspec.js"; import { AIInsightsReportSpec, AIInsightsReportSpec$Outbound, AIInsightsReportSpec$outboundSchema, } from "./aiinsightsreportspec.js"; import { DetailedSettlementReportSpec, DetailedSettlementReportSpec$Outbound, DetailedSettlementReportSpec$outboundSchema, } from "./detailedsettlementreportspec.js"; import { ReportSchedule, ReportSchedule$outboundSchema, } from "./reportschedule.js"; import { TransactionRetriesReportSpec, TransactionRetriesReportSpec$Outbound, TransactionRetriesReportSpec$outboundSchema, } from "./transactionretriesreportspec.js"; import { TransactionsReportSpec, TransactionsReportSpec$Outbound, TransactionsReportSpec$outboundSchema, } from "./transactionsreportspec.js"; /** * The report specification. */ export type Spec = | AccountsReceivablesReportSpec | AIInsightsReportSpec | DetailedSettlementReportSpec | TransactionRetriesReportSpec | TransactionsReportSpec; export type ReportCreate = { /** * The name of the report. */ name: string; /** * A description of the report. */ description?: string | null | undefined; schedule: ReportSchedule; /** * Whether the report schedule is enabled. */ scheduleEnabled: boolean; /** * The timezone for the report schedule. */ scheduleTimezone?: string | undefined; /** * The report specification. */ spec: | AccountsReceivablesReportSpec | AIInsightsReportSpec | DetailedSettlementReportSpec | TransactionRetriesReportSpec | TransactionsReportSpec; }; /** @internal */ export type Spec$Outbound = | AccountsReceivablesReportSpec$Outbound | AIInsightsReportSpec$Outbound | DetailedSettlementReportSpec$Outbound | TransactionRetriesReportSpec$Outbound | TransactionsReportSpec$Outbound; /** @internal */ export const Spec$outboundSchema: z.ZodType = z.union([ AccountsReceivablesReportSpec$outboundSchema, AIInsightsReportSpec$outboundSchema, DetailedSettlementReportSpec$outboundSchema, TransactionRetriesReportSpec$outboundSchema, TransactionsReportSpec$outboundSchema, ]); export function specToJSON(spec: Spec): string { return JSON.stringify(Spec$outboundSchema.parse(spec)); } /** @internal */ export type ReportCreate$Outbound = { name: string; description?: string | null | undefined; schedule: string; schedule_enabled: boolean; schedule_timezone: string; spec: | AccountsReceivablesReportSpec$Outbound | AIInsightsReportSpec$Outbound | DetailedSettlementReportSpec$Outbound | TransactionRetriesReportSpec$Outbound | TransactionsReportSpec$Outbound; }; /** @internal */ export const ReportCreate$outboundSchema: z.ZodType< ReportCreate$Outbound, z.ZodTypeDef, ReportCreate > = z.object({ name: z.string(), description: z.nullable(z.string()).optional(), schedule: ReportSchedule$outboundSchema, scheduleEnabled: z.boolean(), scheduleTimezone: z.string().default("Etc/UTC"), spec: z.union([ AccountsReceivablesReportSpec$outboundSchema, AIInsightsReportSpec$outboundSchema, DetailedSettlementReportSpec$outboundSchema, TransactionRetriesReportSpec$outboundSchema, TransactionsReportSpec$outboundSchema, ]), }).transform((v) => { return remap$(v, { scheduleEnabled: "schedule_enabled", scheduleTimezone: "schedule_timezone", }); }); export function reportCreateToJSON(reportCreate: ReportCreate): string { return JSON.stringify(ReportCreate$outboundSchema.parse(reportCreate)); }