TaobaoTopAuthTokenRefreshRequest.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System.Text.Json.Serialization;
  2. using System.Collections.Generic;
  3. using Topsdk.Util;
  4. namespace Topsdk.Top.Ability304.Request;
  5. public class TaobaoTopAuthTokenRefreshRequest : AbstractTopApiRequest
  6. {
  7. /*
  8. grantType==refresh_token 时需要
  9. */
  10. private string? refreshToken;
  11. [JsonPropertyName("refresh_token")]
  12. public string? RefreshToken
  13. {
  14. get => refreshToken;
  15. set => this.refreshToken = value;
  16. }
  17. public override IDictionary<string, string> ToRequestParam()
  18. {
  19. IDictionary<string, string> requestParam = new Dictionary<string, string>();
  20. if(this.refreshToken != null)
  21. {
  22. requestParam.Add("refresh_token",TopUtils.ConvertBasicType(this.refreshToken));
  23. }
  24. return requestParam;
  25. }
  26. public override IDictionary<string, TopFileItem> ToFileParam()
  27. {
  28. IDictionary<string, TopFileItem> fileParam = new Dictionary<string, TopFileItem>();
  29. return fileParam;
  30. }
  31. public override string GetApiCode()
  32. {
  33. return "taobao.top.auth.token.refresh";
  34. }
  35. }