/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 539be5e83459
 */
import * as z from "zod/v4";
import { safeParse } from "../../lib/schemas.js";
import { CompletionChunk$inboundSchema, } from "./completionchunk.js";
/** @internal */
export const CompletionEvent$inboundSchema = z.object({
    data: z.string().transform((v, ctx) => {
        try {
            return JSON.parse(v);
        }
        catch (err) {
            ctx.addIssue({
                input: v,
                code: "custom",
                message: `malformed json: ${err}`,
            });
            return z.NEVER;
        }
    }).pipe(CompletionChunk$inboundSchema),
});
export function completionEventFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CompletionEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionEvent' from JSON`);
}
//# sourceMappingURL=completionevent.js.map