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