# 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 .i18n import I18n
from .i18n import I18n
from .user_business_management_scope import UserBusinessManagementScope


class UserRole(object):
    _types = {
        "user_id": str,
        "role_id": str,
        "modify_time": str,
        "role_name": I18n,
        "role_description": I18n,
        "business_management_scopes": List[UserBusinessManagementScope],
    }

    def __init__(self, d=None):
        self.user_id: Optional[str] = None
        self.role_id: Optional[str] = None
        self.modify_time: Optional[str] = None
        self.role_name: Optional[I18n] = None
        self.role_description: Optional[I18n] = None
        self.business_management_scopes: Optional[List[UserBusinessManagementScope]] = None
        init(self, d, self._types)

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


class UserRoleBuilder(object):
    def __init__(self) -> None:
        self._user_role = UserRole()

    def user_id(self, user_id: str) -> "UserRoleBuilder":
        self._user_role.user_id = user_id
        return self

    def role_id(self, role_id: str) -> "UserRoleBuilder":
        self._user_role.role_id = role_id
        return self

    def modify_time(self, modify_time: str) -> "UserRoleBuilder":
        self._user_role.modify_time = modify_time
        return self

    def role_name(self, role_name: I18n) -> "UserRoleBuilder":
        self._user_role.role_name = role_name
        return self

    def role_description(self, role_description: I18n) -> "UserRoleBuilder":
        self._user_role.role_description = role_description
        return self

    def business_management_scopes(self,
                                   business_management_scopes: List[UserBusinessManagementScope]) -> "UserRoleBuilder":
        self._user_role.business_management_scopes = business_management_scopes
        return self

    def build(self) -> "UserRole":
        return self._user_role
