mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00
31 lines
835 B
Dart
31 lines
835 B
Dart
class SpotifySpotubeCredentials {
|
|
String clientId;
|
|
String accessToken;
|
|
DateTime expiration;
|
|
bool isAnonymous;
|
|
|
|
SpotifySpotubeCredentials({
|
|
required this.clientId,
|
|
required this.accessToken,
|
|
required this.expiration,
|
|
required this.isAnonymous,
|
|
});
|
|
|
|
SpotifySpotubeCredentials.fromJson(Map<String, dynamic> json)
|
|
: clientId = json['clientId'],
|
|
accessToken = json['accessToken'],
|
|
expiration = DateTime.fromMillisecondsSinceEpoch(
|
|
json['accessTokenExpirationTimestampMs'],
|
|
),
|
|
isAnonymous = json['isAnonymous'];
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return <String, dynamic>{
|
|
'clientId': clientId,
|
|
'accessToken': accessToken,
|
|
'accessTokenExpirationTimestampMs': expiration.millisecondsSinceEpoch,
|
|
'isAnonymous': isAnonymous,
|
|
};
|
|
}
|
|
}
|