|
13 | 13 | use OCP\AppFramework\Http; |
14 | 14 | use OCP\AppFramework\Http\Attribute\CORS; |
15 | 15 | use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI; |
| 16 | +use OCP\AppFramework\Http\Attribute\NoAdminRequired; |
16 | 17 | use OCP\AppFramework\Http\Attribute\OpenAPI; |
17 | 18 | use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired; |
| 19 | +use OCP\AppFramework\Http\Attribute\PublicPage; |
18 | 20 | use OCP\AppFramework\Http\Attribute\RequestHeader; |
19 | 21 | use OCP\AppFramework\Http\DataResponse; |
| 22 | +use OCP\AppFramework\Http\JSONResponse; |
20 | 23 | use OCP\AppFramework\OCS\OCSNotFoundException; |
21 | 24 | use OCP\AppFramework\OCSController; |
22 | 25 |
|
@@ -790,4 +793,62 @@ public function requestParams(): DataResponse { |
790 | 793 |
|
791 | 794 | return new DataResponse(); |
792 | 795 | } |
| 796 | + |
| 797 | + /** |
| 798 | + * A public page with annotation. |
| 799 | + * |
| 800 | + * @PublicPage |
| 801 | + * @return DataResponse<Http::STATUS_OK, list<empty>, array{}> |
| 802 | + * |
| 803 | + * 200: Admin settings updated |
| 804 | + */ |
| 805 | + public function publicPageAnnotation(): DataResponse { |
| 806 | + return new DataResponse(); |
| 807 | + } |
| 808 | + |
| 809 | + /** |
| 810 | + * A public page with attribute. |
| 811 | + * |
| 812 | + * @return DataResponse<Http::STATUS_OK, list<empty>, array{}> |
| 813 | + * |
| 814 | + * 200: Admin settings updated |
| 815 | + */ |
| 816 | + #[PublicPage] |
| 817 | + public function publicPageAttribute(): DataResponse { |
| 818 | + return new DataResponse(); |
| 819 | + } |
| 820 | + |
| 821 | + /** |
| 822 | + * A with merged responses. |
| 823 | + * |
| 824 | + * @return DataResponse<Http::STATUS_OK, array{a: string}, array{}>|JSONResponse<Http::STATUS_OK, array{b: int}, array{}> |
| 825 | + * |
| 826 | + * 200: Admin settings updated |
| 827 | + */ |
| 828 | + public function mergedResponses(): DataResponse|JSONResponse { |
| 829 | + return new DataResponse(); |
| 830 | + } |
| 831 | + |
| 832 | + /** |
| 833 | + * A page with a custom 401. |
| 834 | + * |
| 835 | + * @return DataResponse<Http::STATUS_UNAUTHORIZED, array{a: string}, array{}> |
| 836 | + * |
| 837 | + * 401: Admin settings updated |
| 838 | + */ |
| 839 | + #[NoAdminRequired] |
| 840 | + public function custom401(): DataResponse { |
| 841 | + return new DataResponse(); |
| 842 | + } |
| 843 | + |
| 844 | + /** |
| 845 | + * A page with a custom 403. |
| 846 | + * |
| 847 | + * @return DataResponse<Http::STATUS_FORBIDDEN, array{a: string}, array{}> |
| 848 | + * |
| 849 | + * 403: Admin settings updated |
| 850 | + */ |
| 851 | + public function custom403(): DataResponse { |
| 852 | + return new DataResponse(); |
| 853 | + } |
793 | 854 | } |
0 commit comments