price.py 665 B

1234567891011121314151617181920212223242526
  1. from typing import TYPE_CHECKING, Optional
  2. from yandex_music import YandexMusicModel
  3. from yandex_music.utils import model
  4. if TYPE_CHECKING:
  5. from yandex_music import ClientType
  6. @model
  7. class Price(YandexMusicModel):
  8. """Класс, представляющий цену.
  9. Attributes:
  10. amount (:obj:`int`): Количество единиц.
  11. currency (:obj:`str`): Валюта.
  12. client (:obj:`yandex_music.Client`, optional): Клиент Yandex Music.
  13. """
  14. amount: int
  15. currency: str
  16. client: Optional['ClientType'] = None
  17. def __post_init__(self) -> None:
  18. self._id_attrs = (self.amount, self.currency)