-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAdminSettingsController.php
More file actions
84 lines (73 loc) · 2.1 KB
/
AdminSettingsController.php
File metadata and controls
84 lines (73 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Notifications\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
class AdminSettingsController extends OCSController {
/**
* Route is only in the admin scope because there is no "NoAdminRequired" annotation or attribute
*
* @return DataResponse<Http::STATUS_OK, list<empty>, array{}>
*
* 200: Personal settings updated
*/
public function adminScopeImplicitFromAdminRequired(): DataResponse {
return new DataResponse();
}
/**
* Route is in the default scope because the method overwrites with the Attribute
*
* @return DataResponse<Http::STATUS_OK, list<empty>, array{}>
*
* 200: Personal settings updated
*/
#[OpenAPI]
public function movedToDefaultScope(): DataResponse {
return new DataResponse();
}
/**
* Route in default scope with tags
*
* @return DataResponse<Http::STATUS_OK, list<empty>, array{}>
*
* 200: Personal settings updated
*/
#[OpenAPI(tags: ['settings', 'admin-settings'])]
public function movedToSettingsTag(): DataResponse {
return new DataResponse();
}
/**
* Route in default scope with tags but without named parameters on the attribute
*
* @return DataResponse<Http::STATUS_OK, list<empty>, array{}>
*
* 200: Personal settings updated
*/
#[OpenAPI(OpenAPI::SCOPE_ADMINISTRATION, ['settings', 'admin-settings'])]
public function movedToSettingsTagUnnamed(): DataResponse {
return new DataResponse();
}
public const ALSO_OPTIONAL = 1;
/**
* OCS Route with attribute
*
* @param int $option1 This is optional with magic number
* @param int $option2 This is optional with constant
* @return DataResponse<Http::STATUS_OK, list<empty>, array{}>
*
* 200: Success
*/
#[ApiRoute(verb: 'POST', url: '/optional-parameters')]
public function optionalParameters(
int $option1 = 0,
int $option2 = self::ALSO_OPTIONAL,
) {
return new DataResponse();
}
}