Remove union operator from more dataclass fields
This commit is contained in:
parent
8c2775056d
commit
e28694c987
@ -13,6 +13,8 @@
|
|||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
from attr import dataclass
|
from attr import dataclass
|
||||||
|
|
||||||
from mautrix.types import SerializableAttrs
|
from mautrix.types import SerializableAttrs
|
||||||
@ -23,9 +25,9 @@ from .mention import MentionStruct
|
|||||||
|
|
||||||
@dataclass(kw_only=True)
|
@dataclass(kw_only=True)
|
||||||
class Attachment(SerializableAttrs):
|
class Attachment(SerializableAttrs):
|
||||||
shout: bool | None = None
|
shout: Optional[bool] = None
|
||||||
mentions: list[MentionStruct] | None = None
|
mentions: Optional[list[MentionStruct]] = None
|
||||||
urls: list[str] | None = None
|
urls: Optional[list[str]] = None
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
from typing import Generic, TypeVar
|
from typing import Generic, TypeVar, Optional
|
||||||
|
|
||||||
from attr import dataclass
|
from attr import dataclass
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ class ChannelInfo(Channel):
|
|||||||
newChatCountInvalid: bool
|
newChatCountInvalid: bool
|
||||||
lastChatLogId: Long
|
lastChatLogId: Long
|
||||||
lastSeenLogId: Long
|
lastSeenLogId: Long
|
||||||
lastChatLog: Chatlog | None = None
|
lastChatLog: Optional[Chatlog] = None
|
||||||
metaMap: ChannelMetaMap
|
metaMap: ChannelMetaMap
|
||||||
displayUserList: list[DisplayUserInfo]
|
displayUserList: list[DisplayUserInfo]
|
||||||
pushAlert: bool
|
pushAlert: bool
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
from attr import dataclass
|
from attr import dataclass
|
||||||
|
|
||||||
from mautrix.types import JSON
|
from mautrix.types import JSON
|
||||||
@ -25,7 +27,7 @@ from . import OpenTokenComponent, OpenLink
|
|||||||
@dataclass(kw_only=True)
|
@dataclass(kw_only=True)
|
||||||
class OpenChannelInfo(ChannelInfo, OpenChannel, OpenTokenComponent):
|
class OpenChannelInfo(ChannelInfo, OpenChannel, OpenTokenComponent):
|
||||||
directChannel: bool
|
directChannel: bool
|
||||||
openLink: OpenLink | None = None
|
openLink: Optional[OpenLink] = None
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
from attr import dataclass
|
from attr import dataclass
|
||||||
|
|
||||||
from mautrix.types import SerializableAttrs
|
from mautrix.types import SerializableAttrs
|
||||||
@ -28,7 +30,7 @@ class ChannelUser(SerializableAttrs):
|
|||||||
@dataclass(kw_only=True)
|
@dataclass(kw_only=True)
|
||||||
class PartialOpenLinkComponent(SerializableAttrs):
|
class PartialOpenLinkComponent(SerializableAttrs):
|
||||||
"""Substitute for Partial<OpenLinkComponent>"""
|
"""Substitute for Partial<OpenLinkComponent>"""
|
||||||
linkId: Long | None = None
|
linkId: Optional[Long] = None
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
Loading…
Reference in New Issue
Block a user