/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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"; export type CreateIndexResponse = { /** * The ID of the created index */ indexId?: string | undefined; }; /** @internal */ export const CreateIndexResponse$inboundSchema: z.ZodType< CreateIndexResponse, z.ZodTypeDef, unknown > = z.object({ index_id: z.string().optional(), }).transform((v) => { return remap$(v, { "index_id": "indexId", }); }); /** @internal */ export type CreateIndexResponse$Outbound = { index_id?: string | undefined; }; /** @internal */ export const CreateIndexResponse$outboundSchema: z.ZodType< CreateIndexResponse$Outbound, z.ZodTypeDef, CreateIndexResponse > = z.object({ indexId: z.string().optional(), }).transform((v) => { return remap$(v, { indexId: "index_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateIndexResponse$ { /** @deprecated use `CreateIndexResponse$inboundSchema` instead. */ export const inboundSchema = CreateIndexResponse$inboundSchema; /** @deprecated use `CreateIndexResponse$outboundSchema` instead. */ export const outboundSchema = CreateIndexResponse$outboundSchema; /** @deprecated use `CreateIndexResponse$Outbound` instead. */ export type Outbound = CreateIndexResponse$Outbound; } export function createIndexResponseToJSON( createIndexResponse: CreateIndexResponse, ): string { return JSON.stringify( CreateIndexResponse$outboundSchema.parse(createIndexResponse), ); } export function createIndexResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateIndexResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateIndexResponse' from JSON`, ); }