/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: d93f865786bc
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import * as components from "../components/index.js";
/** @internal */
export const StreamV1WorkflowsExecutionsExecutionIdStreamGetRequest$outboundSchema = z.object({
    executionId: z.string(),
    eventSource: z.nullable(components.EventSource$outboundSchema).optional(),
    lastEventId: z.nullable(z.string()).optional(),
}).transform((v) => {
    return remap$(v, {
        executionId: "execution_id",
        eventSource: "event_source",
        lastEventId: "last_event_id",
    });
});
export function streamV1WorkflowsExecutionsExecutionIdStreamGetRequestToJSON(streamV1WorkflowsExecutionsExecutionIdStreamGetRequest) {
    return JSON.stringify(StreamV1WorkflowsExecutionsExecutionIdStreamGetRequest$outboundSchema.parse(streamV1WorkflowsExecutionsExecutionIdStreamGetRequest));
}
/** @internal */
export const StreamV1WorkflowsExecutionsExecutionIdStreamGetResponseBody$inboundSchema = z.object({
    event: z.string().optional(),
    data: z.string().optional().transform((v, ctx) => {
        if (v === undefined)
            return undefined;
        try {
            return JSON.parse(v);
        }
        catch (err) {
            ctx.addIssue({
                input: v,
                code: "custom",
                message: `malformed json: ${err}`,
            });
            return z.NEVER;
        }
    }).pipe(components.StreamEventSsePayload$inboundSchema.optional()),
    id: z.string().optional(),
    retry: z.int().optional(),
});
export function streamV1WorkflowsExecutionsExecutionIdStreamGetResponseBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => StreamV1WorkflowsExecutionsExecutionIdStreamGetResponseBody$inboundSchema
        .parse(JSON.parse(x)), `Failed to parse 'StreamV1WorkflowsExecutionsExecutionIdStreamGetResponseBody' from JSON`);
}
//# sourceMappingURL=streamv1workflowsexecutionsexecutionidstreamget.js.map