Spotify.NET/SpotifyAPI.Web/Models/Response/ClientCredentialsTokenResponse.cs

20 lines
499 B
C#

using System;
namespace SpotifyAPI.Web
{
public class ClientCredentialsTokenResponse
{
public string AccessToken { get; set; } = default!;
public string TokenType { get; set; } = default!;
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; }
}
}