/* * 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 { VectorStoreFile, VectorStoreFile$inboundSchema, VectorStoreFile$Outbound, VectorStoreFile$outboundSchema, } from "./vectorstorefile.js"; /** * A list of vector store files. */ export type VectorStoreFileList = { /** * The object type, which is always 'list'. */ object: "list"; /** * Array of vector store file objects. */ data: Array; /** * The ID of the first object in the list. */ firstId: string; /** * The ID of the last object in the list. */ lastId: string; /** * Whether there are more objects available. */ hasMore: boolean; }; /** @internal */ export const VectorStoreFileList$inboundSchema: z.ZodType< VectorStoreFileList, z.ZodTypeDef, unknown > = z.object({ object: z.literal("list"), data: z.array(VectorStoreFile$inboundSchema), first_id: z.string(), last_id: z.string(), has_more: z.boolean(), }).transform((v) => { return remap$(v, { "first_id": "firstId", "last_id": "lastId", "has_more": "hasMore", }); }); /** @internal */ export type VectorStoreFileList$Outbound = { object: "list"; data: Array; first_id: string; last_id: string; has_more: boolean; }; /** @internal */ export const VectorStoreFileList$outboundSchema: z.ZodType< VectorStoreFileList$Outbound, z.ZodTypeDef, VectorStoreFileList > = z.object({ object: z.literal("list"), data: z.array(VectorStoreFile$outboundSchema), firstId: z.string(), lastId: z.string(), hasMore: z.boolean(), }).transform((v) => { return remap$(v, { firstId: "first_id", lastId: "last_id", hasMore: "has_more", }); }); export function vectorStoreFileListToJSON( vectorStoreFileList: VectorStoreFileList, ): string { return JSON.stringify( VectorStoreFileList$outboundSchema.parse(vectorStoreFileList), ); } export function vectorStoreFileListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VectorStoreFileList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VectorStoreFileList' from JSON`, ); }