/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: aa256f7ecc7b
 */
import * as z from "zod/v4";
import { safeParse } from "../../lib/schemas.js";
import * as openEnums from "../../types/enums.js";
import { smartUnion } from "../../types/smartUnion.js";
import { ToolProperties$inboundSchema, ToolProperties$outboundSchema, } from "./toolproperties.js";
export const LogicalExpressionType = {
    And: "and",
    Or: "or",
};
/** @internal */
export const LogicalExpressionType$inboundSchema = openEnums.inboundSchema(LogicalExpressionType);
/** @internal */
export const LogicalExpressionType$outboundSchema = openEnums.outboundSchema(LogicalExpressionType);
/** @internal */
export const LogicalExpression$inboundSchema = z.object({
    type: LogicalExpressionType$inboundSchema,
    expressions: z.array(smartUnion([
        z.lazy(() => LogicalExpression$inboundSchema),
        ToolProperties$inboundSchema,
        z.array(z.string()),
    ])),
});
/** @internal */
export const LogicalExpression$outboundSchema = z.object({
    type: LogicalExpressionType$outboundSchema,
    expressions: z.array(smartUnion([
        z.lazy(() => LogicalExpression$outboundSchema),
        ToolProperties$outboundSchema,
        z.array(z.string()),
    ])),
});
export function logicalExpressionToJSON(logicalExpression) {
    return JSON.stringify(LogicalExpression$outboundSchema.parse(logicalExpression));
}
export function logicalExpressionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => LogicalExpression$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LogicalExpression' from JSON`);
}
/** @internal */
export const Expression$inboundSchema = smartUnion([
    z.lazy(() => LogicalExpression$inboundSchema),
    ToolProperties$inboundSchema,
    z.array(z.string()),
]);
/** @internal */
export const Expression$outboundSchema = smartUnion([
    z.lazy(() => LogicalExpression$outboundSchema),
    ToolProperties$outboundSchema,
    z.array(z.string()),
]);
export function expressionToJSON(expression) {
    return JSON.stringify(Expression$outboundSchema.parse(expression));
}
export function expressionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Expression$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Expression' from JSON`);
}
//# sourceMappingURL=logicalexpression.js.map