diff --git a/apps/provisioning_api/lib/Controller/AUserData.php b/apps/provisioning_api/lib/Controller/AUserData.php index bbb3abe3c24ac..c47762a0eda54 100644 --- a/apps/provisioning_api/lib/Controller/AUserData.php +++ b/apps/provisioning_api/lib/Controller/AUserData.php @@ -36,6 +36,7 @@ use OC\User\Backend; use OC\User\NoUserException; use OC_Helper; +use OCA\Provisioning_API\ResponseDefinitions; use OCP\Accounts\IAccountManager; use OCP\Accounts\PropertyDoesNotExistException; use OCP\AppFramework\Http; @@ -52,6 +53,9 @@ use OCP\User\Backend\ISetDisplayNameBackend; use OCP\User\Backend\ISetPasswordBackend; +/** + * @psalm-import-type UserDetails from ResponseDefinitions + */ abstract class AUserData extends OCSController { public const SCOPE_SUFFIX = 'Scope'; @@ -98,12 +102,12 @@ public function __construct(string $appName, * * @param string $userId * @param bool $includeScopes - * @return array + * @return UserDetails|null * @throws NotFoundException * @throws OCSException * @throws OCSNotFoundException */ - protected function getUserData(string $userId, bool $includeScopes = false): array { + protected function getUserData(string $userId, bool $includeScopes = false): ?array { $currentLoggedInUser = $this->userSession->getUser(); assert($currentLoggedInUser !== null, 'No user logged in'); @@ -122,7 +126,7 @@ protected function getUserData(string $userId, bool $includeScopes = false): arr } else { // Check they are looking up themselves if ($currentLoggedInUser->getUID() !== $targetUserObject->getUID()) { - return $data; + return null; } } diff --git a/apps/provisioning_api/lib/Controller/AppConfigController.php b/apps/provisioning_api/lib/Controller/AppConfigController.php index 929676be16ec1..4b67facb1b2c8 100644 --- a/apps/provisioning_api/lib/Controller/AppConfigController.php +++ b/apps/provisioning_api/lib/Controller/AppConfigController.php @@ -7,6 +7,7 @@ * * @author Joas Schilling * @author Roeland Jago Douma + * @author Kate Döen * * @license GNU AGPL version 3 or any later version * @@ -84,7 +85,7 @@ public function __construct(string $appName, } /** - * @return DataResponse + * @return DataResponse */ public function getApps(): DataResponse { return new DataResponse([ @@ -94,7 +95,7 @@ public function getApps(): DataResponse { /** * @param string $app - * @return DataResponse + * @return DataResponse|DataResponse */ public function getKeys(string $app): DataResponse { try { @@ -111,7 +112,7 @@ public function getKeys(string $app): DataResponse { * @param string $app * @param string $key * @param string $defaultValue - * @return DataResponse + * @return DataResponse|DataResponse */ public function getValue(string $app, string $key, string $defaultValue = ''): DataResponse { try { @@ -131,7 +132,7 @@ public function getValue(string $app, string $key, string $defaultValue = ''): D * @param string $app * @param string $key * @param string $value - * @return DataResponse + * @return DataResponse|DataResponse */ public function setValue(string $app, string $key, string $value): DataResponse { $user = $this->userSession->getUser(); @@ -158,7 +159,7 @@ public function setValue(string $app, string $key, string $value): DataResponse * @PasswordConfirmationRequired * @param string $app * @param string $key - * @return DataResponse + * @return DataResponse|DataResponse */ public function deleteKey(string $app, string $key): DataResponse { try { diff --git a/apps/provisioning_api/lib/Controller/AppsController.php b/apps/provisioning_api/lib/Controller/AppsController.php index fa0f2597e7fde..70d85e716e2cb 100644 --- a/apps/provisioning_api/lib/Controller/AppsController.php +++ b/apps/provisioning_api/lib/Controller/AppsController.php @@ -10,6 +10,7 @@ * @author Lukas Reschke * @author Roeland Jago Douma * @author Tom Needham + * @author Kate Döen * * @license AGPL-3.0 * @@ -29,13 +30,18 @@ namespace OCA\Provisioning_API\Controller; use OC_App; +use OCA\Provisioning_API\ResponseDefinitions; use OCP\App\AppPathNotFoundException; use OCP\App\IAppManager; +use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCS\OCSException; use OCP\AppFramework\OCSController; use OCP\IRequest; +/** + * @psalm-import-type AppInfo from ResponseDefinitions + */ class AppsController extends OCSController { /** @var IAppManager */ private $appManager; @@ -52,11 +58,12 @@ public function __construct( /** * @param string|null $filter - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function getApps(string $filter = null): DataResponse { $apps = (new OC_App())->listAllApps(); + /** @var string[] $list */ $list = []; foreach ($apps as $app) { $list[] = $app['id']; @@ -81,7 +88,7 @@ public function getApps(string $filter = null): DataResponse { /** * @param string $app - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function getAppInfo(string $app): DataResponse { @@ -96,7 +103,7 @@ public function getAppInfo(string $app): DataResponse { /** * @PasswordConfirmationRequired * @param string $app - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function enable(string $app): DataResponse { @@ -111,7 +118,7 @@ public function enable(string $app): DataResponse { /** * @PasswordConfirmationRequired * @param string $app - * @return DataResponse + * @return DataResponse */ public function disable(string $app): DataResponse { $this->appManager->disableApp($app); diff --git a/apps/provisioning_api/lib/Controller/GroupsController.php b/apps/provisioning_api/lib/Controller/GroupsController.php index e7e2a666b7bb4..254b435379ca1 100644 --- a/apps/provisioning_api/lib/Controller/GroupsController.php +++ b/apps/provisioning_api/lib/Controller/GroupsController.php @@ -14,6 +14,7 @@ * @author Robin Appelman * @author Roeland Jago Douma * @author Tom Needham + * @author Kate Döen * * @license AGPL-3.0 * @@ -32,7 +33,9 @@ */ namespace OCA\Provisioning_API\Controller; +use OCA\Provisioning_API\ResponseDefinitions; use OCP\Accounts\IAccountManager; +use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCS\OCSException; use OCP\AppFramework\OCS\OCSForbiddenException; @@ -48,6 +51,10 @@ use OCP\L10N\IFactory; use Psr\Log\LoggerInterface; +/** + * @psalm-import-type GroupDetails from ResponseDefinitions + * @psalm-import-type UserDetails from ResponseDefinitions + */ class GroupsController extends AUserData { /** @var LoggerInterface */ @@ -83,7 +90,7 @@ public function __construct(string $appName, * @param string $search * @param int $limit * @param int $offset - * @return DataResponse + * @return DataResponse */ public function getGroups(string $search = '', int $limit = null, int $offset = 0): DataResponse { $groups = $this->groupManager->search($search, $limit, $offset); @@ -104,7 +111,7 @@ public function getGroups(string $search = '', int $limit = null, int $offset = * @param string $search * @param int $limit * @param int $offset - * @return DataResponse + * @return DataResponse */ public function getGroupsDetails(string $search = '', int $limit = null, int $offset = 0): DataResponse { $groups = $this->groupManager->search($search, $limit, $offset); @@ -127,7 +134,7 @@ public function getGroupsDetails(string $search = '', int $limit = null, int $of * @NoAdminRequired * * @param string $groupId - * @return DataResponse + * @return DataResponse * @throws OCSException * * @deprecated 14 Use getGroupUsers @@ -142,8 +149,10 @@ public function getGroup(string $groupId): DataResponse { * @NoAdminRequired * * @param string $groupId - * @return DataResponse + * @return DataResponse * @throws OCSException + * @throws OCSNotFoundException + * @throws OCSForbiddenException */ public function getGroupUsers(string $groupId): DataResponse { $groupId = urldecode($groupId); @@ -167,6 +176,7 @@ public function getGroupUsers(string $groupId): DataResponse { /** @var IUser $user */ return $user->getUID(); }, $users); + /** @var string[] $users */ $users = array_values($users); return new DataResponse(['users' => $users]); } @@ -183,7 +193,8 @@ public function getGroupUsers(string $groupId): DataResponse { * @param string $search * @param int $limit * @param int $offset - * @return DataResponse + * + * @return DataResponse}, Http::STATUS_OK> * @throws OCSException */ public function getGroupUsersDetails(string $groupId, string $search = '', int $limit = null, int $offset = 0): DataResponse { @@ -210,7 +221,7 @@ public function getGroupUsersDetails(string $groupId, string $search = '', int $ $userId = (string)$user->getUID(); $userData = $this->getUserData($userId); // Do not insert empty entry - if (!empty($userData)) { + if ($userData != null) { $usersDetails[$userId] = $userData; } else { // Logged user does not have permissions to see this user @@ -234,7 +245,7 @@ public function getGroupUsersDetails(string $groupId, string $search = '', int $ * * @param string $groupid * @param string $displayname - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function addGroup(string $groupid, string $displayname = ''): DataResponse { @@ -263,7 +274,7 @@ public function addGroup(string $groupid, string $displayname = ''): DataRespons * @param string $groupId * @param string $key * @param string $value - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function updateGroup(string $groupId, string $key, string $value): DataResponse { @@ -285,7 +296,7 @@ public function updateGroup(string $groupId, string $key, string $value): DataRe * @PasswordConfirmationRequired * * @param string $groupId - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function deleteGroup(string $groupId): DataResponse { @@ -304,7 +315,7 @@ public function deleteGroup(string $groupId): DataResponse { /** * @param string $groupId - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function getSubAdminsOfGroup(string $groupId): DataResponse { @@ -317,6 +328,7 @@ public function getSubAdminsOfGroup(string $groupId): DataResponse { /** @var IUser[] $subadmins */ $subadmins = $this->groupManager->getSubAdmin()->getGroupsSubAdmins($targetGroup); // New class returns IUser[] so convert back + /** @var string[] $uids */ $uids = []; foreach ($subadmins as $user) { $uids[] = $user->getUID(); diff --git a/apps/provisioning_api/lib/Controller/PreferencesController.php b/apps/provisioning_api/lib/Controller/PreferencesController.php index 2dba8b86eb6fc..ff5d317fbbb11 100644 --- a/apps/provisioning_api/lib/Controller/PreferencesController.php +++ b/apps/provisioning_api/lib/Controller/PreferencesController.php @@ -6,6 +6,7 @@ * @copyright Copyright (c) 2022 Joas Schilling * * @author Joas Schilling + * @author Kate Döen * * @license GNU AGPL version 3 or any later version * @@ -58,6 +59,10 @@ public function __construct( /** * @NoAdminRequired * @NoSubAdminRequired + * + * @param array $configs + * + * @return DataResponse */ public function setMultiplePreferences(string $appId, array $configs): DataResponse { $userId = $this->userSession->getUser()->getUID(); @@ -93,6 +98,8 @@ public function setMultiplePreferences(string $appId, array $configs): DataRespo /** * @NoAdminRequired * @NoSubAdminRequired + * + * @return DataResponse */ public function setPreference(string $appId, string $configKey, string $configValue): DataResponse { $userId = $this->userSession->getUser()->getUID(); @@ -124,6 +131,10 @@ public function setPreference(string $appId, string $configKey, string $configVa /** * @NoAdminRequired * @NoSubAdminRequired + * + * @param string[] $configKeys + * + * @return DataResponse */ public function deleteMultiplePreference(string $appId, array $configKeys): DataResponse { $userId = $this->userSession->getUser()->getUID(); @@ -157,6 +168,8 @@ public function deleteMultiplePreference(string $appId, array $configKeys): Data /** * @NoAdminRequired * @NoSubAdminRequired + * + * @return DataResponse */ public function deletePreference(string $appId, string $configKey): DataResponse { $userId = $this->userSession->getUser()->getUID(); diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index f5bbf4899a4d1..b8b4c81a8c1a2 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -52,6 +52,7 @@ use OC\Authentication\Token\RemoteWipe; use OC\KnownUser\KnownUserService; use OC\User\Backend; +use OCA\Provisioning_API\ResponseDefinitions; use OCA\Settings\Mailer\NewUserMailHelper; use OCP\Accounts\IAccountManager; use OCP\Accounts\IAccountProperty; @@ -77,6 +78,9 @@ use OCP\User\Backend\ISetDisplayNameBackend; use Psr\Log\LoggerInterface; +/** + * @psalm-import-type UserDetails from ResponseDefinitions + */ class UsersController extends AUserData { /** @var IURLGenerator */ @@ -142,7 +146,7 @@ public function __construct( * @param string $search * @param int $limit * @param int $offset - * @return DataResponse + * @return DataResponse */ public function getUsers(string $search = '', int $limit = null, int $offset = 0): DataResponse { $user = $this->userSession->getUser(); @@ -165,6 +169,7 @@ public function getUsers(string $search = '', int $limit = null, int $offset = 0 } } + /** @var string[] $users */ $users = array_keys($users); return new DataResponse([ @@ -176,6 +181,7 @@ public function getUsers(string $search = '', int $limit = null, int $offset = 0 * @NoAdminRequired * * returns a list of users and their data + * @return DataResponse}, Http::STATUS_OK> */ public function getUsersDetails(string $search = '', int $limit = null, int $offset = 0): DataResponse { $currentUser = $this->userSession->getUser(); @@ -200,12 +206,13 @@ public function getUsersDetails(string $search = '', int $limit = null, int $off $users = array_merge(...$users); } + /** @var array $usersDetails */ $usersDetails = []; foreach ($users as $userId) { $userId = (string) $userId; $userData = $this->getUserData($userId); // Do not insert empty entry - if (!empty($userData)) { + if ($userData != null) { $usersDetails[$userId] = $userData; } else { // Logged user does not have permissions to see this user @@ -225,8 +232,8 @@ public function getUsersDetails(string $search = '', int $limit = null, int $off * @NoSubAdminRequired * * @param string $location - * @param array $search - * @return DataResponse + * @param array $search + * @return DataResponse, Http::STATUS_OK>|DataResponse */ public function searchByPhoneNumbers(string $location, array $search): DataResponse { $phoneUtil = PhoneNumberUtil::getInstance(); @@ -280,10 +287,6 @@ public function searchByPhoneNumbers(string $location, array $search): DataRespo $userMatches = $this->accountManager->searchUsers(IAccountManager::PROPERTY_PHONE, $phoneNumbers); - if (empty($userMatches)) { - return new DataResponse(); - } - $cloudUrl = rtrim($this->urlGenerator->getAbsoluteURL('/'), '/'); if (strpos($cloudUrl, 'http://') === 0) { $cloudUrl = substr($cloudUrl, strlen('http://')); @@ -324,12 +327,13 @@ private function createNewUserId(): string { * @param string $password * @param string $displayName * @param string $email - * @param array $groups - * @param array $subadmin + * @param string[] $groups + * @param string[] $subadmin * @param string $quota * @param string $language - * @return DataResponse + * @return DataResponse * @throws OCSException + * @throws OCSForbiddenException */ public function addUser( string $userid, @@ -516,7 +520,7 @@ public function addUser( * gets user info * * @param string $userId - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function getUser(string $userId): DataResponse { @@ -528,7 +532,7 @@ public function getUser(string $userId): DataResponse { $data = $this->getUserData($userId, $includeScopes); // getUserData returns empty array if not enough permissions - if (empty($data)) { + if ($data == null) { throw new OCSException('', OCSController::RESPOND_NOT_FOUND); } return new DataResponse($data); @@ -540,12 +544,13 @@ public function getUser(string $userId): DataResponse { * * gets user info from the currently logged in user * - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function getCurrentUser(): DataResponse { $user = $this->userSession->getUser(); if ($user) { + /** @var UserDetails $data */ $data = $this->getUserData($user->getUID(), true); return new DataResponse($data); } @@ -557,7 +562,7 @@ public function getCurrentUser(): DataResponse { * @NoAdminRequired * @NoSubAdminRequired * - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function getEditableFields(): DataResponse { @@ -574,7 +579,7 @@ public function getEditableFields(): DataResponse { * @NoSubAdminRequired * * @param string $userId - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function getEditableFieldsForUser(string $userId): DataResponse { @@ -633,6 +638,7 @@ public function getEditableFieldsForUser(string $userId): DataResponse { * @NoSubAdminRequired * @PasswordConfirmationRequired * + * @return DataResponse * @throws OCSException */ public function editUserMultiValue( @@ -730,7 +736,7 @@ public function editUserMultiValue( * @param string $userId * @param string $key * @param string $value - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function editUser(string $userId, string $key, string $value): DataResponse { @@ -1032,7 +1038,7 @@ public function editUser(string $userId, string $key, string $value): DataRespon * * @param string $userId * - * @return DataResponse + * @return DataResponse * * @throws OCSException */ @@ -1066,7 +1072,7 @@ public function wipeUserDevices(string $userId): DataResponse { * @NoAdminRequired * * @param string $userId - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function deleteUser(string $userId): DataResponse { @@ -1101,7 +1107,7 @@ public function deleteUser(string $userId): DataResponse { * @NoAdminRequired * * @param string $userId - * @return DataResponse + * @return DataResponse * @throws OCSException * @throws OCSForbiddenException */ @@ -1114,7 +1120,7 @@ public function disableUser(string $userId): DataResponse { * @NoAdminRequired * * @param string $userId - * @return DataResponse + * @return DataResponse * @throws OCSException * @throws OCSForbiddenException */ @@ -1125,7 +1131,7 @@ public function enableUser(string $userId): DataResponse { /** * @param string $userId * @param bool $value - * @return DataResponse + * @return DataResponse * @throws OCSException */ private function setEnabled(string $userId, bool $value): DataResponse { @@ -1152,7 +1158,7 @@ private function setEnabled(string $userId, bool $value): DataResponse { * @NoSubAdminRequired * * @param string $userId - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function getUsersGroups(string $userId): DataResponse { @@ -1197,7 +1203,7 @@ public function getUsersGroups(string $userId): DataResponse { * * @param string $userId * @param string $groupid - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function addToGroup(string $userId, string $groupid = ''): DataResponse { @@ -1232,7 +1238,7 @@ public function addToGroup(string $userId, string $groupid = ''): DataResponse { * * @param string $userId * @param string $groupid - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function removeFromGroup(string $userId, string $groupid): DataResponse { @@ -1295,7 +1301,7 @@ public function removeFromGroup(string $userId, string $groupid): DataResponse { * * @param string $userId * @param string $groupid - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function addSubAdmin(string $userId, string $groupid): DataResponse { @@ -1333,7 +1339,7 @@ public function addSubAdmin(string $userId, string $groupid): DataResponse { * * @param string $userId * @param string $groupid - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function removeSubAdmin(string $userId, string $groupid): DataResponse { @@ -1363,7 +1369,7 @@ public function removeSubAdmin(string $userId, string $groupid): DataResponse { * Get the groups a user is a subadmin of * * @param string $userId - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function getUserSubAdminGroups(string $userId): DataResponse { @@ -1378,7 +1384,7 @@ public function getUserSubAdminGroups(string $userId): DataResponse { * resend welcome message * * @param string $userId - * @return DataResponse + * @return DataResponse * @throws OCSException */ public function resendWelcomeMessage(string $userId): DataResponse { diff --git a/apps/provisioning_api/lib/ResponseDefinitions.php b/apps/provisioning_api/lib/ResponseDefinitions.php new file mode 100644 index 0000000000000..4e92afdd7a0f6 --- /dev/null +++ b/apps/provisioning_api/lib/ResponseDefinitions.php @@ -0,0 +1,135 @@ + + * + * @author Kate Döen + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Provisioning_API; + +/** + * @psalm-type UserDetails = array{ + * additional_mail: string[], + * additional_mailScope: string[]|null, + * address: string, + * addressScope: string|null, + * avatarScope: string|null, + * backend: string, + * backendCapabilities: array{ + * setDisplayName: bool, + * setPassword: bool + * }, + * biography: string, + * biographyScope: string|null, + * displayname: string, + * display-name: string, + * displaynameScope: string|null, + * email: string|null, + * emailScope: string|null, + * enabled: bool|null, + * fediverse: string|null, + * fediverseScope: string|null, + * groups: string[], + * headline: string, + * headlineScope: string|null, + * id: string, + * language: string, + * lastLogin: int, + * locale: string, + * notify_email: string|null, + * organisation: string, + * organisationScope: string|null, + * phone: string, + * phoneScope: string|null, + * profile_enabled: string, + * profile_enabledScope: string|null, + * quota: array{ + * free: int|null, + * quota: string|int|bool, + * relative: float|null, + * total: int|null, + * used: int, + * }, + * role: string, + * roleScope: string|null, + * storageLocation: string|null, + * subadmin: string[], + * twitter: string, + * twitterScope: string|null, + * website: string, + * websiteScope: string|null, + * } + * + * @psalm-type AppInfoValue = string|string[]|object + * + * @psalm-type AppInfo = array{ + * active: bool|null, + * activity: AppInfoValue|null, + * author: AppInfoValue|null, + * background-jobs: AppInfoValue|null, + * bugs: AppInfoValue|null, + * category: AppInfoValue|null, + * collaboration: AppInfoValue|null, + * commands: AppInfoValue|null, + * default_enable: AppInfoValue|null, + * dependencies: AppInfoValue|null, + * description: string, + * discussion: AppInfoValue|null, + * documentation: AppInfoValue|null, + * groups: AppInfoValue|null, + * id: string, + * info: AppInfoValue|null, + * internal: bool|null, + * level: int|null, + * licence: AppInfoValue|null, + * name: string, + * namespace: AppInfoValue|null, + * navigations: AppInfoValue|null, + * preview: AppInfoValue|null, + * previewAsIcon: bool|null, + * public: AppInfoValue|null, + * remote: AppInfoValue|null, + * removable: bool|null, + * repair-steps: AppInfoValue|null, + * repository: AppInfoValue|null, + * sabre: AppInfoValue|null, + * screenshot: AppInfoValue|null, + * settings: AppInfoValue|null, + * summary: string, + * trash: AppInfoValue|null, + * two-factor-providers: AppInfoValue|null, + * types: AppInfoValue|null, + * version: string, + * versions: AppInfoValue|null, + * website: AppInfoValue|null, + * } + * + * @psalm-type GroupDetails = array{ + * id: string, + * displayname: string, + * usercount: bool|int, + * disabled: bool|int, + * canAdd: bool, + * canRemove: bool, + * } + */ +class ResponseDefinitions { +} diff --git a/apps/provisioning_api/openapi.json b/apps/provisioning_api/openapi.json new file mode 100644 index 0000000000000..e0693ca3a1dbc --- /dev/null +++ b/apps/provisioning_api/openapi.json @@ -0,0 +1,3456 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Provisioning API", + "description": "This application enables a set of APIs that external systems can use to manage users, groups and apps.", + "license": { + "name": "agpl" + }, + "version": "1.16.0" + }, + "paths": { + "/ocs/v2.php/cloud/apps": { + "get": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "get-apps", + "parameters": [ + { + "name": "filter", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "apps" + ], + "type": "object", + "properties": { + "apps": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/apps/{app}": { + "parameters": [ + { + "name": "app", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "apps-get-app-info", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/AppInfo" + } + } + } + } + } + } + } + } + } + }, + "post": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "enable-apps", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "disable-apps", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/groups": { + "get": { + "tags": [ + "provisioning_api" + ], + "description": "returns a list of groups", + "operationId": "get-groups", + "parameters": [ + { + "name": "search", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "offset", + "in": "query", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "groups" + ], + "type": "object", + "properties": { + "groups": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "post": { + "tags": [ + "provisioning_api" + ], + "description": "creates a new group", + "operationId": "groups-add-group", + "parameters": [ + { + "name": "groupid", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "displayname", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/groups/details": { + "get": { + "tags": [ + "provisioning_api" + ], + "description": "Returns a list of groups details with ids and displaynames", + "operationId": "get-groups-details", + "parameters": [ + { + "name": "search", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "offset", + "in": "query", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "groups" + ], + "type": "object", + "properties": { + "groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupDetails" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/groups/{groupId}/users": { + "parameters": [ + { + "name": "groupId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "tags": [ + "provisioning_api" + ], + "description": "returns an array of users in the specified group", + "operationId": "groups-get-group-users", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "users" + ], + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "text/plain": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "", + "content": { + "text/plain": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/groups/{groupId}/users/details": { + "parameters": [ + { + "name": "groupId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "tags": [ + "provisioning_api" + ], + "description": "returns an array of users details in the specified group", + "operationId": "groups-get-group-users-details", + "parameters": [ + { + "name": "search", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "offset", + "in": "query", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "users" + ], + "type": "object", + "properties": { + "users": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/components/schemas/UserDetails" + }, + { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + } + ] + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/groups/{groupId}/subadmins": { + "parameters": [ + { + "name": "groupId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "groups-get-sub-admins-of-group", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/groups/{groupId}": { + "parameters": [ + { + "name": "groupId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "groups-get-group", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "users" + ], + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "put": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "groups-update-group", + "parameters": [ + { + "name": "key", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "value", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "groups-delete-group", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/users": { + "get": { + "tags": [ + "provisioning_api" + ], + "description": "returns a list of users", + "operationId": "get-users", + "parameters": [ + { + "name": "search", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "offset", + "in": "query", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "users" + ], + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "post": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "users-add-user", + "parameters": [ + { + "name": "userid", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "password", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "displayName", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "email", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "groups", + "in": "query", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "subadmin", + "in": "query", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "quota", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "language", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "403": { + "description": "", + "content": { + "text/plain": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/users/details": { + "get": { + "tags": [ + "provisioning_api" + ], + "description": "returns a list of users and their data", + "operationId": "get-users-details", + "parameters": [ + { + "name": "search", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "offset", + "in": "query", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "users" + ], + "type": "object", + "properties": { + "users": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/components/schemas/UserDetails" + }, + { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + } + ] + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/users/search/by-phone": { + "post": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "users-search-by-phone-numbers", + "parameters": [ + { + "name": "location", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "search", + "in": "query", + "required": true, + "schema": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/users/{userId}": { + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "tags": [ + "provisioning_api" + ], + "description": "gets user info", + "operationId": "users-get-user", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/UserDetails" + } + } + } + } + } + } + } + } + } + }, + "put": { + "tags": [ + "provisioning_api" + ], + "description": "edit users", + "operationId": "users-edit-user", + "parameters": [ + { + "name": "key", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "value", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "users-delete-user", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/user": { + "get": { + "tags": [ + "provisioning_api" + ], + "description": "gets user info from the currently logged in user", + "operationId": "users-get-current-user", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/UserDetails" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/user/fields": { + "get": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "users-get-editable-fields", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/user/fields/{userId}": { + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "users-get-editable-fields-for-user", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/users/{userId}/{collectionName}": { + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "collectionName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "put": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "users-edit-user-multi-value", + "parameters": [ + { + "name": "key", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "value", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/users/{userId}/wipe": { + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "users-wipe-user-devices", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/users/{userId}/enable": { + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "put": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "users-enable-user", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + }, + "403": { + "description": "", + "content": { + "text/plain": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/users/{userId}/disable": { + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "put": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "users-disable-user", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + }, + "403": { + "description": "", + "content": { + "text/plain": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/users/{userId}/groups": { + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "get-users-groups", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "groups" + ], + "type": "object", + "properties": { + "groups": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "post": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "users-add-to-group", + "parameters": [ + { + "name": "groupid", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "users-remove-from-group", + "parameters": [ + { + "name": "groupid", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/users/{userId}/subadmins": { + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "tags": [ + "provisioning_api" + ], + "description": "Get the groups a user is a subadmin of", + "operationId": "users-get-user-sub-admin-groups", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "post": { + "tags": [ + "provisioning_api" + ], + "description": "Creates a subadmin", + "operationId": "users-add-sub-admin", + "parameters": [ + { + "name": "groupid", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "provisioning_api" + ], + "description": "Removes a subadmin from a group", + "operationId": "users-remove-sub-admin", + "parameters": [ + { + "name": "groupid", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/users/{userId}/welcome": { + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "tags": [ + "provisioning_api" + ], + "description": "resend welcome message", + "operationId": "users-resend-welcome-message", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/provisioning_api/api/v1/config/apps": { + "get": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "app-config-get-apps", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/{app}": { + "parameters": [ + { + "name": "app", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "app-config-get-keys", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "required": [ + "message" + ], + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/{app}/{key}": { + "parameters": [ + { + "name": "app", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "key", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "app-config-get-value", + "parameters": [ + { + "name": "defaultValue", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "required": [ + "message" + ], + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "post": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "app-config-set-value", + "parameters": [ + { + "name": "value", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "required": [ + "message" + ], + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "app-config-delete-key", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "required": [ + "message" + ], + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}/{configKey}": { + "parameters": [ + { + "name": "appId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "configKey", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "preferences-set-preference", + "parameters": [ + { + "name": "configValue", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "preferences-delete-preference", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}": { + "parameters": [ + { + "name": "appId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "set-multiple-preferences", + "parameters": [ + { + "name": "configs", + "in": "query", + "required": true, + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "provisioning_api" + ], + "description": "", + "operationId": "preferences-delete-multiple-preference", + "parameters": [ + { + "name": "configKeys", + "in": "query", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "ocs" + ], + "type": "object", + "properties": { + "ocs": { + "required": [ + "meta", + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AppInfo": { + "required": [ + "description", + "id", + "name", + "summary", + "version" + ], + "type": "object", + "properties": { + "active": { + "type": "boolean" + }, + "activity": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "author": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "background-jobs": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "bugs": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "category": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "collaboration": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "commands": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "default_enable": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "dependencies": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "description": { + "type": "string" + }, + "discussion": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "documentation": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "groups": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "id": { + "type": "string" + }, + "info": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "internal": { + "type": "boolean" + }, + "level": { + "type": "integer" + }, + "licence": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "name": { + "type": "string" + }, + "namespace": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "navigations": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "preview": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "previewAsIcon": { + "type": "boolean" + }, + "public": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "remote": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "removable": { + "type": "boolean" + }, + "repair-steps": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "repository": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "sabre": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "screenshot": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "settings": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "summary": { + "type": "string" + }, + "trash": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "two-factor-providers": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "types": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "version": { + "type": "string" + }, + "versions": { + "$ref": "#/components/schemas/AppInfoValue" + }, + "website": { + "$ref": "#/components/schemas/AppInfoValue" + } + } + }, + "AppInfoValue": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "object", + "additionalProperties": true + } + ] + }, + "GroupDetails": { + "required": [ + "id", + "displayname", + "usercount", + "disabled", + "canAdd", + "canRemove" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "displayname": { + "type": "string" + }, + "usercount": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "integer" + } + ] + }, + "disabled": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "integer" + } + ] + }, + "canAdd": { + "type": "boolean" + }, + "canRemove": { + "type": "boolean" + } + } + }, + "OCSMeta": { + "type": "object", + "required": [ + "status", + "statuscode" + ], + "properties": { + "status": { + "type": "string" + }, + "statuscode": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "totalitems": { + "type": "string" + }, + "itemsperpage": { + "type": "string" + } + } + }, + "UserDetails": { + "required": [ + "additional_mail", + "address", + "backend", + "backendCapabilities", + "biography", + "displayname", + "display-name", + "groups", + "headline", + "id", + "language", + "lastLogin", + "locale", + "organisation", + "phone", + "profile_enabled", + "quota", + "role", + "subadmin", + "twitter", + "website" + ], + "type": "object", + "properties": { + "additional_mail": { + "type": "array", + "items": { + "type": "string" + } + }, + "additional_mailScope": { + "type": "array", + "items": { + "type": "string" + } + }, + "address": { + "type": "string" + }, + "addressScope": { + "type": "string" + }, + "avatarScope": { + "type": "string" + }, + "backend": { + "type": "string" + }, + "backendCapabilities": { + "required": [ + "setDisplayName", + "setPassword" + ], + "type": "object", + "properties": { + "setDisplayName": { + "type": "boolean" + }, + "setPassword": { + "type": "boolean" + } + } + }, + "biography": { + "type": "string" + }, + "biographyScope": { + "type": "string" + }, + "displayname": { + "type": "string" + }, + "display-name": { + "type": "string" + }, + "displaynameScope": { + "type": "string" + }, + "email": { + "type": "string" + }, + "emailScope": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "fediverse": { + "type": "string" + }, + "fediverseScope": { + "type": "string" + }, + "groups": { + "type": "array", + "items": { + "type": "string" + } + }, + "headline": { + "type": "string" + }, + "headlineScope": { + "type": "string" + }, + "id": { + "type": "string" + }, + "language": { + "type": "string" + }, + "lastLogin": { + "type": "integer" + }, + "locale": { + "type": "string" + }, + "notify_email": { + "type": "string" + }, + "organisation": { + "type": "string" + }, + "organisationScope": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "phoneScope": { + "type": "string" + }, + "profile_enabled": { + "type": "string" + }, + "profile_enabledScope": { + "type": "string" + }, + "quota": { + "required": [ + "quota", + "used" + ], + "type": "object", + "properties": { + "free": { + "type": "integer" + }, + "quota": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "boolean" + } + ] + }, + "relative": { + "type": "number", + "format": "float" + }, + "total": { + "type": "integer" + }, + "used": { + "type": "integer" + } + } + }, + "role": { + "type": "string" + }, + "roleScope": { + "type": "string" + }, + "storageLocation": { + "type": "string" + }, + "subadmin": { + "type": "array", + "items": { + "type": "string" + } + }, + "twitter": { + "type": "string" + }, + "twitterScope": { + "type": "string" + }, + "website": { + "type": "string" + }, + "websiteScope": { + "type": "string" + } + } + } + }, + "securitySchemes": { + "basic_auth": { + "type": "http", + "scheme": "basic" + } + } + }, + "security": [ + { + "basic_auth": [] + } + ], + "tags": [ + { + "name": "provisioning_api" + } + ] +} \ No newline at end of file