OapiWorkspaceProjectAssistantSendRequest.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.workspace.project.assistant.send request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2021.09.02
  7. */
  8. class OapiWorkspaceProjectAssistantSendRequest
  9. {
  10. /**
  11. * 跳转链接
  12. **/
  13. private $actionUrl;
  14. /**
  15. * 文章内容,最大支持10个文章段落
  16. **/
  17. private $content;
  18. /**
  19. * 链接图片
  20. **/
  21. private $picUrl;
  22. /**
  23. * 消息接收人,最大支持 100人
  24. **/
  25. private $recieverUserids;
  26. /**
  27. * 卡片样式,支持 动态卡片:ActionCardMessage,链接卡片:LinkMessage,markdown卡片:MarkdownMessage
  28. **/
  29. private $style;
  30. /**
  31. * 标题模板KEY
  32. **/
  33. private $title;
  34. private $apiParas = array();
  35. public function setActionUrl($actionUrl)
  36. {
  37. $this->actionUrl = $actionUrl;
  38. $this->apiParas["action_url"] = $actionUrl;
  39. }
  40. public function getActionUrl()
  41. {
  42. return $this->actionUrl;
  43. }
  44. public function setContent($content)
  45. {
  46. $this->content = $content;
  47. $this->apiParas["content"] = $content;
  48. }
  49. public function getContent()
  50. {
  51. return $this->content;
  52. }
  53. public function setPicUrl($picUrl)
  54. {
  55. $this->picUrl = $picUrl;
  56. $this->apiParas["pic_url"] = $picUrl;
  57. }
  58. public function getPicUrl()
  59. {
  60. return $this->picUrl;
  61. }
  62. public function setRecieverUserids($recieverUserids)
  63. {
  64. $this->recieverUserids = $recieverUserids;
  65. $this->apiParas["reciever_userids"] = $recieverUserids;
  66. }
  67. public function getRecieverUserids()
  68. {
  69. return $this->recieverUserids;
  70. }
  71. public function setStyle($style)
  72. {
  73. $this->style = $style;
  74. $this->apiParas["style"] = $style;
  75. }
  76. public function getStyle()
  77. {
  78. return $this->style;
  79. }
  80. public function setTitle($title)
  81. {
  82. $this->title = $title;
  83. $this->apiParas["title"] = $title;
  84. }
  85. public function getTitle()
  86. {
  87. return $this->title;
  88. }
  89. public function getApiMethodName()
  90. {
  91. return "dingtalk.oapi.workspace.project.assistant.send";
  92. }
  93. public function getApiParas()
  94. {
  95. return $this->apiParas;
  96. }
  97. public function check()
  98. {
  99. RequestCheckUtil::checkNotNull($this->actionUrl,"actionUrl");
  100. RequestCheckUtil::checkNotNull($this->recieverUserids,"recieverUserids");
  101. RequestCheckUtil::checkMaxListSize($this->recieverUserids,999,"recieverUserids");
  102. RequestCheckUtil::checkNotNull($this->style,"style");
  103. RequestCheckUtil::checkNotNull($this->title,"title");
  104. }
  105. public function putOtherTextParam($key, $value) {
  106. $this->apiParas[$key] = $value;
  107. $this->$key = $value;
  108. }
  109. }