feat: drive系に _get メソッドを追加

pull/109/head
yupix 7 months ago
parent 72052a2d7f
commit 7599d20230
No known key found for this signature in database
GPG Key ID: 2FF705F5C56D9C06

@ -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)

Loading…
Cancel
Save