/* * 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 { VectorStore, VectorStore$inboundSchema, VectorStore$Outbound, VectorStore$outboundSchema, } from "./vectorstore.js"; /** * A list of vector stores. */ export type VectorStoreList = { /** * The object type, which is always 'list'. */ object: "list"; /** * Array of vector store 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 VectorStoreList$inboundSchema: z.ZodType< VectorStoreList, z.ZodTypeDef, unknown > = z.object({ object: z.literal("list"), data: z.array(VectorStore$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 VectorStoreList$Outbound = { object: "list"; data: Array; first_id: string; last_id: string; has_more: boolean; }; /** @internal */ export const VectorStoreList$outboundSchema: z.ZodType< VectorStoreList$Outbound, z.ZodTypeDef, VectorStoreList > = z.object({ object: z.literal("list"), data: z.array(VectorStore$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 vectorStoreListToJSON( vectorStoreList: VectorStoreList, ): string { return JSON.stringify(VectorStoreList$outboundSchema.parse(vectorStoreList)); } export function vectorStoreListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VectorStoreList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VectorStoreList' from JSON`, ); }