/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ElasticSearchErrorMessage = { header?: string | undefined; reason?: string | undefined; type?: string | undefined; }; /** @internal */ export const ElasticSearchErrorMessage$inboundSchema: z.ZodType< ElasticSearchErrorMessage, z.ZodTypeDef, unknown > = z.object({ header: z.string().optional(), reason: z.string().optional(), type: z.string().optional(), }); export function elasticSearchErrorMessageFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ElasticSearchErrorMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ElasticSearchErrorMessage' from JSON`, ); }