Skip to content

Commit

Permalink
Define enumeration for drive/files
Browse files Browse the repository at this point in the history
  • Loading branch information
YuzuRyo61 committed Dec 4, 2023
1 parent 3188640 commit b4bebd5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
5 changes: 4 additions & 1 deletion misskey/drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
DriveFile,
DriveFileSchema,
)
from .enum import (
DriveFilesSortEnum,
)

__all__ = (
"Misskey",
Expand All @@ -24,7 +27,7 @@ def drive_files(
until_id: Optional[str] = None,
folder_id: Optional[str] = None,
type: Optional[str] = None,
sort, # TODO: Define enum
sort: Optional[DriveFilesSortEnum] = None,
) -> List[DriveFile]:
# TODO
raise NotImplementedError()
Expand Down
1 change: 1 addition & 0 deletions misskey/enum/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
from .reaction_acceptance import ReactionAcceptanceEnum
from .http_method import HttpMethodEnum
from .users import UsersSortEnum, UsersStateEnum, UsersOriginEnum
from .drive_files_sort import DriveFilesSortEnum
14 changes: 14 additions & 0 deletions misskey/enum/drive_files_sort.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from enum import Enum

__all__ = (
"DriveFilesSortEnum",
)


class DriveFilesSortEnum(Enum):
DESCENDING_CREATED_AT = "+createdAt"
ASCENDING_CREATED_AT = "-createdAt"
DESCENDING_NAME = "+name"
ASCENDING_NAME = "-name"
DESCENDING_SIZE = "+size"
ASCENDING_SIZE = "-size"

0 comments on commit b4bebd5

Please sign in to comment.