/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 5e51bdf5cb00
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import * as openEnums from "../../types/enums.js";
import { FunctionCallEntryArguments$inboundSchema, FunctionCallEntryArguments$outboundSchema, } from "./functioncallentryarguments.js";
export const FunctionCallEntryConfirmationStatus = {
    Pending: "pending",
    Allowed: "allowed",
    Denied: "denied",
};
/** @internal */
export const FunctionCallEntryConfirmationStatus$inboundSchema = openEnums.inboundSchema(FunctionCallEntryConfirmationStatus);
/** @internal */
export const FunctionCallEntryConfirmationStatus$outboundSchema = openEnums.outboundSchema(FunctionCallEntryConfirmationStatus);
/** @internal */
export const FunctionCallEntry$inboundSchema = z.object({
    object: z.literal("entry").default("entry"),
    type: z.literal("function.call").default("function.call"),
    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(),
    tool_call_id: z.string(),
    name: z.string(),
    arguments: FunctionCallEntryArguments$inboundSchema,
    confirmation_status: z.nullable(FunctionCallEntryConfirmationStatus$inboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        "created_at": "createdAt",
        "completed_at": "completedAt",
        "agent_id": "agentId",
        "tool_call_id": "toolCallId",
        "confirmation_status": "confirmationStatus",
    });
});
/** @internal */
export const FunctionCallEntry$outboundSchema = z.object({
    object: z.literal("entry").default("entry"),
    type: z.literal("function.call").default("function.call"),
    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(),
    toolCallId: z.string(),
    name: z.string(),
    arguments: FunctionCallEntryArguments$outboundSchema,
    confirmationStatus: z.nullable(FunctionCallEntryConfirmationStatus$outboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        createdAt: "created_at",
        completedAt: "completed_at",
        agentId: "agent_id",
        toolCallId: "tool_call_id",
        confirmationStatus: "confirmation_status",
    });
});
export function functionCallEntryToJSON(functionCallEntry) {
    return JSON.stringify(FunctionCallEntry$outboundSchema.parse(functionCallEntry));
}
export function functionCallEntryFromJSON(jsonString) {
    return safeParse(jsonString, (x) => FunctionCallEntry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FunctionCallEntry' from JSON`);
}
//# sourceMappingURL=functioncallentry.js.map