Добавлены тайп хинты в соответствии с документацией для следуюшщих классов: YandexMusicObject, Cover, Captcha, DownloadInfo, Experiments, Icon, InvocationInfo, Pager, PermissionAlerts, PromoCodeStatus, Settings, TrackShort, TracksList, Video #120
2019-12-24 16:17:04 +09:00
|
|
|
|
from typing import TYPE_CHECKING, Optional
|
|
|
|
|
|
|
|
|
|
if TYPE_CHECKING:
|
|
|
|
|
from yandex_music import Client
|
|
|
|
|
|
2019-05-10 00:28:46 +09:00
|
|
|
|
from yandex_music import YandexMusicObject
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class InvocationInfo(YandexMusicObject):
|
2020-01-26 08:55:56 +09:00
|
|
|
|
"""Класс, представляющий информацию о запросе.
|
2019-07-05 02:21:54 +09:00
|
|
|
|
|
|
|
|
|
Attributes:
|
|
|
|
|
hostname (:obj:`str`): Имя удалённого сервера.
|
|
|
|
|
req_id (:obj:`str`): Номер запроса.
|
|
|
|
|
exec_duration_millis (:obj:`str`): Время выполнения в миллисекундах.
|
|
|
|
|
client (:obj:`yandex_music.Client`): Объект класса :class:`yandex_music.Client` представляющий клиент Yandex
|
|
|
|
|
Music.
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
hostname (:obj:`str`): Имя удалённого сервера.
|
|
|
|
|
req_id (:obj:`str`): Номер запроса.
|
|
|
|
|
exec_duration_millis (:obj:`str`, optional): Время выполнения в миллисекундах.
|
|
|
|
|
client (:obj:`yandex_music.Client`, optional): Объект класса :class:`yandex_music.Client` представляющий клиент
|
|
|
|
|
Yandex Music.
|
|
|
|
|
**kwargs: Произвольные ключевые аргументы полученные от API.
|
|
|
|
|
"""
|
|
|
|
|
|
2019-05-10 00:28:46 +09:00
|
|
|
|
def __init__(self,
|
Добавлены тайп хинты в соответствии с документацией для следуюшщих классов: YandexMusicObject, Cover, Captcha, DownloadInfo, Experiments, Icon, InvocationInfo, Pager, PermissionAlerts, PromoCodeStatus, Settings, TrackShort, TracksList, Video #120
2019-12-24 16:17:04 +09:00
|
|
|
|
hostname: str,
|
|
|
|
|
req_id: str,
|
2019-12-28 22:25:09 +09:00
|
|
|
|
exec_duration_millis: Optional[int] = None,
|
Добавлены тайп хинты в соответствии с документацией для следуюшщих классов: YandexMusicObject, Cover, Captcha, DownloadInfo, Experiments, Icon, InvocationInfo, Pager, PermissionAlerts, PromoCodeStatus, Settings, TrackShort, TracksList, Video #120
2019-12-24 16:17:04 +09:00
|
|
|
|
client: Optional['Client'] = None,
|
2019-05-10 00:28:46 +09:00
|
|
|
|
**kwargs):
|
|
|
|
|
self.hostname = hostname
|
|
|
|
|
self.req_id = req_id
|
2019-05-16 21:45:25 +09:00
|
|
|
|
|
New supported objects: Album, CaseForms, Label, Library, MadeFor, Major, Normalization, PlayCounter, Playlist, Track, TrackPosition, TrackShort, User
The following methods are wrapped:
- albums;
- playlists/list;
- users/{user_id}/playlists/list;
- tracks;
- users/{user_id}/likes/tracks.
Added property to get full track ID
Cover received more optional fields
Ability to pass arguments to the request
Removed unnecessary type conversions
2019-05-13 02:39:12 +09:00
|
|
|
|
self.exec_duration_millis = exec_duration_millis
|
2019-05-10 00:28:46 +09:00
|
|
|
|
|
|
|
|
|
self.client = client
|
Добавлены основные тесты для следующий классов: Account, CaseForms, Cover, DownloadInfo, Enum, InvocationInfo, Lyrics, MadeFor, Permissions, PersonalPlaylistsData, PlayContextsData, Promotion, RotorSettings, Subsription,
Исправлены фикстуры и сравнения для вышеперечисленных классов.
Починен conftest.py
2019-11-08 09:30:15 +09:00
|
|
|
|
self._id_attrs = (self.hostname, self.req_id)
|
2019-05-10 00:28:46 +09:00
|
|
|
|
|
|
|
|
|
@classmethod
|
Добавлены тайп хинты в соответствии с документацией для следуюшщих классов: YandexMusicObject, Cover, Captcha, DownloadInfo, Experiments, Icon, InvocationInfo, Pager, PermissionAlerts, PromoCodeStatus, Settings, TrackShort, TracksList, Video #120
2019-12-24 16:17:04 +09:00
|
|
|
|
def de_json(cls, data: dict, client: 'Client') -> Optional['InvocationInfo']:
|
2019-07-05 02:21:54 +09:00
|
|
|
|
"""Десериализация объекта.
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
data (:obj:`dict`): Поля и значения десериализуемого объекта.
|
|
|
|
|
client (:obj:`yandex_music.Client`): Объект класса :class:`yandex_music.Client` представляющий клиент Yandex
|
|
|
|
|
Music.
|
|
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
:obj:`yandex_music.InvocationInfo`: Объект класса :class:`yandex_music.InvocationInfo`.
|
|
|
|
|
"""
|
2019-05-10 00:28:46 +09:00
|
|
|
|
if not data:
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
data = super(InvocationInfo, cls).de_json(data, client)
|
|
|
|
|
|
|
|
|
|
return cls(client=client, **data)
|