OpenmallTradeShipaddressUpdateRequest.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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.openmall.trade.shipaddress.update
  8. /// </summary>
  9. public class OpenmallTradeShipaddressUpdateRequest : BaseTopRequest<Top.Api.Response.OpenmallTradeShipaddressUpdateResponse>
  10. {
  11. /// <summary>
  12. /// 媒体渠道,代表分销者的身份,签约支付宝代扣的渠道商淘宝账号nick
  13. /// </summary>
  14. public string Distributor { get; set; }
  15. /// <summary>
  16. /// 收货地址。最大长度为228个字节。
  17. /// </summary>
  18. public string ReceiverAddress { get; set; }
  19. /// <summary>
  20. /// 城市。最大长度为32个字节。如:杭州
  21. /// </summary>
  22. public string ReceiverCity { get; set; }
  23. /// <summary>
  24. /// 区/县。最大长度为32个字节。如:西湖区
  25. /// </summary>
  26. public string ReceiverDistrict { get; set; }
  27. /// <summary>
  28. /// 移动电话。最大长度为11个字节。
  29. /// </summary>
  30. public string ReceiverMobile { get; set; }
  31. /// <summary>
  32. /// 收货人全名。最大长度为50个字节。
  33. /// </summary>
  34. public string ReceiverName { get; set; }
  35. /// <summary>
  36. /// 固定电话。最大长度为30个字节。
  37. /// </summary>
  38. public string ReceiverPhone { get; set; }
  39. /// <summary>
  40. /// 省份。最大长度为32个字节。如:浙江
  41. /// </summary>
  42. public string ReceiverState { get; set; }
  43. /// <summary>
  44. /// 6位数字的邮编
  45. /// </summary>
  46. public string ReceiverZip { get; set; }
  47. /// <summary>
  48. /// 淘宝订单号
  49. /// </summary>
  50. public Nullable<long> Tid { get; set; }
  51. #region ITopRequest Members
  52. public override string GetApiName()
  53. {
  54. return "taobao.openmall.trade.shipaddress.update";
  55. }
  56. public override IDictionary<string, string> GetParameters()
  57. {
  58. TopDictionary parameters = new TopDictionary();
  59. parameters.Add("distributor", this.Distributor);
  60. parameters.Add("receiver_address", this.ReceiverAddress);
  61. parameters.Add("receiver_city", this.ReceiverCity);
  62. parameters.Add("receiver_district", this.ReceiverDistrict);
  63. parameters.Add("receiver_mobile", this.ReceiverMobile);
  64. parameters.Add("receiver_name", this.ReceiverName);
  65. parameters.Add("receiver_phone", this.ReceiverPhone);
  66. parameters.Add("receiver_state", this.ReceiverState);
  67. parameters.Add("receiver_zip", this.ReceiverZip);
  68. parameters.Add("tid", this.Tid);
  69. if (this.otherParams != null)
  70. {
  71. parameters.AddAll(this.otherParams);
  72. }
  73. return parameters;
  74. }
  75. public override void Validate()
  76. {
  77. RequestValidator.ValidateRequired("distributor", this.Distributor);
  78. RequestValidator.ValidateRequired("receiver_address", this.ReceiverAddress);
  79. RequestValidator.ValidateMaxLength("receiver_address", this.ReceiverAddress, 228);
  80. RequestValidator.ValidateRequired("receiver_city", this.ReceiverCity);
  81. RequestValidator.ValidateMaxLength("receiver_city", this.ReceiverCity, 32);
  82. RequestValidator.ValidateRequired("receiver_district", this.ReceiverDistrict);
  83. RequestValidator.ValidateMaxLength("receiver_district", this.ReceiverDistrict, 32);
  84. RequestValidator.ValidateRequired("receiver_mobile", this.ReceiverMobile);
  85. RequestValidator.ValidateMaxLength("receiver_mobile", this.ReceiverMobile, 11);
  86. RequestValidator.ValidateRequired("receiver_name", this.ReceiverName);
  87. RequestValidator.ValidateMaxLength("receiver_name", this.ReceiverName, 50);
  88. RequestValidator.ValidateMaxLength("receiver_phone", this.ReceiverPhone, 30);
  89. RequestValidator.ValidateRequired("receiver_state", this.ReceiverState);
  90. RequestValidator.ValidateMaxLength("receiver_state", this.ReceiverState, 32);
  91. RequestValidator.ValidateRequired("tid", this.Tid);
  92. }
  93. #endregion
  94. }
  95. }