OapiV2UserUpdateRequest.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.v2.user.update request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2021.12.02
  7. */
  8. class OapiV2UserUpdateRequest
  9. {
  10. /**
  11. * 修改本组织专属帐号时可指定头像MediaId。只支持参考jpg/png,生成方法 https://developers.dingtalk.com/document/app/upload-media-files
  12. **/
  13. private $avatarMediaId;
  14. /**
  15. * 所属部门id列表
  16. **/
  17. private $deptIdList;
  18. /**
  19. * 员工在对应的部门中的排序。
  20. **/
  21. private $deptOrderList;
  22. /**
  23. * 部门内任职
  24. **/
  25. private $deptPositionList;
  26. /**
  27. * 员工在对应的部门中的职位。
  28. **/
  29. private $deptTitleList;
  30. /**
  31. * 员工邮箱,长度最大50个字符。企业内必须唯一,不可重复。
  32. **/
  33. private $email;
  34. /**
  35. * 专属帐号手机号
  36. **/
  37. private $exclusiveMobile;
  38. /**
  39. * 手机号验证状态
  40. **/
  41. private $exclusiveMobileVerifyStatus;
  42. /**
  43. * 扩展属性,长度最大2000个字符。可以设置多种属性(手机上最多显示10个扩展属性,具体显示哪些属性,请到OA管理后台->设置->通讯录信息设置和OA管理后台->设置->手机端显示信息设置)。 该字段的值支持链接类型填写,同时链接支持变量通配符自动替换,目前支持通配符有:userid,corpid。示例: [工位地址](http://www.dingtalk.com?userid=#userid#&corpid=#corpid#)
  44. **/
  45. private $extension;
  46. /**
  47. * 强制更新的字段,支持清空指定的字段,使用逗号分隔。目前支持字段:manager_userid
  48. **/
  49. private $forceUpdateFields;
  50. /**
  51. * 是否号码隐藏。隐藏手机号后,手机号在个人资料页隐藏,但仍可对其发DING、发起钉钉免费商务电话。
  52. **/
  53. private $hideMobile;
  54. /**
  55. * 入职时间,Unix时间戳,单位ms。
  56. **/
  57. private $hiredDate;
  58. /**
  59. * 重置专属帐号密码
  60. **/
  61. private $initPassword;
  62. /**
  63. * 员工工号,长度最大50个字符。
  64. **/
  65. private $jobNumber;
  66. /**
  67. * 语言
  68. **/
  69. private $language;
  70. /**
  71. * 修改专属帐号登录名
  72. **/
  73. private $loginId;
  74. /**
  75. * 直属主管
  76. **/
  77. private $managerUserid;
  78. /**
  79. * 手机号码,企业内必须唯一,不可重复。如果是国际号码,请使用+xx-xxxxxx的格式
  80. **/
  81. private $mobile;
  82. /**
  83. * 员工名称,长度最大80个字符。
  84. **/
  85. private $name;
  86. /**
  87. * 修改本组织专属帐号时可指定昵称
  88. **/
  89. private $nickname;
  90. /**
  91. * 员工的企业邮箱,长度最大100个字符。员工的企业邮箱已开通,才能增加此字段。
  92. **/
  93. private $orgEmail;
  94. /**
  95. * 企业邮箱类型(profession:标准版,base:基础版)
  96. **/
  97. private $orgEmailType;
  98. /**
  99. * 备注,长度最大2000个字符。
  100. **/
  101. private $remark;
  102. /**
  103. * 是否高管模式。开启后,手机号码对所有员工隐藏。普通员工无法对其发DING、发起钉钉免费商务电话。高管之间不受影响。
  104. **/
  105. private $seniorMode;
  106. /**
  107. * 分机号,长度最大50个字符。企业内必须唯一,不可重复
  108. **/
  109. private $telephone;
  110. /**
  111. * 职位,长度最大200个字符。
  112. **/
  113. private $title;
  114. /**
  115. * 员工id,长度最大64个字符。员工在当前企业内的唯一标识。如果不传,服务器将自动生成一个userid。创建后不可修改,企业内必须唯一。
  116. **/
  117. private $userid;
  118. /**
  119. * 办公地点,长度最大100个字符。
  120. **/
  121. private $workPlace;
  122. private $apiParas = array();
  123. public function setAvatarMediaId($avatarMediaId)
  124. {
  125. $this->avatarMediaId = $avatarMediaId;
  126. $this->apiParas["avatarMediaId"] = $avatarMediaId;
  127. }
  128. public function getAvatarMediaId()
  129. {
  130. return $this->avatarMediaId;
  131. }
  132. public function setDeptIdList($deptIdList)
  133. {
  134. $this->deptIdList = $deptIdList;
  135. $this->apiParas["dept_id_list"] = $deptIdList;
  136. }
  137. public function getDeptIdList()
  138. {
  139. return $this->deptIdList;
  140. }
  141. public function setDeptOrderList($deptOrderList)
  142. {
  143. $this->deptOrderList = $deptOrderList;
  144. $this->apiParas["dept_order_list"] = $deptOrderList;
  145. }
  146. public function getDeptOrderList()
  147. {
  148. return $this->deptOrderList;
  149. }
  150. public function setDeptPositionList($deptPositionList)
  151. {
  152. $this->deptPositionList = $deptPositionList;
  153. $this->apiParas["dept_position_list"] = $deptPositionList;
  154. }
  155. public function getDeptPositionList()
  156. {
  157. return $this->deptPositionList;
  158. }
  159. public function setDeptTitleList($deptTitleList)
  160. {
  161. $this->deptTitleList = $deptTitleList;
  162. $this->apiParas["dept_title_list"] = $deptTitleList;
  163. }
  164. public function getDeptTitleList()
  165. {
  166. return $this->deptTitleList;
  167. }
  168. public function setEmail($email)
  169. {
  170. $this->email = $email;
  171. $this->apiParas["email"] = $email;
  172. }
  173. public function getEmail()
  174. {
  175. return $this->email;
  176. }
  177. public function setExclusiveMobile($exclusiveMobile)
  178. {
  179. $this->exclusiveMobile = $exclusiveMobile;
  180. $this->apiParas["exclusive_mobile"] = $exclusiveMobile;
  181. }
  182. public function getExclusiveMobile()
  183. {
  184. return $this->exclusiveMobile;
  185. }
  186. public function setExclusiveMobileVerifyStatus($exclusiveMobileVerifyStatus)
  187. {
  188. $this->exclusiveMobileVerifyStatus = $exclusiveMobileVerifyStatus;
  189. $this->apiParas["exclusive_mobile_verify_status"] = $exclusiveMobileVerifyStatus;
  190. }
  191. public function getExclusiveMobileVerifyStatus()
  192. {
  193. return $this->exclusiveMobileVerifyStatus;
  194. }
  195. public function setExtension($extension)
  196. {
  197. $this->extension = $extension;
  198. $this->apiParas["extension"] = $extension;
  199. }
  200. public function getExtension()
  201. {
  202. return $this->extension;
  203. }
  204. public function setForceUpdateFields($forceUpdateFields)
  205. {
  206. $this->forceUpdateFields = $forceUpdateFields;
  207. $this->apiParas["force_update_fields"] = $forceUpdateFields;
  208. }
  209. public function getForceUpdateFields()
  210. {
  211. return $this->forceUpdateFields;
  212. }
  213. public function setHideMobile($hideMobile)
  214. {
  215. $this->hideMobile = $hideMobile;
  216. $this->apiParas["hide_mobile"] = $hideMobile;
  217. }
  218. public function getHideMobile()
  219. {
  220. return $this->hideMobile;
  221. }
  222. public function setHiredDate($hiredDate)
  223. {
  224. $this->hiredDate = $hiredDate;
  225. $this->apiParas["hired_date"] = $hiredDate;
  226. }
  227. public function getHiredDate()
  228. {
  229. return $this->hiredDate;
  230. }
  231. public function setInitPassword($initPassword)
  232. {
  233. $this->initPassword = $initPassword;
  234. $this->apiParas["init_password"] = $initPassword;
  235. }
  236. public function getInitPassword()
  237. {
  238. return $this->initPassword;
  239. }
  240. public function setJobNumber($jobNumber)
  241. {
  242. $this->jobNumber = $jobNumber;
  243. $this->apiParas["job_number"] = $jobNumber;
  244. }
  245. public function getJobNumber()
  246. {
  247. return $this->jobNumber;
  248. }
  249. public function setLanguage($language)
  250. {
  251. $this->language = $language;
  252. $this->apiParas["language"] = $language;
  253. }
  254. public function getLanguage()
  255. {
  256. return $this->language;
  257. }
  258. public function setLoginId($loginId)
  259. {
  260. $this->loginId = $loginId;
  261. $this->apiParas["loginId"] = $loginId;
  262. }
  263. public function getLoginId()
  264. {
  265. return $this->loginId;
  266. }
  267. public function setManagerUserid($managerUserid)
  268. {
  269. $this->managerUserid = $managerUserid;
  270. $this->apiParas["manager_userid"] = $managerUserid;
  271. }
  272. public function getManagerUserid()
  273. {
  274. return $this->managerUserid;
  275. }
  276. public function setMobile($mobile)
  277. {
  278. $this->mobile = $mobile;
  279. $this->apiParas["mobile"] = $mobile;
  280. }
  281. public function getMobile()
  282. {
  283. return $this->mobile;
  284. }
  285. public function setName($name)
  286. {
  287. $this->name = $name;
  288. $this->apiParas["name"] = $name;
  289. }
  290. public function getName()
  291. {
  292. return $this->name;
  293. }
  294. public function setNickname($nickname)
  295. {
  296. $this->nickname = $nickname;
  297. $this->apiParas["nickname"] = $nickname;
  298. }
  299. public function getNickname()
  300. {
  301. return $this->nickname;
  302. }
  303. public function setOrgEmail($orgEmail)
  304. {
  305. $this->orgEmail = $orgEmail;
  306. $this->apiParas["org_email"] = $orgEmail;
  307. }
  308. public function getOrgEmail()
  309. {
  310. return $this->orgEmail;
  311. }
  312. public function setOrgEmailType($orgEmailType)
  313. {
  314. $this->orgEmailType = $orgEmailType;
  315. $this->apiParas["org_email_type"] = $orgEmailType;
  316. }
  317. public function getOrgEmailType()
  318. {
  319. return $this->orgEmailType;
  320. }
  321. public function setRemark($remark)
  322. {
  323. $this->remark = $remark;
  324. $this->apiParas["remark"] = $remark;
  325. }
  326. public function getRemark()
  327. {
  328. return $this->remark;
  329. }
  330. public function setSeniorMode($seniorMode)
  331. {
  332. $this->seniorMode = $seniorMode;
  333. $this->apiParas["senior_mode"] = $seniorMode;
  334. }
  335. public function getSeniorMode()
  336. {
  337. return $this->seniorMode;
  338. }
  339. public function setTelephone($telephone)
  340. {
  341. $this->telephone = $telephone;
  342. $this->apiParas["telephone"] = $telephone;
  343. }
  344. public function getTelephone()
  345. {
  346. return $this->telephone;
  347. }
  348. public function setTitle($title)
  349. {
  350. $this->title = $title;
  351. $this->apiParas["title"] = $title;
  352. }
  353. public function getTitle()
  354. {
  355. return $this->title;
  356. }
  357. public function setUserid($userid)
  358. {
  359. $this->userid = $userid;
  360. $this->apiParas["userid"] = $userid;
  361. }
  362. public function getUserid()
  363. {
  364. return $this->userid;
  365. }
  366. public function setWorkPlace($workPlace)
  367. {
  368. $this->workPlace = $workPlace;
  369. $this->apiParas["work_place"] = $workPlace;
  370. }
  371. public function getWorkPlace()
  372. {
  373. return $this->workPlace;
  374. }
  375. public function getApiMethodName()
  376. {
  377. return "dingtalk.oapi.v2.user.update";
  378. }
  379. public function getApiParas()
  380. {
  381. return $this->apiParas;
  382. }
  383. public function check()
  384. {
  385. RequestCheckUtil::checkMaxListSize($this->deptIdList,300,"deptIdList");
  386. RequestCheckUtil::checkMaxLength($this->email,50,"email");
  387. RequestCheckUtil::checkMaxListSize($this->forceUpdateFields,999,"forceUpdateFields");
  388. RequestCheckUtil::checkMinValue($this->hiredDate,1,"hiredDate");
  389. RequestCheckUtil::checkMaxLength($this->jobNumber,50,"jobNumber");
  390. RequestCheckUtil::checkMaxLength($this->language,6,"language");
  391. RequestCheckUtil::checkMaxLength($this->name,80,"name");
  392. RequestCheckUtil::checkMaxLength($this->orgEmail,100,"orgEmail");
  393. RequestCheckUtil::checkMaxLength($this->remark,2000,"remark");
  394. RequestCheckUtil::checkMaxLength($this->telephone,50,"telephone");
  395. RequestCheckUtil::checkMaxLength($this->title,200,"title");
  396. RequestCheckUtil::checkNotNull($this->userid,"userid");
  397. RequestCheckUtil::checkMaxLength($this->userid,64,"userid");
  398. RequestCheckUtil::checkMaxLength($this->workPlace,100,"workPlace");
  399. }
  400. public function putOtherTextParam($key, $value) {
  401. $this->apiParas[$key] = $value;
  402. $this->$key = $value;
  403. }
  404. }