2019-12-27 18:14:51 +09:00
|
|
|
from typing import TYPE_CHECKING, Optional
|
|
|
|
|
2020-01-26 21:19:22 +09:00
|
|
|
from yandex_music import YandexMusicObject
|
2021-09-19 22:47:19 +09:00
|
|
|
from yandex_music.utils import model
|
2020-01-26 21:19:22 +09:00
|
|
|
|
2019-12-27 18:14:51 +09:00
|
|
|
if TYPE_CHECKING:
|
|
|
|
from yandex_music import Client
|
|
|
|
|
2019-11-24 07:51:45 +09:00
|
|
|
|
2021-09-19 22:47:19 +09:00
|
|
|
@model
|
2019-11-24 07:51:45 +09:00
|
|
|
class PlaylistAbsence(YandexMusicObject):
|
2020-01-26 08:55:56 +09:00
|
|
|
"""Класс, представляющий причину отсутствия плейлиста.
|
2019-11-24 08:35:43 +09:00
|
|
|
|
|
|
|
Attributes:
|
|
|
|
kind (:obj:`int`): Уникальный идентификатор плейлиста.
|
|
|
|
reason (:obj:`str`): Причина отсутствия.
|
Удаление избыточной информации (#247)
Классы: Account, AutoRenewable, PassportPhone, Permissions, Plus, Price,
Product, Status, Subscription, UserSettings, Album, Label,
TrackPosition, Playlist
У всех классов изменено описание атрибута client
2020-03-22 04:49:20 +09:00
|
|
|
client (:obj:`yandex_music.Client`, optional): Клиент Yandex Music.
|
2019-11-24 08:35:43 +09:00
|
|
|
"""
|
|
|
|
|
2021-09-19 22:47:19 +09:00
|
|
|
kind: int
|
|
|
|
reason: str
|
|
|
|
client: Optional['Client'] = None
|
2019-11-24 07:51:45 +09:00
|
|
|
|
2021-09-19 22:47:19 +09:00
|
|
|
def __post_init__(self):
|
2019-11-24 07:51:45 +09:00
|
|
|
self._id_attrs = (self.kind, self.reason)
|
|
|
|
|
|
|
|
@classmethod
|
Добавлены тайп хинты для Block, BlockEntity, Char, CharItem, MixLink, PersonalPlaylistsData, PlayContext, PlayContextsData, Promotion, TrackId, TrackShortOld, AlbumsLikes, ArtistsLikes, PlaylistsLikes, CaseForms, MadeFor, PlayCounter, PlaylistAbsence, PlaylistId, User
2019-12-27 22:40:26 +09:00
|
|
|
def de_json(cls, data: dict, client: 'Client') -> Optional['PlaylistAbsence']:
|
2019-11-24 08:35:43 +09:00
|
|
|
"""Десериализация объекта.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
data (:obj:`dict`): Поля и значения десериализуемого объекта.
|
Удаление избыточной информации (#247)
Классы: Account, AutoRenewable, PassportPhone, Permissions, Plus, Price,
Product, Status, Subscription, UserSettings, Album, Label,
TrackPosition, Playlist
У всех классов изменено описание атрибута client
2020-03-22 04:49:20 +09:00
|
|
|
client (:obj:`yandex_music.Client`, optional): Клиент Yandex Music.
|
2019-11-24 08:35:43 +09:00
|
|
|
|
|
|
|
Returns:
|
2020-03-22 06:29:34 +09:00
|
|
|
:obj:`yandex_music.PlaylistAbsence`: Причина отсутствия плейлиста.
|
2019-11-24 08:35:43 +09:00
|
|
|
"""
|
2019-11-24 07:51:45 +09:00
|
|
|
if not data:
|
|
|
|
return None
|
|
|
|
|
|
|
|
data = super(PlaylistAbsence, cls).de_json(data, client)
|
|
|
|
|
|
|
|
return cls(client=client, **data)
|