/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 74b6bb8b7b5a
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { discriminatedUnion } from "../../types/discriminatedUnion.js";
import { JSONPatchPayloadResponse$inboundSchema, } from "./jsonpatchpayloadresponse.js";
import { JSONPayloadResponse$inboundSchema, } from "./jsonpayloadresponse.js";
/** @internal */
export const Payload$inboundSchema = discriminatedUnion("type", {
    json: JSONPayloadResponse$inboundSchema.and(z.object({ type: z.literal("json") })),
    json_patch: JSONPatchPayloadResponse$inboundSchema,
});
export function payloadFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Payload$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Payload' from JSON`);
}
/** @internal */
export const CustomTaskInProgressAttributesResponse$inboundSchema = z.object({
    custom_task_id: z.string(),
    custom_task_type: z.string(),
    payload: discriminatedUnion("type", {
        json: JSONPayloadResponse$inboundSchema.and(z.object({ type: z.literal("json") })),
        json_patch: JSONPatchPayloadResponse$inboundSchema,
    }),
}).transform((v) => {
    return remap$(v, {
        "custom_task_id": "customTaskId",
        "custom_task_type": "customTaskType",
    });
});
export function customTaskInProgressAttributesResponseFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CustomTaskInProgressAttributesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomTaskInProgressAttributesResponse' from JSON`);
}
//# sourceMappingURL=customtaskinprogressattributesresponse.js.map