/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: e5e623eee039 */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The status of the upload, an enum of ACTIVE, SUCCESSFUL */ export const BulkUploadHistoryEventStatus = { Active: "ACTIVE", Successful: "SUCCESSFUL", } as const; /** * The status of the upload, an enum of ACTIVE, SUCCESSFUL */ export type BulkUploadHistoryEventStatus = OpenEnum< typeof BulkUploadHistoryEventStatus >; /** * The current state of the upload, an enum of UNAVAILABLE, UPLOAD STARTED, UPLOAD IN PROGRESS, UPLOAD COMPLETED, DELETION PAUSED, INDEXING COMPLETED */ export const ProcessingState = { Unavailable: "UNAVAILABLE", UploadStarted: "UPLOAD STARTED", UploadInProgress: "UPLOAD IN PROGRESS", UploadCompleted: "UPLOAD COMPLETED", DeletionPaused: "DELETION PAUSED", IndexingCompleted: "INDEXING COMPLETED", } as const; /** * The current state of the upload, an enum of UNAVAILABLE, UPLOAD STARTED, UPLOAD IN PROGRESS, UPLOAD COMPLETED, DELETION PAUSED, INDEXING COMPLETED */ export type ProcessingState = OpenEnum; /** * Information about a successful bulk upload */ export type BulkUploadHistoryEvent = { /** * The unique ID of the upload */ uploadId?: string | undefined; /** * The start time of the upload in ISO 8601 format */ startTime?: string | undefined; /** * The end time of the upload in ISO 8601 format, 'NA' if the upload is still active */ endTime?: string | undefined; /** * The status of the upload, an enum of ACTIVE, SUCCESSFUL */ status?: BulkUploadHistoryEventStatus | undefined; /** * The current state of the upload, an enum of UNAVAILABLE, UPLOAD STARTED, UPLOAD IN PROGRESS, UPLOAD COMPLETED, DELETION PAUSED, INDEXING COMPLETED */ processingState?: ProcessingState | undefined; }; /** @internal */ export const BulkUploadHistoryEventStatus$inboundSchema: z.ZodType< BulkUploadHistoryEventStatus, z.ZodTypeDef, unknown > = openEnums.inboundSchema(BulkUploadHistoryEventStatus); /** @internal */ export const ProcessingState$inboundSchema: z.ZodType< ProcessingState, z.ZodTypeDef, unknown > = openEnums.inboundSchema(ProcessingState); /** @internal */ export const BulkUploadHistoryEvent$inboundSchema: z.ZodType< BulkUploadHistoryEvent, z.ZodTypeDef, unknown > = z.object({ uploadId: z.string().optional(), startTime: z.string().optional(), endTime: z.string().optional(), status: BulkUploadHistoryEventStatus$inboundSchema.optional(), processingState: ProcessingState$inboundSchema.optional(), }); export function bulkUploadHistoryEventFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BulkUploadHistoryEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BulkUploadHistoryEvent' from JSON`, ); }