/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: aa5f2e2294f4
 */
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";
export const Scope = {
    Activity: "activity",
    Workflow: "workflow",
    Wildcard: "*",
};
/** @internal */
export const Scope$outboundSchema = z.enum(Scope);
/** @internal */
export const GetStreamEventsV1WorkflowsEventsStreamGetRequest$outboundSchema = z.object({
    scope: Scope$outboundSchema.default("*"),
    activityName: z.string().default("*"),
    activityId: z.string().default("*"),
    workflowName: z.string().default("*"),
    workflowExecId: z.string().default("*"),
    rootWorkflowExecId: z.string().default("*"),
    parentWorkflowExecId: z.string().default("*"),
    stream: z.string().default("*"),
    startSeq: z.int().default(0),
    metadataFilters: z.nullable(z.record(z.string(), z.any())).optional(),
    workflowEventTypes: z.nullable(z.array(components.WorkflowEventType$outboundSchema)).optional(),
    lastEventId: z.nullable(z.string()).optional(),
}).transform((v) => {
    return remap$(v, {
        activityName: "activity_name",
        activityId: "activity_id",
        workflowName: "workflow_name",
        workflowExecId: "workflow_exec_id",
        rootWorkflowExecId: "root_workflow_exec_id",
        parentWorkflowExecId: "parent_workflow_exec_id",
        startSeq: "start_seq",
        metadataFilters: "metadata_filters",
        workflowEventTypes: "workflow_event_types",
        lastEventId: "last-event-id",
    });
});
export function getStreamEventsV1WorkflowsEventsStreamGetRequestToJSON(getStreamEventsV1WorkflowsEventsStreamGetRequest) {
    return JSON.stringify(GetStreamEventsV1WorkflowsEventsStreamGetRequest$outboundSchema.parse(getStreamEventsV1WorkflowsEventsStreamGetRequest));
}
/** @internal */
export const GetStreamEventsV1WorkflowsEventsStreamGetResponseBody$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 getStreamEventsV1WorkflowsEventsStreamGetResponseBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetStreamEventsV1WorkflowsEventsStreamGetResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetStreamEventsV1WorkflowsEventsStreamGetResponseBody' from JSON`);
}
//# sourceMappingURL=getstreameventsv1workflowseventsstreamget.js.map