/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Index, Index$inboundSchema, Index$Outbound, Index$outboundSchema, } from "./index.js"; export type GetIndexResponse = { index: Index; }; /** @internal */ export const GetIndexResponse$inboundSchema: z.ZodType< GetIndexResponse, z.ZodTypeDef, unknown > = z.object({ index: Index$inboundSchema, }); /** @internal */ export type GetIndexResponse$Outbound = { index: Index$Outbound; }; /** @internal */ export const GetIndexResponse$outboundSchema: z.ZodType< GetIndexResponse$Outbound, z.ZodTypeDef, GetIndexResponse > = z.object({ index: Index$outboundSchema, }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetIndexResponse$ { /** @deprecated use `GetIndexResponse$inboundSchema` instead. */ export const inboundSchema = GetIndexResponse$inboundSchema; /** @deprecated use `GetIndexResponse$outboundSchema` instead. */ export const outboundSchema = GetIndexResponse$outboundSchema; /** @deprecated use `GetIndexResponse$Outbound` instead. */ export type Outbound = GetIndexResponse$Outbound; } export function getIndexResponseToJSON( getIndexResponse: GetIndexResponse, ): string { return JSON.stringify( GetIndexResponse$outboundSchema.parse(getIndexResponse), ); } export function getIndexResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetIndexResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetIndexResponse' from JSON`, ); }