Browse Source

style(dynamite,dynamite_runtime,nextcloud): unify responses and exceptions

Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
pull/846/head
Nikolas Rimikis 1 year ago
parent
commit
a4c0b26325
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 105
      packages/dynamite/dynamite/lib/src/builder/client.dart
  2. 78
      packages/dynamite/dynamite_runtime/lib/src/http_client.dart
  3. 37
      packages/nextcloud/lib/src/api/comments.openapi.dart
  4. 139
      packages/nextcloud/lib/src/api/core.openapi.dart
  5. 43
      packages/nextcloud/lib/src/api/dashboard.openapi.dart
  6. 39
      packages/nextcloud/lib/src/api/dav.openapi.dart
  7. 63
      packages/nextcloud/lib/src/api/files.openapi.dart
  8. 39
      packages/nextcloud/lib/src/api/files_external.openapi.dart
  9. 43
      packages/nextcloud/lib/src/api/files_reminders.openapi.dart
  10. 83
      packages/nextcloud/lib/src/api/files_sharing.openapi.dart
  11. 39
      packages/nextcloud/lib/src/api/files_trashbin.openapi.dart
  12. 39
      packages/nextcloud/lib/src/api/files_versions.openapi.dart
  13. 73
      packages/nextcloud/lib/src/api/news.openapi.dart
  14. 51
      packages/nextcloud/lib/src/api/notes.openapi.dart
  15. 61
      packages/nextcloud/lib/src/api/notifications.openapi.dart
  16. 123
      packages/nextcloud/lib/src/api/provisioning_api.openapi.dart
  17. 43
      packages/nextcloud/lib/src/api/settings.openapi.dart
  18. 37
      packages/nextcloud/lib/src/api/sharebymail.openapi.dart
  19. 59
      packages/nextcloud/lib/src/api/theming.openapi.dart
  20. 39
      packages/nextcloud/lib/src/api/updatenotification.openapi.dart
  21. 59
      packages/nextcloud/lib/src/api/uppush.openapi.dart
  22. 57
      packages/nextcloud/lib/src/api/user_status.openapi.dart
  23. 51
      packages/nextcloud/lib/src/api/weather_status.openapi.dart
  24. 2
      packages/nextcloud/test/helper.dart

105
packages/dynamite/dynamite/lib/src/builder/client.dart

@ -11,109 +11,10 @@ import 'package:dynamite/src/models/openapi.dart' as openapi;
import 'package:dynamite/src/models/type_result.dart'; import 'package:dynamite/src/models/type_result.dart';
import 'package:intersperse/intersperse.dart'; import 'package:intersperse/intersperse.dart';
List<Class> generateDynamiteOverrides(final State state) => [
Class(
(final b) => b
..name = '${state.classPrefix}Response'
..types.addAll([
refer('T'),
refer('U'),
])
..extend = refer('DynamiteResponse<T, U>')
..constructors.add(
Constructor(
(final b) => b
..requiredParameters.addAll(
['data', 'headers'].map(
(final name) => Parameter(
(final b) => b
..name = name
..toSuper = true,
),
),
),
),
)
..methods.add(
Method(
(final b) => b
..name = 'toString'
..returns = refer('String')
..annotations.add(refer('override'))
..lambda = true
..body = Code(
"'${state.classPrefix}Response(data: \$data, headers: \$headers)'",
),
),
),
),
Class(
(final b) => b
..name = '${state.classPrefix}ApiException'
..extend = refer('DynamiteApiException')
..constructors.add(
Constructor(
(final b) => b
..requiredParameters.addAll(
['statusCode', 'headers', 'body'].map(
(final name) => Parameter(
(final b) => b
..name = name
..toSuper = true,
),
),
),
),
)
..methods.addAll([
Method(
(final b) => b
..name = 'fromResponse'
..returns = refer('Future<${state.classPrefix}ApiException>')
..static = true
..modifier = MethodModifier.async
..requiredParameters.add(
Parameter(
(final b) => b
..name = 'response'
..type = refer('HttpClientResponse'),
),
)
..body = Code('''
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return ${state.classPrefix}ApiException(
response.statusCode,
response.responseHeaders,
body,
);
'''),
),
Method(
(final b) => b
..name = 'toString'
..returns = refer('String')
..annotations.add(refer('override'))
..lambda = true
..body = Code(
"'${state.classPrefix}ApiException(statusCode: \$statusCode, headers: \$headers, body: \$body)'",
),
),
]),
),
];
Iterable<Class> generateClients( Iterable<Class> generateClients(
final openapi.OpenAPI spec, final openapi.OpenAPI spec,
final State state, final State state,
) sync* { ) sync* {
yield* generateDynamiteOverrides(state);
final tags = generateTags(spec); final tags = generateTags(spec);
yield buildRootClient(spec, state, tags); yield buildRootClient(spec, state, tags);
@ -560,9 +461,9 @@ final _response = await $client.doRequest(
} }
if (headersType != null && dataType != null) { if (headersType != null && dataType != null) {
b.returns = refer('Future<${state.classPrefix}Response<$dataType, $headersType>>'); b.returns = refer('Future<DynamiteResponse<$dataType, $headersType>>');
code.write( code.write(
'return ${state.classPrefix}Response<$dataType, $headersType>(${dataNeedsAwait ?? false ? 'await ' : ''}$dataValue, $headersValue,);', 'return DynamiteResponse<$dataType, $headersType>(${dataNeedsAwait ?? false ? 'await ' : ''}$dataValue, $headersValue,);',
); );
} else if (headersType != null) { } else if (headersType != null) {
b.returns = refer('Future<$headersType>'); b.returns = refer('Future<$headersType>');
@ -578,7 +479,7 @@ final _response = await $client.doRequest(
code.write('}'); code.write('}');
} }
code.write( code.write(
'throw await ${state.classPrefix}ApiException.fromResponse(_response); // coverage:ignore-line\n', 'throw await DynamiteApiException.fromResponse(_response); // coverage:ignore-line\n',
); );
b.body = Code(code.toString()); b.body = Code(code.toString());

78
packages/dynamite/dynamite_runtime/lib/src/http_client.dart

@ -32,31 +32,74 @@ extension DynamiteHttpClientResponseBody on HttpClientResponse {
} }
} }
class DynamiteResponse<T, U> { /// Response returned by operations of a [DynamiteClient].
DynamiteResponse( ///
this.data, /// See:
/// * [DynamiteApiException] as the exception that can be thrown in operations
/// * [DynamiteAuthentication] for providing authentication methods.
/// * [DynamiteClient] for the client providing operations.
class DynamiteResponse<B, H> {
/// Creates a new dynamite response.
const DynamiteResponse(
this.statusCode,
this.body,
this.headers, this.headers,
); );
final T data; /// The status code of the response.
final int statusCode;
/// The decoded body of the response.
final B body;
final U headers; /// The decoded headers of the response.
final H headers;
@override @override
String toString() => 'DynamiteResponse(data: $data, headers: $headers)'; String toString() => 'DynamiteResponse(data: $body, headers: $headers, statusCode: $statusCode)';
} }
/// The exception thrown by operations of a [DynamiteClient].
///
///
/// See:
/// * [DynamiteResponse] as the response returned by an operation.
/// * [DynamiteAuthentication] for providing authentication methods.
/// * [DynamiteClient] for the client providing operations.
@immutable
class DynamiteApiException implements Exception { class DynamiteApiException implements Exception {
DynamiteApiException( /// Creates a new dynamite exception with the given information.
const DynamiteApiException(
this.statusCode, this.statusCode,
this.headers, this.headers,
this.body, this.body,
); );
/// Creates a new Exception from the given [response].
///
/// Tries to decode the `response` into a string.
static Future<DynamiteApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return DynamiteApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
/// The returned status code when the exception was thrown.
final int statusCode; final int statusCode;
/// The returned headers when the exception was thrown.
final Map<String, String> headers; final Map<String, String> headers;
/// The returned body code when the exception was thrown.
final String body; final String body;
@override @override
@ -129,7 +172,17 @@ class DynamiteHttpBearerAuthentication extends DynamiteAuthentication {
}; };
} }
/// A client for making network requests.
///
/// See:
/// * [DynamiteResponse] as the response returned by an operation.
/// * [DynamiteApiException] as the exception that can be thrown in operations
/// * [DynamiteAuthentication] for providing authentication methods.
class DynamiteClient { class DynamiteClient {
/// Creates a new dynamite network client.
///
/// If [httpClient] is not provided a default one will be created.
/// The [baseURL] will be normalized, removing any trailing `/`.
DynamiteClient( DynamiteClient(
final Uri baseURL, { final Uri baseURL, {
this.baseHeaders, this.baseHeaders,
@ -140,16 +193,27 @@ class DynamiteClient {
}) : httpClient = (httpClient ?? HttpClient())..userAgent = userAgent, }) : httpClient = (httpClient ?? HttpClient())..userAgent = userAgent,
baseURL = baseURL.normalizeEmptyPath(); baseURL = baseURL.normalizeEmptyPath();
/// The base server url used to build the request uri.
///
/// See `https://swagger.io/docs/specification/api-host-and-base-path` for
/// further information.
final Uri baseURL; final Uri baseURL;
/// The base headers added to each request.
final Map<String, String>? baseHeaders; final Map<String, String>? baseHeaders;
/// The base http client.
final HttpClient httpClient; final HttpClient httpClient;
/// The optional cookie jar to persist the response cookies.
final CookieJar? cookieJar; final CookieJar? cookieJar;
/// The available authentications for this client.
///
/// The first one matching the required authentication type will be used.
final List<DynamiteAuthentication> authentications; final List<DynamiteAuthentication> authentications;
/// Makes a request against a given [path].
Future<HttpClientResponse> doRequest( Future<HttpClientResponse> doRequest(
final String method, final String method,
final Uri path, final Uri path,

37
packages/nextcloud/lib/src/api/comments.openapi.dart

@ -7,48 +7,11 @@ import 'package:built_value/serializer.dart';
import 'package:built_value/standard_json_plugin.dart'; import 'package:built_value/standard_json_plugin.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'comments.openapi.g.dart'; part 'comments.openapi.g.dart';
class CommentsResponse<T, U> extends DynamiteResponse<T, U> {
CommentsResponse(
super.data,
super.headers,
);
@override
String toString() => 'CommentsResponse(data: $data, headers: $headers)';
}
class CommentsApiException extends DynamiteApiException {
CommentsApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<CommentsApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return CommentsApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'CommentsApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class CommentsClient extends DynamiteClient { class CommentsClient extends DynamiteClient {
CommentsClient( CommentsClient(
super.baseURL, { super.baseURL, {

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

@ -12,48 +12,11 @@ import 'package:built_value/standard_json_plugin.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'core.openapi.g.dart'; part 'core.openapi.g.dart';
class CoreResponse<T, U> extends DynamiteResponse<T, U> {
CoreResponse(
super.data,
super.headers,
);
@override
String toString() => 'CoreResponse(data: $data, headers: $headers)';
}
class CoreApiException extends DynamiteApiException {
CoreApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<CoreApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return CoreApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'CoreApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class CoreClient extends DynamiteClient { class CoreClient extends DynamiteClient {
CoreClient( CoreClient(
super.baseURL, { super.baseURL, {
@ -129,7 +92,7 @@ class CoreClient extends DynamiteClient {
return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(CoreStatus))! return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(CoreStatus))!
as CoreStatus; as CoreStatus;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -177,7 +140,7 @@ class CoreAppPasswordClient {
specifiedType: const FullType(CoreAppPasswordGetAppPasswordResponseApplicationJson), specifiedType: const FullType(CoreAppPasswordGetAppPasswordResponseApplicationJson),
)! as CoreAppPasswordGetAppPasswordResponseApplicationJson; )! as CoreAppPasswordGetAppPasswordResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Rotate app password /// Rotate app password
@ -221,7 +184,7 @@ class CoreAppPasswordClient {
specifiedType: const FullType(CoreAppPasswordRotateAppPasswordResponseApplicationJson), specifiedType: const FullType(CoreAppPasswordRotateAppPasswordResponseApplicationJson),
)! as CoreAppPasswordRotateAppPasswordResponseApplicationJson; )! as CoreAppPasswordRotateAppPasswordResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Delete app password /// Delete app password
@ -265,7 +228,7 @@ class CoreAppPasswordClient {
specifiedType: const FullType(CoreAppPasswordDeleteAppPasswordResponseApplicationJson), specifiedType: const FullType(CoreAppPasswordDeleteAppPasswordResponseApplicationJson),
)! as CoreAppPasswordDeleteAppPasswordResponseApplicationJson; )! as CoreAppPasswordDeleteAppPasswordResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -337,7 +300,7 @@ class CoreAutoCompleteClient {
specifiedType: const FullType(CoreAutoCompleteGetResponseApplicationJson), specifiedType: const FullType(CoreAutoCompleteGetResponseApplicationJson),
)! as CoreAutoCompleteGetResponseApplicationJson; )! as CoreAutoCompleteGetResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -348,7 +311,7 @@ class CoreAvatarClient {
final CoreClient _rootClient; final CoreClient _rootClient;
/// Get the dark avatar /// Get the dark avatar
Future<CoreResponse<Uint8List, CoreAvatarAvatarGetAvatarDarkHeaders>> getAvatarDark({ Future<DynamiteResponse<Uint8List, CoreAvatarAvatarGetAvatarDarkHeaders>> getAvatarDark({
required final String userId, required final String userId,
required final int size, required final int size,
}) async { }) async {
@ -383,7 +346,7 @@ class CoreAvatarClient {
body, body,
); );
if (response.statusCode == 200) { if (response.statusCode == 200) {
return CoreResponse<Uint8List, CoreAvatarAvatarGetAvatarDarkHeaders>( return DynamiteResponse<Uint8List, CoreAvatarAvatarGetAvatarDarkHeaders>(
await response.bodyBytes, await response.bodyBytes,
_jsonSerializers.deserialize( _jsonSerializers.deserialize(
response.responseHeaders, response.responseHeaders,
@ -391,11 +354,11 @@ class CoreAvatarClient {
)! as CoreAvatarAvatarGetAvatarDarkHeaders, )! as CoreAvatarAvatarGetAvatarDarkHeaders,
); );
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get the avatar /// Get the avatar
Future<CoreResponse<Uint8List, CoreAvatarAvatarGetAvatarHeaders>> getAvatar({ Future<DynamiteResponse<Uint8List, CoreAvatarAvatarGetAvatarHeaders>> getAvatar({
required final String userId, required final String userId,
required final int size, required final int size,
}) async { }) async {
@ -430,7 +393,7 @@ class CoreAvatarClient {
body, body,
); );
if (response.statusCode == 200) { if (response.statusCode == 200) {
return CoreResponse<Uint8List, CoreAvatarAvatarGetAvatarHeaders>( return DynamiteResponse<Uint8List, CoreAvatarAvatarGetAvatarHeaders>(
await response.bodyBytes, await response.bodyBytes,
_jsonSerializers.deserialize( _jsonSerializers.deserialize(
response.responseHeaders, response.responseHeaders,
@ -438,7 +401,7 @@ class CoreAvatarClient {
)! as CoreAvatarAvatarGetAvatarHeaders, )! as CoreAvatarAvatarGetAvatarHeaders,
); );
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -484,7 +447,7 @@ class CoreClientFlowLoginV2Client {
specifiedType: const FullType(CoreLoginFlowV2Credentials), specifiedType: const FullType(CoreLoginFlowV2Credentials),
)! as CoreLoginFlowV2Credentials; )! as CoreLoginFlowV2Credentials;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Init a login flow /// Init a login flow
@ -521,7 +484,7 @@ class CoreClientFlowLoginV2Client {
return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(CoreLoginFlowV2))! return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(CoreLoginFlowV2))!
as CoreLoginFlowV2; as CoreLoginFlowV2;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -573,7 +536,7 @@ class CoreCollaborationResourcesClient {
specifiedType: const FullType(CoreCollaborationResourcesSearchCollectionsResponseApplicationJson), specifiedType: const FullType(CoreCollaborationResourcesSearchCollectionsResponseApplicationJson),
)! as CoreCollaborationResourcesSearchCollectionsResponseApplicationJson; )! as CoreCollaborationResourcesSearchCollectionsResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get a collection /// Get a collection
@ -619,7 +582,7 @@ class CoreCollaborationResourcesClient {
specifiedType: const FullType(CoreCollaborationResourcesListCollectionResponseApplicationJson), specifiedType: const FullType(CoreCollaborationResourcesListCollectionResponseApplicationJson),
)! as CoreCollaborationResourcesListCollectionResponseApplicationJson; )! as CoreCollaborationResourcesListCollectionResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Rename a collection /// Rename a collection
@ -667,7 +630,7 @@ class CoreCollaborationResourcesClient {
specifiedType: const FullType(CoreCollaborationResourcesRenameCollectionResponseApplicationJson), specifiedType: const FullType(CoreCollaborationResourcesRenameCollectionResponseApplicationJson),
)! as CoreCollaborationResourcesRenameCollectionResponseApplicationJson; )! as CoreCollaborationResourcesRenameCollectionResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Add a resource to a collection /// Add a resource to a collection
@ -717,7 +680,7 @@ class CoreCollaborationResourcesClient {
specifiedType: const FullType(CoreCollaborationResourcesAddResourceResponseApplicationJson), specifiedType: const FullType(CoreCollaborationResourcesAddResourceResponseApplicationJson),
)! as CoreCollaborationResourcesAddResourceResponseApplicationJson; )! as CoreCollaborationResourcesAddResourceResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Remove a resource from a collection /// Remove a resource from a collection
@ -767,7 +730,7 @@ class CoreCollaborationResourcesClient {
specifiedType: const FullType(CoreCollaborationResourcesRemoveResourceResponseApplicationJson), specifiedType: const FullType(CoreCollaborationResourcesRemoveResourceResponseApplicationJson),
)! as CoreCollaborationResourcesRemoveResourceResponseApplicationJson; )! as CoreCollaborationResourcesRemoveResourceResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get collections by resource /// Get collections by resource
@ -815,7 +778,7 @@ class CoreCollaborationResourcesClient {
specifiedType: const FullType(CoreCollaborationResourcesGetCollectionsByResourceResponseApplicationJson), specifiedType: const FullType(CoreCollaborationResourcesGetCollectionsByResourceResponseApplicationJson),
)! as CoreCollaborationResourcesGetCollectionsByResourceResponseApplicationJson; )! as CoreCollaborationResourcesGetCollectionsByResourceResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Create a collection for a resource /// Create a collection for a resource
@ -865,7 +828,7 @@ class CoreCollaborationResourcesClient {
specifiedType: const FullType(CoreCollaborationResourcesCreateCollectionOnResourceResponseApplicationJson), specifiedType: const FullType(CoreCollaborationResourcesCreateCollectionOnResourceResponseApplicationJson),
)! as CoreCollaborationResourcesCreateCollectionOnResourceResponseApplicationJson; )! as CoreCollaborationResourcesCreateCollectionOnResourceResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -913,7 +876,7 @@ class CoreGuestAvatarClient {
if (response.statusCode == 200 || response.statusCode == 201) { if (response.statusCode == 200 || response.statusCode == 201) {
return response.bodyBytes; return response.bodyBytes;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Returns a guest avatar image response /// Returns a guest avatar image response
@ -960,7 +923,7 @@ class CoreGuestAvatarClient {
if (response.statusCode == 200 || response.statusCode == 201) { if (response.statusCode == 200 || response.statusCode == 201) {
return response.bodyBytes; return response.bodyBytes;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -1012,7 +975,7 @@ class CoreHoverCardClient {
specifiedType: const FullType(CoreHoverCardGetUserResponseApplicationJson), specifiedType: const FullType(CoreHoverCardGetUserResponseApplicationJson),
)! as CoreHoverCardGetUserResponseApplicationJson; )! as CoreHoverCardGetUserResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -1066,7 +1029,7 @@ class CoreNavigationClient {
specifiedType: const FullType(CoreNavigationGetAppsNavigationResponseApplicationJson), specifiedType: const FullType(CoreNavigationGetAppsNavigationResponseApplicationJson),
)! as CoreNavigationGetAppsNavigationResponseApplicationJson; )! as CoreNavigationGetAppsNavigationResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get the settings navigation /// Get the settings navigation
@ -1114,7 +1077,7 @@ class CoreNavigationClient {
specifiedType: const FullType(CoreNavigationGetSettingsNavigationResponseApplicationJson), specifiedType: const FullType(CoreNavigationGetSettingsNavigationResponseApplicationJson),
)! as CoreNavigationGetSettingsNavigationResponseApplicationJson; )! as CoreNavigationGetSettingsNavigationResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -1125,7 +1088,7 @@ class CoreOcmClient {
final CoreClient _rootClient; final CoreClient _rootClient;
/// generate a OCMProvider with local data and send it as DataResponse. This replaces the old PHP file ocm-provider/index.php /// generate a OCMProvider with local data and send it as DataResponse. This replaces the old PHP file ocm-provider/index.php
Future<CoreResponse<CoreOcmDiscoveryResponseApplicationJson, CoreOcmOcmDiscoveryHeaders>> discovery() async { Future<DynamiteResponse<CoreOcmDiscoveryResponseApplicationJson, CoreOcmOcmDiscoveryHeaders>> discovery() async {
const path = '/index.php/ocm-provider'; const path = '/index.php/ocm-provider';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{ final headers = <String, String>{
@ -1155,7 +1118,7 @@ class CoreOcmClient {
body, body,
); );
if (response.statusCode == 200) { if (response.statusCode == 200) {
return CoreResponse<CoreOcmDiscoveryResponseApplicationJson, CoreOcmOcmDiscoveryHeaders>( return DynamiteResponse<CoreOcmDiscoveryResponseApplicationJson, CoreOcmOcmDiscoveryHeaders>(
_jsonSerializers.deserialize( _jsonSerializers.deserialize(
await response.jsonBody, await response.jsonBody,
specifiedType: const FullType(CoreOcmDiscoveryResponseApplicationJson), specifiedType: const FullType(CoreOcmDiscoveryResponseApplicationJson),
@ -1166,7 +1129,7 @@ class CoreOcmClient {
)! as CoreOcmOcmDiscoveryHeaders, )! as CoreOcmOcmDiscoveryHeaders,
); );
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -1212,7 +1175,7 @@ class CoreOcsClient {
specifiedType: const FullType(CoreOcsGetCapabilitiesResponseApplicationJson), specifiedType: const FullType(CoreOcsGetCapabilitiesResponseApplicationJson),
)! as CoreOcsGetCapabilitiesResponseApplicationJson; )! as CoreOcsGetCapabilitiesResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -1285,7 +1248,7 @@ class CorePreviewClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return response.bodyBytes; return response.bodyBytes;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get a preview by file path /// Get a preview by file path
@ -1352,7 +1315,7 @@ class CorePreviewClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return response.bodyBytes; return response.bodyBytes;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -1408,7 +1371,7 @@ class CoreProfileApiClient {
specifiedType: const FullType(CoreProfileApiSetVisibilityResponseApplicationJson), specifiedType: const FullType(CoreProfileApiSetVisibilityResponseApplicationJson),
)! as CoreProfileApiSetVisibilityResponseApplicationJson; )! as CoreProfileApiSetVisibilityResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -1451,7 +1414,7 @@ class CoreReferenceClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return response.bodyBytes; return response.bodyBytes;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -1503,7 +1466,7 @@ class CoreReferenceApiClient {
specifiedType: const FullType(CoreReferenceApiResolveOneResponseApplicationJson), specifiedType: const FullType(CoreReferenceApiResolveOneResponseApplicationJson),
)! as CoreReferenceApiResolveOneResponseApplicationJson; )! as CoreReferenceApiResolveOneResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Resolve multiple references /// Resolve multiple references
@ -1553,7 +1516,7 @@ class CoreReferenceApiClient {
specifiedType: const FullType(CoreReferenceApiResolveResponseApplicationJson), specifiedType: const FullType(CoreReferenceApiResolveResponseApplicationJson),
)! as CoreReferenceApiResolveResponseApplicationJson; )! as CoreReferenceApiResolveResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Extract references from a text /// Extract references from a text
@ -1607,7 +1570,7 @@ class CoreReferenceApiClient {
specifiedType: const FullType(CoreReferenceApiExtractResponseApplicationJson), specifiedType: const FullType(CoreReferenceApiExtractResponseApplicationJson),
)! as CoreReferenceApiExtractResponseApplicationJson; )! as CoreReferenceApiExtractResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get the providers /// Get the providers
@ -1651,7 +1614,7 @@ class CoreReferenceApiClient {
specifiedType: const FullType(CoreReferenceApiGetProvidersInfoResponseApplicationJson), specifiedType: const FullType(CoreReferenceApiGetProvidersInfoResponseApplicationJson),
)! as CoreReferenceApiGetProvidersInfoResponseApplicationJson; )! as CoreReferenceApiGetProvidersInfoResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Touch a provider /// Touch a provider
@ -1701,7 +1664,7 @@ class CoreReferenceApiClient {
specifiedType: const FullType(CoreReferenceApiTouchProviderResponseApplicationJson), specifiedType: const FullType(CoreReferenceApiTouchProviderResponseApplicationJson),
)! as CoreReferenceApiTouchProviderResponseApplicationJson; )! as CoreReferenceApiTouchProviderResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -1747,7 +1710,7 @@ class CoreTextProcessingApiClient {
specifiedType: const FullType(CoreTextProcessingApiTaskTypesResponseApplicationJson), specifiedType: const FullType(CoreTextProcessingApiTaskTypesResponseApplicationJson),
)! as CoreTextProcessingApiTaskTypesResponseApplicationJson; )! as CoreTextProcessingApiTaskTypesResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// This endpoint allows scheduling a language model task /// This endpoint allows scheduling a language model task
@ -1799,7 +1762,7 @@ class CoreTextProcessingApiClient {
specifiedType: const FullType(CoreTextProcessingApiScheduleResponseApplicationJson), specifiedType: const FullType(CoreTextProcessingApiScheduleResponseApplicationJson),
)! as CoreTextProcessingApiScheduleResponseApplicationJson; )! as CoreTextProcessingApiScheduleResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// This endpoint allows checking the status and results of a task. Tasks are removed 1 week after receiving their last update. /// This endpoint allows checking the status and results of a task. Tasks are removed 1 week after receiving their last update.
@ -1843,7 +1806,7 @@ class CoreTextProcessingApiClient {
specifiedType: const FullType(CoreTextProcessingApiGetTaskResponseApplicationJson), specifiedType: const FullType(CoreTextProcessingApiGetTaskResponseApplicationJson),
)! as CoreTextProcessingApiGetTaskResponseApplicationJson; )! as CoreTextProcessingApiGetTaskResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// This endpoint allows to delete a scheduled task for a user /// This endpoint allows to delete a scheduled task for a user
@ -1889,7 +1852,7 @@ class CoreTextProcessingApiClient {
specifiedType: const FullType(CoreTextProcessingApiDeleteTaskResponseApplicationJson), specifiedType: const FullType(CoreTextProcessingApiDeleteTaskResponseApplicationJson),
)! as CoreTextProcessingApiDeleteTaskResponseApplicationJson; )! as CoreTextProcessingApiDeleteTaskResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// This endpoint returns a list of tasks of a user that are related with a specific appId and optionally with an identifier /// This endpoint returns a list of tasks of a user that are related with a specific appId and optionally with an identifier
@ -1939,7 +1902,7 @@ class CoreTextProcessingApiClient {
specifiedType: const FullType(CoreTextProcessingApiListTasksByAppResponseApplicationJson), specifiedType: const FullType(CoreTextProcessingApiListTasksByAppResponseApplicationJson),
)! as CoreTextProcessingApiListTasksByAppResponseApplicationJson; )! as CoreTextProcessingApiListTasksByAppResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -1985,7 +1948,7 @@ class CoreTranslationApiClient {
specifiedType: const FullType(CoreTranslationApiLanguagesResponseApplicationJson), specifiedType: const FullType(CoreTranslationApiLanguagesResponseApplicationJson),
)! as CoreTranslationApiLanguagesResponseApplicationJson; )! as CoreTranslationApiLanguagesResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Translate a text /// Translate a text
@ -2035,7 +1998,7 @@ class CoreTranslationApiClient {
specifiedType: const FullType(CoreTranslationApiTranslateResponseApplicationJson), specifiedType: const FullType(CoreTranslationApiTranslateResponseApplicationJson),
)! as CoreTranslationApiTranslateResponseApplicationJson; )! as CoreTranslationApiTranslateResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -2089,7 +2052,7 @@ class CoreUnifiedSearchClient {
specifiedType: const FullType(CoreUnifiedSearchGetProvidersResponseApplicationJson), specifiedType: const FullType(CoreUnifiedSearchGetProvidersResponseApplicationJson),
)! as CoreUnifiedSearchGetProvidersResponseApplicationJson; )! as CoreUnifiedSearchGetProvidersResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Search /// Search
@ -2158,7 +2121,7 @@ class CoreUnifiedSearchClient {
specifiedType: const FullType(CoreUnifiedSearchSearchResponseApplicationJson), specifiedType: const FullType(CoreUnifiedSearchSearchResponseApplicationJson),
)! as CoreUnifiedSearchSearchResponseApplicationJson; )! as CoreUnifiedSearchSearchResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -2206,7 +2169,7 @@ class CoreWhatsNewClient {
specifiedType: const FullType(CoreWhatsNewGetResponseApplicationJson), specifiedType: const FullType(CoreWhatsNewGetResponseApplicationJson),
)! as CoreWhatsNewGetResponseApplicationJson; )! as CoreWhatsNewGetResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Dismiss the changes /// Dismiss the changes
@ -2252,7 +2215,7 @@ class CoreWhatsNewClient {
specifiedType: const FullType(CoreWhatsNewDismissResponseApplicationJson), specifiedType: const FullType(CoreWhatsNewDismissResponseApplicationJson),
)! as CoreWhatsNewDismissResponseApplicationJson; )! as CoreWhatsNewDismissResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -2298,7 +2261,7 @@ class CoreWipeClient {
specifiedType: const FullType(CoreWipeCheckWipeResponseApplicationJson), specifiedType: const FullType(CoreWipeCheckWipeResponseApplicationJson),
)! as CoreWipeCheckWipeResponseApplicationJson; )! as CoreWipeCheckWipeResponseApplicationJson;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Finish the wipe /// Finish the wipe
@ -2338,7 +2301,7 @@ class CoreWipeClient {
specifiedType: const FullType(JsonObject), specifiedType: const FullType(JsonObject),
)! as JsonObject; )! as JsonObject;
} }
throw await CoreApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

43
packages/nextcloud/lib/src/api/dashboard.openapi.dart

@ -10,48 +10,11 @@ import 'package:built_value/standard_json_plugin.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'dashboard.openapi.g.dart'; part 'dashboard.openapi.g.dart';
class DashboardResponse<T, U> extends DynamiteResponse<T, U> {
DashboardResponse(
super.data,
super.headers,
);
@override
String toString() => 'DashboardResponse(data: $data, headers: $headers)';
}
class DashboardApiException extends DynamiteApiException {
DashboardApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<DashboardApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return DashboardApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'DashboardApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class DashboardClient extends DynamiteClient { class DashboardClient extends DynamiteClient {
DashboardClient( DashboardClient(
super.baseURL, { super.baseURL, {
@ -118,7 +81,7 @@ class DashboardDashboardApiClient {
specifiedType: const FullType(DashboardDashboardApiGetWidgetsResponseApplicationJson), specifiedType: const FullType(DashboardDashboardApiGetWidgetsResponseApplicationJson),
)! as DashboardDashboardApiGetWidgetsResponseApplicationJson; )! as DashboardDashboardApiGetWidgetsResponseApplicationJson;
} }
throw await DashboardApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get the items for the widgets /// Get the items for the widgets
@ -179,7 +142,7 @@ class DashboardDashboardApiClient {
specifiedType: const FullType(DashboardDashboardApiGetWidgetItemsResponseApplicationJson), specifiedType: const FullType(DashboardDashboardApiGetWidgetItemsResponseApplicationJson),
)! as DashboardDashboardApiGetWidgetItemsResponseApplicationJson; )! as DashboardDashboardApiGetWidgetItemsResponseApplicationJson;
} }
throw await DashboardApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get the items for the widgets /// Get the items for the widgets
@ -240,7 +203,7 @@ class DashboardDashboardApiClient {
specifiedType: const FullType(DashboardDashboardApiGetWidgetItemsV2ResponseApplicationJson), specifiedType: const FullType(DashboardDashboardApiGetWidgetItemsV2ResponseApplicationJson),
)! as DashboardDashboardApiGetWidgetItemsV2ResponseApplicationJson; )! as DashboardDashboardApiGetWidgetItemsV2ResponseApplicationJson;
} }
throw await DashboardApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

39
packages/nextcloud/lib/src/api/dav.openapi.dart

@ -9,48 +9,11 @@ import 'package:built_value/standard_json_plugin.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'dav.openapi.g.dart'; part 'dav.openapi.g.dart';
class DavResponse<T, U> extends DynamiteResponse<T, U> {
DavResponse(
super.data,
super.headers,
);
@override
String toString() => 'DavResponse(data: $data, headers: $headers)';
}
class DavApiException extends DynamiteApiException {
DavApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<DavApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return DavApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'DavApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class DavClient extends DynamiteClient { class DavClient extends DynamiteClient {
DavClient( DavClient(
super.baseURL, { super.baseURL, {
@ -125,7 +88,7 @@ class DavDirectClient {
specifiedType: const FullType(DavDirectGetUrlResponseApplicationJson), specifiedType: const FullType(DavDirectGetUrlResponseApplicationJson),
)! as DavDirectGetUrlResponseApplicationJson; )! as DavDirectGetUrlResponseApplicationJson;
} }
throw await DavApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

63
packages/nextcloud/lib/src/api/files.openapi.dart

@ -12,48 +12,11 @@ import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:dynamite_runtime/utils.dart'; import 'package:dynamite_runtime/utils.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'files.openapi.g.dart'; part 'files.openapi.g.dart';
class FilesResponse<T, U> extends DynamiteResponse<T, U> {
FilesResponse(
super.data,
super.headers,
);
@override
String toString() => 'FilesResponse(data: $data, headers: $headers)';
}
class FilesApiException extends DynamiteApiException {
FilesApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<FilesApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return FilesApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'FilesApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class FilesClient extends DynamiteClient { class FilesClient extends DynamiteClient {
FilesClient( FilesClient(
super.baseURL, { super.baseURL, {
@ -132,7 +95,7 @@ class FilesApiClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return response.bodyBytes; return response.bodyBytes;
} }
throw await FilesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -180,7 +143,7 @@ class FilesDirectEditingClient {
specifiedType: const FullType(FilesDirectEditingInfoResponseApplicationJson), specifiedType: const FullType(FilesDirectEditingInfoResponseApplicationJson),
)! as FilesDirectEditingInfoResponseApplicationJson; )! as FilesDirectEditingInfoResponseApplicationJson;
} }
throw await FilesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get the templates for direct editing /// Get the templates for direct editing
@ -228,7 +191,7 @@ class FilesDirectEditingClient {
specifiedType: const FullType(FilesDirectEditingTemplatesResponseApplicationJson), specifiedType: const FullType(FilesDirectEditingTemplatesResponseApplicationJson),
)! as FilesDirectEditingTemplatesResponseApplicationJson; )! as FilesDirectEditingTemplatesResponseApplicationJson;
} }
throw await FilesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Open a file for direct editing /// Open a file for direct editing
@ -282,7 +245,7 @@ class FilesDirectEditingClient {
specifiedType: const FullType(FilesDirectEditingOpenResponseApplicationJson), specifiedType: const FullType(FilesDirectEditingOpenResponseApplicationJson),
)! as FilesDirectEditingOpenResponseApplicationJson; )! as FilesDirectEditingOpenResponseApplicationJson;
} }
throw await FilesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Create a file for direct editing /// Create a file for direct editing
@ -336,7 +299,7 @@ class FilesDirectEditingClient {
specifiedType: const FullType(FilesDirectEditingCreateResponseApplicationJson), specifiedType: const FullType(FilesDirectEditingCreateResponseApplicationJson),
)! as FilesDirectEditingCreateResponseApplicationJson; )! as FilesDirectEditingCreateResponseApplicationJson;
} }
throw await FilesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -388,7 +351,7 @@ class FilesOpenLocalEditorClient {
specifiedType: const FullType(FilesOpenLocalEditorCreateResponseApplicationJson), specifiedType: const FullType(FilesOpenLocalEditorCreateResponseApplicationJson),
)! as FilesOpenLocalEditorCreateResponseApplicationJson; )! as FilesOpenLocalEditorCreateResponseApplicationJson;
} }
throw await FilesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Validate a local editor /// Validate a local editor
@ -436,7 +399,7 @@ class FilesOpenLocalEditorClient {
specifiedType: const FullType(FilesOpenLocalEditorValidateResponseApplicationJson), specifiedType: const FullType(FilesOpenLocalEditorValidateResponseApplicationJson),
)! as FilesOpenLocalEditorValidateResponseApplicationJson; )! as FilesOpenLocalEditorValidateResponseApplicationJson;
} }
throw await FilesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -484,7 +447,7 @@ class FilesTemplateClient {
specifiedType: const FullType(FilesTemplateListResponseApplicationJson), specifiedType: const FullType(FilesTemplateListResponseApplicationJson),
)! as FilesTemplateListResponseApplicationJson; )! as FilesTemplateListResponseApplicationJson;
} }
throw await FilesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Create a template /// Create a template
@ -538,7 +501,7 @@ class FilesTemplateClient {
specifiedType: const FullType(FilesTemplateCreateResponseApplicationJson), specifiedType: const FullType(FilesTemplateCreateResponseApplicationJson),
)! as FilesTemplateCreateResponseApplicationJson; )! as FilesTemplateCreateResponseApplicationJson;
} }
throw await FilesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Initialize the template directory /// Initialize the template directory
@ -590,7 +553,7 @@ class FilesTemplateClient {
specifiedType: const FullType(FilesTemplatePathResponseApplicationJson), specifiedType: const FullType(FilesTemplatePathResponseApplicationJson),
)! as FilesTemplatePathResponseApplicationJson; )! as FilesTemplatePathResponseApplicationJson;
} }
throw await FilesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -644,7 +607,7 @@ class FilesTransferOwnershipClient {
specifiedType: const FullType(FilesTransferOwnershipTransferResponseApplicationJson), specifiedType: const FullType(FilesTransferOwnershipTransferResponseApplicationJson),
)! as FilesTransferOwnershipTransferResponseApplicationJson; )! as FilesTransferOwnershipTransferResponseApplicationJson;
} }
throw await FilesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Accept an ownership transfer /// Accept an ownership transfer
@ -690,7 +653,7 @@ class FilesTransferOwnershipClient {
specifiedType: const FullType(FilesTransferOwnershipAcceptResponseApplicationJson), specifiedType: const FullType(FilesTransferOwnershipAcceptResponseApplicationJson),
)! as FilesTransferOwnershipAcceptResponseApplicationJson; )! as FilesTransferOwnershipAcceptResponseApplicationJson;
} }
throw await FilesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Reject an ownership transfer /// Reject an ownership transfer
@ -736,7 +699,7 @@ class FilesTransferOwnershipClient {
specifiedType: const FullType(FilesTransferOwnershipRejectResponseApplicationJson), specifiedType: const FullType(FilesTransferOwnershipRejectResponseApplicationJson),
)! as FilesTransferOwnershipRejectResponseApplicationJson; )! as FilesTransferOwnershipRejectResponseApplicationJson;
} }
throw await FilesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

39
packages/nextcloud/lib/src/api/files_external.openapi.dart

@ -11,48 +11,11 @@ import 'package:built_value/standard_json_plugin.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'files_external.openapi.g.dart'; part 'files_external.openapi.g.dart';
class FilesExternalResponse<T, U> extends DynamiteResponse<T, U> {
FilesExternalResponse(
super.data,
super.headers,
);
@override
String toString() => 'FilesExternalResponse(data: $data, headers: $headers)';
}
class FilesExternalApiException extends DynamiteApiException {
FilesExternalApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<FilesExternalApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return FilesExternalApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'FilesExternalApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class FilesExternalClient extends DynamiteClient { class FilesExternalClient extends DynamiteClient {
FilesExternalClient( FilesExternalClient(
super.baseURL, { super.baseURL, {
@ -119,7 +82,7 @@ class FilesExternalApiClient {
specifiedType: const FullType(FilesExternalApiGetUserMountsResponseApplicationJson), specifiedType: const FullType(FilesExternalApiGetUserMountsResponseApplicationJson),
)! as FilesExternalApiGetUserMountsResponseApplicationJson; )! as FilesExternalApiGetUserMountsResponseApplicationJson;
} }
throw await FilesExternalApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

43
packages/nextcloud/lib/src/api/files_reminders.openapi.dart

@ -11,48 +11,11 @@ import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:dynamite_runtime/utils.dart'; import 'package:dynamite_runtime/utils.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'files_reminders.openapi.g.dart'; part 'files_reminders.openapi.g.dart';
class FilesRemindersResponse<T, U> extends DynamiteResponse<T, U> {
FilesRemindersResponse(
super.data,
super.headers,
);
@override
String toString() => 'FilesRemindersResponse(data: $data, headers: $headers)';
}
class FilesRemindersApiException extends DynamiteApiException {
FilesRemindersApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<FilesRemindersApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return FilesRemindersApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'FilesRemindersApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class FilesRemindersClient extends DynamiteClient { class FilesRemindersClient extends DynamiteClient {
FilesRemindersClient( FilesRemindersClient(
super.baseURL, { super.baseURL, {
@ -126,7 +89,7 @@ class FilesRemindersApiClient {
specifiedType: const FullType(FilesRemindersApiGetResponseApplicationJson), specifiedType: const FullType(FilesRemindersApiGetResponseApplicationJson),
)! as FilesRemindersApiGetResponseApplicationJson; )! as FilesRemindersApiGetResponseApplicationJson;
} }
throw await FilesRemindersApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Set a reminder /// Set a reminder
@ -181,7 +144,7 @@ class FilesRemindersApiClient {
specifiedType: const FullType(FilesRemindersApiSetResponseApplicationJson), specifiedType: const FullType(FilesRemindersApiSetResponseApplicationJson),
)! as FilesRemindersApiSetResponseApplicationJson; )! as FilesRemindersApiSetResponseApplicationJson;
} }
throw await FilesRemindersApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Remove a reminder /// Remove a reminder
@ -230,7 +193,7 @@ class FilesRemindersApiClient {
specifiedType: const FullType(FilesRemindersApiRemoveResponseApplicationJson), specifiedType: const FullType(FilesRemindersApiRemoveResponseApplicationJson),
)! as FilesRemindersApiRemoveResponseApplicationJson; )! as FilesRemindersApiRemoveResponseApplicationJson;
} }
throw await FilesRemindersApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

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

@ -11,48 +11,11 @@ import 'package:built_value/standard_json_plugin.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'files_sharing.openapi.g.dart'; part 'files_sharing.openapi.g.dart';
class FilesSharingResponse<T, U> extends DynamiteResponse<T, U> {
FilesSharingResponse(
super.data,
super.headers,
);
@override
String toString() => 'FilesSharingResponse(data: $data, headers: $headers)';
}
class FilesSharingApiException extends DynamiteApiException {
FilesSharingApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<FilesSharingApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return FilesSharingApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'FilesSharingApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class FilesSharingClient extends DynamiteClient { class FilesSharingClient extends DynamiteClient {
FilesSharingClient( FilesSharingClient(
super.baseURL, { super.baseURL, {
@ -129,7 +92,7 @@ class FilesSharingDeletedShareapiClient {
specifiedType: const FullType(FilesSharingDeletedShareapiListResponseApplicationJson), specifiedType: const FullType(FilesSharingDeletedShareapiListResponseApplicationJson),
)! as FilesSharingDeletedShareapiListResponseApplicationJson; )! as FilesSharingDeletedShareapiListResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Undelete a deleted share /// Undelete a deleted share
@ -175,7 +138,7 @@ class FilesSharingDeletedShareapiClient {
specifiedType: const FullType(FilesSharingDeletedShareapiUndeleteResponseApplicationJson), specifiedType: const FullType(FilesSharingDeletedShareapiUndeleteResponseApplicationJson),
)! as FilesSharingDeletedShareapiUndeleteResponseApplicationJson; )! as FilesSharingDeletedShareapiUndeleteResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -222,7 +185,7 @@ class FilesSharingPublicPreviewClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return response.bodyBytes; return response.bodyBytes;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get a preview for a shared file /// Get a preview for a shared file
@ -279,7 +242,7 @@ class FilesSharingPublicPreviewClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return response.bodyBytes; return response.bodyBytes;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -327,7 +290,7 @@ class FilesSharingRemoteClient {
specifiedType: const FullType(FilesSharingRemoteGetSharesResponseApplicationJson), specifiedType: const FullType(FilesSharingRemoteGetSharesResponseApplicationJson),
)! as FilesSharingRemoteGetSharesResponseApplicationJson; )! as FilesSharingRemoteGetSharesResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get list of pending remote shares /// Get list of pending remote shares
@ -371,7 +334,7 @@ class FilesSharingRemoteClient {
specifiedType: const FullType(FilesSharingRemoteGetOpenSharesResponseApplicationJson), specifiedType: const FullType(FilesSharingRemoteGetOpenSharesResponseApplicationJson),
)! as FilesSharingRemoteGetOpenSharesResponseApplicationJson; )! as FilesSharingRemoteGetOpenSharesResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Accept a remote share /// Accept a remote share
@ -417,7 +380,7 @@ class FilesSharingRemoteClient {
specifiedType: const FullType(FilesSharingRemoteAcceptShareResponseApplicationJson), specifiedType: const FullType(FilesSharingRemoteAcceptShareResponseApplicationJson),
)! as FilesSharingRemoteAcceptShareResponseApplicationJson; )! as FilesSharingRemoteAcceptShareResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Decline a remote share /// Decline a remote share
@ -463,7 +426,7 @@ class FilesSharingRemoteClient {
specifiedType: const FullType(FilesSharingRemoteDeclineShareResponseApplicationJson), specifiedType: const FullType(FilesSharingRemoteDeclineShareResponseApplicationJson),
)! as FilesSharingRemoteDeclineShareResponseApplicationJson; )! as FilesSharingRemoteDeclineShareResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get info of a remote share /// Get info of a remote share
@ -509,7 +472,7 @@ class FilesSharingRemoteClient {
specifiedType: const FullType(FilesSharingRemoteGetShareResponseApplicationJson), specifiedType: const FullType(FilesSharingRemoteGetShareResponseApplicationJson),
)! as FilesSharingRemoteGetShareResponseApplicationJson; )! as FilesSharingRemoteGetShareResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Unshare a remote share /// Unshare a remote share
@ -555,7 +518,7 @@ class FilesSharingRemoteClient {
specifiedType: const FullType(FilesSharingRemoteUnshareResponseApplicationJson), specifiedType: const FullType(FilesSharingRemoteUnshareResponseApplicationJson),
)! as FilesSharingRemoteUnshareResponseApplicationJson; )! as FilesSharingRemoteUnshareResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -615,7 +578,7 @@ class FilesSharingShareInfoClient {
specifiedType: const FullType(FilesSharingShareInfo), specifiedType: const FullType(FilesSharingShareInfo),
)! as FilesSharingShareInfo; )! as FilesSharingShareInfo;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -685,7 +648,7 @@ class FilesSharingShareapiClient {
specifiedType: const FullType(FilesSharingShareapiGetSharesResponseApplicationJson), specifiedType: const FullType(FilesSharingShareapiGetSharesResponseApplicationJson),
)! as FilesSharingShareapiGetSharesResponseApplicationJson; )! as FilesSharingShareapiGetSharesResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Create a share /// Create a share
@ -773,7 +736,7 @@ class FilesSharingShareapiClient {
specifiedType: const FullType(FilesSharingShareapiCreateShareResponseApplicationJson), specifiedType: const FullType(FilesSharingShareapiCreateShareResponseApplicationJson),
)! as FilesSharingShareapiCreateShareResponseApplicationJson; )! as FilesSharingShareapiCreateShareResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get all shares relative to a file, including parent folders shares rights /// Get all shares relative to a file, including parent folders shares rights
@ -819,7 +782,7 @@ class FilesSharingShareapiClient {
specifiedType: const FullType(FilesSharingShareapiGetInheritedSharesResponseApplicationJson), specifiedType: const FullType(FilesSharingShareapiGetInheritedSharesResponseApplicationJson),
)! as FilesSharingShareapiGetInheritedSharesResponseApplicationJson; )! as FilesSharingShareapiGetInheritedSharesResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get all shares that are still pending /// Get all shares that are still pending
@ -863,7 +826,7 @@ class FilesSharingShareapiClient {
specifiedType: const FullType(FilesSharingShareapiPendingSharesResponseApplicationJson), specifiedType: const FullType(FilesSharingShareapiPendingSharesResponseApplicationJson),
)! as FilesSharingShareapiPendingSharesResponseApplicationJson; )! as FilesSharingShareapiPendingSharesResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get a specific share by id /// Get a specific share by id
@ -913,7 +876,7 @@ class FilesSharingShareapiClient {
specifiedType: const FullType(FilesSharingShareapiGetShareResponseApplicationJson), specifiedType: const FullType(FilesSharingShareapiGetShareResponseApplicationJson),
)! as FilesSharingShareapiGetShareResponseApplicationJson; )! as FilesSharingShareapiGetShareResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Update a share /// Update a share
@ -995,7 +958,7 @@ class FilesSharingShareapiClient {
specifiedType: const FullType(FilesSharingShareapiUpdateShareResponseApplicationJson), specifiedType: const FullType(FilesSharingShareapiUpdateShareResponseApplicationJson),
)! as FilesSharingShareapiUpdateShareResponseApplicationJson; )! as FilesSharingShareapiUpdateShareResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Delete a share /// Delete a share
@ -1041,7 +1004,7 @@ class FilesSharingShareapiClient {
specifiedType: const FullType(FilesSharingShareapiDeleteShareResponseApplicationJson), specifiedType: const FullType(FilesSharingShareapiDeleteShareResponseApplicationJson),
)! as FilesSharingShareapiDeleteShareResponseApplicationJson; )! as FilesSharingShareapiDeleteShareResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Accept a share /// Accept a share
@ -1087,7 +1050,7 @@ class FilesSharingShareapiClient {
specifiedType: const FullType(FilesSharingShareapiAcceptShareResponseApplicationJson), specifiedType: const FullType(FilesSharingShareapiAcceptShareResponseApplicationJson),
)! as FilesSharingShareapiAcceptShareResponseApplicationJson; )! as FilesSharingShareapiAcceptShareResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -1098,7 +1061,7 @@ class FilesSharingShareesapiClient {
/// Search for sharees /// Search for sharees
Future< Future<
FilesSharingResponse<FilesSharingShareesapiSearchResponseApplicationJson, DynamiteResponse<FilesSharingShareesapiSearchResponseApplicationJson,
FilesSharingShareesapiShareesapiSearchHeaders>> search({ FilesSharingShareesapiShareesapiSearchHeaders>> search({
final String search = '', final String search = '',
final String? itemType, final String? itemType,
@ -1161,7 +1124,7 @@ class FilesSharingShareesapiClient {
body, body,
); );
if (response.statusCode == 200) { if (response.statusCode == 200) {
return FilesSharingResponse<FilesSharingShareesapiSearchResponseApplicationJson, return DynamiteResponse<FilesSharingShareesapiSearchResponseApplicationJson,
FilesSharingShareesapiShareesapiSearchHeaders>( FilesSharingShareesapiShareesapiSearchHeaders>(
_jsonSerializers.deserialize( _jsonSerializers.deserialize(
await response.jsonBody, await response.jsonBody,
@ -1173,7 +1136,7 @@ class FilesSharingShareesapiClient {
)! as FilesSharingShareesapiShareesapiSearchHeaders, )! as FilesSharingShareesapiShareesapiSearchHeaders,
); );
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Find recommended sharees /// Find recommended sharees
@ -1226,7 +1189,7 @@ class FilesSharingShareesapiClient {
specifiedType: const FullType(FilesSharingShareesapiFindRecommendedResponseApplicationJson), specifiedType: const FullType(FilesSharingShareesapiFindRecommendedResponseApplicationJson),
)! as FilesSharingShareesapiFindRecommendedResponseApplicationJson; )! as FilesSharingShareesapiFindRecommendedResponseApplicationJson;
} }
throw await FilesSharingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

39
packages/nextcloud/lib/src/api/files_trashbin.openapi.dart

@ -9,48 +9,11 @@ import 'package:built_value/standard_json_plugin.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'files_trashbin.openapi.g.dart'; part 'files_trashbin.openapi.g.dart';
class FilesTrashbinResponse<T, U> extends DynamiteResponse<T, U> {
FilesTrashbinResponse(
super.data,
super.headers,
);
@override
String toString() => 'FilesTrashbinResponse(data: $data, headers: $headers)';
}
class FilesTrashbinApiException extends DynamiteApiException {
FilesTrashbinApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<FilesTrashbinApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return FilesTrashbinApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'FilesTrashbinApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class FilesTrashbinClient extends DynamiteClient { class FilesTrashbinClient extends DynamiteClient {
FilesTrashbinClient( FilesTrashbinClient(
super.baseURL, { super.baseURL, {
@ -130,7 +93,7 @@ class FilesTrashbinPreviewClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return response.bodyBytes; return response.bodyBytes;
} }
throw await FilesTrashbinApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

39
packages/nextcloud/lib/src/api/files_versions.openapi.dart

@ -9,48 +9,11 @@ import 'package:built_value/standard_json_plugin.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'files_versions.openapi.g.dart'; part 'files_versions.openapi.g.dart';
class FilesVersionsResponse<T, U> extends DynamiteResponse<T, U> {
FilesVersionsResponse(
super.data,
super.headers,
);
@override
String toString() => 'FilesVersionsResponse(data: $data, headers: $headers)';
}
class FilesVersionsApiException extends DynamiteApiException {
FilesVersionsApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<FilesVersionsApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return FilesVersionsApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'FilesVersionsApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class FilesVersionsClient extends DynamiteClient { class FilesVersionsClient extends DynamiteClient {
FilesVersionsClient( FilesVersionsClient(
super.baseURL, { super.baseURL, {
@ -130,7 +93,7 @@ class FilesVersionsPreviewClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return response.bodyBytes; return response.bodyBytes;
} }
throw await FilesVersionsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

73
packages/nextcloud/lib/src/api/news.openapi.dart

@ -11,48 +11,11 @@ import 'package:built_value/standard_json_plugin.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'news.openapi.g.dart'; part 'news.openapi.g.dart';
class NewsResponse<T, U> extends DynamiteResponse<T, U> {
NewsResponse(
super.data,
super.headers,
);
@override
String toString() => 'NewsResponse(data: $data, headers: $headers)';
}
class NewsApiException extends DynamiteApiException {
NewsApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<NewsApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return NewsApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'NewsApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class NewsClient extends DynamiteClient { class NewsClient extends DynamiteClient {
NewsClient( NewsClient(
super.baseURL, { super.baseURL, {
@ -109,7 +72,7 @@ class NewsClient extends DynamiteClient {
specifiedType: const FullType(NewsSupportedAPIVersions), specifiedType: const FullType(NewsSupportedAPIVersions),
)! as NewsSupportedAPIVersions; )! as NewsSupportedAPIVersions;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NewsListFolders> listFolders() async { Future<NewsListFolders> listFolders() async {
@ -147,7 +110,7 @@ class NewsClient extends DynamiteClient {
return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NewsListFolders))! return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NewsListFolders))!
as NewsListFolders; as NewsListFolders;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NewsListFolders> createFolder({required final String name}) async { Future<NewsListFolders> createFolder({required final String name}) async {
@ -186,7 +149,7 @@ class NewsClient extends DynamiteClient {
return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NewsListFolders))! return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NewsListFolders))!
as NewsListFolders; as NewsListFolders;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<void> renameFolder({ Future<void> renameFolder({
@ -226,7 +189,7 @@ class NewsClient extends DynamiteClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return; return;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<void> deleteFolder({required final int folderId}) async { Future<void> deleteFolder({required final int folderId}) async {
@ -262,7 +225,7 @@ class NewsClient extends DynamiteClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return; return;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<void> markFolderAsRead({ Future<void> markFolderAsRead({
@ -302,7 +265,7 @@ class NewsClient extends DynamiteClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return; return;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NewsListFeeds> listFeeds() async { Future<NewsListFeeds> listFeeds() async {
@ -340,7 +303,7 @@ class NewsClient extends DynamiteClient {
return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NewsListFeeds))! return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NewsListFeeds))!
as NewsListFeeds; as NewsListFeeds;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NewsListFeeds> addFeed({ Future<NewsListFeeds> addFeed({
@ -385,7 +348,7 @@ class NewsClient extends DynamiteClient {
return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NewsListFeeds))! return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NewsListFeeds))!
as NewsListFeeds; as NewsListFeeds;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<void> deleteFeed({required final int feedId}) async { Future<void> deleteFeed({required final int feedId}) async {
@ -421,7 +384,7 @@ class NewsClient extends DynamiteClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return; return;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<void> moveFeed({ Future<void> moveFeed({
@ -463,7 +426,7 @@ class NewsClient extends DynamiteClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return; return;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<void> renameFeed({ Future<void> renameFeed({
@ -503,7 +466,7 @@ class NewsClient extends DynamiteClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return; return;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<void> markFeedAsRead({ Future<void> markFeedAsRead({
@ -543,7 +506,7 @@ class NewsClient extends DynamiteClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return; return;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NewsListArticles> listArticles({ Future<NewsListArticles> listArticles({
@ -606,7 +569,7 @@ class NewsClient extends DynamiteClient {
return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NewsListArticles))! return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NewsListArticles))!
as NewsListArticles; as NewsListArticles;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NewsListArticles> listUpdatedArticles({ Future<NewsListArticles> listUpdatedArticles({
@ -657,7 +620,7 @@ class NewsClient extends DynamiteClient {
return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NewsListArticles))! return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NewsListArticles))!
as NewsListArticles; as NewsListArticles;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<void> markArticleAsRead({required final int itemId}) async { Future<void> markArticleAsRead({required final int itemId}) async {
@ -693,7 +656,7 @@ class NewsClient extends DynamiteClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return; return;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<void> markArticleAsUnread({required final int itemId}) async { Future<void> markArticleAsUnread({required final int itemId}) async {
@ -729,7 +692,7 @@ class NewsClient extends DynamiteClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return; return;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<void> starArticle({required final int itemId}) async { Future<void> starArticle({required final int itemId}) async {
@ -765,7 +728,7 @@ class NewsClient extends DynamiteClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return; return;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<void> unstarArticle({required final int itemId}) async { Future<void> unstarArticle({required final int itemId}) async {
@ -801,7 +764,7 @@ class NewsClient extends DynamiteClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return; return;
} }
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

51
packages/nextcloud/lib/src/api/notes.openapi.dart

@ -12,48 +12,11 @@ import 'package:built_value/standard_json_plugin.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'notes.openapi.g.dart'; part 'notes.openapi.g.dart';
class NotesResponse<T, U> extends DynamiteResponse<T, U> {
NotesResponse(
super.data,
super.headers,
);
@override
String toString() => 'NotesResponse(data: $data, headers: $headers)';
}
class NotesApiException extends DynamiteApiException {
NotesApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<NotesApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return NotesApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'NotesApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class NotesClient extends DynamiteClient { class NotesClient extends DynamiteClient {
NotesClient( NotesClient(
super.baseURL, { super.baseURL, {
@ -135,7 +98,7 @@ class NotesClient extends DynamiteClient {
specifiedType: const FullType(BuiltList, [FullType(NotesNote)]), specifiedType: const FullType(BuiltList, [FullType(NotesNote)]),
)! as BuiltList<NotesNote>; )! as BuiltList<NotesNote>;
} }
throw await NotesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NotesNote> createNote({ Future<NotesNote> createNote({
@ -194,7 +157,7 @@ class NotesClient extends DynamiteClient {
return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NotesNote))! return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NotesNote))!
as NotesNote; as NotesNote;
} }
throw await NotesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NotesNote> getNote({ Future<NotesNote> getNote({
@ -243,7 +206,7 @@ class NotesClient extends DynamiteClient {
return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NotesNote))! return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NotesNote))!
as NotesNote; as NotesNote;
} }
throw await NotesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NotesNote> updateNote({ Future<NotesNote> updateNote({
@ -308,7 +271,7 @@ class NotesClient extends DynamiteClient {
return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NotesNote))! return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NotesNote))!
as NotesNote; as NotesNote;
} }
throw await NotesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<String> deleteNote({required final int id}) async { Future<String> deleteNote({required final int id}) async {
@ -346,7 +309,7 @@ class NotesClient extends DynamiteClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return response.body; return response.body;
} }
throw await NotesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NotesSettings> getSettings() async { Future<NotesSettings> getSettings() async {
@ -384,7 +347,7 @@ class NotesClient extends DynamiteClient {
return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NotesSettings))! return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NotesSettings))!
as NotesSettings; as NotesSettings;
} }
throw await NotesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NotesSettings> updateSettings({required final NotesSettings settings}) async { Future<NotesSettings> updateSettings({required final NotesSettings settings}) async {
@ -425,7 +388,7 @@ class NotesClient extends DynamiteClient {
return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NotesSettings))! return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(NotesSettings))!
as NotesSettings; as NotesSettings;
} }
throw await NotesApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

61
packages/nextcloud/lib/src/api/notifications.openapi.dart

@ -11,48 +11,11 @@ import 'package:built_value/standard_json_plugin.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'notifications.openapi.g.dart'; part 'notifications.openapi.g.dart';
class NotificationsResponse<T, U> extends DynamiteResponse<T, U> {
NotificationsResponse(
super.data,
super.headers,
);
@override
String toString() => 'NotificationsResponse(data: $data, headers: $headers)';
}
class NotificationsApiException extends DynamiteApiException {
NotificationsApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<NotificationsApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return NotificationsApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'NotificationsApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class NotificationsClient extends DynamiteClient { class NotificationsClient extends DynamiteClient {
NotificationsClient( NotificationsClient(
super.baseURL, { super.baseURL, {
@ -139,7 +102,7 @@ class NotificationsApiClient {
specifiedType: const FullType(NotificationsApiGenerateNotificationResponseApplicationJson), specifiedType: const FullType(NotificationsApiGenerateNotificationResponseApplicationJson),
)! as NotificationsApiGenerateNotificationResponseApplicationJson; )! as NotificationsApiGenerateNotificationResponseApplicationJson;
} }
throw await NotificationsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -150,7 +113,7 @@ class NotificationsEndpointClient {
/// Get all notifications /// Get all notifications
Future< Future<
NotificationsResponse<NotificationsEndpointListNotificationsResponseApplicationJson, DynamiteResponse<NotificationsEndpointListNotificationsResponseApplicationJson,
NotificationsEndpointEndpointListNotificationsHeaders>> listNotifications({ NotificationsEndpointEndpointListNotificationsHeaders>> listNotifications({
final NotificationsEndpointListNotificationsApiVersion apiVersion = final NotificationsEndpointListNotificationsApiVersion apiVersion =
NotificationsEndpointListNotificationsApiVersion.v2, NotificationsEndpointListNotificationsApiVersion.v2,
@ -189,7 +152,7 @@ class NotificationsEndpointClient {
body, body,
); );
if (response.statusCode == 200) { if (response.statusCode == 200) {
return NotificationsResponse<NotificationsEndpointListNotificationsResponseApplicationJson, return DynamiteResponse<NotificationsEndpointListNotificationsResponseApplicationJson,
NotificationsEndpointEndpointListNotificationsHeaders>( NotificationsEndpointEndpointListNotificationsHeaders>(
_jsonSerializers.deserialize( _jsonSerializers.deserialize(
await response.jsonBody, await response.jsonBody,
@ -201,7 +164,7 @@ class NotificationsEndpointClient {
)! as NotificationsEndpointEndpointListNotificationsHeaders, )! as NotificationsEndpointEndpointListNotificationsHeaders,
); );
} }
throw await NotificationsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Delete all notifications /// Delete all notifications
@ -248,7 +211,7 @@ class NotificationsEndpointClient {
specifiedType: const FullType(NotificationsEndpointDeleteAllNotificationsResponseApplicationJson), specifiedType: const FullType(NotificationsEndpointDeleteAllNotificationsResponseApplicationJson),
)! as NotificationsEndpointDeleteAllNotificationsResponseApplicationJson; )! as NotificationsEndpointDeleteAllNotificationsResponseApplicationJson;
} }
throw await NotificationsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get a notification /// Get a notification
@ -296,7 +259,7 @@ class NotificationsEndpointClient {
specifiedType: const FullType(NotificationsEndpointGetNotificationResponseApplicationJson), specifiedType: const FullType(NotificationsEndpointGetNotificationResponseApplicationJson),
)! as NotificationsEndpointGetNotificationResponseApplicationJson; )! as NotificationsEndpointGetNotificationResponseApplicationJson;
} }
throw await NotificationsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Delete a notification /// Delete a notification
@ -345,7 +308,7 @@ class NotificationsEndpointClient {
specifiedType: const FullType(NotificationsEndpointDeleteNotificationResponseApplicationJson), specifiedType: const FullType(NotificationsEndpointDeleteNotificationResponseApplicationJson),
)! as NotificationsEndpointDeleteNotificationResponseApplicationJson; )! as NotificationsEndpointDeleteNotificationResponseApplicationJson;
} }
throw await NotificationsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Check if notification IDs exist /// Check if notification IDs exist
@ -394,7 +357,7 @@ class NotificationsEndpointClient {
specifiedType: const FullType(NotificationsEndpointConfirmIdsForUserResponseApplicationJson), specifiedType: const FullType(NotificationsEndpointConfirmIdsForUserResponseApplicationJson),
)! as NotificationsEndpointConfirmIdsForUserResponseApplicationJson; )! as NotificationsEndpointConfirmIdsForUserResponseApplicationJson;
} }
throw await NotificationsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -452,7 +415,7 @@ class NotificationsPushClient {
specifiedType: const FullType(NotificationsPushRegisterDeviceResponseApplicationJson), specifiedType: const FullType(NotificationsPushRegisterDeviceResponseApplicationJson),
)! as NotificationsPushRegisterDeviceResponseApplicationJson; )! as NotificationsPushRegisterDeviceResponseApplicationJson;
} }
throw await NotificationsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Remove a device from push notifications /// Remove a device from push notifications
@ -498,7 +461,7 @@ class NotificationsPushClient {
specifiedType: const FullType(NotificationsPushRemoveDeviceResponseApplicationJson), specifiedType: const FullType(NotificationsPushRemoveDeviceResponseApplicationJson),
)! as NotificationsPushRemoveDeviceResponseApplicationJson; )! as NotificationsPushRemoveDeviceResponseApplicationJson;
} }
throw await NotificationsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -556,7 +519,7 @@ class NotificationsSettingsClient {
specifiedType: const FullType(NotificationsSettingsPersonalResponseApplicationJson), specifiedType: const FullType(NotificationsSettingsPersonalResponseApplicationJson),
)! as NotificationsSettingsPersonalResponseApplicationJson; )! as NotificationsSettingsPersonalResponseApplicationJson;
} }
throw await NotificationsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Update default notification settings for new users /// Update default notification settings for new users
@ -610,7 +573,7 @@ class NotificationsSettingsClient {
specifiedType: const FullType(NotificationsSettingsAdminResponseApplicationJson), specifiedType: const FullType(NotificationsSettingsAdminResponseApplicationJson),
)! as NotificationsSettingsAdminResponseApplicationJson; )! as NotificationsSettingsAdminResponseApplicationJson;
} }
throw await NotificationsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

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

@ -12,48 +12,11 @@ import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:dynamite_runtime/utils.dart'; import 'package:dynamite_runtime/utils.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'provisioning_api.openapi.g.dart'; part 'provisioning_api.openapi.g.dart';
class ProvisioningApiResponse<T, U> extends DynamiteResponse<T, U> {
ProvisioningApiResponse(
super.data,
super.headers,
);
@override
String toString() => 'ProvisioningApiResponse(data: $data, headers: $headers)';
}
class ProvisioningApiApiException extends DynamiteApiException {
ProvisioningApiApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<ProvisioningApiApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return ProvisioningApiApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'ProvisioningApiApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class ProvisioningApiClient extends DynamiteClient { class ProvisioningApiClient extends DynamiteClient {
ProvisioningApiClient( ProvisioningApiClient(
super.baseURL, { super.baseURL, {
@ -130,7 +93,7 @@ class ProvisioningApiAppConfigClient {
specifiedType: const FullType(ProvisioningApiAppConfigGetAppsResponseApplicationJson), specifiedType: const FullType(ProvisioningApiAppConfigGetAppsResponseApplicationJson),
)! as ProvisioningApiAppConfigGetAppsResponseApplicationJson; )! as ProvisioningApiAppConfigGetAppsResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get the config keys of an app /// Get the config keys of an app
@ -178,7 +141,7 @@ class ProvisioningApiAppConfigClient {
specifiedType: const FullType(ProvisioningApiAppConfigGetKeysResponseApplicationJson), specifiedType: const FullType(ProvisioningApiAppConfigGetKeysResponseApplicationJson),
)! as ProvisioningApiAppConfigGetKeysResponseApplicationJson; )! as ProvisioningApiAppConfigGetKeysResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get a the config value of an app /// Get a the config value of an app
@ -232,7 +195,7 @@ class ProvisioningApiAppConfigClient {
specifiedType: const FullType(ProvisioningApiAppConfigGetValueResponseApplicationJson), specifiedType: const FullType(ProvisioningApiAppConfigGetValueResponseApplicationJson),
)! as ProvisioningApiAppConfigGetValueResponseApplicationJson; )! as ProvisioningApiAppConfigGetValueResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Update the config value of an app /// Update the config value of an app
@ -282,7 +245,7 @@ class ProvisioningApiAppConfigClient {
specifiedType: const FullType(ProvisioningApiAppConfigSetValueResponseApplicationJson), specifiedType: const FullType(ProvisioningApiAppConfigSetValueResponseApplicationJson),
)! as ProvisioningApiAppConfigSetValueResponseApplicationJson; )! as ProvisioningApiAppConfigSetValueResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Delete a config key of an app /// Delete a config key of an app
@ -332,7 +295,7 @@ class ProvisioningApiAppConfigClient {
specifiedType: const FullType(ProvisioningApiAppConfigDeleteKeyResponseApplicationJson), specifiedType: const FullType(ProvisioningApiAppConfigDeleteKeyResponseApplicationJson),
)! as ProvisioningApiAppConfigDeleteKeyResponseApplicationJson; )! as ProvisioningApiAppConfigDeleteKeyResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -388,7 +351,7 @@ class ProvisioningApiAppsClient {
specifiedType: const FullType(ProvisioningApiAppsGetAppsResponseApplicationJson), specifiedType: const FullType(ProvisioningApiAppsGetAppsResponseApplicationJson),
)! as ProvisioningApiAppsGetAppsResponseApplicationJson; )! as ProvisioningApiAppsGetAppsResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get the app info for an app /// Get the app info for an app
@ -436,7 +399,7 @@ class ProvisioningApiAppsClient {
specifiedType: const FullType(ProvisioningApiAppsGetAppInfoResponseApplicationJson), specifiedType: const FullType(ProvisioningApiAppsGetAppInfoResponseApplicationJson),
)! as ProvisioningApiAppsGetAppInfoResponseApplicationJson; )! as ProvisioningApiAppsGetAppInfoResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Enable an app /// Enable an app
@ -484,7 +447,7 @@ class ProvisioningApiAppsClient {
specifiedType: const FullType(ProvisioningApiAppsEnableResponseApplicationJson), specifiedType: const FullType(ProvisioningApiAppsEnableResponseApplicationJson),
)! as ProvisioningApiAppsEnableResponseApplicationJson; )! as ProvisioningApiAppsEnableResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Disable an app /// Disable an app
@ -532,7 +495,7 @@ class ProvisioningApiAppsClient {
specifiedType: const FullType(ProvisioningApiAppsDisableResponseApplicationJson), specifiedType: const FullType(ProvisioningApiAppsDisableResponseApplicationJson),
)! as ProvisioningApiAppsDisableResponseApplicationJson; )! as ProvisioningApiAppsDisableResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -594,7 +557,7 @@ class ProvisioningApiGroupsClient {
specifiedType: const FullType(ProvisioningApiGroupsGetGroupsResponseApplicationJson), specifiedType: const FullType(ProvisioningApiGroupsGetGroupsResponseApplicationJson),
)! as ProvisioningApiGroupsGetGroupsResponseApplicationJson; )! as ProvisioningApiGroupsGetGroupsResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Create a new group /// Create a new group
@ -646,7 +609,7 @@ class ProvisioningApiGroupsClient {
specifiedType: const FullType(ProvisioningApiGroupsAddGroupResponseApplicationJson), specifiedType: const FullType(ProvisioningApiGroupsAddGroupResponseApplicationJson),
)! as ProvisioningApiGroupsAddGroupResponseApplicationJson; )! as ProvisioningApiGroupsAddGroupResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get a list of groups details /// Get a list of groups details
@ -702,7 +665,7 @@ class ProvisioningApiGroupsClient {
specifiedType: const FullType(ProvisioningApiGroupsGetGroupsDetailsResponseApplicationJson), specifiedType: const FullType(ProvisioningApiGroupsGetGroupsDetailsResponseApplicationJson),
)! as ProvisioningApiGroupsGetGroupsDetailsResponseApplicationJson; )! as ProvisioningApiGroupsGetGroupsDetailsResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get a list of users in the specified group /// Get a list of users in the specified group
@ -749,7 +712,7 @@ class ProvisioningApiGroupsClient {
specifiedType: const FullType(ProvisioningApiGroupsGetGroupUsersResponseApplicationJson), specifiedType: const FullType(ProvisioningApiGroupsGetGroupUsersResponseApplicationJson),
)! as ProvisioningApiGroupsGetGroupUsersResponseApplicationJson; )! as ProvisioningApiGroupsGetGroupUsersResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get a list of users details in the specified group /// Get a list of users details in the specified group
@ -808,7 +771,7 @@ class ProvisioningApiGroupsClient {
specifiedType: const FullType(ProvisioningApiGroupsGetGroupUsersDetailsResponseApplicationJson), specifiedType: const FullType(ProvisioningApiGroupsGetGroupUsersDetailsResponseApplicationJson),
)! as ProvisioningApiGroupsGetGroupUsersDetailsResponseApplicationJson; )! as ProvisioningApiGroupsGetGroupUsersDetailsResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get the list of user IDs that are a subadmin of the group /// Get the list of user IDs that are a subadmin of the group
@ -857,7 +820,7 @@ class ProvisioningApiGroupsClient {
specifiedType: const FullType(ProvisioningApiGroupsGetSubAdminsOfGroupResponseApplicationJson), specifiedType: const FullType(ProvisioningApiGroupsGetSubAdminsOfGroupResponseApplicationJson),
)! as ProvisioningApiGroupsGetSubAdminsOfGroupResponseApplicationJson; )! as ProvisioningApiGroupsGetSubAdminsOfGroupResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get a list of users in the specified group /// Get a list of users in the specified group
@ -905,7 +868,7 @@ class ProvisioningApiGroupsClient {
specifiedType: const FullType(ProvisioningApiGroupsGetGroupResponseApplicationJson), specifiedType: const FullType(ProvisioningApiGroupsGetGroupResponseApplicationJson),
)! as ProvisioningApiGroupsGetGroupResponseApplicationJson; )! as ProvisioningApiGroupsGetGroupResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Update a group /// Update a group
@ -958,7 +921,7 @@ class ProvisioningApiGroupsClient {
specifiedType: const FullType(ProvisioningApiGroupsUpdateGroupResponseApplicationJson), specifiedType: const FullType(ProvisioningApiGroupsUpdateGroupResponseApplicationJson),
)! as ProvisioningApiGroupsUpdateGroupResponseApplicationJson; )! as ProvisioningApiGroupsUpdateGroupResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Delete a group /// Delete a group
@ -1007,7 +970,7 @@ class ProvisioningApiGroupsClient {
specifiedType: const FullType(ProvisioningApiGroupsDeleteGroupResponseApplicationJson), specifiedType: const FullType(ProvisioningApiGroupsDeleteGroupResponseApplicationJson),
)! as ProvisioningApiGroupsDeleteGroupResponseApplicationJson; )! as ProvisioningApiGroupsDeleteGroupResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -1063,7 +1026,7 @@ class ProvisioningApiPreferencesClient {
specifiedType: const FullType(ProvisioningApiPreferencesSetPreferenceResponseApplicationJson), specifiedType: const FullType(ProvisioningApiPreferencesSetPreferenceResponseApplicationJson),
)! as ProvisioningApiPreferencesSetPreferenceResponseApplicationJson; )! as ProvisioningApiPreferencesSetPreferenceResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Delete a preference for an app /// Delete a preference for an app
@ -1111,7 +1074,7 @@ class ProvisioningApiPreferencesClient {
specifiedType: const FullType(ProvisioningApiPreferencesDeletePreferenceResponseApplicationJson), specifiedType: const FullType(ProvisioningApiPreferencesDeletePreferenceResponseApplicationJson),
)! as ProvisioningApiPreferencesDeletePreferenceResponseApplicationJson; )! as ProvisioningApiPreferencesDeletePreferenceResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Update multiple preference values of an app /// Update multiple preference values of an app
@ -1164,7 +1127,7 @@ class ProvisioningApiPreferencesClient {
specifiedType: const FullType(ProvisioningApiPreferencesSetMultiplePreferencesResponseApplicationJson), specifiedType: const FullType(ProvisioningApiPreferencesSetMultiplePreferencesResponseApplicationJson),
)! as ProvisioningApiPreferencesSetMultiplePreferencesResponseApplicationJson; )! as ProvisioningApiPreferencesSetMultiplePreferencesResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Delete multiple preferences for an app /// Delete multiple preferences for an app
@ -1212,7 +1175,7 @@ class ProvisioningApiPreferencesClient {
specifiedType: const FullType(ProvisioningApiPreferencesDeleteMultiplePreferenceResponseApplicationJson), specifiedType: const FullType(ProvisioningApiPreferencesDeleteMultiplePreferenceResponseApplicationJson),
)! as ProvisioningApiPreferencesDeleteMultiplePreferenceResponseApplicationJson; )! as ProvisioningApiPreferencesDeleteMultiplePreferenceResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -1274,7 +1237,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersGetUsersResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersGetUsersResponseApplicationJson),
)! as ProvisioningApiUsersGetUsersResponseApplicationJson; )! as ProvisioningApiUsersGetUsersResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Create a new user /// Create a new user
@ -1352,7 +1315,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersAddUserResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersAddUserResponseApplicationJson),
)! as ProvisioningApiUsersAddUserResponseApplicationJson; )! as ProvisioningApiUsersAddUserResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get a list of users and their details /// Get a list of users and their details
@ -1408,7 +1371,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersGetUsersDetailsResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersGetUsersDetailsResponseApplicationJson),
)! as ProvisioningApiUsersGetUsersDetailsResponseApplicationJson; )! as ProvisioningApiUsersGetUsersDetailsResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Search users by their phone numbers /// Search users by their phone numbers
@ -1464,7 +1427,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersSearchByPhoneNumbersResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersSearchByPhoneNumbersResponseApplicationJson),
)! as ProvisioningApiUsersSearchByPhoneNumbersResponseApplicationJson; )! as ProvisioningApiUsersSearchByPhoneNumbersResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get the details of a user /// Get the details of a user
@ -1510,7 +1473,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersGetUserResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersGetUserResponseApplicationJson),
)! as ProvisioningApiUsersGetUserResponseApplicationJson; )! as ProvisioningApiUsersGetUserResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Update a value of the user's details /// Update a value of the user's details
@ -1560,7 +1523,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersEditUserResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersEditUserResponseApplicationJson),
)! as ProvisioningApiUsersEditUserResponseApplicationJson; )! as ProvisioningApiUsersEditUserResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Delete a user /// Delete a user
@ -1606,7 +1569,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersDeleteUserResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersDeleteUserResponseApplicationJson),
)! as ProvisioningApiUsersDeleteUserResponseApplicationJson; )! as ProvisioningApiUsersDeleteUserResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get the details of the current user /// Get the details of the current user
@ -1650,7 +1613,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersGetCurrentUserResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersGetCurrentUserResponseApplicationJson),
)! as ProvisioningApiUsersGetCurrentUserResponseApplicationJson; )! as ProvisioningApiUsersGetCurrentUserResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get a list of fields that are editable for the current user /// Get a list of fields that are editable for the current user
@ -1694,7 +1657,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersGetEditableFieldsResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersGetEditableFieldsResponseApplicationJson),
)! as ProvisioningApiUsersGetEditableFieldsResponseApplicationJson; )! as ProvisioningApiUsersGetEditableFieldsResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get a list of fields that are editable for a user /// Get a list of fields that are editable for a user
@ -1740,7 +1703,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersGetEditableFieldsForUserResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersGetEditableFieldsForUserResponseApplicationJson),
)! as ProvisioningApiUsersGetEditableFieldsForUserResponseApplicationJson; )! as ProvisioningApiUsersGetEditableFieldsForUserResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Update multiple values of the user's details /// Update multiple values of the user's details
@ -1797,7 +1760,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersEditUserMultiValueResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersEditUserMultiValueResponseApplicationJson),
)! as ProvisioningApiUsersEditUserMultiValueResponseApplicationJson; )! as ProvisioningApiUsersEditUserMultiValueResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Wipe all devices of a user /// Wipe all devices of a user
@ -1843,7 +1806,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersWipeUserDevicesResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersWipeUserDevicesResponseApplicationJson),
)! as ProvisioningApiUsersWipeUserDevicesResponseApplicationJson; )! as ProvisioningApiUsersWipeUserDevicesResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Enable a user /// Enable a user
@ -1889,7 +1852,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersEnableUserResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersEnableUserResponseApplicationJson),
)! as ProvisioningApiUsersEnableUserResponseApplicationJson; )! as ProvisioningApiUsersEnableUserResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Disable a user /// Disable a user
@ -1935,7 +1898,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersDisableUserResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersDisableUserResponseApplicationJson),
)! as ProvisioningApiUsersDisableUserResponseApplicationJson; )! as ProvisioningApiUsersDisableUserResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get a list of groups the user belongs to /// Get a list of groups the user belongs to
@ -1981,7 +1944,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersGetUsersGroupsResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersGetUsersGroupsResponseApplicationJson),
)! as ProvisioningApiUsersGetUsersGroupsResponseApplicationJson; )! as ProvisioningApiUsersGetUsersGroupsResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Add a user to a group /// Add a user to a group
@ -2031,7 +1994,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersAddToGroupResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersAddToGroupResponseApplicationJson),
)! as ProvisioningApiUsersAddToGroupResponseApplicationJson; )! as ProvisioningApiUsersAddToGroupResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Remove a user from a group /// Remove a user from a group
@ -2079,7 +2042,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersRemoveFromGroupResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersRemoveFromGroupResponseApplicationJson),
)! as ProvisioningApiUsersRemoveFromGroupResponseApplicationJson; )! as ProvisioningApiUsersRemoveFromGroupResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get the groups a user is a subadmin of /// Get the groups a user is a subadmin of
@ -2127,7 +2090,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersGetUserSubAdminGroupsResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersGetUserSubAdminGroupsResponseApplicationJson),
)! as ProvisioningApiUsersGetUserSubAdminGroupsResponseApplicationJson; )! as ProvisioningApiUsersGetUserSubAdminGroupsResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Make a user a subadmin of a group /// Make a user a subadmin of a group
@ -2177,7 +2140,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersAddSubAdminResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersAddSubAdminResponseApplicationJson),
)! as ProvisioningApiUsersAddSubAdminResponseApplicationJson; )! as ProvisioningApiUsersAddSubAdminResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Remove a user from the subadmins of a group /// Remove a user from the subadmins of a group
@ -2227,7 +2190,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersRemoveSubAdminResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersRemoveSubAdminResponseApplicationJson),
)! as ProvisioningApiUsersRemoveSubAdminResponseApplicationJson; )! as ProvisioningApiUsersRemoveSubAdminResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Resend the welcome message /// Resend the welcome message
@ -2273,7 +2236,7 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ProvisioningApiUsersResendWelcomeMessageResponseApplicationJson), specifiedType: const FullType(ProvisioningApiUsersResendWelcomeMessageResponseApplicationJson),
)! as ProvisioningApiUsersResendWelcomeMessageResponseApplicationJson; )! as ProvisioningApiUsersResendWelcomeMessageResponseApplicationJson;
} }
throw await ProvisioningApiApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

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

@ -9,48 +9,11 @@ import 'package:built_value/standard_json_plugin.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'settings.openapi.g.dart'; part 'settings.openapi.g.dart';
class SettingsResponse<T, U> extends DynamiteResponse<T, U> {
SettingsResponse(
super.data,
super.headers,
);
@override
String toString() => 'SettingsResponse(data: $data, headers: $headers)';
}
class SettingsApiException extends DynamiteApiException {
SettingsApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<SettingsApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return SettingsApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'SettingsApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class SettingsClient extends DynamiteClient { class SettingsClient extends DynamiteClient {
SettingsClient( SettingsClient(
super.baseURL, { super.baseURL, {
@ -81,7 +44,7 @@ class SettingsLogSettingsClient {
/// download logfile /// download logfile
/// ///
/// This endpoint requires admin access /// This endpoint requires admin access
Future<SettingsResponse<Uint8List, SettingsLogSettingsLogSettingsDownloadHeaders>> download() async { Future<DynamiteResponse<Uint8List, SettingsLogSettingsLogSettingsDownloadHeaders>> download() async {
const path = '/index.php/settings/admin/log/download'; const path = '/index.php/settings/admin/log/download';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{ final headers = <String, String>{
@ -113,7 +76,7 @@ class SettingsLogSettingsClient {
body, body,
); );
if (response.statusCode == 200) { if (response.statusCode == 200) {
return SettingsResponse<Uint8List, SettingsLogSettingsLogSettingsDownloadHeaders>( return DynamiteResponse<Uint8List, SettingsLogSettingsLogSettingsDownloadHeaders>(
await response.bodyBytes, await response.bodyBytes,
_jsonSerializers.deserialize( _jsonSerializers.deserialize(
response.responseHeaders, response.responseHeaders,
@ -121,7 +84,7 @@ class SettingsLogSettingsClient {
)! as SettingsLogSettingsLogSettingsDownloadHeaders, )! as SettingsLogSettingsLogSettingsDownloadHeaders,
); );
} }
throw await SettingsApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

37
packages/nextcloud/lib/src/api/sharebymail.openapi.dart

@ -7,48 +7,11 @@ import 'package:built_value/serializer.dart';
import 'package:built_value/standard_json_plugin.dart'; import 'package:built_value/standard_json_plugin.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'sharebymail.openapi.g.dart'; part 'sharebymail.openapi.g.dart';
class SharebymailResponse<T, U> extends DynamiteResponse<T, U> {
SharebymailResponse(
super.data,
super.headers,
);
@override
String toString() => 'SharebymailResponse(data: $data, headers: $headers)';
}
class SharebymailApiException extends DynamiteApiException {
SharebymailApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<SharebymailApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return SharebymailApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'SharebymailApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class SharebymailClient extends DynamiteClient { class SharebymailClient extends DynamiteClient {
SharebymailClient( SharebymailClient(
super.baseURL, { super.baseURL, {

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

@ -12,48 +12,11 @@ import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:dynamite_runtime/utils.dart'; import 'package:dynamite_runtime/utils.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'theming.openapi.g.dart'; part 'theming.openapi.g.dart';
class ThemingResponse<T, U> extends DynamiteResponse<T, U> {
ThemingResponse(
super.data,
super.headers,
);
@override
String toString() => 'ThemingResponse(data: $data, headers: $headers)';
}
class ThemingApiException extends DynamiteApiException {
ThemingApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<ThemingApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return ThemingApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'ThemingApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class ThemingClient extends DynamiteClient { class ThemingClient extends DynamiteClient {
ThemingClient( ThemingClient(
super.baseURL, { super.baseURL, {
@ -119,7 +82,7 @@ class ThemingIconClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return response.bodyBytes; return response.bodyBytes;
} }
throw await ThemingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Return a 512x512 icon for touch devices /// Return a 512x512 icon for touch devices
@ -156,7 +119,7 @@ class ThemingIconClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return response.bodyBytes; return response.bodyBytes;
} }
throw await ThemingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get a themed icon /// Get a themed icon
@ -198,7 +161,7 @@ class ThemingIconClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return response.bodyBytes; return response.bodyBytes;
} }
throw await ThemingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -253,7 +216,7 @@ class ThemingThemingClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return response.body; return response.body;
} }
throw await ThemingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get an image /// Get an image
@ -296,7 +259,7 @@ class ThemingThemingClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return response.bodyBytes; return response.bodyBytes;
} }
throw await ThemingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get the manifest for an app /// Get the manifest for an app
@ -336,7 +299,7 @@ class ThemingThemingClient {
specifiedType: const FullType(ThemingThemingGetManifestResponseApplicationJson), specifiedType: const FullType(ThemingThemingGetManifestResponseApplicationJson),
)! as ThemingThemingGetManifestResponseApplicationJson; )! as ThemingThemingGetManifestResponseApplicationJson;
} }
throw await ThemingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -381,7 +344,7 @@ class ThemingUserThemeClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
return response.bodyBytes; return response.bodyBytes;
} }
throw await ThemingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Set the background /// Set the background
@ -433,7 +396,7 @@ class ThemingUserThemeClient {
return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(ThemingBackground))! return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(ThemingBackground))!
as ThemingBackground; as ThemingBackground;
} }
throw await ThemingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Delete the background /// Delete the background
@ -473,7 +436,7 @@ class ThemingUserThemeClient {
return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(ThemingBackground))! return _jsonSerializers.deserialize(await response.jsonBody, specifiedType: const FullType(ThemingBackground))!
as ThemingBackground; as ThemingBackground;
} }
throw await ThemingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Enable theme /// Enable theme
@ -519,7 +482,7 @@ class ThemingUserThemeClient {
specifiedType: const FullType(ThemingUserThemeEnableThemeResponseApplicationJson), specifiedType: const FullType(ThemingUserThemeEnableThemeResponseApplicationJson),
)! as ThemingUserThemeEnableThemeResponseApplicationJson; )! as ThemingUserThemeEnableThemeResponseApplicationJson;
} }
throw await ThemingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Disable theme /// Disable theme
@ -565,7 +528,7 @@ class ThemingUserThemeClient {
specifiedType: const FullType(ThemingUserThemeDisableThemeResponseApplicationJson), specifiedType: const FullType(ThemingUserThemeDisableThemeResponseApplicationJson),
)! as ThemingUserThemeDisableThemeResponseApplicationJson; )! as ThemingUserThemeDisableThemeResponseApplicationJson;
} }
throw await ThemingApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

39
packages/nextcloud/lib/src/api/updatenotification.openapi.dart

@ -10,48 +10,11 @@ import 'package:built_value/standard_json_plugin.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'updatenotification.openapi.g.dart'; part 'updatenotification.openapi.g.dart';
class UpdatenotificationResponse<T, U> extends DynamiteResponse<T, U> {
UpdatenotificationResponse(
super.data,
super.headers,
);
@override
String toString() => 'UpdatenotificationResponse(data: $data, headers: $headers)';
}
class UpdatenotificationApiException extends DynamiteApiException {
UpdatenotificationApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<UpdatenotificationApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return UpdatenotificationApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'UpdatenotificationApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class UpdatenotificationClient extends DynamiteClient { class UpdatenotificationClient extends DynamiteClient {
UpdatenotificationClient( UpdatenotificationClient(
super.baseURL, { super.baseURL, {
@ -126,7 +89,7 @@ class UpdatenotificationApiClient {
specifiedType: const FullType(UpdatenotificationApiGetAppListResponseApplicationJson), specifiedType: const FullType(UpdatenotificationApiGetAppListResponseApplicationJson),
)! as UpdatenotificationApiGetAppListResponseApplicationJson; )! as UpdatenotificationApiGetAppListResponseApplicationJson;
} }
throw await UpdatenotificationApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

59
packages/nextcloud/lib/src/api/uppush.openapi.dart

@ -10,48 +10,11 @@ import 'package:built_value/standard_json_plugin.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'uppush.openapi.g.dart'; part 'uppush.openapi.g.dart';
class UppushResponse<T, U> extends DynamiteResponse<T, U> {
UppushResponse(
super.data,
super.headers,
);
@override
String toString() => 'UppushResponse(data: $data, headers: $headers)';
}
class UppushApiException extends DynamiteApiException {
UppushApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<UppushApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return UppushApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'UppushApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class UppushClient extends DynamiteClient { class UppushClient extends DynamiteClient {
UppushClient( UppushClient(
super.baseURL, { super.baseURL, {
@ -109,7 +72,7 @@ class UppushClient extends DynamiteClient {
specifiedType: const FullType(UppushCheckResponseApplicationJson), specifiedType: const FullType(UppushCheckResponseApplicationJson),
)! as UppushCheckResponseApplicationJson; )! as UppushCheckResponseApplicationJson;
} }
throw await UppushApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Set keepalive interval /// Set keepalive interval
@ -153,7 +116,7 @@ class UppushClient extends DynamiteClient {
specifiedType: const FullType(UppushSetKeepaliveResponseApplicationJson), specifiedType: const FullType(UppushSetKeepaliveResponseApplicationJson),
)! as UppushSetKeepaliveResponseApplicationJson; )! as UppushSetKeepaliveResponseApplicationJson;
} }
throw await UppushApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Request to create a new deviceId /// Request to create a new deviceId
@ -195,7 +158,7 @@ class UppushClient extends DynamiteClient {
specifiedType: const FullType(UppushCreateDeviceResponseApplicationJson), specifiedType: const FullType(UppushCreateDeviceResponseApplicationJson),
)! as UppushCreateDeviceResponseApplicationJson; )! as UppushCreateDeviceResponseApplicationJson;
} }
throw await UppushApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Request to get push messages /// Request to get push messages
@ -239,7 +202,7 @@ class UppushClient extends DynamiteClient {
specifiedType: const FullType(UppushSyncDeviceResponseApplicationJson), specifiedType: const FullType(UppushSyncDeviceResponseApplicationJson),
)! as UppushSyncDeviceResponseApplicationJson; )! as UppushSyncDeviceResponseApplicationJson;
} }
throw await UppushApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Delete a device /// Delete a device
@ -281,7 +244,7 @@ class UppushClient extends DynamiteClient {
specifiedType: const FullType(UppushDeleteDeviceResponseApplicationJson), specifiedType: const FullType(UppushDeleteDeviceResponseApplicationJson),
)! as UppushDeleteDeviceResponseApplicationJson; )! as UppushDeleteDeviceResponseApplicationJson;
} }
throw await UppushApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Create an authorization token for a new 3rd party service /// Create an authorization token for a new 3rd party service
@ -327,7 +290,7 @@ class UppushClient extends DynamiteClient {
specifiedType: const FullType(UppushCreateAppResponseApplicationJson), specifiedType: const FullType(UppushCreateAppResponseApplicationJson),
)! as UppushCreateAppResponseApplicationJson; )! as UppushCreateAppResponseApplicationJson;
} }
throw await UppushApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Delete an authorization token /// Delete an authorization token
@ -369,7 +332,7 @@ class UppushClient extends DynamiteClient {
specifiedType: const FullType(UppushDeleteAppResponseApplicationJson), specifiedType: const FullType(UppushDeleteAppResponseApplicationJson),
)! as UppushDeleteAppResponseApplicationJson; )! as UppushDeleteAppResponseApplicationJson;
} }
throw await UppushApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Unifiedpush discovery Following specifications /// Unifiedpush discovery Following specifications
@ -411,7 +374,7 @@ class UppushClient extends DynamiteClient {
specifiedType: const FullType(UppushUnifiedpushDiscoveryResponseApplicationJson), specifiedType: const FullType(UppushUnifiedpushDiscoveryResponseApplicationJson),
)! as UppushUnifiedpushDiscoveryResponseApplicationJson; )! as UppushUnifiedpushDiscoveryResponseApplicationJson;
} }
throw await UppushApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Receive notifications from 3rd parties /// Receive notifications from 3rd parties
@ -453,7 +416,7 @@ class UppushClient extends DynamiteClient {
specifiedType: const FullType(UppushPushResponseApplicationJson), specifiedType: const FullType(UppushPushResponseApplicationJson),
)! as UppushPushResponseApplicationJson; )! as UppushPushResponseApplicationJson;
} }
throw await UppushApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Matrix Gateway discovery /// Matrix Gateway discovery
@ -494,7 +457,7 @@ class UppushClient extends DynamiteClient {
specifiedType: const FullType(UppushGatewayMatrixDiscoveryResponseApplicationJson), specifiedType: const FullType(UppushGatewayMatrixDiscoveryResponseApplicationJson),
)! as UppushGatewayMatrixDiscoveryResponseApplicationJson; )! as UppushGatewayMatrixDiscoveryResponseApplicationJson;
} }
throw await UppushApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Matrix Gateway /// Matrix Gateway
@ -535,7 +498,7 @@ class UppushClient extends DynamiteClient {
specifiedType: const FullType(UppushGatewayMatrixResponseApplicationJson), specifiedType: const FullType(UppushGatewayMatrixResponseApplicationJson),
)! as UppushGatewayMatrixResponseApplicationJson; )! as UppushGatewayMatrixResponseApplicationJson;
} }
throw await UppushApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

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

@ -11,48 +11,11 @@ import 'package:built_value/standard_json_plugin.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'user_status.openapi.g.dart'; part 'user_status.openapi.g.dart';
class UserStatusResponse<T, U> extends DynamiteResponse<T, U> {
UserStatusResponse(
super.data,
super.headers,
);
@override
String toString() => 'UserStatusResponse(data: $data, headers: $headers)';
}
class UserStatusApiException extends DynamiteApiException {
UserStatusApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<UserStatusApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return UserStatusApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'UserStatusApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class UserStatusClient extends DynamiteClient { class UserStatusClient extends DynamiteClient {
UserStatusClient( UserStatusClient(
super.baseURL, { super.baseURL, {
@ -129,7 +92,7 @@ class UserStatusHeartbeatClient {
specifiedType: const FullType(UserStatusHeartbeatHeartbeatResponseApplicationJson), specifiedType: const FullType(UserStatusHeartbeatHeartbeatResponseApplicationJson),
)! as UserStatusHeartbeatHeartbeatResponseApplicationJson; )! as UserStatusHeartbeatHeartbeatResponseApplicationJson;
} }
throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -177,7 +140,7 @@ class UserStatusPredefinedStatusClient {
specifiedType: const FullType(UserStatusPredefinedStatusFindAllResponseApplicationJson), specifiedType: const FullType(UserStatusPredefinedStatusFindAllResponseApplicationJson),
)! as UserStatusPredefinedStatusFindAllResponseApplicationJson; )! as UserStatusPredefinedStatusFindAllResponseApplicationJson;
} }
throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -235,7 +198,7 @@ class UserStatusStatusesClient {
specifiedType: const FullType(UserStatusStatusesFindAllResponseApplicationJson), specifiedType: const FullType(UserStatusStatusesFindAllResponseApplicationJson),
)! as UserStatusStatusesFindAllResponseApplicationJson; )! as UserStatusStatusesFindAllResponseApplicationJson;
} }
throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Find the status of a user /// Find the status of a user
@ -281,7 +244,7 @@ class UserStatusStatusesClient {
specifiedType: const FullType(UserStatusStatusesFindResponseApplicationJson), specifiedType: const FullType(UserStatusStatusesFindResponseApplicationJson),
)! as UserStatusStatusesFindResponseApplicationJson; )! as UserStatusStatusesFindResponseApplicationJson;
} }
throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }
@ -329,7 +292,7 @@ class UserStatusUserStatusClient {
specifiedType: const FullType(UserStatusUserStatusGetStatusResponseApplicationJson), specifiedType: const FullType(UserStatusUserStatusGetStatusResponseApplicationJson),
)! as UserStatusUserStatusGetStatusResponseApplicationJson; )! as UserStatusUserStatusGetStatusResponseApplicationJson;
} }
throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Update the status type of the current user /// Update the status type of the current user
@ -375,7 +338,7 @@ class UserStatusUserStatusClient {
specifiedType: const FullType(UserStatusUserStatusSetStatusResponseApplicationJson), specifiedType: const FullType(UserStatusUserStatusSetStatusResponseApplicationJson),
)! as UserStatusUserStatusSetStatusResponseApplicationJson; )! as UserStatusUserStatusSetStatusResponseApplicationJson;
} }
throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Set the message to a predefined message for the current user /// Set the message to a predefined message for the current user
@ -425,7 +388,7 @@ class UserStatusUserStatusClient {
specifiedType: const FullType(UserStatusUserStatusSetPredefinedMessageResponseApplicationJson), specifiedType: const FullType(UserStatusUserStatusSetPredefinedMessageResponseApplicationJson),
)! as UserStatusUserStatusSetPredefinedMessageResponseApplicationJson; )! as UserStatusUserStatusSetPredefinedMessageResponseApplicationJson;
} }
throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Set the message to a custom message for the current user /// Set the message to a custom message for the current user
@ -481,7 +444,7 @@ class UserStatusUserStatusClient {
specifiedType: const FullType(UserStatusUserStatusSetCustomMessageResponseApplicationJson), specifiedType: const FullType(UserStatusUserStatusSetCustomMessageResponseApplicationJson),
)! as UserStatusUserStatusSetCustomMessageResponseApplicationJson; )! as UserStatusUserStatusSetCustomMessageResponseApplicationJson;
} }
throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Clear the message of the current user /// Clear the message of the current user
@ -525,7 +488,7 @@ class UserStatusUserStatusClient {
specifiedType: const FullType(UserStatusUserStatusClearMessageResponseApplicationJson), specifiedType: const FullType(UserStatusUserStatusClearMessageResponseApplicationJson),
)! as UserStatusUserStatusClearMessageResponseApplicationJson; )! as UserStatusUserStatusClearMessageResponseApplicationJson;
} }
throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Revert the status to the previous status /// Revert the status to the previous status
@ -571,7 +534,7 @@ class UserStatusUserStatusClient {
specifiedType: const FullType(UserStatusUserStatusRevertStatusResponseApplicationJson), specifiedType: const FullType(UserStatusUserStatusRevertStatusResponseApplicationJson),
)! as UserStatusUserStatusRevertStatusResponseApplicationJson; )! as UserStatusUserStatusRevertStatusResponseApplicationJson;
} }
throw await UserStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

51
packages/nextcloud/lib/src/api/weather_status.openapi.dart

@ -10,48 +10,11 @@ import 'package:built_value/standard_json_plugin.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dynamite_runtime/content_string.dart'; import 'package:dynamite_runtime/content_string.dart';
import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/http_client.dart';
import 'package:universal_io/io.dart';
export 'package:dynamite_runtime/http_client.dart'; export 'package:dynamite_runtime/http_client.dart';
part 'weather_status.openapi.g.dart'; part 'weather_status.openapi.g.dart';
class WeatherStatusResponse<T, U> extends DynamiteResponse<T, U> {
WeatherStatusResponse(
super.data,
super.headers,
);
@override
String toString() => 'WeatherStatusResponse(data: $data, headers: $headers)';
}
class WeatherStatusApiException extends DynamiteApiException {
WeatherStatusApiException(
super.statusCode,
super.headers,
super.body,
);
static Future<WeatherStatusApiException> fromResponse(final HttpClientResponse response) async {
String body;
try {
body = await response.body;
} on FormatException {
body = 'binary';
}
return WeatherStatusApiException(
response.statusCode,
response.responseHeaders,
body,
);
}
@override
String toString() => 'WeatherStatusApiException(statusCode: $statusCode, headers: $headers, body: $body)';
}
class WeatherStatusClient extends DynamiteClient { class WeatherStatusClient extends DynamiteClient {
WeatherStatusClient( WeatherStatusClient(
super.baseURL, { super.baseURL, {
@ -122,7 +85,7 @@ class WeatherStatusWeatherStatusClient {
specifiedType: const FullType(WeatherStatusWeatherStatusSetModeResponseApplicationJson), specifiedType: const FullType(WeatherStatusWeatherStatusSetModeResponseApplicationJson),
)! as WeatherStatusWeatherStatusSetModeResponseApplicationJson; )! as WeatherStatusWeatherStatusSetModeResponseApplicationJson;
} }
throw await WeatherStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Try to use the address set in user personal settings as weather location /// Try to use the address set in user personal settings as weather location
@ -166,7 +129,7 @@ class WeatherStatusWeatherStatusClient {
specifiedType: const FullType(WeatherStatusWeatherStatusUsePersonalAddressResponseApplicationJson), specifiedType: const FullType(WeatherStatusWeatherStatusUsePersonalAddressResponseApplicationJson),
)! as WeatherStatusWeatherStatusUsePersonalAddressResponseApplicationJson; )! as WeatherStatusWeatherStatusUsePersonalAddressResponseApplicationJson;
} }
throw await WeatherStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get stored user location /// Get stored user location
@ -210,7 +173,7 @@ class WeatherStatusWeatherStatusClient {
specifiedType: const FullType(WeatherStatusWeatherStatusGetLocationResponseApplicationJson), specifiedType: const FullType(WeatherStatusWeatherStatusGetLocationResponseApplicationJson),
)! as WeatherStatusWeatherStatusGetLocationResponseApplicationJson; )! as WeatherStatusWeatherStatusGetLocationResponseApplicationJson;
} }
throw await WeatherStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Set address and resolve it to get coordinates or directly set coordinates and get address with reverse geocoding /// Set address and resolve it to get coordinates or directly set coordinates and get address with reverse geocoding
@ -266,7 +229,7 @@ class WeatherStatusWeatherStatusClient {
specifiedType: const FullType(WeatherStatusWeatherStatusSetLocationResponseApplicationJson), specifiedType: const FullType(WeatherStatusWeatherStatusSetLocationResponseApplicationJson),
)! as WeatherStatusWeatherStatusSetLocationResponseApplicationJson; )! as WeatherStatusWeatherStatusSetLocationResponseApplicationJson;
} }
throw await WeatherStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get forecast for current location /// Get forecast for current location
@ -310,7 +273,7 @@ class WeatherStatusWeatherStatusClient {
specifiedType: const FullType(WeatherStatusWeatherStatusGetForecastResponseApplicationJson), specifiedType: const FullType(WeatherStatusWeatherStatusGetForecastResponseApplicationJson),
)! as WeatherStatusWeatherStatusGetForecastResponseApplicationJson; )! as WeatherStatusWeatherStatusGetForecastResponseApplicationJson;
} }
throw await WeatherStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Get favorites list /// Get favorites list
@ -354,7 +317,7 @@ class WeatherStatusWeatherStatusClient {
specifiedType: const FullType(WeatherStatusWeatherStatusGetFavoritesResponseApplicationJson), specifiedType: const FullType(WeatherStatusWeatherStatusGetFavoritesResponseApplicationJson),
)! as WeatherStatusWeatherStatusGetFavoritesResponseApplicationJson; )! as WeatherStatusWeatherStatusGetFavoritesResponseApplicationJson;
} }
throw await WeatherStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
/// Set favorites list /// Set favorites list
@ -400,7 +363,7 @@ class WeatherStatusWeatherStatusClient {
specifiedType: const FullType(WeatherStatusWeatherStatusSetFavoritesResponseApplicationJson), specifiedType: const FullType(WeatherStatusWeatherStatusSetFavoritesResponseApplicationJson),
)! as WeatherStatusWeatherStatusSetFavoritesResponseApplicationJson; )! as WeatherStatusWeatherStatusSetFavoritesResponseApplicationJson;
} }
throw await WeatherStatusApiException.fromResponse(response); // coverage:ignore-line throw await DynamiteApiException.fromResponse(response); // coverage:ignore-line
} }
} }

2
packages/nextcloud/test/helper.dart

@ -141,7 +141,7 @@ Future<TestNextcloudClient> getTestClient(
try { try {
await client.core.getStatus(); await client.core.getStatus();
break; break;
} on CoreApiException catch (error) { } on DynamiteApiException catch (error) {
i++; i++;
await Future.delayed(const Duration(milliseconds: 100)); await Future.delayed(const Duration(milliseconds: 100));
if (i >= 30) { if (i >= 30) {

Loading…
Cancel
Save