Browse Source

Merge pull request #582 from nextcloud/fix/dynamite-conflicting-variables

Fix/dynamite conflicting variables
pull/590/head
Kate 1 year ago committed by GitHub
parent
commit
f8d0a3779f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 52
      packages/dynamite/dynamite/lib/src/openapi_builder.dart
  2. 605
      packages/nextcloud/lib/src/api/core.openapi.dart
  3. 313
      packages/nextcloud/lib/src/api/files_sharing.openapi.dart
  4. 579
      packages/nextcloud/lib/src/api/provisioning_api.openapi.dart
  5. 17
      packages/nextcloud/lib/src/api/settings.openapi.dart
  6. 155
      packages/nextcloud/lib/src/api/theming.openapi.dart
  7. 146
      packages/nextcloud/lib/src/api/user_status.openapi.dart

52
packages/dynamite/dynamite/lib/src/openapi_builder.dart

@ -276,7 +276,7 @@ class OpenAPIBuilder implements Builder {
..fields.add( ..fields.add(
Field( Field(
(final b) => b (final b) => b
..name = 'rootClient' ..name = '_rootClient'
..type = refer('${classPrefix}Client') ..type = refer('${classPrefix}Client')
..modifier = FieldModifier.final$, ..modifier = FieldModifier.final$,
), ),
@ -286,7 +286,7 @@ class OpenAPIBuilder implements Builder {
(final b) => b.requiredParameters.add( (final b) => b.requiredParameters.add(
Parameter( Parameter(
(final b) => b (final b) => b
..name = 'rootClient' ..name = '_rootClient'
..toThis = true, ..toThis = true,
), ),
), ),
@ -315,7 +315,7 @@ class OpenAPIBuilder implements Builder {
..lambda = true ..lambda = true
..type = MethodType.getter ..type = MethodType.getter
..returns = refer('$classPrefix${_clientName(t)}') ..returns = refer('$classPrefix${_clientName(t)}')
..body = Code('$classPrefix${_clientName(t)}(${isRootClient ? 'this' : 'rootClient'})'), ..body = Code('$classPrefix${_clientName(t)}(${isRootClient ? 'this' : '_rootClient'})'),
), ),
], ],
for (final path in paths.keys) ...[ for (final path in paths.keys) ...[
@ -364,10 +364,10 @@ class OpenAPIBuilder implements Builder {
{}) {})
.join(','); .join(',');
final code = StringBuffer(''' final code = StringBuffer('''
var path = '$path'; var _path = '$path';
final queryParameters = <String, dynamic>{}; final _queryParameters = <String, dynamic>{};
final headers = <String, String>{${acceptHeader.isNotEmpty ? "'Accept': '$acceptHeader'," : ''}}; final _headers = <String, String>{${acceptHeader.isNotEmpty ? "'Accept': '$acceptHeader'," : ''}};
Uint8List? body; Uint8List? _body;
'''); ''');
final security = operation.security ?? spec.security ?? []; final security = operation.security ?? spec.security ?? [];
@ -377,8 +377,8 @@ class OpenAPIBuilder implements Builder {
for (final requirement in securityRequirements) { for (final requirement in securityRequirements) {
final securityScheme = spec.components!.securitySchemes![requirement.keys.single]!; final securityScheme = spec.components!.securitySchemes![requirement.keys.single]!;
code.write(''' code.write('''
if (${isRootClient ? '' : 'rootClient.'}authentications.where((final a) => a.type == '${securityScheme.type}' && a.scheme == '${securityScheme.scheme}').isNotEmpty) { if (${isRootClient ? 'this' : '_rootClient'}.authentications.where((final a) => a.type == '${securityScheme.type}' && a.scheme == '${securityScheme.scheme}').isNotEmpty) {
headers.addAll(${isRootClient ? '' : 'rootClient.'}authentications.singleWhere((final a) => a.type == '${securityScheme.type}' && a.scheme == '${securityScheme.scheme}').headers); _headers.addAll(${isRootClient ? 'this' : '_rootClient'}.authentications.singleWhere((final a) => a.type == '${securityScheme.type}' && a.scheme == '${securityScheme.scheme}').headers);
} }
'''); ''');
if (securityRequirements.last != requirement) { if (securityRequirements.last != requirement) {
@ -475,15 +475,15 @@ class OpenAPIBuilder implements Builder {
switch (parameter.in_) { switch (parameter.in_) {
case 'path': case 'path':
code.write( code.write(
"path = path.replaceAll('{${parameter.name}}', Uri.encodeQueryComponent($value));", "_path = _path.replaceAll('{${parameter.name}}', Uri.encodeQueryComponent($value));",
); );
case 'query': case 'query':
code.write( code.write(
"queryParameters['${parameter.name}'] = $value;", "_queryParameters['${parameter.name}'] = $value;",
); );
case 'header': case 'header':
code.write( code.write(
"headers['${parameter.name}'] = $value;", "_headers['${parameter.name}'] = $value;",
); );
default: default:
throw Exception('Can not work with parameter in "${parameter.in_}"'); throw Exception('Can not work with parameter in "${parameter.in_}"');
@ -503,7 +503,7 @@ class OpenAPIBuilder implements Builder {
for (final mimeType in operation.requestBody!.content!.keys) { for (final mimeType in operation.requestBody!.content!.keys) {
final mediaType = operation.requestBody!.content![mimeType]!; final mediaType = operation.requestBody!.content![mimeType]!;
code.write("headers['Content-Type'] = '$mimeType';"); code.write("_headers['Content-Type'] = '$mimeType';");
final dartParameterNullable = _isDartParameterNullable( final dartParameterNullable = _isDartParameterNullable(
operation.requestBody!.required, operation.requestBody!.required,
@ -541,7 +541,7 @@ class OpenAPIBuilder implements Builder {
code.write('if ($parameterName != null) {'); code.write('if ($parameterName != null) {');
} }
code.write( code.write(
'body = Uint8List.fromList(utf8.encode(${result.encode(parameterName, mimeType: mimeType)}));', '_body = Uint8List.fromList(utf8.encode(${result.encode(parameterName, mimeType: mimeType)}));',
); );
if (dartParameterNullable) { if (dartParameterNullable) {
code.write('}'); code.write('}');
@ -554,11 +554,11 @@ class OpenAPIBuilder implements Builder {
code.write( code.write(
''' '''
final response = await ${isRootClient ? '' : 'rootClient.'}doRequest( final _response = await ${isRootClient ? 'this' : '_rootClient'}.doRequest(
'$httpMethod', '$httpMethod',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: _path, queryParameters: _queryParameters.isNotEmpty ? _queryParameters : null).toString(),
headers, _headers,
body, _body,
); );
''', ''',
); );
@ -569,7 +569,7 @@ class OpenAPIBuilder implements Builder {
} }
for (final statusCode in operation.responses!.keys) { for (final statusCode in operation.responses!.keys) {
final response = operation.responses![statusCode]!; final response = operation.responses![statusCode]!;
code.write('if (response.statusCode == $statusCode) {'); code.write('if (_response.statusCode == $statusCode) {');
String? headersType; String? headersType;
String? headersValue; String? headersValue;
@ -592,7 +592,7 @@ class OpenAPIBuilder implements Builder {
isHeader: true, isHeader: true,
); );
headersType = result.name; headersType = result.name;
headersValue = result.deserialize('response.responseHeaders'); headersValue = result.deserialize('_response.responseHeaders');
} }
String? dataType; String? dataType;
@ -620,24 +620,24 @@ class OpenAPIBuilder implements Builder {
mimeType == 'application/octet-stream' || mimeType == 'application/octet-stream' ||
mimeType.startsWith('image/')) { mimeType.startsWith('image/')) {
dataType = 'Uint8List'; dataType = 'Uint8List';
dataValue = 'response.bodyBytes'; dataValue = '_response.bodyBytes';
dataNeedsAwait = true; dataNeedsAwait = true;
} else if (mimeType.startsWith('text/')) { } else if (mimeType.startsWith('text/')) {
dataType = 'String'; dataType = 'String';
dataValue = 'response.body'; dataValue = '_response.body';
dataNeedsAwait = true; dataNeedsAwait = true;
} else if (mimeType == 'application/json') { } else if (mimeType == 'application/json') {
dataType = result.name; dataType = result.name;
if (result.name == 'dynamic') { if (result.name == 'dynamic') {
dataValue = ''; dataValue = '';
} else if (result.name == 'String') { } else if (result.name == 'String') {
dataValue = 'response.body'; dataValue = '_response.body';
dataNeedsAwait = true; dataNeedsAwait = true;
} else if (result is TypeResultEnum || result is TypeResultBase) { } else if (result is TypeResultEnum || result is TypeResultBase) {
dataValue = result.deserialize(result.decode('await response.body')); dataValue = result.deserialize(result.decode('await _response.body'));
dataNeedsAwait = false; dataNeedsAwait = false;
} else { } else {
dataValue = result.deserialize('await response.jsonBody'); dataValue = result.deserialize('await _response.jsonBody');
dataNeedsAwait = false; dataNeedsAwait = false;
} }
} else { } else {
@ -665,7 +665,7 @@ class OpenAPIBuilder implements Builder {
code.write('}'); code.write('}');
} }
code.write( code.write(
'throw await ${classPrefix}ApiException.fromResponse(response); // coverage:ignore-line\n', 'throw await ${classPrefix}ApiException.fromResponse(_response); // coverage:ignore-line\n',
); );
} else { } else {
b.returns = refer('Future'); b.returns = refer('Future');

605
packages/nextcloud/lib/src/api/core.openapi.dart

File diff suppressed because it is too large Load Diff

313
packages/nextcloud/lib/src/api/files_sharing.openapi.dart

@ -82,9 +82,9 @@ class FilesSharingClient extends DynamiteClient {
} }
class FilesSharingDeletedShareapiClient { class FilesSharingDeletedShareapiClient {
FilesSharingDeletedShareapiClient(this.rootClient); FilesSharingDeletedShareapiClient(this._rootClient);
final FilesSharingClient rootClient; final FilesSharingClient _rootClient;
/// Get a list of all deleted shares /// Get a list of all deleted shares
Future<FilesSharingDeletedShareapiListResponse200ApplicationJson> list({final String oCSAPIRequest = 'true'}) async { Future<FilesSharingDeletedShareapiListResponse200ApplicationJson> list({final String oCSAPIRequest = 'true'}) async {
@ -95,19 +95,20 @@ class FilesSharingDeletedShareapiClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -134,20 +135,21 @@ class FilesSharingDeletedShareapiClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
path = path.replaceAll('{id}', Uri.encodeQueryComponent(id)); path = path.replaceAll('{id}', Uri.encodeQueryComponent(id));
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'post', 'post',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -164,9 +166,9 @@ class FilesSharingDeletedShareapiClient {
} }
class FilesSharingPublicPreviewClient { class FilesSharingPublicPreviewClient {
FilesSharingPublicPreviewClient(this.rootClient); FilesSharingPublicPreviewClient(this._rootClient);
final FilesSharingClient rootClient; final FilesSharingClient _rootClient;
/// Get a direct link preview for a shared file /// Get a direct link preview for a shared file
Future<Uint8List> directLink({ Future<Uint8List> directLink({
@ -180,18 +182,19 @@ class FilesSharingPublicPreviewClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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 // coverage:ignore-end
path = path.replaceAll('{token}', Uri.encodeQueryComponent(token)); path = path.replaceAll('{token}', Uri.encodeQueryComponent(token));
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -219,13 +222,14 @@ class FilesSharingPublicPreviewClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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 // coverage:ignore-end
path = path.replaceAll('{token}', Uri.encodeQueryComponent(token)); path = path.replaceAll('{token}', Uri.encodeQueryComponent(token));
@ -242,7 +246,7 @@ class FilesSharingPublicPreviewClient {
queryParameters['a'] = a.toString(); queryParameters['a'] = a.toString();
} }
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -256,9 +260,9 @@ class FilesSharingPublicPreviewClient {
} }
class FilesSharingRemoteClient { class FilesSharingRemoteClient {
FilesSharingRemoteClient(this.rootClient); FilesSharingRemoteClient(this._rootClient);
final FilesSharingClient rootClient; final FilesSharingClient _rootClient;
/// Get a list of accepted remote shares /// Get a list of accepted remote shares
Future<FilesSharingRemoteGetSharesResponse200ApplicationJson> getShares({final String oCSAPIRequest = 'true'}) async { Future<FilesSharingRemoteGetSharesResponse200ApplicationJson> getShares({final String oCSAPIRequest = 'true'}) async {
@ -269,19 +273,20 @@ class FilesSharingRemoteClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -307,19 +312,20 @@ class FilesSharingRemoteClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -346,20 +352,21 @@ class FilesSharingRemoteClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString())); path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString()));
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'post', 'post',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -386,20 +393,21 @@ class FilesSharingRemoteClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString())); path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString()));
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'delete', 'delete',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -426,20 +434,21 @@ class FilesSharingRemoteClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString())); path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString()));
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -466,20 +475,21 @@ class FilesSharingRemoteClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString())); path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString()));
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'delete', 'delete',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -496,9 +506,9 @@ class FilesSharingRemoteClient {
} }
class FilesSharingShareInfoClient { class FilesSharingShareInfoClient {
FilesSharingShareInfoClient(this.rootClient); FilesSharingShareInfoClient(this._rootClient);
final FilesSharingClient rootClient; final FilesSharingClient _rootClient;
/// Get the info about a share /// Get the info about a share
Future<FilesSharingShareInfo> info({ Future<FilesSharingShareInfo> info({
@ -514,13 +524,14 @@ class FilesSharingShareInfoClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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 // coverage:ignore-end
queryParameters['t'] = t; queryParameters['t'] = t;
@ -533,7 +544,7 @@ class FilesSharingShareInfoClient {
if (depth != -1) { if (depth != -1) {
queryParameters['depth'] = depth.toString(); queryParameters['depth'] = depth.toString();
} }
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'post', 'post',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -550,9 +561,9 @@ class FilesSharingShareInfoClient {
} }
class FilesSharingShareapiClient { class FilesSharingShareapiClient {
FilesSharingShareapiClient(this.rootClient); FilesSharingShareapiClient(this._rootClient);
final FilesSharingClient rootClient; final FilesSharingClient _rootClient;
/// Get shares of the current user /// Get shares of the current user
Future<FilesSharingShareapiGetSharesResponse200ApplicationJson> getShares({ Future<FilesSharingShareapiGetSharesResponse200ApplicationJson> getShares({
@ -563,20 +574,21 @@ class FilesSharingShareapiClient {
final String includeTags = 'false', final String includeTags = 'false',
final String oCSAPIRequest = 'true', final String oCSAPIRequest = 'true',
}) async { }) async {
const path = '/ocs/v2.php/apps/files_sharing/api/v1/shares'; const path0 = '/ocs/v2.php/apps/files_sharing/api/v1/shares';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{ final headers = <String, String>{
'Accept': 'application/json', 'Accept': 'application/json',
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
@ -597,9 +609,9 @@ class FilesSharingShareapiClient {
queryParameters['include_tags'] = includeTags; queryParameters['include_tags'] = includeTags;
} }
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
body, body,
); );
@ -627,25 +639,28 @@ class FilesSharingShareapiClient {
final String? attributes, final String? attributes,
final String oCSAPIRequest = 'true', final String oCSAPIRequest = 'true',
}) async { }) async {
const path = '/ocs/v2.php/apps/files_sharing/api/v1/shares'; const path0 = '/ocs/v2.php/apps/files_sharing/api/v1/shares';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{ final headers = <String, String>{
'Accept': 'application/json', 'Accept': 'application/json',
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
queryParameters['path'] = path; if (path != null) {
queryParameters['path'] = path;
}
if (permissions != null) { if (permissions != null) {
queryParameters['permissions'] = permissions.toString(); queryParameters['permissions'] = permissions.toString();
} }
@ -677,9 +692,9 @@ class FilesSharingShareapiClient {
queryParameters['attributes'] = attributes; queryParameters['attributes'] = attributes;
} }
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'post', 'post',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
body, body,
); );
@ -697,29 +712,30 @@ class FilesSharingShareapiClient {
required final String path, required final String path,
final String oCSAPIRequest = 'true', final String oCSAPIRequest = 'true',
}) async { }) async {
const path = '/ocs/v2.php/apps/files_sharing/api/v1/shares/inherited'; const path0 = '/ocs/v2.php/apps/files_sharing/api/v1/shares/inherited';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{ final headers = <String, String>{
'Accept': 'application/json', 'Accept': 'application/json',
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
queryParameters['path'] = path; queryParameters['path'] = path;
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
body, body,
); );
@ -743,19 +759,20 @@ class FilesSharingShareapiClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -783,13 +800,14 @@ class FilesSharingShareapiClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
@ -799,7 +817,7 @@ class FilesSharingShareapiClient {
queryParameters['include_tags'] = includeTags.toString(); queryParameters['include_tags'] = includeTags.toString();
} }
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -835,13 +853,14 @@ class FilesSharingShareapiClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
@ -875,7 +894,7 @@ class FilesSharingShareapiClient {
queryParameters['attributes'] = attributes; queryParameters['attributes'] = attributes;
} }
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'put', 'put',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -902,20 +921,21 @@ class FilesSharingShareapiClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
path = path.replaceAll('{id}', Uri.encodeQueryComponent(id)); path = path.replaceAll('{id}', Uri.encodeQueryComponent(id));
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'delete', 'delete',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -942,20 +962,21 @@ class FilesSharingShareapiClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
path = path.replaceAll('{id}', Uri.encodeQueryComponent(id)); path = path.replaceAll('{id}', Uri.encodeQueryComponent(id));
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'post', 'post',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -972,9 +993,9 @@ class FilesSharingShareapiClient {
} }
class FilesSharingShareesapiClient { class FilesSharingShareesapiClient {
FilesSharingShareesapiClient(this.rootClient); FilesSharingShareesapiClient(this._rootClient);
final FilesSharingClient rootClient; final FilesSharingClient _rootClient;
/// Search for sharees /// Search for sharees
Future< Future<
@ -995,13 +1016,14 @@ class FilesSharingShareesapiClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
@ -1028,7 +1050,7 @@ class FilesSharingShareesapiClient {
queryParameters['lookup'] = lookup.toString(); queryParameters['lookup'] = lookup.toString();
} }
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -1063,13 +1085,14 @@ class FilesSharingShareesapiClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
@ -1082,7 +1105,7 @@ class FilesSharingShareesapiClient {
); );
} }
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,

579
packages/nextcloud/lib/src/api/provisioning_api.openapi.dart

File diff suppressed because it is too large Load Diff

17
packages/nextcloud/lib/src/api/settings.openapi.dart

@ -75,9 +75,9 @@ class SettingsClient extends DynamiteClient {
} }
class SettingsLogSettingsClient { class SettingsLogSettingsClient {
SettingsLogSettingsClient(this.rootClient); SettingsLogSettingsClient(this._rootClient);
final SettingsClient rootClient; final SettingsClient _rootClient;
/// download logfile /// download logfile
/// ///
@ -90,18 +90,19 @@ class SettingsLogSettingsClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,

155
packages/nextcloud/lib/src/api/theming.openapi.dart

@ -79,9 +79,9 @@ class ThemingClient extends DynamiteClient {
} }
class ThemingIconClient { class ThemingIconClient {
ThemingIconClient(this.rootClient); ThemingIconClient(this._rootClient);
final ThemingClient rootClient; final ThemingClient _rootClient;
/// Return a 32x32 favicon as png /// Return a 32x32 favicon as png
Future<Uint8List> getFavicon({final String app = 'core'}) async { Future<Uint8List> getFavicon({final String app = 'core'}) async {
@ -92,17 +92,18 @@ class ThemingIconClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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 // coverage:ignore-end
path = path.replaceAll('{app}', Uri.encodeQueryComponent(app)); path = path.replaceAll('{app}', Uri.encodeQueryComponent(app));
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -123,17 +124,18 @@ class ThemingIconClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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 // coverage:ignore-end
path = path.replaceAll('{app}', Uri.encodeQueryComponent(app)); path = path.replaceAll('{app}', Uri.encodeQueryComponent(app));
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -157,13 +159,14 @@ class ThemingIconClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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 // coverage:ignore-end
path = path.replaceAll('{app}', Uri.encodeQueryComponent(app)); path = path.replaceAll('{app}', Uri.encodeQueryComponent(app));
@ -171,7 +174,7 @@ class ThemingIconClient {
throw Exception('Invalid value "$image" for parameter "image" with pattern "${r'^.+$'}"'); // coverage:ignore-line throw Exception('Invalid value "$image" for parameter "image" with pattern "${r'^.+$'}"'); // coverage:ignore-line
} }
path = path.replaceAll('{image}', Uri.encodeQueryComponent(image)); path = path.replaceAll('{image}', Uri.encodeQueryComponent(image));
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -187,9 +190,9 @@ class ThemingIconClient {
/// Class ThemingController /// Class ThemingController
/// handle ajax requests to update the theme /// handle ajax requests to update the theme
class ThemingThemingClient { class ThemingThemingClient {
ThemingThemingClient(this.rootClient); ThemingThemingClient(this._rootClient);
final ThemingClient rootClient; final ThemingClient _rootClient;
/// Get the CSS stylesheet for a theme /// Get the CSS stylesheet for a theme
Future<String> getThemeStylesheet({ Future<String> getThemeStylesheet({
@ -204,13 +207,14 @@ class ThemingThemingClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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 // coverage:ignore-end
path = path.replaceAll('{themeId}', Uri.encodeQueryComponent(themeId)); path = path.replaceAll('{themeId}', Uri.encodeQueryComponent(themeId));
@ -220,7 +224,7 @@ class ThemingThemingClient {
if (withCustomCss != 0) { if (withCustomCss != 0) {
queryParameters['withCustomCss'] = withCustomCss.toString(); queryParameters['withCustomCss'] = withCustomCss.toString();
} }
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -244,20 +248,21 @@ class ThemingThemingClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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 // coverage:ignore-end
path = path.replaceAll('{key}', Uri.encodeQueryComponent(key)); path = path.replaceAll('{key}', Uri.encodeQueryComponent(key));
if (useSvg != 1) { if (useSvg != 1) {
queryParameters['useSvg'] = useSvg.toString(); queryParameters['useSvg'] = useSvg.toString();
} }
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -278,17 +283,18 @@ class ThemingThemingClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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 // coverage:ignore-end
path = path.replaceAll('{app}', Uri.encodeQueryComponent(app)); path = path.replaceAll('{app}', Uri.encodeQueryComponent(app));
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -305,9 +311,9 @@ class ThemingThemingClient {
} }
class ThemingUserThemeClient { class ThemingUserThemeClient {
ThemingUserThemeClient(this.rootClient); ThemingUserThemeClient(this._rootClient);
final ThemingClient rootClient; final ThemingClient _rootClient;
/// Get the background image /// Get the background image
Future<Uint8List> getBackground({final String oCSAPIRequest = 'true'}) async { Future<Uint8List> getBackground({final String oCSAPIRequest = 'true'}) async {
@ -318,19 +324,20 @@ class ThemingUserThemeClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -356,13 +363,14 @@ class ThemingUserThemeClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
@ -375,7 +383,7 @@ class ThemingUserThemeClient {
queryParameters['color'] = color; queryParameters['color'] = color;
} }
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'post', 'post',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -397,19 +405,20 @@ class ThemingUserThemeClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'delete', 'delete',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -434,20 +443,21 @@ class ThemingUserThemeClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
path = path.replaceAll('{themeId}', Uri.encodeQueryComponent(themeId)); path = path.replaceAll('{themeId}', Uri.encodeQueryComponent(themeId));
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'put', 'put',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -474,20 +484,21 @@ class ThemingUserThemeClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
path = path.replaceAll('{themeId}', Uri.encodeQueryComponent(themeId)); path = path.replaceAll('{themeId}', Uri.encodeQueryComponent(themeId));
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'delete', 'delete',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,

146
packages/nextcloud/lib/src/api/user_status.openapi.dart

@ -80,9 +80,9 @@ class UserStatusClient extends DynamiteClient {
} }
class UserStatusHeartbeatClient { class UserStatusHeartbeatClient {
UserStatusHeartbeatClient(this.rootClient); UserStatusHeartbeatClient(this._rootClient);
final UserStatusClient rootClient; final UserStatusClient _rootClient;
/// Keep the status alive /// Keep the status alive
Future<UserStatusHeartbeatHeartbeatResponse200ApplicationJson> heartbeat({ Future<UserStatusHeartbeatHeartbeatResponse200ApplicationJson> heartbeat({
@ -96,20 +96,21 @@ class UserStatusHeartbeatClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
queryParameters['status'] = status; queryParameters['status'] = status;
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'put', 'put',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -126,9 +127,9 @@ class UserStatusHeartbeatClient {
} }
class UserStatusPredefinedStatusClient { class UserStatusPredefinedStatusClient {
UserStatusPredefinedStatusClient(this.rootClient); UserStatusPredefinedStatusClient(this._rootClient);
final UserStatusClient rootClient; final UserStatusClient _rootClient;
/// Get all predefined messages /// Get all predefined messages
Future<UserStatusPredefinedStatusFindAllResponse200ApplicationJson> findAll({ Future<UserStatusPredefinedStatusFindAllResponse200ApplicationJson> findAll({
@ -141,19 +142,20 @@ class UserStatusPredefinedStatusClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -170,9 +172,9 @@ class UserStatusPredefinedStatusClient {
} }
class UserStatusStatusesClient { class UserStatusStatusesClient {
UserStatusStatusesClient(this.rootClient); UserStatusStatusesClient(this._rootClient);
final UserStatusClient rootClient; final UserStatusClient _rootClient;
/// Find statuses of users /// Find statuses of users
Future<UserStatusStatusesFindAllResponse200ApplicationJson> findAll({ Future<UserStatusStatusesFindAllResponse200ApplicationJson> findAll({
@ -187,13 +189,14 @@ class UserStatusStatusesClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
@ -205,7 +208,7 @@ class UserStatusStatusesClient {
queryParameters['offset'] = offset.toString(); queryParameters['offset'] = offset.toString();
} }
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -232,20 +235,21 @@ class UserStatusStatusesClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId)); path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId));
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -262,9 +266,9 @@ class UserStatusStatusesClient {
} }
class UserStatusUserStatusClient { class UserStatusUserStatusClient {
UserStatusUserStatusClient(this.rootClient); UserStatusUserStatusClient(this._rootClient);
final UserStatusClient rootClient; final UserStatusClient _rootClient;
/// Get the status of the current user /// Get the status of the current user
Future<UserStatusUserStatusGetStatusResponse200ApplicationJson> getStatus({ Future<UserStatusUserStatusGetStatusResponse200ApplicationJson> getStatus({
@ -277,19 +281,20 @@ class UserStatusUserStatusClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'get', 'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -316,20 +321,21 @@ class UserStatusUserStatusClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
queryParameters['statusType'] = statusType; queryParameters['statusType'] = statusType;
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'put', 'put',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -357,13 +363,14 @@ class UserStatusUserStatusClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { if (_rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) {
headers.addAll( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _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,
); );
} 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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
@ -373,7 +380,7 @@ class UserStatusUserStatusClient {
queryParameters['clearAt'] = clearAt.toString(); queryParameters['clearAt'] = clearAt.toString();
} }
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'put', 'put',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -402,13 +409,14 @@ class UserStatusUserStatusClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
@ -423,7 +431,7 @@ class UserStatusUserStatusClient {
queryParameters['clearAt'] = clearAt.toString(); queryParameters['clearAt'] = clearAt.toString();
} }
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'put', 'put',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -449,19 +457,20 @@ class UserStatusUserStatusClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'delete', 'delete',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,
@ -488,20 +497,21 @@ class UserStatusUserStatusClient {
}; };
Uint8List? body; Uint8List? body;
// coverage:ignore-start // coverage:ignore-start
if (rootClient.authentications.where((final a) => a.type == 'http' && a.scheme == 'bearer').isNotEmpty) { 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( headers.addAll(
rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'bearer').headers, _rootClient.authentications.singleWhere((final a) => a.type == 'http' && a.scheme == 'basic').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);
} else { } else {
throw Exception('Missing authentication for bearer_auth or basic_auth'); throw Exception('Missing authentication for bearer_auth or basic_auth');
} }
// coverage:ignore-end // coverage:ignore-end
path = path.replaceAll('{messageId}', Uri.encodeQueryComponent(messageId)); path = path.replaceAll('{messageId}', Uri.encodeQueryComponent(messageId));
headers['OCS-APIRequest'] = oCSAPIRequest; headers['OCS-APIRequest'] = oCSAPIRequest;
final response = await rootClient.doRequest( final response = await _rootClient.doRequest(
'delete', 'delete',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers, headers,

Loading…
Cancel
Save