OapiImpaasConversationSendmessageRequest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.impaas.conversation.sendmessage request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2019.07.03
  7. */
  8. class OapiImpaasConversationSendmessageRequest
  9. {
  10. /**
  11. * 群id
  12. **/
  13. private $chatid;
  14. /**
  15. * 消息内容
  16. **/
  17. private $content;
  18. /**
  19. * 1. 优惠券 2 系统消息
  20. **/
  21. private $type;
  22. private $apiParas = array();
  23. public function setChatid($chatid)
  24. {
  25. $this->chatid = $chatid;
  26. $this->apiParas["chatid"] = $chatid;
  27. }
  28. public function getChatid()
  29. {
  30. return $this->chatid;
  31. }
  32. public function setContent($content)
  33. {
  34. $this->content = $content;
  35. $this->apiParas["content"] = $content;
  36. }
  37. public function getContent()
  38. {
  39. return $this->content;
  40. }
  41. public function setType($type)
  42. {
  43. $this->type = $type;
  44. $this->apiParas["type"] = $type;
  45. }
  46. public function getType()
  47. {
  48. return $this->type;
  49. }
  50. public function getApiMethodName()
  51. {
  52. return "dingtalk.oapi.impaas.conversation.sendmessage";
  53. }
  54. public function getApiParas()
  55. {
  56. return $this->apiParas;
  57. }
  58. public function check()
  59. {
  60. RequestCheckUtil::checkNotNull($this->chatid,"chatid");
  61. RequestCheckUtil::checkNotNull($this->content,"content");
  62. RequestCheckUtil::checkNotNull($this->type,"type");
  63. }
  64. public function putOtherTextParam($key, $value) {
  65. $this->apiParas[$key] = $value;
  66. $this->$key = $value;
  67. }
  68. }