123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- <?php
- /**
- * dingtalk API: dingtalk.oapi.v2.department.create request
- *
- * @author auto create
- * @since 1.0, 2021.08.25
- */
- class OapiV2DepartmentCreateRequest
- {
- /**
- * 开启后,加入该部门的申请将默认同意
- **/
- private $autoApproveApply;
-
- /**
- * 部门简介
- **/
- private $brief;
-
- /**
- * 是否创建一个关联此部门的企业群,默认为false
- **/
- private $createDeptGroup;
-
- /**
- * 可以查看指定隐藏部门的其他部门列表,如果部门隐藏,则此值生效。总数不能超过200。
- **/
- private $deptPermits;
-
- /**
- * 扩展字段,JSON格式
- **/
- private $extension;
-
- /**
- * 是否隐藏部门, true表示隐藏 false表示显示
- **/
- private $hideDept;
-
- /**
- * 部门名称,长度限制为1~64个字符,不允许包含字符‘-’‘,’以及‘,’
- **/
- private $name;
-
- /**
- * 在父部门中的排序值,order值小的排序靠前
- **/
- private $order;
-
- /**
- * 限制本部门成员查看通讯录,限制开启后,本部门成员只能看到限定范围内的通讯录。true表示限制开启
- **/
- private $outerDept;
-
- /**
- * 是否只能看到所在部门及下级部门通讯录
- **/
- private $outerDeptOnlySelf;
-
- /**
- * 本部门的员工仅可见员工自己为true时,可以配置额外可见部门,departmentId列表,总数不能超过200。
- **/
- private $outerPermitDepts;
-
- /**
- * 本部门的员工仅可见员工自己为true时,可以配置额外可见人员,userid列表,总数不能超过200。
- **/
- private $outerPermitUsers;
-
- /**
- * 父部门id,根部门id为1
- **/
- private $parentId;
-
- /**
- * 部门标识字段,开发者可用该字段来唯一标识一个部门,并与钉钉外部通讯录里的部门做映射
- **/
- private $sourceIdentifier;
-
- /**
- * 部门联系方式
- **/
- private $telephone;
-
- /**
- * 可以查看指定隐藏部门的其他人员列表,如果部门隐藏,则此值生效,总数不能超过200。
- **/
- private $userPermits;
-
- private $apiParas = array();
-
- public function setAutoApproveApply($autoApproveApply)
- {
- $this->autoApproveApply = $autoApproveApply;
- $this->apiParas["auto_approve_apply"] = $autoApproveApply;
- }
- public function getAutoApproveApply()
- {
- return $this->autoApproveApply;
- }
- public function setBrief($brief)
- {
- $this->brief = $brief;
- $this->apiParas["brief"] = $brief;
- }
- public function getBrief()
- {
- return $this->brief;
- }
- public function setCreateDeptGroup($createDeptGroup)
- {
- $this->createDeptGroup = $createDeptGroup;
- $this->apiParas["create_dept_group"] = $createDeptGroup;
- }
- public function getCreateDeptGroup()
- {
- return $this->createDeptGroup;
- }
- public function setDeptPermits($deptPermits)
- {
- $this->deptPermits = $deptPermits;
- $this->apiParas["dept_permits"] = $deptPermits;
- }
- public function getDeptPermits()
- {
- return $this->deptPermits;
- }
- public function setExtension($extension)
- {
- $this->extension = $extension;
- $this->apiParas["extension"] = $extension;
- }
- public function getExtension()
- {
- return $this->extension;
- }
- public function setHideDept($hideDept)
- {
- $this->hideDept = $hideDept;
- $this->apiParas["hide_dept"] = $hideDept;
- }
- public function getHideDept()
- {
- return $this->hideDept;
- }
- public function setName($name)
- {
- $this->name = $name;
- $this->apiParas["name"] = $name;
- }
- public function getName()
- {
- return $this->name;
- }
- public function setOrder($order)
- {
- $this->order = $order;
- $this->apiParas["order"] = $order;
- }
- public function getOrder()
- {
- return $this->order;
- }
- public function setOuterDept($outerDept)
- {
- $this->outerDept = $outerDept;
- $this->apiParas["outer_dept"] = $outerDept;
- }
- public function getOuterDept()
- {
- return $this->outerDept;
- }
- public function setOuterDeptOnlySelf($outerDeptOnlySelf)
- {
- $this->outerDeptOnlySelf = $outerDeptOnlySelf;
- $this->apiParas["outer_dept_only_self"] = $outerDeptOnlySelf;
- }
- public function getOuterDeptOnlySelf()
- {
- return $this->outerDeptOnlySelf;
- }
- public function setOuterPermitDepts($outerPermitDepts)
- {
- $this->outerPermitDepts = $outerPermitDepts;
- $this->apiParas["outer_permit_depts"] = $outerPermitDepts;
- }
- public function getOuterPermitDepts()
- {
- return $this->outerPermitDepts;
- }
- public function setOuterPermitUsers($outerPermitUsers)
- {
- $this->outerPermitUsers = $outerPermitUsers;
- $this->apiParas["outer_permit_users"] = $outerPermitUsers;
- }
- public function getOuterPermitUsers()
- {
- return $this->outerPermitUsers;
- }
- public function setParentId($parentId)
- {
- $this->parentId = $parentId;
- $this->apiParas["parent_id"] = $parentId;
- }
- public function getParentId()
- {
- return $this->parentId;
- }
- public function setSourceIdentifier($sourceIdentifier)
- {
- $this->sourceIdentifier = $sourceIdentifier;
- $this->apiParas["source_identifier"] = $sourceIdentifier;
- }
- public function getSourceIdentifier()
- {
- return $this->sourceIdentifier;
- }
- public function setTelephone($telephone)
- {
- $this->telephone = $telephone;
- $this->apiParas["telephone"] = $telephone;
- }
- public function getTelephone()
- {
- return $this->telephone;
- }
- public function setUserPermits($userPermits)
- {
- $this->userPermits = $userPermits;
- $this->apiParas["user_permits"] = $userPermits;
- }
- public function getUserPermits()
- {
- return $this->userPermits;
- }
- public function getApiMethodName()
- {
- return "dingtalk.oapi.v2.department.create";
- }
-
- public function getApiParas()
- {
- return $this->apiParas;
- }
-
- public function check()
- {
-
- RequestCheckUtil::checkMaxLength($this->brief,255,"brief");
- RequestCheckUtil::checkMaxListSize($this->deptPermits,200,"deptPermits");
- RequestCheckUtil::checkNotNull($this->name,"name");
- RequestCheckUtil::checkMaxLength($this->name,64,"name");
- RequestCheckUtil::checkMaxListSize($this->outerPermitDepts,200,"outerPermitDepts");
- RequestCheckUtil::checkMaxListSize($this->outerPermitUsers,200,"outerPermitUsers");
- RequestCheckUtil::checkNotNull($this->parentId,"parentId");
- RequestCheckUtil::checkMaxLength($this->telephone,50,"telephone");
- RequestCheckUtil::checkMaxListSize($this->userPermits,200,"userPermits");
- }
-
- public function putOtherTextParam($key, $value) {
- $this->apiParas[$key] = $value;
- $this->$key = $value;
- }
- }
|