# 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


class Role(object):
    _types = {
        "id": str,
        "name": I18n,
        "description": I18n,
        "scope_of_application": int,
        "modify_time": str,
        "role_status": int,
        "role_type": int,
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.name: Optional[I18n] = None
        self.description: Optional[I18n] = None
        self.scope_of_application: Optional[int] = None
        self.modify_time: Optional[str] = None
        self.role_status: Optional[int] = None
        self.role_type: Optional[int] = None
        init(self, d, self._types)

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


class RoleBuilder(object):
    def __init__(self) -> None:
        self._role = Role()

    def id(self, id: str) -> "RoleBuilder":
        self._role.id = id
        return self

    def name(self, name: I18n) -> "RoleBuilder":
        self._role.name = name
        return self

    def description(self, description: I18n) -> "RoleBuilder":
        self._role.description = description
        return self

    def scope_of_application(self, scope_of_application: int) -> "RoleBuilder":
        self._role.scope_of_application = scope_of_application
        return self

    def modify_time(self, modify_time: str) -> "RoleBuilder":
        self._role.modify_time = modify_time
        return self

    def role_status(self, role_status: int) -> "RoleBuilder":
        self._role.role_status = role_status
        return self

    def role_type(self, role_type: int) -> "RoleBuilder":
        self._role.role_type = role_type
        return self

    def build(self) -> "Role":
        return self._role
