File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 3838 CreateGroupReq ,
3939 ChangeGroupStorageQuotaReq ,
4040 GroupStorageQuotaResp ,
41+ ChangeUserGroupQuota ,
42+ UserGroupQuotaResp ,
4143 WorkerQueryInfo ,
4244 WorkerQueryResp ,
4345 WorkersQueryReq ,
99101 "CreateGroupReq" ,
100102 "ChangeGroupStorageQuotaReq" ,
101103 "GroupStorageQuotaResp" ,
104+ "ChangeUserGroupQuota" ,
105+ "UserGroupQuotaResp" ,
102106 "WorkerQueryInfo" ,
103107 "WorkerQueryResp" ,
104108 "WorkersQueryReq" ,
Original file line number Diff line number Diff line change 2929 CreateGroupReq ,
3030 ChangeGroupStorageQuotaReq ,
3131 GroupStorageQuotaResp ,
32+ ChangeUserGroupQuota ,
33+ UserGroupQuotaResp ,
3234 WorkerQueryResp ,
3335 WorkersQueryReq ,
3436 WorkersQueryResp ,
@@ -569,6 +571,21 @@ def admin_update_group_storage_quota(
569571 f"Failed to update storage quota for group { group_name } , status code: { resp .status_code } , error: { resp .text } "
570572 )
571573
574+ def admin_update_user_group_quota (
575+ self , username : str , req : ChangeUserGroupQuota
576+ ) -> UserGroupQuotaResp :
577+ url = self ._get_url (f"admin/users/{ username } /group-quota" )
578+ headers = {"Authorization" : f"Bearer { self .credential } " }
579+ resp = self .http_client .post (url , headers = headers , json = req .to_dict ())
580+ if resp .status_code == 200 :
581+ r = UserGroupQuotaResp .model_validate (resp .json ())
582+ return r
583+ else :
584+ self .logger .error (resp .text )
585+ raise Exception (
586+ f"Failed to update group quota for user { username } , status code: { resp .status_code } , error: { resp .text } "
587+ )
588+
572589 def query_attachments_by_filter (
573590 self , group_name : str , req : AttachmentsQueryReq
574591 ) -> AttachmentsQueryResp :
Original file line number Diff line number Diff line change @@ -657,6 +657,14 @@ class GroupStorageQuotaResp(BaseAPIModel):
657657 storage_quota : int
658658
659659
660+ class ChangeUserGroupQuota (BaseAPIModel ):
661+ group_quota : str
662+
663+
664+ class UserGroupQuotaResp (BaseAPIModel ):
665+ group_quota : int
666+
667+
660668class WorkerQueryInfo (BaseAPIModel ):
661669 worker_id : UUID4
662670 creator_username : str
You can’t perform that action at this time.
0 commit comments