/* * 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"; /** * One of server_error, unsupported_file, or invalid_file. */ export const Code = { ServerError: "server_error", UnsupportedFile: "unsupported_file", InvalidFile: "invalid_file", } as const; /** * One of server_error, unsupported_file, or invalid_file. */ export type Code = ClosedEnum; /** * The last error associated with this vector store file. Will be null if there are no errors. */ export type VectorStoreFileError = { /** * One of server_error, unsupported_file, or invalid_file. */ code: Code; /** * A human-readable description of the error. */ message: string; }; /** @internal */ export const Code$inboundSchema: z.ZodNativeEnum = z.nativeEnum( Code, ); /** @internal */ export const Code$outboundSchema: z.ZodNativeEnum = Code$inboundSchema; /** @internal */ export const VectorStoreFileError$inboundSchema: z.ZodType< VectorStoreFileError, z.ZodTypeDef, unknown > = z.object({ code: Code$inboundSchema, message: z.string(), }); /** @internal */ export type VectorStoreFileError$Outbound = { code: string; message: string; }; /** @internal */ export const VectorStoreFileError$outboundSchema: z.ZodType< VectorStoreFileError$Outbound, z.ZodTypeDef, VectorStoreFileError > = z.object({ code: Code$outboundSchema, message: z.string(), }); export function vectorStoreFileErrorToJSON( vectorStoreFileError: VectorStoreFileError, ): string { return JSON.stringify( VectorStoreFileError$outboundSchema.parse(vectorStoreFileError), ); } export function vectorStoreFileErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VectorStoreFileError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VectorStoreFileError' from JSON`, ); }