OapiMessageCorpconversationAsyncsendV2Request.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.message.corpconversation.asyncsend_v2 request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2022.09.23
  7. */
  8. class OapiMessageCorpconversationAsyncsendV2Request
  9. {
  10. /**
  11. * 微应用的id
  12. **/
  13. private $agentId;
  14. /**
  15. * 接收者的部门id列表
  16. **/
  17. private $deptIdList;
  18. /**
  19. * 是否开启id转译,默认false。仅第三方应用需要用到,企业内部应用可以忽略
  20. **/
  21. private $enableIdTrans;
  22. /**
  23. * 消息体,具体见文档
  24. **/
  25. private $msg;
  26. /**
  27. * 是否发送给企业全部用户
  28. **/
  29. private $toAllUser;
  30. /**
  31. * 接收者的用户userid列表
  32. **/
  33. private $useridList;
  34. private $apiParas = array();
  35. public function setAgentId($agentId)
  36. {
  37. $this->agentId = $agentId;
  38. $this->apiParas["agent_id"] = $agentId;
  39. }
  40. public function getAgentId()
  41. {
  42. return $this->agentId;
  43. }
  44. public function setDeptIdList($deptIdList)
  45. {
  46. $this->deptIdList = $deptIdList;
  47. $this->apiParas["dept_id_list"] = $deptIdList;
  48. }
  49. public function getDeptIdList()
  50. {
  51. return $this->deptIdList;
  52. }
  53. public function setEnableIdTrans($enableIdTrans)
  54. {
  55. $this->enableIdTrans = $enableIdTrans;
  56. $this->apiParas["enable_id_trans"] = $enableIdTrans;
  57. }
  58. public function getEnableIdTrans()
  59. {
  60. return $this->enableIdTrans;
  61. }
  62. public function setMsg($msg)
  63. {
  64. $this->msg = $msg;
  65. $this->apiParas["msg"] = $msg;
  66. }
  67. public function getMsg()
  68. {
  69. return $this->msg;
  70. }
  71. public function setToAllUser($toAllUser)
  72. {
  73. $this->toAllUser = $toAllUser;
  74. $this->apiParas["to_all_user"] = $toAllUser;
  75. }
  76. public function getToAllUser()
  77. {
  78. return $this->toAllUser;
  79. }
  80. public function setUseridList($useridList)
  81. {
  82. $this->useridList = $useridList;
  83. $this->apiParas["userid_list"] = $useridList;
  84. }
  85. public function getUseridList()
  86. {
  87. return $this->useridList;
  88. }
  89. public function getApiMethodName()
  90. {
  91. return "dingtalk.oapi.message.corpconversation.asyncsend_v2";
  92. }
  93. public function getApiParas()
  94. {
  95. return $this->apiParas;
  96. }
  97. public function check()
  98. {
  99. RequestCheckUtil::checkNotNull($this->agentId,"agentId");
  100. RequestCheckUtil::checkMaxListSize($this->deptIdList,500,"deptIdList");
  101. RequestCheckUtil::checkMaxListSize($this->useridList,5000,"useridList");
  102. }
  103. public function putOtherTextParam($key, $value) {
  104. $this->apiParas[$key] = $value;
  105. $this->$key = $value;
  106. }
  107. }