/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: a18ca7fa2648
 */
import { safeParse } from "../../lib/schemas.js";
import { discriminatedUnion } from "../../types/discriminatedUnion.js";
import { JSONPatchAdd$inboundSchema } from "./jsonpatchadd.js";
import { JSONPatchAppend$inboundSchema, } from "./jsonpatchappend.js";
import { JSONPatchRemove$inboundSchema, } from "./jsonpatchremove.js";
import { JSONPatchReplace$inboundSchema, } from "./jsonpatchreplace.js";
/** @internal */
export const JSONPatch$inboundSchema = discriminatedUnion("op", {
    add: JSONPatchAdd$inboundSchema,
    append: JSONPatchAppend$inboundSchema,
    remove: JSONPatchRemove$inboundSchema,
    replace: JSONPatchReplace$inboundSchema,
});
export function jsonPatchFromJSON(jsonString) {
    return safeParse(jsonString, (x) => JSONPatch$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JSONPatch' from JSON`);
}
//# sourceMappingURL=jsonpatch.js.map