2019-05-10 00:28:46 +09:00
|
|
|
from yandex_music import YandexMusicObject
|
|
|
|
|
|
|
|
|
|
|
|
class Subscription(YandexMusicObject):
|
|
|
|
def __init__(self,
|
|
|
|
auto_renewable,
|
|
|
|
can_start_trial,
|
|
|
|
mcdonalds,
|
|
|
|
client=None,
|
|
|
|
**kwargs):
|
|
|
|
self.auto_renewable = auto_renewable
|
|
|
|
self.can_start_trial = bool(can_start_trial)
|
|
|
|
self.mcdonalds = bool(mcdonalds)
|
|
|
|
|
|
|
|
self.client = client
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def de_json(cls, data, client):
|
|
|
|
if not data:
|
|
|
|
return None
|
|
|
|
|
|
|
|
data = super(Subscription, cls).de_json(data, client)
|
|
|
|
from yandex_music import AutoRenewable
|
2019-05-11 05:01:32 +09:00
|
|
|
data['auto_renewable'] = AutoRenewable.de_list(data.get('auto_renewable'), client)
|
2019-05-10 00:28:46 +09:00
|
|
|
|
|
|
|
return cls(client=client, **data)
|