Spotify.NET/SpotifyAPI.Web/Models/Response/Token.cs
2020-05-14 23:26:40 +02:00

19 lines
457 B
C#

using System;
namespace SpotifyAPI.Web
{
public class TokenResponse
{
public string AccessToken { get; set; }
public string TokenType { get; set; }
public int ExpiresIn { get; set; }
/// <summary>
/// Auto-Initalized to UTC Now
/// </summary>
/// <value></value>
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public bool IsExpired { get => CreatedAt.AddSeconds(ExpiresIn) <= DateTime.UtcNow; }
}
}