# 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 .rec_rule_condition import RecRuleCondition


class OtherRecRule(object):
    _types = {
        "conditions": List[RecRuleCondition],
        "conjunction": str,
        "perm": int,
    }

    def __init__(self, d=None):
        self.conditions: Optional[List[RecRuleCondition]] = None
        self.conjunction: Optional[str] = None
        self.perm: Optional[int] = None
        init(self, d, self._types)

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


class OtherRecRuleBuilder(object):
    def __init__(self) -> None:
        self._other_rec_rule = OtherRecRule()

    def conditions(self, conditions: List[RecRuleCondition]) -> "OtherRecRuleBuilder":
        self._other_rec_rule.conditions = conditions
        return self

    def conjunction(self, conjunction: str) -> "OtherRecRuleBuilder":
        self._other_rec_rule.conjunction = conjunction
        return self

    def perm(self, perm: int) -> "OtherRecRuleBuilder":
        self._other_rec_rule.perm = perm
        return self

    def build(self) -> "OtherRecRule":
        return self._other_rec_rule
