Exemplo n.º 1
0
 /// <summary>
 /// Instantiates an immutable instance of a single successful token result, allowing the user to pass in the time the token was retrieved at.
 /// </summary>
 /// <param name="newTokenResponse"></param>
 /// <param name="tokenRetrievedAt"></param>
 public SuccessfulTokenResult(
     NewTokenResponse newTokenResponse,
     DateTime?tokenRetrievedAt)
 {
     TokenResponse  = newTokenResponse ?? throw new ArgumentNullException(nameof(newTokenResponse));
     TokenExpiresAt = (tokenRetrievedAt ?? DateTime.Now) + TimeSpan.FromMinutes(TokenResponse.ExpiresIn);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Instantiates an immutable instance of a single successful token result.
 /// </summary>
 /// <param name="newTokenResponse"></param>
 public SuccessfulTokenResult(
     NewTokenResponse newTokenResponse) : this(newTokenResponse, null)
 {
 }