/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ReportExecutionContext, ReportExecutionContext$inboundSchema, } from "./reportexecutioncontext.js"; import { ReportExecutionStatus, ReportExecutionStatus$inboundSchema, } from "./reportexecutionstatus.js"; import { ReportSummary, ReportSummary$inboundSchema } from "./reportsummary.js"; export type ReportExecution = { /** * Always `report-execution`. */ type: "report-execution"; /** * The unique ID for the report execution. */ id: string; /** * The date this report execution was created at. */ createdAt: Date; /** * The date this report execution was last updated. */ updatedAt: Date; status: ReportExecutionStatus; context: ReportExecutionContext; report: ReportSummary; }; /** @internal */ export const ReportExecution$inboundSchema: z.ZodType< ReportExecution, z.ZodTypeDef, unknown > = z.object({ type: z.literal("report-execution").default("report-execution"), id: z.string(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), status: ReportExecutionStatus$inboundSchema, context: ReportExecutionContext$inboundSchema, report: ReportSummary$inboundSchema, }).transform((v) => { return remap$(v, { "created_at": "createdAt", "updated_at": "updatedAt", }); }); export function reportExecutionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ReportExecution$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ReportExecution' from JSON`, ); }