# Code generated by Lark OpenAPI.

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


class RecRuleCondition(object):
    _types = {
        "field_name": str,
        "operator": str,
        "value": List[str],
        "field_type": int,
    }

    def __init__(self, d=None):
        self.field_name: Optional[str] = None
        self.operator: Optional[str] = None
        self.value: Optional[List[str]] = None
        self.field_type: Optional[int] = None
        init(self, d, self._types)

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


class RecRuleConditionBuilder(object):
    def __init__(self) -> None:
        self._rec_rule_condition = RecRuleCondition()

    def field_name(self, field_name: str) -> "RecRuleConditionBuilder":
        self._rec_rule_condition.field_name = field_name
        return self

    def operator(self, operator: str) -> "RecRuleConditionBuilder":
        self._rec_rule_condition.operator = operator
        return self

    def value(self, value: List[str]) -> "RecRuleConditionBuilder":
        self._rec_rule_condition.value = value
        return self

    def field_type(self, field_type: int) -> "RecRuleConditionBuilder":
        self._rec_rule_condition.field_type = field_type
        return self

    def build(self) -> "RecRuleCondition":
        return self._rec_rule_condition
