/* * 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 ListVectorStoresQueryParamOrder = { 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 ListVectorStoresQueryParamOrder = ClosedEnum< typeof ListVectorStoresQueryParamOrder >; export type ListVectorStoresRequest = { limit?: number | undefined; /** * Sort order by the created_at timestamp of the objects. 'asc' for ascending order and 'desc' for descending order. */ order?: ListVectorStoresQueryParamOrder | undefined; after?: string | undefined; before?: string | undefined; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; /** @internal */ export const ListVectorStoresQueryParamOrder$inboundSchema: z.ZodNativeEnum< typeof ListVectorStoresQueryParamOrder > = z.nativeEnum(ListVectorStoresQueryParamOrder); /** @internal */ export const ListVectorStoresQueryParamOrder$outboundSchema: z.ZodNativeEnum< typeof ListVectorStoresQueryParamOrder > = ListVectorStoresQueryParamOrder$inboundSchema; /** @internal */ export const ListVectorStoresRequest$inboundSchema: z.ZodType< ListVectorStoresRequest, z.ZodTypeDef, unknown > = z.object({ limit: z.number().int().default(20), order: ListVectorStoresQueryParamOrder$inboundSchema.default("desc"), after: z.string().optional(), before: z.string().optional(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type ListVectorStoresRequest$Outbound = { limit: number; order: string; after?: string | undefined; before?: string | undefined; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const ListVectorStoresRequest$outboundSchema: z.ZodType< ListVectorStoresRequest$Outbound, z.ZodTypeDef, ListVectorStoresRequest > = z.object({ limit: z.number().int().default(20), order: ListVectorStoresQueryParamOrder$outboundSchema.default("desc"), after: z.string().optional(), before: z.string().optional(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", }); }); export function listVectorStoresRequestToJSON( listVectorStoresRequest: ListVectorStoresRequest, ): string { return JSON.stringify( ListVectorStoresRequest$outboundSchema.parse(listVectorStoresRequest), ); } export function listVectorStoresRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListVectorStoresRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListVectorStoresRequest' from JSON`, ); }