From e15356188e3fb1c1d1a7ef558bf447f39028756f Mon Sep 17 00:00:00 2001 From: jld3103 Date: Wed, 27 Sep 2023 11:33:03 +0200 Subject: [PATCH] fix(nextcloud): Fix OCS-APIRequest header Signed-off-by: jld3103 --- external/nextcloud-server | 2 +- .../nextcloud/lib/src/api/core.openapi.dart | 130 ++++---- .../nextcloud/lib/src/api/core.openapi.json | 182 +++++++----- .../lib/src/api/dashboard.openapi.dart | 14 +- .../lib/src/api/dashboard.openapi.json | 21 +- .../nextcloud/lib/src/api/dav.openapi.dart | 4 +- .../nextcloud/lib/src/api/dav.openapi.json | 5 +- .../nextcloud/lib/src/api/files.openapi.dart | 160 ++-------- .../lib/src/api/files.openapi.g.dart | 88 ------ .../nextcloud/lib/src/api/files.openapi.json | 102 +++---- .../lib/src/api/files_external.openapi.dart | 6 +- .../lib/src/api/files_external.openapi.json | 7 +- .../lib/src/api/files_reminders.openapi.dart | 12 +- .../lib/src/api/files_reminders.openapi.json | 15 +- .../lib/src/api/files_sharing.openapi.dart | 80 ++--- .../lib/src/api/files_sharing.openapi.json | 110 ++++--- .../lib/src/api/provisioning_api.openapi.dart | 172 +++++------ .../lib/src/api/provisioning_api.openapi.json | 279 ++++++++++-------- .../lib/src/api/settings.openapi.json | 2 +- .../lib/src/api/theming.openapi.dart | 20 +- .../lib/src/api/theming.openapi.json | 29 +- .../src/api/updatenotification.openapi.dart | 4 +- .../src/api/updatenotification.openapi.json | 5 +- .../lib/src/api/user_status.openapi.dart | 42 ++- .../lib/src/api/user_status.openapi.json | 58 ++-- .../lib/src/api/weather_status.openapi.dart | 28 +- .../lib/src/api/weather_status.openapi.json | 47 +-- 27 files changed, 758 insertions(+), 866 deletions(-) diff --git a/external/nextcloud-server b/external/nextcloud-server index 3c5d8410..69a05099 160000 --- a/external/nextcloud-server +++ b/external/nextcloud-server @@ -1 +1 @@ -Subproject commit 3c5d8410fa3d3f4ded01eed8c5cf1718532c174e +Subproject commit 69a050991bd580c0fef0c10a27fcadae701a9338 diff --git a/packages/nextcloud/lib/src/api/core.openapi.dart b/packages/nextcloud/lib/src/api/core.openapi.dart index 31d01887..8b2086fd 100644 --- a/packages/nextcloud/lib/src/api/core.openapi.dart +++ b/packages/nextcloud/lib/src/api/core.openapi.dart @@ -137,9 +137,7 @@ class CoreAppPasswordClient { final CoreClient _rootClient; /// Create app password - Future getAppPassword({ - final String oCSAPIRequest = 'true', - }) async { + Future getAppPassword({final bool oCSAPIRequest = true}) async { const path = '/ocs/v2.php/core/getapppassword'; final queryParameters = {}; final headers = { @@ -159,7 +157,7 @@ class CoreAppPasswordClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -177,7 +175,7 @@ class CoreAppPasswordClient { /// Rotate app password Future rotateAppPassword({ - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/core/apppassword/rotate'; final queryParameters = {}; @@ -198,7 +196,7 @@ class CoreAppPasswordClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -216,7 +214,7 @@ class CoreAppPasswordClient { /// Delete app password Future deleteAppPassword({ - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/core/apppassword'; final queryParameters = {}; @@ -237,7 +235,7 @@ class CoreAppPasswordClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -267,7 +265,7 @@ class CoreAutoCompleteClient { final String? sorter, final List? shareTypes, final int limit = 10, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/core/autocomplete/get'; final queryParameters = {}; @@ -304,7 +302,7 @@ class CoreAutoCompleteClient { if (limit != 10) { queryParameters['limit'] = limit.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -493,7 +491,7 @@ class CoreCollaborationResourcesClient { /// Search for collections Future searchCollections({ required final String filter, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/collaboration/resources/collections/search/{filter}'; final queryParameters = {}; @@ -515,7 +513,7 @@ class CoreCollaborationResourcesClient { } // coverage:ignore-end path = path.replaceAll('{filter}', Uri.encodeQueryComponent(filter)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -534,7 +532,7 @@ class CoreCollaborationResourcesClient { /// Get a collection Future listCollection({ required final int collectionId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/collaboration/resources/collections/{collectionId}'; final queryParameters = {}; @@ -556,7 +554,7 @@ class CoreCollaborationResourcesClient { } // coverage:ignore-end path = path.replaceAll('{collectionId}', Uri.encodeQueryComponent(collectionId.toString())); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -576,7 +574,7 @@ class CoreCollaborationResourcesClient { Future renameCollection({ required final String collectionName, required final int collectionId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/collaboration/resources/collections/{collectionId}'; final queryParameters = {}; @@ -599,7 +597,7 @@ class CoreCollaborationResourcesClient { // coverage:ignore-end queryParameters['collectionName'] = collectionName; path = path.replaceAll('{collectionId}', Uri.encodeQueryComponent(collectionId.toString())); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -620,7 +618,7 @@ class CoreCollaborationResourcesClient { required final String resourceType, required final String resourceId, required final int collectionId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/collaboration/resources/collections/{collectionId}'; final queryParameters = {}; @@ -644,7 +642,7 @@ class CoreCollaborationResourcesClient { queryParameters['resourceType'] = resourceType; queryParameters['resourceId'] = resourceId; path = path.replaceAll('{collectionId}', Uri.encodeQueryComponent(collectionId.toString())); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -665,7 +663,7 @@ class CoreCollaborationResourcesClient { required final String resourceType, required final String resourceId, required final int collectionId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/collaboration/resources/collections/{collectionId}'; final queryParameters = {}; @@ -689,7 +687,7 @@ class CoreCollaborationResourcesClient { queryParameters['resourceType'] = resourceType; queryParameters['resourceId'] = resourceId; path = path.replaceAll('{collectionId}', Uri.encodeQueryComponent(collectionId.toString())); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -709,7 +707,7 @@ class CoreCollaborationResourcesClient { Future getCollectionsByResource({ required final String resourceType, required final String resourceId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/collaboration/resources/{resourceType}/{resourceId}'; final queryParameters = {}; @@ -732,7 +730,7 @@ class CoreCollaborationResourcesClient { // coverage:ignore-end path = path.replaceAll('{resourceType}', Uri.encodeQueryComponent(resourceType)); path = path.replaceAll('{resourceId}', Uri.encodeQueryComponent(resourceId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -753,7 +751,7 @@ class CoreCollaborationResourcesClient { required final String name, required final String baseResourceType, required final String baseResourceId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/collaboration/resources/{baseResourceType}/{baseResourceId}'; final queryParameters = {}; @@ -777,7 +775,7 @@ class CoreCollaborationResourcesClient { queryParameters['name'] = name; path = path.replaceAll('{baseResourceType}', Uri.encodeQueryComponent(baseResourceType)); path = path.replaceAll('{baseResourceId}', Uri.encodeQueryComponent(baseResourceId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -887,7 +885,7 @@ class CoreHoverCardClient { /// Get the user details for a hovercard Future getUser({ required final String userId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/hovercard/v1/{userId}'; final queryParameters = {}; @@ -909,7 +907,7 @@ class CoreHoverCardClient { } // coverage:ignore-end path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -934,7 +932,7 @@ class CoreNavigationClient { /// Get the apps navigation Future getAppsNavigation({ final int absolute = 0, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/core/navigation/apps'; final queryParameters = {}; @@ -958,7 +956,7 @@ class CoreNavigationClient { if (absolute != 0) { queryParameters['absolute'] = absolute.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -977,7 +975,7 @@ class CoreNavigationClient { /// Get the settings navigation Future getSettingsNavigation({ final int absolute = 0, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/core/navigation/settings'; final queryParameters = {}; @@ -1001,7 +999,7 @@ class CoreNavigationClient { if (absolute != 0) { queryParameters['absolute'] = absolute.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1071,7 +1069,7 @@ class CoreOcsClient { final CoreClient _rootClient; /// Get the capabilities - Future getCapabilities({final String oCSAPIRequest = 'true'}) async { + Future getCapabilities({final bool oCSAPIRequest = true}) async { const path = '/ocs/v2.php/cloud/capabilities'; final queryParameters = {}; final headers = { @@ -1089,7 +1087,7 @@ class CoreOcsClient { ); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1246,7 +1244,7 @@ class CoreProfileApiClient { required final String paramId, required final String visibility, required final String targetUserId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/profile/{targetUserId}'; final queryParameters = {}; @@ -1270,7 +1268,7 @@ class CoreProfileApiClient { queryParameters['paramId'] = paramId; queryParameters['visibility'] = visibility; path = path.replaceAll('{targetUserId}', Uri.encodeQueryComponent(targetUserId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1333,7 +1331,7 @@ class CoreReferenceApiClient { /// Resolve a reference Future resolveOne({ required final String reference, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/references/resolve'; final queryParameters = {}; @@ -1355,7 +1353,7 @@ class CoreReferenceApiClient { } // coverage:ignore-end queryParameters['reference'] = reference; - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1375,7 +1373,7 @@ class CoreReferenceApiClient { Future resolve({ required final List references, final int limit = 1, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/references/resolve'; final queryParameters = {}; @@ -1400,7 +1398,7 @@ class CoreReferenceApiClient { if (limit != 1) { queryParameters['limit'] = limit.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1421,7 +1419,7 @@ class CoreReferenceApiClient { required final String text, final int resolve = 0, final int limit = 1, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/references/extract'; final queryParameters = {}; @@ -1449,7 +1447,7 @@ class CoreReferenceApiClient { if (limit != 1) { queryParameters['limit'] = limit.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1467,7 +1465,7 @@ class CoreReferenceApiClient { /// Get the providers Future getProvidersInfo({ - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/references/providers'; final queryParameters = {}; @@ -1488,7 +1486,7 @@ class CoreReferenceApiClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1508,7 +1506,7 @@ class CoreReferenceApiClient { Future touchProvider({ required final String providerId, final int? timestamp, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/references/provider/{providerId}'; final queryParameters = {}; @@ -1533,7 +1531,7 @@ class CoreReferenceApiClient { if (timestamp != null) { queryParameters['timestamp'] = timestamp.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1556,7 +1554,7 @@ class CoreTextProcessingApiClient { final CoreClient _rootClient; /// This endpoint returns all available LanguageModel task types - Future taskTypes({final String oCSAPIRequest = 'true'}) async { + Future taskTypes({final bool oCSAPIRequest = true}) async { const path = '/ocs/v2.php/textprocessing/tasktypes'; final queryParameters = {}; final headers = { @@ -1574,7 +1572,7 @@ class CoreTextProcessingApiClient { ); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1596,7 +1594,7 @@ class CoreTextProcessingApiClient { required final String type, required final String appId, final String identifier = '', - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/textprocessing/schedule'; final queryParameters = {}; @@ -1621,7 +1619,7 @@ class CoreTextProcessingApiClient { if (identifier != '') { queryParameters['identifier'] = identifier; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1640,7 +1638,7 @@ class CoreTextProcessingApiClient { /// This endpoint allows checking the status and results of a task. Tasks are removed 1 week after receiving their last update. Future getTask({ required final int id, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/textprocessing/task/{id}'; final queryParameters = {}; @@ -1660,7 +1658,7 @@ class CoreTextProcessingApiClient { } // coverage:ignore-end path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString())); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1679,7 +1677,7 @@ class CoreTextProcessingApiClient { /// This endpoint allows to delete a scheduled task for a user Future deleteTask({ required final int id, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/textprocessing/task/{id}'; final queryParameters = {}; @@ -1701,7 +1699,7 @@ class CoreTextProcessingApiClient { } // coverage:ignore-end path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString())); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1721,7 +1719,7 @@ class CoreTextProcessingApiClient { Future listTasksByApp({ required final String appId, final String? identifier, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/textprocessing/tasks/app/{appId}'; final queryParameters = {}; @@ -1746,7 +1744,7 @@ class CoreTextProcessingApiClient { if (identifier != null) { queryParameters['identifier'] = identifier; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1769,7 +1767,7 @@ class CoreTranslationApiClient { final CoreClient _rootClient; /// Get the list of supported languages - Future languages({final String oCSAPIRequest = 'true'}) async { + Future languages({final bool oCSAPIRequest = true}) async { const path = '/ocs/v2.php/translation/languages'; final queryParameters = {}; final headers = { @@ -1787,7 +1785,7 @@ class CoreTranslationApiClient { ); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1808,7 +1806,7 @@ class CoreTranslationApiClient { required final String text, required final String toLanguage, final String? fromLanguage, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/translation/translate'; final queryParameters = {}; @@ -1832,7 +1830,7 @@ class CoreTranslationApiClient { if (fromLanguage != null) { queryParameters['fromLanguage'] = fromLanguage; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1857,7 +1855,7 @@ class CoreUnifiedSearchClient { /// Get the providers for unified search Future getProviders({ final String from = '', - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/search/providers'; final queryParameters = {}; @@ -1881,7 +1879,7 @@ class CoreUnifiedSearchClient { if (from != '') { queryParameters['from'] = from; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1905,7 +1903,7 @@ class CoreUnifiedSearchClient { final int? limit, final ContentString? cursor, final String from = '', - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/search/providers/{providerId}/search'; final queryParameters = {}; @@ -1945,7 +1943,7 @@ class CoreUnifiedSearchClient { if (from != '') { queryParameters['from'] = from; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1968,7 +1966,7 @@ class CoreWhatsNewClient { final CoreClient _rootClient; /// Get the changes - Future $get({final String oCSAPIRequest = 'true'}) async { + Future $get({final bool oCSAPIRequest = true}) async { const path = '/ocs/v2.php/core/whatsnew'; final queryParameters = {}; final headers = { @@ -1988,7 +1986,7 @@ class CoreWhatsNewClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -2007,7 +2005,7 @@ class CoreWhatsNewClient { /// Dismiss the changes Future dismiss({ required final String version, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/core/whatsnew'; final queryParameters = {}; @@ -2029,7 +2027,7 @@ class CoreWhatsNewClient { } // coverage:ignore-end queryParameters['version'] = version; - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), diff --git a/packages/nextcloud/lib/src/api/core.openapi.json b/packages/nextcloud/lib/src/api/core.openapi.json index 74047877..f29b2179 100644 --- a/packages/nextcloud/lib/src/api/core.openapi.json +++ b/packages/nextcloud/lib/src/api/core.openapi.json @@ -1498,7 +1498,7 @@ ], "responses": { "200": { - "description": "", + "description": "Login flow init returned", "content": { "application/json": { "schema": { @@ -2054,16 +2054,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Capabilities returned", "content": { "application/json": { "schema": { @@ -2210,10 +2211,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2310,10 +2312,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2459,16 +2462,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Autocomplete results returned", "content": { "application/json": { "schema": { @@ -2522,10 +2526,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2654,10 +2659,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2722,10 +2728,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2800,10 +2807,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2878,10 +2886,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2955,10 +2964,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -3071,10 +3081,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -3172,10 +3183,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -3305,10 +3317,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -3447,10 +3460,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -3589,10 +3603,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -3723,10 +3738,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -3841,10 +3857,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -3994,16 +4011,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Reference returned", "content": { "application/json": { "schema": { @@ -4086,16 +4104,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "References returned", "content": { "application/json": { "schema": { @@ -4186,16 +4205,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "References returned", "content": { "application/json": { "schema": { @@ -4258,16 +4278,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Providers returned", "content": { "application/json": { "schema": { @@ -4340,16 +4361,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Provider touched", "content": { "application/json": { "schema": { @@ -4435,10 +4457,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -4532,16 +4555,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Providers returned", "content": { "application/json": { "schema": { @@ -4665,10 +4689,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -4756,16 +4781,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Supported languages returned", "content": { "application/json": { "schema": { @@ -4879,10 +4905,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -5079,16 +5106,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Task types returned", "content": { "application/json": { "schema": { @@ -5203,10 +5231,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -5358,10 +5387,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -5510,10 +5540,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -5672,10 +5703,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], diff --git a/packages/nextcloud/lib/src/api/dashboard.openapi.dart b/packages/nextcloud/lib/src/api/dashboard.openapi.dart index 62cf94fc..126c77d2 100644 --- a/packages/nextcloud/lib/src/api/dashboard.openapi.dart +++ b/packages/nextcloud/lib/src/api/dashboard.openapi.dart @@ -78,9 +78,7 @@ class DashboardDashboardApiClient { final DashboardClient _rootClient; /// Get the widgets - Future getWidgets({ - final String oCSAPIRequest = 'true', - }) async { + Future getWidgets({final bool oCSAPIRequest = true}) async { const path = '/ocs/v2.php/apps/dashboard/api/v1/widgets'; final queryParameters = {}; final headers = { @@ -100,7 +98,7 @@ class DashboardDashboardApiClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -121,7 +119,7 @@ class DashboardDashboardApiClient { final ContentString>? sinceIds, final int limit = 7, final List widgets = const [], - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/dashboard/api/v1/widget-items'; final queryParameters = {}; @@ -156,7 +154,7 @@ class DashboardDashboardApiClient { if (widgets != const []) { queryParameters['widgets[]'] = widgets.map((final e) => e); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -177,7 +175,7 @@ class DashboardDashboardApiClient { final ContentString>? sinceIds, final int limit = 7, final List widgets = const [], - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/dashboard/api/v2/widget-items'; final queryParameters = {}; @@ -212,7 +210,7 @@ class DashboardDashboardApiClient { if (widgets != const []) { queryParameters['widgets[]'] = widgets.map((final e) => e); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), diff --git a/packages/nextcloud/lib/src/api/dashboard.openapi.json b/packages/nextcloud/lib/src/api/dashboard.openapi.json index 3f33c906..019bcc49 100644 --- a/packages/nextcloud/lib/src/api/dashboard.openapi.json +++ b/packages/nextcloud/lib/src/api/dashboard.openapi.json @@ -192,16 +192,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Widgets returned", "content": { "application/json": { "schema": { @@ -294,16 +295,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Widget items returned", "content": { "application/json": { "schema": { @@ -399,16 +401,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Widget items returned", "content": { "application/json": { "schema": { diff --git a/packages/nextcloud/lib/src/api/dav.openapi.dart b/packages/nextcloud/lib/src/api/dav.openapi.dart index 0752755b..0660ed34 100644 --- a/packages/nextcloud/lib/src/api/dav.openapi.dart +++ b/packages/nextcloud/lib/src/api/dav.openapi.dart @@ -80,7 +80,7 @@ class DavDirectClient { Future getUrl({ required final int fileId, final int? expirationTime, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/dav/api/v1/direct'; final queryParameters = {}; @@ -105,7 +105,7 @@ class DavDirectClient { if (expirationTime != null) { queryParameters['expirationTime'] = expirationTime.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), diff --git a/packages/nextcloud/lib/src/api/dav.openapi.json b/packages/nextcloud/lib/src/api/dav.openapi.json index f13186a8..71f73900 100644 --- a/packages/nextcloud/lib/src/api/dav.openapi.json +++ b/packages/nextcloud/lib/src/api/dav.openapi.json @@ -108,10 +108,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], diff --git a/packages/nextcloud/lib/src/api/files.openapi.dart b/packages/nextcloud/lib/src/api/files.openapi.dart index 82f6b957..71785dd1 100644 --- a/packages/nextcloud/lib/src/api/files.openapi.dart +++ b/packages/nextcloud/lib/src/api/files.openapi.dart @@ -128,43 +128,6 @@ class FilesApiClient { } throw await FilesApiException.fromResponse(response); // coverage:ignore-line } - - /// Get the service-worker Javascript for previews - Future> serviceWorker() async { - const path = '/index.php/apps/files/preview-service-worker.js'; - final queryParameters = {}; - final headers = { - 'Accept': 'application/javascript', - }; - Uint8List? body; - // coverage:ignore-start - if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { - headers.addAll( - _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, - ); - } else if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'basic').isNotEmpty) { - headers.addAll( - _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').headers, - ); - } - // coverage:ignore-end - final response = await _rootClient.doRequest( - 'get', - Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), - headers, - body, - ); - if (response.statusCode == 200) { - return FilesResponse( - await response.body, - _jsonSerializers.deserialize( - response.responseHeaders, - specifiedType: const FullType(FilesApiApiServiceWorkerHeaders), - )! as FilesApiApiServiceWorkerHeaders, - ); - } - throw await FilesApiException.fromResponse(response); // coverage:ignore-line - } } class FilesDirectEditingClient { @@ -173,7 +136,7 @@ class FilesDirectEditingClient { final FilesClient _rootClient; /// Get the direct editing capabilities - Future info({final String oCSAPIRequest = 'true'}) async { + Future info({final bool oCSAPIRequest = true}) async { const path = '/ocs/v2.php/apps/files/api/v1/directEditing'; final queryParameters = {}; final headers = { @@ -193,7 +156,7 @@ class FilesDirectEditingClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -213,7 +176,7 @@ class FilesDirectEditingClient { Future templates({ required final String editorId, required final String creatorId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/files/api/v1/directEditing/templates/{editorId}/{creatorId}'; final queryParameters = {}; @@ -236,7 +199,7 @@ class FilesDirectEditingClient { // coverage:ignore-end path = path.replaceAll('{editorId}', Uri.encodeQueryComponent(editorId)); path = path.replaceAll('{creatorId}', Uri.encodeQueryComponent(creatorId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -257,7 +220,7 @@ class FilesDirectEditingClient { required final String path, final String? editorId, final int? fileId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path0 = '/ocs/v2.php/apps/files/api/v1/directEditing/open'; final queryParameters = {}; @@ -285,7 +248,7 @@ class FilesDirectEditingClient { if (fileId != null) { queryParameters['fileId'] = fileId.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -307,7 +270,7 @@ class FilesDirectEditingClient { required final String editorId, required final String creatorId, final String? templateId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path0 = '/ocs/v2.php/apps/files/api/v1/directEditing/create'; final queryParameters = {}; @@ -334,7 +297,7 @@ class FilesDirectEditingClient { if (templateId != null) { queryParameters['templateId'] = templateId; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -359,7 +322,7 @@ class FilesOpenLocalEditorClient { /// Create a local editor Future create({ required final String path, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path0 = '/ocs/v2.php/apps/files/api/v1/openlocaleditor'; final queryParameters = {}; @@ -381,7 +344,7 @@ class FilesOpenLocalEditorClient { } // coverage:ignore-end queryParameters['path'] = path; - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -401,7 +364,7 @@ class FilesOpenLocalEditorClient { Future validate({ required final String path, required final String token, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path0 = '/ocs/v2.php/apps/files/api/v1/openlocaleditor/{token}'; final queryParameters = {}; @@ -424,7 +387,7 @@ class FilesOpenLocalEditorClient { // coverage:ignore-end queryParameters['path'] = path; path0 = path0.replaceAll('{token}', Uri.encodeQueryComponent(token)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -447,7 +410,7 @@ class FilesTemplateClient { final FilesClient _rootClient; /// List the available templates - Future list({final String oCSAPIRequest = 'true'}) async { + Future list({final bool oCSAPIRequest = true}) async { const path = '/ocs/v2.php/apps/files/api/v1/templates'; final queryParameters = {}; final headers = { @@ -467,7 +430,7 @@ class FilesTemplateClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -488,7 +451,7 @@ class FilesTemplateClient { required final String filePath, final String templatePath = '', final String templateType = 'user', - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/files/api/v1/templates/create'; final queryParameters = {}; @@ -516,7 +479,7 @@ class FilesTemplateClient { if (templateType != 'user') { queryParameters['templateType'] = templateType; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -536,7 +499,7 @@ class FilesTemplateClient { Future path({ final String templatePath = '', final int copySystemTemplates = 0, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/files/api/v1/templates/path'; final queryParameters = {}; @@ -563,7 +526,7 @@ class FilesTemplateClient { if (copySystemTemplates != 0) { queryParameters['copySystemTemplates'] = copySystemTemplates.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -589,7 +552,7 @@ class FilesTransferOwnershipClient { Future transfer({ required final String recipient, required final String path, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path0 = '/ocs/v2.php/apps/files/api/v1/transferownership'; final queryParameters = {}; @@ -612,7 +575,7 @@ class FilesTransferOwnershipClient { // coverage:ignore-end queryParameters['recipient'] = recipient; queryParameters['path'] = path; - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -631,7 +594,7 @@ class FilesTransferOwnershipClient { /// Accept an ownership transfer Future accept({ required final int id, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/files/api/v1/transferownership/{id}'; final queryParameters = {}; @@ -653,7 +616,7 @@ class FilesTransferOwnershipClient { } // coverage:ignore-end path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString())); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -672,7 +635,7 @@ class FilesTransferOwnershipClient { /// Reject an ownership transfer Future reject({ required final int id, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/files/api/v1/transferownership/{id}'; final queryParameters = {}; @@ -694,7 +657,7 @@ class FilesTransferOwnershipClient { } // coverage:ignore-end path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString())); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -711,79 +674,6 @@ class FilesTransferOwnershipClient { } } -@BuiltValue(instantiable: false) -abstract interface class FilesApiApiServiceWorkerHeadersInterface { - @BuiltValueField(wireName: 'service-worker-allowed') - String? get serviceWorkerAllowed; - FilesApiApiServiceWorkerHeadersInterface rebuild( - final void Function(FilesApiApiServiceWorkerHeadersInterfaceBuilder) updates, - ); - FilesApiApiServiceWorkerHeadersInterfaceBuilder toBuilder(); -} - -abstract class FilesApiApiServiceWorkerHeaders - implements - FilesApiApiServiceWorkerHeadersInterface, - Built { - factory FilesApiApiServiceWorkerHeaders([final void Function(FilesApiApiServiceWorkerHeadersBuilder)? b]) = - _$FilesApiApiServiceWorkerHeaders; - - // coverage:ignore-start - const FilesApiApiServiceWorkerHeaders._(); - // coverage:ignore-end - - // coverage:ignore-start - factory FilesApiApiServiceWorkerHeaders.fromJson(final Map json) => - _jsonSerializers.deserializeWith(serializer, json)!; - // coverage:ignore-end - - // coverage:ignore-start - Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; - // coverage:ignore-end - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FilesApiApiServiceWorkerHeadersSerializer(); -} - -class _$FilesApiApiServiceWorkerHeadersSerializer implements StructuredSerializer { - @override - final Iterable types = const [FilesApiApiServiceWorkerHeaders, _$FilesApiApiServiceWorkerHeaders]; - - @override - final String wireName = 'FilesApiApiServiceWorkerHeaders'; - - @override - Iterable serialize( - final Serializers serializers, - final FilesApiApiServiceWorkerHeaders object, { - final FullType specifiedType = FullType.unspecified, - }) { - throw UnimplementedError(); - } - - @override - FilesApiApiServiceWorkerHeaders deserialize( - final Serializers serializers, - final Iterable serialized, { - final FullType specifiedType = FullType.unspecified, - }) { - final result = FilesApiApiServiceWorkerHeadersBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current! as String; - iterator.moveNext(); - final value = iterator.current! as String; - switch (key) { - case 'service-worker-allowed': - result.serviceWorkerAllowed = value; - } - } - - return result.build(); - } -} - @BuiltValue(instantiable: false) abstract interface class FilesOCSMetaInterface { String get status; @@ -2234,8 +2124,6 @@ abstract class FilesTemplate implements FilesTemplateInterface, Built { } } -abstract mixin class FilesApiApiServiceWorkerHeadersInterfaceBuilder { - void replace(FilesApiApiServiceWorkerHeadersInterface other); - void update(void Function(FilesApiApiServiceWorkerHeadersInterfaceBuilder) updates); - String? get serviceWorkerAllowed; - set serviceWorkerAllowed(String? serviceWorkerAllowed); -} - -class _$FilesApiApiServiceWorkerHeaders extends FilesApiApiServiceWorkerHeaders { - @override - final String? serviceWorkerAllowed; - - factory _$FilesApiApiServiceWorkerHeaders([void Function(FilesApiApiServiceWorkerHeadersBuilder)? updates]) => - (FilesApiApiServiceWorkerHeadersBuilder()..update(updates))._build(); - - _$FilesApiApiServiceWorkerHeaders._({this.serviceWorkerAllowed}) : super._(); - - @override - FilesApiApiServiceWorkerHeaders rebuild(void Function(FilesApiApiServiceWorkerHeadersBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - FilesApiApiServiceWorkerHeadersBuilder toBuilder() => FilesApiApiServiceWorkerHeadersBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is FilesApiApiServiceWorkerHeaders && serviceWorkerAllowed == other.serviceWorkerAllowed; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, serviceWorkerAllowed.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'FilesApiApiServiceWorkerHeaders') - ..add('serviceWorkerAllowed', serviceWorkerAllowed)) - .toString(); - } -} - -class FilesApiApiServiceWorkerHeadersBuilder - implements - Builder, - FilesApiApiServiceWorkerHeadersInterfaceBuilder { - _$FilesApiApiServiceWorkerHeaders? _$v; - - String? _serviceWorkerAllowed; - String? get serviceWorkerAllowed => _$this._serviceWorkerAllowed; - set serviceWorkerAllowed(covariant String? serviceWorkerAllowed) => - _$this._serviceWorkerAllowed = serviceWorkerAllowed; - - FilesApiApiServiceWorkerHeadersBuilder(); - - FilesApiApiServiceWorkerHeadersBuilder get _$this { - final $v = _$v; - if ($v != null) { - _serviceWorkerAllowed = $v.serviceWorkerAllowed; - _$v = null; - } - return this; - } - - @override - void replace(covariant FilesApiApiServiceWorkerHeaders other) { - ArgumentError.checkNotNull(other, 'other'); - _$v = other as _$FilesApiApiServiceWorkerHeaders; - } - - @override - void update(void Function(FilesApiApiServiceWorkerHeadersBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - FilesApiApiServiceWorkerHeaders build() => _build(); - - _$FilesApiApiServiceWorkerHeaders _build() { - final _$result = _$v ?? _$FilesApiApiServiceWorkerHeaders._(serviceWorkerAllowed: serviceWorkerAllowed); - replace(_$result); - return _$result; - } -} - abstract mixin class FilesOCSMetaInterfaceBuilder { void replace(FilesOCSMetaInterface other); void update(void Function(FilesOCSMetaInterfaceBuilder) updates); diff --git a/packages/nextcloud/lib/src/api/files.openapi.json b/packages/nextcloud/lib/src/api/files.openapi.json index af094fb1..25c45944 100644 --- a/packages/nextcloud/lib/src/api/files.openapi.json +++ b/packages/nextcloud/lib/src/api/files.openapi.json @@ -333,44 +333,6 @@ } } }, - "/index.php/apps/files/preview-service-worker.js": { - "get": { - "operationId": "api-service-worker", - "summary": "Get the service-worker Javascript for previews", - "tags": [ - "api" - ], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "responses": { - "200": { - "description": "", - "headers": { - "Service-Worker-Allowed": { - "schema": { - "type": "string" - } - } - }, - "content": { - "application/javascript": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - } - } - } - }, "/ocs/v2.php/apps/files/api/v1/directEditing": { "get": { "operationId": "direct_editing-info", @@ -390,16 +352,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Direct editing capabilities returned", "content": { "application/json": { "schema": { @@ -547,10 +510,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -709,10 +673,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -889,10 +854,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -1033,16 +999,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Available templates returned", "content": { "application/json": { "schema": { @@ -1123,10 +1090,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -1211,10 +1179,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -1314,10 +1283,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -1438,10 +1408,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -1560,10 +1531,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -1683,10 +1655,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -1811,10 +1784,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], diff --git a/packages/nextcloud/lib/src/api/files_external.openapi.dart b/packages/nextcloud/lib/src/api/files_external.openapi.dart index 00654edc..457b28c2 100644 --- a/packages/nextcloud/lib/src/api/files_external.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_external.openapi.dart @@ -79,9 +79,7 @@ class FilesExternalApiClient { final FilesExternalClient _rootClient; /// Get the mount points visible for this user - Future getUserMounts({ - final String oCSAPIRequest = 'true', - }) async { + Future getUserMounts({final bool oCSAPIRequest = true}) async { const path = '/ocs/v2.php/apps/files_external/api/v1/mounts'; final queryParameters = {}; final headers = { @@ -101,7 +99,7 @@ class FilesExternalApiClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), diff --git a/packages/nextcloud/lib/src/api/files_external.openapi.json b/packages/nextcloud/lib/src/api/files_external.openapi.json index 4fa5b82d..11c74ef8 100644 --- a/packages/nextcloud/lib/src/api/files_external.openapi.json +++ b/packages/nextcloud/lib/src/api/files_external.openapi.json @@ -190,16 +190,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "User mounts returned", "content": { "application/json": { "schema": { diff --git a/packages/nextcloud/lib/src/api/files_reminders.openapi.dart b/packages/nextcloud/lib/src/api/files_reminders.openapi.dart index 43910058..87b28ecb 100644 --- a/packages/nextcloud/lib/src/api/files_reminders.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_reminders.openapi.dart @@ -81,7 +81,7 @@ class FilesRemindersApiClient { Future $get({ required final String version, required final int fileId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/files_reminders/api/v{version}/{fileId}'; final queryParameters = {}; @@ -109,7 +109,7 @@ class FilesRemindersApiClient { } path = path.replaceAll('{version}', Uri.encodeQueryComponent(version)); path = path.replaceAll('{fileId}', Uri.encodeQueryComponent(fileId.toString())); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -130,7 +130,7 @@ class FilesRemindersApiClient { required final String dueDate, required final String version, required final int fileId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/files_reminders/api/v{version}/{fileId}'; final queryParameters = {}; @@ -159,7 +159,7 @@ class FilesRemindersApiClient { } path = path.replaceAll('{version}', Uri.encodeQueryComponent(version)); path = path.replaceAll('{fileId}', Uri.encodeQueryComponent(fileId.toString())); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -183,7 +183,7 @@ class FilesRemindersApiClient { Future remove({ required final String version, required final int fileId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/files_reminders/api/v{version}/{fileId}'; final queryParameters = {}; @@ -211,7 +211,7 @@ class FilesRemindersApiClient { } path = path.replaceAll('{version}', Uri.encodeQueryComponent(version)); path = path.replaceAll('{fileId}', Uri.encodeQueryComponent(fileId.toString())); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), diff --git a/packages/nextcloud/lib/src/api/files_reminders.openapi.json b/packages/nextcloud/lib/src/api/files_reminders.openapi.json index be0d54de..d82ce060 100644 --- a/packages/nextcloud/lib/src/api/files_reminders.openapi.json +++ b/packages/nextcloud/lib/src/api/files_reminders.openapi.json @@ -86,10 +86,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -209,10 +210,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -396,10 +398,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], diff --git a/packages/nextcloud/lib/src/api/files_sharing.openapi.dart b/packages/nextcloud/lib/src/api/files_sharing.openapi.dart index 7c816aed..e1c07dfc 100644 --- a/packages/nextcloud/lib/src/api/files_sharing.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_sharing.openapi.dart @@ -89,7 +89,7 @@ class FilesSharingDeletedShareapiClient { final FilesSharingClient _rootClient; /// Get a list of all deleted shares - Future list({final String oCSAPIRequest = 'true'}) async { + Future list({final bool oCSAPIRequest = true}) async { const path = '/ocs/v2.php/apps/files_sharing/api/v1/deletedshares'; final queryParameters = {}; final headers = { @@ -109,7 +109,7 @@ class FilesSharingDeletedShareapiClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -128,7 +128,7 @@ class FilesSharingDeletedShareapiClient { /// Undelete a deleted share Future undelete({ required final String id, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/files_sharing/api/v1/deletedshares/{id}'; final queryParameters = {}; @@ -150,7 +150,7 @@ class FilesSharingDeletedShareapiClient { } // coverage:ignore-end path = path.replaceAll('{id}', Uri.encodeQueryComponent(id)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -175,7 +175,7 @@ class FilesSharingPublicPreviewClient { /// Get a direct link preview for a shared file Future directLink({ required final String token, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/index.php/s/{token}/preview'; final queryParameters = {}; @@ -195,7 +195,7 @@ class FilesSharingPublicPreviewClient { } // coverage:ignore-end path = path.replaceAll('{token}', Uri.encodeQueryComponent(token)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -215,7 +215,7 @@ class FilesSharingPublicPreviewClient { final int x = 32, final int y = 32, final int a = 0, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/index.php/apps/files_sharing/publicpreview/{token}'; final queryParameters = {}; @@ -247,7 +247,7 @@ class FilesSharingPublicPreviewClient { if (a != 0) { queryParameters['a'] = a.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -267,7 +267,7 @@ class FilesSharingRemoteClient { final FilesSharingClient _rootClient; /// Get a list of accepted remote shares - Future getShares({final String oCSAPIRequest = 'true'}) async { + Future getShares({final bool oCSAPIRequest = true}) async { const path = '/ocs/v2.php/apps/files_sharing/api/v1/remote_shares'; final queryParameters = {}; final headers = { @@ -287,7 +287,7 @@ class FilesSharingRemoteClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -305,7 +305,7 @@ class FilesSharingRemoteClient { /// Get list of pending remote shares Future getOpenShares({ - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending'; final queryParameters = {}; @@ -326,7 +326,7 @@ class FilesSharingRemoteClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -345,7 +345,7 @@ class FilesSharingRemoteClient { /// Accept a remote share Future acceptShare({ required final int id, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/{id}'; final queryParameters = {}; @@ -367,7 +367,7 @@ class FilesSharingRemoteClient { } // coverage:ignore-end path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString())); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -386,7 +386,7 @@ class FilesSharingRemoteClient { /// Decline a remote share Future declineShare({ required final int id, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/{id}'; final queryParameters = {}; @@ -408,7 +408,7 @@ class FilesSharingRemoteClient { } // coverage:ignore-end path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString())); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -427,7 +427,7 @@ class FilesSharingRemoteClient { /// Get info of a remote share Future getShare({ required final int id, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/files_sharing/api/v1/remote_shares/{id}'; final queryParameters = {}; @@ -449,7 +449,7 @@ class FilesSharingRemoteClient { } // coverage:ignore-end path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString())); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -468,7 +468,7 @@ class FilesSharingRemoteClient { /// Unshare a remote share Future unshare({ required final int id, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/files_sharing/api/v1/remote_shares/{id}'; final queryParameters = {}; @@ -490,7 +490,7 @@ class FilesSharingRemoteClient { } // coverage:ignore-end path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString())); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -574,7 +574,7 @@ class FilesSharingShareapiClient { final String subfiles = 'false', final String path = '', final String includeTags = 'false', - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path0 = '/ocs/v2.php/apps/files_sharing/api/v1/shares'; final queryParameters = {}; @@ -610,7 +610,7 @@ class FilesSharingShareapiClient { if (includeTags != 'false') { queryParameters['include_tags'] = includeTags; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -639,7 +639,7 @@ class FilesSharingShareapiClient { final String note = '', final String label = '', final String? attributes, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path0 = '/ocs/v2.php/apps/files_sharing/api/v1/shares'; final queryParameters = {}; @@ -693,7 +693,7 @@ class FilesSharingShareapiClient { if (attributes != null) { queryParameters['attributes'] = attributes; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -712,7 +712,7 @@ class FilesSharingShareapiClient { /// Get all shares relative to a file, including parent folders shares rights Future getInheritedShares({ required final String path, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path0 = '/ocs/v2.php/apps/files_sharing/api/v1/shares/inherited'; final queryParameters = {}; @@ -734,7 +734,7 @@ class FilesSharingShareapiClient { } // coverage:ignore-end queryParameters['path'] = path; - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -752,7 +752,7 @@ class FilesSharingShareapiClient { /// Get all shares that are still pending Future pendingShares({ - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/files_sharing/api/v1/shares/pending'; final queryParameters = {}; @@ -773,7 +773,7 @@ class FilesSharingShareapiClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -793,7 +793,7 @@ class FilesSharingShareapiClient { Future getShare({ required final String id, final int includeTags = 0, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/files_sharing/api/v1/shares/{id}'; final queryParameters = {}; @@ -818,7 +818,7 @@ class FilesSharingShareapiClient { if (includeTags != 0) { queryParameters['include_tags'] = includeTags.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -846,7 +846,7 @@ class FilesSharingShareapiClient { final String? label, final String? hideDownload, final String? attributes, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/files_sharing/api/v1/shares/{id}'; final queryParameters = {}; @@ -895,7 +895,7 @@ class FilesSharingShareapiClient { if (attributes != null) { queryParameters['attributes'] = attributes; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -914,7 +914,7 @@ class FilesSharingShareapiClient { /// Delete a share Future deleteShare({ required final String id, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/files_sharing/api/v1/shares/{id}'; final queryParameters = {}; @@ -936,7 +936,7 @@ class FilesSharingShareapiClient { } // coverage:ignore-end path = path.replaceAll('{id}', Uri.encodeQueryComponent(id)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -955,7 +955,7 @@ class FilesSharingShareapiClient { /// Accept a share Future acceptShare({ required final String id, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/files_sharing/api/v1/shares/pending/{id}'; final queryParameters = {}; @@ -977,7 +977,7 @@ class FilesSharingShareapiClient { } // coverage:ignore-end path = path.replaceAll('{id}', Uri.encodeQueryComponent(id)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1009,7 +1009,7 @@ class FilesSharingShareesapiClient { final int perPage = 200, final ContentString? shareType, final int lookup = 0, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/files_sharing/api/v1/sharees'; final queryParameters = {}; @@ -1051,7 +1051,7 @@ class FilesSharingShareesapiClient { if (lookup != 0) { queryParameters['lookup'] = lookup.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1078,7 +1078,7 @@ class FilesSharingShareesapiClient { Future findRecommended({ required final String itemType, final ContentString? shareType, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/files_sharing/api/v1/sharees_recommended'; final queryParameters = {}; @@ -1106,7 +1106,7 @@ class FilesSharingShareesapiClient { specifiedType: const FullType(ContentString, [FullType(FilesSharingShareesapiFindRecommendedShareType)]), ); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), diff --git a/packages/nextcloud/lib/src/api/files_sharing.openapi.json b/packages/nextcloud/lib/src/api/files_sharing.openapi.json index 49362d39..5d568a5a 100644 --- a/packages/nextcloud/lib/src/api/files_sharing.openapi.json +++ b/packages/nextcloud/lib/src/api/files_sharing.openapi.json @@ -1317,10 +1317,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -1490,10 +1491,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -1745,10 +1747,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -1917,10 +1920,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2016,10 +2020,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2099,16 +2104,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Pending shares returned", "content": { "application/json": { "schema": { @@ -2180,10 +2186,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2339,10 +2346,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2436,10 +2444,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2523,10 +2532,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2601,16 +2611,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Deleted shares returned", "content": { "application/json": { "schema": { @@ -2673,10 +2684,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2815,10 +2827,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2928,16 +2941,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Recommended sharees returned", "content": { "application/json": { "schema": { @@ -2988,16 +3002,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Accepted remote shares returned", "content": { "application/json": { "schema": { @@ -3051,16 +3066,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Pending remote shares returned", "content": { "application/json": { "schema": { @@ -3124,10 +3140,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -3200,10 +3217,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -3278,10 +3296,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -3356,10 +3375,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], diff --git a/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart b/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart index 8ebd0e48..bb60b0d7 100644 --- a/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart +++ b/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart @@ -89,7 +89,7 @@ class ProvisioningApiAppConfigClient { /// Get a list of apps /// /// This endpoint requires admin access - Future getApps({final String oCSAPIRequest = 'true'}) async { + Future getApps({final bool oCSAPIRequest = true}) async { const path = '/ocs/v2.php/apps/provisioning_api/api/v1/config/apps'; final queryParameters = {}; final headers = { @@ -109,7 +109,7 @@ class ProvisioningApiAppConfigClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -130,7 +130,7 @@ class ProvisioningApiAppConfigClient { /// This endpoint requires admin access Future getKeys({ required final String app, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/{app}'; final queryParameters = {}; @@ -152,7 +152,7 @@ class ProvisioningApiAppConfigClient { } // coverage:ignore-end path = path.replaceAll('{app}', Uri.encodeQueryComponent(app)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -175,7 +175,7 @@ class ProvisioningApiAppConfigClient { required final String app, required final String key, final String defaultValue = '', - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/{app}/{key}'; final queryParameters = {}; @@ -201,7 +201,7 @@ class ProvisioningApiAppConfigClient { if (defaultValue != '') { queryParameters['defaultValue'] = defaultValue; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -222,7 +222,7 @@ class ProvisioningApiAppConfigClient { required final String value, required final String app, required final String key, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/{app}/{key}'; final queryParameters = {}; @@ -246,7 +246,7 @@ class ProvisioningApiAppConfigClient { queryParameters['value'] = value; path = path.replaceAll('{app}', Uri.encodeQueryComponent(app)); path = path.replaceAll('{key}', Uri.encodeQueryComponent(key)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -268,7 +268,7 @@ class ProvisioningApiAppConfigClient { Future deleteKey({ required final String app, required final String key, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/{app}/{key}'; final queryParameters = {}; @@ -291,7 +291,7 @@ class ProvisioningApiAppConfigClient { // coverage:ignore-end path = path.replaceAll('{app}', Uri.encodeQueryComponent(app)); path = path.replaceAll('{key}', Uri.encodeQueryComponent(key)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -318,7 +318,7 @@ class ProvisioningApiAppsClient { /// This endpoint requires admin access Future getApps({ final String? filter, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/cloud/apps'; final queryParameters = {}; @@ -342,7 +342,7 @@ class ProvisioningApiAppsClient { if (filter != null) { queryParameters['filter'] = filter; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -363,7 +363,7 @@ class ProvisioningApiAppsClient { /// This endpoint requires admin access Future getAppInfo({ required final String app, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/apps/{app}'; final queryParameters = {}; @@ -385,7 +385,7 @@ class ProvisioningApiAppsClient { } // coverage:ignore-end path = path.replaceAll('{app}', Uri.encodeQueryComponent(app)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -406,7 +406,7 @@ class ProvisioningApiAppsClient { /// This endpoint requires admin access Future enable({ required final String app, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/apps/{app}'; final queryParameters = {}; @@ -428,7 +428,7 @@ class ProvisioningApiAppsClient { } // coverage:ignore-end path = path.replaceAll('{app}', Uri.encodeQueryComponent(app)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -449,7 +449,7 @@ class ProvisioningApiAppsClient { /// This endpoint requires admin access Future disable({ required final String app, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/apps/{app}'; final queryParameters = {}; @@ -471,7 +471,7 @@ class ProvisioningApiAppsClient { } // coverage:ignore-end path = path.replaceAll('{app}', Uri.encodeQueryComponent(app)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -498,7 +498,7 @@ class ProvisioningApiGroupsClient { final String search = '', final int? limit, final int offset = 0, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/cloud/groups'; final queryParameters = {}; @@ -528,7 +528,7 @@ class ProvisioningApiGroupsClient { if (offset != 0) { queryParameters['offset'] = offset.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -550,7 +550,7 @@ class ProvisioningApiGroupsClient { Future addGroup({ required final String groupid, final String displayname = '', - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/cloud/groups'; final queryParameters = {}; @@ -575,7 +575,7 @@ class ProvisioningApiGroupsClient { if (displayname != '') { queryParameters['displayname'] = displayname; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -596,7 +596,7 @@ class ProvisioningApiGroupsClient { final String search = '', final int? limit, final int offset = 0, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/cloud/groups/details'; final queryParameters = {}; @@ -626,7 +626,7 @@ class ProvisioningApiGroupsClient { if (offset != 0) { queryParameters['offset'] = offset.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -645,7 +645,7 @@ class ProvisioningApiGroupsClient { /// Get a list of users in the specified group Future getGroupUsers({ required final String groupId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/groups/{groupId}/users'; final queryParameters = {}; @@ -672,7 +672,7 @@ class ProvisioningApiGroupsClient { ); // coverage:ignore-line } path = path.replaceAll('{groupId}', Uri.encodeQueryComponent(groupId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -694,7 +694,7 @@ class ProvisioningApiGroupsClient { final String search = '', final int? limit, final int offset = 0, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/groups/{groupId}/users/details'; final queryParameters = {}; @@ -730,7 +730,7 @@ class ProvisioningApiGroupsClient { if (offset != 0) { queryParameters['offset'] = offset.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -751,7 +751,7 @@ class ProvisioningApiGroupsClient { /// This endpoint requires admin access Future getSubAdminsOfGroup({ required final String groupId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/groups/{groupId}/subadmins'; final queryParameters = {}; @@ -778,7 +778,7 @@ class ProvisioningApiGroupsClient { ); // coverage:ignore-line } path = path.replaceAll('{groupId}', Uri.encodeQueryComponent(groupId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -798,7 +798,7 @@ class ProvisioningApiGroupsClient { @Deprecated('') Future getGroup({ required final String groupId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/groups/{groupId}'; final queryParameters = {}; @@ -825,7 +825,7 @@ class ProvisioningApiGroupsClient { ); // coverage:ignore-line } path = path.replaceAll('{groupId}', Uri.encodeQueryComponent(groupId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -848,7 +848,7 @@ class ProvisioningApiGroupsClient { required final String key, required final String value, required final String groupId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/groups/{groupId}'; final queryParameters = {}; @@ -877,7 +877,7 @@ class ProvisioningApiGroupsClient { ); // coverage:ignore-line } path = path.replaceAll('{groupId}', Uri.encodeQueryComponent(groupId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -898,7 +898,7 @@ class ProvisioningApiGroupsClient { /// This endpoint requires admin access Future deleteGroup({ required final String groupId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/groups/{groupId}'; final queryParameters = {}; @@ -925,7 +925,7 @@ class ProvisioningApiGroupsClient { ); // coverage:ignore-line } path = path.replaceAll('{groupId}', Uri.encodeQueryComponent(groupId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -952,7 +952,7 @@ class ProvisioningApiPreferencesClient { required final String configValue, required final String appId, required final String configKey, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}/{configKey}'; final queryParameters = {}; @@ -976,7 +976,7 @@ class ProvisioningApiPreferencesClient { queryParameters['configValue'] = configValue; path = path.replaceAll('{appId}', Uri.encodeQueryComponent(appId)); path = path.replaceAll('{configKey}', Uri.encodeQueryComponent(configKey)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -996,7 +996,7 @@ class ProvisioningApiPreferencesClient { Future deletePreference({ required final String appId, required final String configKey, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}/{configKey}'; final queryParameters = {}; @@ -1019,7 +1019,7 @@ class ProvisioningApiPreferencesClient { // coverage:ignore-end path = path.replaceAll('{appId}', Uri.encodeQueryComponent(appId)); path = path.replaceAll('{configKey}', Uri.encodeQueryComponent(configKey)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1039,7 +1039,7 @@ class ProvisioningApiPreferencesClient { Future setMultiplePreferences({ required final ContentString> configs, required final String appId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}'; final queryParameters = {}; @@ -1067,7 +1067,7 @@ class ProvisioningApiPreferencesClient { ]), ); path = path.replaceAll('{appId}', Uri.encodeQueryComponent(appId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1087,7 +1087,7 @@ class ProvisioningApiPreferencesClient { Future deleteMultiplePreference({ required final List configKeys, required final String appId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}'; final queryParameters = {}; @@ -1110,7 +1110,7 @@ class ProvisioningApiPreferencesClient { // coverage:ignore-end queryParameters['configKeys[]'] = configKeys.map((final e) => e); path = path.replaceAll('{appId}', Uri.encodeQueryComponent(appId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1137,7 +1137,7 @@ class ProvisioningApiUsersClient { final String search = '', final int? limit, final int offset = 0, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/cloud/users'; final queryParameters = {}; @@ -1167,7 +1167,7 @@ class ProvisioningApiUsersClient { if (offset != 0) { queryParameters['offset'] = offset.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1194,7 +1194,7 @@ class ProvisioningApiUsersClient { final String quota = '', final String language = '', final String? manager, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/cloud/users'; final queryParameters = {}; @@ -1240,7 +1240,7 @@ class ProvisioningApiUsersClient { if (manager != null) { queryParameters['manager'] = manager; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1261,7 +1261,7 @@ class ProvisioningApiUsersClient { final String search = '', final int? limit, final int offset = 0, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/cloud/users/details'; final queryParameters = {}; @@ -1291,7 +1291,7 @@ class ProvisioningApiUsersClient { if (offset != 0) { queryParameters['offset'] = offset.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1311,7 +1311,7 @@ class ProvisioningApiUsersClient { Future searchByPhoneNumbers({ required final String location, required final ContentString>> search, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/cloud/users/search/by-phone'; final queryParameters = {}; @@ -1342,7 +1342,7 @@ class ProvisioningApiUsersClient { ]), ]), ); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1361,7 +1361,7 @@ class ProvisioningApiUsersClient { /// Get the details of a user Future getUser({ required final String userId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/users/{userId}'; final queryParameters = {}; @@ -1383,7 +1383,7 @@ class ProvisioningApiUsersClient { } // coverage:ignore-end path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1404,7 +1404,7 @@ class ProvisioningApiUsersClient { required final String key, required final String value, required final String userId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/users/{userId}'; final queryParameters = {}; @@ -1428,7 +1428,7 @@ class ProvisioningApiUsersClient { queryParameters['key'] = key; queryParameters['value'] = value; path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1447,7 +1447,7 @@ class ProvisioningApiUsersClient { /// Delete a user Future deleteUser({ required final String userId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/users/{userId}'; final queryParameters = {}; @@ -1469,7 +1469,7 @@ class ProvisioningApiUsersClient { } // coverage:ignore-end path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1487,7 +1487,7 @@ class ProvisioningApiUsersClient { /// Get the details of the current user Future getCurrentUser({ - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/cloud/user'; final queryParameters = {}; @@ -1508,7 +1508,7 @@ class ProvisioningApiUsersClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1526,7 +1526,7 @@ class ProvisioningApiUsersClient { /// Get a list of fields that are editable for the current user Future getEditableFields({ - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/cloud/user/fields'; final queryParameters = {}; @@ -1547,7 +1547,7 @@ class ProvisioningApiUsersClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1566,7 +1566,7 @@ class ProvisioningApiUsersClient { /// Get a list of fields that are editable for a user Future getEditableFieldsForUser({ required final String userId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/user/fields/{userId}'; final queryParameters = {}; @@ -1588,7 +1588,7 @@ class ProvisioningApiUsersClient { } // coverage:ignore-end path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1610,7 +1610,7 @@ class ProvisioningApiUsersClient { required final String value, required final String userId, required final String collectionName, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/users/{userId}/{collectionName}'; final queryParameters = {}; @@ -1640,7 +1640,7 @@ class ProvisioningApiUsersClient { ); // coverage:ignore-line } path = path.replaceAll('{collectionName}', Uri.encodeQueryComponent(collectionName)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1659,7 +1659,7 @@ class ProvisioningApiUsersClient { /// Wipe all devices of a user Future wipeUserDevices({ required final String userId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/users/{userId}/wipe'; final queryParameters = {}; @@ -1681,7 +1681,7 @@ class ProvisioningApiUsersClient { } // coverage:ignore-end path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1700,7 +1700,7 @@ class ProvisioningApiUsersClient { /// Enable a user Future enableUser({ required final String userId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/users/{userId}/enable'; final queryParameters = {}; @@ -1722,7 +1722,7 @@ class ProvisioningApiUsersClient { } // coverage:ignore-end path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1741,7 +1741,7 @@ class ProvisioningApiUsersClient { /// Disable a user Future disableUser({ required final String userId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/users/{userId}/disable'; final queryParameters = {}; @@ -1763,7 +1763,7 @@ class ProvisioningApiUsersClient { } // coverage:ignore-end path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1782,7 +1782,7 @@ class ProvisioningApiUsersClient { /// Get a list of groups the user belongs to Future getUsersGroups({ required final String userId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/users/{userId}/groups'; final queryParameters = {}; @@ -1804,7 +1804,7 @@ class ProvisioningApiUsersClient { } // coverage:ignore-end path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1824,7 +1824,7 @@ class ProvisioningApiUsersClient { Future addToGroup({ required final String userId, final String groupid = '', - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/users/{userId}/groups'; final queryParameters = {}; @@ -1849,7 +1849,7 @@ class ProvisioningApiUsersClient { if (groupid != '') { queryParameters['groupid'] = groupid; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1869,7 +1869,7 @@ class ProvisioningApiUsersClient { Future removeFromGroup({ required final String groupid, required final String userId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/users/{userId}/groups'; final queryParameters = {}; @@ -1892,7 +1892,7 @@ class ProvisioningApiUsersClient { // coverage:ignore-end queryParameters['groupid'] = groupid; path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1913,7 +1913,7 @@ class ProvisioningApiUsersClient { /// This endpoint requires admin access Future getUserSubAdminGroups({ required final String userId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/users/{userId}/subadmins'; final queryParameters = {}; @@ -1935,7 +1935,7 @@ class ProvisioningApiUsersClient { } // coverage:ignore-end path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -1957,7 +1957,7 @@ class ProvisioningApiUsersClient { Future addSubAdmin({ required final String groupid, required final String userId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/users/{userId}/subadmins'; final queryParameters = {}; @@ -1980,7 +1980,7 @@ class ProvisioningApiUsersClient { // coverage:ignore-end queryParameters['groupid'] = groupid; path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -2002,7 +2002,7 @@ class ProvisioningApiUsersClient { Future removeSubAdmin({ required final String groupid, required final String userId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/users/{userId}/subadmins'; final queryParameters = {}; @@ -2025,7 +2025,7 @@ class ProvisioningApiUsersClient { // coverage:ignore-end queryParameters['groupid'] = groupid; path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -2044,7 +2044,7 @@ class ProvisioningApiUsersClient { /// Resend the welcome message Future resendWelcomeMessage({ required final String userId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/cloud/users/{userId}/welcome'; final queryParameters = {}; @@ -2066,7 +2066,7 @@ class ProvisioningApiUsersClient { } // coverage:ignore-end path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), diff --git a/packages/nextcloud/lib/src/api/provisioning_api.openapi.json b/packages/nextcloud/lib/src/api/provisioning_api.openapi.json index 278d4dfe..f7651c2f 100644 --- a/packages/nextcloud/lib/src/api/provisioning_api.openapi.json +++ b/packages/nextcloud/lib/src/api/provisioning_api.openapi.json @@ -572,16 +572,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Installed apps returned", "content": { "application/json": { "schema": { @@ -653,16 +654,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "App info returned", "content": { "application/json": { "schema": { @@ -721,16 +723,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "App enabled successfully", "content": { "application/json": { "schema": { @@ -787,16 +790,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "App disabled successfully", "content": { "application/json": { "schema": { @@ -874,16 +878,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Groups returned", "content": { "application/json": { "schema": { @@ -962,16 +967,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Group created successfully", "content": { "application/json": { "schema": { @@ -1049,16 +1055,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Groups details returned", "content": { "application/json": { "schema": { @@ -1130,10 +1137,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -1260,16 +1268,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Group users details returned", "content": { "application/json": { "schema": { @@ -1357,16 +1366,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Sub admins returned", "content": { "application/json": { "schema": { @@ -1431,16 +1441,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Group users returned", "content": { "application/json": { "schema": { @@ -1529,16 +1540,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Group updated successfully", "content": { "application/json": { "schema": { @@ -1596,16 +1608,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Group deleted successfully", "content": { "application/json": { "schema": { @@ -1683,16 +1696,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Users returned", "content": { "application/json": { "schema": { @@ -1839,10 +1853,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -1946,16 +1961,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Users details returned", "content": { "application/json": { "schema": { @@ -2061,10 +2077,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -2161,16 +2178,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "User returned", "content": { "application/json": { "schema": { @@ -2246,16 +2264,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "User value edited successfully", "content": { "application/json": { "schema": { @@ -2311,16 +2330,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "User deleted successfully", "content": { "application/json": { "schema": { @@ -2369,16 +2389,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Current user returned", "content": { "application/json": { "schema": { @@ -2429,16 +2450,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Editable fields returned", "content": { "application/json": { "schema": { @@ -2501,16 +2523,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Editable fields for user returned", "content": { "application/json": { "schema": { @@ -2601,16 +2624,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "User values edited successfully", "content": { "application/json": { "schema": { @@ -2668,16 +2692,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Wiped all user devices successfully", "content": { "application/json": { "schema": { @@ -2735,16 +2760,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "User enabled successfully", "content": { "application/json": { "schema": { @@ -2802,16 +2828,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "User disabled successfully", "content": { "application/json": { "schema": { @@ -2869,16 +2896,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Users groups returned", "content": { "application/json": { "schema": { @@ -2956,16 +2984,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "User added to group successfully", "content": { "application/json": { "schema": { @@ -3030,16 +3059,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "User removed from group successfully", "content": { "application/json": { "schema": { @@ -3098,16 +3128,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "User subadmin groups returned", "content": { "application/json": { "schema": { @@ -3178,16 +3209,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "User added as group subadmin successfully", "content": { "application/json": { "schema": { @@ -3253,16 +3285,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "User removed as group subadmin successfully", "content": { "application/json": { "schema": { @@ -3320,16 +3353,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Resent welcome message successfully", "content": { "application/json": { "schema": { @@ -3379,16 +3413,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Apps returned", "content": { "application/json": { "schema": { @@ -3460,10 +3495,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -3605,10 +3641,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -3744,10 +3781,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -3865,10 +3903,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -3996,10 +4035,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -4098,10 +4138,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -4210,10 +4251,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -4315,10 +4357,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], diff --git a/packages/nextcloud/lib/src/api/settings.openapi.json b/packages/nextcloud/lib/src/api/settings.openapi.json index 1e8b1831..379e250d 100644 --- a/packages/nextcloud/lib/src/api/settings.openapi.json +++ b/packages/nextcloud/lib/src/api/settings.openapi.json @@ -41,7 +41,7 @@ ], "responses": { "200": { - "description": "", + "description": "Logfile returned", "headers": { "Content-Disposition": { "schema": { diff --git a/packages/nextcloud/lib/src/api/theming.openapi.dart b/packages/nextcloud/lib/src/api/theming.openapi.dart index 971ba86e..1ac3c481 100644 --- a/packages/nextcloud/lib/src/api/theming.openapi.dart +++ b/packages/nextcloud/lib/src/api/theming.openapi.dart @@ -315,7 +315,7 @@ class ThemingUserThemeClient { final ThemingClient _rootClient; /// Get the background image - Future getBackground({final String oCSAPIRequest = 'true'}) async { + Future getBackground({final bool oCSAPIRequest = true}) async { const path = '/index.php/apps/theming/background'; final queryParameters = {}; final headers = { @@ -335,7 +335,7 @@ class ThemingUserThemeClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -353,7 +353,7 @@ class ThemingUserThemeClient { required final String type, final String value = '', final String? color, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/index.php/apps/theming/background/{type}'; final queryParameters = {}; @@ -381,7 +381,7 @@ class ThemingUserThemeClient { if (color != null) { queryParameters['color'] = color; } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'post', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -396,7 +396,7 @@ class ThemingUserThemeClient { } /// Delete the background - Future deleteBackground({final String oCSAPIRequest = 'true'}) async { + Future deleteBackground({final bool oCSAPIRequest = true}) async { const path = '/index.php/apps/theming/background/custom'; final queryParameters = {}; final headers = { @@ -416,7 +416,7 @@ class ThemingUserThemeClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -433,7 +433,7 @@ class ThemingUserThemeClient { /// Enable theme Future enableTheme({ required final String themeId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/theming/api/v1/theme/{themeId}/enable'; final queryParameters = {}; @@ -455,7 +455,7 @@ class ThemingUserThemeClient { } // coverage:ignore-end path = path.replaceAll('{themeId}', Uri.encodeQueryComponent(themeId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -474,7 +474,7 @@ class ThemingUserThemeClient { /// Disable theme Future disableTheme({ required final String themeId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/theming/api/v1/theme/{themeId}'; final queryParameters = {}; @@ -496,7 +496,7 @@ class ThemingUserThemeClient { } // coverage:ignore-end path = path.replaceAll('{themeId}', Uri.encodeQueryComponent(themeId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), diff --git a/packages/nextcloud/lib/src/api/theming.openapi.json b/packages/nextcloud/lib/src/api/theming.openapi.json index db15aff8..2cfef0be 100644 --- a/packages/nextcloud/lib/src/api/theming.openapi.json +++ b/packages/nextcloud/lib/src/api/theming.openapi.json @@ -310,7 +310,7 @@ ], "responses": { "200": { - "description": "", + "description": "Manifest returned", "content": { "application/json": { "schema": { @@ -595,10 +595,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -673,10 +674,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -749,16 +751,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Background deleted successfully", "content": { "application/json": { "schema": { @@ -798,10 +801,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -885,10 +889,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], diff --git a/packages/nextcloud/lib/src/api/updatenotification.openapi.dart b/packages/nextcloud/lib/src/api/updatenotification.openapi.dart index d6880bbf..75934437 100644 --- a/packages/nextcloud/lib/src/api/updatenotification.openapi.dart +++ b/packages/nextcloud/lib/src/api/updatenotification.openapi.dart @@ -83,7 +83,7 @@ class UpdatenotificationApiClient { Future getAppList({ required final String newVersion, final UpdatenotificationApiGetAppListApiVersion apiVersion = UpdatenotificationApiGetAppListApiVersion.v1, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/updatenotification/api/{apiVersion}/applist/{newVersion}'; final queryParameters = {}; @@ -106,7 +106,7 @@ class UpdatenotificationApiClient { // coverage:ignore-end path = path.replaceAll('{newVersion}', Uri.encodeQueryComponent(newVersion)); path = path.replaceAll('{apiVersion}', Uri.encodeQueryComponent(apiVersion.name)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), diff --git a/packages/nextcloud/lib/src/api/updatenotification.openapi.json b/packages/nextcloud/lib/src/api/updatenotification.openapi.json index 820f1426..06d71542 100644 --- a/packages/nextcloud/lib/src/api/updatenotification.openapi.json +++ b/packages/nextcloud/lib/src/api/updatenotification.openapi.json @@ -104,10 +104,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], diff --git a/packages/nextcloud/lib/src/api/user_status.openapi.dart b/packages/nextcloud/lib/src/api/user_status.openapi.dart index dc7e5c4c..96563011 100644 --- a/packages/nextcloud/lib/src/api/user_status.openapi.dart +++ b/packages/nextcloud/lib/src/api/user_status.openapi.dart @@ -87,7 +87,7 @@ class UserStatusHeartbeatClient { /// Keep the status alive Future heartbeat({ required final String status, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/user_status/api/v1/heartbeat'; final queryParameters = {}; @@ -109,7 +109,7 @@ class UserStatusHeartbeatClient { } // coverage:ignore-end queryParameters['status'] = status; - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -132,9 +132,7 @@ class UserStatusPredefinedStatusClient { final UserStatusClient _rootClient; /// Get all predefined messages - Future findAll({ - final String oCSAPIRequest = 'true', - }) async { + Future findAll({final bool oCSAPIRequest = true}) async { const path = '/ocs/v2.php/apps/user_status/api/v1/predefined_statuses'; final queryParameters = {}; final headers = { @@ -154,7 +152,7 @@ class UserStatusPredefinedStatusClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -180,7 +178,7 @@ class UserStatusStatusesClient { Future findAll({ final int? limit, final int? offset, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/user_status/api/v1/statuses'; final queryParameters = {}; @@ -207,7 +205,7 @@ class UserStatusStatusesClient { if (offset != null) { queryParameters['offset'] = offset.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -226,7 +224,7 @@ class UserStatusStatusesClient { /// Find the status of a user Future find({ required final String userId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/user_status/api/v1/statuses/{userId}'; final queryParameters = {}; @@ -248,7 +246,7 @@ class UserStatusStatusesClient { } // coverage:ignore-end path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -271,7 +269,7 @@ class UserStatusUserStatusClient { final UserStatusClient _rootClient; /// Get the status of the current user - Future getStatus({final String oCSAPIRequest = 'true'}) async { + Future getStatus({final bool oCSAPIRequest = true}) async { const path = '/ocs/v2.php/apps/user_status/api/v1/user_status'; final queryParameters = {}; final headers = { @@ -291,7 +289,7 @@ class UserStatusUserStatusClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -310,7 +308,7 @@ class UserStatusUserStatusClient { /// Update the status type of the current user Future setStatus({ required final String statusType, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/user_status/api/v1/user_status/status'; final queryParameters = {}; @@ -332,7 +330,7 @@ class UserStatusUserStatusClient { } // coverage:ignore-end queryParameters['statusType'] = statusType; - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -352,7 +350,7 @@ class UserStatusUserStatusClient { Future setPredefinedMessage({ required final String messageId, final int? clearAt, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/user_status/api/v1/user_status/message/predefined'; final queryParameters = {}; @@ -377,7 +375,7 @@ class UserStatusUserStatusClient { if (clearAt != null) { queryParameters['clearAt'] = clearAt.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -398,7 +396,7 @@ class UserStatusUserStatusClient { final String? statusIcon, final String? message, final int? clearAt, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/user_status/api/v1/user_status/message/custom'; final queryParameters = {}; @@ -428,7 +426,7 @@ class UserStatusUserStatusClient { if (clearAt != null) { queryParameters['clearAt'] = clearAt.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -446,7 +444,7 @@ class UserStatusUserStatusClient { /// Clear the message of the current user Future clearMessage({ - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/user_status/api/v1/user_status/message'; final queryParameters = {}; @@ -467,7 +465,7 @@ class UserStatusUserStatusClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -486,7 +484,7 @@ class UserStatusUserStatusClient { /// Revert the status to the previous status Future revertStatus({ required final String messageId, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { var path = '/ocs/v2.php/apps/user_status/api/v1/user_status/revert/{messageId}'; final queryParameters = {}; @@ -508,7 +506,7 @@ class UserStatusUserStatusClient { } // coverage:ignore-end path = path.replaceAll('{messageId}', Uri.encodeQueryComponent(messageId)); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'delete', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), diff --git a/packages/nextcloud/lib/src/api/user_status.openapi.json b/packages/nextcloud/lib/src/api/user_status.openapi.json index 8cd090dd..77008c91 100644 --- a/packages/nextcloud/lib/src/api/user_status.openapi.json +++ b/packages/nextcloud/lib/src/api/user_status.openapi.json @@ -235,16 +235,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Statuses returned", "content": { "application/json": { "schema": { @@ -307,16 +308,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "The status was found successfully", + "description": "Status returned", "content": { "application/json": { "schema": { @@ -377,10 +379,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -456,10 +459,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -545,10 +549,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -643,10 +648,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -713,16 +719,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Message cleared successfully", "content": { "application/json": { "schema": { @@ -780,10 +787,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -845,16 +853,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Predefined statuses returned", "content": { "application/json": { "schema": { @@ -917,10 +926,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], diff --git a/packages/nextcloud/lib/src/api/weather_status.openapi.dart b/packages/nextcloud/lib/src/api/weather_status.openapi.dart index 9ff72206..a0da9696 100644 --- a/packages/nextcloud/lib/src/api/weather_status.openapi.dart +++ b/packages/nextcloud/lib/src/api/weather_status.openapi.dart @@ -80,7 +80,7 @@ class WeatherStatusWeatherStatusClient { /// Change the weather status mode. There are currently 2 modes: - ask the browser - use the user defined address Future setMode({ required final int mode, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/weather_status/api/v1/mode'; final queryParameters = {}; @@ -102,7 +102,7 @@ class WeatherStatusWeatherStatusClient { } // coverage:ignore-end queryParameters['mode'] = mode.toString(); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -120,7 +120,7 @@ class WeatherStatusWeatherStatusClient { /// Try to use the address set in user personal settings as weather location Future usePersonalAddress({ - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/weather_status/api/v1/use-personal'; final queryParameters = {}; @@ -141,7 +141,7 @@ class WeatherStatusWeatherStatusClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -159,7 +159,7 @@ class WeatherStatusWeatherStatusClient { /// Get stored user location Future getLocation({ - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/weather_status/api/v1/location'; final queryParameters = {}; @@ -180,7 +180,7 @@ class WeatherStatusWeatherStatusClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -201,7 +201,7 @@ class WeatherStatusWeatherStatusClient { final String? address, final num? lat, final num? lon, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/weather_status/api/v1/location'; final queryParameters = {}; @@ -231,7 +231,7 @@ class WeatherStatusWeatherStatusClient { if (lon != null) { queryParameters['lon'] = lon.toString(); } - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -249,7 +249,7 @@ class WeatherStatusWeatherStatusClient { /// Get forecast for current location Future getForecast({ - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/weather_status/api/v1/forecast'; final queryParameters = {}; @@ -270,7 +270,7 @@ class WeatherStatusWeatherStatusClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -288,7 +288,7 @@ class WeatherStatusWeatherStatusClient { /// Get favorites list Future getFavorites({ - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/weather_status/api/v1/favorites'; final queryParameters = {}; @@ -309,7 +309,7 @@ class WeatherStatusWeatherStatusClient { throw Exception('Missing authentication for bearer_auth or basic_auth'); } // coverage:ignore-end - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'get', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), @@ -328,7 +328,7 @@ class WeatherStatusWeatherStatusClient { /// Set favorites list Future setFavorites({ required final List favorites, - final String oCSAPIRequest = 'true', + final bool oCSAPIRequest = true, }) async { const path = '/ocs/v2.php/apps/weather_status/api/v1/favorites'; final queryParameters = {}; @@ -350,7 +350,7 @@ class WeatherStatusWeatherStatusClient { } // coverage:ignore-end queryParameters['favorites[]'] = favorites.map((final e) => e); - headers['OCS-APIRequest'] = oCSAPIRequest; + headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final response = await _rootClient.doRequest( 'put', Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), diff --git a/packages/nextcloud/lib/src/api/weather_status.openapi.json b/packages/nextcloud/lib/src/api/weather_status.openapi.json index 2269e3f0..ec0f4afa 100644 --- a/packages/nextcloud/lib/src/api/weather_status.openapi.json +++ b/packages/nextcloud/lib/src/api/weather_status.openapi.json @@ -340,16 +340,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Weather status mode updated", "content": { "application/json": { "schema": { @@ -408,16 +409,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Address updated", "content": { "application/json": { "schema": { @@ -493,16 +495,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Location returned", "content": { "application/json": { "schema": { @@ -603,16 +606,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Location updated", "content": { "application/json": { "schema": { @@ -688,10 +692,11 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], @@ -789,16 +794,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Favorites returned", "content": { "application/json": { "schema": { @@ -862,16 +868,17 @@ { "name": "OCS-APIRequest", "in": "header", + "description": "Required to be true for the API request to pass", "required": true, "schema": { - "type": "string", - "default": "true" + "type": "boolean", + "default": true } } ], "responses": { "200": { - "description": "", + "description": "Favorites updated", "content": { "application/json": { "schema": {