init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,10 @@
|
|||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Client.ClientBase.Response
|
||||
{
|
||||
internal class GetTokenFailureResponse
|
||||
{
|
||||
[JsonProperty("error")]
|
||||
public string Error { get; set; }
|
||||
}
|
||||
}
|
|
@ -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; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Client.ClientBase.Response
|
||||
{
|
||||
internal class GetTokenSuccessResponse
|
||||
{
|
||||
[JsonProperty(PropertyName = "access_token")]
|
||||
public string AccessToken { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "expires_in")]
|
||||
public int ExpiresIn { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "token_type")]
|
||||
public string TokenType { get; set; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue