/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
import { ConversationsField$inboundSchema, ConversationsField$outboundSchema, } from "./conversationsfield.js";
import { ConversationsFilterConditionValue$inboundSchema, ConversationsFilterConditionValue$outboundSchema, } from "./conversationsfilterconditionvalue.js";
import { FilterOperator$inboundSchema, FilterOperator$outboundSchema, } from "./filteroperator.js";
/** @internal */
export const Condition$inboundSchema = z.object({
    field: ConversationsField$inboundSchema,
    operator: FilterOperator$inboundSchema,
    value: ConversationsFilterConditionValue$inboundSchema,
});
/** @internal */
export const Condition$outboundSchema = z.object({
    field: ConversationsField$outboundSchema,
    operator: FilterOperator$outboundSchema,
    value: ConversationsFilterConditionValue$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Condition$;
(function (Condition$) {
    /** @deprecated use `Condition$inboundSchema` instead. */
    Condition$.inboundSchema = Condition$inboundSchema;
    /** @deprecated use `Condition$outboundSchema` instead. */
    Condition$.outboundSchema = Condition$outboundSchema;
})(Condition$ || (Condition$ = {}));
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),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ConversationsFilterCondition$;
(function (ConversationsFilterCondition$) {
    /** @deprecated use `ConversationsFilterCondition$inboundSchema` instead. */
    ConversationsFilterCondition$.inboundSchema = ConversationsFilterCondition$inboundSchema;
    /** @deprecated use `ConversationsFilterCondition$outboundSchema` instead. */
    ConversationsFilterCondition$.outboundSchema = ConversationsFilterCondition$outboundSchema;
})(ConversationsFilterCondition$ || (ConversationsFilterCondition$ = {}));
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