/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: fc098a76eca8 */ import * as z from "zod/v4"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type WorkflowStreamError = { error: string; reason: string; }; /** @internal */ export const WorkflowStreamError$inboundSchema: z.ZodType< WorkflowStreamError, unknown > = z.object({ error: z.string(), reason: z.string(), }); /** @internal */ export type WorkflowStreamError$Outbound = { error: string; reason: string; }; /** @internal */ export const WorkflowStreamError$outboundSchema: z.ZodType< WorkflowStreamError$Outbound, WorkflowStreamError > = z.object({ error: z.string(), reason: z.string(), }); export function workflowStreamErrorToJSON( workflowStreamError: WorkflowStreamError, ): string { return JSON.stringify( WorkflowStreamError$outboundSchema.parse(workflowStreamError), ); } export function workflowStreamErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WorkflowStreamError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WorkflowStreamError' from JSON`, ); }