TaobaoTbkScInvitecodeGetRequest.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. using System.Text.Json.Serialization;
  2. using System.Collections.Generic;
  3. using Topsdk.Util;
  4. namespace Topsdk.Top.Ability425.Request;
  5. public class TaobaoTbkScInvitecodeGetRequest : AbstractTopApiRequest
  6. {
  7. /*
  8. 渠道关系ID
  9. */
  10. private long? relationId;
  11. /*
  12. 渠道推广的物料类型
  13. */
  14. private string? relationApp;
  15. /*
  16. 邀请码类型,1 - 渠道邀请,2 - 渠道裂变,3 -会员邀请
  17. */
  18. private long? codeType;
  19. [JsonPropertyName("relation_id")]
  20. public long? RelationId
  21. {
  22. get => relationId;
  23. set => this.relationId = value;
  24. }
  25. [JsonPropertyName("relation_app")]
  26. public string? RelationApp
  27. {
  28. get => relationApp;
  29. set => this.relationApp = value;
  30. }
  31. [JsonPropertyName("code_type")]
  32. public long? CodeType
  33. {
  34. get => codeType;
  35. set => this.codeType = value;
  36. }
  37. public override IDictionary<string, string> ToRequestParam()
  38. {
  39. IDictionary<string, string> requestParam = new Dictionary<string, string>();
  40. if(this.relationId != null)
  41. {
  42. requestParam.Add("relation_id",TopUtils.ConvertBasicType(this.relationId));
  43. }
  44. if(this.relationApp != null)
  45. {
  46. requestParam.Add("relation_app",TopUtils.ConvertBasicType(this.relationApp));
  47. }
  48. if(this.codeType != null)
  49. {
  50. requestParam.Add("code_type",TopUtils.ConvertBasicType(this.codeType));
  51. }
  52. return requestParam;
  53. }
  54. public override IDictionary<string, TopFileItem> ToFileParam()
  55. {
  56. IDictionary<string, TopFileItem> fileParam = new Dictionary<string, TopFileItem>();
  57. return fileParam;
  58. }
  59. public override string GetApiCode()
  60. {
  61. return "taobao.tbk.sc.invitecode.get";
  62. }
  63. }