From b4bebd5b7caa7feabe83b1806c9ede56c10a223a Mon Sep 17 00:00:00 2001 From: YuzuRyo61 Date: Mon, 4 Dec 2023 19:17:51 +0900 Subject: [PATCH] Define enumeration for drive/files --- misskey/drive.py | 5 ++++- misskey/enum/__init__.py | 1 + misskey/enum/drive_files_sort.py | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 misskey/enum/drive_files_sort.py diff --git a/misskey/drive.py b/misskey/drive.py index 08230d0..e45229c 100644 --- a/misskey/drive.py +++ b/misskey/drive.py @@ -7,6 +7,9 @@ DriveFile, DriveFileSchema, ) +from .enum import ( + DriveFilesSortEnum, +) __all__ = ( "Misskey", @@ -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() diff --git a/misskey/enum/__init__.py b/misskey/enum/__init__.py index a96504f..483fe47 100644 --- a/misskey/enum/__init__.py +++ b/misskey/enum/__init__.py @@ -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 diff --git a/misskey/enum/drive_files_sort.py b/misskey/enum/drive_files_sort.py new file mode 100644 index 0000000..90434fd --- /dev/null +++ b/misskey/enum/drive_files_sort.py @@ -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"