TopAuthTokenCreateRequest.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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.auth.token.create
  8. /// </summary>
  9. public class TopAuthTokenCreateRequest : BaseTopRequest<Top.Api.Response.TopAuthTokenCreateResponse>
  10. {
  11. /// <summary>
  12. /// 授权code,grantType==authorization_code 时需要
  13. /// </summary>
  14. public string Code { get; set; }
  15. /// <summary>
  16. /// 非必填,与生成code的uuid配对,使用方式参考文档
  17. /// </summary>
  18. public string Uuid { get; set; }
  19. #region ITopRequest Members
  20. public override string GetApiName()
  21. {
  22. return "taobao.top.auth.token.create";
  23. }
  24. public override IDictionary<string, string> GetParameters()
  25. {
  26. TopDictionary parameters = new TopDictionary();
  27. parameters.Add("code", this.Code);
  28. parameters.Add("uuid", this.Uuid);
  29. if (this.otherParams != null)
  30. {
  31. parameters.AddAll(this.otherParams);
  32. }
  33. return parameters;
  34. }
  35. public override void Validate()
  36. {
  37. RequestValidator.ValidateRequired("code", this.Code);
  38. }
  39. #endregion
  40. }
  41. }