/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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 batch's processing state. * * @remarks * - `pending`: accepted, not yet started * - `processing`: reports are being generated * - `completed`: all reports finished * - `failed`: the batch failed before completing */ export const Status = { Pending: "pending", Processing: "processing", Completed: "completed", Failed: "failed", } as const; /** * The batch's processing state. * * @remarks * - `pending`: accepted, not yet started * - `processing`: reports are being generated * - `completed`: all reports finished * - `failed`: the batch failed before completing */ export type Status = ClosedEnum; export type CreateBulkReport = { /** * Unique identifier of the bulk report batch. */ uuid: string; /** * The batch's processing state. * * @remarks * - `pending`: accepted, not yet started * - `processing`: reports are being generated * - `completed`: all reports finished * - `failed`: the batch failed before completing */ status: Status; }; /** @internal */ export const Status$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Status); /** @internal */ export const CreateBulkReport$inboundSchema: z.ZodType< CreateBulkReport, z.ZodTypeDef, unknown > = z.object({ uuid: z.string(), status: Status$inboundSchema, }); export function createBulkReportFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateBulkReport$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateBulkReport' from JSON`, ); }