Skip to content

Commit

Permalink
add missing access token json properties
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Apr 5, 2024
1 parent 8d70d0d commit 4f4438d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
25 changes: 18 additions & 7 deletions src/Sdkgen.Client/AccessToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,25 @@

namespace Sdkgen.Client;

using System.Text.Json.Serialization;

public class AccessToken
{
{
[JsonPropertyName("access_token")]
public string Token { get; set; }

[JsonPropertyName("token_type")]
public string TokenType { get; set; }

[JsonPropertyName("expires_in")]
public long ExpiresIn { get; set; }

[JsonPropertyName("refresh_token")]
public string RefreshToken { get; set; }

[JsonPropertyName("scope")]
public string Scope { get; set; }

public AccessToken(string token, string tokenType, long expiresIn, string refreshToken, string scope)
{
Token = token;
Expand All @@ -21,12 +38,6 @@ public AccessToken(string token, string tokenType, long expiresIn, string refres
Scope = scope;
}

public string Token { get; set; }
public string TokenType { get; set; }
public long ExpiresIn { get; set; }
public string RefreshToken { get; set; }
public string Scope { get; set; }

public bool HasRefreshToken()
{
return !String.IsNullOrEmpty(this.RefreshToken);
Expand Down
2 changes: 1 addition & 1 deletion src/Sdkgen.Client/Sdkgen.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PackageId>Sdkgen.Client</PackageId>
<PackageVersion>0.1.8</PackageVersion>
<PackageVersion>0.1.9</PackageVersion>
<Authors>chriskapp</Authors>
<Company>Apioo</Company>
<Description>SDKgen is a powerful code generator to automatically build client SDKs for your REST API</Description>
Expand Down

0 comments on commit 4f4438d

Please sign in to comment.