# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
from .filter_rule_value import FilterRuleValue
from .filter_rule_value import FilterRuleValue


class FilterCondition(object):
    _types = {
        "left": FilterRuleValue,
        "right": FilterRuleValue,
        "operator": int,
        "right_value_type": int,
    }

    def __init__(self, d=None):
        self.left: Optional[FilterRuleValue] = None
        self.right: Optional[FilterRuleValue] = None
        self.operator: Optional[int] = None
        self.right_value_type: Optional[int] = None
        init(self, d, self._types)

    @staticmethod
    def builder() -> "FilterConditionBuilder":
        return FilterConditionBuilder()


class FilterConditionBuilder(object):
    def __init__(self) -> None:
        self._filter_condition = FilterCondition()

    def left(self, left: FilterRuleValue) -> "FilterConditionBuilder":
        self._filter_condition.left = left
        return self

    def right(self, right: FilterRuleValue) -> "FilterConditionBuilder":
        self._filter_condition.right = right
        return self

    def operator(self, operator: int) -> "FilterConditionBuilder":
        self._filter_condition.operator = operator
        return self

    def right_value_type(self, right_value_type: int) -> "FilterConditionBuilder":
        self._filter_condition.right_value_type = right_value_type
        return self

    def build(self) -> "FilterCondition":
        return self._filter_condition
