/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ElasticSearchErrorMessage, ElasticSearchErrorMessage$inboundSchema, } from "./elasticsearcherrormessage.js"; import { ElasticSearchResultsNodeInfo, ElasticSearchResultsNodeInfo$inboundSchema, } from "./elasticsearchresultsnodeinfo.js"; import { ElasticSearchSystemInfo, ElasticSearchSystemInfo$inboundSchema, } from "./elasticsearchsysteminfo.js"; export type ElasticSearch = { errorMessage?: ElasticSearchErrorMessage | undefined; resultsNodeInfo?: ElasticSearchResultsNodeInfo | undefined; systemInfo?: ElasticSearchSystemInfo | undefined; }; /** @internal */ export const ElasticSearch$inboundSchema: z.ZodType< ElasticSearch, z.ZodTypeDef, unknown > = z.object({ error_message: ElasticSearchErrorMessage$inboundSchema.optional(), results_node_info: ElasticSearchResultsNodeInfo$inboundSchema.optional(), system_info: ElasticSearchSystemInfo$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "error_message": "errorMessage", "results_node_info": "resultsNodeInfo", "system_info": "systemInfo", }); }); export function elasticSearchFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ElasticSearch$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ElasticSearch' from JSON`, ); }