/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: af3e1aa8c1b3
 */
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 { LogicalExpression$inboundSchema, LogicalExpression$outboundSchema, } from "./logicalexpression.js";
import { ToolProperties$inboundSchema, ToolProperties$outboundSchema, } from "./toolproperties.js";
/** @internal */
export const RequiresConfirmation$inboundSchema = smartUnion([
    LogicalExpression$inboundSchema,
    ToolProperties$inboundSchema,
    z.array(z.string()),
]);
/** @internal */
export const RequiresConfirmation$outboundSchema = smartUnion([
    LogicalExpression$outboundSchema,
    ToolProperties$outboundSchema,
    z.array(z.string()),
]);
export function requiresConfirmationToJSON(requiresConfirmation) {
    return JSON.stringify(RequiresConfirmation$outboundSchema.parse(requiresConfirmation));
}
export function requiresConfirmationFromJSON(jsonString) {
    return safeParse(jsonString, (x) => RequiresConfirmation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequiresConfirmation' from JSON`);
}
/** @internal */
export const SkipConfirmation$inboundSchema = smartUnion([
    LogicalExpression$inboundSchema,
    ToolProperties$inboundSchema,
    z.array(z.string()),
]);
/** @internal */
export const SkipConfirmation$outboundSchema = smartUnion([
    LogicalExpression$outboundSchema,
    ToolProperties$outboundSchema,
    z.array(z.string()),
]);
export function skipConfirmationToJSON(skipConfirmation) {
    return JSON.stringify(SkipConfirmation$outboundSchema.parse(skipConfirmation));
}
export function skipConfirmationFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SkipConfirmation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SkipConfirmation' from JSON`);
}
/** @internal */
export const ToolExecutionConfiguration$inboundSchema = z.object({
    requires_confirmation: z.nullable(smartUnion([
        LogicalExpression$inboundSchema,
        ToolProperties$inboundSchema,
        z.array(z.string()),
    ])).optional(),
    skip_confirmation: z.nullable(smartUnion([
        LogicalExpression$inboundSchema,
        ToolProperties$inboundSchema,
        z.array(z.string()),
    ])).optional(),
    include: z.nullable(z.array(z.string())).optional(),
    exclude: z.nullable(z.array(z.string())).optional(),
}).transform((v) => {
    return remap$(v, {
        "requires_confirmation": "requiresConfirmation",
        "skip_confirmation": "skipConfirmation",
    });
});
/** @internal */
export const ToolExecutionConfiguration$outboundSchema = z.object({
    requiresConfirmation: z.nullable(smartUnion([
        LogicalExpression$outboundSchema,
        ToolProperties$outboundSchema,
        z.array(z.string()),
    ])).optional(),
    skipConfirmation: z.nullable(smartUnion([
        LogicalExpression$outboundSchema,
        ToolProperties$outboundSchema,
        z.array(z.string()),
    ])).optional(),
    include: z.nullable(z.array(z.string())).optional(),
    exclude: z.nullable(z.array(z.string())).optional(),
}).transform((v) => {
    return remap$(v, {
        requiresConfirmation: "requires_confirmation",
        skipConfirmation: "skip_confirmation",
    });
});
export function toolExecutionConfigurationToJSON(toolExecutionConfiguration) {
    return JSON.stringify(ToolExecutionConfiguration$outboundSchema.parse(toolExecutionConfiguration));
}
export function toolExecutionConfigurationFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ToolExecutionConfiguration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolExecutionConfiguration' from JSON`);
}
//# sourceMappingURL=toolexecutionconfiguration.js.map