OapiV2DepartmentUpdateRequest.php 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.v2.department.update request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2021.10.18
  7. */
  8. class OapiV2DepartmentUpdateRequest
  9. {
  10. /**
  11. * 如果有新人加入部门是否会自动加入部门群
  12. **/
  13. private $autoAddUser;
  14. /**
  15. * 开启后,加入该部门的申请将默认同意
  16. **/
  17. private $autoApproveApply;
  18. /**
  19. * 部门简介
  20. **/
  21. private $brief;
  22. /**
  23. * 是否创建一个关联此部门的企业群,默认为false
  24. **/
  25. private $createDeptGroup;
  26. /**
  27. * 部门ID
  28. **/
  29. private $deptId;
  30. /**
  31. * 部门的主管列表,主管的userid列表
  32. **/
  33. private $deptManagerUseridList;
  34. /**
  35. * 可以查看指定隐藏部门的其他部门列表,如果部门隐藏,则此值生效。总数不能超过200。
  36. **/
  37. private $deptPermits;
  38. /**
  39. * 扩展字段,JSON格式
  40. **/
  41. private $extension;
  42. /**
  43. * 强制更新的字段,支持清空指定的字段,使用逗号分隔。目前支持字段:dept_manager_userid_list
  44. **/
  45. private $forceUpdateFields;
  46. /**
  47. * 部门群是否包含隐藏部门
  48. **/
  49. private $groupContainHiddenDept;
  50. /**
  51. * 部门群是否包含外包部门
  52. **/
  53. private $groupContainOuterDept;
  54. /**
  55. * 部门群是否包含子部门
  56. **/
  57. private $groupContainSubDept;
  58. /**
  59. * 是否隐藏部门, true表示隐藏 false表示显示
  60. **/
  61. private $hideDept;
  62. /**
  63. * 通讯录语言
  64. **/
  65. private $language;
  66. /**
  67. * 部门名称,长度限制为1~64个字符,不允许包含字符‘-’‘,’以及‘,’
  68. **/
  69. private $name;
  70. /**
  71. * 在父部门中的排序值,order值小的排序靠前
  72. **/
  73. private $order;
  74. /**
  75. * 企业群群主的userid
  76. **/
  77. private $orgDeptOwner;
  78. /**
  79. * 限制本部门成员查看通讯录,限制开启后,本部门成员只能看到限定范围内的通讯录。true表示限制开启
  80. **/
  81. private $outerDept;
  82. /**
  83. * 是否只能看到所在部门及下级部门通讯录
  84. **/
  85. private $outerDeptOnlySelf;
  86. /**
  87. * 本部门的员工仅可见员工自己为true时,可以配置额外可见部门,departmentId列表,总数不能超过200。
  88. **/
  89. private $outerPermitDepts;
  90. /**
  91. * 本部门的员工仅可见员工自己为true时,可以配置额外可见人员,userid列表,总数不能超过200。
  92. **/
  93. private $outerPermitUsers;
  94. /**
  95. * 父部门id,根部门id为1
  96. **/
  97. private $parentId;
  98. /**
  99. * 部门标识字段,开发者可用该字段来唯一标识一个部门,并与钉钉外部通讯录里的部门做映射
  100. **/
  101. private $sourceIdentifier;
  102. /**
  103. * 部门联系方式
  104. **/
  105. private $telephone;
  106. /**
  107. * 可以查看指定隐藏部门的其他人员列表,如果部门隐藏,则此值生效,总数不能超过200。
  108. **/
  109. private $userPermits;
  110. private $apiParas = array();
  111. public function setAutoAddUser($autoAddUser)
  112. {
  113. $this->autoAddUser = $autoAddUser;
  114. $this->apiParas["auto_add_user"] = $autoAddUser;
  115. }
  116. public function getAutoAddUser()
  117. {
  118. return $this->autoAddUser;
  119. }
  120. public function setAutoApproveApply($autoApproveApply)
  121. {
  122. $this->autoApproveApply = $autoApproveApply;
  123. $this->apiParas["auto_approve_apply"] = $autoApproveApply;
  124. }
  125. public function getAutoApproveApply()
  126. {
  127. return $this->autoApproveApply;
  128. }
  129. public function setBrief($brief)
  130. {
  131. $this->brief = $brief;
  132. $this->apiParas["brief"] = $brief;
  133. }
  134. public function getBrief()
  135. {
  136. return $this->brief;
  137. }
  138. public function setCreateDeptGroup($createDeptGroup)
  139. {
  140. $this->createDeptGroup = $createDeptGroup;
  141. $this->apiParas["create_dept_group"] = $createDeptGroup;
  142. }
  143. public function getCreateDeptGroup()
  144. {
  145. return $this->createDeptGroup;
  146. }
  147. public function setDeptId($deptId)
  148. {
  149. $this->deptId = $deptId;
  150. $this->apiParas["dept_id"] = $deptId;
  151. }
  152. public function getDeptId()
  153. {
  154. return $this->deptId;
  155. }
  156. public function setDeptManagerUseridList($deptManagerUseridList)
  157. {
  158. $this->deptManagerUseridList = $deptManagerUseridList;
  159. $this->apiParas["dept_manager_userid_list"] = $deptManagerUseridList;
  160. }
  161. public function getDeptManagerUseridList()
  162. {
  163. return $this->deptManagerUseridList;
  164. }
  165. public function setDeptPermits($deptPermits)
  166. {
  167. $this->deptPermits = $deptPermits;
  168. $this->apiParas["dept_permits"] = $deptPermits;
  169. }
  170. public function getDeptPermits()
  171. {
  172. return $this->deptPermits;
  173. }
  174. public function setExtension($extension)
  175. {
  176. $this->extension = $extension;
  177. $this->apiParas["extension"] = $extension;
  178. }
  179. public function getExtension()
  180. {
  181. return $this->extension;
  182. }
  183. public function setForceUpdateFields($forceUpdateFields)
  184. {
  185. $this->forceUpdateFields = $forceUpdateFields;
  186. $this->apiParas["force_update_fields"] = $forceUpdateFields;
  187. }
  188. public function getForceUpdateFields()
  189. {
  190. return $this->forceUpdateFields;
  191. }
  192. public function setGroupContainHiddenDept($groupContainHiddenDept)
  193. {
  194. $this->groupContainHiddenDept = $groupContainHiddenDept;
  195. $this->apiParas["group_contain_hidden_dept"] = $groupContainHiddenDept;
  196. }
  197. public function getGroupContainHiddenDept()
  198. {
  199. return $this->groupContainHiddenDept;
  200. }
  201. public function setGroupContainOuterDept($groupContainOuterDept)
  202. {
  203. $this->groupContainOuterDept = $groupContainOuterDept;
  204. $this->apiParas["group_contain_outer_dept"] = $groupContainOuterDept;
  205. }
  206. public function getGroupContainOuterDept()
  207. {
  208. return $this->groupContainOuterDept;
  209. }
  210. public function setGroupContainSubDept($groupContainSubDept)
  211. {
  212. $this->groupContainSubDept = $groupContainSubDept;
  213. $this->apiParas["group_contain_sub_dept"] = $groupContainSubDept;
  214. }
  215. public function getGroupContainSubDept()
  216. {
  217. return $this->groupContainSubDept;
  218. }
  219. public function setHideDept($hideDept)
  220. {
  221. $this->hideDept = $hideDept;
  222. $this->apiParas["hide_dept"] = $hideDept;
  223. }
  224. public function getHideDept()
  225. {
  226. return $this->hideDept;
  227. }
  228. public function setLanguage($language)
  229. {
  230. $this->language = $language;
  231. $this->apiParas["language"] = $language;
  232. }
  233. public function getLanguage()
  234. {
  235. return $this->language;
  236. }
  237. public function setName($name)
  238. {
  239. $this->name = $name;
  240. $this->apiParas["name"] = $name;
  241. }
  242. public function getName()
  243. {
  244. return $this->name;
  245. }
  246. public function setOrder($order)
  247. {
  248. $this->order = $order;
  249. $this->apiParas["order"] = $order;
  250. }
  251. public function getOrder()
  252. {
  253. return $this->order;
  254. }
  255. public function setOrgDeptOwner($orgDeptOwner)
  256. {
  257. $this->orgDeptOwner = $orgDeptOwner;
  258. $this->apiParas["org_dept_owner"] = $orgDeptOwner;
  259. }
  260. public function getOrgDeptOwner()
  261. {
  262. return $this->orgDeptOwner;
  263. }
  264. public function setOuterDept($outerDept)
  265. {
  266. $this->outerDept = $outerDept;
  267. $this->apiParas["outer_dept"] = $outerDept;
  268. }
  269. public function getOuterDept()
  270. {
  271. return $this->outerDept;
  272. }
  273. public function setOuterDeptOnlySelf($outerDeptOnlySelf)
  274. {
  275. $this->outerDeptOnlySelf = $outerDeptOnlySelf;
  276. $this->apiParas["outer_dept_only_self"] = $outerDeptOnlySelf;
  277. }
  278. public function getOuterDeptOnlySelf()
  279. {
  280. return $this->outerDeptOnlySelf;
  281. }
  282. public function setOuterPermitDepts($outerPermitDepts)
  283. {
  284. $this->outerPermitDepts = $outerPermitDepts;
  285. $this->apiParas["outer_permit_depts"] = $outerPermitDepts;
  286. }
  287. public function getOuterPermitDepts()
  288. {
  289. return $this->outerPermitDepts;
  290. }
  291. public function setOuterPermitUsers($outerPermitUsers)
  292. {
  293. $this->outerPermitUsers = $outerPermitUsers;
  294. $this->apiParas["outer_permit_users"] = $outerPermitUsers;
  295. }
  296. public function getOuterPermitUsers()
  297. {
  298. return $this->outerPermitUsers;
  299. }
  300. public function setParentId($parentId)
  301. {
  302. $this->parentId = $parentId;
  303. $this->apiParas["parent_id"] = $parentId;
  304. }
  305. public function getParentId()
  306. {
  307. return $this->parentId;
  308. }
  309. public function setSourceIdentifier($sourceIdentifier)
  310. {
  311. $this->sourceIdentifier = $sourceIdentifier;
  312. $this->apiParas["source_identifier"] = $sourceIdentifier;
  313. }
  314. public function getSourceIdentifier()
  315. {
  316. return $this->sourceIdentifier;
  317. }
  318. public function setTelephone($telephone)
  319. {
  320. $this->telephone = $telephone;
  321. $this->apiParas["telephone"] = $telephone;
  322. }
  323. public function getTelephone()
  324. {
  325. return $this->telephone;
  326. }
  327. public function setUserPermits($userPermits)
  328. {
  329. $this->userPermits = $userPermits;
  330. $this->apiParas["user_permits"] = $userPermits;
  331. }
  332. public function getUserPermits()
  333. {
  334. return $this->userPermits;
  335. }
  336. public function getApiMethodName()
  337. {
  338. return "dingtalk.oapi.v2.department.update";
  339. }
  340. public function getApiParas()
  341. {
  342. return $this->apiParas;
  343. }
  344. public function check()
  345. {
  346. RequestCheckUtil::checkMaxLength($this->brief,255,"brief");
  347. RequestCheckUtil::checkNotNull($this->deptId,"deptId");
  348. RequestCheckUtil::checkMaxListSize($this->deptManagerUseridList,999,"deptManagerUseridList");
  349. RequestCheckUtil::checkMaxListSize($this->deptPermits,200,"deptPermits");
  350. RequestCheckUtil::checkMaxListSize($this->forceUpdateFields,999,"forceUpdateFields");
  351. RequestCheckUtil::checkMaxLength($this->name,64,"name");
  352. RequestCheckUtil::checkMaxListSize($this->outerPermitDepts,200,"outerPermitDepts");
  353. RequestCheckUtil::checkMaxListSize($this->outerPermitUsers,200,"outerPermitUsers");
  354. RequestCheckUtil::checkMaxLength($this->telephone,50,"telephone");
  355. RequestCheckUtil::checkMaxListSize($this->userPermits,200,"userPermits");
  356. }
  357. public function putOtherTextParam($key, $value) {
  358. $this->apiParas[$key] = $value;
  359. $this->$key = $value;
  360. }
  361. }