/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod/v3";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { OpenAIImageUrlObject$inboundSchema, OpenAIImageUrlObject$outboundSchema, } from "./openaiimageurlobject.js";
export const OpenAIContentItemType = {
    Text: "text",
    ImageUrl: "image_url",
};
/** @internal */
export const OpenAIContentItemType$inboundSchema = z.nativeEnum(OpenAIContentItemType);
/** @internal */
export const OpenAIContentItemType$outboundSchema = OpenAIContentItemType$inboundSchema;
/** @internal */
export const OpenAIContentItem$inboundSchema = z.object({
    type: OpenAIContentItemType$inboundSchema,
    text: z.nullable(z.string()).optional(),
    image_url: z.nullable(OpenAIImageUrlObject$inboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        "image_url": "imageUrl",
    });
});
/** @internal */
export const OpenAIContentItem$outboundSchema = z.object({
    type: OpenAIContentItemType$outboundSchema,
    text: z.nullable(z.string()).optional(),
    imageUrl: z.nullable(OpenAIImageUrlObject$outboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        imageUrl: "image_url",
    });
});
export function openAIContentItemToJSON(openAIContentItem) {
    return JSON.stringify(OpenAIContentItem$outboundSchema.parse(openAIContentItem));
}
export function openAIContentItemFromJSON(jsonString) {
    return safeParse(jsonString, (x) => OpenAIContentItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIContentItem' from JSON`);
}
//# sourceMappingURL=openaicontentitem.js.map