init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,46 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Client.ClientBase.Response
|
||||
{
|
||||
public class GetTokenResponse : IResponse
|
||||
{
|
||||
public GetTokenResponse() { }
|
||||
|
||||
public GetTokenResponse(string error)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(error))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(error));
|
||||
}
|
||||
|
||||
Error = error;
|
||||
}
|
||||
|
||||
public GetTokenResponse(string accessToken, int expiresIn)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(accessToken))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(accessToken));
|
||||
}
|
||||
|
||||
if (expiresIn < 1)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(expiresIn));
|
||||
}
|
||||
|
||||
IsSuccess = true;
|
||||
AccessToken = accessToken;
|
||||
ExpiresIn = expiresIn;
|
||||
}
|
||||
|
||||
public bool IsSuccess { get; }
|
||||
|
||||
public string AccessToken { get; }
|
||||
|
||||
public int ExpiresIn { get; }
|
||||
|
||||
public string Error { get; }
|
||||
|
||||
public bool TryAgain { get; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue