/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CreateVectorStoreRequest = { /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; createVectorStoreRequest: components.CreateVectorStoreRequest; }; /** @internal */ export const CreateVectorStoreRequest$inboundSchema: z.ZodType< CreateVectorStoreRequest, z.ZodTypeDef, unknown > = z.object({ "X-On-Behalf-Of": z.string().optional(), CreateVectorStoreRequest: components.CreateVectorStoreRequest$inboundSchema, }).transform((v) => { return remap$(v, { "X-On-Behalf-Of": "xOnBehalfOf", "CreateVectorStoreRequest": "createVectorStoreRequest", }); }); /** @internal */ export type CreateVectorStoreRequest$Outbound = { "X-On-Behalf-Of"?: string | undefined; CreateVectorStoreRequest: components.CreateVectorStoreRequest$Outbound; }; /** @internal */ export const CreateVectorStoreRequest$outboundSchema: z.ZodType< CreateVectorStoreRequest$Outbound, z.ZodTypeDef, CreateVectorStoreRequest > = z.object({ xOnBehalfOf: z.string().optional(), createVectorStoreRequest: components.CreateVectorStoreRequest$outboundSchema, }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", createVectorStoreRequest: "CreateVectorStoreRequest", }); }); export function createVectorStoreRequestToJSON( createVectorStoreRequest: CreateVectorStoreRequest, ): string { return JSON.stringify( CreateVectorStoreRequest$outboundSchema.parse(createVectorStoreRequest), ); } export function createVectorStoreRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateVectorStoreRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateVectorStoreRequest' from JSON`, ); }