/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 4e2617d53d6d
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { smartUnion } from "../../types/smartUnion.js";
import * as components from "../components/index.js";
/** @internal */
export const ListRunsV1WorkflowsRunsGetStatus$outboundSchema = smartUnion([
    components.WorkflowExecutionStatus$outboundSchema,
    z.array(components.WorkflowExecutionStatus$outboundSchema),
]);
export function listRunsV1WorkflowsRunsGetStatusToJSON(listRunsV1WorkflowsRunsGetStatus) {
    return JSON.stringify(ListRunsV1WorkflowsRunsGetStatus$outboundSchema.parse(listRunsV1WorkflowsRunsGetStatus));
}
/** @internal */
export const ListRunsV1WorkflowsRunsGetRequest$outboundSchema = z.object({
    workflowIdentifier: z.nullable(z.string()).optional(),
    search: z.nullable(z.string()).optional(),
    status: z.nullable(smartUnion([
        components.WorkflowExecutionStatus$outboundSchema,
        z.array(components.WorkflowExecutionStatus$outboundSchema),
    ])).optional(),
    userId: z.nullable(z.string()).optional(),
    pageSize: z.int().default(50),
    nextPageToken: z.nullable(z.string()).optional(),
}).transform((v) => {
    return remap$(v, {
        workflowIdentifier: "workflow_identifier",
        userId: "user_id",
        pageSize: "page_size",
        nextPageToken: "next_page_token",
    });
});
export function listRunsV1WorkflowsRunsGetRequestToJSON(listRunsV1WorkflowsRunsGetRequest) {
    return JSON.stringify(ListRunsV1WorkflowsRunsGetRequest$outboundSchema.parse(listRunsV1WorkflowsRunsGetRequest));
}
/** @internal */
export const ListRunsV1WorkflowsRunsGetResponse$inboundSchema = z.object({
    Result: components.WorkflowExecutionListResponse$inboundSchema,
}).transform((v) => {
    return remap$(v, {
        "Result": "result",
    });
});
export function listRunsV1WorkflowsRunsGetResponseFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ListRunsV1WorkflowsRunsGetResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListRunsV1WorkflowsRunsGetResponse' from JSON`);
}
//# sourceMappingURL=listrunsv1workflowsrunsget.js.map