matrix-appservice-kakaotalk/matrix_appservice_kakaotalk/kt/types/openlink/open_link_user_info.py

62 lines
1.9 KiB
Python

# matrix-appservice-kakaotalk - A Matrix-KakaoTalk puppeting bridge.
# Copyright (C) 2022 Tulir Asokan, Andrew Ferrazzutti
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from attr import dataclass
from ..bson import Long
from ..user.channel_user import ChannelUser
from ..user.channel_user_info import DisplayUserInfo, OpenChannelUserInfo
from . import OpenTokenComponent, OpenLinkComponent, OpenPrivilegeComponent
from .open_link_type import OpenChannelUserPerm, OpenProfileType
@dataclass
class OpenLinkKickedUser(ChannelUser):
kickedChannelId: Long
@dataclass
class OpenLinkKickedUserInfo(OpenLinkKickedUser, DisplayUserInfo):
pass
@dataclass
class OpenLinkUserInfo(OpenLinkComponent, OpenTokenComponent, OpenPrivilegeComponent):
nickname: str
profileURL: str
fullProfileURL: str
originalProfileURL: str
profileType: OpenProfileType
perm: OpenChannelUserPerm
@dataclass
class OpenChannelUserInfoMix(OpenLinkComponent, OpenChannelUserInfo):
"""Substitute for OpenChannelUserInfo = OpenLinkComponent & OpenChannelUserInfo"""
pass
@dataclass
class OpenLinkChannelUserInfo(OpenLinkUserInfo, OpenChannelUserInfoMix):
pass
__all__ = [
"OpenLinkKickedUser",
"OpenLinkKickedUserInfo",
"OpenLinkUserInfo",
"OpenChannelUserInfoMix",
"OpenLinkChannelUserInfo",
]