OAuthToken

class yandex_music.device_auth.token.OAuthToken

Класс, представляющий OAuth-токен, полученный через Device Flow.

access_token

OAuth-токен доступа.

Type:

str

refresh_token

Токен для обновления access_token.

Type:

str, optional

expires_in

Срок жизни access_token в секундах.

Type:

int, optional

token_type

Тип токена (обычно bearer).

Type:

str, optional

client

Клиент Yandex Music.

Type:

yandex_music.Client, optional

classmethod de_json(data, client)

Десериализация объекта.

Parameters:
  • data (dict) – Поля и значения десериализуемого объекта.

  • client (yandex_music.Client, optional) – Клиент Yandex Music.

Returns:

OAuth-токен.

Return type:

yandex_music.OAuthToken | None