/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: f647a457441c
 */
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 { MessageOutputContentChunks$inboundSchema, MessageOutputContentChunks$outboundSchema, } from "./messageoutputcontentchunks.js";
/** @internal */
export const MessageOutputEntryContent$inboundSchema = smartUnion([z.string(), z.array(MessageOutputContentChunks$inboundSchema)]);
/** @internal */
export const MessageOutputEntryContent$outboundSchema = smartUnion([
    z.string(),
    z.array(MessageOutputContentChunks$outboundSchema),
]);
export function messageOutputEntryContentToJSON(messageOutputEntryContent) {
    return JSON.stringify(MessageOutputEntryContent$outboundSchema.parse(messageOutputEntryContent));
}
export function messageOutputEntryContentFromJSON(jsonString) {
    return safeParse(jsonString, (x) => MessageOutputEntryContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageOutputEntryContent' from JSON`);
}
/** @internal */
export const MessageOutputEntry$inboundSchema = z.object({
    object: z.literal("entry").default("entry"),
    type: z.literal("message.output").default("message.output"),
    created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v))
        .optional(),
    completed_at: z.nullable(z.iso.datetime({ offset: true }).transform(v => new Date(v))).optional(),
    agent_id: z.nullable(z.string()).optional(),
    model: z.nullable(z.string()).optional(),
    id: z.string().optional(),
    role: z.literal("assistant").default("assistant"),
    content: smartUnion([
        z.string(),
        z.array(MessageOutputContentChunks$inboundSchema),
    ]),
}).transform((v) => {
    return remap$(v, {
        "created_at": "createdAt",
        "completed_at": "completedAt",
        "agent_id": "agentId",
    });
});
/** @internal */
export const MessageOutputEntry$outboundSchema = z.object({
    object: z.literal("entry").default("entry"),
    type: z.literal("message.output").default("message.output"),
    createdAt: z.date().transform(v => v.toISOString()).optional(),
    completedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    agentId: z.nullable(z.string()).optional(),
    model: z.nullable(z.string()).optional(),
    id: z.string().optional(),
    role: z.literal("assistant").default("assistant"),
    content: smartUnion([
        z.string(),
        z.array(MessageOutputContentChunks$outboundSchema),
    ]),
}).transform((v) => {
    return remap$(v, {
        createdAt: "created_at",
        completedAt: "completed_at",
        agentId: "agent_id",
    });
});
export function messageOutputEntryToJSON(messageOutputEntry) {
    return JSON.stringify(MessageOutputEntry$outboundSchema.parse(messageOutputEntry));
}
export function messageOutputEntryFromJSON(jsonString) {
    return safeParse(jsonString, (x) => MessageOutputEntry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageOutputEntry' from JSON`);
}
//# sourceMappingURL=messageoutputentry.js.map