# 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 .matching_rule_scope_setting import MatchingRuleScopeSetting
from .i18n import I18n


class MatchingRuleItem(object):
    _types = {
        "company_id": str,
        "active": bool,
        "priority": int,
        "scope_setting": MatchingRuleScopeSetting,
        "descriptions": List[I18n],
    }

    def __init__(self, d=None):
        self.company_id: Optional[str] = None
        self.active: Optional[bool] = None
        self.priority: Optional[int] = None
        self.scope_setting: Optional[MatchingRuleScopeSetting] = None
        self.descriptions: Optional[List[I18n]] = None
        init(self, d, self._types)

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


class MatchingRuleItemBuilder(object):
    def __init__(self) -> None:
        self._matching_rule_item = MatchingRuleItem()

    def company_id(self, company_id: str) -> "MatchingRuleItemBuilder":
        self._matching_rule_item.company_id = company_id
        return self

    def active(self, active: bool) -> "MatchingRuleItemBuilder":
        self._matching_rule_item.active = active
        return self

    def priority(self, priority: int) -> "MatchingRuleItemBuilder":
        self._matching_rule_item.priority = priority
        return self

    def scope_setting(self, scope_setting: MatchingRuleScopeSetting) -> "MatchingRuleItemBuilder":
        self._matching_rule_item.scope_setting = scope_setting
        return self

    def descriptions(self, descriptions: List[I18n]) -> "MatchingRuleItemBuilder":
        self._matching_rule_item.descriptions = descriptions
        return self

    def build(self) -> "MatchingRuleItem":
        return self._matching_rule_item
