# 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 .criterion import Criterion
from .permission_name_info import PermissionNameInfo
from .permission_name_info import PermissionNameInfo


class RoleMember(object):
    _types = {
        "role_api_id": str,
        "role_api_name": str,
        "users": List[str],
        "departments": List[str],
        "user_filter": Criterion,
        "user_display_infos": List[PermissionNameInfo],
        "department_display_infos": List[PermissionNameInfo],
        "type": str,
        "updated_by": str,
        "updated_at": int,
    }

    def __init__(self, d=None):
        self.role_api_id: Optional[str] = None
        self.role_api_name: Optional[str] = None
        self.users: Optional[List[str]] = None
        self.departments: Optional[List[str]] = None
        self.user_filter: Optional[Criterion] = None
        self.user_display_infos: Optional[List[PermissionNameInfo]] = None
        self.department_display_infos: Optional[List[PermissionNameInfo]] = None
        self.type: Optional[str] = None
        self.updated_by: Optional[str] = None
        self.updated_at: Optional[int] = None
        init(self, d, self._types)

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


class RoleMemberBuilder(object):
    def __init__(self) -> None:
        self._role_member = RoleMember()

    def role_api_id(self, role_api_id: str) -> "RoleMemberBuilder":
        self._role_member.role_api_id = role_api_id
        return self

    def role_api_name(self, role_api_name: str) -> "RoleMemberBuilder":
        self._role_member.role_api_name = role_api_name
        return self

    def users(self, users: List[str]) -> "RoleMemberBuilder":
        self._role_member.users = users
        return self

    def departments(self, departments: List[str]) -> "RoleMemberBuilder":
        self._role_member.departments = departments
        return self

    def user_filter(self, user_filter: Criterion) -> "RoleMemberBuilder":
        self._role_member.user_filter = user_filter
        return self

    def user_display_infos(self, user_display_infos: List[PermissionNameInfo]) -> "RoleMemberBuilder":
        self._role_member.user_display_infos = user_display_infos
        return self

    def department_display_infos(self, department_display_infos: List[PermissionNameInfo]) -> "RoleMemberBuilder":
        self._role_member.department_display_infos = department_display_infos
        return self

    def type(self, type: str) -> "RoleMemberBuilder":
        self._role_member.type = type
        return self

    def updated_by(self, updated_by: str) -> "RoleMemberBuilder":
        self._role_member.updated_by = updated_by
        return self

    def updated_at(self, updated_at: int) -> "RoleMemberBuilder":
        self._role_member.updated_at = updated_at
        return self

    def build(self) -> "RoleMember":
        return self._role_member
