# Code generated by Lark OpenAPI.

from typing import Optional

from lark_oapi.core.construct import init


class RuleConditionItem(object):
    _types = {
        "type": int,
        "operator": int,
        "input": str,
    }

    def __init__(self, d=None):
        self.type: Optional[int] = None
        self.operator: Optional[int] = None
        self.input: Optional[str] = None
        init(self, d, self._types)

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


class RuleConditionItemBuilder(object):
    def __init__(self) -> None:
        self._rule_condition_item = RuleConditionItem()

    def type(self, type: int) -> "RuleConditionItemBuilder":
        self._rule_condition_item.type = type
        return self

    def operator(self, operator: int) -> "RuleConditionItemBuilder":
        self._rule_condition_item.operator = operator
        return self

    def input(self, input: str) -> "RuleConditionItemBuilder":
        self._rule_condition_item.input = input
        return self

    def build(self) -> "RuleConditionItem":
        return self._rule_condition_item
