CorpChatbotAddchatbotinstanceRequest.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.corp.chatbot.addchatbotinstance request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2020.09.18
  7. */
  8. class CorpChatbotAddchatbotinstanceRequest
  9. {
  10. /**
  11. * 机器人id,由钉钉事先分配
  12. **/
  13. private $chatbotId;
  14. /**
  15. * 机器人头像(如果为空,默认是机器人安装时的头像)
  16. **/
  17. private $iconMediaId;
  18. /**
  19. * 机器人名字(如果为空,默认是机器人安装时的名字)
  20. **/
  21. private $name;
  22. /**
  23. * 创建群时返回的openConvsationId
  24. **/
  25. private $openConversationId;
  26. private $apiParas = array();
  27. public function setChatbotId($chatbotId)
  28. {
  29. $this->chatbotId = $chatbotId;
  30. $this->apiParas["chatbot_id"] = $chatbotId;
  31. }
  32. public function getChatbotId()
  33. {
  34. return $this->chatbotId;
  35. }
  36. public function setIconMediaId($iconMediaId)
  37. {
  38. $this->iconMediaId = $iconMediaId;
  39. $this->apiParas["icon_media_id"] = $iconMediaId;
  40. }
  41. public function getIconMediaId()
  42. {
  43. return $this->iconMediaId;
  44. }
  45. public function setName($name)
  46. {
  47. $this->name = $name;
  48. $this->apiParas["name"] = $name;
  49. }
  50. public function getName()
  51. {
  52. return $this->name;
  53. }
  54. public function setOpenConversationId($openConversationId)
  55. {
  56. $this->openConversationId = $openConversationId;
  57. $this->apiParas["open_conversation_id"] = $openConversationId;
  58. }
  59. public function getOpenConversationId()
  60. {
  61. return $this->openConversationId;
  62. }
  63. public function getApiMethodName()
  64. {
  65. return "dingtalk.corp.chatbot.addchatbotinstance";
  66. }
  67. public function getApiParas()
  68. {
  69. return $this->apiParas;
  70. }
  71. public function check()
  72. {
  73. RequestCheckUtil::checkNotNull($this->chatbotId,"chatbotId");
  74. RequestCheckUtil::checkNotNull($this->openConversationId,"openConversationId");
  75. }
  76. public function putOtherTextParam($key, $value) {
  77. $this->apiParas[$key] = $value;
  78. $this->$key = $value;
  79. }
  80. }