Skip to content

Commit f898031

Browse files
committed
git commit -m "fix(provisioning_api): add missing @return annotation for editUserMultiField"
-e Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
1 parent 62580a4 commit f898031

4 files changed

Lines changed: 617 additions & 0 deletions

File tree

apps/provisioning_api/lib/Controller/UsersController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,11 @@ public function editUserMultiValue(
915915
* @param string|null $manager Manager user ID (null = no change, '' = clear)
916916
* @param list<string>|null $groups Group IDs to assign (null = no change, [] = remove all)
917917
* @param list<string>|null $subadminGroups Subadmin group IDs (null = no change, [] = remove all)
918+
* @return DataResponse<Http::STATUS_OK, Provisioning_APIUserDetails, array{}>|DataResponse<Http::STATUS_UNPROCESSABLE_ENTITY, array{errors: array<string, string>}, array{}>
919+
* @throws OCSException
920+
*
921+
* 200: User updated successfully
922+
* 422: One or more submitted fields failed validation
918923
*/
919924
#[PasswordConfirmationRequired]
920925
#[NoAdminRequired]

apps/provisioning_api/openapi-full.json

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4566,6 +4566,210 @@
45664566
}
45674567
}
45684568
},
4569+
"patch": {
4570+
"operationId": "users-edit-user-multi-field",
4571+
"summary": "Update multiple user account fields atomically. All submitted fields are validated first; if any fail, no changes are applied.",
4572+
"description": "Unlike editUser (which updates one field at a time via key/value), this method accepts named fields and applies them all in a single request.\nThis endpoint requires password confirmation",
4573+
"tags": [
4574+
"users"
4575+
],
4576+
"security": [
4577+
{
4578+
"bearer_auth": []
4579+
},
4580+
{
4581+
"basic_auth": []
4582+
}
4583+
],
4584+
"requestBody": {
4585+
"required": false,
4586+
"content": {
4587+
"application/json": {
4588+
"schema": {
4589+
"type": "object",
4590+
"properties": {
4591+
"displayName": {
4592+
"type": "string",
4593+
"nullable": true,
4594+
"default": null,
4595+
"description": "New display name (null = no change)"
4596+
},
4597+
"password": {
4598+
"type": "string",
4599+
"nullable": true,
4600+
"default": null,
4601+
"description": "New password (null = no change)"
4602+
},
4603+
"email": {
4604+
"type": "string",
4605+
"nullable": true,
4606+
"default": null,
4607+
"description": "New primary email (null = no change, '' = clear)"
4608+
},
4609+
"quota": {
4610+
"type": "string",
4611+
"nullable": true,
4612+
"default": null,
4613+
"description": "New quota e.g. \"5 GB\" (null = no change)"
4614+
},
4615+
"language": {
4616+
"type": "string",
4617+
"nullable": true,
4618+
"default": null,
4619+
"description": "Language code e.g. \"de\" (null = no change)"
4620+
},
4621+
"manager": {
4622+
"type": "string",
4623+
"nullable": true,
4624+
"default": null,
4625+
"description": "Manager user ID (null = no change, '' = clear)"
4626+
},
4627+
"groups": {
4628+
"type": "array",
4629+
"nullable": true,
4630+
"default": null,
4631+
"description": "Group IDs to assign (null = no change, [] = remove all)",
4632+
"items": {
4633+
"type": "string"
4634+
}
4635+
},
4636+
"subadminGroups": {
4637+
"type": "array",
4638+
"nullable": true,
4639+
"default": null,
4640+
"description": "Subadmin group IDs (null = no change, [] = remove all)",
4641+
"items": {
4642+
"type": "string"
4643+
}
4644+
}
4645+
}
4646+
}
4647+
}
4648+
}
4649+
},
4650+
"parameters": [
4651+
{
4652+
"name": "userId",
4653+
"in": "path",
4654+
"description": "The user to update",
4655+
"required": true,
4656+
"schema": {
4657+
"type": "string"
4658+
}
4659+
},
4660+
{
4661+
"name": "OCS-APIRequest",
4662+
"in": "header",
4663+
"description": "Required to be true for the API request to pass",
4664+
"required": true,
4665+
"schema": {
4666+
"type": "boolean",
4667+
"default": true
4668+
}
4669+
}
4670+
],
4671+
"responses": {
4672+
"200": {
4673+
"description": "User updated successfully",
4674+
"content": {
4675+
"application/json": {
4676+
"schema": {
4677+
"type": "object",
4678+
"required": [
4679+
"ocs"
4680+
],
4681+
"properties": {
4682+
"ocs": {
4683+
"type": "object",
4684+
"required": [
4685+
"meta",
4686+
"data"
4687+
],
4688+
"properties": {
4689+
"meta": {
4690+
"$ref": "#/components/schemas/OCSMeta"
4691+
},
4692+
"data": {
4693+
"$ref": "#/components/schemas/UserDetails"
4694+
}
4695+
}
4696+
}
4697+
}
4698+
}
4699+
}
4700+
}
4701+
},
4702+
"422": {
4703+
"description": "One or more submitted fields failed validation",
4704+
"content": {
4705+
"application/json": {
4706+
"schema": {
4707+
"type": "object",
4708+
"required": [
4709+
"ocs"
4710+
],
4711+
"properties": {
4712+
"ocs": {
4713+
"type": "object",
4714+
"required": [
4715+
"meta",
4716+
"data"
4717+
],
4718+
"properties": {
4719+
"meta": {
4720+
"$ref": "#/components/schemas/OCSMeta"
4721+
},
4722+
"data": {
4723+
"type": "object",
4724+
"required": [
4725+
"errors"
4726+
],
4727+
"properties": {
4728+
"errors": {
4729+
"type": "object",
4730+
"additionalProperties": {
4731+
"type": "string"
4732+
}
4733+
}
4734+
}
4735+
}
4736+
}
4737+
}
4738+
}
4739+
}
4740+
}
4741+
}
4742+
},
4743+
"401": {
4744+
"description": "Current user is not logged in",
4745+
"content": {
4746+
"application/json": {
4747+
"schema": {
4748+
"type": "object",
4749+
"required": [
4750+
"ocs"
4751+
],
4752+
"properties": {
4753+
"ocs": {
4754+
"type": "object",
4755+
"required": [
4756+
"meta",
4757+
"data"
4758+
],
4759+
"properties": {
4760+
"meta": {
4761+
"$ref": "#/components/schemas/OCSMeta"
4762+
},
4763+
"data": {}
4764+
}
4765+
}
4766+
}
4767+
}
4768+
}
4769+
}
4770+
}
4771+
}
4772+
},
45694773
"delete": {
45704774
"operationId": "users-delete-user",
45714775
"summary": "Delete a user",

0 commit comments

Comments
 (0)