# 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_group_info import PermissionGroupInfo


class BusinessManagementScope(object):
    _types = {
        "entity": EntityInfo,
        "permission_groups": List[PermissionGroupInfo],
    }

    def __init__(self, d=None):
        self.entity: Optional[EntityInfo] = None
        self.permission_groups: Optional[List[PermissionGroupInfo]] = None
        init(self, d, self._types)

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


class BusinessManagementScopeBuilder(object):
    def __init__(self) -> None:
        self._business_management_scope = BusinessManagementScope()

    def entity(self, entity: EntityInfo) -> "BusinessManagementScopeBuilder":
        self._business_management_scope.entity = entity
        return self

    def permission_groups(self, permission_groups: List[PermissionGroupInfo]) -> "BusinessManagementScopeBuilder":
        self._business_management_scope.permission_groups = permission_groups
        return self

    def build(self) -> "BusinessManagementScope":
        return self._business_management_scope
