# 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 .entity_info import EntityInfo
from .permission_scope_rule import PermissionScopeRule


class UserBusinessManagementScope(object):
    _types = {
        "entity": EntityInfo,
        "scope_rule": PermissionScopeRule,
    }

    def __init__(self, d=None):
        self.entity: Optional[EntityInfo] = None
        self.scope_rule: Optional[PermissionScopeRule] = None
        init(self, d, self._types)

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


class UserBusinessManagementScopeBuilder(object):
    def __init__(self) -> None:
        self._user_business_management_scope = UserBusinessManagementScope()

    def entity(self, entity: EntityInfo) -> "UserBusinessManagementScopeBuilder":
        self._user_business_management_scope.entity = entity
        return self

    def scope_rule(self, scope_rule: PermissionScopeRule) -> "UserBusinessManagementScopeBuilder":
        self._user_business_management_scope.scope_rule = scope_rule
        return self

    def build(self) -> "UserBusinessManagementScope":
        return self._user_business_management_scope
