2019-05-16 21:45:25 +09:00
|
|
|
from yandex_music import YandexMusicObject
|
2019-05-10 00:28:46 +09:00
|
|
|
|
|
|
|
|
|
|
|
class Status(YandexMusicObject):
|
|
|
|
def __init__(self,
|
|
|
|
account,
|
|
|
|
permissions,
|
|
|
|
cache_limit,
|
|
|
|
subscription,
|
|
|
|
subeditor,
|
|
|
|
subeditor_level,
|
|
|
|
plus,
|
2019-05-16 21:45:25 +09:00
|
|
|
default_email=None,
|
2019-05-10 00:28:46 +09:00
|
|
|
client=None,
|
|
|
|
**kwargs):
|
|
|
|
self.account = account
|
|
|
|
self.permissions = permissions
|
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.cache_limit = cache_limit
|
2019-05-10 00:28:46 +09:00
|
|
|
self.subscription = subscription
|
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.subeditor = subeditor
|
|
|
|
self.subeditor_level = subeditor_level
|
2019-05-10 00:28:46 +09:00
|
|
|
self.plus = plus
|
2019-05-16 21:45:25 +09:00
|
|
|
|
2019-05-10 00:28:46 +09:00
|
|
|
self.default_email = default_email
|
|
|
|
|
|
|
|
self.client = client
|
|
|
|
self._id_attrs = (self.account,)
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def de_json(cls, data, client):
|
|
|
|
if not data:
|
|
|
|
return None
|
|
|
|
|
|
|
|
data = super(Status, cls).de_json(data, client)
|
2019-05-16 21:45:25 +09:00
|
|
|
from yandex_music import Account, Permissions, Plus, Subscription
|
2019-05-11 05:01:32 +09:00
|
|
|
data['account'] = Account.de_json(data.get('account'), client)
|
|
|
|
data['permissions'] = Permissions.de_json(data.get('permissions'), client)
|
|
|
|
data['subscription'] = Subscription.de_json(data.get('subscription'), client)
|
|
|
|
data['plus'] = Plus.de_json(data.get('plus'), client)
|
2019-05-10 00:28:46 +09:00
|
|
|
|
|
|
|
return cls(client=client, **data)
|