CloudpushNoticeAndroidRequest.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. /**
  3. * TOP API: taobao.cloudpush.notice.android request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2015.06.08
  7. */
  8. class CloudpushNoticeAndroidRequest
  9. {
  10. /**
  11. * 通知摘要
  12. **/
  13. private $summary;
  14. /**
  15. * 推送目标: device:推送给设备; account:推送给指定帐号,all: 推送给全部
  16. **/
  17. private $target;
  18. /**
  19. * 根据Target来设定,如Target=device, 则对应的值为 设备id1,设备id2. 多个值使用逗号分隔
  20. **/
  21. private $targetValue;
  22. /**
  23. * 通知的标题.
  24. **/
  25. private $title;
  26. private $apiParas = array();
  27. public function setSummary($summary)
  28. {
  29. $this->summary = $summary;
  30. $this->apiParas["summary"] = $summary;
  31. }
  32. public function getSummary()
  33. {
  34. return $this->summary;
  35. }
  36. public function setTarget($target)
  37. {
  38. $this->target = $target;
  39. $this->apiParas["target"] = $target;
  40. }
  41. public function getTarget()
  42. {
  43. return $this->target;
  44. }
  45. public function setTargetValue($targetValue)
  46. {
  47. $this->targetValue = $targetValue;
  48. $this->apiParas["target_value"] = $targetValue;
  49. }
  50. public function getTargetValue()
  51. {
  52. return $this->targetValue;
  53. }
  54. public function setTitle($title)
  55. {
  56. $this->title = $title;
  57. $this->apiParas["title"] = $title;
  58. }
  59. public function getTitle()
  60. {
  61. return $this->title;
  62. }
  63. public function getApiMethodName()
  64. {
  65. return "taobao.cloudpush.notice.android";
  66. }
  67. public function getApiParas()
  68. {
  69. return $this->apiParas;
  70. }
  71. public function check()
  72. {
  73. RequestCheckUtil::checkNotNull($this->summary,"summary");
  74. RequestCheckUtil::checkNotNull($this->target,"target");
  75. RequestCheckUtil::checkNotNull($this->targetValue,"targetValue");
  76. RequestCheckUtil::checkNotNull($this->title,"title");
  77. }
  78. public function putOtherTextParam($key, $value) {
  79. $this->apiParas[$key] = $value;
  80. $this->$key = $value;
  81. }
  82. }