From 7599d20230743e244e78a35067e7f5bd7879c08b Mon Sep 17 00:00:00 2001 From: yupix Date: Fri, 9 Feb 2024 08:59:39 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20drive=E7=B3=BB=E3=81=AB=20=5Fget=20?= =?UTF-8?q?=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mipac/models/drive.py | 45 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/mipac/models/drive.py b/mipac/models/drive.py index 224c405..3f1a2ec 100644 --- a/mipac/models/drive.py +++ b/mipac/models/drive.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any from mipac.models.lite.user import PartialUser from mipac.types.drive import IDriveStatus @@ -42,6 +42,17 @@ class DriveStatus: """ return self.__raw_drive_status["usage"] + def _get(self, key: str) -> Any | None: + """You can access the raw response data directly by specifying the key + + + Returns + ------- + Any | None + raw response data + """ + return self.__raw_drive_status.get(key) + class FileProperties: def __init__(self, raw_properties: IFileProperties) -> None: @@ -63,6 +74,16 @@ class FileProperties: def avg_color(self) -> str | None: return self.__raw_properties.get("avg_color") + def _get(self, key: str) -> Any | None: + """You can access the raw response data directly by specifying the key + + + Returns + ------- + Any | None + raw response data + """ + return self.__raw_properties.get(key) class Folder: def __init__(self, raw_folder: IFolder, client: ClientManager): @@ -101,6 +122,17 @@ class Folder: else None ) + def _get(self, key: str) -> Any | None: + """You can access the raw response data directly by specifying the key + + + Returns + ------- + Any | None + raw response data + """ + return self.__raw_folder.get(key) + @property def api(self) -> ClientFolderManager: return self.__client.drive._create_client_folder_manager(folder_id=self.id) @@ -189,6 +221,17 @@ class File: else None ) + def _get(self, key: str) -> Any | None: + """You can access the raw response data directly by specifying the key + + + Returns + ------- + Any | None + raw response data + """ + return self.__raw_file.get(key) + @property def api(self) -> ClientFileManager: return self.__client.drive._create_client_file_manager(file_id=self.id)