OapiV2DepartmentCreateRequest.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.v2.department.create request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2021.08.25
  7. */
  8. class OapiV2DepartmentCreateRequest
  9. {
  10. /**
  11. * 开启后,加入该部门的申请将默认同意
  12. **/
  13. private $autoApproveApply;
  14. /**
  15. * 部门简介
  16. **/
  17. private $brief;
  18. /**
  19. * 是否创建一个关联此部门的企业群,默认为false
  20. **/
  21. private $createDeptGroup;
  22. /**
  23. * 可以查看指定隐藏部门的其他部门列表,如果部门隐藏,则此值生效。总数不能超过200。
  24. **/
  25. private $deptPermits;
  26. /**
  27. * 扩展字段,JSON格式
  28. **/
  29. private $extension;
  30. /**
  31. * 是否隐藏部门, true表示隐藏 false表示显示
  32. **/
  33. private $hideDept;
  34. /**
  35. * 部门名称,长度限制为1~64个字符,不允许包含字符‘-’‘,’以及‘,’
  36. **/
  37. private $name;
  38. /**
  39. * 在父部门中的排序值,order值小的排序靠前
  40. **/
  41. private $order;
  42. /**
  43. * 限制本部门成员查看通讯录,限制开启后,本部门成员只能看到限定范围内的通讯录。true表示限制开启
  44. **/
  45. private $outerDept;
  46. /**
  47. * 是否只能看到所在部门及下级部门通讯录
  48. **/
  49. private $outerDeptOnlySelf;
  50. /**
  51. * 本部门的员工仅可见员工自己为true时,可以配置额外可见部门,departmentId列表,总数不能超过200。
  52. **/
  53. private $outerPermitDepts;
  54. /**
  55. * 本部门的员工仅可见员工自己为true时,可以配置额外可见人员,userid列表,总数不能超过200。
  56. **/
  57. private $outerPermitUsers;
  58. /**
  59. * 父部门id,根部门id为1
  60. **/
  61. private $parentId;
  62. /**
  63. * 部门标识字段,开发者可用该字段来唯一标识一个部门,并与钉钉外部通讯录里的部门做映射
  64. **/
  65. private $sourceIdentifier;
  66. /**
  67. * 部门联系方式
  68. **/
  69. private $telephone;
  70. /**
  71. * 可以查看指定隐藏部门的其他人员列表,如果部门隐藏,则此值生效,总数不能超过200。
  72. **/
  73. private $userPermits;
  74. private $apiParas = array();
  75. public function setAutoApproveApply($autoApproveApply)
  76. {
  77. $this->autoApproveApply = $autoApproveApply;
  78. $this->apiParas["auto_approve_apply"] = $autoApproveApply;
  79. }
  80. public function getAutoApproveApply()
  81. {
  82. return $this->autoApproveApply;
  83. }
  84. public function setBrief($brief)
  85. {
  86. $this->brief = $brief;
  87. $this->apiParas["brief"] = $brief;
  88. }
  89. public function getBrief()
  90. {
  91. return $this->brief;
  92. }
  93. public function setCreateDeptGroup($createDeptGroup)
  94. {
  95. $this->createDeptGroup = $createDeptGroup;
  96. $this->apiParas["create_dept_group"] = $createDeptGroup;
  97. }
  98. public function getCreateDeptGroup()
  99. {
  100. return $this->createDeptGroup;
  101. }
  102. public function setDeptPermits($deptPermits)
  103. {
  104. $this->deptPermits = $deptPermits;
  105. $this->apiParas["dept_permits"] = $deptPermits;
  106. }
  107. public function getDeptPermits()
  108. {
  109. return $this->deptPermits;
  110. }
  111. public function setExtension($extension)
  112. {
  113. $this->extension = $extension;
  114. $this->apiParas["extension"] = $extension;
  115. }
  116. public function getExtension()
  117. {
  118. return $this->extension;
  119. }
  120. public function setHideDept($hideDept)
  121. {
  122. $this->hideDept = $hideDept;
  123. $this->apiParas["hide_dept"] = $hideDept;
  124. }
  125. public function getHideDept()
  126. {
  127. return $this->hideDept;
  128. }
  129. public function setName($name)
  130. {
  131. $this->name = $name;
  132. $this->apiParas["name"] = $name;
  133. }
  134. public function getName()
  135. {
  136. return $this->name;
  137. }
  138. public function setOrder($order)
  139. {
  140. $this->order = $order;
  141. $this->apiParas["order"] = $order;
  142. }
  143. public function getOrder()
  144. {
  145. return $this->order;
  146. }
  147. public function setOuterDept($outerDept)
  148. {
  149. $this->outerDept = $outerDept;
  150. $this->apiParas["outer_dept"] = $outerDept;
  151. }
  152. public function getOuterDept()
  153. {
  154. return $this->outerDept;
  155. }
  156. public function setOuterDeptOnlySelf($outerDeptOnlySelf)
  157. {
  158. $this->outerDeptOnlySelf = $outerDeptOnlySelf;
  159. $this->apiParas["outer_dept_only_self"] = $outerDeptOnlySelf;
  160. }
  161. public function getOuterDeptOnlySelf()
  162. {
  163. return $this->outerDeptOnlySelf;
  164. }
  165. public function setOuterPermitDepts($outerPermitDepts)
  166. {
  167. $this->outerPermitDepts = $outerPermitDepts;
  168. $this->apiParas["outer_permit_depts"] = $outerPermitDepts;
  169. }
  170. public function getOuterPermitDepts()
  171. {
  172. return $this->outerPermitDepts;
  173. }
  174. public function setOuterPermitUsers($outerPermitUsers)
  175. {
  176. $this->outerPermitUsers = $outerPermitUsers;
  177. $this->apiParas["outer_permit_users"] = $outerPermitUsers;
  178. }
  179. public function getOuterPermitUsers()
  180. {
  181. return $this->outerPermitUsers;
  182. }
  183. public function setParentId($parentId)
  184. {
  185. $this->parentId = $parentId;
  186. $this->apiParas["parent_id"] = $parentId;
  187. }
  188. public function getParentId()
  189. {
  190. return $this->parentId;
  191. }
  192. public function setSourceIdentifier($sourceIdentifier)
  193. {
  194. $this->sourceIdentifier = $sourceIdentifier;
  195. $this->apiParas["source_identifier"] = $sourceIdentifier;
  196. }
  197. public function getSourceIdentifier()
  198. {
  199. return $this->sourceIdentifier;
  200. }
  201. public function setTelephone($telephone)
  202. {
  203. $this->telephone = $telephone;
  204. $this->apiParas["telephone"] = $telephone;
  205. }
  206. public function getTelephone()
  207. {
  208. return $this->telephone;
  209. }
  210. public function setUserPermits($userPermits)
  211. {
  212. $this->userPermits = $userPermits;
  213. $this->apiParas["user_permits"] = $userPermits;
  214. }
  215. public function getUserPermits()
  216. {
  217. return $this->userPermits;
  218. }
  219. public function getApiMethodName()
  220. {
  221. return "dingtalk.oapi.v2.department.create";
  222. }
  223. public function getApiParas()
  224. {
  225. return $this->apiParas;
  226. }
  227. public function check()
  228. {
  229. RequestCheckUtil::checkMaxLength($this->brief,255,"brief");
  230. RequestCheckUtil::checkMaxListSize($this->deptPermits,200,"deptPermits");
  231. RequestCheckUtil::checkNotNull($this->name,"name");
  232. RequestCheckUtil::checkMaxLength($this->name,64,"name");
  233. RequestCheckUtil::checkMaxListSize($this->outerPermitDepts,200,"outerPermitDepts");
  234. RequestCheckUtil::checkMaxListSize($this->outerPermitUsers,200,"outerPermitUsers");
  235. RequestCheckUtil::checkNotNull($this->parentId,"parentId");
  236. RequestCheckUtil::checkMaxLength($this->telephone,50,"telephone");
  237. RequestCheckUtil::checkMaxListSize($this->userPermits,200,"userPermits");
  238. }
  239. public function putOtherTextParam($key, $value) {
  240. $this->apiParas[$key] = $value;
  241. $this->$key = $value;
  242. }
  243. }