TopSecretGetRequest.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Collections.Generic;
  3. using Top.Api.Util;
  4. namespace Top.Api.Request
  5. {
  6. /// <summary>
  7. /// TOP API: taobao.top.secret.get
  8. /// </summary>
  9. public class TopSecretGetRequest : BaseTopRequest<Top.Api.Response.TopSecretGetResponse>
  10. {
  11. /// <summary>
  12. /// 自定义用户id
  13. /// </summary>
  14. public Nullable<long> CustomerUserId { get; set; }
  15. /// <summary>
  16. /// 伪随机数
  17. /// </summary>
  18. public string RandomNum { get; set; }
  19. /// <summary>
  20. /// 秘钥版本号
  21. /// </summary>
  22. public Nullable<long> SecretVersion { get; set; }
  23. #region ITopRequest Members
  24. public override string GetApiName()
  25. {
  26. return "taobao.top.secret.get";
  27. }
  28. public override IDictionary<string, string> GetParameters()
  29. {
  30. TopDictionary parameters = new TopDictionary();
  31. parameters.Add("customer_user_id", this.CustomerUserId);
  32. parameters.Add("random_num", this.RandomNum);
  33. parameters.Add("secret_version", this.SecretVersion);
  34. if (this.otherParams != null)
  35. {
  36. parameters.AddAll(this.otherParams);
  37. }
  38. return parameters;
  39. }
  40. public override void Validate()
  41. {
  42. RequestValidator.ValidateRequired("random_num", this.RandomNum);
  43. }
  44. #endregion
  45. }
  46. }