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

22 lines
549 B
C#
Raw Normal View History

2020-05-14 22:26:40 +01:00
using System;
2020-05-15 19:06:24 +01:00
using System.Collections.Generic;
namespace SpotifyAPI.Web
{
2020-05-15 19:06:24 +01:00
public class AuthorizationCodeRefreshResponse
{
public string AccessToken { get; set; }
public string TokenType { get; set; }
public int ExpiresIn { get; set; }
2020-05-15 19:06:24 +01:00
public string Scope { get; set; }
2020-05-14 22:26:40 +01:00
/// <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; }
}
}