OapiImChatServicegroupNoticeCreateRequest.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.im.chat.servicegroup.notice.create request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2019.12.04
  7. */
  8. class OapiImChatServicegroupNoticeCreateRequest
  9. {
  10. /**
  11. * 要创建群公告的群id
  12. **/
  13. private $chatId;
  14. /**
  15. * 是否发送ding提醒
  16. **/
  17. private $sendDing;
  18. /**
  19. * 是否置顶
  20. **/
  21. private $sticky;
  22. /**
  23. * 群公告内容
  24. **/
  25. private $textContent;
  26. /**
  27. * 群公告标题
  28. **/
  29. private $title;
  30. /**
  31. * 唯一性key,由调用方提供,避免重复操作。
  32. **/
  33. private $uniqueKey;
  34. /**
  35. * 创建者id
  36. **/
  37. private $userid;
  38. private $apiParas = array();
  39. public function setChatId($chatId)
  40. {
  41. $this->chatId = $chatId;
  42. $this->apiParas["chat_id"] = $chatId;
  43. }
  44. public function getChatId()
  45. {
  46. return $this->chatId;
  47. }
  48. public function setSendDing($sendDing)
  49. {
  50. $this->sendDing = $sendDing;
  51. $this->apiParas["send_ding"] = $sendDing;
  52. }
  53. public function getSendDing()
  54. {
  55. return $this->sendDing;
  56. }
  57. public function setSticky($sticky)
  58. {
  59. $this->sticky = $sticky;
  60. $this->apiParas["sticky"] = $sticky;
  61. }
  62. public function getSticky()
  63. {
  64. return $this->sticky;
  65. }
  66. public function setTextContent($textContent)
  67. {
  68. $this->textContent = $textContent;
  69. $this->apiParas["text_content"] = $textContent;
  70. }
  71. public function getTextContent()
  72. {
  73. return $this->textContent;
  74. }
  75. public function setTitle($title)
  76. {
  77. $this->title = $title;
  78. $this->apiParas["title"] = $title;
  79. }
  80. public function getTitle()
  81. {
  82. return $this->title;
  83. }
  84. public function setUniqueKey($uniqueKey)
  85. {
  86. $this->uniqueKey = $uniqueKey;
  87. $this->apiParas["unique_key"] = $uniqueKey;
  88. }
  89. public function getUniqueKey()
  90. {
  91. return $this->uniqueKey;
  92. }
  93. public function setUserid($userid)
  94. {
  95. $this->userid = $userid;
  96. $this->apiParas["userid"] = $userid;
  97. }
  98. public function getUserid()
  99. {
  100. return $this->userid;
  101. }
  102. public function getApiMethodName()
  103. {
  104. return "dingtalk.oapi.im.chat.servicegroup.notice.create";
  105. }
  106. public function getApiParas()
  107. {
  108. return $this->apiParas;
  109. }
  110. public function check()
  111. {
  112. RequestCheckUtil::checkNotNull($this->chatId,"chatId");
  113. RequestCheckUtil::checkNotNull($this->textContent,"textContent");
  114. RequestCheckUtil::checkMaxLength($this->textContent,2000,"textContent");
  115. RequestCheckUtil::checkNotNull($this->title,"title");
  116. RequestCheckUtil::checkMaxLength($this->title,200,"title");
  117. RequestCheckUtil::checkNotNull($this->uniqueKey,"uniqueKey");
  118. RequestCheckUtil::checkNotNull($this->userid,"userid");
  119. }
  120. public function putOtherTextParam($key, $value) {
  121. $this->apiParas[$key] = $value;
  122. $this->$key = $value;
  123. }
  124. }