CorpMessageCorpconversationSendmockRequest.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.corp.message.corpconversation.sendmock request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2018.07.25
  7. */
  8. class CorpMessageCorpconversationSendmockRequest
  9. {
  10. /**
  11. * 消息体
  12. **/
  13. private $message;
  14. /**
  15. * 消息类型
  16. **/
  17. private $messageType;
  18. /**
  19. * 微应用agentId
  20. **/
  21. private $microappAgentId;
  22. /**
  23. * 消息接收者部门列表
  24. **/
  25. private $toParty;
  26. /**
  27. * 消息接收者userid列表
  28. **/
  29. private $toUser;
  30. private $apiParas = array();
  31. public function setMessage($message)
  32. {
  33. $this->message = $message;
  34. $this->apiParas["message"] = $message;
  35. }
  36. public function getMessage()
  37. {
  38. return $this->message;
  39. }
  40. public function setMessageType($messageType)
  41. {
  42. $this->messageType = $messageType;
  43. $this->apiParas["message_type"] = $messageType;
  44. }
  45. public function getMessageType()
  46. {
  47. return $this->messageType;
  48. }
  49. public function setMicroappAgentId($microappAgentId)
  50. {
  51. $this->microappAgentId = $microappAgentId;
  52. $this->apiParas["microapp_agent_id"] = $microappAgentId;
  53. }
  54. public function getMicroappAgentId()
  55. {
  56. return $this->microappAgentId;
  57. }
  58. public function setToParty($toParty)
  59. {
  60. $this->toParty = $toParty;
  61. $this->apiParas["to_party"] = $toParty;
  62. }
  63. public function getToParty()
  64. {
  65. return $this->toParty;
  66. }
  67. public function setToUser($toUser)
  68. {
  69. $this->toUser = $toUser;
  70. $this->apiParas["to_user"] = $toUser;
  71. }
  72. public function getToUser()
  73. {
  74. return $this->toUser;
  75. }
  76. public function getApiMethodName()
  77. {
  78. return "dingtalk.corp.message.corpconversation.sendmock";
  79. }
  80. public function getApiParas()
  81. {
  82. return $this->apiParas;
  83. }
  84. public function check()
  85. {
  86. RequestCheckUtil::checkNotNull($this->message,"message");
  87. RequestCheckUtil::checkNotNull($this->messageType,"messageType");
  88. RequestCheckUtil::checkNotNull($this->microappAgentId,"microappAgentId");
  89. RequestCheckUtil::checkNotNull($this->toParty,"toParty");
  90. RequestCheckUtil::checkMaxListSize($this->toParty,20,"toParty");
  91. RequestCheckUtil::checkNotNull($this->toUser,"toUser");
  92. RequestCheckUtil::checkMaxListSize($this->toUser,20,"toUser");
  93. }
  94. public function putOtherTextParam($key, $value) {
  95. $this->apiParas[$key] = $value;
  96. $this->$key = $value;
  97. }
  98. }