Skip to content

Commit

Permalink
πŸ”„ Rename TokenResponse to AccessTokenResponse
Browse files Browse the repository at this point in the history
- Renamed TokenResponse to AccessTokenResponse in ERNIE-Bot.SDK.Models namespace.
- Updated references to the renamed class in ERNIEBotClient.cs.
- Improved clarity and accuracy of the code.
  • Loading branch information
xbotter committed Feb 19, 2024
1 parent cc3da1e commit b6811dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ERNIE-Bot.SDK/ERNIEBotClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public async Task<string> GetAccessTokenAsync(CancellationToken cancellationToke

var webRequest = new HttpRequestMessage(HttpMethod.Post, url);
var response = await _client.SendAsync(webRequest, cancellationToken);
var accessToken = await ParseResponseAsync<TokenResponse>(response);
var accessToken = await ParseResponseAsync<AccessTokenResponse>(response);

if (string.IsNullOrWhiteSpace(accessToken.AccessToken))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace ERNIE_Bot.SDK.Models
/// <summary>
/// Access Token Response
/// </summary>
public class TokenResponse
public class AccessTokenResponse
{
[JsonPropertyName("access_token")]
public string AccessToken { get; set; } = string.Empty;
Expand Down

0 comments on commit b6811dd

Please sign in to comment.