CorpMessageCorpconversationAsyncsendbycodeRequest.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.corp.message.corpconversation.asyncsendbycode request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2019.07.03
  7. */
  8. class CorpMessageCorpconversationAsyncsendbycodeRequest
  9. {
  10. /**
  11. * 微应用的id
  12. **/
  13. private $agentId;
  14. /**
  15. * 用户操作产生的授权码
  16. **/
  17. private $code;
  18. /**
  19. * 接收者的部门id列表
  20. **/
  21. private $deptIdList;
  22. /**
  23. * 与msgtype对应的消息体,具体见文档
  24. **/
  25. private $msgcontent;
  26. /**
  27. * 消息类型,如text、file、oa等,具体见文档
  28. **/
  29. private $msgtype;
  30. /**
  31. * 是否发送给企业全部用户
  32. **/
  33. private $toAllUser;
  34. /**
  35. * 接收者的用户userid列表
  36. **/
  37. private $userIdList;
  38. private $apiParas = array();
  39. public function setAgentId($agentId)
  40. {
  41. $this->agentId = $agentId;
  42. $this->apiParas["agent_id"] = $agentId;
  43. }
  44. public function getAgentId()
  45. {
  46. return $this->agentId;
  47. }
  48. public function setCode($code)
  49. {
  50. $this->code = $code;
  51. $this->apiParas["code"] = $code;
  52. }
  53. public function getCode()
  54. {
  55. return $this->code;
  56. }
  57. public function setDeptIdList($deptIdList)
  58. {
  59. $this->deptIdList = $deptIdList;
  60. $this->apiParas["dept_id_list"] = $deptIdList;
  61. }
  62. public function getDeptIdList()
  63. {
  64. return $this->deptIdList;
  65. }
  66. public function setMsgcontent($msgcontent)
  67. {
  68. $this->msgcontent = $msgcontent;
  69. $this->apiParas["msgcontent"] = $msgcontent;
  70. }
  71. public function getMsgcontent()
  72. {
  73. return $this->msgcontent;
  74. }
  75. public function setMsgtype($msgtype)
  76. {
  77. $this->msgtype = $msgtype;
  78. $this->apiParas["msgtype"] = $msgtype;
  79. }
  80. public function getMsgtype()
  81. {
  82. return $this->msgtype;
  83. }
  84. public function setToAllUser($toAllUser)
  85. {
  86. $this->toAllUser = $toAllUser;
  87. $this->apiParas["to_all_user"] = $toAllUser;
  88. }
  89. public function getToAllUser()
  90. {
  91. return $this->toAllUser;
  92. }
  93. public function setUserIdList($userIdList)
  94. {
  95. $this->userIdList = $userIdList;
  96. $this->apiParas["user_id_list"] = $userIdList;
  97. }
  98. public function getUserIdList()
  99. {
  100. return $this->userIdList;
  101. }
  102. public function getApiMethodName()
  103. {
  104. return "dingtalk.corp.message.corpconversation.asyncsendbycode";
  105. }
  106. public function getApiParas()
  107. {
  108. return $this->apiParas;
  109. }
  110. public function check()
  111. {
  112. RequestCheckUtil::checkNotNull($this->agentId,"agentId");
  113. RequestCheckUtil::checkNotNull($this->code,"code");
  114. RequestCheckUtil::checkMaxListSize($this->deptIdList,20,"deptIdList");
  115. RequestCheckUtil::checkNotNull($this->msgcontent,"msgcontent");
  116. RequestCheckUtil::checkNotNull($this->msgtype,"msgtype");
  117. RequestCheckUtil::checkMaxListSize($this->userIdList,20,"userIdList");
  118. }
  119. public function putOtherTextParam($key, $value) {
  120. $this->apiParas[$key] = $value;
  121. $this->$key = $value;
  122. }
  123. }