/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod/v3";
import { safeParse } from "../../lib/schemas.js";
import { ConversationsField$inboundSchema, ConversationsField$outboundSchema, } from "./conversationsfield.js";
import { FilterOperator$inboundSchema, FilterOperator$outboundSchema, } from "./filteroperator.js";
/** @internal */
export const Four$inboundSchema = z
    .union([z.string(), z.number(), z.boolean()]);
/** @internal */
export const Four$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
export function fourToJSON(four) {
    return JSON.stringify(Four$outboundSchema.parse(four));
}
export function fourFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Four$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Four' from JSON`);
}
/** @internal */
export const Value$inboundSchema = z
    .union([
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.nullable(z.union([z.string(), z.number(), z.boolean()]))),
]);
/** @internal */
export const Value$outboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.nullable(z.union([z.string(), z.number(), z.boolean()]))),
]);
export function valueToJSON(value) {
    return JSON.stringify(Value$outboundSchema.parse(value));
}
export function valueFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Value$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Value' from JSON`);
}
/** @internal */
export const Seven$inboundSchema = z
    .object({
    path: z.array(z.string()),
    value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.nullable(z.union([z.string(), z.number(), z.boolean()]))),
    ])),
});
/** @internal */
export const Seven$outboundSchema = z.object({
    path: z.array(z.string()),
    value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.nullable(z.union([z.string(), z.number(), z.boolean()]))),
    ])),
});
export function sevenToJSON(seven) {
    return JSON.stringify(Seven$outboundSchema.parse(seven));
}
export function sevenFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Seven$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Seven' from JSON`);
}
/** @internal */
export const Condition$inboundSchema = z.object({
    field: ConversationsField$inboundSchema,
    operator: FilterOperator$inboundSchema,
    value: z.any().optional(),
});
/** @internal */
export const Condition$outboundSchema = z.object({
    field: ConversationsField$outboundSchema,
    operator: FilterOperator$outboundSchema,
    value: z.any().optional(),
});
export function conditionToJSON(condition) {
    return JSON.stringify(Condition$outboundSchema.parse(condition));
}
export function conditionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Condition$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Condition' from JSON`);
}
/** @internal */
export const ConversationsFilterCondition$inboundSchema = z.object({
    condition: z.lazy(() => Condition$inboundSchema),
});
/** @internal */
export const ConversationsFilterCondition$outboundSchema = z.object({
    condition: z.lazy(() => Condition$outboundSchema),
});
export function conversationsFilterConditionToJSON(conversationsFilterCondition) {
    return JSON.stringify(ConversationsFilterCondition$outboundSchema.parse(conversationsFilterCondition));
}
export function conversationsFilterConditionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ConversationsFilterCondition$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConversationsFilterCondition' from JSON`);
}
//# sourceMappingURL=conversationsfiltercondition.js.map