OapiChatUpdatebanwordsRequest.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.chat.updatebanwords request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2020.02.06
  7. */
  8. class OapiChatUpdatebanwordsRequest
  9. {
  10. /**
  11. * 禁言时间,单位ms
  12. **/
  13. private $banWordsTime;
  14. /**
  15. * chatid
  16. **/
  17. private $chatid;
  18. /**
  19. * 0表示剔除禁言名单,1表示加入禁言名单
  20. **/
  21. private $type;
  22. /**
  23. * 被禁言人id列表
  24. **/
  25. private $useridList;
  26. private $apiParas = array();
  27. public function setBanWordsTime($banWordsTime)
  28. {
  29. $this->banWordsTime = $banWordsTime;
  30. $this->apiParas["ban_words_time"] = $banWordsTime;
  31. }
  32. public function getBanWordsTime()
  33. {
  34. return $this->banWordsTime;
  35. }
  36. public function setChatid($chatid)
  37. {
  38. $this->chatid = $chatid;
  39. $this->apiParas["chatid"] = $chatid;
  40. }
  41. public function getChatid()
  42. {
  43. return $this->chatid;
  44. }
  45. public function setType($type)
  46. {
  47. $this->type = $type;
  48. $this->apiParas["type"] = $type;
  49. }
  50. public function getType()
  51. {
  52. return $this->type;
  53. }
  54. public function setUseridList($useridList)
  55. {
  56. $this->useridList = $useridList;
  57. $this->apiParas["userid_list"] = $useridList;
  58. }
  59. public function getUseridList()
  60. {
  61. return $this->useridList;
  62. }
  63. public function getApiMethodName()
  64. {
  65. return "dingtalk.oapi.chat.updatebanwords";
  66. }
  67. public function getApiParas()
  68. {
  69. return $this->apiParas;
  70. }
  71. public function check()
  72. {
  73. RequestCheckUtil::checkNotNull($this->banWordsTime,"banWordsTime");
  74. RequestCheckUtil::checkNotNull($this->chatid,"chatid");
  75. RequestCheckUtil::checkNotNull($this->type,"type");
  76. RequestCheckUtil::checkNotNull($this->useridList,"useridList");
  77. RequestCheckUtil::checkMaxListSize($this->useridList,20,"useridList");
  78. }
  79. public function putOtherTextParam($key, $value) {
  80. $this->apiParas[$key] = $value;
  81. $this->$key = $value;
  82. }
  83. }