OapiRobotOrgIntelligentMessageSendRequest.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.robot.org.intelligent.message.send request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2021.04.28
  7. */
  8. class OapiRobotOrgIntelligentMessageSendRequest
  9. {
  10. /**
  11. * at人的userid列表,英文逗号分隔
  12. **/
  13. private $atUserIds;
  14. /**
  15. * 申请到的消息模板唯一标识符
  16. **/
  17. private $msgKey;
  18. /**
  19. * 消息模板中,变量本次替换的值
  20. **/
  21. private $msgParam;
  22. /**
  23. * 开放的群ID
  24. **/
  25. private $openConversationId;
  26. /**
  27. * 接收者userid列表,英文逗号分隔,不传表示全员接收
  28. **/
  29. private $receiverUserIds;
  30. private $apiParas = array();
  31. public function setAtUserIds($atUserIds)
  32. {
  33. $this->atUserIds = $atUserIds;
  34. $this->apiParas["at_user_ids"] = $atUserIds;
  35. }
  36. public function getAtUserIds()
  37. {
  38. return $this->atUserIds;
  39. }
  40. public function setMsgKey($msgKey)
  41. {
  42. $this->msgKey = $msgKey;
  43. $this->apiParas["msg_key"] = $msgKey;
  44. }
  45. public function getMsgKey()
  46. {
  47. return $this->msgKey;
  48. }
  49. public function setMsgParam($msgParam)
  50. {
  51. $this->msgParam = $msgParam;
  52. $this->apiParas["msg_param"] = $msgParam;
  53. }
  54. public function getMsgParam()
  55. {
  56. return $this->msgParam;
  57. }
  58. public function setOpenConversationId($openConversationId)
  59. {
  60. $this->openConversationId = $openConversationId;
  61. $this->apiParas["open_conversation_id"] = $openConversationId;
  62. }
  63. public function getOpenConversationId()
  64. {
  65. return $this->openConversationId;
  66. }
  67. public function setReceiverUserIds($receiverUserIds)
  68. {
  69. $this->receiverUserIds = $receiverUserIds;
  70. $this->apiParas["receiver_user_ids"] = $receiverUserIds;
  71. }
  72. public function getReceiverUserIds()
  73. {
  74. return $this->receiverUserIds;
  75. }
  76. public function getApiMethodName()
  77. {
  78. return "dingtalk.oapi.robot.org.intelligent.message.send";
  79. }
  80. public function getApiParas()
  81. {
  82. return $this->apiParas;
  83. }
  84. public function check()
  85. {
  86. RequestCheckUtil::checkMaxListSize($this->atUserIds,999,"atUserIds");
  87. RequestCheckUtil::checkNotNull($this->msgKey,"msgKey");
  88. RequestCheckUtil::checkNotNull($this->msgParam,"msgParam");
  89. RequestCheckUtil::checkNotNull($this->openConversationId,"openConversationId");
  90. RequestCheckUtil::checkMaxListSize($this->receiverUserIds,999,"receiverUserIds");
  91. }
  92. public function putOtherTextParam($key, $value) {
  93. $this->apiParas[$key] = $value;
  94. $this->$key = $value;
  95. }
  96. }