/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Sort order by the created_at timestamp of the objects. 'asc' for ascending order and 'desc' for descending order. */ export const ListVectorStoreFilesQueryParamOrder = { Asc: "asc", Desc: "desc", } as const; /** * Sort order by the created_at timestamp of the objects. 'asc' for ascending order and 'desc' for descending order. */ export type ListVectorStoreFilesQueryParamOrder = ClosedEnum< typeof ListVectorStoreFilesQueryParamOrder >; /** * Filter by file status. One of in_progress, completed, failed, cancelled. */ export const Filter = { InProgress: "in_progress", Completed: "completed", Failed: "failed", Cancelled: "cancelled", } as const; /** * Filter by file status. One of in_progress, completed, failed, cancelled. */ export type Filter = ClosedEnum; export type ListVectorStoreFilesRequest = { vectorStoreId: string; limit?: number | undefined; /** * Sort order by the created_at timestamp of the objects. 'asc' for ascending order and 'desc' for descending order. */ order?: ListVectorStoreFilesQueryParamOrder | undefined; after?: string | undefined; before?: string | undefined; /** * Filter by file status. One of in_progress, completed, failed, cancelled. */ filter?: Filter | undefined; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; /** @internal */ export const ListVectorStoreFilesQueryParamOrder$inboundSchema: z.ZodNativeEnum< typeof ListVectorStoreFilesQueryParamOrder > = z.nativeEnum(ListVectorStoreFilesQueryParamOrder); /** @internal */ export const ListVectorStoreFilesQueryParamOrder$outboundSchema: z.ZodNativeEnum = ListVectorStoreFilesQueryParamOrder$inboundSchema; /** @internal */ export const Filter$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Filter); /** @internal */ export const Filter$outboundSchema: z.ZodNativeEnum = Filter$inboundSchema; /** @internal */ export const ListVectorStoreFilesRequest$inboundSchema: z.ZodType< ListVectorStoreFilesRequest, z.ZodTypeDef, unknown > = z.object({ vector_store_id: z.string(), limit: z.number().int().default(20), order: ListVectorStoreFilesQueryParamOrder$inboundSchema.default("desc"), after: z.string().optional(), before: z.string().optional(), filter: Filter$inboundSchema.optional(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "vector_store_id": "vectorStoreId", "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type ListVectorStoreFilesRequest$Outbound = { vector_store_id: string; limit: number; order: string; after?: string | undefined; before?: string | undefined; filter?: string | undefined; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const ListVectorStoreFilesRequest$outboundSchema: z.ZodType< ListVectorStoreFilesRequest$Outbound, z.ZodTypeDef, ListVectorStoreFilesRequest > = z.object({ vectorStoreId: z.string(), limit: z.number().int().default(20), order: ListVectorStoreFilesQueryParamOrder$outboundSchema.default("desc"), after: z.string().optional(), before: z.string().optional(), filter: Filter$outboundSchema.optional(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { vectorStoreId: "vector_store_id", xOnBehalfOf: "X-On-Behalf-Of", }); }); export function listVectorStoreFilesRequestToJSON( listVectorStoreFilesRequest: ListVectorStoreFilesRequest, ): string { return JSON.stringify( ListVectorStoreFilesRequest$outboundSchema.parse( listVectorStoreFilesRequest, ), ); } export function listVectorStoreFilesRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListVectorStoreFilesRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListVectorStoreFilesRequest' from JSON`, ); }