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
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
from typing import Optional
|
||||
|
||||
from attr import dataclass
|
||||
|
||||
from mautrix.types import SerializableAttrs
|
||||
|
@ -23,9 +25,9 @@ from .mention import MentionStruct
|
|||
|
||||
@dataclass(kw_only=True)
|
||||
class Attachment(SerializableAttrs):
|
||||
shout: bool | None = None
|
||||
mentions: list[MentionStruct] | None = None
|
||||
urls: list[str] | None = None
|
||||
shout: Optional[bool] = None
|
||||
mentions: Optional[list[MentionStruct]] = None
|
||||
urls: Optional[list[str]] = None
|
||||
|
||||
|
||||
@dataclass
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#
|
||||
# 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 typing import Generic, TypeVar
|
||||
from typing import Generic, TypeVar, Optional
|
||||
|
||||
from attr import dataclass
|
||||
|
||||
|
@ -48,7 +48,7 @@ class ChannelInfo(Channel):
|
|||
newChatCountInvalid: bool
|
||||
lastChatLogId: Long
|
||||
lastSeenLogId: Long
|
||||
lastChatLog: Chatlog | None = None
|
||||
lastChatLog: Optional[Chatlog] = None
|
||||
metaMap: ChannelMetaMap
|
||||
displayUserList: list[DisplayUserInfo]
|
||||
pushAlert: bool
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#
|
||||
# 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 typing import Optional
|
||||
|
||||
from attr import dataclass
|
||||
|
||||
from mautrix.types import JSON
|
||||
|
@ -25,7 +27,7 @@ from . import OpenTokenComponent, OpenLink
|
|||
@dataclass(kw_only=True)
|
||||
class OpenChannelInfo(ChannelInfo, OpenChannel, OpenTokenComponent):
|
||||
directChannel: bool
|
||||
openLink: OpenLink | None = None
|
||||
openLink: Optional[OpenLink] = None
|
||||
|
||||
|
||||
@dataclass
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#
|
||||
# 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 typing import Optional
|
||||
|
||||
from attr import dataclass
|
||||
|
||||
from mautrix.types import SerializableAttrs
|
||||
|
@ -28,7 +30,7 @@ class ChannelUser(SerializableAttrs):
|
|||
@dataclass(kw_only=True)
|
||||
class PartialOpenLinkComponent(SerializableAttrs):
|
||||
"""Substitute for Partial<OpenLinkComponent>"""
|
||||
linkId: Long | None = None
|
||||
linkId: Optional[Long] = None
|
||||
|
||||
|
||||
@dataclass
|
||||
|
|
Loading…
Reference in New Issue