/* * 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 ListIndexesResponse = { /** * List of all indexes */ indexes?: Array | undefined; }; /** @internal */ export const ListIndexesResponse$inboundSchema: z.ZodType< ListIndexesResponse, z.ZodTypeDef, unknown > = z.object({ indexes: z.array(Index$inboundSchema).optional(), }); /** @internal */ export type ListIndexesResponse$Outbound = { indexes?: Array | undefined; }; /** @internal */ export const ListIndexesResponse$outboundSchema: z.ZodType< ListIndexesResponse$Outbound, z.ZodTypeDef, ListIndexesResponse > = z.object({ indexes: z.array(Index$outboundSchema).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ListIndexesResponse$ { /** @deprecated use `ListIndexesResponse$inboundSchema` instead. */ export const inboundSchema = ListIndexesResponse$inboundSchema; /** @deprecated use `ListIndexesResponse$outboundSchema` instead. */ export const outboundSchema = ListIndexesResponse$outboundSchema; /** @deprecated use `ListIndexesResponse$Outbound` instead. */ export type Outbound = ListIndexesResponse$Outbound; } export function listIndexesResponseToJSON( listIndexesResponse: ListIndexesResponse, ): string { return JSON.stringify( ListIndexesResponse$outboundSchema.parse(listIndexesResponse), ); } export function listIndexesResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListIndexesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListIndexesResponse' from JSON`, ); }