TaobaoTopAuthTokenCreateRequest.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System.Text.Json.Serialization;
  2. using System.Collections.Generic;
  3. using Topsdk.Util;
  4. namespace Topsdk.Top.Ability304.Request;
  5. public class TaobaoTopAuthTokenCreateRequest : AbstractTopApiRequest
  6. {
  7. /*
  8. 授权code,grantType==authorization_code 时需要
  9. */
  10. private string? code;
  11. /*
  12. 非必填,与生成code的uuid配对,使用方式参考文档
  13. */
  14. private string? uuid;
  15. [JsonPropertyName("code")]
  16. public string? Code
  17. {
  18. get => code;
  19. set => this.code = value;
  20. }
  21. [JsonPropertyName("uuid")]
  22. public string? Uuid
  23. {
  24. get => uuid;
  25. set => this.uuid = value;
  26. }
  27. public override IDictionary<string, string> ToRequestParam()
  28. {
  29. IDictionary<string, string> requestParam = new Dictionary<string, string>();
  30. if(this.code != null)
  31. {
  32. requestParam.Add("code",TopUtils.ConvertBasicType(this.code));
  33. }
  34. if(this.uuid != null)
  35. {
  36. requestParam.Add("uuid",TopUtils.ConvertBasicType(this.uuid));
  37. }
  38. return requestParam;
  39. }
  40. public override IDictionary<string, TopFileItem> ToFileParam()
  41. {
  42. IDictionary<string, TopFileItem> fileParam = new Dictionary<string, TopFileItem>();
  43. return fileParam;
  44. }
  45. public override string GetApiCode()
  46. {
  47. return "taobao.top.auth.token.create";
  48. }
  49. }