CloudpushMessageIosRequest.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * TOP API: taobao.cloudpush.message.ios request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2015.06.09
  7. */
  8. class CloudpushMessageIosRequest
  9. {
  10. /**
  11. * 发送的消息内容.
  12. **/
  13. private $body;
  14. /**
  15. * 推送目标: device:推送给设备; account:推送给指定帐号,all: 推送给全部
  16. **/
  17. private $target;
  18. /**
  19. * 根据Target来设定,如Target=device, 则对应的值为 设备id1,设备id2. 多个值使用逗号分隔
  20. **/
  21. private $targetValue;
  22. private $apiParas = array();
  23. public function setBody($body)
  24. {
  25. $this->body = $body;
  26. $this->apiParas["body"] = $body;
  27. }
  28. public function getBody()
  29. {
  30. return $this->body;
  31. }
  32. public function setTarget($target)
  33. {
  34. $this->target = $target;
  35. $this->apiParas["target"] = $target;
  36. }
  37. public function getTarget()
  38. {
  39. return $this->target;
  40. }
  41. public function setTargetValue($targetValue)
  42. {
  43. $this->targetValue = $targetValue;
  44. $this->apiParas["target_value"] = $targetValue;
  45. }
  46. public function getTargetValue()
  47. {
  48. return $this->targetValue;
  49. }
  50. public function getApiMethodName()
  51. {
  52. return "taobao.cloudpush.message.ios";
  53. }
  54. public function getApiParas()
  55. {
  56. return $this->apiParas;
  57. }
  58. public function check()
  59. {
  60. RequestCheckUtil::checkNotNull($this->body,"body");
  61. RequestCheckUtil::checkNotNull($this->target,"target");
  62. RequestCheckUtil::checkNotNull($this->targetValue,"targetValue");
  63. }
  64. public function putOtherTextParam($key, $value) {
  65. $this->apiParas[$key] = $value;
  66. $this->$key = $value;
  67. }
  68. }