/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: a6d43f8b673d */ 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 ErrorMessage = { /** * The datasource this message relates to. */ source?: string | undefined; errorMessage?: string | undefined; }; /** @internal */ export const ErrorMessage$inboundSchema: z.ZodType< ErrorMessage, z.ZodTypeDef, unknown > = z.object({ source: z.string().optional(), errorMessage: z.string().optional(), }); export function errorMessageFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ErrorMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ErrorMessage' from JSON`, ); }