Spotify.NET/SpotifyAPI.Web/Models/Response/AuthorizationCodeTokenResponse.cs
Tim Ittermann a9c4aba7fa
Add interfaces for tokens (#499)
* Add interfaces for tokens

* Delete UpgradeLog.htm

* Changed Namespace

Co-authored-by: Jonas Dellinger <jonas@dellinger.dev>
2020-08-26 15:38:00 +02:00

24 lines
660 B
C#

using System;
using System.Collections.Generic;
namespace SpotifyAPI.Web
{
public class AuthorizationCodeTokenResponse: IRefreshableToken
{
public string AccessToken { get; set; } = default!;
public string TokenType { get; set; } = default!;
public int ExpiresIn { get; set; }
public string Scope { get; set; } = default!;
public string RefreshToken { get; set; } = default!;
/// <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; }
}
}