OapiRobotMessageSendorggroupRequest.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.robot.message.sendorggroup request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2022.08.26
  7. */
  8. class OapiRobotMessageSendorggroupRequest
  9. {
  10. /**
  11. * 申请到的企业机器人唯一标识符
  12. **/
  13. private $chatbotId;
  14. /**
  15. * 申请到的消息模板唯一标识符
  16. **/
  17. private $msgKey;
  18. /**
  19. * 消息模板中,变量本次替换的值
  20. **/
  21. private $msgParam;
  22. /**
  23. * 开放的群ID
  24. **/
  25. private $openConversationId;
  26. /**
  27. * 机器人webhook中的access_token参数,与chatbot_id+open_conversation_id 只需要填1种
  28. **/
  29. private $token;
  30. private $apiParas = array();
  31. public function setChatbotId($chatbotId)
  32. {
  33. $this->chatbotId = $chatbotId;
  34. $this->apiParas["chatbot_id"] = $chatbotId;
  35. }
  36. public function getChatbotId()
  37. {
  38. return $this->chatbotId;
  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 setToken($token)
  68. {
  69. $this->token = $token;
  70. $this->apiParas["token"] = $token;
  71. }
  72. public function getToken()
  73. {
  74. return $this->token;
  75. }
  76. public function getApiMethodName()
  77. {
  78. return "dingtalk.oapi.robot.message.sendorggroup";
  79. }
  80. public function getApiParas()
  81. {
  82. return $this->apiParas;
  83. }
  84. public function check()
  85. {
  86. RequestCheckUtil::checkNotNull($this->msgKey,"msgKey");
  87. RequestCheckUtil::checkNotNull($this->msgParam,"msgParam");
  88. }
  89. public function putOtherTextParam($key, $value) {
  90. $this->apiParas[$key] = $value;
  91. $this->$key = $value;
  92. }
  93. }