/* * 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 GetIndexRequest = { /** * The name of the index to be retrieved */ indexName: string; }; /** @internal */ export const GetIndexRequest$inboundSchema: z.ZodType< GetIndexRequest, z.ZodTypeDef, unknown > = z.object({ index_name: z.string(), }).transform((v) => { return remap$(v, { "index_name": "indexName", }); }); /** @internal */ export type GetIndexRequest$Outbound = { index_name: string; }; /** @internal */ export const GetIndexRequest$outboundSchema: z.ZodType< GetIndexRequest$Outbound, z.ZodTypeDef, GetIndexRequest > = z.object({ indexName: z.string(), }).transform((v) => { return remap$(v, { indexName: "index_name", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetIndexRequest$ { /** @deprecated use `GetIndexRequest$inboundSchema` instead. */ export const inboundSchema = GetIndexRequest$inboundSchema; /** @deprecated use `GetIndexRequest$outboundSchema` instead. */ export const outboundSchema = GetIndexRequest$outboundSchema; /** @deprecated use `GetIndexRequest$Outbound` instead. */ export type Outbound = GetIndexRequest$Outbound; } export function getIndexRequestToJSON( getIndexRequest: GetIndexRequest, ): string { return JSON.stringify(GetIndexRequest$outboundSchema.parse(getIndexRequest)); } export function getIndexRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetIndexRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetIndexRequest' from JSON`, ); }