/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 3512371b613d
 */
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 { ImageURL$inboundSchema, ImageURL$outboundSchema, } from "./imageurl.js";
/** @internal */
export const ImageUrlUnion$inboundSchema = smartUnion([ImageURL$inboundSchema, z.string()]);
/** @internal */
export const ImageUrlUnion$outboundSchema = smartUnion([ImageURL$outboundSchema, z.string()]);
export function imageUrlUnionToJSON(imageUrlUnion) {
    return JSON.stringify(ImageUrlUnion$outboundSchema.parse(imageUrlUnion));
}
export function imageUrlUnionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ImageUrlUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageUrlUnion' from JSON`);
}
/** @internal */
export const ImageURLChunk$inboundSchema = z
    .object({
    type: z.literal("image_url").default("image_url"),
    image_url: smartUnion([ImageURL$inboundSchema, z.string()]),
}).transform((v) => {
    return remap$(v, {
        "image_url": "imageUrl",
    });
});
/** @internal */
export const ImageURLChunk$outboundSchema = z.object({
    type: z.literal("image_url").default("image_url"),
    imageUrl: smartUnion([ImageURL$outboundSchema, z.string()]),
}).transform((v) => {
    return remap$(v, {
        imageUrl: "image_url",
    });
});
export function imageURLChunkToJSON(imageURLChunk) {
    return JSON.stringify(ImageURLChunk$outboundSchema.parse(imageURLChunk));
}
export function imageURLChunkFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ImageURLChunk$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageURLChunk' from JSON`);
}
//# sourceMappingURL=imageurlchunk.js.map