/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: ce909efc8e7c
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
/** @internal */
export const FunctionResultEntry$inboundSchema = z.object({
    object: z.literal("entry").default("entry"),
    type: z.literal("function.result").default("function.result"),
    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(),
    id: z.string().optional(),
    tool_call_id: z.string(),
    result: z.string(),
}).transform((v) => {
    return remap$(v, {
        "created_at": "createdAt",
        "completed_at": "completedAt",
        "tool_call_id": "toolCallId",
    });
});
/** @internal */
export const FunctionResultEntry$outboundSchema = z.object({
    object: z.literal("entry").default("entry"),
    type: z.literal("function.result").default("function.result"),
    createdAt: z.date().transform(v => v.toISOString()).optional(),
    completedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    id: z.string().optional(),
    toolCallId: z.string(),
    result: z.string(),
}).transform((v) => {
    return remap$(v, {
        createdAt: "created_at",
        completedAt: "completed_at",
        toolCallId: "tool_call_id",
    });
});
export function functionResultEntryToJSON(functionResultEntry) {
    return JSON.stringify(FunctionResultEntry$outboundSchema.parse(functionResultEntry));
}
export function functionResultEntryFromJSON(jsonString) {
    return safeParse(jsonString, (x) => FunctionResultEntry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FunctionResultEntry' from JSON`);
}
//# sourceMappingURL=functionresultentry.js.map