Skip to content

Commit

Permalink
chore: IUserLite => ILiteUserに変える close #18
Browse files Browse the repository at this point in the history
  • Loading branch information
yupix committed Nov 4, 2022
1 parent 8872004 commit 827adac
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions mipac/models/lite/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

from mipac.models.lite.instance import LiteInstance
from mipac.types.emoji import ICustomEmojiLite
from mipac.types.user import IUserLite
from mipac.types.user import ILiteUser


class LiteUser:
__slots__ = ('__user',)

def __init__(self, user: IUserLite) -> None:
self.__user: IUserLite = user
def __init__(self, user: ILiteUser) -> None:
self.__user: ILiteUser = user

@property
def id(self) -> str:
Expand Down
4 changes: 2 additions & 2 deletions mipac/types/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

if TYPE_CHECKING:
from mipac.types import IDriveFile
from mipac.types.user import IUserLite
from mipac.types.user import ILiteUser

__all__ = ('IChatGroup', 'IChatMessage')

Expand All @@ -23,7 +23,7 @@ class IChatMessage(TypedDict):
file: IDriveFile
text: str | None
user_id: str
user: IUserLite
user: ILiteUser
recipient_id: str
recipient: str
group_id: str
Expand Down
6 changes: 3 additions & 3 deletions mipac/types/follow.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import TypedDict

from mipac.types.user import IUserLite
from mipac.types.user import ILiteUser


class IFollowRequest(TypedDict):
id: str
follower: IUserLite
followee: IUserLite
follower: ILiteUser
followee: ILiteUser
6 changes: 3 additions & 3 deletions mipac/types/note.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .drive import IDriveFile
from .emoji import ICustomEmojiLite
from .poll import IPoll
from .user import IUserLite
from .user import ILiteUser


class GeoPayload(TypedDict):
Expand All @@ -24,7 +24,7 @@ class INoteRequired(TypedDict):
created_at: str
text: str | None
cw: str | None
user: IUserLite
user: ILiteUser
user_id: str
reply_id: str
renote_id: str
Expand Down Expand Up @@ -56,5 +56,5 @@ class INote(INoteRequired, total=False):
class INoteReaction(TypedDict):
id: str
created_at: str
user: IUserLite
user: ILiteUser
type: str
4 changes: 2 additions & 2 deletions mipac/types/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

if TYPE_CHECKING:
from mipac.types.note import INote
from mipac.types.user import IUserLite
from mipac.types.user import ILiteUser


class Notification(TypedDict):
Expand All @@ -22,6 +22,6 @@ class Notification(TypedDict):
class IReactionNf(Notification):
type: str
reaction: str
user: IUserLite
user: ILiteUser
user_id: str
note: INote
8 changes: 4 additions & 4 deletions mipac/types/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from typing import TYPE_CHECKING, Any, Optional, TypedDict

from mipac.types.drive import IDriveFile
from mipac.types.user import IUserLite
from mipac.types.user import ILiteUser

if TYPE_CHECKING:
from mipac.types.drive import IFileProperties
from mipac.types.user import IUserLite
from mipac.types.user import ILiteUser

__all__ = (
'PageContentPayload',
Expand All @@ -25,7 +25,7 @@ class IPageRequired(TypedDict):
createdAt: str
updatedAt: str
userId: str
user: IUserLite
user: ILiteUser
content: list[dict[str, Any]]
variables: list[dict[str, Any]]
title: str
Expand Down Expand Up @@ -109,7 +109,7 @@ class PagePayload(TypedDict):
created_at: str
updated_at: str
user_id: str
user: IUserLite
user: ILiteUser
content: list[PageContentPayload]
variable: list[VariablePayload]
title: str
Expand Down
4 changes: 2 additions & 2 deletions mipac/types/reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@


if TYPE_CHECKING:
from mipac.types.user import IUserLite
from mipac.types.user import ILiteUser

__all__ = ('NoteReactionPayload',)


class NoteReactionPayload(TypedDict):
id: str
created_at: str
user: IUserLite
user: ILiteUser
type: str
10 changes: 5 additions & 5 deletions mipac/types/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
from mipac.types.page import IPage
__all__ = (
'IChannel',
'IUserLite',
'ILiteUser',
'IUserDetailed',
'IUserDetailedField',
)


class IUserLite(TypedDict):
class ILiteUser(TypedDict):
id: str
username: str
host: str | None
Expand All @@ -33,7 +33,7 @@ class IUserDetailedField(TypedDict):
value: str


class IUserDetailedRequired(IUserLite):
class IUserDetailedRequired(ILiteUser):
fields: list[IUserDetailedField]
followers_count: int
following_count: int
Expand Down Expand Up @@ -79,5 +79,5 @@ class IUserDetailed(IUserDetailedRequired, total=False):

class IFollowRequest(TypedDict):
id: str
follower: IUserLite
followee: IUserLite
follower: ILiteUser
followee: ILiteUser

0 comments on commit 827adac

Please sign in to comment.