TaobaoOpenAccountTokenApplyRequest.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. using System.Text.Json.Serialization;
  2. using System.Collections.Generic;
  3. using Topsdk.Util;
  4. namespace Topsdk.Top.Ability865.Request;
  5. public class TaobaoOpenAccountTokenApplyRequest : AbstractTopApiRequest
  6. {
  7. /*
  8. isv自己账号的唯一id
  9. */
  10. private string? isvAccountId;
  11. /*
  12. ISV APP的登录态时长单位是秒
  13. */
  14. private long? loginStateExpireIn;
  15. /*
  16. open account id
  17. */
  18. private long? openAccountId;
  19. /*
  20. 时间戳单位是毫秒
  21. */
  22. private long? tokenTimestamp;
  23. /*
  24. 用于防重放的唯一id
  25. */
  26. private string? uuid;
  27. /*
  28. 用于透传一些业务附加参数
  29. */
  30. private IDictionary<string,object>? ext;
  31. [JsonPropertyName("isv_account_id")]
  32. public string? IsvAccountId
  33. {
  34. get => isvAccountId;
  35. set => this.isvAccountId = value;
  36. }
  37. [JsonPropertyName("login_state_expire_in")]
  38. public long? LoginStateExpireIn
  39. {
  40. get => loginStateExpireIn;
  41. set => this.loginStateExpireIn = value;
  42. }
  43. [JsonPropertyName("open_account_id")]
  44. public long? OpenAccountId
  45. {
  46. get => openAccountId;
  47. set => this.openAccountId = value;
  48. }
  49. [JsonPropertyName("token_timestamp")]
  50. public long? TokenTimestamp
  51. {
  52. get => tokenTimestamp;
  53. set => this.tokenTimestamp = value;
  54. }
  55. [JsonPropertyName("uuid")]
  56. public string? Uuid
  57. {
  58. get => uuid;
  59. set => this.uuid = value;
  60. }
  61. [JsonPropertyName("ext")]
  62. public IDictionary<string,object>? Ext
  63. {
  64. get => ext;
  65. set => this.ext = value;
  66. }
  67. public override IDictionary<string, string> ToRequestParam()
  68. {
  69. IDictionary<string, string> requestParam = new Dictionary<string, string>();
  70. if(this.isvAccountId != null)
  71. {
  72. requestParam.Add("isv_account_id",TopUtils.ConvertBasicType(this.isvAccountId));
  73. }
  74. if(this.loginStateExpireIn != null)
  75. {
  76. requestParam.Add("login_state_expire_in",TopUtils.ConvertBasicType(this.loginStateExpireIn));
  77. }
  78. if(this.openAccountId != null)
  79. {
  80. requestParam.Add("open_account_id",TopUtils.ConvertBasicType(this.openAccountId));
  81. }
  82. if(this.tokenTimestamp != null)
  83. {
  84. requestParam.Add("token_timestamp",TopUtils.ConvertBasicType(this.tokenTimestamp));
  85. }
  86. if(this.uuid != null)
  87. {
  88. requestParam.Add("uuid",TopUtils.ConvertBasicType(this.uuid));
  89. }
  90. if(this.ext != null)
  91. {
  92. requestParam.Add("ext",TopUtils.ConvertStruct(this.ext));
  93. }
  94. return requestParam;
  95. }
  96. public override IDictionary<string, TopFileItem> ToFileParam()
  97. {
  98. IDictionary<string, TopFileItem> fileParam = new Dictionary<string, TopFileItem>();
  99. return fileParam;
  100. }
  101. public override string GetApiCode()
  102. {
  103. return "taobao.open.account.token.apply";
  104. }
  105. }