From a5bb654a767a4c9b86fe8d0d2fb9351aac015868 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Fri, 16 Jun 2023 04:28:45 +0300 Subject: [PATCH 01/20] refactor(backups): Rename BackbaleCredential to BackupsCredential Also adding provider field --- lib/config/hive_config.dart | 4 +- lib/logic/api_maps/rest_maps/backblaze.dart | 8 +- .../initializing/backblaze_form_cubit.dart | 2 +- .../server_installation_cubit.dart | 7 +- .../server_installation_repository.dart | 8 +- .../server_installation_state.dart | 8 +- lib/logic/get_it/api_config.dart | 8 +- lib/logic/models/hive/README.md | 1 + .../models/hive/backblaze_credential.dart | 27 ------ .../models/hive/backblaze_credential.g.dart | 44 --------- lib/logic/models/hive/backups_credential.dart | 51 ++++++++++ .../models/hive/backups_credential.g.dart | 93 +++++++++++++++++++ 12 files changed, 168 insertions(+), 93 deletions(-) delete mode 100644 lib/logic/models/hive/backblaze_credential.dart delete mode 100644 lib/logic/models/hive/backblaze_credential.g.dart create mode 100644 lib/logic/models/hive/backups_credential.dart create mode 100644 lib/logic/models/hive/backups_credential.g.dart diff --git a/lib/config/hive_config.dart b/lib/config/hive_config.dart index 44b03f26..8ee1ca55 100644 --- a/lib/config/hive_config.dart +++ b/lib/config/hive_config.dart @@ -4,7 +4,7 @@ import 'dart:typed_data'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:hive_flutter/hive_flutter.dart'; import 'package:selfprivacy/logic/models/hive/backblaze_bucket.dart'; -import 'package:selfprivacy/logic/models/hive/backblaze_credential.dart'; +import 'package:selfprivacy/logic/models/hive/backups_credential.dart'; import 'package:selfprivacy/logic/models/hive/server_details.dart'; import 'package:selfprivacy/logic/models/hive/server_domain.dart'; import 'package:selfprivacy/logic/models/hive/user.dart'; @@ -111,7 +111,7 @@ class BNames { /// A [ServerHostingDetails] field of [serverInstallationBox] box. static String serverDetails = 'hetznerServer'; - /// A [BackblazeCredential] field of [serverInstallationBox] box. + /// A [BackupsCredential] field of [serverInstallationBox] box. static String backblazeCredential = 'backblazeKey'; /// A [BackblazeBucket] field of [serverInstallationBox] box. diff --git a/lib/logic/api_maps/rest_maps/backblaze.dart b/lib/logic/api_maps/rest_maps/backblaze.dart index 59292775..497a7625 100644 --- a/lib/logic/api_maps/rest_maps/backblaze.dart +++ b/lib/logic/api_maps/rest_maps/backblaze.dart @@ -4,7 +4,7 @@ import 'package:dio/dio.dart'; import 'package:selfprivacy/config/get_it_config.dart'; import 'package:selfprivacy/logic/api_maps/api_generic_result.dart'; import 'package:selfprivacy/logic/api_maps/rest_maps/api_map.dart'; -import 'package:selfprivacy/logic/models/hive/backblaze_credential.dart'; +import 'package:selfprivacy/logic/models/hive/backups_credential.dart'; export 'package:selfprivacy/logic/api_maps/api_generic_result.dart'; @@ -36,7 +36,7 @@ class BackblazeApi extends ApiMap { responseType: ResponseType.json, ); if (isWithToken) { - final BackblazeCredential? backblazeCredential = + final BackupsCredential? backblazeCredential = getIt().backblazeCredential; final String token = backblazeCredential!.applicationKey; options.headers = {'Authorization': 'Basic $token'}; @@ -56,7 +56,7 @@ class BackblazeApi extends ApiMap { Future getAuthorizationToken() async { final Dio client = await getClient(); - final BackblazeCredential? backblazeCredential = + final BackupsCredential? backblazeCredential = getIt().backblazeCredential; if (backblazeCredential == null) { throw Exception('Backblaze credential is null'); @@ -121,7 +121,7 @@ class BackblazeApi extends ApiMap { // Create bucket Future createBucket(final String bucketName) async { final BackblazeApiAuth auth = await getAuthorizationToken(); - final BackblazeCredential? backblazeCredential = + final BackupsCredential? backblazeCredential = getIt().backblazeCredential; final Dio client = await getClient(); client.options.baseUrl = auth.apiUrl; diff --git a/lib/logic/cubit/forms/setup/initializing/backblaze_form_cubit.dart b/lib/logic/cubit/forms/setup/initializing/backblaze_form_cubit.dart index 21d17a84..2578aded 100644 --- a/lib/logic/cubit/forms/setup/initializing/backblaze_form_cubit.dart +++ b/lib/logic/cubit/forms/setup/initializing/backblaze_form_cubit.dart @@ -3,7 +3,7 @@ import 'package:cubit_form/cubit_form.dart'; import 'package:selfprivacy/config/get_it_config.dart'; import 'package:selfprivacy/logic/api_maps/rest_maps/backblaze.dart'; import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart'; -import 'package:selfprivacy/logic/models/hive/backblaze_credential.dart'; +import 'package:selfprivacy/logic/models/hive/backups_credential.dart'; import 'package:easy_localization/easy_localization.dart'; class BackblazeFormCubit extends FormCubit { diff --git a/lib/logic/cubit/server_installation/server_installation_cubit.dart b/lib/logic/cubit/server_installation/server_installation_cubit.dart index 47952c9a..04b4fde6 100644 --- a/lib/logic/cubit/server_installation/server_installation_cubit.dart +++ b/lib/logic/cubit/server_installation/server_installation_cubit.dart @@ -11,7 +11,7 @@ import 'package:selfprivacy/logic/api_maps/rest_maps/dns_providers/dns_provider_ import 'package:selfprivacy/logic/api_maps/rest_maps/server_providers/server_provider.dart'; import 'package:selfprivacy/logic/api_maps/rest_maps/server_providers/server_provider_api_settings.dart'; import 'package:selfprivacy/logic/api_maps/staging_options.dart'; -import 'package:selfprivacy/logic/models/hive/backblaze_credential.dart'; +import 'package:selfprivacy/logic/models/hive/backups_credential.dart'; import 'package:selfprivacy/logic/models/hive/server_details.dart'; import 'package:selfprivacy/logic/models/hive/server_domain.dart'; import 'package:selfprivacy/logic/models/hive/user.dart'; @@ -228,9 +228,10 @@ class ServerInstallationCubit extends Cubit { } void setBackblazeKey(final String keyId, final String applicationKey) async { - final BackblazeCredential backblazeCredential = BackblazeCredential( + final BackupsCredential backblazeCredential = BackupsCredential( keyId: keyId, applicationKey: applicationKey, + provider: BackupsProvider.backblaze, ); await repository.saveBackblazeKey(backblazeCredential); if (state is ServerInstallationRecovery) { @@ -735,7 +736,7 @@ class ServerInstallationCubit extends Cubit { } void finishRecoveryProcess( - final BackblazeCredential backblazeCredential, + final BackupsCredential backblazeCredential, ) async { await repository.saveIsServerStarted(true); await repository.saveIsServerResetedFirstTime(true); diff --git a/lib/logic/cubit/server_installation/server_installation_repository.dart b/lib/logic/cubit/server_installation/server_installation_repository.dart index c138a340..d81d4d8a 100644 --- a/lib/logic/cubit/server_installation/server_installation_repository.dart +++ b/lib/logic/cubit/server_installation/server_installation_repository.dart @@ -16,7 +16,7 @@ import 'package:selfprivacy/logic/api_maps/graphql_maps/server_api/server_api.da import 'package:selfprivacy/logic/api_maps/rest_maps/server_providers/server_provider.dart'; import 'package:selfprivacy/logic/api_maps/staging_options.dart'; import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart'; -import 'package:selfprivacy/logic/models/hive/backblaze_credential.dart'; +import 'package:selfprivacy/logic/models/hive/backups_credential.dart'; import 'package:selfprivacy/logic/models/hive/server_details.dart'; import 'package:selfprivacy/logic/models/hive/server_domain.dart'; import 'package:selfprivacy/logic/models/hive/user.dart'; @@ -49,7 +49,7 @@ class ServerInstallationRepository { final ServerDomain? serverDomain = getIt().serverDomain; final ServerProvider? serverProvider = getIt().serverProvider; - final BackblazeCredential? backblazeCredential = + final BackupsCredential? backblazeCredential = getIt().backblazeCredential; final ServerHostingDetails? serverDetails = getIt().serverDetails; @@ -228,7 +228,7 @@ class ServerInstallationRepository { final User rootUser, final String domainName, final String dnsApiToken, - final BackblazeCredential backblazeCredential, { + final BackupsCredential backblazeCredential, { required final void Function() onCancel, required final Future Function(ServerHostingDetails serverDetails) onSuccess, @@ -706,7 +706,7 @@ class ServerInstallationRepository { } Future saveBackblazeKey( - final BackblazeCredential backblazeCredential, + final BackupsCredential backblazeCredential, ) async { await getIt().storeBackblazeCredential(backblazeCredential); } diff --git a/lib/logic/cubit/server_installation/server_installation_state.dart b/lib/logic/cubit/server_installation/server_installation_state.dart index 5ceaafdd..3289a780 100644 --- a/lib/logic/cubit/server_installation/server_installation_state.dart +++ b/lib/logic/cubit/server_installation/server_installation_state.dart @@ -30,7 +30,7 @@ abstract class ServerInstallationState extends Equatable { final String? providerApiToken; final String? dnsApiToken; final String? serverTypeIdentificator; - final BackblazeCredential? backblazeCredential; + final BackupsCredential? backblazeCredential; final ServerDomain? serverDomain; final User? rootUser; final ServerHostingDetails? serverDetails; @@ -161,7 +161,7 @@ class ServerInstallationNotFinished extends ServerInstallationState { final String? providerApiToken, final String? serverTypeIdentificator, final String? dnsApiToken, - final BackblazeCredential? backblazeCredential, + final BackupsCredential? backblazeCredential, final ServerDomain? serverDomain, final User? rootUser, final ServerHostingDetails? serverDetails, @@ -226,7 +226,7 @@ class ServerInstallationFinished extends ServerInstallationState { required String super.providerApiToken, required String super.serverTypeIdentificator, required String super.dnsApiToken, - required BackblazeCredential super.backblazeCredential, + required BackupsCredential super.backblazeCredential, required ServerDomain super.serverDomain, required User super.rootUser, required ServerHostingDetails super.serverDetails, @@ -309,7 +309,7 @@ class ServerInstallationRecovery extends ServerInstallationState { final String? providerApiToken, final String? serverTypeIdentificator, final String? dnsApiToken, - final BackblazeCredential? backblazeCredential, + final BackupsCredential? backblazeCredential, final ServerDomain? serverDomain, final User? rootUser, final ServerHostingDetails? serverDetails, diff --git a/lib/logic/get_it/api_config.dart b/lib/logic/get_it/api_config.dart index ba49b9b3..58f7492d 100644 --- a/lib/logic/get_it/api_config.dart +++ b/lib/logic/get_it/api_config.dart @@ -1,7 +1,7 @@ import 'package:hive/hive.dart'; import 'package:selfprivacy/config/hive_config.dart'; import 'package:selfprivacy/logic/models/hive/backblaze_bucket.dart'; -import 'package:selfprivacy/logic/models/hive/backblaze_credential.dart'; +import 'package:selfprivacy/logic/models/hive/backups_credential.dart'; import 'package:selfprivacy/logic/models/hive/server_details.dart'; import 'package:selfprivacy/logic/models/hive/server_domain.dart'; @@ -16,7 +16,7 @@ class ApiConfigModel { ServerProvider? get serverProvider => _serverProvider; DnsProvider? get dnsProvider => _dnsProvider; - BackblazeCredential? get backblazeCredential => _backblazeCredential; + BackupsCredential? get backblazeCredential => _backblazeCredential; ServerDomain? get serverDomain => _serverDomain; BackblazeBucket? get backblazeBucket => _backblazeBucket; @@ -27,7 +27,7 @@ class ApiConfigModel { ServerProvider? _serverProvider; DnsProvider? _dnsProvider; ServerHostingDetails? _serverDetails; - BackblazeCredential? _backblazeCredential; + BackupsCredential? _backblazeCredential; ServerDomain? _serverDomain; BackblazeBucket? _backblazeBucket; @@ -61,7 +61,7 @@ class ApiConfigModel { _serverLocation = serverLocation; } - Future storeBackblazeCredential(final BackblazeCredential value) async { + Future storeBackblazeCredential(final BackupsCredential value) async { await _box.put(BNames.backblazeCredential, value); _backblazeCredential = value; } diff --git a/lib/logic/models/hive/README.md b/lib/logic/models/hive/README.md index f8f9e14d..d50da34c 100644 --- a/lib/logic/models/hive/README.md +++ b/lib/logic/models/hive/README.md @@ -12,3 +12,4 @@ 100. DnsProvider 101. ServerProvider 102. UserType +103. BackupsProvider diff --git a/lib/logic/models/hive/backblaze_credential.dart b/lib/logic/models/hive/backblaze_credential.dart deleted file mode 100644 index d7bf2d06..00000000 --- a/lib/logic/models/hive/backblaze_credential.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'dart:convert'; - -import 'package:hive/hive.dart'; - -part 'backblaze_credential.g.dart'; - -@HiveType(typeId: 4) -class BackblazeCredential { - BackblazeCredential({required this.keyId, required this.applicationKey}); - - @HiveField(0) - final String keyId; - - @HiveField(1) - final String applicationKey; - - String get encodedApiKey => encodedBackblazeKey(keyId, applicationKey); - - @override - String toString() => '$keyId: $encodedApiKey'; -} - -String encodedBackblazeKey(final String? keyId, final String? applicationKey) { - final String apiKey = '$keyId:$applicationKey'; - final String encodedApiKey = base64.encode(utf8.encode(apiKey)); - return encodedApiKey; -} diff --git a/lib/logic/models/hive/backblaze_credential.g.dart b/lib/logic/models/hive/backblaze_credential.g.dart deleted file mode 100644 index c6ad373e..00000000 --- a/lib/logic/models/hive/backblaze_credential.g.dart +++ /dev/null @@ -1,44 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'backblaze_credential.dart'; - -// ************************************************************************** -// TypeAdapterGenerator -// ************************************************************************** - -class BackblazeCredentialAdapter extends TypeAdapter { - @override - final int typeId = 4; - - @override - BackblazeCredential read(BinaryReader reader) { - final numOfFields = reader.readByte(); - final fields = { - for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), - }; - return BackblazeCredential( - keyId: fields[0] as String, - applicationKey: fields[1] as String, - ); - } - - @override - void write(BinaryWriter writer, BackblazeCredential obj) { - writer - ..writeByte(2) - ..writeByte(0) - ..write(obj.keyId) - ..writeByte(1) - ..write(obj.applicationKey); - } - - @override - int get hashCode => typeId.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is BackblazeCredentialAdapter && - runtimeType == other.runtimeType && - typeId == other.typeId; -} diff --git a/lib/logic/models/hive/backups_credential.dart b/lib/logic/models/hive/backups_credential.dart new file mode 100644 index 00000000..c64345c4 --- /dev/null +++ b/lib/logic/models/hive/backups_credential.dart @@ -0,0 +1,51 @@ +import 'dart:convert'; + +import 'package:hive/hive.dart'; +import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/schema.graphql.dart'; + +part 'backups_credential.g.dart'; + +@HiveType(typeId: 4) +class BackupsCredential { + BackupsCredential({required this.keyId, required this.applicationKey, required this.provider}); + + @HiveField(0) + final String keyId; + + @HiveField(1) + final String applicationKey; + + @HiveField(2, defaultValue: BackupsProvider.backblaze) + final BackupsProvider provider; + + String get encodedApiKey => encodedBackblazeKey(keyId, applicationKey); + + @override + String toString() => '$keyId: $encodedApiKey'; +} + +String encodedBackblazeKey(final String? keyId, final String? applicationKey) { + final String apiKey = '$keyId:$applicationKey'; + final String encodedApiKey = base64.encode(utf8.encode(apiKey)); + return encodedApiKey; +} + +@HiveType(typeId: 103) +enum BackupsProvider { + @HiveField(0) + none, + @HiveField(1) + memory, + @HiveField(2) + file, + @HiveField(3) + backblaze; + + factory BackupsProvider.fromGraphQL(final Enum$BackupProvider provider) => switch (provider) { + Enum$BackupProvider.NONE => none, + Enum$BackupProvider.MEMORY => memory, + Enum$BackupProvider.FILE => file, + Enum$BackupProvider.BACKBLAZE => backblaze, + Enum$BackupProvider.$unknown => none + }; +} diff --git a/lib/logic/models/hive/backups_credential.g.dart b/lib/logic/models/hive/backups_credential.g.dart new file mode 100644 index 00000000..9eae9093 --- /dev/null +++ b/lib/logic/models/hive/backups_credential.g.dart @@ -0,0 +1,93 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'backups_credential.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class BackblazeCredentialAdapter extends TypeAdapter { + @override + final int typeId = 4; + + @override + BackblazeCredential read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return BackblazeCredential( + keyId: fields[0] as String, + applicationKey: fields[1] as String, + ); + } + + @override + void write(BinaryWriter writer, BackblazeCredential obj) { + writer + ..writeByte(2) + ..writeByte(0) + ..write(obj.keyId) + ..writeByte(1) + ..write(obj.applicationKey); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BackblazeCredentialAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class BackupsProviderAdapter extends TypeAdapter { + @override + final int typeId = 103; + + @override + BackupsProvider read(BinaryReader reader) { + switch (reader.readByte()) { + case 0: + return BackupsProvider.none; + case 1: + return BackupsProvider.memory; + case 2: + return BackupsProvider.file; + case 3: + return BackupsProvider.backblaze; + default: + return BackupsProvider.none; + } + } + + @override + void write(BinaryWriter writer, BackupsProvider obj) { + switch (obj) { + case BackupsProvider.none: + writer.writeByte(0); + break; + case BackupsProvider.memory: + writer.writeByte(1); + break; + case BackupsProvider.file: + writer.writeByte(2); + break; + case BackupsProvider.backblaze: + writer.writeByte(3); + break; + } + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BackupsProviderAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} From 13af7e5e1d4e9e662821d16dc897d66638877928 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Fri, 16 Jun 2023 04:30:46 +0300 Subject: [PATCH 02/20] feat(backups): Introduce read GraphQL nodes for backups --- .../graphql_maps/schema/backups.graphql | 24 + .../graphql_maps/schema/backups.graphql.dart | 1548 +++++++++++++++++ .../schema/disk_volumes.graphql.dart | 201 +++ .../graphql_maps/schema/schema.graphql | 256 +-- .../graphql_maps/schema/schema.graphql.dart | 516 +++++- .../schema/server_api.graphql.dart | 201 +++ .../schema/server_settings.graphql.dart | 201 +++ .../graphql_maps/schema/services.graphql | 2 +- .../graphql_maps/schema/services.graphql.dart | 201 +++ .../graphql_maps/schema/users.graphql.dart | 201 +++ 10 files changed, 3211 insertions(+), 140 deletions(-) create mode 100644 lib/logic/api_maps/graphql_maps/schema/backups.graphql create mode 100644 lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart diff --git a/lib/logic/api_maps/graphql_maps/schema/backups.graphql b/lib/logic/api_maps/graphql_maps/schema/backups.graphql new file mode 100644 index 00000000..36177fca --- /dev/null +++ b/lib/logic/api_maps/graphql_maps/schema/backups.graphql @@ -0,0 +1,24 @@ +query BackupConfiguration { + backup { + configuration { + autobackupPeriod + encryptionKey + isInitialized + locationId + locationName + provider + } + } +} + +query AllBackupSnapshots { + backup { + allSnapshots { + ...backupSnapshotFields + service { + displayName + id + } + } + } +} diff --git a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart new file mode 100644 index 00000000..37ee4109 --- /dev/null +++ b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart @@ -0,0 +1,1548 @@ +import 'dart:async'; +import 'package:gql/ast.dart'; +import 'package:graphql/client.dart' as graphql; +import 'package:selfprivacy/utils/scalars.dart'; +import 'schema.graphql.dart'; + +class Query$BackupConfiguration { + Query$BackupConfiguration({ + required this.backup, + this.$__typename = 'Query', + }); + + factory Query$BackupConfiguration.fromJson(Map json) { + final l$backup = json['backup']; + final l$$__typename = json['__typename']; + return Query$BackupConfiguration( + backup: Query$BackupConfiguration$backup.fromJson( + (l$backup as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Query$BackupConfiguration$backup backup; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$backup = backup; + _resultData['backup'] = l$backup.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$backup = backup; + final l$$__typename = $__typename; + return Object.hashAll([ + l$backup, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$BackupConfiguration) || + runtimeType != other.runtimeType) { + return false; + } + final l$backup = backup; + final lOther$backup = other.backup; + if (l$backup != lOther$backup) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$BackupConfiguration + on Query$BackupConfiguration { + CopyWith$Query$BackupConfiguration get copyWith => + CopyWith$Query$BackupConfiguration( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$BackupConfiguration { + factory CopyWith$Query$BackupConfiguration( + Query$BackupConfiguration instance, + TRes Function(Query$BackupConfiguration) then, + ) = _CopyWithImpl$Query$BackupConfiguration; + + factory CopyWith$Query$BackupConfiguration.stub(TRes res) = + _CopyWithStubImpl$Query$BackupConfiguration; + + TRes call({ + Query$BackupConfiguration$backup? backup, + String? $__typename, + }); + CopyWith$Query$BackupConfiguration$backup get backup; +} + +class _CopyWithImpl$Query$BackupConfiguration + implements CopyWith$Query$BackupConfiguration { + _CopyWithImpl$Query$BackupConfiguration( + this._instance, + this._then, + ); + + final Query$BackupConfiguration _instance; + + final TRes Function(Query$BackupConfiguration) _then; + + static const _undefined = {}; + + TRes call({ + Object? backup = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$BackupConfiguration( + backup: backup == _undefined || backup == null + ? _instance.backup + : (backup as Query$BackupConfiguration$backup), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Query$BackupConfiguration$backup get backup { + final local$backup = _instance.backup; + return CopyWith$Query$BackupConfiguration$backup( + local$backup, (e) => call(backup: e)); + } +} + +class _CopyWithStubImpl$Query$BackupConfiguration + implements CopyWith$Query$BackupConfiguration { + _CopyWithStubImpl$Query$BackupConfiguration(this._res); + + TRes _res; + + call({ + Query$BackupConfiguration$backup? backup, + String? $__typename, + }) => + _res; + CopyWith$Query$BackupConfiguration$backup get backup => + CopyWith$Query$BackupConfiguration$backup.stub(_res); +} + +const documentNodeQueryBackupConfiguration = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'BackupConfiguration'), + variableDefinitions: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'backup'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'configuration'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'autobackupPeriod'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'encryptionKey'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'isInitialized'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'locationId'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'locationName'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'provider'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), +]); +Query$BackupConfiguration _parserFn$Query$BackupConfiguration( + Map data) => + Query$BackupConfiguration.fromJson(data); +typedef OnQueryComplete$Query$BackupConfiguration = FutureOr Function( + Map?, + Query$BackupConfiguration?, +); + +class Options$Query$BackupConfiguration + extends graphql.QueryOptions { + Options$Query$BackupConfiguration({ + String? operationName, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Query$BackupConfiguration? typedOptimisticResult, + Duration? pollInterval, + graphql.Context? context, + OnQueryComplete$Query$BackupConfiguration? onComplete, + graphql.OnQueryError? onError, + }) : onCompleteWithParsed = onComplete, + super( + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + pollInterval: pollInterval, + context: context, + onComplete: onComplete == null + ? null + : (data) => onComplete( + data, + data == null + ? null + : _parserFn$Query$BackupConfiguration(data), + ), + onError: onError, + document: documentNodeQueryBackupConfiguration, + parserFn: _parserFn$Query$BackupConfiguration, + ); + + final OnQueryComplete$Query$BackupConfiguration? onCompleteWithParsed; + + @override + List get properties => [ + ...super.onComplete == null + ? super.properties + : super.properties.where((property) => property != onComplete), + onCompleteWithParsed, + ]; +} + +class WatchOptions$Query$BackupConfiguration + extends graphql.WatchQueryOptions { + WatchOptions$Query$BackupConfiguration({ + String? operationName, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Query$BackupConfiguration? typedOptimisticResult, + graphql.Context? context, + Duration? pollInterval, + bool? eagerlyFetchResults, + bool carryForwardDataOnException = true, + bool fetchResults = false, + }) : super( + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + document: documentNodeQueryBackupConfiguration, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Query$BackupConfiguration, + ); +} + +class FetchMoreOptions$Query$BackupConfiguration + extends graphql.FetchMoreOptions { + FetchMoreOptions$Query$BackupConfiguration( + {required graphql.UpdateQuery updateQuery}) + : super( + updateQuery: updateQuery, + document: documentNodeQueryBackupConfiguration, + ); +} + +extension ClientExtension$Query$BackupConfiguration on graphql.GraphQLClient { + Future> + query$BackupConfiguration( + [Options$Query$BackupConfiguration? options]) async => + await this.query(options ?? Options$Query$BackupConfiguration()); + graphql.ObservableQuery + watchQuery$BackupConfiguration( + [WatchOptions$Query$BackupConfiguration? options]) => + this.watchQuery(options ?? WatchOptions$Query$BackupConfiguration()); + void writeQuery$BackupConfiguration({ + required Query$BackupConfiguration data, + bool broadcast = true, + }) => + this.writeQuery( + graphql.Request( + operation: graphql.Operation( + document: documentNodeQueryBackupConfiguration)), + data: data.toJson(), + broadcast: broadcast, + ); + Query$BackupConfiguration? readQuery$BackupConfiguration( + {bool optimistic = true}) { + final result = this.readQuery( + graphql.Request( + operation: graphql.Operation( + document: documentNodeQueryBackupConfiguration)), + optimistic: optimistic, + ); + return result == null ? null : Query$BackupConfiguration.fromJson(result); + } +} + +class Query$BackupConfiguration$backup { + Query$BackupConfiguration$backup({ + required this.configuration, + this.$__typename = 'Backup', + }); + + factory Query$BackupConfiguration$backup.fromJson(Map json) { + final l$configuration = json['configuration']; + final l$$__typename = json['__typename']; + return Query$BackupConfiguration$backup( + configuration: Query$BackupConfiguration$backup$configuration.fromJson( + (l$configuration as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Query$BackupConfiguration$backup$configuration configuration; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$configuration = configuration; + _resultData['configuration'] = l$configuration.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$configuration = configuration; + final l$$__typename = $__typename; + return Object.hashAll([ + l$configuration, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$BackupConfiguration$backup) || + runtimeType != other.runtimeType) { + return false; + } + final l$configuration = configuration; + final lOther$configuration = other.configuration; + if (l$configuration != lOther$configuration) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$BackupConfiguration$backup + on Query$BackupConfiguration$backup { + CopyWith$Query$BackupConfiguration$backup + get copyWith => CopyWith$Query$BackupConfiguration$backup( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$BackupConfiguration$backup { + factory CopyWith$Query$BackupConfiguration$backup( + Query$BackupConfiguration$backup instance, + TRes Function(Query$BackupConfiguration$backup) then, + ) = _CopyWithImpl$Query$BackupConfiguration$backup; + + factory CopyWith$Query$BackupConfiguration$backup.stub(TRes res) = + _CopyWithStubImpl$Query$BackupConfiguration$backup; + + TRes call({ + Query$BackupConfiguration$backup$configuration? configuration, + String? $__typename, + }); + CopyWith$Query$BackupConfiguration$backup$configuration + get configuration; +} + +class _CopyWithImpl$Query$BackupConfiguration$backup + implements CopyWith$Query$BackupConfiguration$backup { + _CopyWithImpl$Query$BackupConfiguration$backup( + this._instance, + this._then, + ); + + final Query$BackupConfiguration$backup _instance; + + final TRes Function(Query$BackupConfiguration$backup) _then; + + static const _undefined = {}; + + TRes call({ + Object? configuration = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$BackupConfiguration$backup( + configuration: configuration == _undefined || configuration == null + ? _instance.configuration + : (configuration as Query$BackupConfiguration$backup$configuration), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Query$BackupConfiguration$backup$configuration + get configuration { + final local$configuration = _instance.configuration; + return CopyWith$Query$BackupConfiguration$backup$configuration( + local$configuration, (e) => call(configuration: e)); + } +} + +class _CopyWithStubImpl$Query$BackupConfiguration$backup + implements CopyWith$Query$BackupConfiguration$backup { + _CopyWithStubImpl$Query$BackupConfiguration$backup(this._res); + + TRes _res; + + call({ + Query$BackupConfiguration$backup$configuration? configuration, + String? $__typename, + }) => + _res; + CopyWith$Query$BackupConfiguration$backup$configuration + get configuration => + CopyWith$Query$BackupConfiguration$backup$configuration.stub(_res); +} + +class Query$BackupConfiguration$backup$configuration { + Query$BackupConfiguration$backup$configuration({ + this.autobackupPeriod, + required this.encryptionKey, + required this.isInitialized, + this.locationId, + this.locationName, + required this.provider, + this.$__typename = 'BackupConfiguration', + }); + + factory Query$BackupConfiguration$backup$configuration.fromJson( + Map json) { + final l$autobackupPeriod = json['autobackupPeriod']; + final l$encryptionKey = json['encryptionKey']; + final l$isInitialized = json['isInitialized']; + final l$locationId = json['locationId']; + final l$locationName = json['locationName']; + final l$provider = json['provider']; + final l$$__typename = json['__typename']; + return Query$BackupConfiguration$backup$configuration( + autobackupPeriod: (l$autobackupPeriod as int?), + encryptionKey: (l$encryptionKey as String), + isInitialized: (l$isInitialized as bool), + locationId: (l$locationId as String?), + locationName: (l$locationName as String?), + provider: fromJson$Enum$BackupProvider((l$provider as String)), + $__typename: (l$$__typename as String), + ); + } + + final int? autobackupPeriod; + + final String encryptionKey; + + final bool isInitialized; + + final String? locationId; + + final String? locationName; + + final Enum$BackupProvider provider; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$autobackupPeriod = autobackupPeriod; + _resultData['autobackupPeriod'] = l$autobackupPeriod; + final l$encryptionKey = encryptionKey; + _resultData['encryptionKey'] = l$encryptionKey; + final l$isInitialized = isInitialized; + _resultData['isInitialized'] = l$isInitialized; + final l$locationId = locationId; + _resultData['locationId'] = l$locationId; + final l$locationName = locationName; + _resultData['locationName'] = l$locationName; + final l$provider = provider; + _resultData['provider'] = toJson$Enum$BackupProvider(l$provider); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$autobackupPeriod = autobackupPeriod; + final l$encryptionKey = encryptionKey; + final l$isInitialized = isInitialized; + final l$locationId = locationId; + final l$locationName = locationName; + final l$provider = provider; + final l$$__typename = $__typename; + return Object.hashAll([ + l$autobackupPeriod, + l$encryptionKey, + l$isInitialized, + l$locationId, + l$locationName, + l$provider, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$BackupConfiguration$backup$configuration) || + runtimeType != other.runtimeType) { + return false; + } + final l$autobackupPeriod = autobackupPeriod; + final lOther$autobackupPeriod = other.autobackupPeriod; + if (l$autobackupPeriod != lOther$autobackupPeriod) { + return false; + } + final l$encryptionKey = encryptionKey; + final lOther$encryptionKey = other.encryptionKey; + if (l$encryptionKey != lOther$encryptionKey) { + return false; + } + final l$isInitialized = isInitialized; + final lOther$isInitialized = other.isInitialized; + if (l$isInitialized != lOther$isInitialized) { + return false; + } + final l$locationId = locationId; + final lOther$locationId = other.locationId; + if (l$locationId != lOther$locationId) { + return false; + } + final l$locationName = locationName; + final lOther$locationName = other.locationName; + if (l$locationName != lOther$locationName) { + return false; + } + final l$provider = provider; + final lOther$provider = other.provider; + if (l$provider != lOther$provider) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$BackupConfiguration$backup$configuration + on Query$BackupConfiguration$backup$configuration { + CopyWith$Query$BackupConfiguration$backup$configuration< + Query$BackupConfiguration$backup$configuration> + get copyWith => CopyWith$Query$BackupConfiguration$backup$configuration( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$BackupConfiguration$backup$configuration { + factory CopyWith$Query$BackupConfiguration$backup$configuration( + Query$BackupConfiguration$backup$configuration instance, + TRes Function(Query$BackupConfiguration$backup$configuration) then, + ) = _CopyWithImpl$Query$BackupConfiguration$backup$configuration; + + factory CopyWith$Query$BackupConfiguration$backup$configuration.stub( + TRes res) = + _CopyWithStubImpl$Query$BackupConfiguration$backup$configuration; + + TRes call({ + int? autobackupPeriod, + String? encryptionKey, + bool? isInitialized, + String? locationId, + String? locationName, + Enum$BackupProvider? provider, + String? $__typename, + }); +} + +class _CopyWithImpl$Query$BackupConfiguration$backup$configuration + implements CopyWith$Query$BackupConfiguration$backup$configuration { + _CopyWithImpl$Query$BackupConfiguration$backup$configuration( + this._instance, + this._then, + ); + + final Query$BackupConfiguration$backup$configuration _instance; + + final TRes Function(Query$BackupConfiguration$backup$configuration) _then; + + static const _undefined = {}; + + TRes call({ + Object? autobackupPeriod = _undefined, + Object? encryptionKey = _undefined, + Object? isInitialized = _undefined, + Object? locationId = _undefined, + Object? locationName = _undefined, + Object? provider = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$BackupConfiguration$backup$configuration( + autobackupPeriod: autobackupPeriod == _undefined + ? _instance.autobackupPeriod + : (autobackupPeriod as int?), + encryptionKey: encryptionKey == _undefined || encryptionKey == null + ? _instance.encryptionKey + : (encryptionKey as String), + isInitialized: isInitialized == _undefined || isInitialized == null + ? _instance.isInitialized + : (isInitialized as bool), + locationId: locationId == _undefined + ? _instance.locationId + : (locationId as String?), + locationName: locationName == _undefined + ? _instance.locationName + : (locationName as String?), + provider: provider == _undefined || provider == null + ? _instance.provider + : (provider as Enum$BackupProvider), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Query$BackupConfiguration$backup$configuration + implements CopyWith$Query$BackupConfiguration$backup$configuration { + _CopyWithStubImpl$Query$BackupConfiguration$backup$configuration(this._res); + + TRes _res; + + call({ + int? autobackupPeriod, + String? encryptionKey, + bool? isInitialized, + String? locationId, + String? locationName, + Enum$BackupProvider? provider, + String? $__typename, + }) => + _res; +} + +class Query$AllBackupSnapshots { + Query$AllBackupSnapshots({ + required this.backup, + this.$__typename = 'Query', + }); + + factory Query$AllBackupSnapshots.fromJson(Map json) { + final l$backup = json['backup']; + final l$$__typename = json['__typename']; + return Query$AllBackupSnapshots( + backup: Query$AllBackupSnapshots$backup.fromJson( + (l$backup as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Query$AllBackupSnapshots$backup backup; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$backup = backup; + _resultData['backup'] = l$backup.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$backup = backup; + final l$$__typename = $__typename; + return Object.hashAll([ + l$backup, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$AllBackupSnapshots) || + runtimeType != other.runtimeType) { + return false; + } + final l$backup = backup; + final lOther$backup = other.backup; + if (l$backup != lOther$backup) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$AllBackupSnapshots + on Query$AllBackupSnapshots { + CopyWith$Query$AllBackupSnapshots get copyWith => + CopyWith$Query$AllBackupSnapshots( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$AllBackupSnapshots { + factory CopyWith$Query$AllBackupSnapshots( + Query$AllBackupSnapshots instance, + TRes Function(Query$AllBackupSnapshots) then, + ) = _CopyWithImpl$Query$AllBackupSnapshots; + + factory CopyWith$Query$AllBackupSnapshots.stub(TRes res) = + _CopyWithStubImpl$Query$AllBackupSnapshots; + + TRes call({ + Query$AllBackupSnapshots$backup? backup, + String? $__typename, + }); + CopyWith$Query$AllBackupSnapshots$backup get backup; +} + +class _CopyWithImpl$Query$AllBackupSnapshots + implements CopyWith$Query$AllBackupSnapshots { + _CopyWithImpl$Query$AllBackupSnapshots( + this._instance, + this._then, + ); + + final Query$AllBackupSnapshots _instance; + + final TRes Function(Query$AllBackupSnapshots) _then; + + static const _undefined = {}; + + TRes call({ + Object? backup = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$AllBackupSnapshots( + backup: backup == _undefined || backup == null + ? _instance.backup + : (backup as Query$AllBackupSnapshots$backup), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Query$AllBackupSnapshots$backup get backup { + final local$backup = _instance.backup; + return CopyWith$Query$AllBackupSnapshots$backup( + local$backup, (e) => call(backup: e)); + } +} + +class _CopyWithStubImpl$Query$AllBackupSnapshots + implements CopyWith$Query$AllBackupSnapshots { + _CopyWithStubImpl$Query$AllBackupSnapshots(this._res); + + TRes _res; + + call({ + Query$AllBackupSnapshots$backup? backup, + String? $__typename, + }) => + _res; + CopyWith$Query$AllBackupSnapshots$backup get backup => + CopyWith$Query$AllBackupSnapshots$backup.stub(_res); +} + +const documentNodeQueryAllBackupSnapshots = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'AllBackupSnapshots'), + variableDefinitions: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'backup'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'allSnapshots'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'backupSnapshotFields'), + directives: [], + ), + FieldNode( + name: NameNode(value: 'service'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'displayName'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + fragmentDefinitionbackupSnapshotFields, +]); +Query$AllBackupSnapshots _parserFn$Query$AllBackupSnapshots( + Map data) => + Query$AllBackupSnapshots.fromJson(data); +typedef OnQueryComplete$Query$AllBackupSnapshots = FutureOr Function( + Map?, + Query$AllBackupSnapshots?, +); + +class Options$Query$AllBackupSnapshots + extends graphql.QueryOptions { + Options$Query$AllBackupSnapshots({ + String? operationName, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Query$AllBackupSnapshots? typedOptimisticResult, + Duration? pollInterval, + graphql.Context? context, + OnQueryComplete$Query$AllBackupSnapshots? onComplete, + graphql.OnQueryError? onError, + }) : onCompleteWithParsed = onComplete, + super( + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + pollInterval: pollInterval, + context: context, + onComplete: onComplete == null + ? null + : (data) => onComplete( + data, + data == null + ? null + : _parserFn$Query$AllBackupSnapshots(data), + ), + onError: onError, + document: documentNodeQueryAllBackupSnapshots, + parserFn: _parserFn$Query$AllBackupSnapshots, + ); + + final OnQueryComplete$Query$AllBackupSnapshots? onCompleteWithParsed; + + @override + List get properties => [ + ...super.onComplete == null + ? super.properties + : super.properties.where((property) => property != onComplete), + onCompleteWithParsed, + ]; +} + +class WatchOptions$Query$AllBackupSnapshots + extends graphql.WatchQueryOptions { + WatchOptions$Query$AllBackupSnapshots({ + String? operationName, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Query$AllBackupSnapshots? typedOptimisticResult, + graphql.Context? context, + Duration? pollInterval, + bool? eagerlyFetchResults, + bool carryForwardDataOnException = true, + bool fetchResults = false, + }) : super( + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + document: documentNodeQueryAllBackupSnapshots, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Query$AllBackupSnapshots, + ); +} + +class FetchMoreOptions$Query$AllBackupSnapshots + extends graphql.FetchMoreOptions { + FetchMoreOptions$Query$AllBackupSnapshots( + {required graphql.UpdateQuery updateQuery}) + : super( + updateQuery: updateQuery, + document: documentNodeQueryAllBackupSnapshots, + ); +} + +extension ClientExtension$Query$AllBackupSnapshots on graphql.GraphQLClient { + Future> + query$AllBackupSnapshots( + [Options$Query$AllBackupSnapshots? options]) async => + await this.query(options ?? Options$Query$AllBackupSnapshots()); + graphql.ObservableQuery + watchQuery$AllBackupSnapshots( + [WatchOptions$Query$AllBackupSnapshots? options]) => + this.watchQuery(options ?? WatchOptions$Query$AllBackupSnapshots()); + void writeQuery$AllBackupSnapshots({ + required Query$AllBackupSnapshots data, + bool broadcast = true, + }) => + this.writeQuery( + graphql.Request( + operation: graphql.Operation( + document: documentNodeQueryAllBackupSnapshots)), + data: data.toJson(), + broadcast: broadcast, + ); + Query$AllBackupSnapshots? readQuery$AllBackupSnapshots( + {bool optimistic = true}) { + final result = this.readQuery( + graphql.Request( + operation: + graphql.Operation(document: documentNodeQueryAllBackupSnapshots)), + optimistic: optimistic, + ); + return result == null ? null : Query$AllBackupSnapshots.fromJson(result); + } +} + +class Query$AllBackupSnapshots$backup { + Query$AllBackupSnapshots$backup({ + required this.allSnapshots, + this.$__typename = 'Backup', + }); + + factory Query$AllBackupSnapshots$backup.fromJson(Map json) { + final l$allSnapshots = json['allSnapshots']; + final l$$__typename = json['__typename']; + return Query$AllBackupSnapshots$backup( + allSnapshots: (l$allSnapshots as List) + .map((e) => Query$AllBackupSnapshots$backup$allSnapshots.fromJson( + (e as Map))) + .toList(), + $__typename: (l$$__typename as String), + ); + } + + final List allSnapshots; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$allSnapshots = allSnapshots; + _resultData['allSnapshots'] = + l$allSnapshots.map((e) => e.toJson()).toList(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$allSnapshots = allSnapshots; + final l$$__typename = $__typename; + return Object.hashAll([ + Object.hashAll(l$allSnapshots.map((v) => v)), + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$AllBackupSnapshots$backup) || + runtimeType != other.runtimeType) { + return false; + } + final l$allSnapshots = allSnapshots; + final lOther$allSnapshots = other.allSnapshots; + if (l$allSnapshots.length != lOther$allSnapshots.length) { + return false; + } + for (int i = 0; i < l$allSnapshots.length; i++) { + final l$allSnapshots$entry = l$allSnapshots[i]; + final lOther$allSnapshots$entry = lOther$allSnapshots[i]; + if (l$allSnapshots$entry != lOther$allSnapshots$entry) { + return false; + } + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$AllBackupSnapshots$backup + on Query$AllBackupSnapshots$backup { + CopyWith$Query$AllBackupSnapshots$backup + get copyWith => CopyWith$Query$AllBackupSnapshots$backup( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$AllBackupSnapshots$backup { + factory CopyWith$Query$AllBackupSnapshots$backup( + Query$AllBackupSnapshots$backup instance, + TRes Function(Query$AllBackupSnapshots$backup) then, + ) = _CopyWithImpl$Query$AllBackupSnapshots$backup; + + factory CopyWith$Query$AllBackupSnapshots$backup.stub(TRes res) = + _CopyWithStubImpl$Query$AllBackupSnapshots$backup; + + TRes call({ + List? allSnapshots, + String? $__typename, + }); + TRes allSnapshots( + Iterable Function( + Iterable< + CopyWith$Query$AllBackupSnapshots$backup$allSnapshots< + Query$AllBackupSnapshots$backup$allSnapshots>>) + _fn); +} + +class _CopyWithImpl$Query$AllBackupSnapshots$backup + implements CopyWith$Query$AllBackupSnapshots$backup { + _CopyWithImpl$Query$AllBackupSnapshots$backup( + this._instance, + this._then, + ); + + final Query$AllBackupSnapshots$backup _instance; + + final TRes Function(Query$AllBackupSnapshots$backup) _then; + + static const _undefined = {}; + + TRes call({ + Object? allSnapshots = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$AllBackupSnapshots$backup( + allSnapshots: allSnapshots == _undefined || allSnapshots == null + ? _instance.allSnapshots + : (allSnapshots + as List), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + TRes allSnapshots( + Iterable Function( + Iterable< + CopyWith$Query$AllBackupSnapshots$backup$allSnapshots< + Query$AllBackupSnapshots$backup$allSnapshots>>) + _fn) => + call( + allSnapshots: _fn(_instance.allSnapshots + .map((e) => CopyWith$Query$AllBackupSnapshots$backup$allSnapshots( + e, + (i) => i, + ))).toList()); +} + +class _CopyWithStubImpl$Query$AllBackupSnapshots$backup + implements CopyWith$Query$AllBackupSnapshots$backup { + _CopyWithStubImpl$Query$AllBackupSnapshots$backup(this._res); + + TRes _res; + + call({ + List? allSnapshots, + String? $__typename, + }) => + _res; + allSnapshots(_fn) => _res; +} + +class Query$AllBackupSnapshots$backup$allSnapshots + implements Fragment$backupSnapshotFields { + Query$AllBackupSnapshots$backup$allSnapshots({ + required this.id, + required this.createdAt, + this.$__typename = 'SnapshotInfo', + required this.service, + }); + + factory Query$AllBackupSnapshots$backup$allSnapshots.fromJson( + Map json) { + final l$id = json['id']; + final l$createdAt = json['createdAt']; + final l$$__typename = json['__typename']; + final l$service = json['service']; + return Query$AllBackupSnapshots$backup$allSnapshots( + id: (l$id as String), + createdAt: dateTimeFromJson(l$createdAt), + $__typename: (l$$__typename as String), + service: Query$AllBackupSnapshots$backup$allSnapshots$service.fromJson( + (l$service as Map)), + ); + } + + final String id; + + final DateTime createdAt; + + final String $__typename; + + final Query$AllBackupSnapshots$backup$allSnapshots$service service; + + Map toJson() { + final _resultData = {}; + final l$id = id; + _resultData['id'] = l$id; + final l$createdAt = createdAt; + _resultData['createdAt'] = dateTimeToJson(l$createdAt); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + final l$service = service; + _resultData['service'] = l$service.toJson(); + return _resultData; + } + + @override + int get hashCode { + final l$id = id; + final l$createdAt = createdAt; + final l$$__typename = $__typename; + final l$service = service; + return Object.hashAll([ + l$id, + l$createdAt, + l$$__typename, + l$service, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$AllBackupSnapshots$backup$allSnapshots) || + runtimeType != other.runtimeType) { + return false; + } + final l$id = id; + final lOther$id = other.id; + if (l$id != lOther$id) { + return false; + } + final l$createdAt = createdAt; + final lOther$createdAt = other.createdAt; + if (l$createdAt != lOther$createdAt) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + final l$service = service; + final lOther$service = other.service; + if (l$service != lOther$service) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$AllBackupSnapshots$backup$allSnapshots + on Query$AllBackupSnapshots$backup$allSnapshots { + CopyWith$Query$AllBackupSnapshots$backup$allSnapshots< + Query$AllBackupSnapshots$backup$allSnapshots> + get copyWith => CopyWith$Query$AllBackupSnapshots$backup$allSnapshots( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$AllBackupSnapshots$backup$allSnapshots { + factory CopyWith$Query$AllBackupSnapshots$backup$allSnapshots( + Query$AllBackupSnapshots$backup$allSnapshots instance, + TRes Function(Query$AllBackupSnapshots$backup$allSnapshots) then, + ) = _CopyWithImpl$Query$AllBackupSnapshots$backup$allSnapshots; + + factory CopyWith$Query$AllBackupSnapshots$backup$allSnapshots.stub(TRes res) = + _CopyWithStubImpl$Query$AllBackupSnapshots$backup$allSnapshots; + + TRes call({ + String? id, + DateTime? createdAt, + String? $__typename, + Query$AllBackupSnapshots$backup$allSnapshots$service? service, + }); + CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service + get service; +} + +class _CopyWithImpl$Query$AllBackupSnapshots$backup$allSnapshots + implements CopyWith$Query$AllBackupSnapshots$backup$allSnapshots { + _CopyWithImpl$Query$AllBackupSnapshots$backup$allSnapshots( + this._instance, + this._then, + ); + + final Query$AllBackupSnapshots$backup$allSnapshots _instance; + + final TRes Function(Query$AllBackupSnapshots$backup$allSnapshots) _then; + + static const _undefined = {}; + + TRes call({ + Object? id = _undefined, + Object? createdAt = _undefined, + Object? $__typename = _undefined, + Object? service = _undefined, + }) => + _then(Query$AllBackupSnapshots$backup$allSnapshots( + id: id == _undefined || id == null ? _instance.id : (id as String), + createdAt: createdAt == _undefined || createdAt == null + ? _instance.createdAt + : (createdAt as DateTime), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + service: service == _undefined || service == null + ? _instance.service + : (service as Query$AllBackupSnapshots$backup$allSnapshots$service), + )); + CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service + get service { + final local$service = _instance.service; + return CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service( + local$service, (e) => call(service: e)); + } +} + +class _CopyWithStubImpl$Query$AllBackupSnapshots$backup$allSnapshots + implements CopyWith$Query$AllBackupSnapshots$backup$allSnapshots { + _CopyWithStubImpl$Query$AllBackupSnapshots$backup$allSnapshots(this._res); + + TRes _res; + + call({ + String? id, + DateTime? createdAt, + String? $__typename, + Query$AllBackupSnapshots$backup$allSnapshots$service? service, + }) => + _res; + CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service + get service => + CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service.stub( + _res); +} + +class Query$AllBackupSnapshots$backup$allSnapshots$service { + Query$AllBackupSnapshots$backup$allSnapshots$service({ + required this.displayName, + required this.id, + this.$__typename = 'Service', + }); + + factory Query$AllBackupSnapshots$backup$allSnapshots$service.fromJson( + Map json) { + final l$displayName = json['displayName']; + final l$id = json['id']; + final l$$__typename = json['__typename']; + return Query$AllBackupSnapshots$backup$allSnapshots$service( + displayName: (l$displayName as String), + id: (l$id as String), + $__typename: (l$$__typename as String), + ); + } + + final String displayName; + + final String id; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$displayName = displayName; + _resultData['displayName'] = l$displayName; + final l$id = id; + _resultData['id'] = l$id; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$displayName = displayName; + final l$id = id; + final l$$__typename = $__typename; + return Object.hashAll([ + l$displayName, + l$id, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$AllBackupSnapshots$backup$allSnapshots$service) || + runtimeType != other.runtimeType) { + return false; + } + final l$displayName = displayName; + final lOther$displayName = other.displayName; + if (l$displayName != lOther$displayName) { + return false; + } + final l$id = id; + final lOther$id = other.id; + if (l$id != lOther$id) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$AllBackupSnapshots$backup$allSnapshots$service + on Query$AllBackupSnapshots$backup$allSnapshots$service { + CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service< + Query$AllBackupSnapshots$backup$allSnapshots$service> + get copyWith => + CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service< + TRes> { + factory CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service( + Query$AllBackupSnapshots$backup$allSnapshots$service instance, + TRes Function(Query$AllBackupSnapshots$backup$allSnapshots$service) then, + ) = _CopyWithImpl$Query$AllBackupSnapshots$backup$allSnapshots$service; + + factory CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service.stub( + TRes res) = + _CopyWithStubImpl$Query$AllBackupSnapshots$backup$allSnapshots$service; + + TRes call({ + String? displayName, + String? id, + String? $__typename, + }); +} + +class _CopyWithImpl$Query$AllBackupSnapshots$backup$allSnapshots$service + implements + CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service { + _CopyWithImpl$Query$AllBackupSnapshots$backup$allSnapshots$service( + this._instance, + this._then, + ); + + final Query$AllBackupSnapshots$backup$allSnapshots$service _instance; + + final TRes Function(Query$AllBackupSnapshots$backup$allSnapshots$service) + _then; + + static const _undefined = {}; + + TRes call({ + Object? displayName = _undefined, + Object? id = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$AllBackupSnapshots$backup$allSnapshots$service( + displayName: displayName == _undefined || displayName == null + ? _instance.displayName + : (displayName as String), + id: id == _undefined || id == null ? _instance.id : (id as String), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Query$AllBackupSnapshots$backup$allSnapshots$service< + TRes> + implements + CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service { + _CopyWithStubImpl$Query$AllBackupSnapshots$backup$allSnapshots$service( + this._res); + + TRes _res; + + call({ + String? displayName, + String? id, + String? $__typename, + }) => + _res; +} diff --git a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart index 84550cc2..2f62067b 100644 --- a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart @@ -27,6 +27,10 @@ class Fragment$basicMutationReturnFields { return Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn .fromJson(json); + case "GenericBackupConfigReturn": + return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn + .fromJson(json); + case "GenericJobButationReturn": return Fragment$basicMutationReturnFields$$GenericJobButationReturn .fromJson(json); @@ -151,6 +155,9 @@ extension UtilityExtension$Fragment$basicMutationReturnFields required _T Function( Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) deviceApiTokenMutationReturn, + required _T Function( + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) + genericBackupConfigReturn, required _T Function( Fragment$basicMutationReturnFields$$GenericJobButationReturn) genericJobButationReturn, @@ -183,6 +190,10 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return deviceApiTokenMutationReturn(this as Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn); + case "GenericBackupConfigReturn": + return genericBackupConfigReturn(this + as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); + case "GenericJobButationReturn": return genericJobButationReturn(this as Fragment$basicMutationReturnFields$$GenericJobButationReturn); @@ -221,6 +232,8 @@ extension UtilityExtension$Fragment$basicMutationReturnFields _T Function( Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn)? deviceApiTokenMutationReturn, + _T Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn)? + genericBackupConfigReturn, _T Function(Fragment$basicMutationReturnFields$$GenericJobButationReturn)? genericJobButationReturn, _T Function(Fragment$basicMutationReturnFields$$GenericMutationReturn)? @@ -260,6 +273,14 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return orElse(); } + case "GenericBackupConfigReturn": + if (genericBackupConfigReturn != null) { + return genericBackupConfigReturn(this + as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); + } else { + return orElse(); + } + case "GenericJobButationReturn": if (genericJobButationReturn != null) { return genericJobButationReturn(this @@ -1008,6 +1029,186 @@ class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutati _res; } +class Fragment$basicMutationReturnFields$$GenericBackupConfigReturn + implements Fragment$basicMutationReturnFields { + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn({ + required this.code, + required this.message, + required this.success, + this.$__typename = 'GenericBackupConfigReturn', + }); + + factory Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.fromJson( + Map json) { + final l$code = json['code']; + final l$message = json['message']; + final l$success = json['success']; + final l$$__typename = json['__typename']; + return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + code: (l$code as int), + message: (l$message as String), + success: (l$success as bool), + $__typename: (l$$__typename as String), + ); + } + + final int code; + + final String message; + + final bool success; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$code = code; + _resultData['code'] = l$code; + final l$message = message; + _resultData['message'] = l$message; + final l$success = success; + _resultData['success'] = l$success; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$code = code; + final l$message = message; + final l$success = success; + final l$$__typename = $__typename; + return Object.hashAll([ + l$code, + l$message, + l$success, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) || + runtimeType != other.runtimeType) { + return false; + } + final l$code = code; + final lOther$code = other.code; + if (l$code != lOther$code) { + return false; + } + final l$message = message; + final lOther$message = other.message; + if (l$message != lOther$message) { + return false; + } + final l$success = success; + final lOther$success = other.success; + if (l$success != lOther$success) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn + on Fragment$basicMutationReturnFields$$GenericBackupConfigReturn { + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn> + get copyWith => + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> { + factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn instance, + TRes Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) + then, + ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; + + factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.stub( + TRes res) = + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; + + TRes call({ + int? code, + String? message, + bool? success, + String? $__typename, + }); +} + +class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> + implements + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> { + _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + this._instance, + this._then, + ); + + final Fragment$basicMutationReturnFields$$GenericBackupConfigReturn _instance; + + final TRes Function( + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) _then; + + static const _undefined = {}; + + TRes call({ + Object? code = _undefined, + Object? message = _undefined, + Object? success = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + code: + code == _undefined || code == null ? _instance.code : (code as int), + message: message == _undefined || message == null + ? _instance.message + : (message as String), + success: success == _undefined || success == null + ? _instance.success + : (success as bool), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> + implements + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> { + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + this._res); + + TRes _res; + + call({ + int? code, + String? message, + bool? success, + String? $__typename, + }) => + _res; +} + class Fragment$basicMutationReturnFields$$GenericJobButationReturn implements Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields$$GenericJobButationReturn({ diff --git a/lib/logic/api_maps/graphql_maps/schema/schema.graphql b/lib/logic/api_maps/graphql_maps/schema/schema.graphql index 89bc30c8..81f06b06 100644 --- a/lib/logic/api_maps/graphql_maps/schema/schema.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/schema.graphql @@ -1,54 +1,54 @@ type Alert { - message: String! severity: Severity! - timestamp: DateTime title: String! + message: String! + timestamp: DateTime } type Api { - devices: [ApiDevice!]! - recoveryKey: ApiRecoveryKeyStatus! version: String! + recoveryKey: ApiRecoveryKeyStatus! + devices: [ApiDevice!]! } type ApiDevice { + name: String! creationDate: DateTime! isCaller: Boolean! - name: String! } type ApiJob { - createdAt: DateTime! - description: String! - error: String - finishedAt: DateTime + uid: String! name: String! - progress: Int - result: String + description: String! status: String! statusText: String - uid: String! + progress: Int + createdAt: DateTime! updatedAt: DateTime! + finishedAt: DateTime + error: String + result: String } type ApiKeyMutationReturn implements MutationReturnInterface { + success: Boolean! + message: String! code: Int! key: String - message: String! - success: Boolean! } type ApiRecoveryKeyStatus { - creationDate: DateTime exists: Boolean! + valid: Boolean! + creationDate: DateTime expirationDate: DateTime usesLeft: Int - valid: Boolean! } type AutoUpgradeOptions { - allowReboot: Boolean! enable: Boolean! + allowReboot: Boolean! } input AutoUpgradeSettingsInput { @@ -57,52 +57,89 @@ input AutoUpgradeSettingsInput { } type AutoUpgradeSettingsMutationReturn implements MutationReturnInterface { - allowReboot: Boolean! + success: Boolean! + message: String! code: Int! enableAutoUpgrade: Boolean! - message: String! - success: Boolean! + allowReboot: Boolean! +} + +type Backup { + configuration: BackupConfiguration! + allSnapshots: [SnapshotInfo!]! +} + +type BackupConfiguration { + provider: BackupProvider! + encryptionKey: String! + isInitialized: Boolean! + autobackupPeriod: Int + locationName: String + locationId: String +} + +enum BackupProvider { + BACKBLAZE + NONE + MEMORY + FILE } """Date with time (isoformat)""" scalar DateTime type DeviceApiTokenMutationReturn implements MutationReturnInterface { - code: Int! - message: String! success: Boolean! + message: String! + code: Int! token: String } enum DnsProvider { - CLOUDFLARE, + CLOUDFLARE + DIGITALOCEAN DESEC } type DnsRecord { - content: String! - name: String! - priority: Int recordType: String! + name: String! + content: String! ttl: Int! + priority: Int +} + +type GenericBackupConfigReturn implements MutationReturnInterface { + success: Boolean! + message: String! + code: Int! + configuration: BackupConfiguration } type GenericJobButationReturn implements MutationReturnInterface { + success: Boolean! + message: String! code: Int! job: ApiJob - message: String! - success: Boolean! } type GenericMutationReturn implements MutationReturnInterface { - code: Int! - message: String! success: Boolean! + message: String! + code: Int! +} + +input InitializeRepositoryInput { + provider: BackupProvider! + locationId: String! + locationName: String! + login: String! + password: String! } type Job { - getJob(jobId: String!): ApiJob getJobs: [ApiJob!]! + getJob(jobId: String!): ApiJob } input MigrateToBindsInput { @@ -119,52 +156,59 @@ input MoveServiceInput { } type Mutation { - addSshKey(sshInput: SshMutationInput!): UserMutationReturn! - authorizeWithNewDeviceApiKey(input: UseNewDeviceKeyInput!): DeviceApiTokenMutationReturn! - changeAutoUpgradeSettings(settings: AutoUpgradeSettingsInput!): AutoUpgradeSettingsMutationReturn! - changeTimezone(timezone: String!): TimezoneMutationReturn! - createUser(user: UserMutationInput!): UserMutationReturn! - deleteDeviceApiToken(device: String!): GenericMutationReturn! - deleteUser(username: String!): GenericMutationReturn! - disableService(serviceId: String!): ServiceMutationReturn! - enableService(serviceId: String!): ServiceMutationReturn! - getNewDeviceApiKey: ApiKeyMutationReturn! getNewRecoveryApiKey(limits: RecoveryKeyLimitsInput = null): ApiKeyMutationReturn! - invalidateNewDeviceApiKey: GenericMutationReturn! - migrateToBinds(input: MigrateToBindsInput!): GenericJobButationReturn! - mountVolume(name: String!): GenericMutationReturn! - moveService(input: MoveServiceInput!): ServiceJobMutationReturn! - pullRepositoryChanges: GenericMutationReturn! - rebootSystem: GenericMutationReturn! + useRecoveryApiKey(input: UseRecoveryKeyInput!): DeviceApiTokenMutationReturn! refreshDeviceApiToken: DeviceApiTokenMutationReturn! - removeJob(jobId: String!): GenericMutationReturn! - removeSshKey(sshInput: SshMutationInput!): UserMutationReturn! - resizeVolume(name: String!): GenericMutationReturn! - restartService(serviceId: String!): ServiceMutationReturn! + deleteDeviceApiToken(device: String!): GenericMutationReturn! + getNewDeviceApiKey: ApiKeyMutationReturn! + invalidateNewDeviceApiKey: GenericMutationReturn! + authorizeWithNewDeviceApiKey(input: UseNewDeviceKeyInput!): DeviceApiTokenMutationReturn! + changeTimezone(timezone: String!): TimezoneMutationReturn! + changeAutoUpgradeSettings(settings: AutoUpgradeSettingsInput!): AutoUpgradeSettingsMutationReturn! runSystemRebuild: GenericMutationReturn! runSystemRollback: GenericMutationReturn! runSystemUpgrade: GenericMutationReturn! - startService(serviceId: String!): ServiceMutationReturn! - stopService(serviceId: String!): ServiceMutationReturn! - testMutation: GenericMutationReturn! - unmountVolume(name: String!): GenericMutationReturn! + rebootSystem: GenericMutationReturn! + pullRepositoryChanges: GenericMutationReturn! + createUser(user: UserMutationInput!): UserMutationReturn! + deleteUser(username: String!): GenericMutationReturn! updateUser(user: UserMutationInput!): UserMutationReturn! - useRecoveryApiKey(input: UseRecoveryKeyInput!): DeviceApiTokenMutationReturn! + addSshKey(sshInput: SshMutationInput!): UserMutationReturn! + removeSshKey(sshInput: SshMutationInput!): UserMutationReturn! + resizeVolume(name: String!): GenericMutationReturn! + mountVolume(name: String!): GenericMutationReturn! + unmountVolume(name: String!): GenericMutationReturn! + migrateToBinds(input: MigrateToBindsInput!): GenericJobButationReturn! + enableService(serviceId: String!): ServiceMutationReturn! + disableService(serviceId: String!): ServiceMutationReturn! + stopService(serviceId: String!): ServiceMutationReturn! + startService(serviceId: String!): ServiceMutationReturn! + restartService(serviceId: String!): ServiceMutationReturn! + moveService(input: MoveServiceInput!): ServiceJobMutationReturn! + removeJob(jobId: String!): GenericMutationReturn! + initializeRepository(repository: InitializeRepositoryInput!): GenericBackupConfigReturn! + removeRepository: GenericBackupConfigReturn! + setAutobackupPeriod(period: Int = null): GenericBackupConfigReturn! + startBackup(serviceId: String = null): GenericJobButationReturn! + restoreBackup(snapshotId: String!): GenericJobButationReturn! + forceSnapshotsReload: GenericMutationReturn! + testMutation: GenericMutationReturn! } interface MutationReturnInterface { - code: Int! - message: String! success: Boolean! + message: String! + code: Int! } type Query { + system: System! api: Api! + users: Users! + storage: Storage! jobs: Job! services: Services! - storage: Storage! - system: System! - users: Users! + backup: Backup! } input RecoveryKeyLimitsInput { @@ -178,49 +222,50 @@ enum ServerProvider { } type Service { - description: String! - displayName: String! - dnsRecords: [DnsRecord!] id: String! - isEnabled: Boolean! + displayName: String! + description: String! + svgIcon: String! isMovable: Boolean! isRequired: Boolean! + isEnabled: Boolean! status: ServiceStatusEnum! - storageUsage: ServiceStorageUsage! - svgIcon: String! url: String + dnsRecords: [DnsRecord!] + storageUsage: ServiceStorageUsage! + backupSnapshots: [SnapshotInfo!] } type ServiceJobMutationReturn implements MutationReturnInterface { + success: Boolean! + message: String! code: Int! job: ApiJob - message: String! service: Service - success: Boolean! } type ServiceMutationReturn implements MutationReturnInterface { - code: Int! - message: String! - service: Service success: Boolean! + message: String! + code: Int! + service: Service } enum ServiceStatusEnum { - ACTIVATING ACTIVE - DEACTIVATING - FAILED - INACTIVE - OFF RELOADING + INACTIVE + FAILED + ACTIVATING + DEACTIVATING + OFF } type ServiceStorageUsage implements StorageUsageInterface { - service: Service - title: String! usedSpace: String! volume: StorageVolume + title: String! + service: Service } type Services { @@ -228,11 +273,17 @@ type Services { } enum Severity { - CRITICAL - ERROR INFO - SUCCESS WARNING + ERROR + CRITICAL + SUCCESS +} + +type SnapshotInfo { + id: String! + service: Service! + createdAt: DateTime! } input SshMutationInput { @@ -251,21 +302,21 @@ type Storage { } interface StorageUsageInterface { - title: String! usedSpace: String! volume: StorageVolume + title: String! } type StorageVolume { - freeSpace: String! - model: String - name: String! - root: Boolean! - serial: String totalSpace: String! + freeSpace: String! + usedSpace: String! + root: Boolean! + name: String! + model: String + serial: String type: String! usages: [StorageUsageInterface!]! - usedSpace: String! } type Subscription { @@ -273,12 +324,12 @@ type Subscription { } type System { - busy: Boolean! + status: Alert! domainInfo: SystemDomainInfo! + settings: SystemSettings! info: SystemInfo! provider: SystemProviderInfo! - settings: SystemSettings! - status: Alert! + busy: Boolean! workingDirectory: String! } @@ -290,14 +341,14 @@ type SystemDomainInfo { } type SystemInfo { - pythonVersion: String! systemVersion: String! + pythonVersion: String! usingBinds: Boolean! } type SystemProviderInfo { - id: String! provider: ServerProvider! + id: String! } type SystemSettings { @@ -307,9 +358,9 @@ type SystemSettings { } type TimezoneMutationReturn implements MutationReturnInterface { - code: Int! - message: String! success: Boolean! + message: String! + code: Int! timezone: String } @@ -324,9 +375,9 @@ input UseRecoveryKeyInput { } type User { - sshKeys: [String!]! userType: UserType! username: String! + sshKeys: [String!]! } input UserMutationInput { @@ -335,9 +386,9 @@ input UserMutationInput { } type UserMutationReturn implements MutationReturnInterface { - code: Int! - message: String! success: Boolean! + message: String! + code: Int! user: User } @@ -358,4 +409,9 @@ fragment dnsRecordFields on DnsRecord { priority recordType ttl -} \ No newline at end of file +} + +fragment backupSnapshotFields on SnapshotInfo { + id + createdAt +} diff --git a/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart index 9325f5cb..ea4947ad 100644 --- a/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart @@ -143,6 +143,190 @@ class _CopyWithStubImpl$Input$AutoUpgradeSettingsInput _res; } +class Input$InitializeRepositoryInput { + factory Input$InitializeRepositoryInput({ + required Enum$BackupProvider provider, + required String locationId, + required String locationName, + required String login, + required String password, + }) => + Input$InitializeRepositoryInput._({ + r'provider': provider, + r'locationId': locationId, + r'locationName': locationName, + r'login': login, + r'password': password, + }); + + Input$InitializeRepositoryInput._(this._$data); + + factory Input$InitializeRepositoryInput.fromJson(Map data) { + final result$data = {}; + final l$provider = data['provider']; + result$data['provider'] = + fromJson$Enum$BackupProvider((l$provider as String)); + final l$locationId = data['locationId']; + result$data['locationId'] = (l$locationId as String); + final l$locationName = data['locationName']; + result$data['locationName'] = (l$locationName as String); + final l$login = data['login']; + result$data['login'] = (l$login as String); + final l$password = data['password']; + result$data['password'] = (l$password as String); + return Input$InitializeRepositoryInput._(result$data); + } + + Map _$data; + + Enum$BackupProvider get provider => + (_$data['provider'] as Enum$BackupProvider); + String get locationId => (_$data['locationId'] as String); + String get locationName => (_$data['locationName'] as String); + String get login => (_$data['login'] as String); + String get password => (_$data['password'] as String); + Map toJson() { + final result$data = {}; + final l$provider = provider; + result$data['provider'] = toJson$Enum$BackupProvider(l$provider); + final l$locationId = locationId; + result$data['locationId'] = l$locationId; + final l$locationName = locationName; + result$data['locationName'] = l$locationName; + final l$login = login; + result$data['login'] = l$login; + final l$password = password; + result$data['password'] = l$password; + return result$data; + } + + CopyWith$Input$InitializeRepositoryInput + get copyWith => CopyWith$Input$InitializeRepositoryInput( + this, + (i) => i, + ); + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Input$InitializeRepositoryInput) || + runtimeType != other.runtimeType) { + return false; + } + final l$provider = provider; + final lOther$provider = other.provider; + if (l$provider != lOther$provider) { + return false; + } + final l$locationId = locationId; + final lOther$locationId = other.locationId; + if (l$locationId != lOther$locationId) { + return false; + } + final l$locationName = locationName; + final lOther$locationName = other.locationName; + if (l$locationName != lOther$locationName) { + return false; + } + final l$login = login; + final lOther$login = other.login; + if (l$login != lOther$login) { + return false; + } + final l$password = password; + final lOther$password = other.password; + if (l$password != lOther$password) { + return false; + } + return true; + } + + @override + int get hashCode { + final l$provider = provider; + final l$locationId = locationId; + final l$locationName = locationName; + final l$login = login; + final l$password = password; + return Object.hashAll([ + l$provider, + l$locationId, + l$locationName, + l$login, + l$password, + ]); + } +} + +abstract class CopyWith$Input$InitializeRepositoryInput { + factory CopyWith$Input$InitializeRepositoryInput( + Input$InitializeRepositoryInput instance, + TRes Function(Input$InitializeRepositoryInput) then, + ) = _CopyWithImpl$Input$InitializeRepositoryInput; + + factory CopyWith$Input$InitializeRepositoryInput.stub(TRes res) = + _CopyWithStubImpl$Input$InitializeRepositoryInput; + + TRes call({ + Enum$BackupProvider? provider, + String? locationId, + String? locationName, + String? login, + String? password, + }); +} + +class _CopyWithImpl$Input$InitializeRepositoryInput + implements CopyWith$Input$InitializeRepositoryInput { + _CopyWithImpl$Input$InitializeRepositoryInput( + this._instance, + this._then, + ); + + final Input$InitializeRepositoryInput _instance; + + final TRes Function(Input$InitializeRepositoryInput) _then; + + static const _undefined = {}; + + TRes call({ + Object? provider = _undefined, + Object? locationId = _undefined, + Object? locationName = _undefined, + Object? login = _undefined, + Object? password = _undefined, + }) => + _then(Input$InitializeRepositoryInput._({ + ..._instance._$data, + if (provider != _undefined && provider != null) + 'provider': (provider as Enum$BackupProvider), + if (locationId != _undefined && locationId != null) + 'locationId': (locationId as String), + if (locationName != _undefined && locationName != null) + 'locationName': (locationName as String), + if (login != _undefined && login != null) 'login': (login as String), + if (password != _undefined && password != null) + 'password': (password as String), + })); +} + +class _CopyWithStubImpl$Input$InitializeRepositoryInput + implements CopyWith$Input$InitializeRepositoryInput { + _CopyWithStubImpl$Input$InitializeRepositoryInput(this._res); + + TRes _res; + + call({ + Enum$BackupProvider? provider, + String? locationId, + String? locationName, + String? login, + String? password, + }) => + _res; +} + class Input$MigrateToBindsInput { factory Input$MigrateToBindsInput({ required String emailBlockDevice, @@ -1096,12 +1280,46 @@ class _CopyWithStubImpl$Input$UserMutationInput _res; } -enum Enum$DnsProvider { CLOUDFLARE, DESEC, $unknown } +enum Enum$BackupProvider { BACKBLAZE, NONE, MEMORY, FILE, $unknown } + +String toJson$Enum$BackupProvider(Enum$BackupProvider e) { + switch (e) { + case Enum$BackupProvider.BACKBLAZE: + return r'BACKBLAZE'; + case Enum$BackupProvider.NONE: + return r'NONE'; + case Enum$BackupProvider.MEMORY: + return r'MEMORY'; + case Enum$BackupProvider.FILE: + return r'FILE'; + case Enum$BackupProvider.$unknown: + return r'$unknown'; + } +} + +Enum$BackupProvider fromJson$Enum$BackupProvider(String value) { + switch (value) { + case r'BACKBLAZE': + return Enum$BackupProvider.BACKBLAZE; + case r'NONE': + return Enum$BackupProvider.NONE; + case r'MEMORY': + return Enum$BackupProvider.MEMORY; + case r'FILE': + return Enum$BackupProvider.FILE; + default: + return Enum$BackupProvider.$unknown; + } +} + +enum Enum$DnsProvider { CLOUDFLARE, DIGITALOCEAN, DESEC, $unknown } String toJson$Enum$DnsProvider(Enum$DnsProvider e) { switch (e) { case Enum$DnsProvider.CLOUDFLARE: return r'CLOUDFLARE'; + case Enum$DnsProvider.DIGITALOCEAN: + return r'DIGITALOCEAN'; case Enum$DnsProvider.DESEC: return r'DESEC'; case Enum$DnsProvider.$unknown: @@ -1113,6 +1331,8 @@ Enum$DnsProvider fromJson$Enum$DnsProvider(String value) { switch (value) { case r'CLOUDFLARE': return Enum$DnsProvider.CLOUDFLARE; + case r'DIGITALOCEAN': + return Enum$DnsProvider.DIGITALOCEAN; case r'DESEC': return Enum$DnsProvider.DESEC; default: @@ -1145,32 +1365,32 @@ Enum$ServerProvider fromJson$Enum$ServerProvider(String value) { } enum Enum$ServiceStatusEnum { - ACTIVATING, ACTIVE, - DEACTIVATING, - FAILED, - INACTIVE, - OFF, RELOADING, + INACTIVE, + FAILED, + ACTIVATING, + DEACTIVATING, + OFF, $unknown } String toJson$Enum$ServiceStatusEnum(Enum$ServiceStatusEnum e) { switch (e) { - case Enum$ServiceStatusEnum.ACTIVATING: - return r'ACTIVATING'; case Enum$ServiceStatusEnum.ACTIVE: return r'ACTIVE'; - case Enum$ServiceStatusEnum.DEACTIVATING: - return r'DEACTIVATING'; - case Enum$ServiceStatusEnum.FAILED: - return r'FAILED'; - case Enum$ServiceStatusEnum.INACTIVE: - return r'INACTIVE'; - case Enum$ServiceStatusEnum.OFF: - return r'OFF'; case Enum$ServiceStatusEnum.RELOADING: return r'RELOADING'; + case Enum$ServiceStatusEnum.INACTIVE: + return r'INACTIVE'; + case Enum$ServiceStatusEnum.FAILED: + return r'FAILED'; + case Enum$ServiceStatusEnum.ACTIVATING: + return r'ACTIVATING'; + case Enum$ServiceStatusEnum.DEACTIVATING: + return r'DEACTIVATING'; + case Enum$ServiceStatusEnum.OFF: + return r'OFF'; case Enum$ServiceStatusEnum.$unknown: return r'$unknown'; } @@ -1178,39 +1398,39 @@ String toJson$Enum$ServiceStatusEnum(Enum$ServiceStatusEnum e) { Enum$ServiceStatusEnum fromJson$Enum$ServiceStatusEnum(String value) { switch (value) { - case r'ACTIVATING': - return Enum$ServiceStatusEnum.ACTIVATING; case r'ACTIVE': return Enum$ServiceStatusEnum.ACTIVE; - case r'DEACTIVATING': - return Enum$ServiceStatusEnum.DEACTIVATING; - case r'FAILED': - return Enum$ServiceStatusEnum.FAILED; - case r'INACTIVE': - return Enum$ServiceStatusEnum.INACTIVE; - case r'OFF': - return Enum$ServiceStatusEnum.OFF; case r'RELOADING': return Enum$ServiceStatusEnum.RELOADING; + case r'INACTIVE': + return Enum$ServiceStatusEnum.INACTIVE; + case r'FAILED': + return Enum$ServiceStatusEnum.FAILED; + case r'ACTIVATING': + return Enum$ServiceStatusEnum.ACTIVATING; + case r'DEACTIVATING': + return Enum$ServiceStatusEnum.DEACTIVATING; + case r'OFF': + return Enum$ServiceStatusEnum.OFF; default: return Enum$ServiceStatusEnum.$unknown; } } -enum Enum$Severity { CRITICAL, ERROR, INFO, SUCCESS, WARNING, $unknown } +enum Enum$Severity { INFO, WARNING, ERROR, CRITICAL, SUCCESS, $unknown } String toJson$Enum$Severity(Enum$Severity e) { switch (e) { - case Enum$Severity.CRITICAL: - return r'CRITICAL'; - case Enum$Severity.ERROR: - return r'ERROR'; case Enum$Severity.INFO: return r'INFO'; - case Enum$Severity.SUCCESS: - return r'SUCCESS'; case Enum$Severity.WARNING: return r'WARNING'; + case Enum$Severity.ERROR: + return r'ERROR'; + case Enum$Severity.CRITICAL: + return r'CRITICAL'; + case Enum$Severity.SUCCESS: + return r'SUCCESS'; case Enum$Severity.$unknown: return r'$unknown'; } @@ -1218,16 +1438,16 @@ String toJson$Enum$Severity(Enum$Severity e) { Enum$Severity fromJson$Enum$Severity(String value) { switch (value) { - case r'CRITICAL': - return Enum$Severity.CRITICAL; - case r'ERROR': - return Enum$Severity.ERROR; case r'INFO': return Enum$Severity.INFO; - case r'SUCCESS': - return Enum$Severity.SUCCESS; case r'WARNING': return Enum$Severity.WARNING; + case r'ERROR': + return Enum$Severity.ERROR; + case r'CRITICAL': + return Enum$Severity.CRITICAL; + case r'SUCCESS': + return Enum$Severity.SUCCESS; default: return Enum$Severity.$unknown; } @@ -1555,11 +1775,229 @@ extension ClientExtension$Fragment$dnsRecordFields on graphql.GraphQLClient { } } +class Fragment$backupSnapshotFields { + Fragment$backupSnapshotFields({ + required this.id, + required this.createdAt, + this.$__typename = 'SnapshotInfo', + }); + + factory Fragment$backupSnapshotFields.fromJson(Map json) { + final l$id = json['id']; + final l$createdAt = json['createdAt']; + final l$$__typename = json['__typename']; + return Fragment$backupSnapshotFields( + id: (l$id as String), + createdAt: dateTimeFromJson(l$createdAt), + $__typename: (l$$__typename as String), + ); + } + + final String id; + + final DateTime createdAt; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$id = id; + _resultData['id'] = l$id; + final l$createdAt = createdAt; + _resultData['createdAt'] = dateTimeToJson(l$createdAt); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$id = id; + final l$createdAt = createdAt; + final l$$__typename = $__typename; + return Object.hashAll([ + l$id, + l$createdAt, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Fragment$backupSnapshotFields) || + runtimeType != other.runtimeType) { + return false; + } + final l$id = id; + final lOther$id = other.id; + if (l$id != lOther$id) { + return false; + } + final l$createdAt = createdAt; + final lOther$createdAt = other.createdAt; + if (l$createdAt != lOther$createdAt) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$backupSnapshotFields + on Fragment$backupSnapshotFields { + CopyWith$Fragment$backupSnapshotFields + get copyWith => CopyWith$Fragment$backupSnapshotFields( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$backupSnapshotFields { + factory CopyWith$Fragment$backupSnapshotFields( + Fragment$backupSnapshotFields instance, + TRes Function(Fragment$backupSnapshotFields) then, + ) = _CopyWithImpl$Fragment$backupSnapshotFields; + + factory CopyWith$Fragment$backupSnapshotFields.stub(TRes res) = + _CopyWithStubImpl$Fragment$backupSnapshotFields; + + TRes call({ + String? id, + DateTime? createdAt, + String? $__typename, + }); +} + +class _CopyWithImpl$Fragment$backupSnapshotFields + implements CopyWith$Fragment$backupSnapshotFields { + _CopyWithImpl$Fragment$backupSnapshotFields( + this._instance, + this._then, + ); + + final Fragment$backupSnapshotFields _instance; + + final TRes Function(Fragment$backupSnapshotFields) _then; + + static const _undefined = {}; + + TRes call({ + Object? id = _undefined, + Object? createdAt = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$backupSnapshotFields( + id: id == _undefined || id == null ? _instance.id : (id as String), + createdAt: createdAt == _undefined || createdAt == null + ? _instance.createdAt + : (createdAt as DateTime), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Fragment$backupSnapshotFields + implements CopyWith$Fragment$backupSnapshotFields { + _CopyWithStubImpl$Fragment$backupSnapshotFields(this._res); + + TRes _res; + + call({ + String? id, + DateTime? createdAt, + String? $__typename, + }) => + _res; +} + +const fragmentDefinitionbackupSnapshotFields = FragmentDefinitionNode( + name: NameNode(value: 'backupSnapshotFields'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'SnapshotInfo'), + isNonNull: false, + )), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'createdAt'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), +); +const documentNodeFragmentbackupSnapshotFields = DocumentNode(definitions: [ + fragmentDefinitionbackupSnapshotFields, +]); + +extension ClientExtension$Fragment$backupSnapshotFields + on graphql.GraphQLClient { + void writeFragment$backupSnapshotFields({ + required Fragment$backupSnapshotFields data, + required Map idFields, + bool broadcast = true, + }) => + this.writeFragment( + graphql.FragmentRequest( + idFields: idFields, + fragment: const graphql.Fragment( + fragmentName: 'backupSnapshotFields', + document: documentNodeFragmentbackupSnapshotFields, + ), + ), + data: data.toJson(), + broadcast: broadcast, + ); + Fragment$backupSnapshotFields? readFragment$backupSnapshotFields({ + required Map idFields, + bool optimistic = true, + }) { + final result = this.readFragment( + graphql.FragmentRequest( + idFields: idFields, + fragment: const graphql.Fragment( + fragmentName: 'backupSnapshotFields', + document: documentNodeFragmentbackupSnapshotFields, + ), + ), + optimistic: optimistic, + ); + return result == null + ? null + : Fragment$backupSnapshotFields.fromJson(result); + } +} + const possibleTypesMap = >{ 'MutationReturnInterface': { 'ApiKeyMutationReturn', 'AutoUpgradeSettingsMutationReturn', 'DeviceApiTokenMutationReturn', + 'GenericBackupConfigReturn', 'GenericJobButationReturn', 'GenericMutationReturn', 'ServiceJobMutationReturn', diff --git a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart index f41e841f..cbd77ad0 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart @@ -28,6 +28,10 @@ class Fragment$basicMutationReturnFields { return Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn .fromJson(json); + case "GenericBackupConfigReturn": + return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn + .fromJson(json); + case "GenericJobButationReturn": return Fragment$basicMutationReturnFields$$GenericJobButationReturn .fromJson(json); @@ -152,6 +156,9 @@ extension UtilityExtension$Fragment$basicMutationReturnFields required _T Function( Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) deviceApiTokenMutationReturn, + required _T Function( + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) + genericBackupConfigReturn, required _T Function( Fragment$basicMutationReturnFields$$GenericJobButationReturn) genericJobButationReturn, @@ -184,6 +191,10 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return deviceApiTokenMutationReturn(this as Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn); + case "GenericBackupConfigReturn": + return genericBackupConfigReturn(this + as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); + case "GenericJobButationReturn": return genericJobButationReturn(this as Fragment$basicMutationReturnFields$$GenericJobButationReturn); @@ -222,6 +233,8 @@ extension UtilityExtension$Fragment$basicMutationReturnFields _T Function( Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn)? deviceApiTokenMutationReturn, + _T Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn)? + genericBackupConfigReturn, _T Function(Fragment$basicMutationReturnFields$$GenericJobButationReturn)? genericJobButationReturn, _T Function(Fragment$basicMutationReturnFields$$GenericMutationReturn)? @@ -261,6 +274,14 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return orElse(); } + case "GenericBackupConfigReturn": + if (genericBackupConfigReturn != null) { + return genericBackupConfigReturn(this + as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); + } else { + return orElse(); + } + case "GenericJobButationReturn": if (genericJobButationReturn != null) { return genericJobButationReturn(this @@ -1009,6 +1030,186 @@ class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutati _res; } +class Fragment$basicMutationReturnFields$$GenericBackupConfigReturn + implements Fragment$basicMutationReturnFields { + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn({ + required this.code, + required this.message, + required this.success, + this.$__typename = 'GenericBackupConfigReturn', + }); + + factory Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.fromJson( + Map json) { + final l$code = json['code']; + final l$message = json['message']; + final l$success = json['success']; + final l$$__typename = json['__typename']; + return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + code: (l$code as int), + message: (l$message as String), + success: (l$success as bool), + $__typename: (l$$__typename as String), + ); + } + + final int code; + + final String message; + + final bool success; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$code = code; + _resultData['code'] = l$code; + final l$message = message; + _resultData['message'] = l$message; + final l$success = success; + _resultData['success'] = l$success; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$code = code; + final l$message = message; + final l$success = success; + final l$$__typename = $__typename; + return Object.hashAll([ + l$code, + l$message, + l$success, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) || + runtimeType != other.runtimeType) { + return false; + } + final l$code = code; + final lOther$code = other.code; + if (l$code != lOther$code) { + return false; + } + final l$message = message; + final lOther$message = other.message; + if (l$message != lOther$message) { + return false; + } + final l$success = success; + final lOther$success = other.success; + if (l$success != lOther$success) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn + on Fragment$basicMutationReturnFields$$GenericBackupConfigReturn { + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn> + get copyWith => + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> { + factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn instance, + TRes Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) + then, + ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; + + factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.stub( + TRes res) = + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; + + TRes call({ + int? code, + String? message, + bool? success, + String? $__typename, + }); +} + +class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> + implements + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> { + _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + this._instance, + this._then, + ); + + final Fragment$basicMutationReturnFields$$GenericBackupConfigReturn _instance; + + final TRes Function( + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) _then; + + static const _undefined = {}; + + TRes call({ + Object? code = _undefined, + Object? message = _undefined, + Object? success = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + code: + code == _undefined || code == null ? _instance.code : (code as int), + message: message == _undefined || message == null + ? _instance.message + : (message as String), + success: success == _undefined || success == null + ? _instance.success + : (success as bool), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> + implements + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> { + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + this._res); + + TRes _res; + + call({ + int? code, + String? message, + bool? success, + String? $__typename, + }) => + _res; +} + class Fragment$basicMutationReturnFields$$GenericJobButationReturn implements Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields$$GenericJobButationReturn({ diff --git a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart index 64738ad8..98e6dd77 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart @@ -27,6 +27,10 @@ class Fragment$basicMutationReturnFields { return Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn .fromJson(json); + case "GenericBackupConfigReturn": + return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn + .fromJson(json); + case "GenericJobButationReturn": return Fragment$basicMutationReturnFields$$GenericJobButationReturn .fromJson(json); @@ -151,6 +155,9 @@ extension UtilityExtension$Fragment$basicMutationReturnFields required _T Function( Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) deviceApiTokenMutationReturn, + required _T Function( + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) + genericBackupConfigReturn, required _T Function( Fragment$basicMutationReturnFields$$GenericJobButationReturn) genericJobButationReturn, @@ -183,6 +190,10 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return deviceApiTokenMutationReturn(this as Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn); + case "GenericBackupConfigReturn": + return genericBackupConfigReturn(this + as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); + case "GenericJobButationReturn": return genericJobButationReturn(this as Fragment$basicMutationReturnFields$$GenericJobButationReturn); @@ -221,6 +232,8 @@ extension UtilityExtension$Fragment$basicMutationReturnFields _T Function( Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn)? deviceApiTokenMutationReturn, + _T Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn)? + genericBackupConfigReturn, _T Function(Fragment$basicMutationReturnFields$$GenericJobButationReturn)? genericJobButationReturn, _T Function(Fragment$basicMutationReturnFields$$GenericMutationReturn)? @@ -260,6 +273,14 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return orElse(); } + case "GenericBackupConfigReturn": + if (genericBackupConfigReturn != null) { + return genericBackupConfigReturn(this + as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); + } else { + return orElse(); + } + case "GenericJobButationReturn": if (genericJobButationReturn != null) { return genericJobButationReturn(this @@ -1008,6 +1029,186 @@ class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutati _res; } +class Fragment$basicMutationReturnFields$$GenericBackupConfigReturn + implements Fragment$basicMutationReturnFields { + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn({ + required this.code, + required this.message, + required this.success, + this.$__typename = 'GenericBackupConfigReturn', + }); + + factory Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.fromJson( + Map json) { + final l$code = json['code']; + final l$message = json['message']; + final l$success = json['success']; + final l$$__typename = json['__typename']; + return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + code: (l$code as int), + message: (l$message as String), + success: (l$success as bool), + $__typename: (l$$__typename as String), + ); + } + + final int code; + + final String message; + + final bool success; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$code = code; + _resultData['code'] = l$code; + final l$message = message; + _resultData['message'] = l$message; + final l$success = success; + _resultData['success'] = l$success; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$code = code; + final l$message = message; + final l$success = success; + final l$$__typename = $__typename; + return Object.hashAll([ + l$code, + l$message, + l$success, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) || + runtimeType != other.runtimeType) { + return false; + } + final l$code = code; + final lOther$code = other.code; + if (l$code != lOther$code) { + return false; + } + final l$message = message; + final lOther$message = other.message; + if (l$message != lOther$message) { + return false; + } + final l$success = success; + final lOther$success = other.success; + if (l$success != lOther$success) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn + on Fragment$basicMutationReturnFields$$GenericBackupConfigReturn { + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn> + get copyWith => + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> { + factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn instance, + TRes Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) + then, + ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; + + factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.stub( + TRes res) = + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; + + TRes call({ + int? code, + String? message, + bool? success, + String? $__typename, + }); +} + +class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> + implements + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> { + _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + this._instance, + this._then, + ); + + final Fragment$basicMutationReturnFields$$GenericBackupConfigReturn _instance; + + final TRes Function( + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) _then; + + static const _undefined = {}; + + TRes call({ + Object? code = _undefined, + Object? message = _undefined, + Object? success = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + code: + code == _undefined || code == null ? _instance.code : (code as int), + message: message == _undefined || message == null + ? _instance.message + : (message as String), + success: success == _undefined || success == null + ? _instance.success + : (success as bool), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> + implements + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> { + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + this._res); + + TRes _res; + + call({ + int? code, + String? message, + bool? success, + String? $__typename, + }) => + _res; +} + class Fragment$basicMutationReturnFields$$GenericJobButationReturn implements Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields$$GenericJobButationReturn({ diff --git a/lib/logic/api_maps/graphql_maps/schema/services.graphql b/lib/logic/api_maps/graphql_maps/schema/services.graphql index 7386c362..7998e5c0 100644 --- a/lib/logic/api_maps/graphql_maps/schema/services.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/services.graphql @@ -77,4 +77,4 @@ mutation MoveService($input: MoveServiceInput!) { updatedAt } } -} \ No newline at end of file +} diff --git a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart index 616788d8..8ea9cbbc 100644 --- a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart @@ -28,6 +28,10 @@ class Fragment$basicMutationReturnFields { return Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn .fromJson(json); + case "GenericBackupConfigReturn": + return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn + .fromJson(json); + case "GenericJobButationReturn": return Fragment$basicMutationReturnFields$$GenericJobButationReturn .fromJson(json); @@ -152,6 +156,9 @@ extension UtilityExtension$Fragment$basicMutationReturnFields required _T Function( Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) deviceApiTokenMutationReturn, + required _T Function( + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) + genericBackupConfigReturn, required _T Function( Fragment$basicMutationReturnFields$$GenericJobButationReturn) genericJobButationReturn, @@ -184,6 +191,10 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return deviceApiTokenMutationReturn(this as Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn); + case "GenericBackupConfigReturn": + return genericBackupConfigReturn(this + as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); + case "GenericJobButationReturn": return genericJobButationReturn(this as Fragment$basicMutationReturnFields$$GenericJobButationReturn); @@ -222,6 +233,8 @@ extension UtilityExtension$Fragment$basicMutationReturnFields _T Function( Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn)? deviceApiTokenMutationReturn, + _T Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn)? + genericBackupConfigReturn, _T Function(Fragment$basicMutationReturnFields$$GenericJobButationReturn)? genericJobButationReturn, _T Function(Fragment$basicMutationReturnFields$$GenericMutationReturn)? @@ -261,6 +274,14 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return orElse(); } + case "GenericBackupConfigReturn": + if (genericBackupConfigReturn != null) { + return genericBackupConfigReturn(this + as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); + } else { + return orElse(); + } + case "GenericJobButationReturn": if (genericJobButationReturn != null) { return genericJobButationReturn(this @@ -1009,6 +1030,186 @@ class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutati _res; } +class Fragment$basicMutationReturnFields$$GenericBackupConfigReturn + implements Fragment$basicMutationReturnFields { + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn({ + required this.code, + required this.message, + required this.success, + this.$__typename = 'GenericBackupConfigReturn', + }); + + factory Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.fromJson( + Map json) { + final l$code = json['code']; + final l$message = json['message']; + final l$success = json['success']; + final l$$__typename = json['__typename']; + return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + code: (l$code as int), + message: (l$message as String), + success: (l$success as bool), + $__typename: (l$$__typename as String), + ); + } + + final int code; + + final String message; + + final bool success; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$code = code; + _resultData['code'] = l$code; + final l$message = message; + _resultData['message'] = l$message; + final l$success = success; + _resultData['success'] = l$success; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$code = code; + final l$message = message; + final l$success = success; + final l$$__typename = $__typename; + return Object.hashAll([ + l$code, + l$message, + l$success, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) || + runtimeType != other.runtimeType) { + return false; + } + final l$code = code; + final lOther$code = other.code; + if (l$code != lOther$code) { + return false; + } + final l$message = message; + final lOther$message = other.message; + if (l$message != lOther$message) { + return false; + } + final l$success = success; + final lOther$success = other.success; + if (l$success != lOther$success) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn + on Fragment$basicMutationReturnFields$$GenericBackupConfigReturn { + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn> + get copyWith => + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> { + factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn instance, + TRes Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) + then, + ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; + + factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.stub( + TRes res) = + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; + + TRes call({ + int? code, + String? message, + bool? success, + String? $__typename, + }); +} + +class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> + implements + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> { + _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + this._instance, + this._then, + ); + + final Fragment$basicMutationReturnFields$$GenericBackupConfigReturn _instance; + + final TRes Function( + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) _then; + + static const _undefined = {}; + + TRes call({ + Object? code = _undefined, + Object? message = _undefined, + Object? success = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + code: + code == _undefined || code == null ? _instance.code : (code as int), + message: message == _undefined || message == null + ? _instance.message + : (message as String), + success: success == _undefined || success == null + ? _instance.success + : (success as bool), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> + implements + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> { + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + this._res); + + TRes _res; + + call({ + int? code, + String? message, + bool? success, + String? $__typename, + }) => + _res; +} + class Fragment$basicMutationReturnFields$$GenericJobButationReturn implements Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields$$GenericJobButationReturn({ diff --git a/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart index 02cde074..1a7d4e98 100644 --- a/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart @@ -27,6 +27,10 @@ class Fragment$basicMutationReturnFields { return Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn .fromJson(json); + case "GenericBackupConfigReturn": + return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn + .fromJson(json); + case "GenericJobButationReturn": return Fragment$basicMutationReturnFields$$GenericJobButationReturn .fromJson(json); @@ -151,6 +155,9 @@ extension UtilityExtension$Fragment$basicMutationReturnFields required _T Function( Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) deviceApiTokenMutationReturn, + required _T Function( + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) + genericBackupConfigReturn, required _T Function( Fragment$basicMutationReturnFields$$GenericJobButationReturn) genericJobButationReturn, @@ -183,6 +190,10 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return deviceApiTokenMutationReturn(this as Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn); + case "GenericBackupConfigReturn": + return genericBackupConfigReturn(this + as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); + case "GenericJobButationReturn": return genericJobButationReturn(this as Fragment$basicMutationReturnFields$$GenericJobButationReturn); @@ -221,6 +232,8 @@ extension UtilityExtension$Fragment$basicMutationReturnFields _T Function( Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn)? deviceApiTokenMutationReturn, + _T Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn)? + genericBackupConfigReturn, _T Function(Fragment$basicMutationReturnFields$$GenericJobButationReturn)? genericJobButationReturn, _T Function(Fragment$basicMutationReturnFields$$GenericMutationReturn)? @@ -260,6 +273,14 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return orElse(); } + case "GenericBackupConfigReturn": + if (genericBackupConfigReturn != null) { + return genericBackupConfigReturn(this + as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); + } else { + return orElse(); + } + case "GenericJobButationReturn": if (genericJobButationReturn != null) { return genericJobButationReturn(this @@ -1008,6 +1029,186 @@ class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutati _res; } +class Fragment$basicMutationReturnFields$$GenericBackupConfigReturn + implements Fragment$basicMutationReturnFields { + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn({ + required this.code, + required this.message, + required this.success, + this.$__typename = 'GenericBackupConfigReturn', + }); + + factory Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.fromJson( + Map json) { + final l$code = json['code']; + final l$message = json['message']; + final l$success = json['success']; + final l$$__typename = json['__typename']; + return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + code: (l$code as int), + message: (l$message as String), + success: (l$success as bool), + $__typename: (l$$__typename as String), + ); + } + + final int code; + + final String message; + + final bool success; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$code = code; + _resultData['code'] = l$code; + final l$message = message; + _resultData['message'] = l$message; + final l$success = success; + _resultData['success'] = l$success; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$code = code; + final l$message = message; + final l$success = success; + final l$$__typename = $__typename; + return Object.hashAll([ + l$code, + l$message, + l$success, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) || + runtimeType != other.runtimeType) { + return false; + } + final l$code = code; + final lOther$code = other.code; + if (l$code != lOther$code) { + return false; + } + final l$message = message; + final lOther$message = other.message; + if (l$message != lOther$message) { + return false; + } + final l$success = success; + final lOther$success = other.success; + if (l$success != lOther$success) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn + on Fragment$basicMutationReturnFields$$GenericBackupConfigReturn { + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn> + get copyWith => + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> { + factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn instance, + TRes Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) + then, + ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; + + factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.stub( + TRes res) = + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; + + TRes call({ + int? code, + String? message, + bool? success, + String? $__typename, + }); +} + +class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> + implements + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> { + _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + this._instance, + this._then, + ); + + final Fragment$basicMutationReturnFields$$GenericBackupConfigReturn _instance; + + final TRes Function( + Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) _then; + + static const _undefined = {}; + + TRes call({ + Object? code = _undefined, + Object? message = _undefined, + Object? success = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + code: + code == _undefined || code == null ? _instance.code : (code as int), + message: message == _undefined || message == null + ? _instance.message + : (message as String), + success: success == _undefined || success == null + ? _instance.success + : (success as bool), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> + implements + CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< + TRes> { + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( + this._res); + + TRes _res; + + call({ + int? code, + String? message, + bool? success, + String? $__typename, + }) => + _res; +} + class Fragment$basicMutationReturnFields$$GenericJobButationReturn implements Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields$$GenericJobButationReturn({ From 5069563d45171b6e73418e2a4b908dc89e49eb2b Mon Sep 17 00:00:00 2001 From: Inex Code Date: Fri, 16 Jun 2023 04:31:23 +0300 Subject: [PATCH 03/20] chore(router): Rebuild the router with latest AutoRoute --- lib/ui/router/router.gr.dart | 554 +++++++++++++++++------------------ 1 file changed, 277 insertions(+), 277 deletions(-) diff --git a/lib/ui/router/router.gr.dart b/lib/ui/router/router.gr.dart index a4e919b6..4ceba014 100644 --- a/lib/ui/router/router.gr.dart +++ b/lib/ui/router/router.gr.dart @@ -15,6 +15,24 @@ abstract class _$RootRouter extends RootStackRouter { @override final Map pagesMap = { + BackupDetailsRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const BackupDetailsPage(), + ); + }, + DevicesRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const DevicesScreen(), + ); + }, + DnsDetailsRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const DnsDetailsPage(), + ); + }, AppSettingsRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, @@ -27,10 +45,10 @@ abstract class _$RootRouter extends RootStackRouter { child: const DeveloperSettingsPage(), ); }, - ConsoleRoute.name: (routeData) { + AboutApplicationRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, - child: const ConsolePage(), + child: const AboutApplicationPage(), ); }, MoreRoute.name: (routeData) { @@ -39,10 +57,10 @@ abstract class _$RootRouter extends RootStackRouter { child: const MorePage(), ); }, - AboutApplicationRoute.name: (routeData) { + ConsoleRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, - child: const AboutApplicationPage(), + child: const ConsolePage(), ); }, OnboardingRoute.name: (routeData) { @@ -57,84 +75,16 @@ abstract class _$RootRouter extends RootStackRouter { child: const ProvidersPage(), ); }, - ServerDetailsRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const ServerDetailsScreen(), - ); - }, - ServiceRoute.name: (routeData) { - final args = routeData.argsAs(); - return AutoRoutePage( - routeData: routeData, - child: ServicePage( - serviceId: args.serviceId, - key: args.key, - ), - ); - }, - ServicesRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const ServicesPage(), - ); - }, - UsersRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const UsersPage(), - ); - }, - NewUserRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const NewUserPage(), - ); - }, - UserDetailsRoute.name: (routeData) { - final args = routeData.argsAs(); - return AutoRoutePage( - routeData: routeData, - child: UserDetailsPage( - login: args.login, - key: args.key, - ), - ); - }, - BackupDetailsRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const BackupDetailsPage(), - ); - }, - DnsDetailsRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const DnsDetailsPage(), - ); - }, - RecoveryRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const RecoveryRouting(), - ); - }, - InitializingRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const InitializingPage(), - ); - }, RecoveryKeyRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, child: const RecoveryKeyPage(), ); }, - DevicesRoute.name: (routeData) { + ServerDetailsRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, - child: const DevicesScreen(), + child: const ServerDetailsScreen(), ); }, ServicesMigrationRoute.name: (routeData) { @@ -170,6 +120,56 @@ abstract class _$RootRouter extends RootStackRouter { ), ); }, + ServiceRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( + routeData: routeData, + child: ServicePage( + serviceId: args.serviceId, + key: args.key, + ), + ); + }, + ServicesRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const ServicesPage(), + ); + }, + InitializingRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const InitializingPage(), + ); + }, + RecoveryRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const RecoveryRouting(), + ); + }, + UsersRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const UsersPage(), + ); + }, + NewUserRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const NewUserPage(), + ); + }, + UserDetailsRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( + routeData: routeData, + child: UserDetailsPage( + login: args.login, + key: args.key, + ), + ); + }, RootRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, @@ -179,6 +179,48 @@ abstract class _$RootRouter extends RootStackRouter { }; } +/// generated route for +/// [BackupDetailsPage] +class BackupDetailsRoute extends PageRouteInfo { + const BackupDetailsRoute({List? children}) + : super( + BackupDetailsRoute.name, + initialChildren: children, + ); + + static const String name = 'BackupDetailsRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [DevicesScreen] +class DevicesRoute extends PageRouteInfo { + const DevicesRoute({List? children}) + : super( + DevicesRoute.name, + initialChildren: children, + ); + + static const String name = 'DevicesRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [DnsDetailsPage] +class DnsDetailsRoute extends PageRouteInfo { + const DnsDetailsRoute({List? children}) + : super( + DnsDetailsRoute.name, + initialChildren: children, + ); + + static const String name = 'DnsDetailsRoute'; + + static const PageInfo page = PageInfo(name); +} + /// generated route for /// [AppSettingsPage] class AppSettingsRoute extends PageRouteInfo { @@ -208,15 +250,15 @@ class DeveloperSettingsRoute extends PageRouteInfo { } /// generated route for -/// [ConsolePage] -class ConsoleRoute extends PageRouteInfo { - const ConsoleRoute({List? children}) +/// [AboutApplicationPage] +class AboutApplicationRoute extends PageRouteInfo { + const AboutApplicationRoute({List? children}) : super( - ConsoleRoute.name, + AboutApplicationRoute.name, initialChildren: children, ); - static const String name = 'ConsoleRoute'; + static const String name = 'AboutApplicationRoute'; static const PageInfo page = PageInfo(name); } @@ -236,15 +278,15 @@ class MoreRoute extends PageRouteInfo { } /// generated route for -/// [AboutApplicationPage] -class AboutApplicationRoute extends PageRouteInfo { - const AboutApplicationRoute({List? children}) +/// [ConsolePage] +class ConsoleRoute extends PageRouteInfo { + const ConsoleRoute({List? children}) : super( - AboutApplicationRoute.name, + ConsoleRoute.name, initialChildren: children, ); - static const String name = 'AboutApplicationRoute'; + static const String name = 'ConsoleRoute'; static const PageInfo page = PageInfo(name); } @@ -277,194 +319,6 @@ class ProvidersRoute extends PageRouteInfo { static const PageInfo page = PageInfo(name); } -/// generated route for -/// [ServerDetailsScreen] -class ServerDetailsRoute extends PageRouteInfo { - const ServerDetailsRoute({List? children}) - : super( - ServerDetailsRoute.name, - initialChildren: children, - ); - - static const String name = 'ServerDetailsRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [ServicePage] -class ServiceRoute extends PageRouteInfo { - ServiceRoute({ - required String serviceId, - Key? key, - List? children, - }) : super( - ServiceRoute.name, - args: ServiceRouteArgs( - serviceId: serviceId, - key: key, - ), - initialChildren: children, - ); - - static const String name = 'ServiceRoute'; - - static const PageInfo page = - PageInfo(name); -} - -class ServiceRouteArgs { - const ServiceRouteArgs({ - required this.serviceId, - this.key, - }); - - final String serviceId; - - final Key? key; - - @override - String toString() { - return 'ServiceRouteArgs{serviceId: $serviceId, key: $key}'; - } -} - -/// generated route for -/// [ServicesPage] -class ServicesRoute extends PageRouteInfo { - const ServicesRoute({List? children}) - : super( - ServicesRoute.name, - initialChildren: children, - ); - - static const String name = 'ServicesRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [UsersPage] -class UsersRoute extends PageRouteInfo { - const UsersRoute({List? children}) - : super( - UsersRoute.name, - initialChildren: children, - ); - - static const String name = 'UsersRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [NewUserPage] -class NewUserRoute extends PageRouteInfo { - const NewUserRoute({List? children}) - : super( - NewUserRoute.name, - initialChildren: children, - ); - - static const String name = 'NewUserRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [UserDetailsPage] -class UserDetailsRoute extends PageRouteInfo { - UserDetailsRoute({ - required String login, - Key? key, - List? children, - }) : super( - UserDetailsRoute.name, - args: UserDetailsRouteArgs( - login: login, - key: key, - ), - initialChildren: children, - ); - - static const String name = 'UserDetailsRoute'; - - static const PageInfo page = - PageInfo(name); -} - -class UserDetailsRouteArgs { - const UserDetailsRouteArgs({ - required this.login, - this.key, - }); - - final String login; - - final Key? key; - - @override - String toString() { - return 'UserDetailsRouteArgs{login: $login, key: $key}'; - } -} - -/// generated route for -/// [BackupDetailsPage] -class BackupDetailsRoute extends PageRouteInfo { - const BackupDetailsRoute({List? children}) - : super( - BackupDetailsRoute.name, - initialChildren: children, - ); - - static const String name = 'BackupDetailsRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [DnsDetailsPage] -class DnsDetailsRoute extends PageRouteInfo { - const DnsDetailsRoute({List? children}) - : super( - DnsDetailsRoute.name, - initialChildren: children, - ); - - static const String name = 'DnsDetailsRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [RecoveryRouting] -class RecoveryRoute extends PageRouteInfo { - const RecoveryRoute({List? children}) - : super( - RecoveryRoute.name, - initialChildren: children, - ); - - static const String name = 'RecoveryRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [InitializingPage] -class InitializingRoute extends PageRouteInfo { - const InitializingRoute({List? children}) - : super( - InitializingRoute.name, - initialChildren: children, - ); - - static const String name = 'InitializingRoute'; - - static const PageInfo page = PageInfo(name); -} - /// generated route for /// [RecoveryKeyPage] class RecoveryKeyRoute extends PageRouteInfo { @@ -480,15 +334,15 @@ class RecoveryKeyRoute extends PageRouteInfo { } /// generated route for -/// [DevicesScreen] -class DevicesRoute extends PageRouteInfo { - const DevicesRoute({List? children}) +/// [ServerDetailsScreen] +class ServerDetailsRoute extends PageRouteInfo { + const ServerDetailsRoute({List? children}) : super( - DevicesRoute.name, + ServerDetailsRoute.name, initialChildren: children, ); - static const String name = 'DevicesRoute'; + static const String name = 'ServerDetailsRoute'; static const PageInfo page = PageInfo(name); } @@ -622,6 +476,152 @@ class ServerStorageRouteArgs { } } +/// generated route for +/// [ServicePage] +class ServiceRoute extends PageRouteInfo { + ServiceRoute({ + required String serviceId, + Key? key, + List? children, + }) : super( + ServiceRoute.name, + args: ServiceRouteArgs( + serviceId: serviceId, + key: key, + ), + initialChildren: children, + ); + + static const String name = 'ServiceRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class ServiceRouteArgs { + const ServiceRouteArgs({ + required this.serviceId, + this.key, + }); + + final String serviceId; + + final Key? key; + + @override + String toString() { + return 'ServiceRouteArgs{serviceId: $serviceId, key: $key}'; + } +} + +/// generated route for +/// [ServicesPage] +class ServicesRoute extends PageRouteInfo { + const ServicesRoute({List? children}) + : super( + ServicesRoute.name, + initialChildren: children, + ); + + static const String name = 'ServicesRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [InitializingPage] +class InitializingRoute extends PageRouteInfo { + const InitializingRoute({List? children}) + : super( + InitializingRoute.name, + initialChildren: children, + ); + + static const String name = 'InitializingRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [RecoveryRouting] +class RecoveryRoute extends PageRouteInfo { + const RecoveryRoute({List? children}) + : super( + RecoveryRoute.name, + initialChildren: children, + ); + + static const String name = 'RecoveryRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [UsersPage] +class UsersRoute extends PageRouteInfo { + const UsersRoute({List? children}) + : super( + UsersRoute.name, + initialChildren: children, + ); + + static const String name = 'UsersRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [NewUserPage] +class NewUserRoute extends PageRouteInfo { + const NewUserRoute({List? children}) + : super( + NewUserRoute.name, + initialChildren: children, + ); + + static const String name = 'NewUserRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [UserDetailsPage] +class UserDetailsRoute extends PageRouteInfo { + UserDetailsRoute({ + required String login, + Key? key, + List? children, + }) : super( + UserDetailsRoute.name, + args: UserDetailsRouteArgs( + login: login, + key: key, + ), + initialChildren: children, + ); + + static const String name = 'UserDetailsRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class UserDetailsRouteArgs { + const UserDetailsRouteArgs({ + required this.login, + this.key, + }); + + final String login; + + final Key? key; + + @override + String toString() { + return 'UserDetailsRouteArgs{login: $login, key: $key}'; + } +} + /// generated route for /// [RootPage] class RootRoute extends PageRouteInfo { From e70cbab618ae8b3cd501e1c63a1b0e97909d90f1 Mon Sep 17 00:00:00 2001 From: NaiJi Date: Mon, 19 Jun 2023 18:05:57 -0300 Subject: [PATCH 04/20] chore: Fix a typo in GraphQL scheme --- .../schema/disk_volumes.graphql.dart | 84 +++++++++---------- .../graphql_maps/schema/schema.graphql | 8 +- .../graphql_maps/schema/schema.graphql.dart | 2 +- .../schema/server_api.graphql.dart | 80 +++++++++--------- .../schema/server_settings.graphql.dart | 80 +++++++++--------- .../graphql_maps/schema/services.graphql.dart | 80 +++++++++--------- .../graphql_maps/schema/users.graphql.dart | 80 +++++++++--------- 7 files changed, 207 insertions(+), 207 deletions(-) diff --git a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart index 846a72a7..e9e91eb8 100644 --- a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart @@ -32,8 +32,8 @@ class Fragment$basicMutationReturnFields { return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn .fromJson(json); - case "GenericJobButationReturn": - return Fragment$basicMutationReturnFields$$GenericJobButationReturn + case "GenericJobMutationReturn": + return Fragment$basicMutationReturnFields$$GenericJobMutationReturn .fromJson(json); case "GenericMutationReturn": @@ -160,8 +160,8 @@ extension UtilityExtension$Fragment$basicMutationReturnFields Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) genericBackupConfigReturn, required _T Function( - Fragment$basicMutationReturnFields$$GenericJobButationReturn) - genericJobButationReturn, + Fragment$basicMutationReturnFields$$GenericJobMutationReturn) + genericJobMutationReturn, required _T Function( Fragment$basicMutationReturnFields$$GenericMutationReturn) genericMutationReturn, @@ -195,9 +195,9 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return genericBackupConfigReturn(this as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); - case "GenericJobButationReturn": - return genericJobButationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobButationReturn); + case "GenericJobMutationReturn": + return genericJobMutationReturn(this + as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); case "GenericMutationReturn": return genericMutationReturn( @@ -235,8 +235,8 @@ extension UtilityExtension$Fragment$basicMutationReturnFields deviceApiTokenMutationReturn, _T Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn)? genericBackupConfigReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericJobButationReturn)? - genericJobButationReturn, + _T Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn)? + genericJobMutationReturn, _T Function(Fragment$basicMutationReturnFields$$GenericMutationReturn)? genericMutationReturn, _T Function(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn)? @@ -282,10 +282,10 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return orElse(); } - case "GenericJobButationReturn": - if (genericJobButationReturn != null) { - return genericJobButationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobButationReturn); + case "GenericJobMutationReturn": + if (genericJobMutationReturn != null) { + return genericJobMutationReturn(this + as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); } else { return orElse(); } @@ -1210,22 +1210,22 @@ class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigR _res; } -class Fragment$basicMutationReturnFields$$GenericJobButationReturn +class Fragment$basicMutationReturnFields$$GenericJobMutationReturn implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericJobButationReturn({ + Fragment$basicMutationReturnFields$$GenericJobMutationReturn({ required this.code, required this.message, required this.success, - this.$__typename = 'GenericJobButationReturn', + this.$__typename = 'GenericJobMutationReturn', }); - factory Fragment$basicMutationReturnFields$$GenericJobButationReturn.fromJson( + factory Fragment$basicMutationReturnFields$$GenericJobMutationReturn.fromJson( Map json) { final l$code = json['code']; final l$message = json['message']; final l$success = json['success']; final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericJobButationReturn( + return Fragment$basicMutationReturnFields$$GenericJobMutationReturn( code: (l$code as int), message: (l$message as String), success: (l$success as bool), @@ -1274,7 +1274,7 @@ class Fragment$basicMutationReturnFields$$GenericJobButationReturn return true; } if (!(other - is Fragment$basicMutationReturnFields$$GenericJobButationReturn) || + is Fragment$basicMutationReturnFields$$GenericJobMutationReturn) || runtimeType != other.runtimeType) { return false; } @@ -1302,28 +1302,28 @@ class Fragment$basicMutationReturnFields$$GenericJobButationReturn } } -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericJobButationReturn - on Fragment$basicMutationReturnFields$$GenericJobButationReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< - Fragment$basicMutationReturnFields$$GenericJobButationReturn> +extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericJobMutationReturn + on Fragment$basicMutationReturnFields$$GenericJobMutationReturn { + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< + Fragment$basicMutationReturnFields$$GenericJobMutationReturn> get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn( + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( this, (i) => i, ); } -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< +abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn( - Fragment$basicMutationReturnFields$$GenericJobButationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericJobButationReturn) + factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( + Fragment$basicMutationReturnFields$$GenericJobMutationReturn instance, + TRes Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn) then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn; + ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn.stub( + factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn.stub( TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn; + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; TRes call({ int? code, @@ -1333,20 +1333,20 @@ abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationRe }); } -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn< +class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn( + _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( this._instance, this._then, ); - final Fragment$basicMutationReturnFields$$GenericJobButationReturn _instance; + final Fragment$basicMutationReturnFields$$GenericJobMutationReturn _instance; final TRes Function( - Fragment$basicMutationReturnFields$$GenericJobButationReturn) _then; + Fragment$basicMutationReturnFields$$GenericJobMutationReturn) _then; static const _undefined = {}; @@ -1356,7 +1356,7 @@ class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn Object? success = _undefined, Object? $__typename = _undefined, }) => - _then(Fragment$basicMutationReturnFields$$GenericJobButationReturn( + _then(Fragment$basicMutationReturnFields$$GenericJobMutationReturn( code: code == _undefined || code == null ? _instance.code : (code as int), message: message == _undefined || message == null @@ -1371,12 +1371,12 @@ class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn )); } -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn< +class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn( + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( this._res); TRes _res; @@ -5884,12 +5884,12 @@ extension ClientExtension$Mutation$MigrateToBinds on graphql.GraphQLClient { } class Mutation$MigrateToBinds$migrateToBinds - implements Fragment$basicMutationReturnFields$$GenericJobButationReturn { + implements Fragment$basicMutationReturnFields$$GenericJobMutationReturn { Mutation$MigrateToBinds$migrateToBinds({ required this.code, required this.message, required this.success, - this.$__typename = 'GenericJobButationReturn', + this.$__typename = 'GenericJobMutationReturn', this.job, }); diff --git a/lib/logic/api_maps/graphql_maps/schema/schema.graphql b/lib/logic/api_maps/graphql_maps/schema/schema.graphql index aa3bf9b7..2c699c54 100644 --- a/lib/logic/api_maps/graphql_maps/schema/schema.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/schema.graphql @@ -116,7 +116,7 @@ type GenericBackupConfigReturn implements MutationReturnInterface { configuration: BackupConfiguration } -type GenericJobButationReturn implements MutationReturnInterface { +type GenericJobMutationReturn implements MutationReturnInterface { success: Boolean! message: String! code: Int! @@ -178,7 +178,7 @@ type Mutation { resizeVolume(name: String!): GenericMutationReturn! mountVolume(name: String!): GenericMutationReturn! unmountVolume(name: String!): GenericMutationReturn! - migrateToBinds(input: MigrateToBindsInput!): GenericJobButationReturn! + migrateToBinds(input: MigrateToBindsInput!): GenericJobMutationReturn! enableService(serviceId: String!): ServiceMutationReturn! disableService(serviceId: String!): ServiceMutationReturn! stopService(serviceId: String!): ServiceMutationReturn! @@ -189,8 +189,8 @@ type Mutation { initializeRepository(repository: InitializeRepositoryInput!): GenericBackupConfigReturn! removeRepository: GenericBackupConfigReturn! setAutobackupPeriod(period: Int = null): GenericBackupConfigReturn! - startBackup(serviceId: String = null): GenericJobButationReturn! - restoreBackup(snapshotId: String!): GenericJobButationReturn! + startBackup(serviceId: String = null): GenericJobMutationReturn! + restoreBackup(snapshotId: String!): GenericJobMutationReturn! forceSnapshotsReload: GenericMutationReturn! testMutation: GenericMutationReturn! } diff --git a/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart index 17ee3de7..0efab17a 100644 --- a/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart @@ -1998,7 +1998,7 @@ const possibleTypesMap = >{ 'AutoUpgradeSettingsMutationReturn', 'DeviceApiTokenMutationReturn', 'GenericBackupConfigReturn', - 'GenericJobButationReturn', + 'GenericJobMutationReturn', 'GenericMutationReturn', 'ServiceJobMutationReturn', 'ServiceMutationReturn', diff --git a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart index c6baa686..2e950aa1 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart @@ -32,8 +32,8 @@ class Fragment$basicMutationReturnFields { return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn .fromJson(json); - case "GenericJobButationReturn": - return Fragment$basicMutationReturnFields$$GenericJobButationReturn + case "GenericJobMutationReturn": + return Fragment$basicMutationReturnFields$$GenericJobMutationReturn .fromJson(json); case "GenericMutationReturn": @@ -160,8 +160,8 @@ extension UtilityExtension$Fragment$basicMutationReturnFields Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) genericBackupConfigReturn, required _T Function( - Fragment$basicMutationReturnFields$$GenericJobButationReturn) - genericJobButationReturn, + Fragment$basicMutationReturnFields$$GenericJobMutationReturn) + genericJobMutationReturn, required _T Function( Fragment$basicMutationReturnFields$$GenericMutationReturn) genericMutationReturn, @@ -195,9 +195,9 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return genericBackupConfigReturn(this as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); - case "GenericJobButationReturn": - return genericJobButationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobButationReturn); + case "GenericJobMutationReturn": + return genericJobMutationReturn(this + as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); case "GenericMutationReturn": return genericMutationReturn( @@ -235,8 +235,8 @@ extension UtilityExtension$Fragment$basicMutationReturnFields deviceApiTokenMutationReturn, _T Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn)? genericBackupConfigReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericJobButationReturn)? - genericJobButationReturn, + _T Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn)? + genericJobMutationReturn, _T Function(Fragment$basicMutationReturnFields$$GenericMutationReturn)? genericMutationReturn, _T Function(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn)? @@ -282,10 +282,10 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return orElse(); } - case "GenericJobButationReturn": - if (genericJobButationReturn != null) { - return genericJobButationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobButationReturn); + case "GenericJobMutationReturn": + if (genericJobMutationReturn != null) { + return genericJobMutationReturn(this + as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); } else { return orElse(); } @@ -1210,22 +1210,22 @@ class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigR _res; } -class Fragment$basicMutationReturnFields$$GenericJobButationReturn +class Fragment$basicMutationReturnFields$$GenericJobMutationReturn implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericJobButationReturn({ + Fragment$basicMutationReturnFields$$GenericJobMutationReturn({ required this.code, required this.message, required this.success, - this.$__typename = 'GenericJobButationReturn', + this.$__typename = 'GenericJobMutationReturn', }); - factory Fragment$basicMutationReturnFields$$GenericJobButationReturn.fromJson( + factory Fragment$basicMutationReturnFields$$GenericJobMutationReturn.fromJson( Map json) { final l$code = json['code']; final l$message = json['message']; final l$success = json['success']; final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericJobButationReturn( + return Fragment$basicMutationReturnFields$$GenericJobMutationReturn( code: (l$code as int), message: (l$message as String), success: (l$success as bool), @@ -1274,7 +1274,7 @@ class Fragment$basicMutationReturnFields$$GenericJobButationReturn return true; } if (!(other - is Fragment$basicMutationReturnFields$$GenericJobButationReturn) || + is Fragment$basicMutationReturnFields$$GenericJobMutationReturn) || runtimeType != other.runtimeType) { return false; } @@ -1302,28 +1302,28 @@ class Fragment$basicMutationReturnFields$$GenericJobButationReturn } } -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericJobButationReturn - on Fragment$basicMutationReturnFields$$GenericJobButationReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< - Fragment$basicMutationReturnFields$$GenericJobButationReturn> +extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericJobMutationReturn + on Fragment$basicMutationReturnFields$$GenericJobMutationReturn { + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< + Fragment$basicMutationReturnFields$$GenericJobMutationReturn> get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn( + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( this, (i) => i, ); } -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< +abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn( - Fragment$basicMutationReturnFields$$GenericJobButationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericJobButationReturn) + factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( + Fragment$basicMutationReturnFields$$GenericJobMutationReturn instance, + TRes Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn) then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn; + ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn.stub( + factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn.stub( TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn; + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; TRes call({ int? code, @@ -1333,20 +1333,20 @@ abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationRe }); } -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn< +class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn( + _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( this._instance, this._then, ); - final Fragment$basicMutationReturnFields$$GenericJobButationReturn _instance; + final Fragment$basicMutationReturnFields$$GenericJobMutationReturn _instance; final TRes Function( - Fragment$basicMutationReturnFields$$GenericJobButationReturn) _then; + Fragment$basicMutationReturnFields$$GenericJobMutationReturn) _then; static const _undefined = {}; @@ -1356,7 +1356,7 @@ class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn Object? success = _undefined, Object? $__typename = _undefined, }) => - _then(Fragment$basicMutationReturnFields$$GenericJobButationReturn( + _then(Fragment$basicMutationReturnFields$$GenericJobMutationReturn( code: code == _undefined || code == null ? _instance.code : (code as int), message: message == _undefined || message == null @@ -1371,12 +1371,12 @@ class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn )); } -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn< +class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn( + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( this._res); TRes _res; diff --git a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart index 9702fab0..59bd5fdd 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart @@ -31,8 +31,8 @@ class Fragment$basicMutationReturnFields { return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn .fromJson(json); - case "GenericJobButationReturn": - return Fragment$basicMutationReturnFields$$GenericJobButationReturn + case "GenericJobMutationReturn": + return Fragment$basicMutationReturnFields$$GenericJobMutationReturn .fromJson(json); case "GenericMutationReturn": @@ -159,8 +159,8 @@ extension UtilityExtension$Fragment$basicMutationReturnFields Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) genericBackupConfigReturn, required _T Function( - Fragment$basicMutationReturnFields$$GenericJobButationReturn) - genericJobButationReturn, + Fragment$basicMutationReturnFields$$GenericJobMutationReturn) + genericJobMutationReturn, required _T Function( Fragment$basicMutationReturnFields$$GenericMutationReturn) genericMutationReturn, @@ -194,9 +194,9 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return genericBackupConfigReturn(this as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); - case "GenericJobButationReturn": - return genericJobButationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobButationReturn); + case "GenericJobMutationReturn": + return genericJobMutationReturn(this + as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); case "GenericMutationReturn": return genericMutationReturn( @@ -234,8 +234,8 @@ extension UtilityExtension$Fragment$basicMutationReturnFields deviceApiTokenMutationReturn, _T Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn)? genericBackupConfigReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericJobButationReturn)? - genericJobButationReturn, + _T Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn)? + genericJobMutationReturn, _T Function(Fragment$basicMutationReturnFields$$GenericMutationReturn)? genericMutationReturn, _T Function(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn)? @@ -281,10 +281,10 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return orElse(); } - case "GenericJobButationReturn": - if (genericJobButationReturn != null) { - return genericJobButationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobButationReturn); + case "GenericJobMutationReturn": + if (genericJobMutationReturn != null) { + return genericJobMutationReturn(this + as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); } else { return orElse(); } @@ -1209,22 +1209,22 @@ class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigR _res; } -class Fragment$basicMutationReturnFields$$GenericJobButationReturn +class Fragment$basicMutationReturnFields$$GenericJobMutationReturn implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericJobButationReturn({ + Fragment$basicMutationReturnFields$$GenericJobMutationReturn({ required this.code, required this.message, required this.success, - this.$__typename = 'GenericJobButationReturn', + this.$__typename = 'GenericJobMutationReturn', }); - factory Fragment$basicMutationReturnFields$$GenericJobButationReturn.fromJson( + factory Fragment$basicMutationReturnFields$$GenericJobMutationReturn.fromJson( Map json) { final l$code = json['code']; final l$message = json['message']; final l$success = json['success']; final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericJobButationReturn( + return Fragment$basicMutationReturnFields$$GenericJobMutationReturn( code: (l$code as int), message: (l$message as String), success: (l$success as bool), @@ -1273,7 +1273,7 @@ class Fragment$basicMutationReturnFields$$GenericJobButationReturn return true; } if (!(other - is Fragment$basicMutationReturnFields$$GenericJobButationReturn) || + is Fragment$basicMutationReturnFields$$GenericJobMutationReturn) || runtimeType != other.runtimeType) { return false; } @@ -1301,28 +1301,28 @@ class Fragment$basicMutationReturnFields$$GenericJobButationReturn } } -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericJobButationReturn - on Fragment$basicMutationReturnFields$$GenericJobButationReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< - Fragment$basicMutationReturnFields$$GenericJobButationReturn> +extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericJobMutationReturn + on Fragment$basicMutationReturnFields$$GenericJobMutationReturn { + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< + Fragment$basicMutationReturnFields$$GenericJobMutationReturn> get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn( + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( this, (i) => i, ); } -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< +abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn( - Fragment$basicMutationReturnFields$$GenericJobButationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericJobButationReturn) + factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( + Fragment$basicMutationReturnFields$$GenericJobMutationReturn instance, + TRes Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn) then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn; + ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn.stub( + factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn.stub( TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn; + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; TRes call({ int? code, @@ -1332,20 +1332,20 @@ abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationRe }); } -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn< +class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn( + _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( this._instance, this._then, ); - final Fragment$basicMutationReturnFields$$GenericJobButationReturn _instance; + final Fragment$basicMutationReturnFields$$GenericJobMutationReturn _instance; final TRes Function( - Fragment$basicMutationReturnFields$$GenericJobButationReturn) _then; + Fragment$basicMutationReturnFields$$GenericJobMutationReturn) _then; static const _undefined = {}; @@ -1355,7 +1355,7 @@ class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn Object? success = _undefined, Object? $__typename = _undefined, }) => - _then(Fragment$basicMutationReturnFields$$GenericJobButationReturn( + _then(Fragment$basicMutationReturnFields$$GenericJobMutationReturn( code: code == _undefined || code == null ? _instance.code : (code as int), message: message == _undefined || message == null @@ -1370,12 +1370,12 @@ class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn )); } -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn< +class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn( + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( this._res); TRes _res; diff --git a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart index 415fac13..04eaaef9 100644 --- a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart @@ -31,8 +31,8 @@ class Fragment$basicMutationReturnFields { return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn .fromJson(json); - case "GenericJobButationReturn": - return Fragment$basicMutationReturnFields$$GenericJobButationReturn + case "GenericJobMutationReturn": + return Fragment$basicMutationReturnFields$$GenericJobMutationReturn .fromJson(json); case "GenericMutationReturn": @@ -159,8 +159,8 @@ extension UtilityExtension$Fragment$basicMutationReturnFields Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) genericBackupConfigReturn, required _T Function( - Fragment$basicMutationReturnFields$$GenericJobButationReturn) - genericJobButationReturn, + Fragment$basicMutationReturnFields$$GenericJobMutationReturn) + genericJobMutationReturn, required _T Function( Fragment$basicMutationReturnFields$$GenericMutationReturn) genericMutationReturn, @@ -194,9 +194,9 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return genericBackupConfigReturn(this as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); - case "GenericJobButationReturn": - return genericJobButationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobButationReturn); + case "GenericJobMutationReturn": + return genericJobMutationReturn(this + as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); case "GenericMutationReturn": return genericMutationReturn( @@ -234,8 +234,8 @@ extension UtilityExtension$Fragment$basicMutationReturnFields deviceApiTokenMutationReturn, _T Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn)? genericBackupConfigReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericJobButationReturn)? - genericJobButationReturn, + _T Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn)? + genericJobMutationReturn, _T Function(Fragment$basicMutationReturnFields$$GenericMutationReturn)? genericMutationReturn, _T Function(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn)? @@ -281,10 +281,10 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return orElse(); } - case "GenericJobButationReturn": - if (genericJobButationReturn != null) { - return genericJobButationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobButationReturn); + case "GenericJobMutationReturn": + if (genericJobMutationReturn != null) { + return genericJobMutationReturn(this + as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); } else { return orElse(); } @@ -1209,22 +1209,22 @@ class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigR _res; } -class Fragment$basicMutationReturnFields$$GenericJobButationReturn +class Fragment$basicMutationReturnFields$$GenericJobMutationReturn implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericJobButationReturn({ + Fragment$basicMutationReturnFields$$GenericJobMutationReturn({ required this.code, required this.message, required this.success, - this.$__typename = 'GenericJobButationReturn', + this.$__typename = 'GenericJobMutationReturn', }); - factory Fragment$basicMutationReturnFields$$GenericJobButationReturn.fromJson( + factory Fragment$basicMutationReturnFields$$GenericJobMutationReturn.fromJson( Map json) { final l$code = json['code']; final l$message = json['message']; final l$success = json['success']; final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericJobButationReturn( + return Fragment$basicMutationReturnFields$$GenericJobMutationReturn( code: (l$code as int), message: (l$message as String), success: (l$success as bool), @@ -1273,7 +1273,7 @@ class Fragment$basicMutationReturnFields$$GenericJobButationReturn return true; } if (!(other - is Fragment$basicMutationReturnFields$$GenericJobButationReturn) || + is Fragment$basicMutationReturnFields$$GenericJobMutationReturn) || runtimeType != other.runtimeType) { return false; } @@ -1301,28 +1301,28 @@ class Fragment$basicMutationReturnFields$$GenericJobButationReturn } } -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericJobButationReturn - on Fragment$basicMutationReturnFields$$GenericJobButationReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< - Fragment$basicMutationReturnFields$$GenericJobButationReturn> +extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericJobMutationReturn + on Fragment$basicMutationReturnFields$$GenericJobMutationReturn { + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< + Fragment$basicMutationReturnFields$$GenericJobMutationReturn> get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn( + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( this, (i) => i, ); } -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< +abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn( - Fragment$basicMutationReturnFields$$GenericJobButationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericJobButationReturn) + factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( + Fragment$basicMutationReturnFields$$GenericJobMutationReturn instance, + TRes Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn) then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn; + ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn.stub( + factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn.stub( TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn; + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; TRes call({ int? code, @@ -1332,20 +1332,20 @@ abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationRe }); } -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn< +class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn( + _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( this._instance, this._then, ); - final Fragment$basicMutationReturnFields$$GenericJobButationReturn _instance; + final Fragment$basicMutationReturnFields$$GenericJobMutationReturn _instance; final TRes Function( - Fragment$basicMutationReturnFields$$GenericJobButationReturn) _then; + Fragment$basicMutationReturnFields$$GenericJobMutationReturn) _then; static const _undefined = {}; @@ -1355,7 +1355,7 @@ class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn Object? success = _undefined, Object? $__typename = _undefined, }) => - _then(Fragment$basicMutationReturnFields$$GenericJobButationReturn( + _then(Fragment$basicMutationReturnFields$$GenericJobMutationReturn( code: code == _undefined || code == null ? _instance.code : (code as int), message: message == _undefined || message == null @@ -1370,12 +1370,12 @@ class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn )); } -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn< +class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn( + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( this._res); TRes _res; diff --git a/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart index d89acba4..4df77d6f 100644 --- a/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart @@ -31,8 +31,8 @@ class Fragment$basicMutationReturnFields { return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn .fromJson(json); - case "GenericJobButationReturn": - return Fragment$basicMutationReturnFields$$GenericJobButationReturn + case "GenericJobMutationReturn": + return Fragment$basicMutationReturnFields$$GenericJobMutationReturn .fromJson(json); case "GenericMutationReturn": @@ -159,8 +159,8 @@ extension UtilityExtension$Fragment$basicMutationReturnFields Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) genericBackupConfigReturn, required _T Function( - Fragment$basicMutationReturnFields$$GenericJobButationReturn) - genericJobButationReturn, + Fragment$basicMutationReturnFields$$GenericJobMutationReturn) + genericJobMutationReturn, required _T Function( Fragment$basicMutationReturnFields$$GenericMutationReturn) genericMutationReturn, @@ -194,9 +194,9 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return genericBackupConfigReturn(this as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); - case "GenericJobButationReturn": - return genericJobButationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobButationReturn); + case "GenericJobMutationReturn": + return genericJobMutationReturn(this + as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); case "GenericMutationReturn": return genericMutationReturn( @@ -234,8 +234,8 @@ extension UtilityExtension$Fragment$basicMutationReturnFields deviceApiTokenMutationReturn, _T Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn)? genericBackupConfigReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericJobButationReturn)? - genericJobButationReturn, + _T Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn)? + genericJobMutationReturn, _T Function(Fragment$basicMutationReturnFields$$GenericMutationReturn)? genericMutationReturn, _T Function(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn)? @@ -281,10 +281,10 @@ extension UtilityExtension$Fragment$basicMutationReturnFields return orElse(); } - case "GenericJobButationReturn": - if (genericJobButationReturn != null) { - return genericJobButationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobButationReturn); + case "GenericJobMutationReturn": + if (genericJobMutationReturn != null) { + return genericJobMutationReturn(this + as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); } else { return orElse(); } @@ -1209,22 +1209,22 @@ class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigR _res; } -class Fragment$basicMutationReturnFields$$GenericJobButationReturn +class Fragment$basicMutationReturnFields$$GenericJobMutationReturn implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericJobButationReturn({ + Fragment$basicMutationReturnFields$$GenericJobMutationReturn({ required this.code, required this.message, required this.success, - this.$__typename = 'GenericJobButationReturn', + this.$__typename = 'GenericJobMutationReturn', }); - factory Fragment$basicMutationReturnFields$$GenericJobButationReturn.fromJson( + factory Fragment$basicMutationReturnFields$$GenericJobMutationReturn.fromJson( Map json) { final l$code = json['code']; final l$message = json['message']; final l$success = json['success']; final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericJobButationReturn( + return Fragment$basicMutationReturnFields$$GenericJobMutationReturn( code: (l$code as int), message: (l$message as String), success: (l$success as bool), @@ -1273,7 +1273,7 @@ class Fragment$basicMutationReturnFields$$GenericJobButationReturn return true; } if (!(other - is Fragment$basicMutationReturnFields$$GenericJobButationReturn) || + is Fragment$basicMutationReturnFields$$GenericJobMutationReturn) || runtimeType != other.runtimeType) { return false; } @@ -1301,28 +1301,28 @@ class Fragment$basicMutationReturnFields$$GenericJobButationReturn } } -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericJobButationReturn - on Fragment$basicMutationReturnFields$$GenericJobButationReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< - Fragment$basicMutationReturnFields$$GenericJobButationReturn> +extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericJobMutationReturn + on Fragment$basicMutationReturnFields$$GenericJobMutationReturn { + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< + Fragment$basicMutationReturnFields$$GenericJobMutationReturn> get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn( + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( this, (i) => i, ); } -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< +abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn( - Fragment$basicMutationReturnFields$$GenericJobButationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericJobButationReturn) + factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( + Fragment$basicMutationReturnFields$$GenericJobMutationReturn instance, + TRes Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn) then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn; + ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn.stub( + factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn.stub( TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn; + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; TRes call({ int? code, @@ -1332,20 +1332,20 @@ abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationRe }); } -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn< +class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn( + _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( this._instance, this._then, ); - final Fragment$basicMutationReturnFields$$GenericJobButationReturn _instance; + final Fragment$basicMutationReturnFields$$GenericJobMutationReturn _instance; final TRes Function( - Fragment$basicMutationReturnFields$$GenericJobButationReturn) _then; + Fragment$basicMutationReturnFields$$GenericJobMutationReturn) _then; static const _undefined = {}; @@ -1355,7 +1355,7 @@ class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn Object? success = _undefined, Object? $__typename = _undefined, }) => - _then(Fragment$basicMutationReturnFields$$GenericJobButationReturn( + _then(Fragment$basicMutationReturnFields$$GenericJobMutationReturn( code: code == _undefined || code == null ? _instance.code : (code as int), message: message == _undefined || message == null @@ -1370,12 +1370,12 @@ class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn )); } -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn< +class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobButationReturn< + CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobButationReturn( + _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( this._res); TRes _res; From f05bedf460ded92491be5295c742f8684ed4f054 Mon Sep 17 00:00:00 2001 From: NaiJi Date: Thu, 22 Jun 2023 11:14:00 -0300 Subject: [PATCH 05/20] chore: Implement new backups api --- .../graphql_maps/schema/backups.graphql | 44 + .../graphql_maps/schema/backups.graphql.dart | 2620 +++++++++++++++++ .../graphql_maps/server_api/server_api.dart | 195 +- lib/logic/cubit/backups/backups_cubit.dart | 23 +- lib/logic/models/hive/backups_credential.dart | 28 +- .../models/initialize_repository_input.dart | 16 + lib/logic/models/json/backup.dart | 19 +- lib/logic/models/json/backup.g.dart | 4 + 8 files changed, 2925 insertions(+), 24 deletions(-) create mode 100644 lib/logic/models/initialize_repository_input.dart diff --git a/lib/logic/api_maps/graphql_maps/schema/backups.graphql b/lib/logic/api_maps/graphql_maps/schema/backups.graphql index 36177fca..eb9fcfb1 100644 --- a/lib/logic/api_maps/graphql_maps/schema/backups.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/backups.graphql @@ -22,3 +22,47 @@ query AllBackupSnapshots { } } } + +fragment genericBackupConfigReturn on GenericBackupConfigReturn { + code + message + success + configuration { + provider + encryptionKey + isInitialized + autobackupPeriod + locationName + locationId + } +} + +mutation ForceSnapshotsReload { + forceSnapshotsReload { + ...basicMutationReturnFields + } +} + +mutation StartBackup($serviceId: String = null) { + startBackup(serviceId: $serviceId) { + ...basicMutationReturnFields + } +} + +mutation SetAutobackupPeriod($period: Int = null) { + setAutobackupPeriod(period: $period) { + ...genericBackupConfigReturn + } +} + +mutation RemoveRepository { + removeRepository { + ...genericBackupConfigReturn + } +} + +mutation InitializeRepository($repository: InitializeRepositoryInput!) { + initializeRepository(repository: $repository) { + ...genericBackupConfigReturn + } +} diff --git a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart index 37ee4109..54b02ead 100644 --- a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart @@ -3,6 +3,578 @@ import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'package:selfprivacy/utils/scalars.dart'; import 'schema.graphql.dart'; +import 'services.graphql.dart'; + +class Fragment$genericBackupConfigReturn { + Fragment$genericBackupConfigReturn({ + required this.code, + required this.message, + required this.success, + this.configuration, + this.$__typename = 'GenericBackupConfigReturn', + }); + + factory Fragment$genericBackupConfigReturn.fromJson( + Map json) { + final l$code = json['code']; + final l$message = json['message']; + final l$success = json['success']; + final l$configuration = json['configuration']; + final l$$__typename = json['__typename']; + return Fragment$genericBackupConfigReturn( + code: (l$code as int), + message: (l$message as String), + success: (l$success as bool), + configuration: l$configuration == null + ? null + : Fragment$genericBackupConfigReturn$configuration.fromJson( + (l$configuration as Map)), + $__typename: (l$$__typename as String), + ); + } + + final int code; + + final String message; + + final bool success; + + final Fragment$genericBackupConfigReturn$configuration? configuration; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$code = code; + _resultData['code'] = l$code; + final l$message = message; + _resultData['message'] = l$message; + final l$success = success; + _resultData['success'] = l$success; + final l$configuration = configuration; + _resultData['configuration'] = l$configuration?.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$code = code; + final l$message = message; + final l$success = success; + final l$configuration = configuration; + final l$$__typename = $__typename; + return Object.hashAll([ + l$code, + l$message, + l$success, + l$configuration, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Fragment$genericBackupConfigReturn) || + runtimeType != other.runtimeType) { + return false; + } + final l$code = code; + final lOther$code = other.code; + if (l$code != lOther$code) { + return false; + } + final l$message = message; + final lOther$message = other.message; + if (l$message != lOther$message) { + return false; + } + final l$success = success; + final lOther$success = other.success; + if (l$success != lOther$success) { + return false; + } + final l$configuration = configuration; + final lOther$configuration = other.configuration; + if (l$configuration != lOther$configuration) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$genericBackupConfigReturn + on Fragment$genericBackupConfigReturn { + CopyWith$Fragment$genericBackupConfigReturn< + Fragment$genericBackupConfigReturn> + get copyWith => CopyWith$Fragment$genericBackupConfigReturn( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$genericBackupConfigReturn { + factory CopyWith$Fragment$genericBackupConfigReturn( + Fragment$genericBackupConfigReturn instance, + TRes Function(Fragment$genericBackupConfigReturn) then, + ) = _CopyWithImpl$Fragment$genericBackupConfigReturn; + + factory CopyWith$Fragment$genericBackupConfigReturn.stub(TRes res) = + _CopyWithStubImpl$Fragment$genericBackupConfigReturn; + + TRes call({ + int? code, + String? message, + bool? success, + Fragment$genericBackupConfigReturn$configuration? configuration, + String? $__typename, + }); + CopyWith$Fragment$genericBackupConfigReturn$configuration + get configuration; +} + +class _CopyWithImpl$Fragment$genericBackupConfigReturn + implements CopyWith$Fragment$genericBackupConfigReturn { + _CopyWithImpl$Fragment$genericBackupConfigReturn( + this._instance, + this._then, + ); + + final Fragment$genericBackupConfigReturn _instance; + + final TRes Function(Fragment$genericBackupConfigReturn) _then; + + static const _undefined = {}; + + TRes call({ + Object? code = _undefined, + Object? message = _undefined, + Object? success = _undefined, + Object? configuration = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$genericBackupConfigReturn( + code: + code == _undefined || code == null ? _instance.code : (code as int), + message: message == _undefined || message == null + ? _instance.message + : (message as String), + success: success == _undefined || success == null + ? _instance.success + : (success as bool), + configuration: configuration == _undefined + ? _instance.configuration + : (configuration + as Fragment$genericBackupConfigReturn$configuration?), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Fragment$genericBackupConfigReturn$configuration + get configuration { + final local$configuration = _instance.configuration; + return local$configuration == null + ? CopyWith$Fragment$genericBackupConfigReturn$configuration.stub( + _then(_instance)) + : CopyWith$Fragment$genericBackupConfigReturn$configuration( + local$configuration, (e) => call(configuration: e)); + } +} + +class _CopyWithStubImpl$Fragment$genericBackupConfigReturn + implements CopyWith$Fragment$genericBackupConfigReturn { + _CopyWithStubImpl$Fragment$genericBackupConfigReturn(this._res); + + TRes _res; + + call({ + int? code, + String? message, + bool? success, + Fragment$genericBackupConfigReturn$configuration? configuration, + String? $__typename, + }) => + _res; + CopyWith$Fragment$genericBackupConfigReturn$configuration + get configuration => + CopyWith$Fragment$genericBackupConfigReturn$configuration.stub(_res); +} + +const fragmentDefinitiongenericBackupConfigReturn = FragmentDefinitionNode( + name: NameNode(value: 'genericBackupConfigReturn'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'GenericBackupConfigReturn'), + isNonNull: false, + )), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'code'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'message'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'success'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'configuration'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'provider'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'encryptionKey'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'isInitialized'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'autobackupPeriod'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'locationName'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'locationId'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), +); +const documentNodeFragmentgenericBackupConfigReturn = + DocumentNode(definitions: [ + fragmentDefinitiongenericBackupConfigReturn, +]); + +extension ClientExtension$Fragment$genericBackupConfigReturn + on graphql.GraphQLClient { + void writeFragment$genericBackupConfigReturn({ + required Fragment$genericBackupConfigReturn data, + required Map idFields, + bool broadcast = true, + }) => + this.writeFragment( + graphql.FragmentRequest( + idFields: idFields, + fragment: const graphql.Fragment( + fragmentName: 'genericBackupConfigReturn', + document: documentNodeFragmentgenericBackupConfigReturn, + ), + ), + data: data.toJson(), + broadcast: broadcast, + ); + Fragment$genericBackupConfigReturn? readFragment$genericBackupConfigReturn({ + required Map idFields, + bool optimistic = true, + }) { + final result = this.readFragment( + graphql.FragmentRequest( + idFields: idFields, + fragment: const graphql.Fragment( + fragmentName: 'genericBackupConfigReturn', + document: documentNodeFragmentgenericBackupConfigReturn, + ), + ), + optimistic: optimistic, + ); + return result == null + ? null + : Fragment$genericBackupConfigReturn.fromJson(result); + } +} + +class Fragment$genericBackupConfigReturn$configuration { + Fragment$genericBackupConfigReturn$configuration({ + required this.provider, + required this.encryptionKey, + required this.isInitialized, + this.autobackupPeriod, + this.locationName, + this.locationId, + this.$__typename = 'BackupConfiguration', + }); + + factory Fragment$genericBackupConfigReturn$configuration.fromJson( + Map json) { + final l$provider = json['provider']; + final l$encryptionKey = json['encryptionKey']; + final l$isInitialized = json['isInitialized']; + final l$autobackupPeriod = json['autobackupPeriod']; + final l$locationName = json['locationName']; + final l$locationId = json['locationId']; + final l$$__typename = json['__typename']; + return Fragment$genericBackupConfigReturn$configuration( + provider: fromJson$Enum$BackupProvider((l$provider as String)), + encryptionKey: (l$encryptionKey as String), + isInitialized: (l$isInitialized as bool), + autobackupPeriod: (l$autobackupPeriod as int?), + locationName: (l$locationName as String?), + locationId: (l$locationId as String?), + $__typename: (l$$__typename as String), + ); + } + + final Enum$BackupProvider provider; + + final String encryptionKey; + + final bool isInitialized; + + final int? autobackupPeriod; + + final String? locationName; + + final String? locationId; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$provider = provider; + _resultData['provider'] = toJson$Enum$BackupProvider(l$provider); + final l$encryptionKey = encryptionKey; + _resultData['encryptionKey'] = l$encryptionKey; + final l$isInitialized = isInitialized; + _resultData['isInitialized'] = l$isInitialized; + final l$autobackupPeriod = autobackupPeriod; + _resultData['autobackupPeriod'] = l$autobackupPeriod; + final l$locationName = locationName; + _resultData['locationName'] = l$locationName; + final l$locationId = locationId; + _resultData['locationId'] = l$locationId; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$provider = provider; + final l$encryptionKey = encryptionKey; + final l$isInitialized = isInitialized; + final l$autobackupPeriod = autobackupPeriod; + final l$locationName = locationName; + final l$locationId = locationId; + final l$$__typename = $__typename; + return Object.hashAll([ + l$provider, + l$encryptionKey, + l$isInitialized, + l$autobackupPeriod, + l$locationName, + l$locationId, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Fragment$genericBackupConfigReturn$configuration) || + runtimeType != other.runtimeType) { + return false; + } + final l$provider = provider; + final lOther$provider = other.provider; + if (l$provider != lOther$provider) { + return false; + } + final l$encryptionKey = encryptionKey; + final lOther$encryptionKey = other.encryptionKey; + if (l$encryptionKey != lOther$encryptionKey) { + return false; + } + final l$isInitialized = isInitialized; + final lOther$isInitialized = other.isInitialized; + if (l$isInitialized != lOther$isInitialized) { + return false; + } + final l$autobackupPeriod = autobackupPeriod; + final lOther$autobackupPeriod = other.autobackupPeriod; + if (l$autobackupPeriod != lOther$autobackupPeriod) { + return false; + } + final l$locationName = locationName; + final lOther$locationName = other.locationName; + if (l$locationName != lOther$locationName) { + return false; + } + final l$locationId = locationId; + final lOther$locationId = other.locationId; + if (l$locationId != lOther$locationId) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$genericBackupConfigReturn$configuration + on Fragment$genericBackupConfigReturn$configuration { + CopyWith$Fragment$genericBackupConfigReturn$configuration< + Fragment$genericBackupConfigReturn$configuration> + get copyWith => CopyWith$Fragment$genericBackupConfigReturn$configuration( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$genericBackupConfigReturn$configuration { + factory CopyWith$Fragment$genericBackupConfigReturn$configuration( + Fragment$genericBackupConfigReturn$configuration instance, + TRes Function(Fragment$genericBackupConfigReturn$configuration) then, + ) = _CopyWithImpl$Fragment$genericBackupConfigReturn$configuration; + + factory CopyWith$Fragment$genericBackupConfigReturn$configuration.stub( + TRes res) = + _CopyWithStubImpl$Fragment$genericBackupConfigReturn$configuration; + + TRes call({ + Enum$BackupProvider? provider, + String? encryptionKey, + bool? isInitialized, + int? autobackupPeriod, + String? locationName, + String? locationId, + String? $__typename, + }); +} + +class _CopyWithImpl$Fragment$genericBackupConfigReturn$configuration + implements CopyWith$Fragment$genericBackupConfigReturn$configuration { + _CopyWithImpl$Fragment$genericBackupConfigReturn$configuration( + this._instance, + this._then, + ); + + final Fragment$genericBackupConfigReturn$configuration _instance; + + final TRes Function(Fragment$genericBackupConfigReturn$configuration) _then; + + static const _undefined = {}; + + TRes call({ + Object? provider = _undefined, + Object? encryptionKey = _undefined, + Object? isInitialized = _undefined, + Object? autobackupPeriod = _undefined, + Object? locationName = _undefined, + Object? locationId = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$genericBackupConfigReturn$configuration( + provider: provider == _undefined || provider == null + ? _instance.provider + : (provider as Enum$BackupProvider), + encryptionKey: encryptionKey == _undefined || encryptionKey == null + ? _instance.encryptionKey + : (encryptionKey as String), + isInitialized: isInitialized == _undefined || isInitialized == null + ? _instance.isInitialized + : (isInitialized as bool), + autobackupPeriod: autobackupPeriod == _undefined + ? _instance.autobackupPeriod + : (autobackupPeriod as int?), + locationName: locationName == _undefined + ? _instance.locationName + : (locationName as String?), + locationId: locationId == _undefined + ? _instance.locationId + : (locationId as String?), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Fragment$genericBackupConfigReturn$configuration + implements CopyWith$Fragment$genericBackupConfigReturn$configuration { + _CopyWithStubImpl$Fragment$genericBackupConfigReturn$configuration(this._res); + + TRes _res; + + call({ + Enum$BackupProvider? provider, + String? encryptionKey, + bool? isInitialized, + int? autobackupPeriod, + String? locationName, + String? locationId, + String? $__typename, + }) => + _res; +} class Query$BackupConfiguration { Query$BackupConfiguration({ @@ -1546,3 +2118,2051 @@ class _CopyWithStubImpl$Query$AllBackupSnapshots$backup$allSnapshots$service< }) => _res; } + +class Mutation$ForceSnapshotsReload { + Mutation$ForceSnapshotsReload({ + required this.forceSnapshotsReload, + this.$__typename = 'Mutation', + }); + + factory Mutation$ForceSnapshotsReload.fromJson(Map json) { + final l$forceSnapshotsReload = json['forceSnapshotsReload']; + final l$$__typename = json['__typename']; + return Mutation$ForceSnapshotsReload( + forceSnapshotsReload: + Mutation$ForceSnapshotsReload$forceSnapshotsReload.fromJson( + (l$forceSnapshotsReload as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Mutation$ForceSnapshotsReload$forceSnapshotsReload forceSnapshotsReload; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$forceSnapshotsReload = forceSnapshotsReload; + _resultData['forceSnapshotsReload'] = l$forceSnapshotsReload.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$forceSnapshotsReload = forceSnapshotsReload; + final l$$__typename = $__typename; + return Object.hashAll([ + l$forceSnapshotsReload, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$ForceSnapshotsReload) || + runtimeType != other.runtimeType) { + return false; + } + final l$forceSnapshotsReload = forceSnapshotsReload; + final lOther$forceSnapshotsReload = other.forceSnapshotsReload; + if (l$forceSnapshotsReload != lOther$forceSnapshotsReload) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$ForceSnapshotsReload + on Mutation$ForceSnapshotsReload { + CopyWith$Mutation$ForceSnapshotsReload + get copyWith => CopyWith$Mutation$ForceSnapshotsReload( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$ForceSnapshotsReload { + factory CopyWith$Mutation$ForceSnapshotsReload( + Mutation$ForceSnapshotsReload instance, + TRes Function(Mutation$ForceSnapshotsReload) then, + ) = _CopyWithImpl$Mutation$ForceSnapshotsReload; + + factory CopyWith$Mutation$ForceSnapshotsReload.stub(TRes res) = + _CopyWithStubImpl$Mutation$ForceSnapshotsReload; + + TRes call({ + Mutation$ForceSnapshotsReload$forceSnapshotsReload? forceSnapshotsReload, + String? $__typename, + }); + CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload + get forceSnapshotsReload; +} + +class _CopyWithImpl$Mutation$ForceSnapshotsReload + implements CopyWith$Mutation$ForceSnapshotsReload { + _CopyWithImpl$Mutation$ForceSnapshotsReload( + this._instance, + this._then, + ); + + final Mutation$ForceSnapshotsReload _instance; + + final TRes Function(Mutation$ForceSnapshotsReload) _then; + + static const _undefined = {}; + + TRes call({ + Object? forceSnapshotsReload = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$ForceSnapshotsReload( + forceSnapshotsReload: + forceSnapshotsReload == _undefined || forceSnapshotsReload == null + ? _instance.forceSnapshotsReload + : (forceSnapshotsReload + as Mutation$ForceSnapshotsReload$forceSnapshotsReload), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload + get forceSnapshotsReload { + final local$forceSnapshotsReload = _instance.forceSnapshotsReload; + return CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload( + local$forceSnapshotsReload, (e) => call(forceSnapshotsReload: e)); + } +} + +class _CopyWithStubImpl$Mutation$ForceSnapshotsReload + implements CopyWith$Mutation$ForceSnapshotsReload { + _CopyWithStubImpl$Mutation$ForceSnapshotsReload(this._res); + + TRes _res; + + call({ + Mutation$ForceSnapshotsReload$forceSnapshotsReload? forceSnapshotsReload, + String? $__typename, + }) => + _res; + CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload + get forceSnapshotsReload => + CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload.stub( + _res); +} + +const documentNodeMutationForceSnapshotsReload = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'ForceSnapshotsReload'), + variableDefinitions: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'forceSnapshotsReload'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'basicMutationReturnFields'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + fragmentDefinitionbasicMutationReturnFields, +]); +Mutation$ForceSnapshotsReload _parserFn$Mutation$ForceSnapshotsReload( + Map data) => + Mutation$ForceSnapshotsReload.fromJson(data); +typedef OnMutationCompleted$Mutation$ForceSnapshotsReload = FutureOr + Function( + Map?, + Mutation$ForceSnapshotsReload?, +); + +class Options$Mutation$ForceSnapshotsReload + extends graphql.MutationOptions { + Options$Mutation$ForceSnapshotsReload({ + String? operationName, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Mutation$ForceSnapshotsReload? typedOptimisticResult, + graphql.Context? context, + OnMutationCompleted$Mutation$ForceSnapshotsReload? onCompleted, + graphql.OnMutationUpdate? update, + graphql.OnError? onError, + }) : onCompletedWithParsed = onCompleted, + super( + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + onCompleted: onCompleted == null + ? null + : (data) => onCompleted( + data, + data == null + ? null + : _parserFn$Mutation$ForceSnapshotsReload(data), + ), + update: update, + onError: onError, + document: documentNodeMutationForceSnapshotsReload, + parserFn: _parserFn$Mutation$ForceSnapshotsReload, + ); + + final OnMutationCompleted$Mutation$ForceSnapshotsReload? + onCompletedWithParsed; + + @override + List get properties => [ + ...super.onCompleted == null + ? super.properties + : super.properties.where((property) => property != onCompleted), + onCompletedWithParsed, + ]; +} + +class WatchOptions$Mutation$ForceSnapshotsReload + extends graphql.WatchQueryOptions { + WatchOptions$Mutation$ForceSnapshotsReload({ + String? operationName, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Mutation$ForceSnapshotsReload? typedOptimisticResult, + graphql.Context? context, + Duration? pollInterval, + bool? eagerlyFetchResults, + bool carryForwardDataOnException = true, + bool fetchResults = false, + }) : super( + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + document: documentNodeMutationForceSnapshotsReload, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Mutation$ForceSnapshotsReload, + ); +} + +extension ClientExtension$Mutation$ForceSnapshotsReload + on graphql.GraphQLClient { + Future> + mutate$ForceSnapshotsReload( + [Options$Mutation$ForceSnapshotsReload? options]) async => + await this.mutate(options ?? Options$Mutation$ForceSnapshotsReload()); + graphql.ObservableQuery + watchMutation$ForceSnapshotsReload( + [WatchOptions$Mutation$ForceSnapshotsReload? options]) => + this.watchMutation( + options ?? WatchOptions$Mutation$ForceSnapshotsReload()); +} + +class Mutation$ForceSnapshotsReload$forceSnapshotsReload + implements Fragment$basicMutationReturnFields$$GenericMutationReturn { + Mutation$ForceSnapshotsReload$forceSnapshotsReload({ + required this.code, + required this.message, + required this.success, + this.$__typename = 'GenericMutationReturn', + }); + + factory Mutation$ForceSnapshotsReload$forceSnapshotsReload.fromJson( + Map json) { + final l$code = json['code']; + final l$message = json['message']; + final l$success = json['success']; + final l$$__typename = json['__typename']; + return Mutation$ForceSnapshotsReload$forceSnapshotsReload( + code: (l$code as int), + message: (l$message as String), + success: (l$success as bool), + $__typename: (l$$__typename as String), + ); + } + + final int code; + + final String message; + + final bool success; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$code = code; + _resultData['code'] = l$code; + final l$message = message; + _resultData['message'] = l$message; + final l$success = success; + _resultData['success'] = l$success; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$code = code; + final l$message = message; + final l$success = success; + final l$$__typename = $__typename; + return Object.hashAll([ + l$code, + l$message, + l$success, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$ForceSnapshotsReload$forceSnapshotsReload) || + runtimeType != other.runtimeType) { + return false; + } + final l$code = code; + final lOther$code = other.code; + if (l$code != lOther$code) { + return false; + } + final l$message = message; + final lOther$message = other.message; + if (l$message != lOther$message) { + return false; + } + final l$success = success; + final lOther$success = other.success; + if (l$success != lOther$success) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$ForceSnapshotsReload$forceSnapshotsReload + on Mutation$ForceSnapshotsReload$forceSnapshotsReload { + CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload< + Mutation$ForceSnapshotsReload$forceSnapshotsReload> + get copyWith => + CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload< + TRes> { + factory CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload( + Mutation$ForceSnapshotsReload$forceSnapshotsReload instance, + TRes Function(Mutation$ForceSnapshotsReload$forceSnapshotsReload) then, + ) = _CopyWithImpl$Mutation$ForceSnapshotsReload$forceSnapshotsReload; + + factory CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload.stub( + TRes res) = + _CopyWithStubImpl$Mutation$ForceSnapshotsReload$forceSnapshotsReload; + + TRes call({ + int? code, + String? message, + bool? success, + String? $__typename, + }); +} + +class _CopyWithImpl$Mutation$ForceSnapshotsReload$forceSnapshotsReload + implements + CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload { + _CopyWithImpl$Mutation$ForceSnapshotsReload$forceSnapshotsReload( + this._instance, + this._then, + ); + + final Mutation$ForceSnapshotsReload$forceSnapshotsReload _instance; + + final TRes Function(Mutation$ForceSnapshotsReload$forceSnapshotsReload) _then; + + static const _undefined = {}; + + TRes call({ + Object? code = _undefined, + Object? message = _undefined, + Object? success = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$ForceSnapshotsReload$forceSnapshotsReload( + code: + code == _undefined || code == null ? _instance.code : (code as int), + message: message == _undefined || message == null + ? _instance.message + : (message as String), + success: success == _undefined || success == null + ? _instance.success + : (success as bool), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Mutation$ForceSnapshotsReload$forceSnapshotsReload + implements + CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload { + _CopyWithStubImpl$Mutation$ForceSnapshotsReload$forceSnapshotsReload( + this._res); + + TRes _res; + + call({ + int? code, + String? message, + bool? success, + String? $__typename, + }) => + _res; +} + +class Variables$Mutation$StartBackup { + factory Variables$Mutation$StartBackup({String? serviceId}) => + Variables$Mutation$StartBackup._({ + if (serviceId != null) r'serviceId': serviceId, + }); + + Variables$Mutation$StartBackup._(this._$data); + + factory Variables$Mutation$StartBackup.fromJson(Map data) { + final result$data = {}; + if (data.containsKey('serviceId')) { + final l$serviceId = data['serviceId']; + result$data['serviceId'] = (l$serviceId as String?); + } + return Variables$Mutation$StartBackup._(result$data); + } + + Map _$data; + + String? get serviceId => (_$data['serviceId'] as String?); + Map toJson() { + final result$data = {}; + if (_$data.containsKey('serviceId')) { + final l$serviceId = serviceId; + result$data['serviceId'] = l$serviceId; + } + return result$data; + } + + CopyWith$Variables$Mutation$StartBackup + get copyWith => CopyWith$Variables$Mutation$StartBackup( + this, + (i) => i, + ); + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Variables$Mutation$StartBackup) || + runtimeType != other.runtimeType) { + return false; + } + final l$serviceId = serviceId; + final lOther$serviceId = other.serviceId; + if (_$data.containsKey('serviceId') != + other._$data.containsKey('serviceId')) { + return false; + } + if (l$serviceId != lOther$serviceId) { + return false; + } + return true; + } + + @override + int get hashCode { + final l$serviceId = serviceId; + return Object.hashAll( + [_$data.containsKey('serviceId') ? l$serviceId : const {}]); + } +} + +abstract class CopyWith$Variables$Mutation$StartBackup { + factory CopyWith$Variables$Mutation$StartBackup( + Variables$Mutation$StartBackup instance, + TRes Function(Variables$Mutation$StartBackup) then, + ) = _CopyWithImpl$Variables$Mutation$StartBackup; + + factory CopyWith$Variables$Mutation$StartBackup.stub(TRes res) = + _CopyWithStubImpl$Variables$Mutation$StartBackup; + + TRes call({String? serviceId}); +} + +class _CopyWithImpl$Variables$Mutation$StartBackup + implements CopyWith$Variables$Mutation$StartBackup { + _CopyWithImpl$Variables$Mutation$StartBackup( + this._instance, + this._then, + ); + + final Variables$Mutation$StartBackup _instance; + + final TRes Function(Variables$Mutation$StartBackup) _then; + + static const _undefined = {}; + + TRes call({Object? serviceId = _undefined}) => + _then(Variables$Mutation$StartBackup._({ + ..._instance._$data, + if (serviceId != _undefined) 'serviceId': (serviceId as String?), + })); +} + +class _CopyWithStubImpl$Variables$Mutation$StartBackup + implements CopyWith$Variables$Mutation$StartBackup { + _CopyWithStubImpl$Variables$Mutation$StartBackup(this._res); + + TRes _res; + + call({String? serviceId}) => _res; +} + +class Mutation$StartBackup { + Mutation$StartBackup({ + required this.startBackup, + this.$__typename = 'Mutation', + }); + + factory Mutation$StartBackup.fromJson(Map json) { + final l$startBackup = json['startBackup']; + final l$$__typename = json['__typename']; + return Mutation$StartBackup( + startBackup: Mutation$StartBackup$startBackup.fromJson( + (l$startBackup as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Mutation$StartBackup$startBackup startBackup; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$startBackup = startBackup; + _resultData['startBackup'] = l$startBackup.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$startBackup = startBackup; + final l$$__typename = $__typename; + return Object.hashAll([ + l$startBackup, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$StartBackup) || runtimeType != other.runtimeType) { + return false; + } + final l$startBackup = startBackup; + final lOther$startBackup = other.startBackup; + if (l$startBackup != lOther$startBackup) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$StartBackup on Mutation$StartBackup { + CopyWith$Mutation$StartBackup get copyWith => + CopyWith$Mutation$StartBackup( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$StartBackup { + factory CopyWith$Mutation$StartBackup( + Mutation$StartBackup instance, + TRes Function(Mutation$StartBackup) then, + ) = _CopyWithImpl$Mutation$StartBackup; + + factory CopyWith$Mutation$StartBackup.stub(TRes res) = + _CopyWithStubImpl$Mutation$StartBackup; + + TRes call({ + Mutation$StartBackup$startBackup? startBackup, + String? $__typename, + }); + CopyWith$Mutation$StartBackup$startBackup get startBackup; +} + +class _CopyWithImpl$Mutation$StartBackup + implements CopyWith$Mutation$StartBackup { + _CopyWithImpl$Mutation$StartBackup( + this._instance, + this._then, + ); + + final Mutation$StartBackup _instance; + + final TRes Function(Mutation$StartBackup) _then; + + static const _undefined = {}; + + TRes call({ + Object? startBackup = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$StartBackup( + startBackup: startBackup == _undefined || startBackup == null + ? _instance.startBackup + : (startBackup as Mutation$StartBackup$startBackup), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Mutation$StartBackup$startBackup get startBackup { + final local$startBackup = _instance.startBackup; + return CopyWith$Mutation$StartBackup$startBackup( + local$startBackup, (e) => call(startBackup: e)); + } +} + +class _CopyWithStubImpl$Mutation$StartBackup + implements CopyWith$Mutation$StartBackup { + _CopyWithStubImpl$Mutation$StartBackup(this._res); + + TRes _res; + + call({ + Mutation$StartBackup$startBackup? startBackup, + String? $__typename, + }) => + _res; + CopyWith$Mutation$StartBackup$startBackup get startBackup => + CopyWith$Mutation$StartBackup$startBackup.stub(_res); +} + +const documentNodeMutationStartBackup = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'StartBackup'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'serviceId')), + type: NamedTypeNode( + name: NameNode(value: 'String'), + isNonNull: false, + ), + defaultValue: DefaultValueNode(value: NullValueNode()), + directives: [], + ) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'startBackup'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'serviceId'), + value: VariableNode(name: NameNode(value: 'serviceId')), + ) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'basicMutationReturnFields'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + fragmentDefinitionbasicMutationReturnFields, +]); +Mutation$StartBackup _parserFn$Mutation$StartBackup( + Map data) => + Mutation$StartBackup.fromJson(data); +typedef OnMutationCompleted$Mutation$StartBackup = FutureOr Function( + Map?, + Mutation$StartBackup?, +); + +class Options$Mutation$StartBackup + extends graphql.MutationOptions { + Options$Mutation$StartBackup({ + String? operationName, + Variables$Mutation$StartBackup? variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Mutation$StartBackup? typedOptimisticResult, + graphql.Context? context, + OnMutationCompleted$Mutation$StartBackup? onCompleted, + graphql.OnMutationUpdate? update, + graphql.OnError? onError, + }) : onCompletedWithParsed = onCompleted, + super( + variables: variables?.toJson() ?? {}, + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + onCompleted: onCompleted == null + ? null + : (data) => onCompleted( + data, + data == null ? null : _parserFn$Mutation$StartBackup(data), + ), + update: update, + onError: onError, + document: documentNodeMutationStartBackup, + parserFn: _parserFn$Mutation$StartBackup, + ); + + final OnMutationCompleted$Mutation$StartBackup? onCompletedWithParsed; + + @override + List get properties => [ + ...super.onCompleted == null + ? super.properties + : super.properties.where((property) => property != onCompleted), + onCompletedWithParsed, + ]; +} + +class WatchOptions$Mutation$StartBackup + extends graphql.WatchQueryOptions { + WatchOptions$Mutation$StartBackup({ + String? operationName, + Variables$Mutation$StartBackup? variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Mutation$StartBackup? typedOptimisticResult, + graphql.Context? context, + Duration? pollInterval, + bool? eagerlyFetchResults, + bool carryForwardDataOnException = true, + bool fetchResults = false, + }) : super( + variables: variables?.toJson() ?? {}, + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + document: documentNodeMutationStartBackup, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Mutation$StartBackup, + ); +} + +extension ClientExtension$Mutation$StartBackup on graphql.GraphQLClient { + Future> mutate$StartBackup( + [Options$Mutation$StartBackup? options]) async => + await this.mutate(options ?? Options$Mutation$StartBackup()); + graphql.ObservableQuery watchMutation$StartBackup( + [WatchOptions$Mutation$StartBackup? options]) => + this.watchMutation(options ?? WatchOptions$Mutation$StartBackup()); +} + +class Mutation$StartBackup$startBackup + implements Fragment$basicMutationReturnFields$$GenericJobMutationReturn { + Mutation$StartBackup$startBackup({ + required this.code, + required this.message, + required this.success, + this.$__typename = 'GenericJobMutationReturn', + }); + + factory Mutation$StartBackup$startBackup.fromJson(Map json) { + final l$code = json['code']; + final l$message = json['message']; + final l$success = json['success']; + final l$$__typename = json['__typename']; + return Mutation$StartBackup$startBackup( + code: (l$code as int), + message: (l$message as String), + success: (l$success as bool), + $__typename: (l$$__typename as String), + ); + } + + final int code; + + final String message; + + final bool success; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$code = code; + _resultData['code'] = l$code; + final l$message = message; + _resultData['message'] = l$message; + final l$success = success; + _resultData['success'] = l$success; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$code = code; + final l$message = message; + final l$success = success; + final l$$__typename = $__typename; + return Object.hashAll([ + l$code, + l$message, + l$success, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$StartBackup$startBackup) || + runtimeType != other.runtimeType) { + return false; + } + final l$code = code; + final lOther$code = other.code; + if (l$code != lOther$code) { + return false; + } + final l$message = message; + final lOther$message = other.message; + if (l$message != lOther$message) { + return false; + } + final l$success = success; + final lOther$success = other.success; + if (l$success != lOther$success) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$StartBackup$startBackup + on Mutation$StartBackup$startBackup { + CopyWith$Mutation$StartBackup$startBackup + get copyWith => CopyWith$Mutation$StartBackup$startBackup( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$StartBackup$startBackup { + factory CopyWith$Mutation$StartBackup$startBackup( + Mutation$StartBackup$startBackup instance, + TRes Function(Mutation$StartBackup$startBackup) then, + ) = _CopyWithImpl$Mutation$StartBackup$startBackup; + + factory CopyWith$Mutation$StartBackup$startBackup.stub(TRes res) = + _CopyWithStubImpl$Mutation$StartBackup$startBackup; + + TRes call({ + int? code, + String? message, + bool? success, + String? $__typename, + }); +} + +class _CopyWithImpl$Mutation$StartBackup$startBackup + implements CopyWith$Mutation$StartBackup$startBackup { + _CopyWithImpl$Mutation$StartBackup$startBackup( + this._instance, + this._then, + ); + + final Mutation$StartBackup$startBackup _instance; + + final TRes Function(Mutation$StartBackup$startBackup) _then; + + static const _undefined = {}; + + TRes call({ + Object? code = _undefined, + Object? message = _undefined, + Object? success = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$StartBackup$startBackup( + code: + code == _undefined || code == null ? _instance.code : (code as int), + message: message == _undefined || message == null + ? _instance.message + : (message as String), + success: success == _undefined || success == null + ? _instance.success + : (success as bool), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Mutation$StartBackup$startBackup + implements CopyWith$Mutation$StartBackup$startBackup { + _CopyWithStubImpl$Mutation$StartBackup$startBackup(this._res); + + TRes _res; + + call({ + int? code, + String? message, + bool? success, + String? $__typename, + }) => + _res; +} + +class Variables$Mutation$SetAutobackupPeriod { + factory Variables$Mutation$SetAutobackupPeriod({int? period}) => + Variables$Mutation$SetAutobackupPeriod._({ + if (period != null) r'period': period, + }); + + Variables$Mutation$SetAutobackupPeriod._(this._$data); + + factory Variables$Mutation$SetAutobackupPeriod.fromJson( + Map data) { + final result$data = {}; + if (data.containsKey('period')) { + final l$period = data['period']; + result$data['period'] = (l$period as int?); + } + return Variables$Mutation$SetAutobackupPeriod._(result$data); + } + + Map _$data; + + int? get period => (_$data['period'] as int?); + Map toJson() { + final result$data = {}; + if (_$data.containsKey('period')) { + final l$period = period; + result$data['period'] = l$period; + } + return result$data; + } + + CopyWith$Variables$Mutation$SetAutobackupPeriod< + Variables$Mutation$SetAutobackupPeriod> + get copyWith => CopyWith$Variables$Mutation$SetAutobackupPeriod( + this, + (i) => i, + ); + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Variables$Mutation$SetAutobackupPeriod) || + runtimeType != other.runtimeType) { + return false; + } + final l$period = period; + final lOther$period = other.period; + if (_$data.containsKey('period') != other._$data.containsKey('period')) { + return false; + } + if (l$period != lOther$period) { + return false; + } + return true; + } + + @override + int get hashCode { + final l$period = period; + return Object.hashAll([_$data.containsKey('period') ? l$period : const {}]); + } +} + +abstract class CopyWith$Variables$Mutation$SetAutobackupPeriod { + factory CopyWith$Variables$Mutation$SetAutobackupPeriod( + Variables$Mutation$SetAutobackupPeriod instance, + TRes Function(Variables$Mutation$SetAutobackupPeriod) then, + ) = _CopyWithImpl$Variables$Mutation$SetAutobackupPeriod; + + factory CopyWith$Variables$Mutation$SetAutobackupPeriod.stub(TRes res) = + _CopyWithStubImpl$Variables$Mutation$SetAutobackupPeriod; + + TRes call({int? period}); +} + +class _CopyWithImpl$Variables$Mutation$SetAutobackupPeriod + implements CopyWith$Variables$Mutation$SetAutobackupPeriod { + _CopyWithImpl$Variables$Mutation$SetAutobackupPeriod( + this._instance, + this._then, + ); + + final Variables$Mutation$SetAutobackupPeriod _instance; + + final TRes Function(Variables$Mutation$SetAutobackupPeriod) _then; + + static const _undefined = {}; + + TRes call({Object? period = _undefined}) => + _then(Variables$Mutation$SetAutobackupPeriod._({ + ..._instance._$data, + if (period != _undefined) 'period': (period as int?), + })); +} + +class _CopyWithStubImpl$Variables$Mutation$SetAutobackupPeriod + implements CopyWith$Variables$Mutation$SetAutobackupPeriod { + _CopyWithStubImpl$Variables$Mutation$SetAutobackupPeriod(this._res); + + TRes _res; + + call({int? period}) => _res; +} + +class Mutation$SetAutobackupPeriod { + Mutation$SetAutobackupPeriod({ + required this.setAutobackupPeriod, + this.$__typename = 'Mutation', + }); + + factory Mutation$SetAutobackupPeriod.fromJson(Map json) { + final l$setAutobackupPeriod = json['setAutobackupPeriod']; + final l$$__typename = json['__typename']; + return Mutation$SetAutobackupPeriod( + setAutobackupPeriod: Fragment$genericBackupConfigReturn.fromJson( + (l$setAutobackupPeriod as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Fragment$genericBackupConfigReturn setAutobackupPeriod; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$setAutobackupPeriod = setAutobackupPeriod; + _resultData['setAutobackupPeriod'] = l$setAutobackupPeriod.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$setAutobackupPeriod = setAutobackupPeriod; + final l$$__typename = $__typename; + return Object.hashAll([ + l$setAutobackupPeriod, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$SetAutobackupPeriod) || + runtimeType != other.runtimeType) { + return false; + } + final l$setAutobackupPeriod = setAutobackupPeriod; + final lOther$setAutobackupPeriod = other.setAutobackupPeriod; + if (l$setAutobackupPeriod != lOther$setAutobackupPeriod) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$SetAutobackupPeriod + on Mutation$SetAutobackupPeriod { + CopyWith$Mutation$SetAutobackupPeriod + get copyWith => CopyWith$Mutation$SetAutobackupPeriod( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$SetAutobackupPeriod { + factory CopyWith$Mutation$SetAutobackupPeriod( + Mutation$SetAutobackupPeriod instance, + TRes Function(Mutation$SetAutobackupPeriod) then, + ) = _CopyWithImpl$Mutation$SetAutobackupPeriod; + + factory CopyWith$Mutation$SetAutobackupPeriod.stub(TRes res) = + _CopyWithStubImpl$Mutation$SetAutobackupPeriod; + + TRes call({ + Fragment$genericBackupConfigReturn? setAutobackupPeriod, + String? $__typename, + }); + CopyWith$Fragment$genericBackupConfigReturn get setAutobackupPeriod; +} + +class _CopyWithImpl$Mutation$SetAutobackupPeriod + implements CopyWith$Mutation$SetAutobackupPeriod { + _CopyWithImpl$Mutation$SetAutobackupPeriod( + this._instance, + this._then, + ); + + final Mutation$SetAutobackupPeriod _instance; + + final TRes Function(Mutation$SetAutobackupPeriod) _then; + + static const _undefined = {}; + + TRes call({ + Object? setAutobackupPeriod = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$SetAutobackupPeriod( + setAutobackupPeriod: + setAutobackupPeriod == _undefined || setAutobackupPeriod == null + ? _instance.setAutobackupPeriod + : (setAutobackupPeriod as Fragment$genericBackupConfigReturn), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Fragment$genericBackupConfigReturn get setAutobackupPeriod { + final local$setAutobackupPeriod = _instance.setAutobackupPeriod; + return CopyWith$Fragment$genericBackupConfigReturn( + local$setAutobackupPeriod, (e) => call(setAutobackupPeriod: e)); + } +} + +class _CopyWithStubImpl$Mutation$SetAutobackupPeriod + implements CopyWith$Mutation$SetAutobackupPeriod { + _CopyWithStubImpl$Mutation$SetAutobackupPeriod(this._res); + + TRes _res; + + call({ + Fragment$genericBackupConfigReturn? setAutobackupPeriod, + String? $__typename, + }) => + _res; + CopyWith$Fragment$genericBackupConfigReturn get setAutobackupPeriod => + CopyWith$Fragment$genericBackupConfigReturn.stub(_res); +} + +const documentNodeMutationSetAutobackupPeriod = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'SetAutobackupPeriod'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'period')), + type: NamedTypeNode( + name: NameNode(value: 'Int'), + isNonNull: false, + ), + defaultValue: DefaultValueNode(value: NullValueNode()), + directives: [], + ) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'setAutobackupPeriod'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'period'), + value: VariableNode(name: NameNode(value: 'period')), + ) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'genericBackupConfigReturn'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + fragmentDefinitiongenericBackupConfigReturn, +]); +Mutation$SetAutobackupPeriod _parserFn$Mutation$SetAutobackupPeriod( + Map data) => + Mutation$SetAutobackupPeriod.fromJson(data); +typedef OnMutationCompleted$Mutation$SetAutobackupPeriod = FutureOr + Function( + Map?, + Mutation$SetAutobackupPeriod?, +); + +class Options$Mutation$SetAutobackupPeriod + extends graphql.MutationOptions { + Options$Mutation$SetAutobackupPeriod({ + String? operationName, + Variables$Mutation$SetAutobackupPeriod? variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Mutation$SetAutobackupPeriod? typedOptimisticResult, + graphql.Context? context, + OnMutationCompleted$Mutation$SetAutobackupPeriod? onCompleted, + graphql.OnMutationUpdate? update, + graphql.OnError? onError, + }) : onCompletedWithParsed = onCompleted, + super( + variables: variables?.toJson() ?? {}, + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + onCompleted: onCompleted == null + ? null + : (data) => onCompleted( + data, + data == null + ? null + : _parserFn$Mutation$SetAutobackupPeriod(data), + ), + update: update, + onError: onError, + document: documentNodeMutationSetAutobackupPeriod, + parserFn: _parserFn$Mutation$SetAutobackupPeriod, + ); + + final OnMutationCompleted$Mutation$SetAutobackupPeriod? onCompletedWithParsed; + + @override + List get properties => [ + ...super.onCompleted == null + ? super.properties + : super.properties.where((property) => property != onCompleted), + onCompletedWithParsed, + ]; +} + +class WatchOptions$Mutation$SetAutobackupPeriod + extends graphql.WatchQueryOptions { + WatchOptions$Mutation$SetAutobackupPeriod({ + String? operationName, + Variables$Mutation$SetAutobackupPeriod? variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Mutation$SetAutobackupPeriod? typedOptimisticResult, + graphql.Context? context, + Duration? pollInterval, + bool? eagerlyFetchResults, + bool carryForwardDataOnException = true, + bool fetchResults = false, + }) : super( + variables: variables?.toJson() ?? {}, + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + document: documentNodeMutationSetAutobackupPeriod, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Mutation$SetAutobackupPeriod, + ); +} + +extension ClientExtension$Mutation$SetAutobackupPeriod + on graphql.GraphQLClient { + Future> + mutate$SetAutobackupPeriod( + [Options$Mutation$SetAutobackupPeriod? options]) async => + await this.mutate(options ?? Options$Mutation$SetAutobackupPeriod()); + graphql.ObservableQuery + watchMutation$SetAutobackupPeriod( + [WatchOptions$Mutation$SetAutobackupPeriod? options]) => + this.watchMutation( + options ?? WatchOptions$Mutation$SetAutobackupPeriod()); +} + +class Mutation$RemoveRepository { + Mutation$RemoveRepository({ + required this.removeRepository, + this.$__typename = 'Mutation', + }); + + factory Mutation$RemoveRepository.fromJson(Map json) { + final l$removeRepository = json['removeRepository']; + final l$$__typename = json['__typename']; + return Mutation$RemoveRepository( + removeRepository: Fragment$genericBackupConfigReturn.fromJson( + (l$removeRepository as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Fragment$genericBackupConfigReturn removeRepository; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$removeRepository = removeRepository; + _resultData['removeRepository'] = l$removeRepository.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$removeRepository = removeRepository; + final l$$__typename = $__typename; + return Object.hashAll([ + l$removeRepository, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$RemoveRepository) || + runtimeType != other.runtimeType) { + return false; + } + final l$removeRepository = removeRepository; + final lOther$removeRepository = other.removeRepository; + if (l$removeRepository != lOther$removeRepository) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$RemoveRepository + on Mutation$RemoveRepository { + CopyWith$Mutation$RemoveRepository get copyWith => + CopyWith$Mutation$RemoveRepository( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$RemoveRepository { + factory CopyWith$Mutation$RemoveRepository( + Mutation$RemoveRepository instance, + TRes Function(Mutation$RemoveRepository) then, + ) = _CopyWithImpl$Mutation$RemoveRepository; + + factory CopyWith$Mutation$RemoveRepository.stub(TRes res) = + _CopyWithStubImpl$Mutation$RemoveRepository; + + TRes call({ + Fragment$genericBackupConfigReturn? removeRepository, + String? $__typename, + }); + CopyWith$Fragment$genericBackupConfigReturn get removeRepository; +} + +class _CopyWithImpl$Mutation$RemoveRepository + implements CopyWith$Mutation$RemoveRepository { + _CopyWithImpl$Mutation$RemoveRepository( + this._instance, + this._then, + ); + + final Mutation$RemoveRepository _instance; + + final TRes Function(Mutation$RemoveRepository) _then; + + static const _undefined = {}; + + TRes call({ + Object? removeRepository = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$RemoveRepository( + removeRepository: + removeRepository == _undefined || removeRepository == null + ? _instance.removeRepository + : (removeRepository as Fragment$genericBackupConfigReturn), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Fragment$genericBackupConfigReturn get removeRepository { + final local$removeRepository = _instance.removeRepository; + return CopyWith$Fragment$genericBackupConfigReturn( + local$removeRepository, (e) => call(removeRepository: e)); + } +} + +class _CopyWithStubImpl$Mutation$RemoveRepository + implements CopyWith$Mutation$RemoveRepository { + _CopyWithStubImpl$Mutation$RemoveRepository(this._res); + + TRes _res; + + call({ + Fragment$genericBackupConfigReturn? removeRepository, + String? $__typename, + }) => + _res; + CopyWith$Fragment$genericBackupConfigReturn get removeRepository => + CopyWith$Fragment$genericBackupConfigReturn.stub(_res); +} + +const documentNodeMutationRemoveRepository = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'RemoveRepository'), + variableDefinitions: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'removeRepository'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'genericBackupConfigReturn'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + fragmentDefinitiongenericBackupConfigReturn, +]); +Mutation$RemoveRepository _parserFn$Mutation$RemoveRepository( + Map data) => + Mutation$RemoveRepository.fromJson(data); +typedef OnMutationCompleted$Mutation$RemoveRepository = FutureOr Function( + Map?, + Mutation$RemoveRepository?, +); + +class Options$Mutation$RemoveRepository + extends graphql.MutationOptions { + Options$Mutation$RemoveRepository({ + String? operationName, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Mutation$RemoveRepository? typedOptimisticResult, + graphql.Context? context, + OnMutationCompleted$Mutation$RemoveRepository? onCompleted, + graphql.OnMutationUpdate? update, + graphql.OnError? onError, + }) : onCompletedWithParsed = onCompleted, + super( + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + onCompleted: onCompleted == null + ? null + : (data) => onCompleted( + data, + data == null + ? null + : _parserFn$Mutation$RemoveRepository(data), + ), + update: update, + onError: onError, + document: documentNodeMutationRemoveRepository, + parserFn: _parserFn$Mutation$RemoveRepository, + ); + + final OnMutationCompleted$Mutation$RemoveRepository? onCompletedWithParsed; + + @override + List get properties => [ + ...super.onCompleted == null + ? super.properties + : super.properties.where((property) => property != onCompleted), + onCompletedWithParsed, + ]; +} + +class WatchOptions$Mutation$RemoveRepository + extends graphql.WatchQueryOptions { + WatchOptions$Mutation$RemoveRepository({ + String? operationName, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Mutation$RemoveRepository? typedOptimisticResult, + graphql.Context? context, + Duration? pollInterval, + bool? eagerlyFetchResults, + bool carryForwardDataOnException = true, + bool fetchResults = false, + }) : super( + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + document: documentNodeMutationRemoveRepository, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Mutation$RemoveRepository, + ); +} + +extension ClientExtension$Mutation$RemoveRepository on graphql.GraphQLClient { + Future> + mutate$RemoveRepository( + [Options$Mutation$RemoveRepository? options]) async => + await this.mutate(options ?? Options$Mutation$RemoveRepository()); + graphql.ObservableQuery< + Mutation$RemoveRepository> watchMutation$RemoveRepository( + [WatchOptions$Mutation$RemoveRepository? options]) => + this.watchMutation(options ?? WatchOptions$Mutation$RemoveRepository()); +} + +class Variables$Mutation$InitializeRepository { + factory Variables$Mutation$InitializeRepository( + {required Input$InitializeRepositoryInput repository}) => + Variables$Mutation$InitializeRepository._({ + r'repository': repository, + }); + + Variables$Mutation$InitializeRepository._(this._$data); + + factory Variables$Mutation$InitializeRepository.fromJson( + Map data) { + final result$data = {}; + final l$repository = data['repository']; + result$data['repository'] = Input$InitializeRepositoryInput.fromJson( + (l$repository as Map)); + return Variables$Mutation$InitializeRepository._(result$data); + } + + Map _$data; + + Input$InitializeRepositoryInput get repository => + (_$data['repository'] as Input$InitializeRepositoryInput); + Map toJson() { + final result$data = {}; + final l$repository = repository; + result$data['repository'] = l$repository.toJson(); + return result$data; + } + + CopyWith$Variables$Mutation$InitializeRepository< + Variables$Mutation$InitializeRepository> + get copyWith => CopyWith$Variables$Mutation$InitializeRepository( + this, + (i) => i, + ); + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Variables$Mutation$InitializeRepository) || + runtimeType != other.runtimeType) { + return false; + } + final l$repository = repository; + final lOther$repository = other.repository; + if (l$repository != lOther$repository) { + return false; + } + return true; + } + + @override + int get hashCode { + final l$repository = repository; + return Object.hashAll([l$repository]); + } +} + +abstract class CopyWith$Variables$Mutation$InitializeRepository { + factory CopyWith$Variables$Mutation$InitializeRepository( + Variables$Mutation$InitializeRepository instance, + TRes Function(Variables$Mutation$InitializeRepository) then, + ) = _CopyWithImpl$Variables$Mutation$InitializeRepository; + + factory CopyWith$Variables$Mutation$InitializeRepository.stub(TRes res) = + _CopyWithStubImpl$Variables$Mutation$InitializeRepository; + + TRes call({Input$InitializeRepositoryInput? repository}); +} + +class _CopyWithImpl$Variables$Mutation$InitializeRepository + implements CopyWith$Variables$Mutation$InitializeRepository { + _CopyWithImpl$Variables$Mutation$InitializeRepository( + this._instance, + this._then, + ); + + final Variables$Mutation$InitializeRepository _instance; + + final TRes Function(Variables$Mutation$InitializeRepository) _then; + + static const _undefined = {}; + + TRes call({Object? repository = _undefined}) => + _then(Variables$Mutation$InitializeRepository._({ + ..._instance._$data, + if (repository != _undefined && repository != null) + 'repository': (repository as Input$InitializeRepositoryInput), + })); +} + +class _CopyWithStubImpl$Variables$Mutation$InitializeRepository + implements CopyWith$Variables$Mutation$InitializeRepository { + _CopyWithStubImpl$Variables$Mutation$InitializeRepository(this._res); + + TRes _res; + + call({Input$InitializeRepositoryInput? repository}) => _res; +} + +class Mutation$InitializeRepository { + Mutation$InitializeRepository({ + required this.initializeRepository, + this.$__typename = 'Mutation', + }); + + factory Mutation$InitializeRepository.fromJson(Map json) { + final l$initializeRepository = json['initializeRepository']; + final l$$__typename = json['__typename']; + return Mutation$InitializeRepository( + initializeRepository: Fragment$genericBackupConfigReturn.fromJson( + (l$initializeRepository as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Fragment$genericBackupConfigReturn initializeRepository; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$initializeRepository = initializeRepository; + _resultData['initializeRepository'] = l$initializeRepository.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$initializeRepository = initializeRepository; + final l$$__typename = $__typename; + return Object.hashAll([ + l$initializeRepository, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$InitializeRepository) || + runtimeType != other.runtimeType) { + return false; + } + final l$initializeRepository = initializeRepository; + final lOther$initializeRepository = other.initializeRepository; + if (l$initializeRepository != lOther$initializeRepository) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$InitializeRepository + on Mutation$InitializeRepository { + CopyWith$Mutation$InitializeRepository + get copyWith => CopyWith$Mutation$InitializeRepository( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$InitializeRepository { + factory CopyWith$Mutation$InitializeRepository( + Mutation$InitializeRepository instance, + TRes Function(Mutation$InitializeRepository) then, + ) = _CopyWithImpl$Mutation$InitializeRepository; + + factory CopyWith$Mutation$InitializeRepository.stub(TRes res) = + _CopyWithStubImpl$Mutation$InitializeRepository; + + TRes call({ + Fragment$genericBackupConfigReturn? initializeRepository, + String? $__typename, + }); + CopyWith$Fragment$genericBackupConfigReturn get initializeRepository; +} + +class _CopyWithImpl$Mutation$InitializeRepository + implements CopyWith$Mutation$InitializeRepository { + _CopyWithImpl$Mutation$InitializeRepository( + this._instance, + this._then, + ); + + final Mutation$InitializeRepository _instance; + + final TRes Function(Mutation$InitializeRepository) _then; + + static const _undefined = {}; + + TRes call({ + Object? initializeRepository = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$InitializeRepository( + initializeRepository: + initializeRepository == _undefined || initializeRepository == null + ? _instance.initializeRepository + : (initializeRepository as Fragment$genericBackupConfigReturn), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Fragment$genericBackupConfigReturn get initializeRepository { + final local$initializeRepository = _instance.initializeRepository; + return CopyWith$Fragment$genericBackupConfigReturn( + local$initializeRepository, (e) => call(initializeRepository: e)); + } +} + +class _CopyWithStubImpl$Mutation$InitializeRepository + implements CopyWith$Mutation$InitializeRepository { + _CopyWithStubImpl$Mutation$InitializeRepository(this._res); + + TRes _res; + + call({ + Fragment$genericBackupConfigReturn? initializeRepository, + String? $__typename, + }) => + _res; + CopyWith$Fragment$genericBackupConfigReturn get initializeRepository => + CopyWith$Fragment$genericBackupConfigReturn.stub(_res); +} + +const documentNodeMutationInitializeRepository = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'InitializeRepository'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'repository')), + type: NamedTypeNode( + name: NameNode(value: 'InitializeRepositoryInput'), + isNonNull: true, + ), + defaultValue: DefaultValueNode(value: null), + directives: [], + ) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'initializeRepository'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'repository'), + value: VariableNode(name: NameNode(value: 'repository')), + ) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'genericBackupConfigReturn'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + fragmentDefinitiongenericBackupConfigReturn, +]); +Mutation$InitializeRepository _parserFn$Mutation$InitializeRepository( + Map data) => + Mutation$InitializeRepository.fromJson(data); +typedef OnMutationCompleted$Mutation$InitializeRepository = FutureOr + Function( + Map?, + Mutation$InitializeRepository?, +); + +class Options$Mutation$InitializeRepository + extends graphql.MutationOptions { + Options$Mutation$InitializeRepository({ + String? operationName, + required Variables$Mutation$InitializeRepository variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Mutation$InitializeRepository? typedOptimisticResult, + graphql.Context? context, + OnMutationCompleted$Mutation$InitializeRepository? onCompleted, + graphql.OnMutationUpdate? update, + graphql.OnError? onError, + }) : onCompletedWithParsed = onCompleted, + super( + variables: variables.toJson(), + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + onCompleted: onCompleted == null + ? null + : (data) => onCompleted( + data, + data == null + ? null + : _parserFn$Mutation$InitializeRepository(data), + ), + update: update, + onError: onError, + document: documentNodeMutationInitializeRepository, + parserFn: _parserFn$Mutation$InitializeRepository, + ); + + final OnMutationCompleted$Mutation$InitializeRepository? + onCompletedWithParsed; + + @override + List get properties => [ + ...super.onCompleted == null + ? super.properties + : super.properties.where((property) => property != onCompleted), + onCompletedWithParsed, + ]; +} + +class WatchOptions$Mutation$InitializeRepository + extends graphql.WatchQueryOptions { + WatchOptions$Mutation$InitializeRepository({ + String? operationName, + required Variables$Mutation$InitializeRepository variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Mutation$InitializeRepository? typedOptimisticResult, + graphql.Context? context, + Duration? pollInterval, + bool? eagerlyFetchResults, + bool carryForwardDataOnException = true, + bool fetchResults = false, + }) : super( + variables: variables.toJson(), + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + document: documentNodeMutationInitializeRepository, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Mutation$InitializeRepository, + ); +} + +extension ClientExtension$Mutation$InitializeRepository + on graphql.GraphQLClient { + Future> + mutate$InitializeRepository( + Options$Mutation$InitializeRepository options) async => + await this.mutate(options); + graphql.ObservableQuery + watchMutation$InitializeRepository( + WatchOptions$Mutation$InitializeRepository options) => + this.watchMutation(options); +} diff --git a/lib/logic/api_maps/graphql_maps/server_api/server_api.dart b/lib/logic/api_maps/graphql_maps/server_api/server_api.dart index 91d4eeed..504a0cb5 100644 --- a/lib/logic/api_maps/graphql_maps/server_api/server_api.dart +++ b/lib/logic/api_maps/graphql_maps/server_api/server_api.dart @@ -2,6 +2,7 @@ import 'package:graphql/client.dart'; import 'package:selfprivacy/config/get_it_config.dart'; import 'package:selfprivacy/logic/api_maps/generic_result.dart'; import 'package:selfprivacy/logic/api_maps/graphql_maps/graphql_api_map.dart'; +import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/backups.graphql.dart'; import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart'; import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/schema.graphql.dart'; import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/server_api.graphql.dart'; @@ -9,10 +10,10 @@ import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/server_settings.g import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/services.graphql.dart'; import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/users.graphql.dart'; import 'package:selfprivacy/logic/models/auto_upgrade_settings.dart'; -import 'package:selfprivacy/logic/models/hive/backblaze_bucket.dart'; import 'package:selfprivacy/logic/models/hive/server_details.dart'; import 'package:selfprivacy/logic/models/hive/server_domain.dart'; import 'package:selfprivacy/logic/models/hive/user.dart'; +import 'package:selfprivacy/logic/models/initialize_repository_input.dart'; import 'package:selfprivacy/logic/models/json/api_token.dart'; import 'package:selfprivacy/logic/models/json/backup.dart'; import 'package:selfprivacy/logic/models/json/device_token.dart'; @@ -510,7 +511,133 @@ class ServerApi extends GraphQLApiMap return token; } - /// TODO: backups're not implemented on server side + Future>> getBackups() async { + GenericResult> backups; + QueryResult response; + + try { + final GraphQLClient client = await getClient(); + response = await client.query$AllBackupSnapshots(); + if (response.hasException) { + final message = response.exception.toString(); + print(message); + backups = GenericResult>( + success: false, + data: [], + message: message, + ); + } + final List parsed = response.parsedData!.backup.allSnapshots + .map( + ( + final Query$AllBackupSnapshots$backup$allSnapshots snapshot, + ) => + Backup.fromGraphQL(snapshot), + ) + .toList(); + backups = GenericResult>( + success: true, + data: parsed, + ); + } catch (e) { + print(e); + backups = GenericResult>( + success: false, + data: [], + message: e.toString(), + ); + } + + return backups; + } + + Future forceBackupListReload() async { + try { + final GraphQLClient client = await getClient(); + await client.mutate$ForceSnapshotsReload(); + } catch (e) { + print(e); + return GenericResult( + success: false, + data: null, + message: e.toString(), + ); + } + + return GenericResult( + success: true, + data: null, + ); + } + + Future startBackup({final String? serviceId}) async { + QueryResult response; + GenericResult? result; + + try { + final GraphQLClient client = await getClient(); + final variables = Variables$Mutation$StartBackup(serviceId: serviceId); + final options = Options$Mutation$StartBackup(variables: variables); + response = await client.mutate$StartBackup(options); + if (response.hasException) { + final message = response.exception.toString(); + print(message); + result = GenericResult( + success: false, + data: null, + message: message, + ); + } + result = GenericResult( + success: true, + data: null, + ); + } catch (e) { + print(e); + result = GenericResult( + success: false, + data: null, + message: e.toString(), + ); + } + + return result; + } + + Future setAutobackupPeriod({final int? period}) async { + QueryResult response; + GenericResult? result; + + try { + final GraphQLClient client = await getClient(); + final variables = Variables$Mutation$SetAutobackupPeriod(period: period); + final options = + Options$Mutation$SetAutobackupPeriod(variables: variables); + response = await client.mutate$SetAutobackupPeriod(options); + if (response.hasException) { + final message = response.exception.toString(); + print(message); + result = GenericResult( + success: false, + data: null, + message: message, + ); + } + result = GenericResult( + success: true, + data: null, + ); + } catch (e) { + print(e); + result = GenericResult( + success: false, + data: null, + message: e.toString(), + ); + } + + return result; + } Future getBackupStatus() async => BackupStatus( progress: 0.0, @@ -518,13 +645,67 @@ class ServerApi extends GraphQLApiMap errorMessage: null, ); - Future> getBackups() async => []; + Future removeRepository() async { + try { + final GraphQLClient client = await getClient(); + await client.mutate$RemoveRepository(); + } catch (e) { + print(e); + return GenericResult( + success: false, + data: null, + message: e.toString(), + ); + } - Future uploadBackblazeConfig(final BackblazeBucket bucket) async {} + return GenericResult( + success: true, + data: null, + ); + } - Future forceBackupListReload() async {} + Future initializeRepository( + final InitializeRepositoryInput input, + ) async { + QueryResult response; + GenericResult? result; - Future startBackup() async {} + try { + final GraphQLClient client = await getClient(); + final variables = Variables$Mutation$InitializeRepository( + repository: Input$InitializeRepositoryInput( + locationId: input.locationId, + locationName: input.locationName, + login: input.login, + password: input.password, + provider: input.provider.toGraphQL(), + ), + ); + final options = + Options$Mutation$InitializeRepository(variables: variables); + response = await client.mutate$InitializeRepository(options); + if (response.hasException) { + final message = response.exception.toString(); + print(message); + result = GenericResult( + success: false, + data: null, + message: message, + ); + } + result = GenericResult( + success: true, + data: null, + ); + } catch (e) { + print(e); + result = GenericResult( + success: false, + data: null, + message: e.toString(), + ); + } - Future restoreBackup(final String backupId) async {} + return result; + } } diff --git a/lib/logic/cubit/backups/backups_cubit.dart b/lib/logic/cubit/backups/backups_cubit.dart index b0fbc020..cb743161 100644 --- a/lib/logic/cubit/backups/backups_cubit.dart +++ b/lib/logic/cubit/backups/backups_cubit.dart @@ -63,10 +63,10 @@ class BackupsCubit extends ServerInstallationDependendCubit { break; case BackupStatusEnum.initialized: case BackupStatusEnum.error: - final List backups = await api.getBackups(); + final result = await api.getBackups(); emit( BackupsState( - backups: backups, + backups: result.data, isInitialized: true, preventActions: false, progress: status.progress, @@ -78,10 +78,10 @@ class BackupsCubit extends ServerInstallationDependendCubit { break; case BackupStatusEnum.backingUp: case BackupStatusEnum.restoring: - final List backups = await api.getBackups(); + final result = await api.getBackups(); emit( BackupsState( - backups: backups, + backups: result.data, isInitialized: true, preventActions: true, progress: status.progress, @@ -121,7 +121,7 @@ class BackupsCubit extends ServerInstallationDependendCubit { ); await getIt().storeBackblazeBucket(bucket); - await api.uploadBackblazeConfig(bucket); + //await api.uploadBackblazeConfig(bucket); await updateBackups(); emit(state.copyWith(isInitialized: true, preventActions: false)); @@ -133,7 +133,7 @@ class BackupsCubit extends ServerInstallationDependendCubit { if (bucket == null) { emit(state.copyWith(isInitialized: false)); } else { - await api.uploadBackblazeConfig(bucket); + //await api.uploadBackblazeConfig(bucket); emit(state.copyWith(isInitialized: true, preventActions: false)); getIt().showSnackBar('backup.reuploaded_key'); } @@ -153,7 +153,12 @@ class BackupsCubit extends ServerInstallationDependendCubit { Future updateBackups({final bool useTimer = false}) async { emit(state.copyWith(refreshing: true)); - final List backups = await api.getBackups(); + final result = await api.getBackups(); + if (!result.success || result.data.isEmpty) { + return; + } + + final List backups = result.data; final BackupStatus status = await api.getBackupStatus(); emit( state.copyWith( @@ -186,7 +191,9 @@ class BackupsCubit extends ServerInstallationDependendCubit { Future restoreBackup(final String backupId) async { emit(state.copyWith(preventActions: true)); - await api.restoreBackup(backupId); + + /// TOOD: ??? + //await api.restoreBackup(backupId); emit(state.copyWith(preventActions: false)); } diff --git a/lib/logic/models/hive/backups_credential.dart b/lib/logic/models/hive/backups_credential.dart index c64345c4..9b14f067 100644 --- a/lib/logic/models/hive/backups_credential.dart +++ b/lib/logic/models/hive/backups_credential.dart @@ -7,7 +7,11 @@ part 'backups_credential.g.dart'; @HiveType(typeId: 4) class BackupsCredential { - BackupsCredential({required this.keyId, required this.applicationKey, required this.provider}); + BackupsCredential({ + required this.keyId, + required this.applicationKey, + required this.provider, + }); @HiveField(0) final String keyId; @@ -41,11 +45,19 @@ enum BackupsProvider { @HiveField(3) backblaze; - factory BackupsProvider.fromGraphQL(final Enum$BackupProvider provider) => switch (provider) { - Enum$BackupProvider.NONE => none, - Enum$BackupProvider.MEMORY => memory, - Enum$BackupProvider.FILE => file, - Enum$BackupProvider.BACKBLAZE => backblaze, - Enum$BackupProvider.$unknown => none - }; + factory BackupsProvider.fromGraphQL(final Enum$BackupProvider provider) => + switch (provider) { + Enum$BackupProvider.NONE => none, + Enum$BackupProvider.MEMORY => memory, + Enum$BackupProvider.FILE => file, + Enum$BackupProvider.BACKBLAZE => backblaze, + Enum$BackupProvider.$unknown => none + }; + + Enum$BackupProvider toGraphQL() => switch (this) { + none => Enum$BackupProvider.NONE, + memory => Enum$BackupProvider.MEMORY, + file => Enum$BackupProvider.FILE, + backblaze => Enum$BackupProvider.BACKBLAZE, + }; } diff --git a/lib/logic/models/initialize_repository_input.dart b/lib/logic/models/initialize_repository_input.dart new file mode 100644 index 00000000..fcb137b0 --- /dev/null +++ b/lib/logic/models/initialize_repository_input.dart @@ -0,0 +1,16 @@ +import 'package:selfprivacy/logic/models/hive/backups_credential.dart'; + +class InitializeRepositoryInput { + InitializeRepositoryInput({ + required this.provider, + required this.locationId, + required this.locationName, + required this.login, + required this.password, + }); + final BackupsProvider provider; + final String locationId; + final String locationName; + final String login; + final String password; +} diff --git a/lib/logic/models/json/backup.dart b/lib/logic/models/json/backup.dart index 2e1215db..a806d00b 100644 --- a/lib/logic/models/json/backup.dart +++ b/lib/logic/models/json/backup.dart @@ -1,4 +1,5 @@ import 'package:json_annotation/json_annotation.dart'; +import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/backups.graphql.dart'; part 'backup.g.dart'; @@ -6,12 +7,28 @@ part 'backup.g.dart'; class Backup { factory Backup.fromJson(final Map json) => _$BackupFromJson(json); - Backup({required this.time, required this.id}); + Backup.fromGraphQL( + final Query$AllBackupSnapshots$backup$allSnapshots snapshot, + ) : this( + id: snapshot.id, + time: snapshot.createdAt, + serviceId: snapshot.service.id, + fallbackServiceName: snapshot.service.displayName, + ); + + Backup({ + required this.time, + required this.id, + required this.serviceId, + required this.fallbackServiceName, + }); // Time of the backup final DateTime time; @JsonKey(name: 'short_id') final String id; + final String serviceId; + final String fallbackServiceName; } enum BackupStatusEnum { diff --git a/lib/logic/models/json/backup.g.dart b/lib/logic/models/json/backup.g.dart index dea4847d..35148517 100644 --- a/lib/logic/models/json/backup.g.dart +++ b/lib/logic/models/json/backup.g.dart @@ -9,11 +9,15 @@ part of 'backup.dart'; Backup _$BackupFromJson(Map json) => Backup( time: DateTime.parse(json['time'] as String), id: json['short_id'] as String, + serviceId: json['serviceId'] as String, + fallbackServiceName: json['fallbackServiceName'] as String, ); Map _$BackupToJson(Backup instance) => { 'time': instance.time.toIso8601String(), 'short_id': instance.id, + 'serviceId': instance.serviceId, + 'fallbackServiceName': instance.fallbackServiceName, }; BackupStatus _$BackupStatusFromJson(Map json) => BackupStatus( From feca9d3b0635f2c01aad6519cef64c10f24a10ff Mon Sep 17 00:00:00 2001 From: NaiJi Date: Thu, 22 Jun 2023 23:22:48 -0300 Subject: [PATCH 06/20] chore: Update scheme.graphql and its models --- .../graphql_maps/schema/backups.graphql | 31 +- .../graphql_maps/schema/backups.graphql.dart | 1268 +++++++++++++---- .../graphql_maps/schema/schema.graphql | 145 +- .../graphql_maps/schema/schema.graphql.dart | 523 +------ .../schema/server_settings.graphql | 10 +- .../schema/server_settings.graphql.dart | 321 ++++- .../graphql_maps/schema/services.graphql | 2 +- .../graphql_maps/schema/services.graphql.dart | 28 +- .../graphql_maps/server_api/server_api.dart | 6 +- lib/logic/models/json/dns_records.dart | 4 +- lib/logic/models/service.dart | 6 +- 11 files changed, 1484 insertions(+), 860 deletions(-) diff --git a/lib/logic/api_maps/graphql_maps/schema/backups.graphql b/lib/logic/api_maps/graphql_maps/schema/backups.graphql index eb9fcfb1..0ee5aa6c 100644 --- a/lib/logic/api_maps/graphql_maps/schema/backups.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/backups.graphql @@ -14,7 +14,8 @@ query BackupConfiguration { query AllBackupSnapshots { backup { allSnapshots { - ...backupSnapshotFields + id + createdAt service { displayName id @@ -38,31 +39,41 @@ fragment genericBackupConfigReturn on GenericBackupConfigReturn { } mutation ForceSnapshotsReload { - forceSnapshotsReload { - ...basicMutationReturnFields + backup { + forceSnapshotsReload { + ...basicMutationReturnFields + } } } mutation StartBackup($serviceId: String = null) { - startBackup(serviceId: $serviceId) { + backup { + startBackup(serviceId: $serviceId) { ...basicMutationReturnFields + } } } mutation SetAutobackupPeriod($period: Int = null) { - setAutobackupPeriod(period: $period) { - ...genericBackupConfigReturn + backup { + setAutobackupPeriod(period: $period) { + ...genericBackupConfigReturn + } } } mutation RemoveRepository { - removeRepository { - ...genericBackupConfigReturn + backup { + removeRepository { + ...genericBackupConfigReturn + } } } mutation InitializeRepository($repository: InitializeRepositoryInput!) { - initializeRepository(repository: $repository) { - ...genericBackupConfigReturn + backup { + initializeRepository(repository: $repository) { + ...genericBackupConfigReturn + } } } diff --git a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart index 54b02ead..7ebfa705 100644 --- a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart @@ -1443,9 +1443,19 @@ const documentNodeQueryAllBackupSnapshots = DocumentNode(definitions: [ arguments: [], directives: [], selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'backupSnapshotFields'), + FieldNode( + name: NameNode(value: 'id'), + alias: null, + arguments: [], directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'createdAt'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, ), FieldNode( name: NameNode(value: 'service'), @@ -1503,7 +1513,6 @@ const documentNodeQueryAllBackupSnapshots = DocumentNode(definitions: [ ), ]), ), - fragmentDefinitionbackupSnapshotFields, ]); Query$AllBackupSnapshots _parserFn$Query$AllBackupSnapshots( Map data) => @@ -1787,27 +1796,26 @@ class _CopyWithStubImpl$Query$AllBackupSnapshots$backup allSnapshots(_fn) => _res; } -class Query$AllBackupSnapshots$backup$allSnapshots - implements Fragment$backupSnapshotFields { +class Query$AllBackupSnapshots$backup$allSnapshots { Query$AllBackupSnapshots$backup$allSnapshots({ required this.id, required this.createdAt, - this.$__typename = 'SnapshotInfo', required this.service, + this.$__typename = 'SnapshotInfo', }); factory Query$AllBackupSnapshots$backup$allSnapshots.fromJson( Map json) { final l$id = json['id']; final l$createdAt = json['createdAt']; - final l$$__typename = json['__typename']; final l$service = json['service']; + final l$$__typename = json['__typename']; return Query$AllBackupSnapshots$backup$allSnapshots( id: (l$id as String), createdAt: dateTimeFromJson(l$createdAt), - $__typename: (l$$__typename as String), service: Query$AllBackupSnapshots$backup$allSnapshots$service.fromJson( (l$service as Map)), + $__typename: (l$$__typename as String), ); } @@ -1815,20 +1823,20 @@ class Query$AllBackupSnapshots$backup$allSnapshots final DateTime createdAt; - final String $__typename; - final Query$AllBackupSnapshots$backup$allSnapshots$service service; + final String $__typename; + Map toJson() { final _resultData = {}; final l$id = id; _resultData['id'] = l$id; final l$createdAt = createdAt; _resultData['createdAt'] = dateTimeToJson(l$createdAt); - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; final l$service = service; _resultData['service'] = l$service.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; return _resultData; } @@ -1836,13 +1844,13 @@ class Query$AllBackupSnapshots$backup$allSnapshots int get hashCode { final l$id = id; final l$createdAt = createdAt; - final l$$__typename = $__typename; final l$service = service; + final l$$__typename = $__typename; return Object.hashAll([ l$id, l$createdAt, - l$$__typename, l$service, + l$$__typename, ]); } @@ -1865,16 +1873,16 @@ class Query$AllBackupSnapshots$backup$allSnapshots if (l$createdAt != lOther$createdAt) { return false; } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } final l$service = service; final lOther$service = other.service; if (l$service != lOther$service) { return false; } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } return true; } } @@ -1901,8 +1909,8 @@ abstract class CopyWith$Query$AllBackupSnapshots$backup$allSnapshots { TRes call({ String? id, DateTime? createdAt, - String? $__typename, Query$AllBackupSnapshots$backup$allSnapshots$service? service, + String? $__typename, }); CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service get service; @@ -1924,20 +1932,20 @@ class _CopyWithImpl$Query$AllBackupSnapshots$backup$allSnapshots TRes call({ Object? id = _undefined, Object? createdAt = _undefined, - Object? $__typename = _undefined, Object? service = _undefined, + Object? $__typename = _undefined, }) => _then(Query$AllBackupSnapshots$backup$allSnapshots( id: id == _undefined || id == null ? _instance.id : (id as String), createdAt: createdAt == _undefined || createdAt == null ? _instance.createdAt : (createdAt as DateTime), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), service: service == _undefined || service == null ? _instance.service : (service as Query$AllBackupSnapshots$backup$allSnapshots$service), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), )); CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service get service { @@ -1956,8 +1964,8 @@ class _CopyWithStubImpl$Query$AllBackupSnapshots$backup$allSnapshots call({ String? id, DateTime? createdAt, - String? $__typename, Query$AllBackupSnapshots$backup$allSnapshots$service? service, + String? $__typename, }) => _res; CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service @@ -2121,29 +2129,28 @@ class _CopyWithStubImpl$Query$AllBackupSnapshots$backup$allSnapshots$service< class Mutation$ForceSnapshotsReload { Mutation$ForceSnapshotsReload({ - required this.forceSnapshotsReload, + required this.backup, this.$__typename = 'Mutation', }); factory Mutation$ForceSnapshotsReload.fromJson(Map json) { - final l$forceSnapshotsReload = json['forceSnapshotsReload']; + final l$backup = json['backup']; final l$$__typename = json['__typename']; return Mutation$ForceSnapshotsReload( - forceSnapshotsReload: - Mutation$ForceSnapshotsReload$forceSnapshotsReload.fromJson( - (l$forceSnapshotsReload as Map)), + backup: Mutation$ForceSnapshotsReload$backup.fromJson( + (l$backup as Map)), $__typename: (l$$__typename as String), ); } - final Mutation$ForceSnapshotsReload$forceSnapshotsReload forceSnapshotsReload; + final Mutation$ForceSnapshotsReload$backup backup; final String $__typename; Map toJson() { final _resultData = {}; - final l$forceSnapshotsReload = forceSnapshotsReload; - _resultData['forceSnapshotsReload'] = l$forceSnapshotsReload.toJson(); + final l$backup = backup; + _resultData['backup'] = l$backup.toJson(); final l$$__typename = $__typename; _resultData['__typename'] = l$$__typename; return _resultData; @@ -2151,10 +2158,10 @@ class Mutation$ForceSnapshotsReload { @override int get hashCode { - final l$forceSnapshotsReload = forceSnapshotsReload; + final l$backup = backup; final l$$__typename = $__typename; return Object.hashAll([ - l$forceSnapshotsReload, + l$backup, l$$__typename, ]); } @@ -2168,9 +2175,9 @@ class Mutation$ForceSnapshotsReload { runtimeType != other.runtimeType) { return false; } - final l$forceSnapshotsReload = forceSnapshotsReload; - final lOther$forceSnapshotsReload = other.forceSnapshotsReload; - if (l$forceSnapshotsReload != lOther$forceSnapshotsReload) { + final l$backup = backup; + final lOther$backup = other.backup; + if (l$backup != lOther$backup) { return false; } final l$$__typename = $__typename; @@ -2201,11 +2208,10 @@ abstract class CopyWith$Mutation$ForceSnapshotsReload { _CopyWithStubImpl$Mutation$ForceSnapshotsReload; TRes call({ - Mutation$ForceSnapshotsReload$forceSnapshotsReload? forceSnapshotsReload, + Mutation$ForceSnapshotsReload$backup? backup, String? $__typename, }); - CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload - get forceSnapshotsReload; + CopyWith$Mutation$ForceSnapshotsReload$backup get backup; } class _CopyWithImpl$Mutation$ForceSnapshotsReload @@ -2222,24 +2228,21 @@ class _CopyWithImpl$Mutation$ForceSnapshotsReload static const _undefined = {}; TRes call({ - Object? forceSnapshotsReload = _undefined, + Object? backup = _undefined, Object? $__typename = _undefined, }) => _then(Mutation$ForceSnapshotsReload( - forceSnapshotsReload: - forceSnapshotsReload == _undefined || forceSnapshotsReload == null - ? _instance.forceSnapshotsReload - : (forceSnapshotsReload - as Mutation$ForceSnapshotsReload$forceSnapshotsReload), + backup: backup == _undefined || backup == null + ? _instance.backup + : (backup as Mutation$ForceSnapshotsReload$backup), $__typename: $__typename == _undefined || $__typename == null ? _instance.$__typename : ($__typename as String), )); - CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload - get forceSnapshotsReload { - final local$forceSnapshotsReload = _instance.forceSnapshotsReload; - return CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload( - local$forceSnapshotsReload, (e) => call(forceSnapshotsReload: e)); + CopyWith$Mutation$ForceSnapshotsReload$backup get backup { + final local$backup = _instance.backup; + return CopyWith$Mutation$ForceSnapshotsReload$backup( + local$backup, (e) => call(backup: e)); } } @@ -2250,14 +2253,12 @@ class _CopyWithStubImpl$Mutation$ForceSnapshotsReload TRes _res; call({ - Mutation$ForceSnapshotsReload$forceSnapshotsReload? forceSnapshotsReload, + Mutation$ForceSnapshotsReload$backup? backup, String? $__typename, }) => _res; - CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload - get forceSnapshotsReload => - CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload.stub( - _res); + CopyWith$Mutation$ForceSnapshotsReload$backup get backup => + CopyWith$Mutation$ForceSnapshotsReload$backup.stub(_res); } const documentNodeMutationForceSnapshotsReload = DocumentNode(definitions: [ @@ -2268,14 +2269,29 @@ const documentNodeMutationForceSnapshotsReload = DocumentNode(definitions: [ directives: [], selectionSet: SelectionSetNode(selections: [ FieldNode( - name: NameNode(value: 'forceSnapshotsReload'), + name: NameNode(value: 'backup'), alias: null, arguments: [], directives: [], selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'basicMutationReturnFields'), + FieldNode( + name: NameNode(value: 'forceSnapshotsReload'), + alias: null, + arguments: [], directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'basicMutationReturnFields'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), ), FieldNode( name: NameNode(value: '__typename'), @@ -2396,22 +2412,168 @@ extension ClientExtension$Mutation$ForceSnapshotsReload options ?? WatchOptions$Mutation$ForceSnapshotsReload()); } -class Mutation$ForceSnapshotsReload$forceSnapshotsReload +class Mutation$ForceSnapshotsReload$backup { + Mutation$ForceSnapshotsReload$backup({ + required this.forceSnapshotsReload, + this.$__typename = 'BackupMutations', + }); + + factory Mutation$ForceSnapshotsReload$backup.fromJson( + Map json) { + final l$forceSnapshotsReload = json['forceSnapshotsReload']; + final l$$__typename = json['__typename']; + return Mutation$ForceSnapshotsReload$backup( + forceSnapshotsReload: + Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload.fromJson( + (l$forceSnapshotsReload as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload + forceSnapshotsReload; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$forceSnapshotsReload = forceSnapshotsReload; + _resultData['forceSnapshotsReload'] = l$forceSnapshotsReload.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$forceSnapshotsReload = forceSnapshotsReload; + final l$$__typename = $__typename; + return Object.hashAll([ + l$forceSnapshotsReload, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$ForceSnapshotsReload$backup) || + runtimeType != other.runtimeType) { + return false; + } + final l$forceSnapshotsReload = forceSnapshotsReload; + final lOther$forceSnapshotsReload = other.forceSnapshotsReload; + if (l$forceSnapshotsReload != lOther$forceSnapshotsReload) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$ForceSnapshotsReload$backup + on Mutation$ForceSnapshotsReload$backup { + CopyWith$Mutation$ForceSnapshotsReload$backup< + Mutation$ForceSnapshotsReload$backup> + get copyWith => CopyWith$Mutation$ForceSnapshotsReload$backup( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$ForceSnapshotsReload$backup { + factory CopyWith$Mutation$ForceSnapshotsReload$backup( + Mutation$ForceSnapshotsReload$backup instance, + TRes Function(Mutation$ForceSnapshotsReload$backup) then, + ) = _CopyWithImpl$Mutation$ForceSnapshotsReload$backup; + + factory CopyWith$Mutation$ForceSnapshotsReload$backup.stub(TRes res) = + _CopyWithStubImpl$Mutation$ForceSnapshotsReload$backup; + + TRes call({ + Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload? + forceSnapshotsReload, + String? $__typename, + }); + CopyWith$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload + get forceSnapshotsReload; +} + +class _CopyWithImpl$Mutation$ForceSnapshotsReload$backup + implements CopyWith$Mutation$ForceSnapshotsReload$backup { + _CopyWithImpl$Mutation$ForceSnapshotsReload$backup( + this._instance, + this._then, + ); + + final Mutation$ForceSnapshotsReload$backup _instance; + + final TRes Function(Mutation$ForceSnapshotsReload$backup) _then; + + static const _undefined = {}; + + TRes call({ + Object? forceSnapshotsReload = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$ForceSnapshotsReload$backup( + forceSnapshotsReload: forceSnapshotsReload == _undefined || + forceSnapshotsReload == null + ? _instance.forceSnapshotsReload + : (forceSnapshotsReload + as Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload + get forceSnapshotsReload { + final local$forceSnapshotsReload = _instance.forceSnapshotsReload; + return CopyWith$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload( + local$forceSnapshotsReload, (e) => call(forceSnapshotsReload: e)); + } +} + +class _CopyWithStubImpl$Mutation$ForceSnapshotsReload$backup + implements CopyWith$Mutation$ForceSnapshotsReload$backup { + _CopyWithStubImpl$Mutation$ForceSnapshotsReload$backup(this._res); + + TRes _res; + + call({ + Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload? + forceSnapshotsReload, + String? $__typename, + }) => + _res; + CopyWith$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload + get forceSnapshotsReload => + CopyWith$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload + .stub(_res); +} + +class Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload implements Fragment$basicMutationReturnFields$$GenericMutationReturn { - Mutation$ForceSnapshotsReload$forceSnapshotsReload({ + Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload({ required this.code, required this.message, required this.success, this.$__typename = 'GenericMutationReturn', }); - factory Mutation$ForceSnapshotsReload$forceSnapshotsReload.fromJson( + factory Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload.fromJson( Map json) { final l$code = json['code']; final l$message = json['message']; final l$success = json['success']; final l$$__typename = json['__typename']; - return Mutation$ForceSnapshotsReload$forceSnapshotsReload( + return Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload( code: (l$code as int), message: (l$message as String), success: (l$success as bool), @@ -2459,7 +2621,7 @@ class Mutation$ForceSnapshotsReload$forceSnapshotsReload if (identical(this, other)) { return true; } - if (!(other is Mutation$ForceSnapshotsReload$forceSnapshotsReload) || + if (!(other is Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload) || runtimeType != other.runtimeType) { return false; } @@ -2487,27 +2649,28 @@ class Mutation$ForceSnapshotsReload$forceSnapshotsReload } } -extension UtilityExtension$Mutation$ForceSnapshotsReload$forceSnapshotsReload - on Mutation$ForceSnapshotsReload$forceSnapshotsReload { - CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload< - Mutation$ForceSnapshotsReload$forceSnapshotsReload> +extension UtilityExtension$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload + on Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload { + CopyWith$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload< + Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload> get copyWith => - CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload( + CopyWith$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload( this, (i) => i, ); } -abstract class CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload< +abstract class CopyWith$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload< TRes> { - factory CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload( - Mutation$ForceSnapshotsReload$forceSnapshotsReload instance, - TRes Function(Mutation$ForceSnapshotsReload$forceSnapshotsReload) then, - ) = _CopyWithImpl$Mutation$ForceSnapshotsReload$forceSnapshotsReload; + factory CopyWith$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload( + Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload instance, + TRes Function(Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload) + then, + ) = _CopyWithImpl$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload; - factory CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload.stub( + factory CopyWith$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload.stub( TRes res) = - _CopyWithStubImpl$Mutation$ForceSnapshotsReload$forceSnapshotsReload; + _CopyWithStubImpl$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload; TRes call({ int? code, @@ -2517,17 +2680,20 @@ abstract class CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload< }); } -class _CopyWithImpl$Mutation$ForceSnapshotsReload$forceSnapshotsReload +class _CopyWithImpl$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload< + TRes> implements - CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload { - _CopyWithImpl$Mutation$ForceSnapshotsReload$forceSnapshotsReload( + CopyWith$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload< + TRes> { + _CopyWithImpl$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload( this._instance, this._then, ); - final Mutation$ForceSnapshotsReload$forceSnapshotsReload _instance; + final Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload _instance; - final TRes Function(Mutation$ForceSnapshotsReload$forceSnapshotsReload) _then; + final TRes Function(Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload) + _then; static const _undefined = {}; @@ -2537,7 +2703,7 @@ class _CopyWithImpl$Mutation$ForceSnapshotsReload$forceSnapshotsReload Object? success = _undefined, Object? $__typename = _undefined, }) => - _then(Mutation$ForceSnapshotsReload$forceSnapshotsReload( + _then(Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload( code: code == _undefined || code == null ? _instance.code : (code as int), message: message == _undefined || message == null @@ -2552,10 +2718,12 @@ class _CopyWithImpl$Mutation$ForceSnapshotsReload$forceSnapshotsReload )); } -class _CopyWithStubImpl$Mutation$ForceSnapshotsReload$forceSnapshotsReload +class _CopyWithStubImpl$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload< + TRes> implements - CopyWith$Mutation$ForceSnapshotsReload$forceSnapshotsReload { - _CopyWithStubImpl$Mutation$ForceSnapshotsReload$forceSnapshotsReload( + CopyWith$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload< + TRes> { + _CopyWithStubImpl$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload( this._res); TRes _res; @@ -2675,28 +2843,28 @@ class _CopyWithStubImpl$Variables$Mutation$StartBackup class Mutation$StartBackup { Mutation$StartBackup({ - required this.startBackup, + required this.backup, this.$__typename = 'Mutation', }); factory Mutation$StartBackup.fromJson(Map json) { - final l$startBackup = json['startBackup']; + final l$backup = json['backup']; final l$$__typename = json['__typename']; return Mutation$StartBackup( - startBackup: Mutation$StartBackup$startBackup.fromJson( - (l$startBackup as Map)), + backup: Mutation$StartBackup$backup.fromJson( + (l$backup as Map)), $__typename: (l$$__typename as String), ); } - final Mutation$StartBackup$startBackup startBackup; + final Mutation$StartBackup$backup backup; final String $__typename; Map toJson() { final _resultData = {}; - final l$startBackup = startBackup; - _resultData['startBackup'] = l$startBackup.toJson(); + final l$backup = backup; + _resultData['backup'] = l$backup.toJson(); final l$$__typename = $__typename; _resultData['__typename'] = l$$__typename; return _resultData; @@ -2704,10 +2872,10 @@ class Mutation$StartBackup { @override int get hashCode { - final l$startBackup = startBackup; + final l$backup = backup; final l$$__typename = $__typename; return Object.hashAll([ - l$startBackup, + l$backup, l$$__typename, ]); } @@ -2720,9 +2888,9 @@ class Mutation$StartBackup { if (!(other is Mutation$StartBackup) || runtimeType != other.runtimeType) { return false; } - final l$startBackup = startBackup; - final lOther$startBackup = other.startBackup; - if (l$startBackup != lOther$startBackup) { + final l$backup = backup; + final lOther$backup = other.backup; + if (l$backup != lOther$backup) { return false; } final l$$__typename = $__typename; @@ -2752,10 +2920,10 @@ abstract class CopyWith$Mutation$StartBackup { _CopyWithStubImpl$Mutation$StartBackup; TRes call({ - Mutation$StartBackup$startBackup? startBackup, + Mutation$StartBackup$backup? backup, String? $__typename, }); - CopyWith$Mutation$StartBackup$startBackup get startBackup; + CopyWith$Mutation$StartBackup$backup get backup; } class _CopyWithImpl$Mutation$StartBackup @@ -2772,21 +2940,21 @@ class _CopyWithImpl$Mutation$StartBackup static const _undefined = {}; TRes call({ - Object? startBackup = _undefined, + Object? backup = _undefined, Object? $__typename = _undefined, }) => _then(Mutation$StartBackup( - startBackup: startBackup == _undefined || startBackup == null - ? _instance.startBackup - : (startBackup as Mutation$StartBackup$startBackup), + backup: backup == _undefined || backup == null + ? _instance.backup + : (backup as Mutation$StartBackup$backup), $__typename: $__typename == _undefined || $__typename == null ? _instance.$__typename : ($__typename as String), )); - CopyWith$Mutation$StartBackup$startBackup get startBackup { - final local$startBackup = _instance.startBackup; - return CopyWith$Mutation$StartBackup$startBackup( - local$startBackup, (e) => call(startBackup: e)); + CopyWith$Mutation$StartBackup$backup get backup { + final local$backup = _instance.backup; + return CopyWith$Mutation$StartBackup$backup( + local$backup, (e) => call(backup: e)); } } @@ -2797,12 +2965,12 @@ class _CopyWithStubImpl$Mutation$StartBackup TRes _res; call({ - Mutation$StartBackup$startBackup? startBackup, + Mutation$StartBackup$backup? backup, String? $__typename, }) => _res; - CopyWith$Mutation$StartBackup$startBackup get startBackup => - CopyWith$Mutation$StartBackup$startBackup.stub(_res); + CopyWith$Mutation$StartBackup$backup get backup => + CopyWith$Mutation$StartBackup$backup.stub(_res); } const documentNodeMutationStartBackup = DocumentNode(definitions: [ @@ -2823,19 +2991,34 @@ const documentNodeMutationStartBackup = DocumentNode(definitions: [ directives: [], selectionSet: SelectionSetNode(selections: [ FieldNode( - name: NameNode(value: 'startBackup'), + name: NameNode(value: 'backup'), alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'serviceId'), - value: VariableNode(name: NameNode(value: 'serviceId')), - ) - ], + arguments: [], directives: [], selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'basicMutationReturnFields'), + FieldNode( + name: NameNode(value: 'startBackup'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'serviceId'), + value: VariableNode(name: NameNode(value: 'serviceId')), + ) + ], directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'basicMutationReturnFields'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), ), FieldNode( name: NameNode(value: '__typename'), @@ -2952,21 +3135,156 @@ extension ClientExtension$Mutation$StartBackup on graphql.GraphQLClient { this.watchMutation(options ?? WatchOptions$Mutation$StartBackup()); } -class Mutation$StartBackup$startBackup +class Mutation$StartBackup$backup { + Mutation$StartBackup$backup({ + required this.startBackup, + this.$__typename = 'BackupMutations', + }); + + factory Mutation$StartBackup$backup.fromJson(Map json) { + final l$startBackup = json['startBackup']; + final l$$__typename = json['__typename']; + return Mutation$StartBackup$backup( + startBackup: Mutation$StartBackup$backup$startBackup.fromJson( + (l$startBackup as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Mutation$StartBackup$backup$startBackup startBackup; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$startBackup = startBackup; + _resultData['startBackup'] = l$startBackup.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$startBackup = startBackup; + final l$$__typename = $__typename; + return Object.hashAll([ + l$startBackup, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$StartBackup$backup) || + runtimeType != other.runtimeType) { + return false; + } + final l$startBackup = startBackup; + final lOther$startBackup = other.startBackup; + if (l$startBackup != lOther$startBackup) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$StartBackup$backup + on Mutation$StartBackup$backup { + CopyWith$Mutation$StartBackup$backup + get copyWith => CopyWith$Mutation$StartBackup$backup( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$StartBackup$backup { + factory CopyWith$Mutation$StartBackup$backup( + Mutation$StartBackup$backup instance, + TRes Function(Mutation$StartBackup$backup) then, + ) = _CopyWithImpl$Mutation$StartBackup$backup; + + factory CopyWith$Mutation$StartBackup$backup.stub(TRes res) = + _CopyWithStubImpl$Mutation$StartBackup$backup; + + TRes call({ + Mutation$StartBackup$backup$startBackup? startBackup, + String? $__typename, + }); + CopyWith$Mutation$StartBackup$backup$startBackup get startBackup; +} + +class _CopyWithImpl$Mutation$StartBackup$backup + implements CopyWith$Mutation$StartBackup$backup { + _CopyWithImpl$Mutation$StartBackup$backup( + this._instance, + this._then, + ); + + final Mutation$StartBackup$backup _instance; + + final TRes Function(Mutation$StartBackup$backup) _then; + + static const _undefined = {}; + + TRes call({ + Object? startBackup = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$StartBackup$backup( + startBackup: startBackup == _undefined || startBackup == null + ? _instance.startBackup + : (startBackup as Mutation$StartBackup$backup$startBackup), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Mutation$StartBackup$backup$startBackup get startBackup { + final local$startBackup = _instance.startBackup; + return CopyWith$Mutation$StartBackup$backup$startBackup( + local$startBackup, (e) => call(startBackup: e)); + } +} + +class _CopyWithStubImpl$Mutation$StartBackup$backup + implements CopyWith$Mutation$StartBackup$backup { + _CopyWithStubImpl$Mutation$StartBackup$backup(this._res); + + TRes _res; + + call({ + Mutation$StartBackup$backup$startBackup? startBackup, + String? $__typename, + }) => + _res; + CopyWith$Mutation$StartBackup$backup$startBackup get startBackup => + CopyWith$Mutation$StartBackup$backup$startBackup.stub(_res); +} + +class Mutation$StartBackup$backup$startBackup implements Fragment$basicMutationReturnFields$$GenericJobMutationReturn { - Mutation$StartBackup$startBackup({ + Mutation$StartBackup$backup$startBackup({ required this.code, required this.message, required this.success, this.$__typename = 'GenericJobMutationReturn', }); - factory Mutation$StartBackup$startBackup.fromJson(Map json) { + factory Mutation$StartBackup$backup$startBackup.fromJson( + Map json) { final l$code = json['code']; final l$message = json['message']; final l$success = json['success']; final l$$__typename = json['__typename']; - return Mutation$StartBackup$startBackup( + return Mutation$StartBackup$backup$startBackup( code: (l$code as int), message: (l$message as String), success: (l$success as bool), @@ -3014,7 +3332,7 @@ class Mutation$StartBackup$startBackup if (identical(this, other)) { return true; } - if (!(other is Mutation$StartBackup$startBackup) || + if (!(other is Mutation$StartBackup$backup$startBackup) || runtimeType != other.runtimeType) { return false; } @@ -3042,23 +3360,24 @@ class Mutation$StartBackup$startBackup } } -extension UtilityExtension$Mutation$StartBackup$startBackup - on Mutation$StartBackup$startBackup { - CopyWith$Mutation$StartBackup$startBackup - get copyWith => CopyWith$Mutation$StartBackup$startBackup( +extension UtilityExtension$Mutation$StartBackup$backup$startBackup + on Mutation$StartBackup$backup$startBackup { + CopyWith$Mutation$StartBackup$backup$startBackup< + Mutation$StartBackup$backup$startBackup> + get copyWith => CopyWith$Mutation$StartBackup$backup$startBackup( this, (i) => i, ); } -abstract class CopyWith$Mutation$StartBackup$startBackup { - factory CopyWith$Mutation$StartBackup$startBackup( - Mutation$StartBackup$startBackup instance, - TRes Function(Mutation$StartBackup$startBackup) then, - ) = _CopyWithImpl$Mutation$StartBackup$startBackup; +abstract class CopyWith$Mutation$StartBackup$backup$startBackup { + factory CopyWith$Mutation$StartBackup$backup$startBackup( + Mutation$StartBackup$backup$startBackup instance, + TRes Function(Mutation$StartBackup$backup$startBackup) then, + ) = _CopyWithImpl$Mutation$StartBackup$backup$startBackup; - factory CopyWith$Mutation$StartBackup$startBackup.stub(TRes res) = - _CopyWithStubImpl$Mutation$StartBackup$startBackup; + factory CopyWith$Mutation$StartBackup$backup$startBackup.stub(TRes res) = + _CopyWithStubImpl$Mutation$StartBackup$backup$startBackup; TRes call({ int? code, @@ -3068,16 +3387,16 @@ abstract class CopyWith$Mutation$StartBackup$startBackup { }); } -class _CopyWithImpl$Mutation$StartBackup$startBackup - implements CopyWith$Mutation$StartBackup$startBackup { - _CopyWithImpl$Mutation$StartBackup$startBackup( +class _CopyWithImpl$Mutation$StartBackup$backup$startBackup + implements CopyWith$Mutation$StartBackup$backup$startBackup { + _CopyWithImpl$Mutation$StartBackup$backup$startBackup( this._instance, this._then, ); - final Mutation$StartBackup$startBackup _instance; + final Mutation$StartBackup$backup$startBackup _instance; - final TRes Function(Mutation$StartBackup$startBackup) _then; + final TRes Function(Mutation$StartBackup$backup$startBackup) _then; static const _undefined = {}; @@ -3087,7 +3406,7 @@ class _CopyWithImpl$Mutation$StartBackup$startBackup Object? success = _undefined, Object? $__typename = _undefined, }) => - _then(Mutation$StartBackup$startBackup( + _then(Mutation$StartBackup$backup$startBackup( code: code == _undefined || code == null ? _instance.code : (code as int), message: message == _undefined || message == null @@ -3102,9 +3421,9 @@ class _CopyWithImpl$Mutation$StartBackup$startBackup )); } -class _CopyWithStubImpl$Mutation$StartBackup$startBackup - implements CopyWith$Mutation$StartBackup$startBackup { - _CopyWithStubImpl$Mutation$StartBackup$startBackup(this._res); +class _CopyWithStubImpl$Mutation$StartBackup$backup$startBackup + implements CopyWith$Mutation$StartBackup$backup$startBackup { + _CopyWithStubImpl$Mutation$StartBackup$backup$startBackup(this._res); TRes _res; @@ -3223,28 +3542,28 @@ class _CopyWithStubImpl$Variables$Mutation$SetAutobackupPeriod class Mutation$SetAutobackupPeriod { Mutation$SetAutobackupPeriod({ - required this.setAutobackupPeriod, + required this.backup, this.$__typename = 'Mutation', }); factory Mutation$SetAutobackupPeriod.fromJson(Map json) { - final l$setAutobackupPeriod = json['setAutobackupPeriod']; + final l$backup = json['backup']; final l$$__typename = json['__typename']; return Mutation$SetAutobackupPeriod( - setAutobackupPeriod: Fragment$genericBackupConfigReturn.fromJson( - (l$setAutobackupPeriod as Map)), + backup: Mutation$SetAutobackupPeriod$backup.fromJson( + (l$backup as Map)), $__typename: (l$$__typename as String), ); } - final Fragment$genericBackupConfigReturn setAutobackupPeriod; + final Mutation$SetAutobackupPeriod$backup backup; final String $__typename; Map toJson() { final _resultData = {}; - final l$setAutobackupPeriod = setAutobackupPeriod; - _resultData['setAutobackupPeriod'] = l$setAutobackupPeriod.toJson(); + final l$backup = backup; + _resultData['backup'] = l$backup.toJson(); final l$$__typename = $__typename; _resultData['__typename'] = l$$__typename; return _resultData; @@ -3252,10 +3571,10 @@ class Mutation$SetAutobackupPeriod { @override int get hashCode { - final l$setAutobackupPeriod = setAutobackupPeriod; + final l$backup = backup; final l$$__typename = $__typename; return Object.hashAll([ - l$setAutobackupPeriod, + l$backup, l$$__typename, ]); } @@ -3269,9 +3588,9 @@ class Mutation$SetAutobackupPeriod { runtimeType != other.runtimeType) { return false; } - final l$setAutobackupPeriod = setAutobackupPeriod; - final lOther$setAutobackupPeriod = other.setAutobackupPeriod; - if (l$setAutobackupPeriod != lOther$setAutobackupPeriod) { + final l$backup = backup; + final lOther$backup = other.backup; + if (l$backup != lOther$backup) { return false; } final l$$__typename = $__typename; @@ -3302,10 +3621,10 @@ abstract class CopyWith$Mutation$SetAutobackupPeriod { _CopyWithStubImpl$Mutation$SetAutobackupPeriod; TRes call({ - Fragment$genericBackupConfigReturn? setAutobackupPeriod, + Mutation$SetAutobackupPeriod$backup? backup, String? $__typename, }); - CopyWith$Fragment$genericBackupConfigReturn get setAutobackupPeriod; + CopyWith$Mutation$SetAutobackupPeriod$backup get backup; } class _CopyWithImpl$Mutation$SetAutobackupPeriod @@ -3322,22 +3641,21 @@ class _CopyWithImpl$Mutation$SetAutobackupPeriod static const _undefined = {}; TRes call({ - Object? setAutobackupPeriod = _undefined, + Object? backup = _undefined, Object? $__typename = _undefined, }) => _then(Mutation$SetAutobackupPeriod( - setAutobackupPeriod: - setAutobackupPeriod == _undefined || setAutobackupPeriod == null - ? _instance.setAutobackupPeriod - : (setAutobackupPeriod as Fragment$genericBackupConfigReturn), + backup: backup == _undefined || backup == null + ? _instance.backup + : (backup as Mutation$SetAutobackupPeriod$backup), $__typename: $__typename == _undefined || $__typename == null ? _instance.$__typename : ($__typename as String), )); - CopyWith$Fragment$genericBackupConfigReturn get setAutobackupPeriod { - final local$setAutobackupPeriod = _instance.setAutobackupPeriod; - return CopyWith$Fragment$genericBackupConfigReturn( - local$setAutobackupPeriod, (e) => call(setAutobackupPeriod: e)); + CopyWith$Mutation$SetAutobackupPeriod$backup get backup { + final local$backup = _instance.backup; + return CopyWith$Mutation$SetAutobackupPeriod$backup( + local$backup, (e) => call(backup: e)); } } @@ -3348,12 +3666,12 @@ class _CopyWithStubImpl$Mutation$SetAutobackupPeriod TRes _res; call({ - Fragment$genericBackupConfigReturn? setAutobackupPeriod, + Mutation$SetAutobackupPeriod$backup? backup, String? $__typename, }) => _res; - CopyWith$Fragment$genericBackupConfigReturn get setAutobackupPeriod => - CopyWith$Fragment$genericBackupConfigReturn.stub(_res); + CopyWith$Mutation$SetAutobackupPeriod$backup get backup => + CopyWith$Mutation$SetAutobackupPeriod$backup.stub(_res); } const documentNodeMutationSetAutobackupPeriod = DocumentNode(definitions: [ @@ -3374,19 +3692,34 @@ const documentNodeMutationSetAutobackupPeriod = DocumentNode(definitions: [ directives: [], selectionSet: SelectionSetNode(selections: [ FieldNode( - name: NameNode(value: 'setAutobackupPeriod'), + name: NameNode(value: 'backup'), alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'period'), - value: VariableNode(name: NameNode(value: 'period')), - ) - ], + arguments: [], directives: [], selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'genericBackupConfigReturn'), + FieldNode( + name: NameNode(value: 'setAutobackupPeriod'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'period'), + value: VariableNode(name: NameNode(value: 'period')), + ) + ], directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'genericBackupConfigReturn'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), ), FieldNode( name: NameNode(value: '__typename'), @@ -3510,30 +3843,31 @@ extension ClientExtension$Mutation$SetAutobackupPeriod options ?? WatchOptions$Mutation$SetAutobackupPeriod()); } -class Mutation$RemoveRepository { - Mutation$RemoveRepository({ - required this.removeRepository, - this.$__typename = 'Mutation', +class Mutation$SetAutobackupPeriod$backup { + Mutation$SetAutobackupPeriod$backup({ + required this.setAutobackupPeriod, + this.$__typename = 'BackupMutations', }); - factory Mutation$RemoveRepository.fromJson(Map json) { - final l$removeRepository = json['removeRepository']; + factory Mutation$SetAutobackupPeriod$backup.fromJson( + Map json) { + final l$setAutobackupPeriod = json['setAutobackupPeriod']; final l$$__typename = json['__typename']; - return Mutation$RemoveRepository( - removeRepository: Fragment$genericBackupConfigReturn.fromJson( - (l$removeRepository as Map)), + return Mutation$SetAutobackupPeriod$backup( + setAutobackupPeriod: Fragment$genericBackupConfigReturn.fromJson( + (l$setAutobackupPeriod as Map)), $__typename: (l$$__typename as String), ); } - final Fragment$genericBackupConfigReturn removeRepository; + final Fragment$genericBackupConfigReturn setAutobackupPeriod; final String $__typename; Map toJson() { final _resultData = {}; - final l$removeRepository = removeRepository; - _resultData['removeRepository'] = l$removeRepository.toJson(); + final l$setAutobackupPeriod = setAutobackupPeriod; + _resultData['setAutobackupPeriod'] = l$setAutobackupPeriod.toJson(); final l$$__typename = $__typename; _resultData['__typename'] = l$$__typename; return _resultData; @@ -3541,10 +3875,146 @@ class Mutation$RemoveRepository { @override int get hashCode { - final l$removeRepository = removeRepository; + final l$setAutobackupPeriod = setAutobackupPeriod; final l$$__typename = $__typename; return Object.hashAll([ - l$removeRepository, + l$setAutobackupPeriod, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$SetAutobackupPeriod$backup) || + runtimeType != other.runtimeType) { + return false; + } + final l$setAutobackupPeriod = setAutobackupPeriod; + final lOther$setAutobackupPeriod = other.setAutobackupPeriod; + if (l$setAutobackupPeriod != lOther$setAutobackupPeriod) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$SetAutobackupPeriod$backup + on Mutation$SetAutobackupPeriod$backup { + CopyWith$Mutation$SetAutobackupPeriod$backup< + Mutation$SetAutobackupPeriod$backup> + get copyWith => CopyWith$Mutation$SetAutobackupPeriod$backup( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$SetAutobackupPeriod$backup { + factory CopyWith$Mutation$SetAutobackupPeriod$backup( + Mutation$SetAutobackupPeriod$backup instance, + TRes Function(Mutation$SetAutobackupPeriod$backup) then, + ) = _CopyWithImpl$Mutation$SetAutobackupPeriod$backup; + + factory CopyWith$Mutation$SetAutobackupPeriod$backup.stub(TRes res) = + _CopyWithStubImpl$Mutation$SetAutobackupPeriod$backup; + + TRes call({ + Fragment$genericBackupConfigReturn? setAutobackupPeriod, + String? $__typename, + }); + CopyWith$Fragment$genericBackupConfigReturn get setAutobackupPeriod; +} + +class _CopyWithImpl$Mutation$SetAutobackupPeriod$backup + implements CopyWith$Mutation$SetAutobackupPeriod$backup { + _CopyWithImpl$Mutation$SetAutobackupPeriod$backup( + this._instance, + this._then, + ); + + final Mutation$SetAutobackupPeriod$backup _instance; + + final TRes Function(Mutation$SetAutobackupPeriod$backup) _then; + + static const _undefined = {}; + + TRes call({ + Object? setAutobackupPeriod = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$SetAutobackupPeriod$backup( + setAutobackupPeriod: + setAutobackupPeriod == _undefined || setAutobackupPeriod == null + ? _instance.setAutobackupPeriod + : (setAutobackupPeriod as Fragment$genericBackupConfigReturn), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Fragment$genericBackupConfigReturn get setAutobackupPeriod { + final local$setAutobackupPeriod = _instance.setAutobackupPeriod; + return CopyWith$Fragment$genericBackupConfigReturn( + local$setAutobackupPeriod, (e) => call(setAutobackupPeriod: e)); + } +} + +class _CopyWithStubImpl$Mutation$SetAutobackupPeriod$backup + implements CopyWith$Mutation$SetAutobackupPeriod$backup { + _CopyWithStubImpl$Mutation$SetAutobackupPeriod$backup(this._res); + + TRes _res; + + call({ + Fragment$genericBackupConfigReturn? setAutobackupPeriod, + String? $__typename, + }) => + _res; + CopyWith$Fragment$genericBackupConfigReturn get setAutobackupPeriod => + CopyWith$Fragment$genericBackupConfigReturn.stub(_res); +} + +class Mutation$RemoveRepository { + Mutation$RemoveRepository({ + required this.backup, + this.$__typename = 'Mutation', + }); + + factory Mutation$RemoveRepository.fromJson(Map json) { + final l$backup = json['backup']; + final l$$__typename = json['__typename']; + return Mutation$RemoveRepository( + backup: Mutation$RemoveRepository$backup.fromJson( + (l$backup as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Mutation$RemoveRepository$backup backup; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$backup = backup; + _resultData['backup'] = l$backup.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$backup = backup; + final l$$__typename = $__typename; + return Object.hashAll([ + l$backup, l$$__typename, ]); } @@ -3558,9 +4028,9 @@ class Mutation$RemoveRepository { runtimeType != other.runtimeType) { return false; } - final l$removeRepository = removeRepository; - final lOther$removeRepository = other.removeRepository; - if (l$removeRepository != lOther$removeRepository) { + final l$backup = backup; + final lOther$backup = other.backup; + if (l$backup != lOther$backup) { return false; } final l$$__typename = $__typename; @@ -3591,10 +4061,10 @@ abstract class CopyWith$Mutation$RemoveRepository { _CopyWithStubImpl$Mutation$RemoveRepository; TRes call({ - Fragment$genericBackupConfigReturn? removeRepository, + Mutation$RemoveRepository$backup? backup, String? $__typename, }); - CopyWith$Fragment$genericBackupConfigReturn get removeRepository; + CopyWith$Mutation$RemoveRepository$backup get backup; } class _CopyWithImpl$Mutation$RemoveRepository @@ -3611,22 +4081,21 @@ class _CopyWithImpl$Mutation$RemoveRepository static const _undefined = {}; TRes call({ - Object? removeRepository = _undefined, + Object? backup = _undefined, Object? $__typename = _undefined, }) => _then(Mutation$RemoveRepository( - removeRepository: - removeRepository == _undefined || removeRepository == null - ? _instance.removeRepository - : (removeRepository as Fragment$genericBackupConfigReturn), + backup: backup == _undefined || backup == null + ? _instance.backup + : (backup as Mutation$RemoveRepository$backup), $__typename: $__typename == _undefined || $__typename == null ? _instance.$__typename : ($__typename as String), )); - CopyWith$Fragment$genericBackupConfigReturn get removeRepository { - final local$removeRepository = _instance.removeRepository; - return CopyWith$Fragment$genericBackupConfigReturn( - local$removeRepository, (e) => call(removeRepository: e)); + CopyWith$Mutation$RemoveRepository$backup get backup { + final local$backup = _instance.backup; + return CopyWith$Mutation$RemoveRepository$backup( + local$backup, (e) => call(backup: e)); } } @@ -3637,12 +4106,12 @@ class _CopyWithStubImpl$Mutation$RemoveRepository TRes _res; call({ - Fragment$genericBackupConfigReturn? removeRepository, + Mutation$RemoveRepository$backup? backup, String? $__typename, }) => _res; - CopyWith$Fragment$genericBackupConfigReturn get removeRepository => - CopyWith$Fragment$genericBackupConfigReturn.stub(_res); + CopyWith$Mutation$RemoveRepository$backup get backup => + CopyWith$Mutation$RemoveRepository$backup.stub(_res); } const documentNodeMutationRemoveRepository = DocumentNode(definitions: [ @@ -3653,14 +4122,29 @@ const documentNodeMutationRemoveRepository = DocumentNode(definitions: [ directives: [], selectionSet: SelectionSetNode(selections: [ FieldNode( - name: NameNode(value: 'removeRepository'), + name: NameNode(value: 'backup'), alias: null, arguments: [], directives: [], selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'genericBackupConfigReturn'), + FieldNode( + name: NameNode(value: 'removeRepository'), + alias: null, + arguments: [], directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'genericBackupConfigReturn'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), ), FieldNode( name: NameNode(value: '__typename'), @@ -3777,6 +4261,141 @@ extension ClientExtension$Mutation$RemoveRepository on graphql.GraphQLClient { this.watchMutation(options ?? WatchOptions$Mutation$RemoveRepository()); } +class Mutation$RemoveRepository$backup { + Mutation$RemoveRepository$backup({ + required this.removeRepository, + this.$__typename = 'BackupMutations', + }); + + factory Mutation$RemoveRepository$backup.fromJson(Map json) { + final l$removeRepository = json['removeRepository']; + final l$$__typename = json['__typename']; + return Mutation$RemoveRepository$backup( + removeRepository: Fragment$genericBackupConfigReturn.fromJson( + (l$removeRepository as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Fragment$genericBackupConfigReturn removeRepository; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$removeRepository = removeRepository; + _resultData['removeRepository'] = l$removeRepository.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$removeRepository = removeRepository; + final l$$__typename = $__typename; + return Object.hashAll([ + l$removeRepository, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$RemoveRepository$backup) || + runtimeType != other.runtimeType) { + return false; + } + final l$removeRepository = removeRepository; + final lOther$removeRepository = other.removeRepository; + if (l$removeRepository != lOther$removeRepository) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$RemoveRepository$backup + on Mutation$RemoveRepository$backup { + CopyWith$Mutation$RemoveRepository$backup + get copyWith => CopyWith$Mutation$RemoveRepository$backup( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$RemoveRepository$backup { + factory CopyWith$Mutation$RemoveRepository$backup( + Mutation$RemoveRepository$backup instance, + TRes Function(Mutation$RemoveRepository$backup) then, + ) = _CopyWithImpl$Mutation$RemoveRepository$backup; + + factory CopyWith$Mutation$RemoveRepository$backup.stub(TRes res) = + _CopyWithStubImpl$Mutation$RemoveRepository$backup; + + TRes call({ + Fragment$genericBackupConfigReturn? removeRepository, + String? $__typename, + }); + CopyWith$Fragment$genericBackupConfigReturn get removeRepository; +} + +class _CopyWithImpl$Mutation$RemoveRepository$backup + implements CopyWith$Mutation$RemoveRepository$backup { + _CopyWithImpl$Mutation$RemoveRepository$backup( + this._instance, + this._then, + ); + + final Mutation$RemoveRepository$backup _instance; + + final TRes Function(Mutation$RemoveRepository$backup) _then; + + static const _undefined = {}; + + TRes call({ + Object? removeRepository = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$RemoveRepository$backup( + removeRepository: + removeRepository == _undefined || removeRepository == null + ? _instance.removeRepository + : (removeRepository as Fragment$genericBackupConfigReturn), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Fragment$genericBackupConfigReturn get removeRepository { + final local$removeRepository = _instance.removeRepository; + return CopyWith$Fragment$genericBackupConfigReturn( + local$removeRepository, (e) => call(removeRepository: e)); + } +} + +class _CopyWithStubImpl$Mutation$RemoveRepository$backup + implements CopyWith$Mutation$RemoveRepository$backup { + _CopyWithStubImpl$Mutation$RemoveRepository$backup(this._res); + + TRes _res; + + call({ + Fragment$genericBackupConfigReturn? removeRepository, + String? $__typename, + }) => + _res; + CopyWith$Fragment$genericBackupConfigReturn get removeRepository => + CopyWith$Fragment$genericBackupConfigReturn.stub(_res); +} + class Variables$Mutation$InitializeRepository { factory Variables$Mutation$InitializeRepository( {required Input$InitializeRepositoryInput repository}) => @@ -3880,28 +4499,28 @@ class _CopyWithStubImpl$Variables$Mutation$InitializeRepository class Mutation$InitializeRepository { Mutation$InitializeRepository({ - required this.initializeRepository, + required this.backup, this.$__typename = 'Mutation', }); factory Mutation$InitializeRepository.fromJson(Map json) { - final l$initializeRepository = json['initializeRepository']; + final l$backup = json['backup']; final l$$__typename = json['__typename']; return Mutation$InitializeRepository( - initializeRepository: Fragment$genericBackupConfigReturn.fromJson( - (l$initializeRepository as Map)), + backup: Mutation$InitializeRepository$backup.fromJson( + (l$backup as Map)), $__typename: (l$$__typename as String), ); } - final Fragment$genericBackupConfigReturn initializeRepository; + final Mutation$InitializeRepository$backup backup; final String $__typename; Map toJson() { final _resultData = {}; - final l$initializeRepository = initializeRepository; - _resultData['initializeRepository'] = l$initializeRepository.toJson(); + final l$backup = backup; + _resultData['backup'] = l$backup.toJson(); final l$$__typename = $__typename; _resultData['__typename'] = l$$__typename; return _resultData; @@ -3909,10 +4528,10 @@ class Mutation$InitializeRepository { @override int get hashCode { - final l$initializeRepository = initializeRepository; + final l$backup = backup; final l$$__typename = $__typename; return Object.hashAll([ - l$initializeRepository, + l$backup, l$$__typename, ]); } @@ -3926,9 +4545,9 @@ class Mutation$InitializeRepository { runtimeType != other.runtimeType) { return false; } - final l$initializeRepository = initializeRepository; - final lOther$initializeRepository = other.initializeRepository; - if (l$initializeRepository != lOther$initializeRepository) { + final l$backup = backup; + final lOther$backup = other.backup; + if (l$backup != lOther$backup) { return false; } final l$$__typename = $__typename; @@ -3959,10 +4578,10 @@ abstract class CopyWith$Mutation$InitializeRepository { _CopyWithStubImpl$Mutation$InitializeRepository; TRes call({ - Fragment$genericBackupConfigReturn? initializeRepository, + Mutation$InitializeRepository$backup? backup, String? $__typename, }); - CopyWith$Fragment$genericBackupConfigReturn get initializeRepository; + CopyWith$Mutation$InitializeRepository$backup get backup; } class _CopyWithImpl$Mutation$InitializeRepository @@ -3979,22 +4598,21 @@ class _CopyWithImpl$Mutation$InitializeRepository static const _undefined = {}; TRes call({ - Object? initializeRepository = _undefined, + Object? backup = _undefined, Object? $__typename = _undefined, }) => _then(Mutation$InitializeRepository( - initializeRepository: - initializeRepository == _undefined || initializeRepository == null - ? _instance.initializeRepository - : (initializeRepository as Fragment$genericBackupConfigReturn), + backup: backup == _undefined || backup == null + ? _instance.backup + : (backup as Mutation$InitializeRepository$backup), $__typename: $__typename == _undefined || $__typename == null ? _instance.$__typename : ($__typename as String), )); - CopyWith$Fragment$genericBackupConfigReturn get initializeRepository { - final local$initializeRepository = _instance.initializeRepository; - return CopyWith$Fragment$genericBackupConfigReturn( - local$initializeRepository, (e) => call(initializeRepository: e)); + CopyWith$Mutation$InitializeRepository$backup get backup { + final local$backup = _instance.backup; + return CopyWith$Mutation$InitializeRepository$backup( + local$backup, (e) => call(backup: e)); } } @@ -4005,12 +4623,12 @@ class _CopyWithStubImpl$Mutation$InitializeRepository TRes _res; call({ - Fragment$genericBackupConfigReturn? initializeRepository, + Mutation$InitializeRepository$backup? backup, String? $__typename, }) => _res; - CopyWith$Fragment$genericBackupConfigReturn get initializeRepository => - CopyWith$Fragment$genericBackupConfigReturn.stub(_res); + CopyWith$Mutation$InitializeRepository$backup get backup => + CopyWith$Mutation$InitializeRepository$backup.stub(_res); } const documentNodeMutationInitializeRepository = DocumentNode(definitions: [ @@ -4031,19 +4649,34 @@ const documentNodeMutationInitializeRepository = DocumentNode(definitions: [ directives: [], selectionSet: SelectionSetNode(selections: [ FieldNode( - name: NameNode(value: 'initializeRepository'), + name: NameNode(value: 'backup'), alias: null, - arguments: [ - ArgumentNode( - name: NameNode(value: 'repository'), - value: VariableNode(name: NameNode(value: 'repository')), - ) - ], + arguments: [], directives: [], selectionSet: SelectionSetNode(selections: [ - FragmentSpreadNode( - name: NameNode(value: 'genericBackupConfigReturn'), + FieldNode( + name: NameNode(value: 'initializeRepository'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'repository'), + value: VariableNode(name: NameNode(value: 'repository')), + ) + ], directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'genericBackupConfigReturn'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), ), FieldNode( name: NameNode(value: '__typename'), @@ -4166,3 +4799,140 @@ extension ClientExtension$Mutation$InitializeRepository WatchOptions$Mutation$InitializeRepository options) => this.watchMutation(options); } + +class Mutation$InitializeRepository$backup { + Mutation$InitializeRepository$backup({ + required this.initializeRepository, + this.$__typename = 'BackupMutations', + }); + + factory Mutation$InitializeRepository$backup.fromJson( + Map json) { + final l$initializeRepository = json['initializeRepository']; + final l$$__typename = json['__typename']; + return Mutation$InitializeRepository$backup( + initializeRepository: Fragment$genericBackupConfigReturn.fromJson( + (l$initializeRepository as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Fragment$genericBackupConfigReturn initializeRepository; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$initializeRepository = initializeRepository; + _resultData['initializeRepository'] = l$initializeRepository.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$initializeRepository = initializeRepository; + final l$$__typename = $__typename; + return Object.hashAll([ + l$initializeRepository, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$InitializeRepository$backup) || + runtimeType != other.runtimeType) { + return false; + } + final l$initializeRepository = initializeRepository; + final lOther$initializeRepository = other.initializeRepository; + if (l$initializeRepository != lOther$initializeRepository) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$InitializeRepository$backup + on Mutation$InitializeRepository$backup { + CopyWith$Mutation$InitializeRepository$backup< + Mutation$InitializeRepository$backup> + get copyWith => CopyWith$Mutation$InitializeRepository$backup( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$InitializeRepository$backup { + factory CopyWith$Mutation$InitializeRepository$backup( + Mutation$InitializeRepository$backup instance, + TRes Function(Mutation$InitializeRepository$backup) then, + ) = _CopyWithImpl$Mutation$InitializeRepository$backup; + + factory CopyWith$Mutation$InitializeRepository$backup.stub(TRes res) = + _CopyWithStubImpl$Mutation$InitializeRepository$backup; + + TRes call({ + Fragment$genericBackupConfigReturn? initializeRepository, + String? $__typename, + }); + CopyWith$Fragment$genericBackupConfigReturn get initializeRepository; +} + +class _CopyWithImpl$Mutation$InitializeRepository$backup + implements CopyWith$Mutation$InitializeRepository$backup { + _CopyWithImpl$Mutation$InitializeRepository$backup( + this._instance, + this._then, + ); + + final Mutation$InitializeRepository$backup _instance; + + final TRes Function(Mutation$InitializeRepository$backup) _then; + + static const _undefined = {}; + + TRes call({ + Object? initializeRepository = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$InitializeRepository$backup( + initializeRepository: + initializeRepository == _undefined || initializeRepository == null + ? _instance.initializeRepository + : (initializeRepository as Fragment$genericBackupConfigReturn), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Fragment$genericBackupConfigReturn get initializeRepository { + final local$initializeRepository = _instance.initializeRepository; + return CopyWith$Fragment$genericBackupConfigReturn( + local$initializeRepository, (e) => call(initializeRepository: e)); + } +} + +class _CopyWithStubImpl$Mutation$InitializeRepository$backup + implements CopyWith$Mutation$InitializeRepository$backup { + _CopyWithStubImpl$Mutation$InitializeRepository$backup(this._res); + + TRes _res; + + call({ + Fragment$genericBackupConfigReturn? initializeRepository, + String? $__typename, + }) => + _res; + CopyWith$Fragment$genericBackupConfigReturn get initializeRepository => + CopyWith$Fragment$genericBackupConfigReturn.stub(_res); +} diff --git a/lib/logic/api_maps/graphql_maps/schema/schema.graphql b/lib/logic/api_maps/graphql_maps/schema/schema.graphql index 2c699c54..15ae463d 100644 --- a/lib/logic/api_maps/graphql_maps/schema/schema.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/schema.graphql @@ -38,6 +38,16 @@ type ApiKeyMutationReturn implements MutationReturnInterface { key: String } +type ApiMutations { + getNewRecoveryApiKey(limits: RecoveryKeyLimitsInput = null): ApiKeyMutationReturn! + useRecoveryApiKey(input: UseRecoveryKeyInput!): DeviceApiTokenMutationReturn! + refreshDeviceApiToken: DeviceApiTokenMutationReturn! + deleteDeviceApiToken(device: String!): GenericMutationReturn! + getNewDeviceApiKey: ApiKeyMutationReturn! + invalidateNewDeviceApiKey: GenericMutationReturn! + authorizeWithNewDeviceApiKey(input: UseNewDeviceKeyInput!): DeviceApiTokenMutationReturn! +} + type ApiRecoveryKeyStatus { exists: Boolean! valid: Boolean! @@ -78,6 +88,15 @@ type BackupConfiguration { locationId: String } +type BackupMutations { + initializeRepository(repository: InitializeRepositoryInput!): GenericBackupConfigReturn! + removeRepository: GenericBackupConfigReturn! + setAutobackupPeriod(period: Int = null): GenericBackupConfigReturn! + startBackup(serviceId: String!): GenericJobMutationReturn! + restoreBackup(snapshotId: String!): GenericJobMutationReturn! + forceSnapshotsReload: GenericMutationReturn! +} + enum BackupProvider { BACKBLAZE NONE @@ -96,9 +115,9 @@ type DeviceApiTokenMutationReturn implements MutationReturnInterface { } enum DnsProvider { - CLOUDFLARE, - DESEC, + CLOUDFLARE DIGITALOCEAN + DESEC } type DnsRecord { @@ -142,6 +161,10 @@ type Job { getJob(jobId: String!): ApiJob } +type JobMutations { + removeJob(jobId: String!): GenericMutationReturn! +} + input MigrateToBindsInput { emailBlockDevice: String! bitwardenBlockDevice: String! @@ -156,42 +179,43 @@ input MoveServiceInput { } type Mutation { - getNewRecoveryApiKey(limits: RecoveryKeyLimitsInput = null): ApiKeyMutationReturn! - useRecoveryApiKey(input: UseRecoveryKeyInput!): DeviceApiTokenMutationReturn! - refreshDeviceApiToken: DeviceApiTokenMutationReturn! - deleteDeviceApiToken(device: String!): GenericMutationReturn! - getNewDeviceApiKey: ApiKeyMutationReturn! - invalidateNewDeviceApiKey: GenericMutationReturn! - authorizeWithNewDeviceApiKey(input: UseNewDeviceKeyInput!): DeviceApiTokenMutationReturn! - changeTimezone(timezone: String!): TimezoneMutationReturn! - changeAutoUpgradeSettings(settings: AutoUpgradeSettingsInput!): AutoUpgradeSettingsMutationReturn! - runSystemRebuild: GenericMutationReturn! - runSystemRollback: GenericMutationReturn! - runSystemUpgrade: GenericMutationReturn! - rebootSystem: GenericMutationReturn! - pullRepositoryChanges: GenericMutationReturn! - createUser(user: UserMutationInput!): UserMutationReturn! - deleteUser(username: String!): GenericMutationReturn! - updateUser(user: UserMutationInput!): UserMutationReturn! - addSshKey(sshInput: SshMutationInput!): UserMutationReturn! - removeSshKey(sshInput: SshMutationInput!): UserMutationReturn! - resizeVolume(name: String!): GenericMutationReturn! - mountVolume(name: String!): GenericMutationReturn! - unmountVolume(name: String!): GenericMutationReturn! - migrateToBinds(input: MigrateToBindsInput!): GenericJobMutationReturn! - enableService(serviceId: String!): ServiceMutationReturn! - disableService(serviceId: String!): ServiceMutationReturn! - stopService(serviceId: String!): ServiceMutationReturn! - startService(serviceId: String!): ServiceMutationReturn! - restartService(serviceId: String!): ServiceMutationReturn! - moveService(input: MoveServiceInput!): ServiceJobMutationReturn! - removeJob(jobId: String!): GenericMutationReturn! - initializeRepository(repository: InitializeRepositoryInput!): GenericBackupConfigReturn! - removeRepository: GenericBackupConfigReturn! - setAutobackupPeriod(period: Int = null): GenericBackupConfigReturn! - startBackup(serviceId: String = null): GenericJobMutationReturn! - restoreBackup(snapshotId: String!): GenericJobMutationReturn! - forceSnapshotsReload: GenericMutationReturn! + getNewRecoveryApiKey(limits: RecoveryKeyLimitsInput = null): ApiKeyMutationReturn! @deprecated(reason: "Use `api.get_new_recovery_api_key` instead") + useRecoveryApiKey(input: UseRecoveryKeyInput!): DeviceApiTokenMutationReturn! @deprecated(reason: "Use `api.use_recovery_api_key` instead") + refreshDeviceApiToken: DeviceApiTokenMutationReturn! @deprecated(reason: "Use `api.refresh_device_api_token` instead") + deleteDeviceApiToken(device: String!): GenericMutationReturn! @deprecated(reason: "Use `api.delete_device_api_token` instead") + getNewDeviceApiKey: ApiKeyMutationReturn! @deprecated(reason: "Use `api.get_new_device_api_key` instead") + invalidateNewDeviceApiKey: GenericMutationReturn! @deprecated(reason: "Use `api.invalidate_new_device_api_key` instead") + authorizeWithNewDeviceApiKey(input: UseNewDeviceKeyInput!): DeviceApiTokenMutationReturn! @deprecated(reason: "Use `api.authorize_with_new_device_api_key` instead") + changeTimezone(timezone: String!): TimezoneMutationReturn! @deprecated(reason: "Use `system.change_timezone` instead") + changeAutoUpgradeSettings(settings: AutoUpgradeSettingsInput!): AutoUpgradeSettingsMutationReturn! @deprecated(reason: "Use `system.change_auto_upgrade_settings` instead") + runSystemRebuild: GenericMutationReturn! @deprecated(reason: "Use `system.run_system_rebuild` instead") + runSystemRollback: GenericMutationReturn! @deprecated(reason: "Use `system.run_system_rollback` instead") + runSystemUpgrade: GenericMutationReturn! @deprecated(reason: "Use `system.run_system_upgrade` instead") + rebootSystem: GenericMutationReturn! @deprecated(reason: "Use `system.reboot_system` instead") + pullRepositoryChanges: GenericMutationReturn! @deprecated(reason: "Use `system.pull_repository_changes` instead") + createUser(user: UserMutationInput!): UserMutationReturn! @deprecated(reason: "Use `users.create_user` instead") + deleteUser(username: String!): GenericMutationReturn! @deprecated(reason: "Use `users.delete_user` instead") + updateUser(user: UserMutationInput!): UserMutationReturn! @deprecated(reason: "Use `users.update_user` instead") + addSshKey(sshInput: SshMutationInput!): UserMutationReturn! @deprecated(reason: "Use `users.add_ssh_key` instead") + removeSshKey(sshInput: SshMutationInput!): UserMutationReturn! @deprecated(reason: "Use `users.remove_ssh_key` instead") + resizeVolume(name: String!): GenericMutationReturn! @deprecated(reason: "Use `storage.resize_volume` instead") + mountVolume(name: String!): GenericMutationReturn! @deprecated(reason: "Use `storage.mount_volume` instead") + unmountVolume(name: String!): GenericMutationReturn! @deprecated(reason: "Use `storage.unmount_volume` instead") + migrateToBinds(input: MigrateToBindsInput!): GenericJobMutationReturn! @deprecated(reason: "Use `storage.migrate_to_binds` instead") + enableService(serviceId: String!): ServiceMutationReturn! @deprecated(reason: "Use `services.enable_service` instead") + disableService(serviceId: String!): ServiceMutationReturn! @deprecated(reason: "Use `services.disable_service` instead") + stopService(serviceId: String!): ServiceMutationReturn! @deprecated(reason: "Use `services.stop_service` instead") + startService(serviceId: String!): ServiceMutationReturn! @deprecated(reason: "Use `services.start_service` instead") + restartService(serviceId: String!): ServiceMutationReturn! @deprecated(reason: "Use `services.restart_service` instead") + moveService(input: MoveServiceInput!): ServiceJobMutationReturn! @deprecated(reason: "Use `services.move_service` instead") + removeJob(jobId: String!): GenericMutationReturn! @deprecated(reason: "Use `jobs.remove_job` instead") + api: ApiMutations! + system: SystemMutations! + users: UsersMutations! + storage: StorageMutations! + services: ServicesMutations! + jobs: JobMutations! + backup: BackupMutations! testMutation: GenericMutationReturn! } @@ -202,8 +226,8 @@ interface MutationReturnInterface { } type Query { - system: System! api: Api! + system: System! users: Users! storage: Storage! jobs: Job! @@ -272,6 +296,15 @@ type Services { allServices: [Service!]! } +type ServicesMutations { + enableService(serviceId: String!): ServiceMutationReturn! + disableService(serviceId: String!): ServiceMutationReturn! + stopService(serviceId: String!): ServiceMutationReturn! + startService(serviceId: String!): ServiceMutationReturn! + restartService(serviceId: String!): ServiceMutationReturn! + moveService(input: MoveServiceInput!): ServiceJobMutationReturn! +} + enum Severity { INFO WARNING @@ -301,6 +334,13 @@ type Storage { volumes: [StorageVolume!]! } +type StorageMutations { + resizeVolume(name: String!): GenericMutationReturn! + mountVolume(name: String!): GenericMutationReturn! + unmountVolume(name: String!): GenericMutationReturn! + migrateToBinds(input: MigrateToBindsInput!): GenericJobMutationReturn! +} + interface StorageUsageInterface { usedSpace: String! volume: StorageVolume @@ -346,6 +386,16 @@ type SystemInfo { usingBinds: Boolean! } +type SystemMutations { + changeTimezone(timezone: String!): TimezoneMutationReturn! + changeAutoUpgradeSettings(settings: AutoUpgradeSettingsInput!): AutoUpgradeSettingsMutationReturn! + runSystemRebuild: GenericMutationReturn! + runSystemRollback: GenericMutationReturn! + runSystemUpgrade: GenericMutationReturn! + rebootSystem: GenericMutationReturn! + pullRepositoryChanges: GenericMutationReturn! +} + type SystemProviderInfo { provider: ServerProvider! id: String! @@ -403,15 +453,10 @@ type Users { getUser(username: String!): User } -fragment dnsRecordFields on DnsRecord { - content - name - priority - recordType - ttl -} - -fragment backupSnapshotFields on SnapshotInfo { - id - createdAt +type UsersMutations { + createUser(user: UserMutationInput!): UserMutationReturn! + deleteUser(username: String!): GenericMutationReturn! + updateUser(user: UserMutationInput!): UserMutationReturn! + addSshKey(sshInput: SshMutationInput!): UserMutationReturn! + removeSshKey(sshInput: SshMutationInput!): UserMutationReturn! } diff --git a/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart index 0efab17a..e92ecc5e 100644 --- a/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart @@ -1,5 +1,3 @@ -import 'package:gql/ast.dart'; -import 'package:graphql/client.dart' as graphql; import 'package:selfprivacy/utils/scalars.dart'; class Input$AutoUpgradeSettingsInput { @@ -1312,16 +1310,16 @@ Enum$BackupProvider fromJson$Enum$BackupProvider(String value) { } } -enum Enum$DnsProvider { CLOUDFLARE, DESEC, DIGITALOCEAN, $unknown } +enum Enum$DnsProvider { CLOUDFLARE, DIGITALOCEAN, DESEC, $unknown } String toJson$Enum$DnsProvider(Enum$DnsProvider e) { switch (e) { case Enum$DnsProvider.CLOUDFLARE: return r'CLOUDFLARE'; - case Enum$DnsProvider.DESEC: - return r'DESEC'; case Enum$DnsProvider.DIGITALOCEAN: return r'DIGITALOCEAN'; + case Enum$DnsProvider.DESEC: + return r'DESEC'; case Enum$DnsProvider.$unknown: return r'$unknown'; } @@ -1331,10 +1329,10 @@ Enum$DnsProvider fromJson$Enum$DnsProvider(String value) { switch (value) { case r'CLOUDFLARE': return Enum$DnsProvider.CLOUDFLARE; - case r'DESEC': - return Enum$DnsProvider.DESEC; case r'DIGITALOCEAN': return Enum$DnsProvider.DIGITALOCEAN; + case r'DESEC': + return Enum$DnsProvider.DESEC; default: return Enum$DnsProvider.$unknown; } @@ -1481,517 +1479,6 @@ Enum$UserType fromJson$Enum$UserType(String value) { } } -class Fragment$dnsRecordFields { - Fragment$dnsRecordFields({ - required this.content, - required this.name, - this.priority, - required this.recordType, - required this.ttl, - this.$__typename = 'DnsRecord', - }); - - factory Fragment$dnsRecordFields.fromJson(Map json) { - final l$content = json['content']; - final l$name = json['name']; - final l$priority = json['priority']; - final l$recordType = json['recordType']; - final l$ttl = json['ttl']; - final l$$__typename = json['__typename']; - return Fragment$dnsRecordFields( - content: (l$content as String), - name: (l$name as String), - priority: (l$priority as int?), - recordType: (l$recordType as String), - ttl: (l$ttl as int), - $__typename: (l$$__typename as String), - ); - } - - final String content; - - final String name; - - final int? priority; - - final String recordType; - - final int ttl; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$content = content; - _resultData['content'] = l$content; - final l$name = name; - _resultData['name'] = l$name; - final l$priority = priority; - _resultData['priority'] = l$priority; - final l$recordType = recordType; - _resultData['recordType'] = l$recordType; - final l$ttl = ttl; - _resultData['ttl'] = l$ttl; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$content = content; - final l$name = name; - final l$priority = priority; - final l$recordType = recordType; - final l$ttl = ttl; - final l$$__typename = $__typename; - return Object.hashAll([ - l$content, - l$name, - l$priority, - l$recordType, - l$ttl, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$dnsRecordFields) || - runtimeType != other.runtimeType) { - return false; - } - final l$content = content; - final lOther$content = other.content; - if (l$content != lOther$content) { - return false; - } - final l$name = name; - final lOther$name = other.name; - if (l$name != lOther$name) { - return false; - } - final l$priority = priority; - final lOther$priority = other.priority; - if (l$priority != lOther$priority) { - return false; - } - final l$recordType = recordType; - final lOther$recordType = other.recordType; - if (l$recordType != lOther$recordType) { - return false; - } - final l$ttl = ttl; - final lOther$ttl = other.ttl; - if (l$ttl != lOther$ttl) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$dnsRecordFields - on Fragment$dnsRecordFields { - CopyWith$Fragment$dnsRecordFields get copyWith => - CopyWith$Fragment$dnsRecordFields( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$dnsRecordFields { - factory CopyWith$Fragment$dnsRecordFields( - Fragment$dnsRecordFields instance, - TRes Function(Fragment$dnsRecordFields) then, - ) = _CopyWithImpl$Fragment$dnsRecordFields; - - factory CopyWith$Fragment$dnsRecordFields.stub(TRes res) = - _CopyWithStubImpl$Fragment$dnsRecordFields; - - TRes call({ - String? content, - String? name, - int? priority, - String? recordType, - int? ttl, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$dnsRecordFields - implements CopyWith$Fragment$dnsRecordFields { - _CopyWithImpl$Fragment$dnsRecordFields( - this._instance, - this._then, - ); - - final Fragment$dnsRecordFields _instance; - - final TRes Function(Fragment$dnsRecordFields) _then; - - static const _undefined = {}; - - TRes call({ - Object? content = _undefined, - Object? name = _undefined, - Object? priority = _undefined, - Object? recordType = _undefined, - Object? ttl = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$dnsRecordFields( - content: content == _undefined || content == null - ? _instance.content - : (content as String), - name: name == _undefined || name == null - ? _instance.name - : (name as String), - priority: - priority == _undefined ? _instance.priority : (priority as int?), - recordType: recordType == _undefined || recordType == null - ? _instance.recordType - : (recordType as String), - ttl: ttl == _undefined || ttl == null ? _instance.ttl : (ttl as int), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$dnsRecordFields - implements CopyWith$Fragment$dnsRecordFields { - _CopyWithStubImpl$Fragment$dnsRecordFields(this._res); - - TRes _res; - - call({ - String? content, - String? name, - int? priority, - String? recordType, - int? ttl, - String? $__typename, - }) => - _res; -} - -const fragmentDefinitiondnsRecordFields = FragmentDefinitionNode( - name: NameNode(value: 'dnsRecordFields'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'DnsRecord'), - isNonNull: false, - )), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'content'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'priority'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'recordType'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'ttl'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: '__typename'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - ]), -); -const documentNodeFragmentdnsRecordFields = DocumentNode(definitions: [ - fragmentDefinitiondnsRecordFields, -]); - -extension ClientExtension$Fragment$dnsRecordFields on graphql.GraphQLClient { - void writeFragment$dnsRecordFields({ - required Fragment$dnsRecordFields data, - required Map idFields, - bool broadcast = true, - }) => - this.writeFragment( - graphql.FragmentRequest( - idFields: idFields, - fragment: const graphql.Fragment( - fragmentName: 'dnsRecordFields', - document: documentNodeFragmentdnsRecordFields, - ), - ), - data: data.toJson(), - broadcast: broadcast, - ); - Fragment$dnsRecordFields? readFragment$dnsRecordFields({ - required Map idFields, - bool optimistic = true, - }) { - final result = this.readFragment( - graphql.FragmentRequest( - idFields: idFields, - fragment: const graphql.Fragment( - fragmentName: 'dnsRecordFields', - document: documentNodeFragmentdnsRecordFields, - ), - ), - optimistic: optimistic, - ); - return result == null ? null : Fragment$dnsRecordFields.fromJson(result); - } -} - -class Fragment$backupSnapshotFields { - Fragment$backupSnapshotFields({ - required this.id, - required this.createdAt, - this.$__typename = 'SnapshotInfo', - }); - - factory Fragment$backupSnapshotFields.fromJson(Map json) { - final l$id = json['id']; - final l$createdAt = json['createdAt']; - final l$$__typename = json['__typename']; - return Fragment$backupSnapshotFields( - id: (l$id as String), - createdAt: dateTimeFromJson(l$createdAt), - $__typename: (l$$__typename as String), - ); - } - - final String id; - - final DateTime createdAt; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$id = id; - _resultData['id'] = l$id; - final l$createdAt = createdAt; - _resultData['createdAt'] = dateTimeToJson(l$createdAt); - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$id = id; - final l$createdAt = createdAt; - final l$$__typename = $__typename; - return Object.hashAll([ - l$id, - l$createdAt, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$backupSnapshotFields) || - runtimeType != other.runtimeType) { - return false; - } - final l$id = id; - final lOther$id = other.id; - if (l$id != lOther$id) { - return false; - } - final l$createdAt = createdAt; - final lOther$createdAt = other.createdAt; - if (l$createdAt != lOther$createdAt) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$backupSnapshotFields - on Fragment$backupSnapshotFields { - CopyWith$Fragment$backupSnapshotFields - get copyWith => CopyWith$Fragment$backupSnapshotFields( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$backupSnapshotFields { - factory CopyWith$Fragment$backupSnapshotFields( - Fragment$backupSnapshotFields instance, - TRes Function(Fragment$backupSnapshotFields) then, - ) = _CopyWithImpl$Fragment$backupSnapshotFields; - - factory CopyWith$Fragment$backupSnapshotFields.stub(TRes res) = - _CopyWithStubImpl$Fragment$backupSnapshotFields; - - TRes call({ - String? id, - DateTime? createdAt, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$backupSnapshotFields - implements CopyWith$Fragment$backupSnapshotFields { - _CopyWithImpl$Fragment$backupSnapshotFields( - this._instance, - this._then, - ); - - final Fragment$backupSnapshotFields _instance; - - final TRes Function(Fragment$backupSnapshotFields) _then; - - static const _undefined = {}; - - TRes call({ - Object? id = _undefined, - Object? createdAt = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$backupSnapshotFields( - id: id == _undefined || id == null ? _instance.id : (id as String), - createdAt: createdAt == _undefined || createdAt == null - ? _instance.createdAt - : (createdAt as DateTime), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$backupSnapshotFields - implements CopyWith$Fragment$backupSnapshotFields { - _CopyWithStubImpl$Fragment$backupSnapshotFields(this._res); - - TRes _res; - - call({ - String? id, - DateTime? createdAt, - String? $__typename, - }) => - _res; -} - -const fragmentDefinitionbackupSnapshotFields = FragmentDefinitionNode( - name: NameNode(value: 'backupSnapshotFields'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'SnapshotInfo'), - isNonNull: false, - )), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'createdAt'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: '__typename'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - ]), -); -const documentNodeFragmentbackupSnapshotFields = DocumentNode(definitions: [ - fragmentDefinitionbackupSnapshotFields, -]); - -extension ClientExtension$Fragment$backupSnapshotFields - on graphql.GraphQLClient { - void writeFragment$backupSnapshotFields({ - required Fragment$backupSnapshotFields data, - required Map idFields, - bool broadcast = true, - }) => - this.writeFragment( - graphql.FragmentRequest( - idFields: idFields, - fragment: const graphql.Fragment( - fragmentName: 'backupSnapshotFields', - document: documentNodeFragmentbackupSnapshotFields, - ), - ), - data: data.toJson(), - broadcast: broadcast, - ); - Fragment$backupSnapshotFields? readFragment$backupSnapshotFields({ - required Map idFields, - bool optimistic = true, - }) { - final result = this.readFragment( - graphql.FragmentRequest( - idFields: idFields, - fragment: const graphql.Fragment( - fragmentName: 'backupSnapshotFields', - document: documentNodeFragmentbackupSnapshotFields, - ), - ), - optimistic: optimistic, - ); - return result == null - ? null - : Fragment$backupSnapshotFields.fromJson(result); - } -} - const possibleTypesMap = >{ 'MutationReturnInterface': { 'ApiKeyMutationReturn', diff --git a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql index 83e5f06e..a33a5fef 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql @@ -28,6 +28,14 @@ query SystemIsUsingBinds { } } +fragment fragmentDnsRecords on DnsRecord { + recordType + name + content + ttl + priority +} + query DomainInfo { system { domainInfo { @@ -35,7 +43,7 @@ query DomainInfo { hostname provider requiredDnsRecords { - ...dnsRecordFields + ...fragmentDnsRecords } } } diff --git a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart index 59bd5fdd..abbba037 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart @@ -2282,6 +2282,300 @@ class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$UserMutationReturn< _res; } +class Fragment$fragmentDnsRecords { + Fragment$fragmentDnsRecords({ + required this.recordType, + required this.name, + required this.content, + required this.ttl, + this.priority, + this.$__typename = 'DnsRecord', + }); + + factory Fragment$fragmentDnsRecords.fromJson(Map json) { + final l$recordType = json['recordType']; + final l$name = json['name']; + final l$content = json['content']; + final l$ttl = json['ttl']; + final l$priority = json['priority']; + final l$$__typename = json['__typename']; + return Fragment$fragmentDnsRecords( + recordType: (l$recordType as String), + name: (l$name as String), + content: (l$content as String), + ttl: (l$ttl as int), + priority: (l$priority as int?), + $__typename: (l$$__typename as String), + ); + } + + final String recordType; + + final String name; + + final String content; + + final int ttl; + + final int? priority; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$recordType = recordType; + _resultData['recordType'] = l$recordType; + final l$name = name; + _resultData['name'] = l$name; + final l$content = content; + _resultData['content'] = l$content; + final l$ttl = ttl; + _resultData['ttl'] = l$ttl; + final l$priority = priority; + _resultData['priority'] = l$priority; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$recordType = recordType; + final l$name = name; + final l$content = content; + final l$ttl = ttl; + final l$priority = priority; + final l$$__typename = $__typename; + return Object.hashAll([ + l$recordType, + l$name, + l$content, + l$ttl, + l$priority, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Fragment$fragmentDnsRecords) || + runtimeType != other.runtimeType) { + return false; + } + final l$recordType = recordType; + final lOther$recordType = other.recordType; + if (l$recordType != lOther$recordType) { + return false; + } + final l$name = name; + final lOther$name = other.name; + if (l$name != lOther$name) { + return false; + } + final l$content = content; + final lOther$content = other.content; + if (l$content != lOther$content) { + return false; + } + final l$ttl = ttl; + final lOther$ttl = other.ttl; + if (l$ttl != lOther$ttl) { + return false; + } + final l$priority = priority; + final lOther$priority = other.priority; + if (l$priority != lOther$priority) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$fragmentDnsRecords + on Fragment$fragmentDnsRecords { + CopyWith$Fragment$fragmentDnsRecords + get copyWith => CopyWith$Fragment$fragmentDnsRecords( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$fragmentDnsRecords { + factory CopyWith$Fragment$fragmentDnsRecords( + Fragment$fragmentDnsRecords instance, + TRes Function(Fragment$fragmentDnsRecords) then, + ) = _CopyWithImpl$Fragment$fragmentDnsRecords; + + factory CopyWith$Fragment$fragmentDnsRecords.stub(TRes res) = + _CopyWithStubImpl$Fragment$fragmentDnsRecords; + + TRes call({ + String? recordType, + String? name, + String? content, + int? ttl, + int? priority, + String? $__typename, + }); +} + +class _CopyWithImpl$Fragment$fragmentDnsRecords + implements CopyWith$Fragment$fragmentDnsRecords { + _CopyWithImpl$Fragment$fragmentDnsRecords( + this._instance, + this._then, + ); + + final Fragment$fragmentDnsRecords _instance; + + final TRes Function(Fragment$fragmentDnsRecords) _then; + + static const _undefined = {}; + + TRes call({ + Object? recordType = _undefined, + Object? name = _undefined, + Object? content = _undefined, + Object? ttl = _undefined, + Object? priority = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$fragmentDnsRecords( + recordType: recordType == _undefined || recordType == null + ? _instance.recordType + : (recordType as String), + name: name == _undefined || name == null + ? _instance.name + : (name as String), + content: content == _undefined || content == null + ? _instance.content + : (content as String), + ttl: ttl == _undefined || ttl == null ? _instance.ttl : (ttl as int), + priority: + priority == _undefined ? _instance.priority : (priority as int?), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Fragment$fragmentDnsRecords + implements CopyWith$Fragment$fragmentDnsRecords { + _CopyWithStubImpl$Fragment$fragmentDnsRecords(this._res); + + TRes _res; + + call({ + String? recordType, + String? name, + String? content, + int? ttl, + int? priority, + String? $__typename, + }) => + _res; +} + +const fragmentDefinitionfragmentDnsRecords = FragmentDefinitionNode( + name: NameNode(value: 'fragmentDnsRecords'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'DnsRecord'), + isNonNull: false, + )), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'recordType'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'content'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'ttl'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'priority'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), +); +const documentNodeFragmentfragmentDnsRecords = DocumentNode(definitions: [ + fragmentDefinitionfragmentDnsRecords, +]); + +extension ClientExtension$Fragment$fragmentDnsRecords on graphql.GraphQLClient { + void writeFragment$fragmentDnsRecords({ + required Fragment$fragmentDnsRecords data, + required Map idFields, + bool broadcast = true, + }) => + this.writeFragment( + graphql.FragmentRequest( + idFields: idFields, + fragment: const graphql.Fragment( + fragmentName: 'fragmentDnsRecords', + document: documentNodeFragmentfragmentDnsRecords, + ), + ), + data: data.toJson(), + broadcast: broadcast, + ); + Fragment$fragmentDnsRecords? readFragment$fragmentDnsRecords({ + required Map idFields, + bool optimistic = true, + }) { + final result = this.readFragment( + graphql.FragmentRequest( + idFields: idFields, + fragment: const graphql.Fragment( + fragmentName: 'fragmentDnsRecords', + document: documentNodeFragmentfragmentDnsRecords, + ), + ), + optimistic: optimistic, + ); + return result == null ? null : Fragment$fragmentDnsRecords.fromJson(result); + } +} + class Query$SystemSettings { Query$SystemSettings({ required this.system, @@ -4019,7 +4313,7 @@ const documentNodeQueryDomainInfo = DocumentNode(definitions: [ directives: [], selectionSet: SelectionSetNode(selections: [ FragmentSpreadNode( - name: NameNode(value: 'dnsRecordFields'), + name: NameNode(value: 'fragmentDnsRecords'), directives: [], ), FieldNode( @@ -4058,7 +4352,7 @@ const documentNodeQueryDomainInfo = DocumentNode(definitions: [ ), ]), ), - fragmentDefinitiondnsRecordFields, + fragmentDefinitionfragmentDnsRecords, ]); Query$DomainInfo _parserFn$Query$DomainInfo(Map data) => Query$DomainInfo.fromJson(data); @@ -4331,7 +4625,7 @@ class Query$DomainInfo$system$domainInfo { provider: fromJson$Enum$DnsProvider((l$provider as String)), requiredDnsRecords: (l$requiredDnsRecords as List) .map((e) => - Fragment$dnsRecordFields.fromJson((e as Map))) + Fragment$fragmentDnsRecords.fromJson((e as Map))) .toList(), $__typename: (l$$__typename as String), ); @@ -4343,7 +4637,7 @@ class Query$DomainInfo$system$domainInfo { final Enum$DnsProvider provider; - final List requiredDnsRecords; + final List requiredDnsRecords; final String $__typename; @@ -4447,13 +4741,14 @@ abstract class CopyWith$Query$DomainInfo$system$domainInfo { String? domain, String? hostname, Enum$DnsProvider? provider, - List? requiredDnsRecords, + List? requiredDnsRecords, String? $__typename, }); TRes requiredDnsRecords( - Iterable Function( + Iterable Function( Iterable< - CopyWith$Fragment$dnsRecordFields>) + CopyWith$Fragment$fragmentDnsRecords< + Fragment$fragmentDnsRecords>>) _fn); } @@ -4490,20 +4785,20 @@ class _CopyWithImpl$Query$DomainInfo$system$domainInfo requiredDnsRecords: requiredDnsRecords == _undefined || requiredDnsRecords == null ? _instance.requiredDnsRecords - : (requiredDnsRecords as List), + : (requiredDnsRecords as List), $__typename: $__typename == _undefined || $__typename == null ? _instance.$__typename : ($__typename as String), )); TRes requiredDnsRecords( - Iterable Function( + Iterable Function( Iterable< - CopyWith$Fragment$dnsRecordFields< - Fragment$dnsRecordFields>>) + CopyWith$Fragment$fragmentDnsRecords< + Fragment$fragmentDnsRecords>>) _fn) => call( requiredDnsRecords: _fn(_instance.requiredDnsRecords - .map((e) => CopyWith$Fragment$dnsRecordFields( + .map((e) => CopyWith$Fragment$fragmentDnsRecords( e, (i) => i, ))).toList()); @@ -4519,7 +4814,7 @@ class _CopyWithStubImpl$Query$DomainInfo$system$domainInfo String? domain, String? hostname, Enum$DnsProvider? provider, - List? requiredDnsRecords, + List? requiredDnsRecords, String? $__typename, }) => _res; diff --git a/lib/logic/api_maps/graphql_maps/schema/services.graphql b/lib/logic/api_maps/graphql_maps/schema/services.graphql index 7998e5c0..9299ff7b 100644 --- a/lib/logic/api_maps/graphql_maps/schema/services.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/services.graphql @@ -10,7 +10,7 @@ query AllServices { description displayName dnsRecords { - ...dnsRecordFields + ...fragmentDnsRecords } id isEnabled diff --git a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart index 04eaaef9..64720f3e 100644 --- a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart @@ -3,6 +3,7 @@ import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'package:selfprivacy/utils/scalars.dart'; import 'schema.graphql.dart'; +import 'server_settings.graphql.dart'; class Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields({ @@ -2454,7 +2455,7 @@ const documentNodeQueryAllServices = DocumentNode(definitions: [ directives: [], selectionSet: SelectionSetNode(selections: [ FragmentSpreadNode( - name: NameNode(value: 'dnsRecordFields'), + name: NameNode(value: 'fragmentDnsRecords'), directives: [], ), FieldNode( @@ -2593,7 +2594,7 @@ const documentNodeQueryAllServices = DocumentNode(definitions: [ ), ]), ), - fragmentDefinitiondnsRecordFields, + fragmentDefinitionfragmentDnsRecords, ]); Query$AllServices _parserFn$Query$AllServices(Map data) => Query$AllServices.fromJson(data); @@ -2901,7 +2902,7 @@ class Query$AllServices$services$allServices { displayName: (l$displayName as String), dnsRecords: (l$dnsRecords as List?) ?.map((e) => - Fragment$dnsRecordFields.fromJson((e as Map))) + Fragment$fragmentDnsRecords.fromJson((e as Map))) .toList(), id: (l$id as String), isEnabled: (l$isEnabled as bool), @@ -2921,7 +2922,7 @@ class Query$AllServices$services$allServices { final String displayName; - final List? dnsRecords; + final List? dnsRecords; final String id; @@ -3106,7 +3107,7 @@ abstract class CopyWith$Query$AllServices$services$allServices { TRes call({ String? description, String? displayName, - List? dnsRecords, + List? dnsRecords, String? id, bool? isEnabled, bool? isMovable, @@ -3118,9 +3119,10 @@ abstract class CopyWith$Query$AllServices$services$allServices { String? $__typename, }); TRes dnsRecords( - Iterable? Function( + Iterable? Function( Iterable< - CopyWith$Fragment$dnsRecordFields>?) + CopyWith$Fragment$fragmentDnsRecords< + Fragment$fragmentDnsRecords>>?) _fn); CopyWith$Query$AllServices$services$allServices$storageUsage get storageUsage; @@ -3162,7 +3164,7 @@ class _CopyWithImpl$Query$AllServices$services$allServices : (displayName as String), dnsRecords: dnsRecords == _undefined ? _instance.dnsRecords - : (dnsRecords as List?), + : (dnsRecords as List?), id: id == _undefined || id == null ? _instance.id : (id as String), isEnabled: isEnabled == _undefined || isEnabled == null ? _instance.isEnabled @@ -3189,14 +3191,14 @@ class _CopyWithImpl$Query$AllServices$services$allServices : ($__typename as String), )); TRes dnsRecords( - Iterable? Function( + Iterable? Function( Iterable< - CopyWith$Fragment$dnsRecordFields< - Fragment$dnsRecordFields>>?) + CopyWith$Fragment$fragmentDnsRecords< + Fragment$fragmentDnsRecords>>?) _fn) => call( dnsRecords: _fn(_instance.dnsRecords - ?.map((e) => CopyWith$Fragment$dnsRecordFields( + ?.map((e) => CopyWith$Fragment$fragmentDnsRecords( e, (i) => i, )))?.toList()); @@ -3217,7 +3219,7 @@ class _CopyWithStubImpl$Query$AllServices$services$allServices call({ String? description, String? displayName, - List? dnsRecords, + List? dnsRecords, String? id, bool? isEnabled, bool? isMovable, diff --git a/lib/logic/api_maps/graphql_maps/server_api/server_api.dart b/lib/logic/api_maps/graphql_maps/server_api/server_api.dart index 504a0cb5..bbcbb461 100644 --- a/lib/logic/api_maps/graphql_maps/server_api/server_api.dart +++ b/lib/logic/api_maps/graphql_maps/server_api/server_api.dart @@ -289,8 +289,10 @@ class ServerApi extends GraphQLApiMap } records = response.parsedData!.system.domainInfo.requiredDnsRecords .map( - (final Fragment$dnsRecordFields fragment) => - DnsRecord.fromGraphQL(fragment), + ( + final Fragment$fragmentDnsRecords record, + ) => + DnsRecord.fromGraphQL(record), ) .toList(); } catch (e) { diff --git a/lib/logic/models/json/dns_records.dart b/lib/logic/models/json/dns_records.dart index 1680e943..3951ae4e 100644 --- a/lib/logic/models/json/dns_records.dart +++ b/lib/logic/models/json/dns_records.dart @@ -1,5 +1,5 @@ import 'package:json_annotation/json_annotation.dart'; -import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/schema.graphql.dart'; +import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart'; part 'dns_records.g.dart'; @@ -16,7 +16,7 @@ class DnsRecord { }); DnsRecord.fromGraphQL( - final Fragment$dnsRecordFields record, + final Fragment$fragmentDnsRecords record, ) : this( type: record.recordType, name: record.name, diff --git a/lib/logic/models/service.dart b/lib/logic/models/service.dart index 039065e3..19cd39ea 100644 --- a/lib/logic/models/service.dart +++ b/lib/logic/models/service.dart @@ -6,6 +6,8 @@ import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/services.graphql. import 'package:selfprivacy/logic/models/disk_size.dart'; import 'package:selfprivacy/logic/models/json/dns_records.dart'; +import '../api_maps/graphql_maps/schema/server_settings.graphql.dart'; + class Service { Service.fromGraphQL(final Query$AllServices$services$allServices service) : this( @@ -24,7 +26,9 @@ class Service { svgIcon: utf8.decode(base64.decode(service.svgIcon)), dnsRecords: service.dnsRecords ?.map( - (final Fragment$dnsRecordFields record) => + ( + final Fragment$fragmentDnsRecords record, + ) => DnsRecord.fromGraphQL(record), ) .toList() ?? From d2d8add10d98b9930cf0eb1b85305821eb714ae6 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Thu, 29 Jun 2023 12:52:09 +0300 Subject: [PATCH 07/20] feat(backups): Update the models --- lib/config/hive_config.dart | 1 + .../graphql_maps/schema/backups.graphql | 2 +- .../graphql_maps/schema/backups.graphql.dart | 50 ++-- .../schema/disk_volumes.graphql.dart | 1 - .../graphql_maps/schema/schema.graphql | 1 + .../graphql_maps/schema/server_api.graphql | 1 + .../schema/server_api.graphql.dart | 29 +- .../schema/server_settings.graphql.dart | 2 +- .../graphql_maps/schema/services.graphql.dart | 1 + .../graphql_maps/schema/users.graphql.dart | 2 +- .../graphql_maps/server_api/backups_api.dart | 207 ++++++++++++++ .../graphql_maps/server_api/server_api.dart | 203 +------------- lib/logic/cubit/backups/backups_cubit.dart | 231 ++++++++-------- lib/logic/cubit/backups/backups_state.dart | 23 +- .../server_installation_cubit.dart | 4 +- lib/logic/models/backup.dart | 60 ++++ lib/logic/models/hive/backblaze_bucket.dart | 4 + lib/logic/models/hive/backblaze_bucket.g.dart | 7 +- lib/logic/models/hive/backups_credential.dart | 8 +- .../models/hive/backups_credential.g.dart | 30 +- .../models/initialize_repository_input.dart | 2 +- lib/logic/models/json/backup.dart | 65 ----- lib/logic/models/json/backup.g.dart | 44 --- .../pages/backup_details/backup_details.dart | 261 ++++++++++++------ lib/ui/pages/providers/providers.dart | 19 +- 25 files changed, 669 insertions(+), 589 deletions(-) create mode 100644 lib/logic/api_maps/graphql_maps/server_api/backups_api.dart create mode 100644 lib/logic/models/backup.dart delete mode 100644 lib/logic/models/json/backup.dart delete mode 100644 lib/logic/models/json/backup.g.dart diff --git a/lib/config/hive_config.dart b/lib/config/hive_config.dart index 0bf1ca7c..25dee2c8 100644 --- a/lib/config/hive_config.dart +++ b/lib/config/hive_config.dart @@ -21,6 +21,7 @@ class HiveConfig { Hive.registerAdapter(UserTypeAdapter()); Hive.registerAdapter(DnsProviderTypeAdapter()); Hive.registerAdapter(ServerProviderTypeAdapter()); + Hive.registerAdapter(BackupsProviderTypeAdapter()); await Hive.openBox(BNames.appSettingsBox); diff --git a/lib/logic/api_maps/graphql_maps/schema/backups.graphql b/lib/logic/api_maps/graphql_maps/schema/backups.graphql index 0ee5aa6c..c0341b19 100644 --- a/lib/logic/api_maps/graphql_maps/schema/backups.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/backups.graphql @@ -46,7 +46,7 @@ mutation ForceSnapshotsReload { } } -mutation StartBackup($serviceId: String = null) { +mutation StartBackup($serviceId: String!) { backup { startBackup(serviceId: $serviceId) { ...basicMutationReturnFields diff --git a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart index 7ebfa705..2ed668b1 100644 --- a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart @@ -1,9 +1,9 @@ import 'dart:async'; +import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'package:selfprivacy/utils/scalars.dart'; import 'schema.graphql.dart'; -import 'services.graphql.dart'; class Fragment$genericBackupConfigReturn { Fragment$genericBackupConfigReturn({ @@ -2738,31 +2738,27 @@ class _CopyWithStubImpl$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReloa } class Variables$Mutation$StartBackup { - factory Variables$Mutation$StartBackup({String? serviceId}) => + factory Variables$Mutation$StartBackup({required String serviceId}) => Variables$Mutation$StartBackup._({ - if (serviceId != null) r'serviceId': serviceId, + r'serviceId': serviceId, }); Variables$Mutation$StartBackup._(this._$data); factory Variables$Mutation$StartBackup.fromJson(Map data) { final result$data = {}; - if (data.containsKey('serviceId')) { - final l$serviceId = data['serviceId']; - result$data['serviceId'] = (l$serviceId as String?); - } + final l$serviceId = data['serviceId']; + result$data['serviceId'] = (l$serviceId as String); return Variables$Mutation$StartBackup._(result$data); } Map _$data; - String? get serviceId => (_$data['serviceId'] as String?); + String get serviceId => (_$data['serviceId'] as String); Map toJson() { final result$data = {}; - if (_$data.containsKey('serviceId')) { - final l$serviceId = serviceId; - result$data['serviceId'] = l$serviceId; - } + final l$serviceId = serviceId; + result$data['serviceId'] = l$serviceId; return result$data; } @@ -2782,10 +2778,6 @@ class Variables$Mutation$StartBackup { } final l$serviceId = serviceId; final lOther$serviceId = other.serviceId; - if (_$data.containsKey('serviceId') != - other._$data.containsKey('serviceId')) { - return false; - } if (l$serviceId != lOther$serviceId) { return false; } @@ -2795,8 +2787,7 @@ class Variables$Mutation$StartBackup { @override int get hashCode { final l$serviceId = serviceId; - return Object.hashAll( - [_$data.containsKey('serviceId') ? l$serviceId : const {}]); + return Object.hashAll([l$serviceId]); } } @@ -2828,7 +2819,8 @@ class _CopyWithImpl$Variables$Mutation$StartBackup TRes call({Object? serviceId = _undefined}) => _then(Variables$Mutation$StartBackup._({ ..._instance._$data, - if (serviceId != _undefined) 'serviceId': (serviceId as String?), + if (serviceId != _undefined && serviceId != null) + 'serviceId': (serviceId as String), })); } @@ -2982,9 +2974,9 @@ const documentNodeMutationStartBackup = DocumentNode(definitions: [ variable: VariableNode(name: NameNode(value: 'serviceId')), type: NamedTypeNode( name: NameNode(value: 'String'), - isNonNull: false, + isNonNull: true, ), - defaultValue: DefaultValueNode(value: NullValueNode()), + defaultValue: DefaultValueNode(value: null), directives: [], ) ], @@ -3052,7 +3044,7 @@ class Options$Mutation$StartBackup extends graphql.MutationOptions { Options$Mutation$StartBackup({ String? operationName, - Variables$Mutation$StartBackup? variables, + required Variables$Mutation$StartBackup variables, graphql.FetchPolicy? fetchPolicy, graphql.ErrorPolicy? errorPolicy, graphql.CacheRereadPolicy? cacheRereadPolicy, @@ -3064,7 +3056,7 @@ class Options$Mutation$StartBackup graphql.OnError? onError, }) : onCompletedWithParsed = onCompleted, super( - variables: variables?.toJson() ?? {}, + variables: variables.toJson(), operationName: operationName, fetchPolicy: fetchPolicy, errorPolicy: errorPolicy, @@ -3098,7 +3090,7 @@ class WatchOptions$Mutation$StartBackup extends graphql.WatchQueryOptions { WatchOptions$Mutation$StartBackup({ String? operationName, - Variables$Mutation$StartBackup? variables, + required Variables$Mutation$StartBackup variables, graphql.FetchPolicy? fetchPolicy, graphql.ErrorPolicy? errorPolicy, graphql.CacheRereadPolicy? cacheRereadPolicy, @@ -3110,7 +3102,7 @@ class WatchOptions$Mutation$StartBackup bool carryForwardDataOnException = true, bool fetchResults = false, }) : super( - variables: variables?.toJson() ?? {}, + variables: variables.toJson(), operationName: operationName, fetchPolicy: fetchPolicy, errorPolicy: errorPolicy, @@ -3128,11 +3120,11 @@ class WatchOptions$Mutation$StartBackup extension ClientExtension$Mutation$StartBackup on graphql.GraphQLClient { Future> mutate$StartBackup( - [Options$Mutation$StartBackup? options]) async => - await this.mutate(options ?? Options$Mutation$StartBackup()); + Options$Mutation$StartBackup options) async => + await this.mutate(options); graphql.ObservableQuery watchMutation$StartBackup( - [WatchOptions$Mutation$StartBackup? options]) => - this.watchMutation(options ?? WatchOptions$Mutation$StartBackup()); + WatchOptions$Mutation$StartBackup options) => + this.watchMutation(options); } class Mutation$StartBackup$backup { diff --git a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart index e9e91eb8..c900dcc7 100644 --- a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart @@ -3,7 +3,6 @@ import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'package:selfprivacy/utils/scalars.dart'; import 'schema.graphql.dart'; -import 'services.graphql.dart'; class Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields({ diff --git a/lib/logic/api_maps/graphql_maps/schema/schema.graphql b/lib/logic/api_maps/graphql_maps/schema/schema.graphql index 15ae463d..d53da52e 100644 --- a/lib/logic/api_maps/graphql_maps/schema/schema.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/schema.graphql @@ -19,6 +19,7 @@ type ApiDevice { type ApiJob { uid: String! + typeId: String! name: String! description: String! status: String! diff --git a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql index f1012815..9797e81f 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql @@ -23,6 +23,7 @@ query GetApiJobs { status statusText uid + typeId updatedAt } } diff --git a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart index 2e950aa1..7c09fbb7 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart @@ -1,9 +1,9 @@ import 'dart:async'; +import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'package:selfprivacy/utils/scalars.dart'; import 'schema.graphql.dart'; -import 'services.graphql.dart'; class Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields({ @@ -2914,6 +2914,13 @@ const documentNodeQueryGetApiJobs = DocumentNode(definitions: [ directives: [], selectionSet: null, ), + FieldNode( + name: NameNode(value: 'typeId'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), FieldNode( name: NameNode(value: 'updatedAt'), alias: null, @@ -3229,6 +3236,7 @@ class Query$GetApiJobs$jobs$getJobs { required this.status, this.statusText, required this.uid, + required this.typeId, required this.updatedAt, this.$__typename = 'ApiJob', }); @@ -3244,6 +3252,7 @@ class Query$GetApiJobs$jobs$getJobs { final l$status = json['status']; final l$statusText = json['statusText']; final l$uid = json['uid']; + final l$typeId = json['typeId']; final l$updatedAt = json['updatedAt']; final l$$__typename = json['__typename']; return Query$GetApiJobs$jobs$getJobs( @@ -3257,6 +3266,7 @@ class Query$GetApiJobs$jobs$getJobs { status: (l$status as String), statusText: (l$statusText as String?), uid: (l$uid as String), + typeId: (l$typeId as String), updatedAt: dateTimeFromJson(l$updatedAt), $__typename: (l$$__typename as String), ); @@ -3282,6 +3292,8 @@ class Query$GetApiJobs$jobs$getJobs { final String uid; + final String typeId; + final DateTime updatedAt; final String $__typename; @@ -3309,6 +3321,8 @@ class Query$GetApiJobs$jobs$getJobs { _resultData['statusText'] = l$statusText; final l$uid = uid; _resultData['uid'] = l$uid; + final l$typeId = typeId; + _resultData['typeId'] = l$typeId; final l$updatedAt = updatedAt; _resultData['updatedAt'] = dateTimeToJson(l$updatedAt); final l$$__typename = $__typename; @@ -3328,6 +3342,7 @@ class Query$GetApiJobs$jobs$getJobs { final l$status = status; final l$statusText = statusText; final l$uid = uid; + final l$typeId = typeId; final l$updatedAt = updatedAt; final l$$__typename = $__typename; return Object.hashAll([ @@ -3341,6 +3356,7 @@ class Query$GetApiJobs$jobs$getJobs { l$status, l$statusText, l$uid, + l$typeId, l$updatedAt, l$$__typename, ]); @@ -3405,6 +3421,11 @@ class Query$GetApiJobs$jobs$getJobs { if (l$uid != lOther$uid) { return false; } + final l$typeId = typeId; + final lOther$typeId = other.typeId; + if (l$typeId != lOther$typeId) { + return false; + } final l$updatedAt = updatedAt; final lOther$updatedAt = other.updatedAt; if (l$updatedAt != lOther$updatedAt) { @@ -3448,6 +3469,7 @@ abstract class CopyWith$Query$GetApiJobs$jobs$getJobs { String? status, String? statusText, String? uid, + String? typeId, DateTime? updatedAt, String? $__typename, }); @@ -3477,6 +3499,7 @@ class _CopyWithImpl$Query$GetApiJobs$jobs$getJobs Object? status = _undefined, Object? statusText = _undefined, Object? uid = _undefined, + Object? typeId = _undefined, Object? updatedAt = _undefined, Object? $__typename = _undefined, }) => @@ -3504,6 +3527,9 @@ class _CopyWithImpl$Query$GetApiJobs$jobs$getJobs ? _instance.statusText : (statusText as String?), uid: uid == _undefined || uid == null ? _instance.uid : (uid as String), + typeId: typeId == _undefined || typeId == null + ? _instance.typeId + : (typeId as String), updatedAt: updatedAt == _undefined || updatedAt == null ? _instance.updatedAt : (updatedAt as DateTime), @@ -3530,6 +3556,7 @@ class _CopyWithStubImpl$Query$GetApiJobs$jobs$getJobs String? status, String? statusText, String? uid, + String? typeId, DateTime? updatedAt, String? $__typename, }) => diff --git a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart index abbba037..ae8aabcb 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart @@ -1,8 +1,8 @@ import 'dart:async'; +import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'schema.graphql.dart'; -import 'services.graphql.dart'; class Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields({ diff --git a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart index 64720f3e..2fbf6c3d 100644 --- a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'package:selfprivacy/utils/scalars.dart'; diff --git a/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart index 4df77d6f..d17316df 100644 --- a/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart @@ -1,8 +1,8 @@ import 'dart:async'; +import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'schema.graphql.dart'; -import 'services.graphql.dart'; class Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields({ diff --git a/lib/logic/api_maps/graphql_maps/server_api/backups_api.dart b/lib/logic/api_maps/graphql_maps/server_api/backups_api.dart new file mode 100644 index 00000000..18fea675 --- /dev/null +++ b/lib/logic/api_maps/graphql_maps/server_api/backups_api.dart @@ -0,0 +1,207 @@ +part of 'server_api.dart'; + +mixin BackupsApi on GraphQLApiMap { + Future> getBackups() async { + List backups; + QueryResult response; + + try { + final GraphQLClient client = await getClient(); + response = await client.query$AllBackupSnapshots(); + if (response.hasException) { + final message = response.exception.toString(); + print(message); + backups = []; + } + final List parsed = response.parsedData!.backup.allSnapshots + .map( + ( + final Query$AllBackupSnapshots$backup$allSnapshots snapshot, + ) => + Backup.fromGraphQL(snapshot), + ) + .toList(); + backups = parsed; + } catch (e) { + print(e); + backups = []; + } + + return backups; + } + + Future getBackupsConfiguration() async { + BackupConfiguration? backupConfiguration; + QueryResult response; + try { + final GraphQLClient client = await getClient(); + response = await client.query$BackupConfiguration(); + if (response.hasException) { + final message = response.exception.toString(); + print(message); + backupConfiguration = null; + } + final BackupConfiguration parsed = BackupConfiguration.fromGraphQL( + response.parsedData!.backup.configuration, + ); + backupConfiguration = parsed; + } catch (e) { + print(e); + backupConfiguration = null; + } + + return backupConfiguration; + } + + Future forceBackupListReload() async { + try { + final GraphQLClient client = await getClient(); + await client.mutate$ForceSnapshotsReload(); + } catch (e) { + print(e); + return GenericResult( + success: false, + data: null, + message: e.toString(), + ); + } + + return GenericResult( + success: true, + data: null, + ); + } + + Future startBackup(final String serviceId) async { + QueryResult response; + GenericResult? result; + + try { + final GraphQLClient client = await getClient(); + final variables = Variables$Mutation$StartBackup(serviceId: serviceId); + final options = Options$Mutation$StartBackup(variables: variables); + response = await client.mutate$StartBackup(options); + if (response.hasException) { + final message = response.exception.toString(); + print(message); + result = GenericResult( + success: false, + data: null, + message: message, + ); + } + result = GenericResult( + success: true, + data: null, + ); + } catch (e) { + print(e); + result = GenericResult( + success: false, + data: null, + message: e.toString(), + ); + } + + return result; + } + + Future setAutobackupPeriod({final int? period}) async { + QueryResult response; + GenericResult? result; + + try { + final GraphQLClient client = await getClient(); + final variables = Variables$Mutation$SetAutobackupPeriod(period: period); + final options = + Options$Mutation$SetAutobackupPeriod(variables: variables); + response = await client.mutate$SetAutobackupPeriod(options); + if (response.hasException) { + final message = response.exception.toString(); + print(message); + result = GenericResult( + success: false, + data: null, + message: message, + ); + } + result = GenericResult( + success: true, + data: null, + ); + } catch (e) { + print(e); + result = GenericResult( + success: false, + data: null, + message: e.toString(), + ); + } + + return result; + } + + Future removeRepository() async { + try { + final GraphQLClient client = await getClient(); + await client.mutate$RemoveRepository(); + } catch (e) { + print(e); + return GenericResult( + success: false, + data: null, + message: e.toString(), + ); + } + + return GenericResult( + success: true, + data: null, + ); + } + + Future initializeRepository( + final InitializeRepositoryInput input, + ) async { + QueryResult response; + GenericResult? result; + + try { + final GraphQLClient client = await getClient(); + final variables = Variables$Mutation$InitializeRepository( + repository: Input$InitializeRepositoryInput( + locationId: input.locationId, + locationName: input.locationName, + login: input.login, + password: input.password, + provider: input.provider.toGraphQL(), + ), + ); + final options = + Options$Mutation$InitializeRepository(variables: variables); + response = await client.mutate$InitializeRepository(options); + if (response.hasException) { + final message = response.exception.toString(); + print(message); + result = GenericResult( + success: false, + data: null, + message: message, + ); + } + result = GenericResult( + success: true, + data: null, + ); + } catch (e) { + print(e); + result = GenericResult( + success: false, + data: null, + message: e.toString(), + ); + } + + return result; + } +} diff --git a/lib/logic/api_maps/graphql_maps/server_api/server_api.dart b/lib/logic/api_maps/graphql_maps/server_api/server_api.dart index bbcbb461..91694945 100644 --- a/lib/logic/api_maps/graphql_maps/server_api/server_api.dart +++ b/lib/logic/api_maps/graphql_maps/server_api/server_api.dart @@ -15,7 +15,7 @@ import 'package:selfprivacy/logic/models/hive/server_domain.dart'; import 'package:selfprivacy/logic/models/hive/user.dart'; import 'package:selfprivacy/logic/models/initialize_repository_input.dart'; import 'package:selfprivacy/logic/models/json/api_token.dart'; -import 'package:selfprivacy/logic/models/json/backup.dart'; +import 'package:selfprivacy/logic/models/backup.dart'; import 'package:selfprivacy/logic/models/json/device_token.dart'; import 'package:selfprivacy/logic/models/json/dns_records.dart'; import 'package:selfprivacy/logic/models/json/recovery_token_status.dart'; @@ -32,9 +32,10 @@ part 'server_actions_api.dart'; part 'services_api.dart'; part 'users_api.dart'; part 'volume_api.dart'; +part 'backups_api.dart'; class ServerApi extends GraphQLApiMap - with VolumeApi, JobsApi, ServerActionsApi, ServicesApi, UsersApi { + with VolumeApi, JobsApi, ServerActionsApi, ServicesApi, UsersApi, BackupsApi { ServerApi({ this.hasLogger = false, this.isWithToken = true, @@ -512,202 +513,4 @@ class ServerApi extends GraphQLApiMap return token; } - - Future>> getBackups() async { - GenericResult> backups; - QueryResult response; - - try { - final GraphQLClient client = await getClient(); - response = await client.query$AllBackupSnapshots(); - if (response.hasException) { - final message = response.exception.toString(); - print(message); - backups = GenericResult>( - success: false, - data: [], - message: message, - ); - } - final List parsed = response.parsedData!.backup.allSnapshots - .map( - ( - final Query$AllBackupSnapshots$backup$allSnapshots snapshot, - ) => - Backup.fromGraphQL(snapshot), - ) - .toList(); - backups = GenericResult>( - success: true, - data: parsed, - ); - } catch (e) { - print(e); - backups = GenericResult>( - success: false, - data: [], - message: e.toString(), - ); - } - - return backups; - } - - Future forceBackupListReload() async { - try { - final GraphQLClient client = await getClient(); - await client.mutate$ForceSnapshotsReload(); - } catch (e) { - print(e); - return GenericResult( - success: false, - data: null, - message: e.toString(), - ); - } - - return GenericResult( - success: true, - data: null, - ); - } - - Future startBackup({final String? serviceId}) async { - QueryResult response; - GenericResult? result; - - try { - final GraphQLClient client = await getClient(); - final variables = Variables$Mutation$StartBackup(serviceId: serviceId); - final options = Options$Mutation$StartBackup(variables: variables); - response = await client.mutate$StartBackup(options); - if (response.hasException) { - final message = response.exception.toString(); - print(message); - result = GenericResult( - success: false, - data: null, - message: message, - ); - } - result = GenericResult( - success: true, - data: null, - ); - } catch (e) { - print(e); - result = GenericResult( - success: false, - data: null, - message: e.toString(), - ); - } - - return result; - } - - Future setAutobackupPeriod({final int? period}) async { - QueryResult response; - GenericResult? result; - - try { - final GraphQLClient client = await getClient(); - final variables = Variables$Mutation$SetAutobackupPeriod(period: period); - final options = - Options$Mutation$SetAutobackupPeriod(variables: variables); - response = await client.mutate$SetAutobackupPeriod(options); - if (response.hasException) { - final message = response.exception.toString(); - print(message); - result = GenericResult( - success: false, - data: null, - message: message, - ); - } - result = GenericResult( - success: true, - data: null, - ); - } catch (e) { - print(e); - result = GenericResult( - success: false, - data: null, - message: e.toString(), - ); - } - - return result; - } - - Future getBackupStatus() async => BackupStatus( - progress: 0.0, - status: BackupStatusEnum.error, - errorMessage: null, - ); - - Future removeRepository() async { - try { - final GraphQLClient client = await getClient(); - await client.mutate$RemoveRepository(); - } catch (e) { - print(e); - return GenericResult( - success: false, - data: null, - message: e.toString(), - ); - } - - return GenericResult( - success: true, - data: null, - ); - } - - Future initializeRepository( - final InitializeRepositoryInput input, - ) async { - QueryResult response; - GenericResult? result; - - try { - final GraphQLClient client = await getClient(); - final variables = Variables$Mutation$InitializeRepository( - repository: Input$InitializeRepositoryInput( - locationId: input.locationId, - locationName: input.locationName, - login: input.login, - password: input.password, - provider: input.provider.toGraphQL(), - ), - ); - final options = - Options$Mutation$InitializeRepository(variables: variables); - response = await client.mutate$InitializeRepository(options); - if (response.hasException) { - final message = response.exception.toString(); - print(message); - result = GenericResult( - success: false, - data: null, - message: message, - ); - } - result = GenericResult( - success: true, - data: null, - ); - } catch (e) { - print(e); - result = GenericResult( - success: false, - data: null, - message: e.toString(), - ); - } - - return result; - } } diff --git a/lib/logic/cubit/backups/backups_cubit.dart b/lib/logic/cubit/backups/backups_cubit.dart index cb743161..4a1c980b 100644 --- a/lib/logic/cubit/backups/backups_cubit.dart +++ b/lib/logic/cubit/backups/backups_cubit.dart @@ -6,7 +6,10 @@ import 'package:selfprivacy/logic/api_maps/rest_maps/backblaze.dart'; import 'package:selfprivacy/logic/api_maps/graphql_maps/server_api/server_api.dart'; import 'package:selfprivacy/logic/cubit/app_config_dependent/authentication_dependend_cubit.dart'; import 'package:selfprivacy/logic/models/hive/backblaze_bucket.dart'; -import 'package:selfprivacy/logic/models/json/backup.dart'; +import 'package:selfprivacy/logic/models/backup.dart'; +import 'package:selfprivacy/logic/models/hive/backups_credential.dart'; +import 'package:selfprivacy/logic/models/initialize_repository_input.dart'; +import 'package:selfprivacy/logic/models/service.dart'; part 'backups_state.dart'; @@ -24,107 +27,83 @@ class BackupsCubit extends ServerInstallationDependendCubit { Future load() async { if (serverInstallationCubit.state is ServerInstallationFinished) { final BackblazeBucket? bucket = getIt().backblazeBucket; - if (bucket == null) { - emit( - const BackupsState( - isInitialized: false, - preventActions: false, - refreshing: false, - ), - ); - } else { - final BackupStatus status = await api.getBackupStatus(); - switch (status.status) { - case BackupStatusEnum.noKey: - case BackupStatusEnum.notInitialized: - emit( - BackupsState( - backups: const [], - isInitialized: true, - preventActions: false, - progress: 0, - status: status.status, - refreshing: false, - ), - ); - break; - case BackupStatusEnum.initializing: - emit( - BackupsState( - backups: const [], - isInitialized: true, - preventActions: false, - progress: 0, - status: status.status, - refreshTimer: const Duration(seconds: 10), - refreshing: false, - ), - ); - break; - case BackupStatusEnum.initialized: - case BackupStatusEnum.error: - final result = await api.getBackups(); - emit( - BackupsState( - backups: result.data, - isInitialized: true, - preventActions: false, - progress: status.progress, - status: status.status, - error: status.errorMessage ?? '', - refreshing: false, - ), - ); - break; - case BackupStatusEnum.backingUp: - case BackupStatusEnum.restoring: - final result = await api.getBackups(); - emit( - BackupsState( - backups: result.data, - isInitialized: true, - preventActions: true, - progress: status.progress, - status: status.status, - error: status.errorMessage ?? '', - refreshTimer: const Duration(seconds: 5), - refreshing: false, - ), - ); - break; - default: - emit(const BackupsState()); - } - Timer(state.refreshTimer, () => updateBackups(useTimer: true)); - } + final BackupConfiguration? backupConfig = + await api.getBackupsConfiguration(); + final List backups = await api.getBackups(); + emit( + state.copyWith( + backblazeBucket: bucket, + isInitialized: backupConfig?.isInitialized, + autobackupPeriod: backupConfig?.autobackupPeriod, + backups: backups, + preventActions: false, + refreshing: false, + ), + ); + print(state); } } - Future createBucket() async { + Future initializeBackups() async { emit(state.copyWith(preventActions: true)); - final String domain = serverInstallationCubit.state.serverDomain!.domainName - .replaceAll(RegExp(r'[^a-zA-Z0-9]'), '-'); - final int serverId = serverInstallationCubit.state.serverDetails!.id; - String bucketName = 'selfprivacy-$domain-$serverId'; - // If bucket name is too long, shorten it - if (bucketName.length > 49) { - bucketName = bucketName.substring(0, 49); + final String? encryptionKey = + (await api.getBackupsConfiguration())?.encryptionKey; + if (encryptionKey == null) { + getIt() + .showSnackBar("Couldn't get encryption key from your server."); + emit(state.copyWith(preventActions: false)); + return; } - final String bucketId = await backblaze.createBucket(bucketName); - final BackblazeApplicationKey key = await backblaze.createKey(bucketId); - final BackblazeBucket bucket = BackblazeBucket( - bucketId: bucketId, - bucketName: bucketName, - applicationKey: key.applicationKey, - applicationKeyId: key.applicationKeyId, + final BackblazeBucket bucket; + + if (state.backblazeBucket == null) { + final String domain = serverInstallationCubit + .state.serverDomain!.domainName + .replaceAll(RegExp(r'[^a-zA-Z0-9]'), '-'); + final int serverId = serverInstallationCubit.state.serverDetails!.id; + String bucketName = 'selfprivacy-$domain-$serverId'; + // If bucket name is too long, shorten it + if (bucketName.length > 49) { + bucketName = bucketName.substring(0, 49); + } + final String bucketId = await backblaze.createBucket(bucketName); + + final BackblazeApplicationKey key = await backblaze.createKey(bucketId); + bucket = BackblazeBucket( + bucketId: bucketId, + bucketName: bucketName, + applicationKey: key.applicationKey, + applicationKeyId: key.applicationKeyId, + encryptionKey: encryptionKey, + ); + + await getIt().storeBackblazeBucket(bucket); + emit(state.copyWith(backblazeBucket: bucket)); + } else { + bucket = state.backblazeBucket!; + } + + final GenericResult result = await api.initializeRepository( + InitializeRepositoryInput( + provider: BackupsProviderType.backblaze, + locationId: bucket.bucketId, + locationName: bucket.bucketName, + login: bucket.applicationKeyId, + password: bucket.applicationKey, + ), ); - - await getIt().storeBackblazeBucket(bucket); - //await api.uploadBackblazeConfig(bucket); + if (result.success == false) { + getIt() + .showSnackBar(result.message ?? 'Unknown error'); + emit(state.copyWith(preventActions: false)); + return; + } await updateBackups(); + getIt().showSnackBar( + 'Backups repository is now initializing. It may take a while.'); - emit(state.copyWith(isInitialized: true, preventActions: false)); + emit(state.copyWith(preventActions: false)); } Future reuploadKey() async { @@ -132,42 +111,47 @@ class BackupsCubit extends ServerInstallationDependendCubit { final BackblazeBucket? bucket = getIt().backblazeBucket; if (bucket == null) { emit(state.copyWith(isInitialized: false)); + print('bucket is null'); } else { - //await api.uploadBackblazeConfig(bucket); - emit(state.copyWith(isInitialized: true, preventActions: false)); - getIt().showSnackBar('backup.reuploaded_key'); + print('bucket is not null'); + final GenericResult result = await api.initializeRepository( + InitializeRepositoryInput( + provider: BackupsProviderType.backblaze, + locationId: bucket.bucketId, + locationName: bucket.bucketName, + login: bucket.applicationKeyId, + password: bucket.applicationKey, + ), + ); + print('result is $result'); + if (result.success == false) { + getIt() + .showSnackBar(result.message ?? 'Unknown error'); + emit(state.copyWith(preventActions: false)); + return; + } else { + emit(state.copyWith(preventActions: false)); + getIt().showSnackBar('backup.reuploaded_key'); + await updateBackups(); + } } } - Duration refreshTimeFromState(final BackupStatusEnum status) { - switch (status) { - case BackupStatusEnum.backingUp: - case BackupStatusEnum.restoring: - return const Duration(seconds: 5); - case BackupStatusEnum.initializing: - return const Duration(seconds: 10); - default: - return const Duration(seconds: 60); - } - } + @Deprecated("we don't have states") + Duration refreshTimeFromState() => const Duration(seconds: 60); Future updateBackups({final bool useTimer = false}) async { emit(state.copyWith(refreshing: true)); - final result = await api.getBackups(); - if (!result.success || result.data.isEmpty) { - return; - } + final backups = await api.getBackups(); + final backupConfig = await api.getBackupsConfiguration(); - final List backups = result.data; - final BackupStatus status = await api.getBackupStatus(); emit( state.copyWith( backups: backups, - progress: status.progress, - status: status.status, - error: status.errorMessage, - refreshTimer: refreshTimeFromState(status.status), + refreshTimer: refreshTimeFromState(), refreshing: false, + isInitialized: backupConfig?.isInitialized ?? false, + autobackupPeriod: backupConfig?.autobackupPeriod, ), ); if (useTimer) { @@ -182,9 +166,18 @@ class BackupsCubit extends ServerInstallationDependendCubit { emit(state.copyWith(preventActions: false)); } - Future createBackup() async { + Future createMultipleBackups(final List services) async { emit(state.copyWith(preventActions: true)); - await api.startBackup(); + for (final service in services) { + await api.startBackup(service.id); + } + await updateBackups(); + emit(state.copyWith(preventActions: false)); + } + + Future createBackup(final String serviceId) async { + emit(state.copyWith(preventActions: true)); + await api.startBackup(serviceId); await updateBackups(); emit(state.copyWith(preventActions: false)); } diff --git a/lib/logic/cubit/backups/backups_state.dart b/lib/logic/cubit/backups/backups_state.dart index 33ec52c8..988f669b 100644 --- a/lib/logic/cubit/backups/backups_state.dart +++ b/lib/logic/cubit/backups/backups_state.dart @@ -4,31 +4,26 @@ class BackupsState extends ServerInstallationDependendState { const BackupsState({ this.isInitialized = false, this.backups = const [], - this.progress = 0.0, - this.status = BackupStatusEnum.noKey, this.preventActions = true, - this.error = '', this.refreshTimer = const Duration(seconds: 60), this.refreshing = true, + this.autobackupPeriod, + this.backblazeBucket, }); final bool isInitialized; final List backups; - final double progress; - final BackupStatusEnum status; final bool preventActions; - final String error; final Duration refreshTimer; final bool refreshing; + final Duration? autobackupPeriod; + final BackblazeBucket? backblazeBucket; @override List get props => [ isInitialized, backups, - progress, preventActions, - status, - error, refreshTimer, refreshing ]; @@ -36,21 +31,19 @@ class BackupsState extends ServerInstallationDependendState { BackupsState copyWith({ final bool? isInitialized, final List? backups, - final double? progress, - final BackupStatusEnum? status, final bool? preventActions, - final String? error, final Duration? refreshTimer, final bool? refreshing, + final Duration? autobackupPeriod, + final BackblazeBucket? backblazeBucket, }) => BackupsState( isInitialized: isInitialized ?? this.isInitialized, backups: backups ?? this.backups, - progress: progress ?? this.progress, - status: status ?? this.status, preventActions: preventActions ?? this.preventActions, - error: error ?? this.error, refreshTimer: refreshTimer ?? this.refreshTimer, refreshing: refreshing ?? this.refreshing, + autobackupPeriod: autobackupPeriod ?? this.autobackupPeriod, + backblazeBucket: backblazeBucket ?? this.backblazeBucket, ); } diff --git a/lib/logic/cubit/server_installation/server_installation_cubit.dart b/lib/logic/cubit/server_installation/server_installation_cubit.dart index b2252e8e..3f00a5b5 100644 --- a/lib/logic/cubit/server_installation/server_installation_cubit.dart +++ b/lib/logic/cubit/server_installation/server_installation_cubit.dart @@ -197,7 +197,7 @@ class ServerInstallationCubit extends Cubit { final BackupsCredential backblazeCredential = BackupsCredential( keyId: keyId, applicationKey: applicationKey, - provider: BackupsProvider.backblaze, + provider: BackupsProviderType.backblaze, ); await repository.saveBackblazeKey(backblazeCredential); if (state is ServerInstallationRecovery) { @@ -699,7 +699,7 @@ class ServerInstallationCubit extends Cubit { provider: dnsProviderType, ), ); - await repository.setDnsApiToken(token); + // await repository.setDnsApiToken(token); emit( dataState.copyWith( serverDomain: ServerDomain( diff --git a/lib/logic/models/backup.dart b/lib/logic/models/backup.dart new file mode 100644 index 00000000..fda68375 --- /dev/null +++ b/lib/logic/models/backup.dart @@ -0,0 +1,60 @@ +import 'package:json_annotation/json_annotation.dart'; +import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/backups.graphql.dart'; +import 'package:selfprivacy/logic/models/hive/backups_credential.dart'; + +class Backup { + Backup.fromGraphQL( + final Query$AllBackupSnapshots$backup$allSnapshots snapshot, + ) : this( + id: snapshot.id, + time: snapshot.createdAt, + serviceId: snapshot.service.id, + fallbackServiceName: snapshot.service.displayName, + ); + + Backup({ + required this.time, + required this.id, + required this.serviceId, + required this.fallbackServiceName, + }); + + // Time of the backup + final DateTime time; + @JsonKey(name: 'short_id') + final String id; + final String serviceId; + final String fallbackServiceName; +} + +class BackupConfiguration { + BackupConfiguration.fromGraphQL( + final Query$BackupConfiguration$backup$configuration configuration, + ) : this( + // Provided by API as int of minutes + autobackupPeriod: configuration.autobackupPeriod != null + ? Duration(minutes: configuration.autobackupPeriod!) + : null, + encryptionKey: configuration.encryptionKey, + isInitialized: configuration.isInitialized, + locationId: configuration.locationId, + locationName: configuration.locationName, + provider: BackupsProviderType.fromGraphQL(configuration.provider), + ); + + BackupConfiguration({ + required this.autobackupPeriod, + required this.encryptionKey, + required this.isInitialized, + required this.locationId, + required this.locationName, + required this.provider, + }); + + final Duration? autobackupPeriod; + final String encryptionKey; + final bool isInitialized; + final String? locationId; + final String? locationName; + final BackupsProviderType provider; +} diff --git a/lib/logic/models/hive/backblaze_bucket.dart b/lib/logic/models/hive/backblaze_bucket.dart index 39b98cf5..6c4bbeea 100644 --- a/lib/logic/models/hive/backblaze_bucket.dart +++ b/lib/logic/models/hive/backblaze_bucket.dart @@ -9,6 +9,7 @@ class BackblazeBucket { required this.bucketName, required this.applicationKeyId, required this.applicationKey, + required this.encryptionKey, }); @HiveField(0) @@ -23,6 +24,9 @@ class BackblazeBucket { @HiveField(3) final String bucketName; + @HiveField(4) + final String encryptionKey; + @override String toString() => bucketName; } diff --git a/lib/logic/models/hive/backblaze_bucket.g.dart b/lib/logic/models/hive/backblaze_bucket.g.dart index 18802bc0..129905a5 100644 --- a/lib/logic/models/hive/backblaze_bucket.g.dart +++ b/lib/logic/models/hive/backblaze_bucket.g.dart @@ -21,13 +21,14 @@ class BackblazeBucketAdapter extends TypeAdapter { bucketName: fields[3] as String, applicationKeyId: fields[1] as String, applicationKey: fields[2] as String, + encryptionKey: fields[4] as String, ); } @override void write(BinaryWriter writer, BackblazeBucket obj) { writer - ..writeByte(4) + ..writeByte(5) ..writeByte(0) ..write(obj.bucketId) ..writeByte(1) @@ -35,7 +36,9 @@ class BackblazeBucketAdapter extends TypeAdapter { ..writeByte(2) ..write(obj.applicationKey) ..writeByte(3) - ..write(obj.bucketName); + ..write(obj.bucketName) + ..writeByte(4) + ..write(obj.encryptionKey); } @override diff --git a/lib/logic/models/hive/backups_credential.dart b/lib/logic/models/hive/backups_credential.dart index 9b14f067..0c0cf48d 100644 --- a/lib/logic/models/hive/backups_credential.dart +++ b/lib/logic/models/hive/backups_credential.dart @@ -19,8 +19,8 @@ class BackupsCredential { @HiveField(1) final String applicationKey; - @HiveField(2, defaultValue: BackupsProvider.backblaze) - final BackupsProvider provider; + @HiveField(2, defaultValue: BackupsProviderType.backblaze) + final BackupsProviderType provider; String get encodedApiKey => encodedBackblazeKey(keyId, applicationKey); @@ -35,7 +35,7 @@ String encodedBackblazeKey(final String? keyId, final String? applicationKey) { } @HiveType(typeId: 103) -enum BackupsProvider { +enum BackupsProviderType { @HiveField(0) none, @HiveField(1) @@ -45,7 +45,7 @@ enum BackupsProvider { @HiveField(3) backblaze; - factory BackupsProvider.fromGraphQL(final Enum$BackupProvider provider) => + factory BackupsProviderType.fromGraphQL(final Enum$BackupProvider provider) => switch (provider) { Enum$BackupProvider.NONE => none, Enum$BackupProvider.MEMORY => memory, diff --git a/lib/logic/models/hive/backups_credential.g.dart b/lib/logic/models/hive/backups_credential.g.dart index 2cf023df..13166d31 100644 --- a/lib/logic/models/hive/backups_credential.g.dart +++ b/lib/logic/models/hive/backups_credential.g.dart @@ -20,8 +20,8 @@ class BackupsCredentialAdapter extends TypeAdapter { keyId: fields[0] as String, applicationKey: fields[1] as String, provider: fields[2] == null - ? BackupsProvider.backblaze - : fields[2] as BackupsProvider, + ? BackupsProviderType.backblaze + : fields[2] as BackupsProviderType, ); } @@ -48,39 +48,39 @@ class BackupsCredentialAdapter extends TypeAdapter { typeId == other.typeId; } -class BackupsProviderAdapter extends TypeAdapter { +class BackupsProviderTypeAdapter extends TypeAdapter { @override final int typeId = 103; @override - BackupsProvider read(BinaryReader reader) { + BackupsProviderType read(BinaryReader reader) { switch (reader.readByte()) { case 0: - return BackupsProvider.none; + return BackupsProviderType.none; case 1: - return BackupsProvider.memory; + return BackupsProviderType.memory; case 2: - return BackupsProvider.file; + return BackupsProviderType.file; case 3: - return BackupsProvider.backblaze; + return BackupsProviderType.backblaze; default: - return BackupsProvider.none; + return BackupsProviderType.none; } } @override - void write(BinaryWriter writer, BackupsProvider obj) { + void write(BinaryWriter writer, BackupsProviderType obj) { switch (obj) { - case BackupsProvider.none: + case BackupsProviderType.none: writer.writeByte(0); break; - case BackupsProvider.memory: + case BackupsProviderType.memory: writer.writeByte(1); break; - case BackupsProvider.file: + case BackupsProviderType.file: writer.writeByte(2); break; - case BackupsProvider.backblaze: + case BackupsProviderType.backblaze: writer.writeByte(3); break; } @@ -92,7 +92,7 @@ class BackupsProviderAdapter extends TypeAdapter { @override bool operator ==(Object other) => identical(this, other) || - other is BackupsProviderAdapter && + other is BackupsProviderTypeAdapter && runtimeType == other.runtimeType && typeId == other.typeId; } diff --git a/lib/logic/models/initialize_repository_input.dart b/lib/logic/models/initialize_repository_input.dart index fcb137b0..7ccaa410 100644 --- a/lib/logic/models/initialize_repository_input.dart +++ b/lib/logic/models/initialize_repository_input.dart @@ -8,7 +8,7 @@ class InitializeRepositoryInput { required this.login, required this.password, }); - final BackupsProvider provider; + final BackupsProviderType provider; final String locationId; final String locationName; final String login; diff --git a/lib/logic/models/json/backup.dart b/lib/logic/models/json/backup.dart deleted file mode 100644 index a806d00b..00000000 --- a/lib/logic/models/json/backup.dart +++ /dev/null @@ -1,65 +0,0 @@ -import 'package:json_annotation/json_annotation.dart'; -import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/backups.graphql.dart'; - -part 'backup.g.dart'; - -@JsonSerializable() -class Backup { - factory Backup.fromJson(final Map json) => - _$BackupFromJson(json); - Backup.fromGraphQL( - final Query$AllBackupSnapshots$backup$allSnapshots snapshot, - ) : this( - id: snapshot.id, - time: snapshot.createdAt, - serviceId: snapshot.service.id, - fallbackServiceName: snapshot.service.displayName, - ); - - Backup({ - required this.time, - required this.id, - required this.serviceId, - required this.fallbackServiceName, - }); - - // Time of the backup - final DateTime time; - @JsonKey(name: 'short_id') - final String id; - final String serviceId; - final String fallbackServiceName; -} - -enum BackupStatusEnum { - @JsonValue('NO_KEY') - noKey, - @JsonValue('NOT_INITIALIZED') - notInitialized, - @JsonValue('INITIALIZED') - initialized, - @JsonValue('BACKING_UP') - backingUp, - @JsonValue('RESTORING') - restoring, - @JsonValue('ERROR') - error, - @JsonValue('INITIALIZING') - initializing, -} - -@JsonSerializable() -class BackupStatus { - factory BackupStatus.fromJson(final Map json) => - _$BackupStatusFromJson(json); - BackupStatus({ - required this.status, - required this.progress, - required this.errorMessage, - }); - - final BackupStatusEnum status; - final double progress; - @JsonKey(name: 'error_message') - final String? errorMessage; -} diff --git a/lib/logic/models/json/backup.g.dart b/lib/logic/models/json/backup.g.dart deleted file mode 100644 index 35148517..00000000 --- a/lib/logic/models/json/backup.g.dart +++ /dev/null @@ -1,44 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'backup.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -Backup _$BackupFromJson(Map json) => Backup( - time: DateTime.parse(json['time'] as String), - id: json['short_id'] as String, - serviceId: json['serviceId'] as String, - fallbackServiceName: json['fallbackServiceName'] as String, - ); - -Map _$BackupToJson(Backup instance) => { - 'time': instance.time.toIso8601String(), - 'short_id': instance.id, - 'serviceId': instance.serviceId, - 'fallbackServiceName': instance.fallbackServiceName, - }; - -BackupStatus _$BackupStatusFromJson(Map json) => BackupStatus( - status: $enumDecode(_$BackupStatusEnumEnumMap, json['status']), - progress: (json['progress'] as num).toDouble(), - errorMessage: json['error_message'] as String?, - ); - -Map _$BackupStatusToJson(BackupStatus instance) => - { - 'status': _$BackupStatusEnumEnumMap[instance.status]!, - 'progress': instance.progress, - 'error_message': instance.errorMessage, - }; - -const _$BackupStatusEnumEnumMap = { - BackupStatusEnum.noKey: 'NO_KEY', - BackupStatusEnum.notInitialized: 'NOT_INITIALIZED', - BackupStatusEnum.initialized: 'INITIALIZED', - BackupStatusEnum.backingUp: 'BACKING_UP', - BackupStatusEnum.restoring: 'RESTORING', - BackupStatusEnum.error: 'ERROR', - BackupStatusEnum.initializing: 'INITIALIZING', -}; diff --git a/lib/ui/pages/backup_details/backup_details.dart b/lib/ui/pages/backup_details/backup_details.dart index f909e481..2dac9a0b 100644 --- a/lib/ui/pages/backup_details/backup_details.dart +++ b/lib/ui/pages/backup_details/backup_details.dart @@ -1,9 +1,14 @@ import 'package:auto_route/auto_route.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart'; import 'package:selfprivacy/logic/cubit/backups/backups_cubit.dart'; -import 'package:selfprivacy/logic/models/json/backup.dart'; +import 'package:selfprivacy/logic/cubit/server_jobs/server_jobs_cubit.dart'; +import 'package:selfprivacy/logic/cubit/services/services_cubit.dart'; +import 'package:selfprivacy/logic/models/backup.dart'; +import 'package:selfprivacy/logic/models/json/server_job.dart'; +import 'package:selfprivacy/logic/models/service.dart'; import 'package:selfprivacy/logic/models/state_types.dart'; import 'package:selfprivacy/ui/components/buttons/brand_button.dart'; import 'package:selfprivacy/ui/components/cards/outlined_card.dart'; @@ -29,19 +34,15 @@ class _BackupDetailsPageState extends State is ServerInstallationFinished; final bool isBackupInitialized = context.watch().state.isInitialized; - final BackupStatusEnum backupStatus = - context.watch().state.status; final StateType providerState = isReady && isBackupInitialized - ? (backupStatus == BackupStatusEnum.error - ? StateType.warning - : StateType.stable) + ? StateType.stable : StateType.uninitialized; final bool preventActions = context.watch().state.preventActions; - final double backupProgress = context.watch().state.progress; - final String backupError = context.watch().state.error; final List backups = context.watch().state.backups; final bool refreshing = context.watch().state.refreshing; + final List services = + context.watch().state.services; return BrandHeroScreen( heroIcon: BrandIcons.save, @@ -53,81 +54,45 @@ class _BackupDetailsPageState extends State onPressed: preventActions ? null : () async { - await context.read().createBucket(); + await context.read().initializeBackups(); }, text: 'backup.initialize'.tr(), ), - if (backupStatus == BackupStatusEnum.initializing) - Text( - 'backup.waiting_for_rebuild'.tr(), - style: Theme.of(context).textTheme.bodyMedium, - ), - if (backupStatus != BackupStatusEnum.initializing && - backupStatus != BackupStatusEnum.noKey) - OutlinedCard( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (backupStatus == BackupStatusEnum.initialized) - ListTile( - onTap: preventActions - ? null - : () async { - await context.read().createBackup(); - }, - leading: const Icon( - Icons.add_circle_outline_rounded, - ), - title: Text( - 'backup.create_new'.tr(), - style: Theme.of(context).textTheme.titleLarge, - ), - ), - if (backupStatus == BackupStatusEnum.backingUp) - ListTile( - title: Text( - 'backup.creating'.tr( - args: [(backupProgress * 100).round().toString()], + ListTile( + onTap: preventActions + ? null + : () { + // await context.read().createBackup(); + showModalBottomSheet( + useRootNavigator: true, + context: context, + isScrollControlled: true, + builder: (final BuildContext context) => + DraggableScrollableSheet( + expand: false, + maxChildSize: 0.9, + minChildSize: 0.4, + initialChildSize: 0.6, + builder: (context, scrollController) => + CreateBackupsModal( + services: services, + scrollController: scrollController, ), - style: Theme.of(context).textTheme.titleLarge, ), - subtitle: LinearProgressIndicator( - value: backupProgress, - backgroundColor: Colors.grey.withOpacity(0.2), - ), - ), - if (backupStatus == BackupStatusEnum.restoring) - ListTile( - title: Text( - 'backup.restoring'.tr( - args: [(backupProgress * 100).round().toString()], - ), - style: Theme.of(context).textTheme.titleLarge, - ), - subtitle: LinearProgressIndicator( - backgroundColor: Colors.grey.withOpacity(0.2), - ), - ), - if (backupStatus == BackupStatusEnum.error) - ListTile( - leading: Icon( - Icons.error_outline, - color: Theme.of(context).colorScheme.error, - ), - title: Text( - 'backup.error_pending'.tr(), - style: Theme.of(context).textTheme.titleLarge, - ), - ), - ], - ), + ); + }, + leading: const Icon( + Icons.add_circle_outline_rounded, ), + title: Text( + 'backup.create_new'.tr(), + ), + ), const SizedBox(height: 16), // Card with a list of existing backups // Each list item has a date // When clicked, starts the restore action - if (backupStatus != BackupStatusEnum.initializing && - backupStatus != BackupStatusEnum.noKey) + if (isBackupInitialized) OutlinedCard( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -230,11 +195,151 @@ class _BackupDetailsPageState extends State ], ), ), - if (backupStatus == BackupStatusEnum.error) - Text( - backupError.toString(), - style: Theme.of(context).textTheme.bodyMedium, - ), + ], + ); + } +} + +class CreateBackupsModal extends StatefulWidget { + const CreateBackupsModal({ + super.key, + required this.services, + required this.scrollController, + }); + + final List services; + final ScrollController scrollController; + + @override + State createState() => _CreateBackupsModalState(); +} + +class _CreateBackupsModalState extends State { + // Store in state the selected services to backup + List selectedServices = []; + + // Select all services on modal open + @override + void initState() { + super.initState(); + final List busyServices = context + .read() + .state + .backupJobList + .where((final ServerJob job) => + job.status == JobStatusEnum.running || + job.status == JobStatusEnum.created) + .map((final ServerJob job) => job.typeId.split('.')[1]) + .toList(); + selectedServices.addAll(widget.services + .where((final Service service) => !busyServices.contains(service.id))); + } + + @override + Widget build(final BuildContext context) { + final List busyServices = context + .watch() + .state + .backupJobList + .where((final ServerJob job) => + job.status == JobStatusEnum.running || + job.status == JobStatusEnum.created) + .map((final ServerJob job) => job.typeId.split('.')[1]) + .toList(); + + return ListView( + controller: widget.scrollController, + padding: const EdgeInsets.all(16), + children: [ + const SizedBox(height: 16), + Text( + 'backup.create_new_select_headline'.tr(), + style: Theme.of(context).textTheme.headlineSmall, + textAlign: TextAlign.center, + ), + const SizedBox(height: 16), + // Select all services tile + CheckboxListTile( + onChanged: (final bool? value) { + setState(() { + if (value ?? true) { + setState(() { + selectedServices.clear(); + selectedServices.addAll(widget.services.where( + (final service) => !busyServices.contains(service.id))); + }); + } else { + selectedServices.clear(); + } + }); + }, + title: Text( + 'backup.select_all'.tr(), + ), + secondary: const Icon( + Icons.checklist_outlined, + ), + value: selectedServices.length >= + widget.services.length - busyServices.length, + ), + const Divider( + height: 1.0, + ), + ...widget.services.map( + (final Service service) { + final bool busy = busyServices.contains(service.id); + return CheckboxListTile( + onChanged: !busy + ? (final bool? value) { + setState(() { + if (value ?? true) { + setState(() { + selectedServices.add(service); + }); + } else { + setState(() { + selectedServices.remove(service); + }); + } + }); + } + : null, + title: Text( + service.displayName, + ), + subtitle: Text( + busy ? 'backup.service_busy'.tr() : service.description, + ), + secondary: SvgPicture.string( + service.svgIcon, + height: 24, + width: 24, + colorFilter: ColorFilter.mode( + busy + ? Theme.of(context).colorScheme.outlineVariant + : Theme.of(context).colorScheme.onBackground, + BlendMode.srcIn, + ), + ), + value: selectedServices.contains(service), + ); + }, + ), + const SizedBox(height: 16), + // Create backup button + FilledButton( + onPressed: selectedServices.isEmpty + ? null + : () { + context + .read() + .createMultipleBackups(selectedServices); + Navigator.of(context).pop(); + }, + child: Text( + 'backup.create'.tr(), + ), + ), ], ); } diff --git a/lib/ui/pages/providers/providers.dart b/lib/ui/pages/providers/providers.dart index 25533a43..bdae6e07 100644 --- a/lib/ui/pages/providers/providers.dart +++ b/lib/ui/pages/providers/providers.dart @@ -97,16 +97,15 @@ class _ProvidersPageState extends State { ), const SizedBox(height: 16), // TODO: When backups are fixed, show this card - if (isBackupInitialized) - _Card( - state: isBackupInitialized - ? StateType.stable - : StateType.uninitialized, - icon: BrandIcons.save, - title: 'backup.card_title'.tr(), - subtitle: isBackupInitialized ? 'backup.card_subtitle'.tr() : '', - onTap: () => context.pushRoute(const BackupDetailsRoute()), - ), + _Card( + state: isBackupInitialized + ? StateType.stable + : StateType.uninitialized, + icon: BrandIcons.save, + title: 'backup.card_title'.tr(), + subtitle: isBackupInitialized ? 'backup.card_subtitle'.tr() : '', + onTap: () => context.pushRoute(const BackupDetailsRoute()), + ), ], ), ); From e1e4779c51a879c71f9bcd44329bfaea1628e8c0 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Thu, 29 Jun 2023 12:52:37 +0300 Subject: [PATCH 08/20] feat(recovery): Couldn't save the dns token --- .../server_installation_repository.dart | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/logic/cubit/server_installation/server_installation_repository.dart b/lib/logic/cubit/server_installation/server_installation_repository.dart index 33d047b1..2a6829e6 100644 --- a/lib/logic/cubit/server_installation/server_installation_repository.dart +++ b/lib/logic/cubit/server_installation/server_installation_repository.dart @@ -170,12 +170,13 @@ class ServerInstallationRepository { Future getDomainId(final String token, final String domain) async { final result = await ProvidersController.currentDnsProvider!.tryInitApiByToken(token); - return result.success - ? (await ProvidersController.currentDnsProvider!.getZoneId( - domain, - )) - .data - : null; + if (!result.success) { + return null; + } + await setDnsApiToken(token); + return (await ProvidersController.currentDnsProvider!.getZoneId( + domain, + )).data; } Future> isDnsAddressesMatch( From 62e906d1a4a110e64f0a67ed018e5b1cbdeec842 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Thu, 29 Jun 2023 12:53:13 +0300 Subject: [PATCH 09/20] feat(jobs): Update the model and modal sheets --- lib/logic/cubit/server_jobs/server_jobs_state.dart | 5 +++++ lib/logic/models/json/server_job.dart | 3 +++ lib/logic/models/json/server_job.g.dart | 2 ++ lib/ui/components/jobs_content/jobs_content.dart | 10 ++++++++-- lib/ui/components/pre_styled_buttons/flash_fab.dart | 11 ++++++++++- lib/ui/layouts/brand_hero_screen.dart | 11 ++++++++++- .../binds_migration/services_migration.dart | 11 ++++++++++- 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/lib/logic/cubit/server_jobs/server_jobs_state.dart b/lib/logic/cubit/server_jobs/server_jobs_state.dart index 03b564c0..71732d67 100644 --- a/lib/logic/cubit/server_jobs/server_jobs_state.dart +++ b/lib/logic/cubit/server_jobs/server_jobs_state.dart @@ -21,6 +21,11 @@ class ServerJobsState extends ServerInstallationDependendState { } } + List get backupJobList => serverJobList.where( + // The backup jobs has the format of 'service..backup' + (final job) => job.typeId.contains('backup'), + ).toList(); + bool get hasRemovableJobs => serverJobList.any( (final job) => job.status == JobStatusEnum.finished || diff --git a/lib/logic/models/json/server_job.dart b/lib/logic/models/json/server_job.dart index 2c448e81..6b125c5f 100644 --- a/lib/logic/models/json/server_job.dart +++ b/lib/logic/models/json/server_job.dart @@ -12,6 +12,7 @@ class ServerJob { required this.description, required this.status, required this.uid, + required this.typeId, required this.updatedAt, required this.createdAt, this.error, @@ -33,12 +34,14 @@ class ServerJob { status: JobStatusEnum.fromString(serverJob.status), statusText: serverJob.statusText, uid: serverJob.uid, + typeId: serverJob.typeId, updatedAt: serverJob.updatedAt, ); final String name; final String description; final JobStatusEnum status; final String uid; + final String typeId; final DateTime updatedAt; final DateTime createdAt; diff --git a/lib/logic/models/json/server_job.g.dart b/lib/logic/models/json/server_job.g.dart index 5328547b..61ff259b 100644 --- a/lib/logic/models/json/server_job.g.dart +++ b/lib/logic/models/json/server_job.g.dart @@ -11,6 +11,7 @@ ServerJob _$ServerJobFromJson(Map json) => ServerJob( description: json['description'] as String, status: $enumDecode(_$JobStatusEnumEnumMap, json['status']), uid: json['uid'] as String, + typeId: json['typeId'] as String, updatedAt: DateTime.parse(json['updatedAt'] as String), createdAt: DateTime.parse(json['createdAt'] as String), error: json['error'] as String?, @@ -27,6 +28,7 @@ Map _$ServerJobToJson(ServerJob instance) => { 'description': instance.description, 'status': _$JobStatusEnumEnumMap[instance.status]!, 'uid': instance.uid, + 'typeId': instance.typeId, 'updatedAt': instance.updatedAt.toIso8601String(), 'createdAt': instance.createdAt.toIso8601String(), 'error': instance.error, diff --git a/lib/ui/components/jobs_content/jobs_content.dart b/lib/ui/components/jobs_content/jobs_content.dart index 5ba00f89..8db853ac 100644 --- a/lib/ui/components/jobs_content/jobs_content.dart +++ b/lib/ui/components/jobs_content/jobs_content.dart @@ -12,7 +12,12 @@ import 'package:selfprivacy/ui/components/jobs_content/server_job_card.dart'; import 'package:selfprivacy/ui/helpers/modals.dart'; class JobsContent extends StatelessWidget { - const JobsContent({super.key}); + const JobsContent({ + required this.controller, + super.key, + }); + + final ScrollController controller; @override Widget build(final BuildContext context) { @@ -119,9 +124,10 @@ class JobsContent extends StatelessWidget { ]; } return ListView( + controller: controller, padding: paddingH15V0, children: [ - const SizedBox(height: 15), + const SizedBox(height: 16), Center( child: Text( 'jobs.title'.tr(), diff --git a/lib/ui/components/pre_styled_buttons/flash_fab.dart b/lib/ui/components/pre_styled_buttons/flash_fab.dart index 2098f79e..caffbfac 100644 --- a/lib/ui/components/pre_styled_buttons/flash_fab.dart +++ b/lib/ui/components/pre_styled_buttons/flash_fab.dart @@ -62,7 +62,16 @@ class _BrandFabState extends State // TODO: Make a hero animation to the screen showModalBottomSheet( context: context, - builder: (final BuildContext context) => const JobsContent(), + useRootNavigator: true, + isScrollControlled: true, + builder: (final BuildContext context) => DraggableScrollableSheet( + expand: false, + maxChildSize: 0.9, + minChildSize: 0.4, + initialChildSize: 0.6, + builder: (final context, final scrollController) => + JobsContent(controller: scrollController), + ), ); }, isExtended: widget.extended, diff --git a/lib/ui/layouts/brand_hero_screen.dart b/lib/ui/layouts/brand_hero_screen.dart index adb94902..e7b320c0 100644 --- a/lib/ui/layouts/brand_hero_screen.dart +++ b/lib/ui/layouts/brand_hero_screen.dart @@ -145,7 +145,16 @@ class _HeroSliverAppBarState extends State { onPressed: () { showModalBottomSheet( context: context, - builder: (final BuildContext context) => const JobsContent(), + useRootNavigator: true, + isScrollControlled: true, + builder: (final BuildContext context) => DraggableScrollableSheet( + expand: false, + maxChildSize: 0.9, + minChildSize: 0.4, + initialChildSize: 0.6, + builder: (final context, final scrollController) => + JobsContent(controller: scrollController), + ), ); }, icon: Icon( diff --git a/lib/ui/pages/server_storage/binds_migration/services_migration.dart b/lib/ui/pages/server_storage/binds_migration/services_migration.dart index cdb3339b..f7c26c88 100644 --- a/lib/ui/pages/server_storage/binds_migration/services_migration.dart +++ b/lib/ui/pages/server_storage/binds_migration/services_migration.dart @@ -177,7 +177,16 @@ class _ServicesMigrationPageState extends State { context.router.popUntilRoot(); showModalBottomSheet( context: context, - builder: (final BuildContext context) => const JobsContent(), + useRootNavigator: true, + isScrollControlled: true, + builder: (final BuildContext context) => DraggableScrollableSheet( + expand: false, + maxChildSize: 0.9, + minChildSize: 0.4, + initialChildSize: 0.6, + builder: (final context, final scrollController) => + JobsContent(controller: scrollController), + ), ); }, ), From 90ab4244f671878b613f89e0f224ca29a4520ef5 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Thu, 29 Jun 2023 13:51:38 +0300 Subject: [PATCH 10/20] feat(backups): Expose if the service can be backed up --- .../graphql_maps/schema/schema.graphql | 1 + .../graphql_maps/schema/services.graphql | 1 + lib/logic/cubit/backups/backups_cubit.dart | 3 +- lib/logic/cubit/services/services_state.dart | 4 ++ lib/logic/models/service.dart | 6 ++- .../pages/backup_details/backup_details.dart | 39 ++++++++++++------- 6 files changed, 37 insertions(+), 17 deletions(-) diff --git a/lib/logic/api_maps/graphql_maps/schema/schema.graphql b/lib/logic/api_maps/graphql_maps/schema/schema.graphql index d53da52e..643dca4f 100644 --- a/lib/logic/api_maps/graphql_maps/schema/schema.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/schema.graphql @@ -254,6 +254,7 @@ type Service { isMovable: Boolean! isRequired: Boolean! isEnabled: Boolean! + canBeBackedUp: Boolean! status: ServiceStatusEnum! url: String dnsRecords: [DnsRecord!] diff --git a/lib/logic/api_maps/graphql_maps/schema/services.graphql b/lib/logic/api_maps/graphql_maps/schema/services.graphql index 9299ff7b..c27b568c 100644 --- a/lib/logic/api_maps/graphql_maps/schema/services.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/services.graphql @@ -16,6 +16,7 @@ query AllServices { isEnabled isMovable isRequired + canBeBackedUp status storageUsage { title diff --git a/lib/logic/cubit/backups/backups_cubit.dart b/lib/logic/cubit/backups/backups_cubit.dart index 4a1c980b..61dcc576 100644 --- a/lib/logic/cubit/backups/backups_cubit.dart +++ b/lib/logic/cubit/backups/backups_cubit.dart @@ -101,7 +101,8 @@ class BackupsCubit extends ServerInstallationDependendCubit { } await updateBackups(); getIt().showSnackBar( - 'Backups repository is now initializing. It may take a while.'); + 'Backups repository is now initializing. It may take a while.', + ); emit(state.copyWith(preventActions: false)); } diff --git a/lib/logic/cubit/services/services_state.dart b/lib/logic/cubit/services/services_state.dart index 2d99880a..d6247bc1 100644 --- a/lib/logic/cubit/services/services_state.dart +++ b/lib/logic/cubit/services/services_state.dart @@ -12,6 +12,10 @@ class ServicesState extends ServerInstallationDependendState { final List services; final List lockedServices; + List get servicesThatCanBeBackedUp => services.where( + (final service) => service.canBeBackedUp, + ).toList(); + bool isServiceLocked(final String serviceId) => lockedServices.contains(serviceId); diff --git a/lib/logic/models/service.dart b/lib/logic/models/service.dart index 19cd39ea..086d527d 100644 --- a/lib/logic/models/service.dart +++ b/lib/logic/models/service.dart @@ -6,7 +6,7 @@ import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/services.graphql. import 'package:selfprivacy/logic/models/disk_size.dart'; import 'package:selfprivacy/logic/models/json/dns_records.dart'; -import '../api_maps/graphql_maps/schema/server_settings.graphql.dart'; +import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart'; class Service { Service.fromGraphQL(final Query$AllServices$services$allServices service) @@ -17,6 +17,7 @@ class Service { isEnabled: service.isEnabled, isRequired: service.isRequired, isMovable: service.isMovable, + canBeBackedUp: service.canBeBackedUp, status: ServiceStatus.fromGraphQL(service.status), storageUsage: ServiceStorageUsage( used: DiskSize(byte: int.parse(service.storageUsage.usedSpace)), @@ -42,6 +43,7 @@ class Service { required this.isEnabled, required this.isRequired, required this.isMovable, + required this.canBeBackedUp, required this.status, required this.storageUsage, required this.svgIcon, @@ -75,6 +77,7 @@ class Service { isEnabled: false, isRequired: false, isMovable: false, + canBeBackedUp: false, status: ServiceStatus.off, storageUsage: ServiceStorageUsage( used: const DiskSize(byte: 0), @@ -91,6 +94,7 @@ class Service { final bool isEnabled; final bool isRequired; final bool isMovable; + final bool canBeBackedUp; final ServiceStatus status; final ServiceStorageUsage storageUsage; final String svgIcon; diff --git a/lib/ui/pages/backup_details/backup_details.dart b/lib/ui/pages/backup_details/backup_details.dart index 2dac9a0b..b3fa2348 100644 --- a/lib/ui/pages/backup_details/backup_details.dart +++ b/lib/ui/pages/backup_details/backup_details.dart @@ -42,7 +42,7 @@ class _BackupDetailsPageState extends State final List backups = context.watch().state.backups; final bool refreshing = context.watch().state.refreshing; final List services = - context.watch().state.services; + context.watch().state.servicesThatCanBeBackedUp; return BrandHeroScreen( heroIcon: BrandIcons.save, @@ -73,7 +73,7 @@ class _BackupDetailsPageState extends State maxChildSize: 0.9, minChildSize: 0.4, initialChildSize: 0.6, - builder: (context, scrollController) => + builder: (final context, final scrollController) => CreateBackupsModal( services: services, scrollController: scrollController, @@ -202,9 +202,9 @@ class _BackupDetailsPageState extends State class CreateBackupsModal extends StatefulWidget { const CreateBackupsModal({ - super.key, required this.services, required this.scrollController, + super.key, }); final List services; @@ -226,13 +226,17 @@ class _CreateBackupsModalState extends State { .read() .state .backupJobList - .where((final ServerJob job) => - job.status == JobStatusEnum.running || - job.status == JobStatusEnum.created) + .where( + (final ServerJob job) => + job.status == JobStatusEnum.running || + job.status == JobStatusEnum.created, + ) .map((final ServerJob job) => job.typeId.split('.')[1]) .toList(); - selectedServices.addAll(widget.services - .where((final Service service) => !busyServices.contains(service.id))); + selectedServices.addAll( + widget.services + .where((final Service service) => !busyServices.contains(service.id)), + ); } @override @@ -241,9 +245,11 @@ class _CreateBackupsModalState extends State { .watch() .state .backupJobList - .where((final ServerJob job) => - job.status == JobStatusEnum.running || - job.status == JobStatusEnum.created) + .where( + (final ServerJob job) => + job.status == JobStatusEnum.running || + job.status == JobStatusEnum.created, + ) .map((final ServerJob job) => job.typeId.split('.')[1]) .toList(); @@ -253,7 +259,7 @@ class _CreateBackupsModalState extends State { children: [ const SizedBox(height: 16), Text( - 'backup.create_new_select_headline'.tr(), + 'backup.create_new_select_heading'.tr(), style: Theme.of(context).textTheme.headlineSmall, textAlign: TextAlign.center, ), @@ -265,8 +271,11 @@ class _CreateBackupsModalState extends State { if (value ?? true) { setState(() { selectedServices.clear(); - selectedServices.addAll(widget.services.where( - (final service) => !busyServices.contains(service.id))); + selectedServices.addAll( + widget.services.where( + (final service) => !busyServices.contains(service.id), + ), + ); }); } else { selectedServices.clear(); @@ -337,7 +346,7 @@ class _CreateBackupsModalState extends State { Navigator.of(context).pop(); }, child: Text( - 'backup.create'.tr(), + 'backup.start'.tr(), ), ), ], From 7f5488c76b9c758b34af5c13397387503a4afdd2 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Thu, 29 Jun 2023 13:52:25 +0300 Subject: [PATCH 11/20] refactor(services): Remove unused state getters --- lib/logic/cubit/services/services_state.dart | 54 ++------------------ 1 file changed, 4 insertions(+), 50 deletions(-) diff --git a/lib/logic/cubit/services/services_state.dart b/lib/logic/cubit/services/services_state.dart index d6247bc1..7a136b54 100644 --- a/lib/logic/cubit/services/services_state.dart +++ b/lib/logic/cubit/services/services_state.dart @@ -12,44 +12,15 @@ class ServicesState extends ServerInstallationDependendState { final List services; final List lockedServices; - List get servicesThatCanBeBackedUp => services.where( + List get servicesThatCanBeBackedUp => services + .where( (final service) => service.canBeBackedUp, - ).toList(); + ) + .toList(); bool isServiceLocked(final String serviceId) => lockedServices.contains(serviceId); - bool get isPasswordManagerEnable => services - .firstWhere( - (final service) => service.id == 'bitwarden', - orElse: () => Service.empty, - ) - .isEnabled; - bool get isCloudEnable => services - .firstWhere( - (final service) => service.id == 'nextcloud', - orElse: () => Service.empty, - ) - .isEnabled; - bool get isGitEnable => services - .firstWhere( - (final service) => service.id == 'gitea', - orElse: () => Service.empty, - ) - .isEnabled; - bool get isSocialNetworkEnable => services - .firstWhere( - (final service) => service.id == 'pleroma', - orElse: () => Service.empty, - ) - .isEnabled; - bool get isVpnEnable => services - .firstWhere( - (final service) => service.id == 'ocserv', - orElse: () => Service.empty, - ) - .isEnabled; - Service? getServiceById(final String id) { final service = services.firstWhere( (final service) => service.id == id, @@ -67,23 +38,6 @@ class ServicesState extends ServerInstallationDependendState { lockedServices, ]; - bool isEnableByType(final Service service) { - switch (service.id) { - case 'bitwarden': - return isPasswordManagerEnable; - case 'nextcloud': - return isCloudEnable; - case 'pleroma': - return isSocialNetworkEnable; - case 'gitea': - return isGitEnable; - case 'ocserv': - return isVpnEnable; - default: - throw Exception('wrong state'); - } - } - ServicesState copyWith({ final List? services, final List? lockedServices, From b3b7c83461006c012acdb2573ee64a068a522d26 Mon Sep 17 00:00:00 2001 From: NaiJi Date: Thu, 29 Jun 2023 15:38:46 -0300 Subject: [PATCH 12/20] chore: Implement fragments for ServerJob type on backup requests --- .../graphql_maps/schema/backups.graphql | 14 + .../graphql_maps/schema/backups.graphql.dart | 802 ++++++++++++++- .../graphql_maps/schema/disk_volumes.graphql | 12 +- .../schema/disk_volumes.graphql.dart | 426 +------- .../graphql_maps/schema/server_api.graphql | 28 +- .../schema/server_api.graphql.dart | 934 ++++++++++-------- .../schema/server_settings.graphql.dart | 2 +- .../graphql_maps/schema/services.graphql | 12 +- .../graphql_maps/schema/services.graphql.dart | 452 +-------- .../graphql_maps/schema/users.graphql.dart | 2 +- .../graphql_maps/server_api/backups_api.dart | 47 +- lib/logic/models/json/server_job.dart | 2 +- .../providers/dns_providers/dns_provider.dart | 9 + 13 files changed, 1445 insertions(+), 1297 deletions(-) diff --git a/lib/logic/api_maps/graphql_maps/schema/backups.graphql b/lib/logic/api_maps/graphql_maps/schema/backups.graphql index c0341b19..fae80432 100644 --- a/lib/logic/api_maps/graphql_maps/schema/backups.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/backups.graphql @@ -50,6 +50,9 @@ mutation StartBackup($serviceId: String!) { backup { startBackup(serviceId: $serviceId) { ...basicMutationReturnFields + job { + ...basicApiJobsFields + } } } } @@ -77,3 +80,14 @@ mutation InitializeRepository($repository: InitializeRepositoryInput!) { } } } + +mutation RestoreBackup($snapshotId: String!) { + backup { + restoreBackup(snapshotId: $snapshotId) { + ...basicMutationReturnFields + job { + ...basicApiJobsFields + } + } + } +} \ No newline at end of file diff --git a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart index 2ed668b1..52bf45eb 100644 --- a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart @@ -1,9 +1,10 @@ import 'dart:async'; -import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'package:selfprivacy/utils/scalars.dart'; import 'schema.graphql.dart'; +import 'server_api.graphql.dart'; +import 'services.graphql.dart'; class Fragment$genericBackupConfigReturn { Fragment$genericBackupConfigReturn({ @@ -3003,6 +3004,25 @@ const documentNodeMutationStartBackup = DocumentNode(definitions: [ name: NameNode(value: 'basicMutationReturnFields'), directives: [], ), + FieldNode( + name: NameNode(value: 'job'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'basicApiJobsFields'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), FieldNode( name: NameNode(value: '__typename'), alias: null, @@ -3031,6 +3051,7 @@ const documentNodeMutationStartBackup = DocumentNode(definitions: [ ]), ), fragmentDefinitionbasicMutationReturnFields, + fragmentDefinitionbasicApiJobsFields, ]); Mutation$StartBackup _parserFn$Mutation$StartBackup( Map data) => @@ -3268,6 +3289,7 @@ class Mutation$StartBackup$backup$startBackup required this.message, required this.success, this.$__typename = 'GenericJobMutationReturn', + this.job, }); factory Mutation$StartBackup$backup$startBackup.fromJson( @@ -3276,11 +3298,16 @@ class Mutation$StartBackup$backup$startBackup final l$message = json['message']; final l$success = json['success']; final l$$__typename = json['__typename']; + final l$job = json['job']; return Mutation$StartBackup$backup$startBackup( code: (l$code as int), message: (l$message as String), success: (l$success as bool), $__typename: (l$$__typename as String), + job: l$job == null + ? null + : Fragment$basicApiJobsFields.fromJson( + (l$job as Map)), ); } @@ -3292,6 +3319,8 @@ class Mutation$StartBackup$backup$startBackup final String $__typename; + final Fragment$basicApiJobsFields? job; + Map toJson() { final _resultData = {}; final l$code = code; @@ -3302,6 +3331,8 @@ class Mutation$StartBackup$backup$startBackup _resultData['success'] = l$success; final l$$__typename = $__typename; _resultData['__typename'] = l$$__typename; + final l$job = job; + _resultData['job'] = l$job?.toJson(); return _resultData; } @@ -3311,11 +3342,13 @@ class Mutation$StartBackup$backup$startBackup final l$message = message; final l$success = success; final l$$__typename = $__typename; + final l$job = job; return Object.hashAll([ l$code, l$message, l$success, l$$__typename, + l$job, ]); } @@ -3348,6 +3381,11 @@ class Mutation$StartBackup$backup$startBackup if (l$$__typename != lOther$$__typename) { return false; } + final l$job = job; + final lOther$job = other.job; + if (l$job != lOther$job) { + return false; + } return true; } } @@ -3376,7 +3414,9 @@ abstract class CopyWith$Mutation$StartBackup$backup$startBackup { String? message, bool? success, String? $__typename, + Fragment$basicApiJobsFields? job, }); + CopyWith$Fragment$basicApiJobsFields get job; } class _CopyWithImpl$Mutation$StartBackup$backup$startBackup @@ -3397,6 +3437,7 @@ class _CopyWithImpl$Mutation$StartBackup$backup$startBackup Object? message = _undefined, Object? success = _undefined, Object? $__typename = _undefined, + Object? job = _undefined, }) => _then(Mutation$StartBackup$backup$startBackup( code: @@ -3410,7 +3451,16 @@ class _CopyWithImpl$Mutation$StartBackup$backup$startBackup $__typename: $__typename == _undefined || $__typename == null ? _instance.$__typename : ($__typename as String), + job: job == _undefined + ? _instance.job + : (job as Fragment$basicApiJobsFields?), )); + CopyWith$Fragment$basicApiJobsFields get job { + final local$job = _instance.job; + return local$job == null + ? CopyWith$Fragment$basicApiJobsFields.stub(_then(_instance)) + : CopyWith$Fragment$basicApiJobsFields(local$job, (e) => call(job: e)); + } } class _CopyWithStubImpl$Mutation$StartBackup$backup$startBackup @@ -3424,8 +3474,11 @@ class _CopyWithStubImpl$Mutation$StartBackup$backup$startBackup String? message, bool? success, String? $__typename, + Fragment$basicApiJobsFields? job, }) => _res; + CopyWith$Fragment$basicApiJobsFields get job => + CopyWith$Fragment$basicApiJobsFields.stub(_res); } class Variables$Mutation$SetAutobackupPeriod { @@ -4928,3 +4981,750 @@ class _CopyWithStubImpl$Mutation$InitializeRepository$backup CopyWith$Fragment$genericBackupConfigReturn get initializeRepository => CopyWith$Fragment$genericBackupConfigReturn.stub(_res); } + +class Variables$Mutation$RestoreBackup { + factory Variables$Mutation$RestoreBackup({required String snapshotId}) => + Variables$Mutation$RestoreBackup._({ + r'snapshotId': snapshotId, + }); + + Variables$Mutation$RestoreBackup._(this._$data); + + factory Variables$Mutation$RestoreBackup.fromJson(Map data) { + final result$data = {}; + final l$snapshotId = data['snapshotId']; + result$data['snapshotId'] = (l$snapshotId as String); + return Variables$Mutation$RestoreBackup._(result$data); + } + + Map _$data; + + String get snapshotId => (_$data['snapshotId'] as String); + Map toJson() { + final result$data = {}; + final l$snapshotId = snapshotId; + result$data['snapshotId'] = l$snapshotId; + return result$data; + } + + CopyWith$Variables$Mutation$RestoreBackup + get copyWith => CopyWith$Variables$Mutation$RestoreBackup( + this, + (i) => i, + ); + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Variables$Mutation$RestoreBackup) || + runtimeType != other.runtimeType) { + return false; + } + final l$snapshotId = snapshotId; + final lOther$snapshotId = other.snapshotId; + if (l$snapshotId != lOther$snapshotId) { + return false; + } + return true; + } + + @override + int get hashCode { + final l$snapshotId = snapshotId; + return Object.hashAll([l$snapshotId]); + } +} + +abstract class CopyWith$Variables$Mutation$RestoreBackup { + factory CopyWith$Variables$Mutation$RestoreBackup( + Variables$Mutation$RestoreBackup instance, + TRes Function(Variables$Mutation$RestoreBackup) then, + ) = _CopyWithImpl$Variables$Mutation$RestoreBackup; + + factory CopyWith$Variables$Mutation$RestoreBackup.stub(TRes res) = + _CopyWithStubImpl$Variables$Mutation$RestoreBackup; + + TRes call({String? snapshotId}); +} + +class _CopyWithImpl$Variables$Mutation$RestoreBackup + implements CopyWith$Variables$Mutation$RestoreBackup { + _CopyWithImpl$Variables$Mutation$RestoreBackup( + this._instance, + this._then, + ); + + final Variables$Mutation$RestoreBackup _instance; + + final TRes Function(Variables$Mutation$RestoreBackup) _then; + + static const _undefined = {}; + + TRes call({Object? snapshotId = _undefined}) => + _then(Variables$Mutation$RestoreBackup._({ + ..._instance._$data, + if (snapshotId != _undefined && snapshotId != null) + 'snapshotId': (snapshotId as String), + })); +} + +class _CopyWithStubImpl$Variables$Mutation$RestoreBackup + implements CopyWith$Variables$Mutation$RestoreBackup { + _CopyWithStubImpl$Variables$Mutation$RestoreBackup(this._res); + + TRes _res; + + call({String? snapshotId}) => _res; +} + +class Mutation$RestoreBackup { + Mutation$RestoreBackup({ + required this.backup, + this.$__typename = 'Mutation', + }); + + factory Mutation$RestoreBackup.fromJson(Map json) { + final l$backup = json['backup']; + final l$$__typename = json['__typename']; + return Mutation$RestoreBackup( + backup: Mutation$RestoreBackup$backup.fromJson( + (l$backup as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Mutation$RestoreBackup$backup backup; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$backup = backup; + _resultData['backup'] = l$backup.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$backup = backup; + final l$$__typename = $__typename; + return Object.hashAll([ + l$backup, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$RestoreBackup) || + runtimeType != other.runtimeType) { + return false; + } + final l$backup = backup; + final lOther$backup = other.backup; + if (l$backup != lOther$backup) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$RestoreBackup on Mutation$RestoreBackup { + CopyWith$Mutation$RestoreBackup get copyWith => + CopyWith$Mutation$RestoreBackup( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$RestoreBackup { + factory CopyWith$Mutation$RestoreBackup( + Mutation$RestoreBackup instance, + TRes Function(Mutation$RestoreBackup) then, + ) = _CopyWithImpl$Mutation$RestoreBackup; + + factory CopyWith$Mutation$RestoreBackup.stub(TRes res) = + _CopyWithStubImpl$Mutation$RestoreBackup; + + TRes call({ + Mutation$RestoreBackup$backup? backup, + String? $__typename, + }); + CopyWith$Mutation$RestoreBackup$backup get backup; +} + +class _CopyWithImpl$Mutation$RestoreBackup + implements CopyWith$Mutation$RestoreBackup { + _CopyWithImpl$Mutation$RestoreBackup( + this._instance, + this._then, + ); + + final Mutation$RestoreBackup _instance; + + final TRes Function(Mutation$RestoreBackup) _then; + + static const _undefined = {}; + + TRes call({ + Object? backup = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$RestoreBackup( + backup: backup == _undefined || backup == null + ? _instance.backup + : (backup as Mutation$RestoreBackup$backup), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Mutation$RestoreBackup$backup get backup { + final local$backup = _instance.backup; + return CopyWith$Mutation$RestoreBackup$backup( + local$backup, (e) => call(backup: e)); + } +} + +class _CopyWithStubImpl$Mutation$RestoreBackup + implements CopyWith$Mutation$RestoreBackup { + _CopyWithStubImpl$Mutation$RestoreBackup(this._res); + + TRes _res; + + call({ + Mutation$RestoreBackup$backup? backup, + String? $__typename, + }) => + _res; + CopyWith$Mutation$RestoreBackup$backup get backup => + CopyWith$Mutation$RestoreBackup$backup.stub(_res); +} + +const documentNodeMutationRestoreBackup = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'RestoreBackup'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'snapshotId')), + type: NamedTypeNode( + name: NameNode(value: 'String'), + isNonNull: true, + ), + defaultValue: DefaultValueNode(value: null), + directives: [], + ) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'backup'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'restoreBackup'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'snapshotId'), + value: VariableNode(name: NameNode(value: 'snapshotId')), + ) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'basicMutationReturnFields'), + directives: [], + ), + FieldNode( + name: NameNode(value: 'job'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'basicApiJobsFields'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + fragmentDefinitionbasicMutationReturnFields, + fragmentDefinitionbasicApiJobsFields, +]); +Mutation$RestoreBackup _parserFn$Mutation$RestoreBackup( + Map data) => + Mutation$RestoreBackup.fromJson(data); +typedef OnMutationCompleted$Mutation$RestoreBackup = FutureOr Function( + Map?, + Mutation$RestoreBackup?, +); + +class Options$Mutation$RestoreBackup + extends graphql.MutationOptions { + Options$Mutation$RestoreBackup({ + String? operationName, + required Variables$Mutation$RestoreBackup variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Mutation$RestoreBackup? typedOptimisticResult, + graphql.Context? context, + OnMutationCompleted$Mutation$RestoreBackup? onCompleted, + graphql.OnMutationUpdate? update, + graphql.OnError? onError, + }) : onCompletedWithParsed = onCompleted, + super( + variables: variables.toJson(), + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + onCompleted: onCompleted == null + ? null + : (data) => onCompleted( + data, + data == null + ? null + : _parserFn$Mutation$RestoreBackup(data), + ), + update: update, + onError: onError, + document: documentNodeMutationRestoreBackup, + parserFn: _parserFn$Mutation$RestoreBackup, + ); + + final OnMutationCompleted$Mutation$RestoreBackup? onCompletedWithParsed; + + @override + List get properties => [ + ...super.onCompleted == null + ? super.properties + : super.properties.where((property) => property != onCompleted), + onCompletedWithParsed, + ]; +} + +class WatchOptions$Mutation$RestoreBackup + extends graphql.WatchQueryOptions { + WatchOptions$Mutation$RestoreBackup({ + String? operationName, + required Variables$Mutation$RestoreBackup variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Mutation$RestoreBackup? typedOptimisticResult, + graphql.Context? context, + Duration? pollInterval, + bool? eagerlyFetchResults, + bool carryForwardDataOnException = true, + bool fetchResults = false, + }) : super( + variables: variables.toJson(), + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + document: documentNodeMutationRestoreBackup, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Mutation$RestoreBackup, + ); +} + +extension ClientExtension$Mutation$RestoreBackup on graphql.GraphQLClient { + Future> mutate$RestoreBackup( + Options$Mutation$RestoreBackup options) async => + await this.mutate(options); + graphql.ObservableQuery watchMutation$RestoreBackup( + WatchOptions$Mutation$RestoreBackup options) => + this.watchMutation(options); +} + +class Mutation$RestoreBackup$backup { + Mutation$RestoreBackup$backup({ + required this.restoreBackup, + this.$__typename = 'BackupMutations', + }); + + factory Mutation$RestoreBackup$backup.fromJson(Map json) { + final l$restoreBackup = json['restoreBackup']; + final l$$__typename = json['__typename']; + return Mutation$RestoreBackup$backup( + restoreBackup: Mutation$RestoreBackup$backup$restoreBackup.fromJson( + (l$restoreBackup as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Mutation$RestoreBackup$backup$restoreBackup restoreBackup; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$restoreBackup = restoreBackup; + _resultData['restoreBackup'] = l$restoreBackup.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$restoreBackup = restoreBackup; + final l$$__typename = $__typename; + return Object.hashAll([ + l$restoreBackup, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$RestoreBackup$backup) || + runtimeType != other.runtimeType) { + return false; + } + final l$restoreBackup = restoreBackup; + final lOther$restoreBackup = other.restoreBackup; + if (l$restoreBackup != lOther$restoreBackup) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$RestoreBackup$backup + on Mutation$RestoreBackup$backup { + CopyWith$Mutation$RestoreBackup$backup + get copyWith => CopyWith$Mutation$RestoreBackup$backup( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$RestoreBackup$backup { + factory CopyWith$Mutation$RestoreBackup$backup( + Mutation$RestoreBackup$backup instance, + TRes Function(Mutation$RestoreBackup$backup) then, + ) = _CopyWithImpl$Mutation$RestoreBackup$backup; + + factory CopyWith$Mutation$RestoreBackup$backup.stub(TRes res) = + _CopyWithStubImpl$Mutation$RestoreBackup$backup; + + TRes call({ + Mutation$RestoreBackup$backup$restoreBackup? restoreBackup, + String? $__typename, + }); + CopyWith$Mutation$RestoreBackup$backup$restoreBackup get restoreBackup; +} + +class _CopyWithImpl$Mutation$RestoreBackup$backup + implements CopyWith$Mutation$RestoreBackup$backup { + _CopyWithImpl$Mutation$RestoreBackup$backup( + this._instance, + this._then, + ); + + final Mutation$RestoreBackup$backup _instance; + + final TRes Function(Mutation$RestoreBackup$backup) _then; + + static const _undefined = {}; + + TRes call({ + Object? restoreBackup = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$RestoreBackup$backup( + restoreBackup: restoreBackup == _undefined || restoreBackup == null + ? _instance.restoreBackup + : (restoreBackup as Mutation$RestoreBackup$backup$restoreBackup), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Mutation$RestoreBackup$backup$restoreBackup get restoreBackup { + final local$restoreBackup = _instance.restoreBackup; + return CopyWith$Mutation$RestoreBackup$backup$restoreBackup( + local$restoreBackup, (e) => call(restoreBackup: e)); + } +} + +class _CopyWithStubImpl$Mutation$RestoreBackup$backup + implements CopyWith$Mutation$RestoreBackup$backup { + _CopyWithStubImpl$Mutation$RestoreBackup$backup(this._res); + + TRes _res; + + call({ + Mutation$RestoreBackup$backup$restoreBackup? restoreBackup, + String? $__typename, + }) => + _res; + CopyWith$Mutation$RestoreBackup$backup$restoreBackup + get restoreBackup => + CopyWith$Mutation$RestoreBackup$backup$restoreBackup.stub(_res); +} + +class Mutation$RestoreBackup$backup$restoreBackup + implements Fragment$basicMutationReturnFields$$GenericJobMutationReturn { + Mutation$RestoreBackup$backup$restoreBackup({ + required this.code, + required this.message, + required this.success, + this.$__typename = 'GenericJobMutationReturn', + this.job, + }); + + factory Mutation$RestoreBackup$backup$restoreBackup.fromJson( + Map json) { + final l$code = json['code']; + final l$message = json['message']; + final l$success = json['success']; + final l$$__typename = json['__typename']; + final l$job = json['job']; + return Mutation$RestoreBackup$backup$restoreBackup( + code: (l$code as int), + message: (l$message as String), + success: (l$success as bool), + $__typename: (l$$__typename as String), + job: l$job == null + ? null + : Fragment$basicApiJobsFields.fromJson( + (l$job as Map)), + ); + } + + final int code; + + final String message; + + final bool success; + + final String $__typename; + + final Fragment$basicApiJobsFields? job; + + Map toJson() { + final _resultData = {}; + final l$code = code; + _resultData['code'] = l$code; + final l$message = message; + _resultData['message'] = l$message; + final l$success = success; + _resultData['success'] = l$success; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + final l$job = job; + _resultData['job'] = l$job?.toJson(); + return _resultData; + } + + @override + int get hashCode { + final l$code = code; + final l$message = message; + final l$success = success; + final l$$__typename = $__typename; + final l$job = job; + return Object.hashAll([ + l$code, + l$message, + l$success, + l$$__typename, + l$job, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$RestoreBackup$backup$restoreBackup) || + runtimeType != other.runtimeType) { + return false; + } + final l$code = code; + final lOther$code = other.code; + if (l$code != lOther$code) { + return false; + } + final l$message = message; + final lOther$message = other.message; + if (l$message != lOther$message) { + return false; + } + final l$success = success; + final lOther$success = other.success; + if (l$success != lOther$success) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + final l$job = job; + final lOther$job = other.job; + if (l$job != lOther$job) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$RestoreBackup$backup$restoreBackup + on Mutation$RestoreBackup$backup$restoreBackup { + CopyWith$Mutation$RestoreBackup$backup$restoreBackup< + Mutation$RestoreBackup$backup$restoreBackup> + get copyWith => CopyWith$Mutation$RestoreBackup$backup$restoreBackup( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$RestoreBackup$backup$restoreBackup { + factory CopyWith$Mutation$RestoreBackup$backup$restoreBackup( + Mutation$RestoreBackup$backup$restoreBackup instance, + TRes Function(Mutation$RestoreBackup$backup$restoreBackup) then, + ) = _CopyWithImpl$Mutation$RestoreBackup$backup$restoreBackup; + + factory CopyWith$Mutation$RestoreBackup$backup$restoreBackup.stub(TRes res) = + _CopyWithStubImpl$Mutation$RestoreBackup$backup$restoreBackup; + + TRes call({ + int? code, + String? message, + bool? success, + String? $__typename, + Fragment$basicApiJobsFields? job, + }); + CopyWith$Fragment$basicApiJobsFields get job; +} + +class _CopyWithImpl$Mutation$RestoreBackup$backup$restoreBackup + implements CopyWith$Mutation$RestoreBackup$backup$restoreBackup { + _CopyWithImpl$Mutation$RestoreBackup$backup$restoreBackup( + this._instance, + this._then, + ); + + final Mutation$RestoreBackup$backup$restoreBackup _instance; + + final TRes Function(Mutation$RestoreBackup$backup$restoreBackup) _then; + + static const _undefined = {}; + + TRes call({ + Object? code = _undefined, + Object? message = _undefined, + Object? success = _undefined, + Object? $__typename = _undefined, + Object? job = _undefined, + }) => + _then(Mutation$RestoreBackup$backup$restoreBackup( + code: + code == _undefined || code == null ? _instance.code : (code as int), + message: message == _undefined || message == null + ? _instance.message + : (message as String), + success: success == _undefined || success == null + ? _instance.success + : (success as bool), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + job: job == _undefined + ? _instance.job + : (job as Fragment$basicApiJobsFields?), + )); + CopyWith$Fragment$basicApiJobsFields get job { + final local$job = _instance.job; + return local$job == null + ? CopyWith$Fragment$basicApiJobsFields.stub(_then(_instance)) + : CopyWith$Fragment$basicApiJobsFields(local$job, (e) => call(job: e)); + } +} + +class _CopyWithStubImpl$Mutation$RestoreBackup$backup$restoreBackup + implements CopyWith$Mutation$RestoreBackup$backup$restoreBackup { + _CopyWithStubImpl$Mutation$RestoreBackup$backup$restoreBackup(this._res); + + TRes _res; + + call({ + int? code, + String? message, + bool? success, + String? $__typename, + Fragment$basicApiJobsFields? job, + }) => + _res; + CopyWith$Fragment$basicApiJobsFields get job => + CopyWith$Fragment$basicApiJobsFields.stub(_res); +} diff --git a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql index a5947f5e..e1d562d2 100644 --- a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql @@ -53,17 +53,7 @@ mutation MigrateToBinds($input: MigrateToBindsInput!) { migrateToBinds(input: $input) { ...basicMutationReturnFields job { - createdAt - description - error - finishedAt - name - progress - result - status - statusText - uid - updatedAt + ...basicApiJobsFields } } } diff --git a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart index c900dcc7..2d7939a5 100644 --- a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart @@ -1,8 +1,9 @@ import 'dart:async'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; -import 'package:selfprivacy/utils/scalars.dart'; import 'schema.graphql.dart'; +import 'server_api.graphql.dart'; +import 'services.graphql.dart'; class Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields({ @@ -5679,82 +5680,9 @@ const documentNodeMutationMigrateToBinds = DocumentNode(definitions: [ arguments: [], directives: [], selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'createdAt'), - alias: null, - arguments: [], + FragmentSpreadNode( + name: NameNode(value: 'basicApiJobsFields'), directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'description'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'error'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'finishedAt'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'progress'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'result'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'status'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'statusText'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'uid'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'updatedAt'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, ), FieldNode( name: NameNode(value: '__typename'), @@ -5784,6 +5712,7 @@ const documentNodeMutationMigrateToBinds = DocumentNode(definitions: [ ]), ), fragmentDefinitionbasicMutationReturnFields, + fragmentDefinitionbasicApiJobsFields, ]); Mutation$MigrateToBinds _parserFn$Mutation$MigrateToBinds( Map data) => @@ -5906,7 +5835,7 @@ class Mutation$MigrateToBinds$migrateToBinds $__typename: (l$$__typename as String), job: l$job == null ? null - : Mutation$MigrateToBinds$migrateToBinds$job.fromJson( + : Fragment$basicApiJobsFields.fromJson( (l$job as Map)), ); } @@ -5919,7 +5848,7 @@ class Mutation$MigrateToBinds$migrateToBinds final String $__typename; - final Mutation$MigrateToBinds$migrateToBinds$job? job; + final Fragment$basicApiJobsFields? job; Map toJson() { final _resultData = {}; @@ -6014,9 +5943,9 @@ abstract class CopyWith$Mutation$MigrateToBinds$migrateToBinds { String? message, bool? success, String? $__typename, - Mutation$MigrateToBinds$migrateToBinds$job? job, + Fragment$basicApiJobsFields? job, }); - CopyWith$Mutation$MigrateToBinds$migrateToBinds$job get job; + CopyWith$Fragment$basicApiJobsFields get job; } class _CopyWithImpl$Mutation$MigrateToBinds$migrateToBinds @@ -6053,15 +5982,13 @@ class _CopyWithImpl$Mutation$MigrateToBinds$migrateToBinds : ($__typename as String), job: job == _undefined ? _instance.job - : (job as Mutation$MigrateToBinds$migrateToBinds$job?), + : (job as Fragment$basicApiJobsFields?), )); - CopyWith$Mutation$MigrateToBinds$migrateToBinds$job get job { + CopyWith$Fragment$basicApiJobsFields get job { final local$job = _instance.job; return local$job == null - ? CopyWith$Mutation$MigrateToBinds$migrateToBinds$job.stub( - _then(_instance)) - : CopyWith$Mutation$MigrateToBinds$migrateToBinds$job( - local$job, (e) => call(job: e)); + ? CopyWith$Fragment$basicApiJobsFields.stub(_then(_instance)) + : CopyWith$Fragment$basicApiJobsFields(local$job, (e) => call(job: e)); } } @@ -6076,330 +6003,9 @@ class _CopyWithStubImpl$Mutation$MigrateToBinds$migrateToBinds String? message, bool? success, String? $__typename, - Mutation$MigrateToBinds$migrateToBinds$job? job, - }) => - _res; - CopyWith$Mutation$MigrateToBinds$migrateToBinds$job get job => - CopyWith$Mutation$MigrateToBinds$migrateToBinds$job.stub(_res); -} - -class Mutation$MigrateToBinds$migrateToBinds$job { - Mutation$MigrateToBinds$migrateToBinds$job({ - required this.createdAt, - required this.description, - this.error, - this.finishedAt, - required this.name, - this.progress, - this.result, - required this.status, - this.statusText, - required this.uid, - required this.updatedAt, - this.$__typename = 'ApiJob', - }); - - factory Mutation$MigrateToBinds$migrateToBinds$job.fromJson( - Map json) { - final l$createdAt = json['createdAt']; - final l$description = json['description']; - final l$error = json['error']; - final l$finishedAt = json['finishedAt']; - final l$name = json['name']; - final l$progress = json['progress']; - final l$result = json['result']; - final l$status = json['status']; - final l$statusText = json['statusText']; - final l$uid = json['uid']; - final l$updatedAt = json['updatedAt']; - final l$$__typename = json['__typename']; - return Mutation$MigrateToBinds$migrateToBinds$job( - createdAt: dateTimeFromJson(l$createdAt), - description: (l$description as String), - error: (l$error as String?), - finishedAt: l$finishedAt == null ? null : dateTimeFromJson(l$finishedAt), - name: (l$name as String), - progress: (l$progress as int?), - result: (l$result as String?), - status: (l$status as String), - statusText: (l$statusText as String?), - uid: (l$uid as String), - updatedAt: dateTimeFromJson(l$updatedAt), - $__typename: (l$$__typename as String), - ); - } - - final DateTime createdAt; - - final String description; - - final String? error; - - final DateTime? finishedAt; - - final String name; - - final int? progress; - - final String? result; - - final String status; - - final String? statusText; - - final String uid; - - final DateTime updatedAt; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$createdAt = createdAt; - _resultData['createdAt'] = dateTimeToJson(l$createdAt); - final l$description = description; - _resultData['description'] = l$description; - final l$error = error; - _resultData['error'] = l$error; - final l$finishedAt = finishedAt; - _resultData['finishedAt'] = - l$finishedAt == null ? null : dateTimeToJson(l$finishedAt); - final l$name = name; - _resultData['name'] = l$name; - final l$progress = progress; - _resultData['progress'] = l$progress; - final l$result = result; - _resultData['result'] = l$result; - final l$status = status; - _resultData['status'] = l$status; - final l$statusText = statusText; - _resultData['statusText'] = l$statusText; - final l$uid = uid; - _resultData['uid'] = l$uid; - final l$updatedAt = updatedAt; - _resultData['updatedAt'] = dateTimeToJson(l$updatedAt); - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$createdAt = createdAt; - final l$description = description; - final l$error = error; - final l$finishedAt = finishedAt; - final l$name = name; - final l$progress = progress; - final l$result = result; - final l$status = status; - final l$statusText = statusText; - final l$uid = uid; - final l$updatedAt = updatedAt; - final l$$__typename = $__typename; - return Object.hashAll([ - l$createdAt, - l$description, - l$error, - l$finishedAt, - l$name, - l$progress, - l$result, - l$status, - l$statusText, - l$uid, - l$updatedAt, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Mutation$MigrateToBinds$migrateToBinds$job) || - runtimeType != other.runtimeType) { - return false; - } - final l$createdAt = createdAt; - final lOther$createdAt = other.createdAt; - if (l$createdAt != lOther$createdAt) { - return false; - } - final l$description = description; - final lOther$description = other.description; - if (l$description != lOther$description) { - return false; - } - final l$error = error; - final lOther$error = other.error; - if (l$error != lOther$error) { - return false; - } - final l$finishedAt = finishedAt; - final lOther$finishedAt = other.finishedAt; - if (l$finishedAt != lOther$finishedAt) { - return false; - } - final l$name = name; - final lOther$name = other.name; - if (l$name != lOther$name) { - return false; - } - final l$progress = progress; - final lOther$progress = other.progress; - if (l$progress != lOther$progress) { - return false; - } - final l$result = result; - final lOther$result = other.result; - if (l$result != lOther$result) { - return false; - } - final l$status = status; - final lOther$status = other.status; - if (l$status != lOther$status) { - return false; - } - final l$statusText = statusText; - final lOther$statusText = other.statusText; - if (l$statusText != lOther$statusText) { - return false; - } - final l$uid = uid; - final lOther$uid = other.uid; - if (l$uid != lOther$uid) { - return false; - } - final l$updatedAt = updatedAt; - final lOther$updatedAt = other.updatedAt; - if (l$updatedAt != lOther$updatedAt) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Mutation$MigrateToBinds$migrateToBinds$job - on Mutation$MigrateToBinds$migrateToBinds$job { - CopyWith$Mutation$MigrateToBinds$migrateToBinds$job< - Mutation$MigrateToBinds$migrateToBinds$job> - get copyWith => CopyWith$Mutation$MigrateToBinds$migrateToBinds$job( - this, - (i) => i, - ); -} - -abstract class CopyWith$Mutation$MigrateToBinds$migrateToBinds$job { - factory CopyWith$Mutation$MigrateToBinds$migrateToBinds$job( - Mutation$MigrateToBinds$migrateToBinds$job instance, - TRes Function(Mutation$MigrateToBinds$migrateToBinds$job) then, - ) = _CopyWithImpl$Mutation$MigrateToBinds$migrateToBinds$job; - - factory CopyWith$Mutation$MigrateToBinds$migrateToBinds$job.stub(TRes res) = - _CopyWithStubImpl$Mutation$MigrateToBinds$migrateToBinds$job; - - TRes call({ - DateTime? createdAt, - String? description, - String? error, - DateTime? finishedAt, - String? name, - int? progress, - String? result, - String? status, - String? statusText, - String? uid, - DateTime? updatedAt, - String? $__typename, - }); -} - -class _CopyWithImpl$Mutation$MigrateToBinds$migrateToBinds$job - implements CopyWith$Mutation$MigrateToBinds$migrateToBinds$job { - _CopyWithImpl$Mutation$MigrateToBinds$migrateToBinds$job( - this._instance, - this._then, - ); - - final Mutation$MigrateToBinds$migrateToBinds$job _instance; - - final TRes Function(Mutation$MigrateToBinds$migrateToBinds$job) _then; - - static const _undefined = {}; - - TRes call({ - Object? createdAt = _undefined, - Object? description = _undefined, - Object? error = _undefined, - Object? finishedAt = _undefined, - Object? name = _undefined, - Object? progress = _undefined, - Object? result = _undefined, - Object? status = _undefined, - Object? statusText = _undefined, - Object? uid = _undefined, - Object? updatedAt = _undefined, - Object? $__typename = _undefined, - }) => - _then(Mutation$MigrateToBinds$migrateToBinds$job( - createdAt: createdAt == _undefined || createdAt == null - ? _instance.createdAt - : (createdAt as DateTime), - description: description == _undefined || description == null - ? _instance.description - : (description as String), - error: error == _undefined ? _instance.error : (error as String?), - finishedAt: finishedAt == _undefined - ? _instance.finishedAt - : (finishedAt as DateTime?), - name: name == _undefined || name == null - ? _instance.name - : (name as String), - progress: - progress == _undefined ? _instance.progress : (progress as int?), - result: result == _undefined ? _instance.result : (result as String?), - status: status == _undefined || status == null - ? _instance.status - : (status as String), - statusText: statusText == _undefined - ? _instance.statusText - : (statusText as String?), - uid: uid == _undefined || uid == null ? _instance.uid : (uid as String), - updatedAt: updatedAt == _undefined || updatedAt == null - ? _instance.updatedAt - : (updatedAt as DateTime), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Mutation$MigrateToBinds$migrateToBinds$job - implements CopyWith$Mutation$MigrateToBinds$migrateToBinds$job { - _CopyWithStubImpl$Mutation$MigrateToBinds$migrateToBinds$job(this._res); - - TRes _res; - - call({ - DateTime? createdAt, - String? description, - String? error, - DateTime? finishedAt, - String? name, - int? progress, - String? result, - String? status, - String? statusText, - String? uid, - DateTime? updatedAt, - String? $__typename, + Fragment$basicApiJobsFields? job, }) => _res; + CopyWith$Fragment$basicApiJobsFields get job => + CopyWith$Fragment$basicApiJobsFields.stub(_res); } diff --git a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql index 9797e81f..631454db 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql @@ -4,6 +4,21 @@ fragment basicMutationReturnFields on MutationReturnInterface{ success } +fragment basicApiJobsFields on ApiJob{ + createdAt + description + error + finishedAt + name + progress + result + status + statusText + uid + typeId + updatedAt +} + query GetApiVersion { api { version @@ -13,18 +28,7 @@ query GetApiVersion { query GetApiJobs { jobs { getJobs { - createdAt - description - error - finishedAt - name - progress - result - status - statusText - uid - typeId - updatedAt + ...basicApiJobsFields } } } diff --git a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart index 7c09fbb7..75b1f344 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart @@ -1,9 +1,9 @@ import 'dart:async'; -import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'package:selfprivacy/utils/scalars.dart'; import 'schema.graphql.dart'; +import 'services.graphql.dart'; class Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields({ @@ -2283,6 +2283,486 @@ class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$UserMutationReturn< _res; } +class Fragment$basicApiJobsFields { + Fragment$basicApiJobsFields({ + required this.createdAt, + required this.description, + this.error, + this.finishedAt, + required this.name, + this.progress, + this.result, + required this.status, + this.statusText, + required this.uid, + required this.typeId, + required this.updatedAt, + this.$__typename = 'ApiJob', + }); + + factory Fragment$basicApiJobsFields.fromJson(Map json) { + final l$createdAt = json['createdAt']; + final l$description = json['description']; + final l$error = json['error']; + final l$finishedAt = json['finishedAt']; + final l$name = json['name']; + final l$progress = json['progress']; + final l$result = json['result']; + final l$status = json['status']; + final l$statusText = json['statusText']; + final l$uid = json['uid']; + final l$typeId = json['typeId']; + final l$updatedAt = json['updatedAt']; + final l$$__typename = json['__typename']; + return Fragment$basicApiJobsFields( + createdAt: dateTimeFromJson(l$createdAt), + description: (l$description as String), + error: (l$error as String?), + finishedAt: l$finishedAt == null ? null : dateTimeFromJson(l$finishedAt), + name: (l$name as String), + progress: (l$progress as int?), + result: (l$result as String?), + status: (l$status as String), + statusText: (l$statusText as String?), + uid: (l$uid as String), + typeId: (l$typeId as String), + updatedAt: dateTimeFromJson(l$updatedAt), + $__typename: (l$$__typename as String), + ); + } + + final DateTime createdAt; + + final String description; + + final String? error; + + final DateTime? finishedAt; + + final String name; + + final int? progress; + + final String? result; + + final String status; + + final String? statusText; + + final String uid; + + final String typeId; + + final DateTime updatedAt; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$createdAt = createdAt; + _resultData['createdAt'] = dateTimeToJson(l$createdAt); + final l$description = description; + _resultData['description'] = l$description; + final l$error = error; + _resultData['error'] = l$error; + final l$finishedAt = finishedAt; + _resultData['finishedAt'] = + l$finishedAt == null ? null : dateTimeToJson(l$finishedAt); + final l$name = name; + _resultData['name'] = l$name; + final l$progress = progress; + _resultData['progress'] = l$progress; + final l$result = result; + _resultData['result'] = l$result; + final l$status = status; + _resultData['status'] = l$status; + final l$statusText = statusText; + _resultData['statusText'] = l$statusText; + final l$uid = uid; + _resultData['uid'] = l$uid; + final l$typeId = typeId; + _resultData['typeId'] = l$typeId; + final l$updatedAt = updatedAt; + _resultData['updatedAt'] = dateTimeToJson(l$updatedAt); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$createdAt = createdAt; + final l$description = description; + final l$error = error; + final l$finishedAt = finishedAt; + final l$name = name; + final l$progress = progress; + final l$result = result; + final l$status = status; + final l$statusText = statusText; + final l$uid = uid; + final l$typeId = typeId; + final l$updatedAt = updatedAt; + final l$$__typename = $__typename; + return Object.hashAll([ + l$createdAt, + l$description, + l$error, + l$finishedAt, + l$name, + l$progress, + l$result, + l$status, + l$statusText, + l$uid, + l$typeId, + l$updatedAt, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Fragment$basicApiJobsFields) || + runtimeType != other.runtimeType) { + return false; + } + final l$createdAt = createdAt; + final lOther$createdAt = other.createdAt; + if (l$createdAt != lOther$createdAt) { + return false; + } + final l$description = description; + final lOther$description = other.description; + if (l$description != lOther$description) { + return false; + } + final l$error = error; + final lOther$error = other.error; + if (l$error != lOther$error) { + return false; + } + final l$finishedAt = finishedAt; + final lOther$finishedAt = other.finishedAt; + if (l$finishedAt != lOther$finishedAt) { + return false; + } + final l$name = name; + final lOther$name = other.name; + if (l$name != lOther$name) { + return false; + } + final l$progress = progress; + final lOther$progress = other.progress; + if (l$progress != lOther$progress) { + return false; + } + final l$result = result; + final lOther$result = other.result; + if (l$result != lOther$result) { + return false; + } + final l$status = status; + final lOther$status = other.status; + if (l$status != lOther$status) { + return false; + } + final l$statusText = statusText; + final lOther$statusText = other.statusText; + if (l$statusText != lOther$statusText) { + return false; + } + final l$uid = uid; + final lOther$uid = other.uid; + if (l$uid != lOther$uid) { + return false; + } + final l$typeId = typeId; + final lOther$typeId = other.typeId; + if (l$typeId != lOther$typeId) { + return false; + } + final l$updatedAt = updatedAt; + final lOther$updatedAt = other.updatedAt; + if (l$updatedAt != lOther$updatedAt) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$basicApiJobsFields + on Fragment$basicApiJobsFields { + CopyWith$Fragment$basicApiJobsFields + get copyWith => CopyWith$Fragment$basicApiJobsFields( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$basicApiJobsFields { + factory CopyWith$Fragment$basicApiJobsFields( + Fragment$basicApiJobsFields instance, + TRes Function(Fragment$basicApiJobsFields) then, + ) = _CopyWithImpl$Fragment$basicApiJobsFields; + + factory CopyWith$Fragment$basicApiJobsFields.stub(TRes res) = + _CopyWithStubImpl$Fragment$basicApiJobsFields; + + TRes call({ + DateTime? createdAt, + String? description, + String? error, + DateTime? finishedAt, + String? name, + int? progress, + String? result, + String? status, + String? statusText, + String? uid, + String? typeId, + DateTime? updatedAt, + String? $__typename, + }); +} + +class _CopyWithImpl$Fragment$basicApiJobsFields + implements CopyWith$Fragment$basicApiJobsFields { + _CopyWithImpl$Fragment$basicApiJobsFields( + this._instance, + this._then, + ); + + final Fragment$basicApiJobsFields _instance; + + final TRes Function(Fragment$basicApiJobsFields) _then; + + static const _undefined = {}; + + TRes call({ + Object? createdAt = _undefined, + Object? description = _undefined, + Object? error = _undefined, + Object? finishedAt = _undefined, + Object? name = _undefined, + Object? progress = _undefined, + Object? result = _undefined, + Object? status = _undefined, + Object? statusText = _undefined, + Object? uid = _undefined, + Object? typeId = _undefined, + Object? updatedAt = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$basicApiJobsFields( + createdAt: createdAt == _undefined || createdAt == null + ? _instance.createdAt + : (createdAt as DateTime), + description: description == _undefined || description == null + ? _instance.description + : (description as String), + error: error == _undefined ? _instance.error : (error as String?), + finishedAt: finishedAt == _undefined + ? _instance.finishedAt + : (finishedAt as DateTime?), + name: name == _undefined || name == null + ? _instance.name + : (name as String), + progress: + progress == _undefined ? _instance.progress : (progress as int?), + result: result == _undefined ? _instance.result : (result as String?), + status: status == _undefined || status == null + ? _instance.status + : (status as String), + statusText: statusText == _undefined + ? _instance.statusText + : (statusText as String?), + uid: uid == _undefined || uid == null ? _instance.uid : (uid as String), + typeId: typeId == _undefined || typeId == null + ? _instance.typeId + : (typeId as String), + updatedAt: updatedAt == _undefined || updatedAt == null + ? _instance.updatedAt + : (updatedAt as DateTime), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Fragment$basicApiJobsFields + implements CopyWith$Fragment$basicApiJobsFields { + _CopyWithStubImpl$Fragment$basicApiJobsFields(this._res); + + TRes _res; + + call({ + DateTime? createdAt, + String? description, + String? error, + DateTime? finishedAt, + String? name, + int? progress, + String? result, + String? status, + String? statusText, + String? uid, + String? typeId, + DateTime? updatedAt, + String? $__typename, + }) => + _res; +} + +const fragmentDefinitionbasicApiJobsFields = FragmentDefinitionNode( + name: NameNode(value: 'basicApiJobsFields'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'ApiJob'), + isNonNull: false, + )), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'createdAt'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'description'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'error'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'finishedAt'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'progress'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'result'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'status'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'statusText'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'uid'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'typeId'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'updatedAt'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), +); +const documentNodeFragmentbasicApiJobsFields = DocumentNode(definitions: [ + fragmentDefinitionbasicApiJobsFields, +]); + +extension ClientExtension$Fragment$basicApiJobsFields on graphql.GraphQLClient { + void writeFragment$basicApiJobsFields({ + required Fragment$basicApiJobsFields data, + required Map idFields, + bool broadcast = true, + }) => + this.writeFragment( + graphql.FragmentRequest( + idFields: idFields, + fragment: const graphql.Fragment( + fragmentName: 'basicApiJobsFields', + document: documentNodeFragmentbasicApiJobsFields, + ), + ), + data: data.toJson(), + broadcast: broadcast, + ); + Fragment$basicApiJobsFields? readFragment$basicApiJobsFields({ + required Map idFields, + bool optimistic = true, + }) { + final result = this.readFragment( + graphql.FragmentRequest( + idFields: idFields, + fragment: const graphql.Fragment( + fragmentName: 'basicApiJobsFields', + document: documentNodeFragmentbasicApiJobsFields, + ), + ), + optimistic: optimistic, + ); + return result == null ? null : Fragment$basicApiJobsFields.fromJson(result); + } +} + class Query$GetApiVersion { Query$GetApiVersion({ required this.api, @@ -2844,89 +3324,9 @@ const documentNodeQueryGetApiJobs = DocumentNode(definitions: [ arguments: [], directives: [], selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'createdAt'), - alias: null, - arguments: [], + FragmentSpreadNode( + name: NameNode(value: 'basicApiJobsFields'), directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'description'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'error'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'finishedAt'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'progress'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'result'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'status'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'statusText'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'uid'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'typeId'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'updatedAt'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, ), FieldNode( name: NameNode(value: '__typename'), @@ -2955,6 +3355,7 @@ const documentNodeQueryGetApiJobs = DocumentNode(definitions: [ ), ]), ), + fragmentDefinitionbasicApiJobsFields, ]); Query$GetApiJobs _parserFn$Query$GetApiJobs(Map data) => Query$GetApiJobs.fromJson(data); @@ -3083,14 +3484,14 @@ class Query$GetApiJobs$jobs { final l$$__typename = json['__typename']; return Query$GetApiJobs$jobs( getJobs: (l$getJobs as List) - .map((e) => Query$GetApiJobs$jobs$getJobs.fromJson( - (e as Map))) + .map((e) => + Fragment$basicApiJobsFields.fromJson((e as Map))) .toList(), $__typename: (l$$__typename as String), ); } - final List getJobs; + final List getJobs; final String $__typename; @@ -3160,14 +3561,14 @@ abstract class CopyWith$Query$GetApiJobs$jobs { _CopyWithStubImpl$Query$GetApiJobs$jobs; TRes call({ - List? getJobs, + List? getJobs, String? $__typename, }); TRes getJobs( - Iterable Function( + Iterable Function( Iterable< - CopyWith$Query$GetApiJobs$jobs$getJobs< - Query$GetApiJobs$jobs$getJobs>>) + CopyWith$Fragment$basicApiJobsFields< + Fragment$basicApiJobsFields>>) _fn); } @@ -3191,20 +3592,20 @@ class _CopyWithImpl$Query$GetApiJobs$jobs _then(Query$GetApiJobs$jobs( getJobs: getJobs == _undefined || getJobs == null ? _instance.getJobs - : (getJobs as List), + : (getJobs as List), $__typename: $__typename == _undefined || $__typename == null ? _instance.$__typename : ($__typename as String), )); TRes getJobs( - Iterable Function( + Iterable Function( Iterable< - CopyWith$Query$GetApiJobs$jobs$getJobs< - Query$GetApiJobs$jobs$getJobs>>) + CopyWith$Fragment$basicApiJobsFields< + Fragment$basicApiJobsFields>>) _fn) => call( - getJobs: _fn(_instance.getJobs - .map((e) => CopyWith$Query$GetApiJobs$jobs$getJobs( + getJobs: _fn( + _instance.getJobs.map((e) => CopyWith$Fragment$basicApiJobsFields( e, (i) => i, ))).toList()); @@ -3217,352 +3618,13 @@ class _CopyWithStubImpl$Query$GetApiJobs$jobs TRes _res; call({ - List? getJobs, + List? getJobs, String? $__typename, }) => _res; getJobs(_fn) => _res; } -class Query$GetApiJobs$jobs$getJobs { - Query$GetApiJobs$jobs$getJobs({ - required this.createdAt, - required this.description, - this.error, - this.finishedAt, - required this.name, - this.progress, - this.result, - required this.status, - this.statusText, - required this.uid, - required this.typeId, - required this.updatedAt, - this.$__typename = 'ApiJob', - }); - - factory Query$GetApiJobs$jobs$getJobs.fromJson(Map json) { - final l$createdAt = json['createdAt']; - final l$description = json['description']; - final l$error = json['error']; - final l$finishedAt = json['finishedAt']; - final l$name = json['name']; - final l$progress = json['progress']; - final l$result = json['result']; - final l$status = json['status']; - final l$statusText = json['statusText']; - final l$uid = json['uid']; - final l$typeId = json['typeId']; - final l$updatedAt = json['updatedAt']; - final l$$__typename = json['__typename']; - return Query$GetApiJobs$jobs$getJobs( - createdAt: dateTimeFromJson(l$createdAt), - description: (l$description as String), - error: (l$error as String?), - finishedAt: l$finishedAt == null ? null : dateTimeFromJson(l$finishedAt), - name: (l$name as String), - progress: (l$progress as int?), - result: (l$result as String?), - status: (l$status as String), - statusText: (l$statusText as String?), - uid: (l$uid as String), - typeId: (l$typeId as String), - updatedAt: dateTimeFromJson(l$updatedAt), - $__typename: (l$$__typename as String), - ); - } - - final DateTime createdAt; - - final String description; - - final String? error; - - final DateTime? finishedAt; - - final String name; - - final int? progress; - - final String? result; - - final String status; - - final String? statusText; - - final String uid; - - final String typeId; - - final DateTime updatedAt; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$createdAt = createdAt; - _resultData['createdAt'] = dateTimeToJson(l$createdAt); - final l$description = description; - _resultData['description'] = l$description; - final l$error = error; - _resultData['error'] = l$error; - final l$finishedAt = finishedAt; - _resultData['finishedAt'] = - l$finishedAt == null ? null : dateTimeToJson(l$finishedAt); - final l$name = name; - _resultData['name'] = l$name; - final l$progress = progress; - _resultData['progress'] = l$progress; - final l$result = result; - _resultData['result'] = l$result; - final l$status = status; - _resultData['status'] = l$status; - final l$statusText = statusText; - _resultData['statusText'] = l$statusText; - final l$uid = uid; - _resultData['uid'] = l$uid; - final l$typeId = typeId; - _resultData['typeId'] = l$typeId; - final l$updatedAt = updatedAt; - _resultData['updatedAt'] = dateTimeToJson(l$updatedAt); - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$createdAt = createdAt; - final l$description = description; - final l$error = error; - final l$finishedAt = finishedAt; - final l$name = name; - final l$progress = progress; - final l$result = result; - final l$status = status; - final l$statusText = statusText; - final l$uid = uid; - final l$typeId = typeId; - final l$updatedAt = updatedAt; - final l$$__typename = $__typename; - return Object.hashAll([ - l$createdAt, - l$description, - l$error, - l$finishedAt, - l$name, - l$progress, - l$result, - l$status, - l$statusText, - l$uid, - l$typeId, - l$updatedAt, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Query$GetApiJobs$jobs$getJobs) || - runtimeType != other.runtimeType) { - return false; - } - final l$createdAt = createdAt; - final lOther$createdAt = other.createdAt; - if (l$createdAt != lOther$createdAt) { - return false; - } - final l$description = description; - final lOther$description = other.description; - if (l$description != lOther$description) { - return false; - } - final l$error = error; - final lOther$error = other.error; - if (l$error != lOther$error) { - return false; - } - final l$finishedAt = finishedAt; - final lOther$finishedAt = other.finishedAt; - if (l$finishedAt != lOther$finishedAt) { - return false; - } - final l$name = name; - final lOther$name = other.name; - if (l$name != lOther$name) { - return false; - } - final l$progress = progress; - final lOther$progress = other.progress; - if (l$progress != lOther$progress) { - return false; - } - final l$result = result; - final lOther$result = other.result; - if (l$result != lOther$result) { - return false; - } - final l$status = status; - final lOther$status = other.status; - if (l$status != lOther$status) { - return false; - } - final l$statusText = statusText; - final lOther$statusText = other.statusText; - if (l$statusText != lOther$statusText) { - return false; - } - final l$uid = uid; - final lOther$uid = other.uid; - if (l$uid != lOther$uid) { - return false; - } - final l$typeId = typeId; - final lOther$typeId = other.typeId; - if (l$typeId != lOther$typeId) { - return false; - } - final l$updatedAt = updatedAt; - final lOther$updatedAt = other.updatedAt; - if (l$updatedAt != lOther$updatedAt) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Query$GetApiJobs$jobs$getJobs - on Query$GetApiJobs$jobs$getJobs { - CopyWith$Query$GetApiJobs$jobs$getJobs - get copyWith => CopyWith$Query$GetApiJobs$jobs$getJobs( - this, - (i) => i, - ); -} - -abstract class CopyWith$Query$GetApiJobs$jobs$getJobs { - factory CopyWith$Query$GetApiJobs$jobs$getJobs( - Query$GetApiJobs$jobs$getJobs instance, - TRes Function(Query$GetApiJobs$jobs$getJobs) then, - ) = _CopyWithImpl$Query$GetApiJobs$jobs$getJobs; - - factory CopyWith$Query$GetApiJobs$jobs$getJobs.stub(TRes res) = - _CopyWithStubImpl$Query$GetApiJobs$jobs$getJobs; - - TRes call({ - DateTime? createdAt, - String? description, - String? error, - DateTime? finishedAt, - String? name, - int? progress, - String? result, - String? status, - String? statusText, - String? uid, - String? typeId, - DateTime? updatedAt, - String? $__typename, - }); -} - -class _CopyWithImpl$Query$GetApiJobs$jobs$getJobs - implements CopyWith$Query$GetApiJobs$jobs$getJobs { - _CopyWithImpl$Query$GetApiJobs$jobs$getJobs( - this._instance, - this._then, - ); - - final Query$GetApiJobs$jobs$getJobs _instance; - - final TRes Function(Query$GetApiJobs$jobs$getJobs) _then; - - static const _undefined = {}; - - TRes call({ - Object? createdAt = _undefined, - Object? description = _undefined, - Object? error = _undefined, - Object? finishedAt = _undefined, - Object? name = _undefined, - Object? progress = _undefined, - Object? result = _undefined, - Object? status = _undefined, - Object? statusText = _undefined, - Object? uid = _undefined, - Object? typeId = _undefined, - Object? updatedAt = _undefined, - Object? $__typename = _undefined, - }) => - _then(Query$GetApiJobs$jobs$getJobs( - createdAt: createdAt == _undefined || createdAt == null - ? _instance.createdAt - : (createdAt as DateTime), - description: description == _undefined || description == null - ? _instance.description - : (description as String), - error: error == _undefined ? _instance.error : (error as String?), - finishedAt: finishedAt == _undefined - ? _instance.finishedAt - : (finishedAt as DateTime?), - name: name == _undefined || name == null - ? _instance.name - : (name as String), - progress: - progress == _undefined ? _instance.progress : (progress as int?), - result: result == _undefined ? _instance.result : (result as String?), - status: status == _undefined || status == null - ? _instance.status - : (status as String), - statusText: statusText == _undefined - ? _instance.statusText - : (statusText as String?), - uid: uid == _undefined || uid == null ? _instance.uid : (uid as String), - typeId: typeId == _undefined || typeId == null - ? _instance.typeId - : (typeId as String), - updatedAt: updatedAt == _undefined || updatedAt == null - ? _instance.updatedAt - : (updatedAt as DateTime), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Query$GetApiJobs$jobs$getJobs - implements CopyWith$Query$GetApiJobs$jobs$getJobs { - _CopyWithStubImpl$Query$GetApiJobs$jobs$getJobs(this._res); - - TRes _res; - - call({ - DateTime? createdAt, - String? description, - String? error, - DateTime? finishedAt, - String? name, - int? progress, - String? result, - String? status, - String? statusText, - String? uid, - String? typeId, - DateTime? updatedAt, - String? $__typename, - }) => - _res; -} - class Variables$Mutation$RemoveJob { factory Variables$Mutation$RemoveJob({required String jobId}) => Variables$Mutation$RemoveJob._({ diff --git a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart index ae8aabcb..abbba037 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart @@ -1,8 +1,8 @@ import 'dart:async'; -import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'schema.graphql.dart'; +import 'services.graphql.dart'; class Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields({ diff --git a/lib/logic/api_maps/graphql_maps/schema/services.graphql b/lib/logic/api_maps/graphql_maps/schema/services.graphql index c27b568c..104d22b8 100644 --- a/lib/logic/api_maps/graphql_maps/schema/services.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/services.graphql @@ -65,17 +65,7 @@ mutation MoveService($input: MoveServiceInput!) { moveService(input: $input) { ...basicMutationReturnFields job { - createdAt - description - error - finishedAt - name - progress - result - status - statusText - uid - updatedAt + ...basicApiJobsFields } } } diff --git a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart index 2fbf6c3d..e2cd4056 100644 --- a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart @@ -1,9 +1,8 @@ import 'dart:async'; -import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; -import 'package:selfprivacy/utils/scalars.dart'; import 'schema.graphql.dart'; +import 'server_api.graphql.dart'; import 'server_settings.graphql.dart'; class Fragment$basicMutationReturnFields { @@ -2496,6 +2495,13 @@ const documentNodeQueryAllServices = DocumentNode(definitions: [ directives: [], selectionSet: null, ), + FieldNode( + name: NameNode(value: 'canBeBackedUp'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), FieldNode( name: NameNode(value: 'status'), alias: null, @@ -2877,6 +2883,7 @@ class Query$AllServices$services$allServices { required this.isEnabled, required this.isMovable, required this.isRequired, + required this.canBeBackedUp, required this.status, required this.storageUsage, required this.svgIcon, @@ -2893,6 +2900,7 @@ class Query$AllServices$services$allServices { final l$isEnabled = json['isEnabled']; final l$isMovable = json['isMovable']; final l$isRequired = json['isRequired']; + final l$canBeBackedUp = json['canBeBackedUp']; final l$status = json['status']; final l$storageUsage = json['storageUsage']; final l$svgIcon = json['svgIcon']; @@ -2909,6 +2917,7 @@ class Query$AllServices$services$allServices { isEnabled: (l$isEnabled as bool), isMovable: (l$isMovable as bool), isRequired: (l$isRequired as bool), + canBeBackedUp: (l$canBeBackedUp as bool), status: fromJson$Enum$ServiceStatusEnum((l$status as String)), storageUsage: Query$AllServices$services$allServices$storageUsage.fromJson( @@ -2933,6 +2942,8 @@ class Query$AllServices$services$allServices { final bool isRequired; + final bool canBeBackedUp; + final Enum$ServiceStatusEnum status; final Query$AllServices$services$allServices$storageUsage storageUsage; @@ -2959,6 +2970,8 @@ class Query$AllServices$services$allServices { _resultData['isMovable'] = l$isMovable; final l$isRequired = isRequired; _resultData['isRequired'] = l$isRequired; + final l$canBeBackedUp = canBeBackedUp; + _resultData['canBeBackedUp'] = l$canBeBackedUp; final l$status = status; _resultData['status'] = toJson$Enum$ServiceStatusEnum(l$status); final l$storageUsage = storageUsage; @@ -2981,6 +2994,7 @@ class Query$AllServices$services$allServices { final l$isEnabled = isEnabled; final l$isMovable = isMovable; final l$isRequired = isRequired; + final l$canBeBackedUp = canBeBackedUp; final l$status = status; final l$storageUsage = storageUsage; final l$svgIcon = svgIcon; @@ -2994,6 +3008,7 @@ class Query$AllServices$services$allServices { l$isEnabled, l$isMovable, l$isRequired, + l$canBeBackedUp, l$status, l$storageUsage, l$svgIcon, @@ -3057,6 +3072,11 @@ class Query$AllServices$services$allServices { if (l$isRequired != lOther$isRequired) { return false; } + final l$canBeBackedUp = canBeBackedUp; + final lOther$canBeBackedUp = other.canBeBackedUp; + if (l$canBeBackedUp != lOther$canBeBackedUp) { + return false; + } final l$status = status; final lOther$status = other.status; if (l$status != lOther$status) { @@ -3113,6 +3133,7 @@ abstract class CopyWith$Query$AllServices$services$allServices { bool? isEnabled, bool? isMovable, bool? isRequired, + bool? canBeBackedUp, Enum$ServiceStatusEnum? status, Query$AllServices$services$allServices$storageUsage? storageUsage, String? svgIcon, @@ -3150,6 +3171,7 @@ class _CopyWithImpl$Query$AllServices$services$allServices Object? isEnabled = _undefined, Object? isMovable = _undefined, Object? isRequired = _undefined, + Object? canBeBackedUp = _undefined, Object? status = _undefined, Object? storageUsage = _undefined, Object? svgIcon = _undefined, @@ -3176,6 +3198,9 @@ class _CopyWithImpl$Query$AllServices$services$allServices isRequired: isRequired == _undefined || isRequired == null ? _instance.isRequired : (isRequired as bool), + canBeBackedUp: canBeBackedUp == _undefined || canBeBackedUp == null + ? _instance.canBeBackedUp + : (canBeBackedUp as bool), status: status == _undefined || status == null ? _instance.status : (status as Enum$ServiceStatusEnum), @@ -3225,6 +3250,7 @@ class _CopyWithStubImpl$Query$AllServices$services$allServices bool? isEnabled, bool? isMovable, bool? isRequired, + bool? canBeBackedUp, Enum$ServiceStatusEnum? status, Query$AllServices$services$allServices$storageUsage? storageUsage, String? svgIcon, @@ -6561,82 +6587,9 @@ const documentNodeMutationMoveService = DocumentNode(definitions: [ arguments: [], directives: [], selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'createdAt'), - alias: null, - arguments: [], + FragmentSpreadNode( + name: NameNode(value: 'basicApiJobsFields'), directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'description'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'error'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'finishedAt'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'progress'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'result'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'status'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'statusText'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'uid'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'updatedAt'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, ), FieldNode( name: NameNode(value: '__typename'), @@ -6666,6 +6619,7 @@ const documentNodeMutationMoveService = DocumentNode(definitions: [ ]), ), fragmentDefinitionbasicMutationReturnFields, + fragmentDefinitionbasicApiJobsFields, ]); Mutation$MoveService _parserFn$Mutation$MoveService( Map data) => @@ -6785,7 +6739,7 @@ class Mutation$MoveService$moveService $__typename: (l$$__typename as String), job: l$job == null ? null - : Mutation$MoveService$moveService$job.fromJson( + : Fragment$basicApiJobsFields.fromJson( (l$job as Map)), ); } @@ -6798,7 +6752,7 @@ class Mutation$MoveService$moveService final String $__typename; - final Mutation$MoveService$moveService$job? job; + final Fragment$basicApiJobsFields? job; Map toJson() { final _resultData = {}; @@ -6892,9 +6846,9 @@ abstract class CopyWith$Mutation$MoveService$moveService { String? message, bool? success, String? $__typename, - Mutation$MoveService$moveService$job? job, + Fragment$basicApiJobsFields? job, }); - CopyWith$Mutation$MoveService$moveService$job get job; + CopyWith$Fragment$basicApiJobsFields get job; } class _CopyWithImpl$Mutation$MoveService$moveService @@ -6931,14 +6885,13 @@ class _CopyWithImpl$Mutation$MoveService$moveService : ($__typename as String), job: job == _undefined ? _instance.job - : (job as Mutation$MoveService$moveService$job?), + : (job as Fragment$basicApiJobsFields?), )); - CopyWith$Mutation$MoveService$moveService$job get job { + CopyWith$Fragment$basicApiJobsFields get job { final local$job = _instance.job; return local$job == null - ? CopyWith$Mutation$MoveService$moveService$job.stub(_then(_instance)) - : CopyWith$Mutation$MoveService$moveService$job( - local$job, (e) => call(job: e)); + ? CopyWith$Fragment$basicApiJobsFields.stub(_then(_instance)) + : CopyWith$Fragment$basicApiJobsFields(local$job, (e) => call(job: e)); } } @@ -6953,330 +6906,9 @@ class _CopyWithStubImpl$Mutation$MoveService$moveService String? message, bool? success, String? $__typename, - Mutation$MoveService$moveService$job? job, - }) => - _res; - CopyWith$Mutation$MoveService$moveService$job get job => - CopyWith$Mutation$MoveService$moveService$job.stub(_res); -} - -class Mutation$MoveService$moveService$job { - Mutation$MoveService$moveService$job({ - required this.createdAt, - required this.description, - this.error, - this.finishedAt, - required this.name, - this.progress, - this.result, - required this.status, - this.statusText, - required this.uid, - required this.updatedAt, - this.$__typename = 'ApiJob', - }); - - factory Mutation$MoveService$moveService$job.fromJson( - Map json) { - final l$createdAt = json['createdAt']; - final l$description = json['description']; - final l$error = json['error']; - final l$finishedAt = json['finishedAt']; - final l$name = json['name']; - final l$progress = json['progress']; - final l$result = json['result']; - final l$status = json['status']; - final l$statusText = json['statusText']; - final l$uid = json['uid']; - final l$updatedAt = json['updatedAt']; - final l$$__typename = json['__typename']; - return Mutation$MoveService$moveService$job( - createdAt: dateTimeFromJson(l$createdAt), - description: (l$description as String), - error: (l$error as String?), - finishedAt: l$finishedAt == null ? null : dateTimeFromJson(l$finishedAt), - name: (l$name as String), - progress: (l$progress as int?), - result: (l$result as String?), - status: (l$status as String), - statusText: (l$statusText as String?), - uid: (l$uid as String), - updatedAt: dateTimeFromJson(l$updatedAt), - $__typename: (l$$__typename as String), - ); - } - - final DateTime createdAt; - - final String description; - - final String? error; - - final DateTime? finishedAt; - - final String name; - - final int? progress; - - final String? result; - - final String status; - - final String? statusText; - - final String uid; - - final DateTime updatedAt; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$createdAt = createdAt; - _resultData['createdAt'] = dateTimeToJson(l$createdAt); - final l$description = description; - _resultData['description'] = l$description; - final l$error = error; - _resultData['error'] = l$error; - final l$finishedAt = finishedAt; - _resultData['finishedAt'] = - l$finishedAt == null ? null : dateTimeToJson(l$finishedAt); - final l$name = name; - _resultData['name'] = l$name; - final l$progress = progress; - _resultData['progress'] = l$progress; - final l$result = result; - _resultData['result'] = l$result; - final l$status = status; - _resultData['status'] = l$status; - final l$statusText = statusText; - _resultData['statusText'] = l$statusText; - final l$uid = uid; - _resultData['uid'] = l$uid; - final l$updatedAt = updatedAt; - _resultData['updatedAt'] = dateTimeToJson(l$updatedAt); - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$createdAt = createdAt; - final l$description = description; - final l$error = error; - final l$finishedAt = finishedAt; - final l$name = name; - final l$progress = progress; - final l$result = result; - final l$status = status; - final l$statusText = statusText; - final l$uid = uid; - final l$updatedAt = updatedAt; - final l$$__typename = $__typename; - return Object.hashAll([ - l$createdAt, - l$description, - l$error, - l$finishedAt, - l$name, - l$progress, - l$result, - l$status, - l$statusText, - l$uid, - l$updatedAt, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Mutation$MoveService$moveService$job) || - runtimeType != other.runtimeType) { - return false; - } - final l$createdAt = createdAt; - final lOther$createdAt = other.createdAt; - if (l$createdAt != lOther$createdAt) { - return false; - } - final l$description = description; - final lOther$description = other.description; - if (l$description != lOther$description) { - return false; - } - final l$error = error; - final lOther$error = other.error; - if (l$error != lOther$error) { - return false; - } - final l$finishedAt = finishedAt; - final lOther$finishedAt = other.finishedAt; - if (l$finishedAt != lOther$finishedAt) { - return false; - } - final l$name = name; - final lOther$name = other.name; - if (l$name != lOther$name) { - return false; - } - final l$progress = progress; - final lOther$progress = other.progress; - if (l$progress != lOther$progress) { - return false; - } - final l$result = result; - final lOther$result = other.result; - if (l$result != lOther$result) { - return false; - } - final l$status = status; - final lOther$status = other.status; - if (l$status != lOther$status) { - return false; - } - final l$statusText = statusText; - final lOther$statusText = other.statusText; - if (l$statusText != lOther$statusText) { - return false; - } - final l$uid = uid; - final lOther$uid = other.uid; - if (l$uid != lOther$uid) { - return false; - } - final l$updatedAt = updatedAt; - final lOther$updatedAt = other.updatedAt; - if (l$updatedAt != lOther$updatedAt) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Mutation$MoveService$moveService$job - on Mutation$MoveService$moveService$job { - CopyWith$Mutation$MoveService$moveService$job< - Mutation$MoveService$moveService$job> - get copyWith => CopyWith$Mutation$MoveService$moveService$job( - this, - (i) => i, - ); -} - -abstract class CopyWith$Mutation$MoveService$moveService$job { - factory CopyWith$Mutation$MoveService$moveService$job( - Mutation$MoveService$moveService$job instance, - TRes Function(Mutation$MoveService$moveService$job) then, - ) = _CopyWithImpl$Mutation$MoveService$moveService$job; - - factory CopyWith$Mutation$MoveService$moveService$job.stub(TRes res) = - _CopyWithStubImpl$Mutation$MoveService$moveService$job; - - TRes call({ - DateTime? createdAt, - String? description, - String? error, - DateTime? finishedAt, - String? name, - int? progress, - String? result, - String? status, - String? statusText, - String? uid, - DateTime? updatedAt, - String? $__typename, - }); -} - -class _CopyWithImpl$Mutation$MoveService$moveService$job - implements CopyWith$Mutation$MoveService$moveService$job { - _CopyWithImpl$Mutation$MoveService$moveService$job( - this._instance, - this._then, - ); - - final Mutation$MoveService$moveService$job _instance; - - final TRes Function(Mutation$MoveService$moveService$job) _then; - - static const _undefined = {}; - - TRes call({ - Object? createdAt = _undefined, - Object? description = _undefined, - Object? error = _undefined, - Object? finishedAt = _undefined, - Object? name = _undefined, - Object? progress = _undefined, - Object? result = _undefined, - Object? status = _undefined, - Object? statusText = _undefined, - Object? uid = _undefined, - Object? updatedAt = _undefined, - Object? $__typename = _undefined, - }) => - _then(Mutation$MoveService$moveService$job( - createdAt: createdAt == _undefined || createdAt == null - ? _instance.createdAt - : (createdAt as DateTime), - description: description == _undefined || description == null - ? _instance.description - : (description as String), - error: error == _undefined ? _instance.error : (error as String?), - finishedAt: finishedAt == _undefined - ? _instance.finishedAt - : (finishedAt as DateTime?), - name: name == _undefined || name == null - ? _instance.name - : (name as String), - progress: - progress == _undefined ? _instance.progress : (progress as int?), - result: result == _undefined ? _instance.result : (result as String?), - status: status == _undefined || status == null - ? _instance.status - : (status as String), - statusText: statusText == _undefined - ? _instance.statusText - : (statusText as String?), - uid: uid == _undefined || uid == null ? _instance.uid : (uid as String), - updatedAt: updatedAt == _undefined || updatedAt == null - ? _instance.updatedAt - : (updatedAt as DateTime), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Mutation$MoveService$moveService$job - implements CopyWith$Mutation$MoveService$moveService$job { - _CopyWithStubImpl$Mutation$MoveService$moveService$job(this._res); - - TRes _res; - - call({ - DateTime? createdAt, - String? description, - String? error, - DateTime? finishedAt, - String? name, - int? progress, - String? result, - String? status, - String? statusText, - String? uid, - DateTime? updatedAt, - String? $__typename, + Fragment$basicApiJobsFields? job, }) => _res; + CopyWith$Fragment$basicApiJobsFields get job => + CopyWith$Fragment$basicApiJobsFields.stub(_res); } diff --git a/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart index d17316df..4df77d6f 100644 --- a/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart @@ -1,8 +1,8 @@ import 'dart:async'; -import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'schema.graphql.dart'; +import 'services.graphql.dart'; class Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields({ diff --git a/lib/logic/api_maps/graphql_maps/server_api/backups_api.dart b/lib/logic/api_maps/graphql_maps/server_api/backups_api.dart index 18fea675..b652db03 100644 --- a/lib/logic/api_maps/graphql_maps/server_api/backups_api.dart +++ b/lib/logic/api_maps/graphql_maps/server_api/backups_api.dart @@ -72,9 +72,9 @@ mixin BackupsApi on GraphQLApiMap { ); } - Future startBackup(final String serviceId) async { + Future> startBackup(final String serviceId) async { QueryResult response; - GenericResult? result; + GenericResult? result; try { final GraphQLClient client = await getClient(); @@ -92,7 +92,9 @@ mixin BackupsApi on GraphQLApiMap { } result = GenericResult( success: true, - data: null, + data: ServerJob.fromGraphQL( + response.parsedData!.backup.startBackup.job!, + ), ); } catch (e) { print(e); @@ -204,4 +206,43 @@ mixin BackupsApi on GraphQLApiMap { return result; } + + Future> restoreBackup( + final String snapshotId, + ) async { + QueryResult response; + GenericResult? result; + + try { + final GraphQLClient client = await getClient(); + final variables = + Variables$Mutation$RestoreBackup(snapshotId: snapshotId); + final options = Options$Mutation$RestoreBackup(variables: variables); + response = await client.mutate$RestoreBackup(options); + if (response.hasException) { + final message = response.exception.toString(); + print(message); + result = GenericResult( + success: false, + data: null, + message: message, + ); + } + result = GenericResult( + success: true, + data: ServerJob.fromGraphQL( + response.parsedData!.backup.restoreBackup.job!, + ), + ); + } catch (e) { + print(e); + result = GenericResult( + success: false, + data: null, + message: e.toString(), + ); + } + + return result; + } } diff --git a/lib/logic/models/json/server_job.dart b/lib/logic/models/json/server_job.dart index 6b125c5f..44fb2561 100644 --- a/lib/logic/models/json/server_job.dart +++ b/lib/logic/models/json/server_job.dart @@ -22,7 +22,7 @@ class ServerJob { this.finishedAt, }); - ServerJob.fromGraphQL(final Query$GetApiJobs$jobs$getJobs serverJob) + ServerJob.fromGraphQL(final Fragment$basicApiJobsFields serverJob) : this( createdAt: serverJob.createdAt, description: serverJob.description, diff --git a/lib/logic/providers/dns_providers/dns_provider.dart b/lib/logic/providers/dns_providers/dns_provider.dart index 60976f68..e27c4b00 100644 --- a/lib/logic/providers/dns_providers/dns_provider.dart +++ b/lib/logic/providers/dns_providers/dns_provider.dart @@ -5,7 +5,16 @@ import 'package:selfprivacy/logic/models/json/dns_records.dart'; export 'package:selfprivacy/logic/api_maps/generic_result.dart'; abstract class DnsProvider { + /// Returns an assigned enum value, respectively to which + /// provider implements [DnsProvider] interface. DnsProviderType get type; + + /// Tries to access an account linked to the provided token. + /// + /// To generate a token for your account follow instructions of your + /// DNS provider respectfully. + /// + /// If success, saves it for future usage. Future> tryInitApiByToken(final String token); Future> getZoneId(final String domain); Future> removeDomainRecords({ From 62b7a0ee7ec2b1100406a818255c2435ab61d12c Mon Sep 17 00:00:00 2001 From: Inex Code Date: Sun, 2 Jul 2023 14:41:31 +0300 Subject: [PATCH 13/20] feat(backups): Add descriptions for backups --- .../graphql_maps/schema/backups.graphql.dart | 2 +- .../schema/disk_volumes.graphql.dart | 1 - .../graphql_maps/schema/schema.graphql | 1 + .../schema/server_api.graphql.dart | 2 +- .../schema/server_settings.graphql.dart | 2 +- .../graphql_maps/schema/services.graphql | 1 + .../graphql_maps/schema/services.graphql.dart | 29 ++++ .../graphql_maps/schema/users.graphql.dart | 2 +- lib/logic/cubit/backups/backups_cubit.dart | 2 + lib/logic/cubit/backups/backups_state.dart | 2 +- lib/logic/models/service.dart | 4 + lib/ui/layouts/brand_hero_screen.dart | 3 +- .../pages/backup_details/backup_details.dart | 125 +++++++++++------- 13 files changed, 121 insertions(+), 55 deletions(-) diff --git a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart index 52bf45eb..14d1ab1a 100644 --- a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart @@ -1,10 +1,10 @@ import 'dart:async'; +import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'package:selfprivacy/utils/scalars.dart'; import 'schema.graphql.dart'; import 'server_api.graphql.dart'; -import 'services.graphql.dart'; class Fragment$genericBackupConfigReturn { Fragment$genericBackupConfigReturn({ diff --git a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart index 2d7939a5..aae28508 100644 --- a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart @@ -3,7 +3,6 @@ import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'schema.graphql.dart'; import 'server_api.graphql.dart'; -import 'services.graphql.dart'; class Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields({ diff --git a/lib/logic/api_maps/graphql_maps/schema/schema.graphql b/lib/logic/api_maps/graphql_maps/schema/schema.graphql index 643dca4f..1f57a51a 100644 --- a/lib/logic/api_maps/graphql_maps/schema/schema.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/schema.graphql @@ -255,6 +255,7 @@ type Service { isRequired: Boolean! isEnabled: Boolean! canBeBackedUp: Boolean! + backupDescription: String! status: ServiceStatusEnum! url: String dnsRecords: [DnsRecord!] diff --git a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart index 75b1f344..eaddf55b 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart @@ -1,9 +1,9 @@ import 'dart:async'; +import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'package:selfprivacy/utils/scalars.dart'; import 'schema.graphql.dart'; -import 'services.graphql.dart'; class Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields({ diff --git a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart index abbba037..ae8aabcb 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart @@ -1,8 +1,8 @@ import 'dart:async'; +import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'schema.graphql.dart'; -import 'services.graphql.dart'; class Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields({ diff --git a/lib/logic/api_maps/graphql_maps/schema/services.graphql b/lib/logic/api_maps/graphql_maps/schema/services.graphql index 104d22b8..ee5ee245 100644 --- a/lib/logic/api_maps/graphql_maps/schema/services.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/services.graphql @@ -17,6 +17,7 @@ query AllServices { isMovable isRequired canBeBackedUp + backupDescription status storageUsage { title diff --git a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart index e2cd4056..4d33f536 100644 --- a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'schema.graphql.dart'; @@ -2502,6 +2503,13 @@ const documentNodeQueryAllServices = DocumentNode(definitions: [ directives: [], selectionSet: null, ), + FieldNode( + name: NameNode(value: 'backupDescription'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), FieldNode( name: NameNode(value: 'status'), alias: null, @@ -2884,6 +2892,7 @@ class Query$AllServices$services$allServices { required this.isMovable, required this.isRequired, required this.canBeBackedUp, + required this.backupDescription, required this.status, required this.storageUsage, required this.svgIcon, @@ -2901,6 +2910,7 @@ class Query$AllServices$services$allServices { final l$isMovable = json['isMovable']; final l$isRequired = json['isRequired']; final l$canBeBackedUp = json['canBeBackedUp']; + final l$backupDescription = json['backupDescription']; final l$status = json['status']; final l$storageUsage = json['storageUsage']; final l$svgIcon = json['svgIcon']; @@ -2918,6 +2928,7 @@ class Query$AllServices$services$allServices { isMovable: (l$isMovable as bool), isRequired: (l$isRequired as bool), canBeBackedUp: (l$canBeBackedUp as bool), + backupDescription: (l$backupDescription as String), status: fromJson$Enum$ServiceStatusEnum((l$status as String)), storageUsage: Query$AllServices$services$allServices$storageUsage.fromJson( @@ -2944,6 +2955,8 @@ class Query$AllServices$services$allServices { final bool canBeBackedUp; + final String backupDescription; + final Enum$ServiceStatusEnum status; final Query$AllServices$services$allServices$storageUsage storageUsage; @@ -2972,6 +2985,8 @@ class Query$AllServices$services$allServices { _resultData['isRequired'] = l$isRequired; final l$canBeBackedUp = canBeBackedUp; _resultData['canBeBackedUp'] = l$canBeBackedUp; + final l$backupDescription = backupDescription; + _resultData['backupDescription'] = l$backupDescription; final l$status = status; _resultData['status'] = toJson$Enum$ServiceStatusEnum(l$status); final l$storageUsage = storageUsage; @@ -2995,6 +3010,7 @@ class Query$AllServices$services$allServices { final l$isMovable = isMovable; final l$isRequired = isRequired; final l$canBeBackedUp = canBeBackedUp; + final l$backupDescription = backupDescription; final l$status = status; final l$storageUsage = storageUsage; final l$svgIcon = svgIcon; @@ -3009,6 +3025,7 @@ class Query$AllServices$services$allServices { l$isMovable, l$isRequired, l$canBeBackedUp, + l$backupDescription, l$status, l$storageUsage, l$svgIcon, @@ -3077,6 +3094,11 @@ class Query$AllServices$services$allServices { if (l$canBeBackedUp != lOther$canBeBackedUp) { return false; } + final l$backupDescription = backupDescription; + final lOther$backupDescription = other.backupDescription; + if (l$backupDescription != lOther$backupDescription) { + return false; + } final l$status = status; final lOther$status = other.status; if (l$status != lOther$status) { @@ -3134,6 +3156,7 @@ abstract class CopyWith$Query$AllServices$services$allServices { bool? isMovable, bool? isRequired, bool? canBeBackedUp, + String? backupDescription, Enum$ServiceStatusEnum? status, Query$AllServices$services$allServices$storageUsage? storageUsage, String? svgIcon, @@ -3172,6 +3195,7 @@ class _CopyWithImpl$Query$AllServices$services$allServices Object? isMovable = _undefined, Object? isRequired = _undefined, Object? canBeBackedUp = _undefined, + Object? backupDescription = _undefined, Object? status = _undefined, Object? storageUsage = _undefined, Object? svgIcon = _undefined, @@ -3201,6 +3225,10 @@ class _CopyWithImpl$Query$AllServices$services$allServices canBeBackedUp: canBeBackedUp == _undefined || canBeBackedUp == null ? _instance.canBeBackedUp : (canBeBackedUp as bool), + backupDescription: + backupDescription == _undefined || backupDescription == null + ? _instance.backupDescription + : (backupDescription as String), status: status == _undefined || status == null ? _instance.status : (status as Enum$ServiceStatusEnum), @@ -3251,6 +3279,7 @@ class _CopyWithStubImpl$Query$AllServices$services$allServices bool? isMovable, bool? isRequired, bool? canBeBackedUp, + String? backupDescription, Enum$ServiceStatusEnum? status, Query$AllServices$services$allServices$storageUsage? storageUsage, String? svgIcon, diff --git a/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart index 4df77d6f..d17316df 100644 --- a/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart @@ -1,8 +1,8 @@ import 'dart:async'; +import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'schema.graphql.dart'; -import 'services.graphql.dart'; class Fragment$basicMutationReturnFields { Fragment$basicMutationReturnFields({ diff --git a/lib/logic/cubit/backups/backups_cubit.dart b/lib/logic/cubit/backups/backups_cubit.dart index 61dcc576..6e34b410 100644 --- a/lib/logic/cubit/backups/backups_cubit.dart +++ b/lib/logic/cubit/backups/backups_cubit.dart @@ -30,6 +30,7 @@ class BackupsCubit extends ServerInstallationDependendCubit { final BackupConfiguration? backupConfig = await api.getBackupsConfiguration(); final List backups = await api.getBackups(); + backups.sort((final a, final b) => b.time.compareTo(a.time)); emit( state.copyWith( backblazeBucket: bucket, @@ -144,6 +145,7 @@ class BackupsCubit extends ServerInstallationDependendCubit { Future updateBackups({final bool useTimer = false}) async { emit(state.copyWith(refreshing: true)); final backups = await api.getBackups(); + backups.sort((final a, final b) => b.time.compareTo(a.time)); final backupConfig = await api.getBackupsConfiguration(); emit( diff --git a/lib/logic/cubit/backups/backups_state.dart b/lib/logic/cubit/backups/backups_state.dart index 988f669b..909e7f21 100644 --- a/lib/logic/cubit/backups/backups_state.dart +++ b/lib/logic/cubit/backups/backups_state.dart @@ -25,7 +25,7 @@ class BackupsState extends ServerInstallationDependendState { backups, preventActions, refreshTimer, - refreshing + refreshing, ]; BackupsState copyWith({ diff --git a/lib/logic/models/service.dart b/lib/logic/models/service.dart index 086d527d..d79615e8 100644 --- a/lib/logic/models/service.dart +++ b/lib/logic/models/service.dart @@ -18,6 +18,7 @@ class Service { isRequired: service.isRequired, isMovable: service.isMovable, canBeBackedUp: service.canBeBackedUp, + backupDescription: service.backupDescription, status: ServiceStatus.fromGraphQL(service.status), storageUsage: ServiceStorageUsage( used: DiskSize(byte: int.parse(service.storageUsage.usedSpace)), @@ -44,6 +45,7 @@ class Service { required this.isRequired, required this.isMovable, required this.canBeBackedUp, + required this.backupDescription, required this.status, required this.storageUsage, required this.svgIcon, @@ -78,6 +80,7 @@ class Service { isRequired: false, isMovable: false, canBeBackedUp: false, + backupDescription: '', status: ServiceStatus.off, storageUsage: ServiceStorageUsage( used: const DiskSize(byte: 0), @@ -95,6 +98,7 @@ class Service { final bool isRequired; final bool isMovable; final bool canBeBackedUp; + final String backupDescription; final ServiceStatus status; final ServiceStorageUsage storageUsage; final String svgIcon; diff --git a/lib/ui/layouts/brand_hero_screen.dart b/lib/ui/layouts/brand_hero_screen.dart index e7b320c0..a7b8be74 100644 --- a/lib/ui/layouts/brand_hero_screen.dart +++ b/lib/ui/layouts/brand_hero_screen.dart @@ -147,7 +147,8 @@ class _HeroSliverAppBarState extends State { context: context, useRootNavigator: true, isScrollControlled: true, - builder: (final BuildContext context) => DraggableScrollableSheet( + builder: (final BuildContext context) => + DraggableScrollableSheet( expand: false, maxChildSize: 0.9, minChildSize: 0.4, diff --git a/lib/ui/pages/backup_details/backup_details.dart b/lib/ui/pages/backup_details/backup_details.dart index b3fa2348..92491763 100644 --- a/lib/ui/pages/backup_details/backup_details.dart +++ b/lib/ui/pages/backup_details/backup_details.dart @@ -93,59 +93,88 @@ class _BackupDetailsPageState extends State // Each list item has a date // When clicked, starts the restore action if (isBackupInitialized) - OutlinedCard( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ListTile( + title: Text( + 'backups.latest_snapshots'.tr(), + style: Theme.of(context).textTheme.headlineSmall!.copyWith( + color: Theme.of(context).colorScheme.secondary, + ), + ), + subtitle: Text( + 'backups.latest_snapshots_subtitle'.tr(), + style: Theme.of(context).textTheme.labelMedium, + ), + ), + if (backups.isEmpty) ListTile( leading: const Icon( - Icons.refresh, - ), - title: Text( - 'backup.restore'.tr(), - style: Theme.of(context).textTheme.titleLarge, + Icons.error_outline, ), + title: Text('backup.no_backups'.tr()), ), - const Divider( - height: 1.0, - ), - if (backups.isEmpty) - ListTile( - leading: const Icon( - Icons.error_outline, - ), - title: Text('backup.no_backups'.tr()), - ), - if (backups.isNotEmpty) - Column( - children: backups - .map( - (final Backup backup) => ListTile( - onTap: preventActions - ? null - : () { - showPopUpAlert( - alertTitle: 'backup.restoring'.tr(), - description: 'backup.restore_alert'.tr( - args: [backup.time.toString()], - ), - actionButtonTitle: 'modals.yes'.tr(), - actionButtonOnPressed: () => { - context - .read() - .restoreBackup(backup.id) - }, - ); + if (backups.isNotEmpty) + Column( + children: backups.take(20).map( + (final Backup backup) { + final service = context + .read() + .state + .getServiceById(backup.serviceId); + return ListTile( + onTap: preventActions + ? null + : () { + showPopUpAlert( + alertTitle: 'backup.restoring'.tr(), + description: 'backup.restore_alert'.tr( + args: [backup.time.toString()], + ), + actionButtonTitle: 'modals.yes'.tr(), + actionButtonOnPressed: () => { + context + .read() + .restoreBackup(backup.id) }, - title: Text( - '${MaterialLocalizations.of(context).formatShortDate(backup.time)} ${TimeOfDay.fromDateTime(backup.time).format(context)}', - ), - ), - ) - .toList(), + ); + }, + title: Text( + '${MaterialLocalizations.of(context).formatShortDate(backup.time)} ${TimeOfDay.fromDateTime(backup.time).format(context)}', + ), + subtitle: Text( + service?.displayName ?? backup.fallbackServiceName, + ), + leading: service != null + ? SvgPicture.string( + service.svgIcon, + height: 24, + width: 24, + colorFilter: ColorFilter.mode( + Theme.of(context).colorScheme.onBackground, + BlendMode.srcIn, + ), + ) + : const Icon( + Icons.question_mark_outlined, + ), + ); + }, + ).toList(), + ), + if (backups.isNotEmpty && backups.length > 20) + ListTile( + title: Text( + 'backups.show_more'.tr(), + style: Theme.of(context).textTheme.labelMedium, ), - ], - ), + leading: const Icon( + Icons.arrow_drop_down, + ), + onTap: null, + ) + ], ), const SizedBox(height: 16), OutlinedCard( @@ -317,7 +346,7 @@ class _CreateBackupsModalState extends State { service.displayName, ), subtitle: Text( - busy ? 'backup.service_busy'.tr() : service.description, + busy ? 'backup.service_busy'.tr() : service.backupDescription, ), secondary: SvgPicture.string( service.svgIcon, From a8bddaaeba61edc4e35be26b8af7c219e320f53e Mon Sep 17 00:00:00 2001 From: Inex Code Date: Sun, 2 Jul 2023 14:41:54 +0300 Subject: [PATCH 14/20] style: Reformatting --- .../server_installation/server_installation_repository.dart | 3 ++- lib/logic/cubit/server_jobs/server_jobs_state.dart | 6 ++++-- lib/ui/pages/more/app_settings/developer_settings.dart | 5 ++--- .../server_storage/binds_migration/services_migration.dart | 3 ++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/logic/cubit/server_installation/server_installation_repository.dart b/lib/logic/cubit/server_installation/server_installation_repository.dart index 2a6829e6..8ebe7c1a 100644 --- a/lib/logic/cubit/server_installation/server_installation_repository.dart +++ b/lib/logic/cubit/server_installation/server_installation_repository.dart @@ -176,7 +176,8 @@ class ServerInstallationRepository { await setDnsApiToken(token); return (await ProvidersController.currentDnsProvider!.getZoneId( domain, - )).data; + )) + .data; } Future> isDnsAddressesMatch( diff --git a/lib/logic/cubit/server_jobs/server_jobs_state.dart b/lib/logic/cubit/server_jobs/server_jobs_state.dart index 71732d67..2902ba3b 100644 --- a/lib/logic/cubit/server_jobs/server_jobs_state.dart +++ b/lib/logic/cubit/server_jobs/server_jobs_state.dart @@ -21,10 +21,12 @@ class ServerJobsState extends ServerInstallationDependendState { } } - List get backupJobList => serverJobList.where( + List get backupJobList => serverJobList + .where( // The backup jobs has the format of 'service..backup' (final job) => job.typeId.contains('backup'), - ).toList(); + ) + .toList(); bool get hasRemovableJobs => serverJobList.any( (final job) => diff --git a/lib/ui/pages/more/app_settings/developer_settings.dart b/lib/ui/pages/more/app_settings/developer_settings.dart index c2a34916..3c3addb4 100644 --- a/lib/ui/pages/more/app_settings/developer_settings.dart +++ b/lib/ui/pages/more/app_settings/developer_settings.dart @@ -44,11 +44,10 @@ class _DeveloperSettingsPageState extends State { ), SwitchListTile( title: Text('developer_settings.ignore_tls'.tr()), - subtitle: - Text('developer_settings.ignore_tls_description'.tr()), + subtitle: Text('developer_settings.ignore_tls_description'.tr()), value: TlsOptions.verifyCertificate, onChanged: (final bool value) => setState( - () => TlsOptions.verifyCertificate = value, + () => TlsOptions.verifyCertificate = value, ), ), Padding( diff --git a/lib/ui/pages/server_storage/binds_migration/services_migration.dart b/lib/ui/pages/server_storage/binds_migration/services_migration.dart index f7c26c88..f07c275e 100644 --- a/lib/ui/pages/server_storage/binds_migration/services_migration.dart +++ b/lib/ui/pages/server_storage/binds_migration/services_migration.dart @@ -179,7 +179,8 @@ class _ServicesMigrationPageState extends State { context: context, useRootNavigator: true, isScrollControlled: true, - builder: (final BuildContext context) => DraggableScrollableSheet( + builder: (final BuildContext context) => + DraggableScrollableSheet( expand: false, maxChildSize: 0.9, minChildSize: 0.4, From edb02764f78131ff16fcb0191e88625941d04502 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Sun, 2 Jul 2023 18:22:07 +0300 Subject: [PATCH 15/20] fix: GraphQL fragments deduplication --- .../graphql_maps/schema/backups.graphql.dart | 1 - .../graphql_maps/schema/disk_volumes.graphql | 6 - .../schema/disk_volumes.graphql.dart | 2278 ---------------- .../schema/server_api.graphql.dart | 1 - .../schema/server_settings.graphql | 6 - .../schema/server_settings.graphql.dart | 2280 +---------------- .../graphql_maps/schema/services.graphql | 6 - .../graphql_maps/schema/services.graphql.dart | 2279 ---------------- .../graphql_maps/schema/users.graphql | 6 - .../graphql_maps/schema/users.graphql.dart | 2280 +---------------- .../graphql_maps/server_api/server_api.dart | 8 +- 11 files changed, 9 insertions(+), 9142 deletions(-) diff --git a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart index 14d1ab1a..428da3e4 100644 --- a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'package:selfprivacy/utils/scalars.dart'; diff --git a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql index e1d562d2..76ba5475 100644 --- a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql @@ -1,9 +1,3 @@ -fragment basicMutationReturnFields on MutationReturnInterface{ - code - message - success -} - query GetServerDiskVolumes { storage { volumes { diff --git a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart index aae28508..d448df1d 100644 --- a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart @@ -4,2284 +4,6 @@ import 'package:graphql/client.dart' as graphql; import 'schema.graphql.dart'; import 'server_api.graphql.dart'; -class Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields({ - required this.code, - required this.message, - required this.success, - required this.$__typename, - }); - - factory Fragment$basicMutationReturnFields.fromJson( - Map json) { - switch (json["__typename"] as String) { - case "ApiKeyMutationReturn": - return Fragment$basicMutationReturnFields$$ApiKeyMutationReturn - .fromJson(json); - - case "AutoUpgradeSettingsMutationReturn": - return Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - .fromJson(json); - - case "DeviceApiTokenMutationReturn": - return Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - .fromJson(json); - - case "GenericBackupConfigReturn": - return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn - .fromJson(json); - - case "GenericJobMutationReturn": - return Fragment$basicMutationReturnFields$$GenericJobMutationReturn - .fromJson(json); - - case "GenericMutationReturn": - return Fragment$basicMutationReturnFields$$GenericMutationReturn - .fromJson(json); - - case "ServiceJobMutationReturn": - return Fragment$basicMutationReturnFields$$ServiceJobMutationReturn - .fromJson(json); - - case "ServiceMutationReturn": - return Fragment$basicMutationReturnFields$$ServiceMutationReturn - .fromJson(json); - - case "TimezoneMutationReturn": - return Fragment$basicMutationReturnFields$$TimezoneMutationReturn - .fromJson(json); - - case "UserMutationReturn": - return Fragment$basicMutationReturnFields$$UserMutationReturn.fromJson( - json); - - default: - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields - on Fragment$basicMutationReturnFields { - CopyWith$Fragment$basicMutationReturnFields< - Fragment$basicMutationReturnFields> - get copyWith => CopyWith$Fragment$basicMutationReturnFields( - this, - (i) => i, - ); - _T when<_T>({ - required _T Function( - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) - apiKeyMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) - autoUpgradeSettingsMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) - deviceApiTokenMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) - genericBackupConfigReturn, - required _T Function( - Fragment$basicMutationReturnFields$$GenericJobMutationReturn) - genericJobMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$GenericMutationReturn) - genericMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) - serviceJobMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$ServiceMutationReturn) - serviceMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$TimezoneMutationReturn) - timezoneMutationReturn, - required _T Function(Fragment$basicMutationReturnFields$$UserMutationReturn) - userMutationReturn, - required _T Function() orElse, - }) { - switch ($__typename) { - case "ApiKeyMutationReturn": - return apiKeyMutationReturn( - this as Fragment$basicMutationReturnFields$$ApiKeyMutationReturn); - - case "AutoUpgradeSettingsMutationReturn": - return autoUpgradeSettingsMutationReturn(this - as Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn); - - case "DeviceApiTokenMutationReturn": - return deviceApiTokenMutationReturn(this - as Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn); - - case "GenericBackupConfigReturn": - return genericBackupConfigReturn(this - as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); - - case "GenericJobMutationReturn": - return genericJobMutationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); - - case "GenericMutationReturn": - return genericMutationReturn( - this as Fragment$basicMutationReturnFields$$GenericMutationReturn); - - case "ServiceJobMutationReturn": - return serviceJobMutationReturn(this - as Fragment$basicMutationReturnFields$$ServiceJobMutationReturn); - - case "ServiceMutationReturn": - return serviceMutationReturn( - this as Fragment$basicMutationReturnFields$$ServiceMutationReturn); - - case "TimezoneMutationReturn": - return timezoneMutationReturn( - this as Fragment$basicMutationReturnFields$$TimezoneMutationReturn); - - case "UserMutationReturn": - return userMutationReturn( - this as Fragment$basicMutationReturnFields$$UserMutationReturn); - - default: - return orElse(); - } - } - - _T maybeWhen<_T>({ - _T Function(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn)? - apiKeyMutationReturn, - _T Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn)? - autoUpgradeSettingsMutationReturn, - _T Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn)? - deviceApiTokenMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn)? - genericBackupConfigReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn)? - genericJobMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericMutationReturn)? - genericMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn)? - serviceJobMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$ServiceMutationReturn)? - serviceMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$TimezoneMutationReturn)? - timezoneMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$UserMutationReturn)? - userMutationReturn, - required _T Function() orElse, - }) { - switch ($__typename) { - case "ApiKeyMutationReturn": - if (apiKeyMutationReturn != null) { - return apiKeyMutationReturn( - this as Fragment$basicMutationReturnFields$$ApiKeyMutationReturn); - } else { - return orElse(); - } - - case "AutoUpgradeSettingsMutationReturn": - if (autoUpgradeSettingsMutationReturn != null) { - return autoUpgradeSettingsMutationReturn(this - as Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn); - } else { - return orElse(); - } - - case "DeviceApiTokenMutationReturn": - if (deviceApiTokenMutationReturn != null) { - return deviceApiTokenMutationReturn(this - as Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn); - } else { - return orElse(); - } - - case "GenericBackupConfigReturn": - if (genericBackupConfigReturn != null) { - return genericBackupConfigReturn(this - as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); - } else { - return orElse(); - } - - case "GenericJobMutationReturn": - if (genericJobMutationReturn != null) { - return genericJobMutationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); - } else { - return orElse(); - } - - case "GenericMutationReturn": - if (genericMutationReturn != null) { - return genericMutationReturn(this - as Fragment$basicMutationReturnFields$$GenericMutationReturn); - } else { - return orElse(); - } - - case "ServiceJobMutationReturn": - if (serviceJobMutationReturn != null) { - return serviceJobMutationReturn(this - as Fragment$basicMutationReturnFields$$ServiceJobMutationReturn); - } else { - return orElse(); - } - - case "ServiceMutationReturn": - if (serviceMutationReturn != null) { - return serviceMutationReturn(this - as Fragment$basicMutationReturnFields$$ServiceMutationReturn); - } else { - return orElse(); - } - - case "TimezoneMutationReturn": - if (timezoneMutationReturn != null) { - return timezoneMutationReturn(this - as Fragment$basicMutationReturnFields$$TimezoneMutationReturn); - } else { - return orElse(); - } - - case "UserMutationReturn": - if (userMutationReturn != null) { - return userMutationReturn( - this as Fragment$basicMutationReturnFields$$UserMutationReturn); - } else { - return orElse(); - } - - default: - return orElse(); - } - } -} - -abstract class CopyWith$Fragment$basicMutationReturnFields { - factory CopyWith$Fragment$basicMutationReturnFields( - Fragment$basicMutationReturnFields instance, - TRes Function(Fragment$basicMutationReturnFields) then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields; - - factory CopyWith$Fragment$basicMutationReturnFields.stub(TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields - implements CopyWith$Fragment$basicMutationReturnFields { - _CopyWithImpl$Fragment$basicMutationReturnFields( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields _instance; - - final TRes Function(Fragment$basicMutationReturnFields) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields - implements CopyWith$Fragment$basicMutationReturnFields { - _CopyWithStubImpl$Fragment$basicMutationReturnFields(this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -const fragmentDefinitionbasicMutationReturnFields = FragmentDefinitionNode( - name: NameNode(value: 'basicMutationReturnFields'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'MutationReturnInterface'), - isNonNull: false, - )), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'code'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'message'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'success'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: '__typename'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - ]), -); -const documentNodeFragmentbasicMutationReturnFields = - DocumentNode(definitions: [ - fragmentDefinitionbasicMutationReturnFields, -]); - -extension ClientExtension$Fragment$basicMutationReturnFields - on graphql.GraphQLClient { - void writeFragment$basicMutationReturnFields({ - required Fragment$basicMutationReturnFields data, - required Map idFields, - bool broadcast = true, - }) => - this.writeFragment( - graphql.FragmentRequest( - idFields: idFields, - fragment: const graphql.Fragment( - fragmentName: 'basicMutationReturnFields', - document: documentNodeFragmentbasicMutationReturnFields, - ), - ), - data: data.toJson(), - broadcast: broadcast, - ); - Fragment$basicMutationReturnFields? readFragment$basicMutationReturnFields({ - required Map idFields, - bool optimistic = true, - }) { - final result = this.readFragment( - graphql.FragmentRequest( - idFields: idFields, - fragment: const graphql.Fragment( - fragmentName: 'basicMutationReturnFields', - document: documentNodeFragmentbasicMutationReturnFields, - ), - ), - optimistic: optimistic, - ); - return result == null - ? null - : Fragment$basicMutationReturnFields.fromJson(result); - } -} - -class Fragment$basicMutationReturnFields$$ApiKeyMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'ApiKeyMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$ApiKeyMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn - on Fragment$basicMutationReturnFields$$ApiKeyMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$ApiKeyMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'AutoUpgradeSettingsMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - on Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - instance, - TRes Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'DeviceApiTokenMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - on Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn instance, - TRes Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$GenericBackupConfigReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'GenericBackupConfigReturn', - }); - - factory Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn - on Fragment$basicMutationReturnFields$$GenericBackupConfigReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$GenericBackupConfigReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$GenericJobMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericJobMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'GenericJobMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$GenericJobMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$GenericJobMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericJobMutationReturn - on Fragment$basicMutationReturnFields$$GenericJobMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - Fragment$basicMutationReturnFields$$GenericJobMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - Fragment$basicMutationReturnFields$$GenericJobMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$GenericJobMutationReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$GenericJobMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$GenericMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'GenericMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$GenericMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$GenericMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericMutationReturn - on Fragment$basicMutationReturnFields$$GenericMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - Fragment$basicMutationReturnFields$$GenericMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn( - Fragment$basicMutationReturnFields$$GenericMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$GenericMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$GenericMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$GenericMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$ServiceJobMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'ServiceJobMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$ServiceJobMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn - on Fragment$basicMutationReturnFields$$ServiceJobMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$ServiceJobMutationReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$ServiceMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$ServiceMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'ServiceMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$ServiceMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$ServiceMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$ServiceMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$ServiceMutationReturn - on Fragment$basicMutationReturnFields$$ServiceMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - Fragment$basicMutationReturnFields$$ServiceMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - Fragment$basicMutationReturnFields$$ServiceMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$ServiceMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$ServiceMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$ServiceMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$ServiceMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$TimezoneMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$TimezoneMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'TimezoneMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$TimezoneMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$TimezoneMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$TimezoneMutationReturn - on Fragment$basicMutationReturnFields$$TimezoneMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - Fragment$basicMutationReturnFields$$TimezoneMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - Fragment$basicMutationReturnFields$$TimezoneMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$TimezoneMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$TimezoneMutationReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$TimezoneMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$UserMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$UserMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'UserMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$UserMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$UserMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$UserMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$UserMutationReturn - on Fragment$basicMutationReturnFields$$UserMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn< - Fragment$basicMutationReturnFields$$UserMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn( - Fragment$basicMutationReturnFields$$UserMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$UserMutationReturn) then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$UserMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$UserMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$UserMutationReturn - implements - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn { - _CopyWithImpl$Fragment$basicMutationReturnFields$$UserMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$UserMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$UserMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$UserMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$UserMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$UserMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - class Query$GetServerDiskVolumes { Query$GetServerDiskVolumes({ required this.storage, diff --git a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart index eaddf55b..3fed1110 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'package:selfprivacy/utils/scalars.dart'; diff --git a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql index a33a5fef..f0fbedd6 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql @@ -1,9 +1,3 @@ -fragment basicMutationReturnFields on MutationReturnInterface{ - code - message - success -} - query SystemSettings { system { settings { diff --git a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart index ae8aabcb..bcc677e8 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart @@ -1,2286 +1,8 @@ import 'dart:async'; -import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'schema.graphql.dart'; - -class Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields({ - required this.code, - required this.message, - required this.success, - required this.$__typename, - }); - - factory Fragment$basicMutationReturnFields.fromJson( - Map json) { - switch (json["__typename"] as String) { - case "ApiKeyMutationReturn": - return Fragment$basicMutationReturnFields$$ApiKeyMutationReturn - .fromJson(json); - - case "AutoUpgradeSettingsMutationReturn": - return Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - .fromJson(json); - - case "DeviceApiTokenMutationReturn": - return Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - .fromJson(json); - - case "GenericBackupConfigReturn": - return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn - .fromJson(json); - - case "GenericJobMutationReturn": - return Fragment$basicMutationReturnFields$$GenericJobMutationReturn - .fromJson(json); - - case "GenericMutationReturn": - return Fragment$basicMutationReturnFields$$GenericMutationReturn - .fromJson(json); - - case "ServiceJobMutationReturn": - return Fragment$basicMutationReturnFields$$ServiceJobMutationReturn - .fromJson(json); - - case "ServiceMutationReturn": - return Fragment$basicMutationReturnFields$$ServiceMutationReturn - .fromJson(json); - - case "TimezoneMutationReturn": - return Fragment$basicMutationReturnFields$$TimezoneMutationReturn - .fromJson(json); - - case "UserMutationReturn": - return Fragment$basicMutationReturnFields$$UserMutationReturn.fromJson( - json); - - default: - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields - on Fragment$basicMutationReturnFields { - CopyWith$Fragment$basicMutationReturnFields< - Fragment$basicMutationReturnFields> - get copyWith => CopyWith$Fragment$basicMutationReturnFields( - this, - (i) => i, - ); - _T when<_T>({ - required _T Function( - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) - apiKeyMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) - autoUpgradeSettingsMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) - deviceApiTokenMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) - genericBackupConfigReturn, - required _T Function( - Fragment$basicMutationReturnFields$$GenericJobMutationReturn) - genericJobMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$GenericMutationReturn) - genericMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) - serviceJobMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$ServiceMutationReturn) - serviceMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$TimezoneMutationReturn) - timezoneMutationReturn, - required _T Function(Fragment$basicMutationReturnFields$$UserMutationReturn) - userMutationReturn, - required _T Function() orElse, - }) { - switch ($__typename) { - case "ApiKeyMutationReturn": - return apiKeyMutationReturn( - this as Fragment$basicMutationReturnFields$$ApiKeyMutationReturn); - - case "AutoUpgradeSettingsMutationReturn": - return autoUpgradeSettingsMutationReturn(this - as Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn); - - case "DeviceApiTokenMutationReturn": - return deviceApiTokenMutationReturn(this - as Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn); - - case "GenericBackupConfigReturn": - return genericBackupConfigReturn(this - as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); - - case "GenericJobMutationReturn": - return genericJobMutationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); - - case "GenericMutationReturn": - return genericMutationReturn( - this as Fragment$basicMutationReturnFields$$GenericMutationReturn); - - case "ServiceJobMutationReturn": - return serviceJobMutationReturn(this - as Fragment$basicMutationReturnFields$$ServiceJobMutationReturn); - - case "ServiceMutationReturn": - return serviceMutationReturn( - this as Fragment$basicMutationReturnFields$$ServiceMutationReturn); - - case "TimezoneMutationReturn": - return timezoneMutationReturn( - this as Fragment$basicMutationReturnFields$$TimezoneMutationReturn); - - case "UserMutationReturn": - return userMutationReturn( - this as Fragment$basicMutationReturnFields$$UserMutationReturn); - - default: - return orElse(); - } - } - - _T maybeWhen<_T>({ - _T Function(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn)? - apiKeyMutationReturn, - _T Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn)? - autoUpgradeSettingsMutationReturn, - _T Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn)? - deviceApiTokenMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn)? - genericBackupConfigReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn)? - genericJobMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericMutationReturn)? - genericMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn)? - serviceJobMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$ServiceMutationReturn)? - serviceMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$TimezoneMutationReturn)? - timezoneMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$UserMutationReturn)? - userMutationReturn, - required _T Function() orElse, - }) { - switch ($__typename) { - case "ApiKeyMutationReturn": - if (apiKeyMutationReturn != null) { - return apiKeyMutationReturn( - this as Fragment$basicMutationReturnFields$$ApiKeyMutationReturn); - } else { - return orElse(); - } - - case "AutoUpgradeSettingsMutationReturn": - if (autoUpgradeSettingsMutationReturn != null) { - return autoUpgradeSettingsMutationReturn(this - as Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn); - } else { - return orElse(); - } - - case "DeviceApiTokenMutationReturn": - if (deviceApiTokenMutationReturn != null) { - return deviceApiTokenMutationReturn(this - as Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn); - } else { - return orElse(); - } - - case "GenericBackupConfigReturn": - if (genericBackupConfigReturn != null) { - return genericBackupConfigReturn(this - as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); - } else { - return orElse(); - } - - case "GenericJobMutationReturn": - if (genericJobMutationReturn != null) { - return genericJobMutationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); - } else { - return orElse(); - } - - case "GenericMutationReturn": - if (genericMutationReturn != null) { - return genericMutationReturn(this - as Fragment$basicMutationReturnFields$$GenericMutationReturn); - } else { - return orElse(); - } - - case "ServiceJobMutationReturn": - if (serviceJobMutationReturn != null) { - return serviceJobMutationReturn(this - as Fragment$basicMutationReturnFields$$ServiceJobMutationReturn); - } else { - return orElse(); - } - - case "ServiceMutationReturn": - if (serviceMutationReturn != null) { - return serviceMutationReturn(this - as Fragment$basicMutationReturnFields$$ServiceMutationReturn); - } else { - return orElse(); - } - - case "TimezoneMutationReturn": - if (timezoneMutationReturn != null) { - return timezoneMutationReturn(this - as Fragment$basicMutationReturnFields$$TimezoneMutationReturn); - } else { - return orElse(); - } - - case "UserMutationReturn": - if (userMutationReturn != null) { - return userMutationReturn( - this as Fragment$basicMutationReturnFields$$UserMutationReturn); - } else { - return orElse(); - } - - default: - return orElse(); - } - } -} - -abstract class CopyWith$Fragment$basicMutationReturnFields { - factory CopyWith$Fragment$basicMutationReturnFields( - Fragment$basicMutationReturnFields instance, - TRes Function(Fragment$basicMutationReturnFields) then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields; - - factory CopyWith$Fragment$basicMutationReturnFields.stub(TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields - implements CopyWith$Fragment$basicMutationReturnFields { - _CopyWithImpl$Fragment$basicMutationReturnFields( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields _instance; - - final TRes Function(Fragment$basicMutationReturnFields) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields - implements CopyWith$Fragment$basicMutationReturnFields { - _CopyWithStubImpl$Fragment$basicMutationReturnFields(this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -const fragmentDefinitionbasicMutationReturnFields = FragmentDefinitionNode( - name: NameNode(value: 'basicMutationReturnFields'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'MutationReturnInterface'), - isNonNull: false, - )), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'code'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'message'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'success'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: '__typename'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - ]), -); -const documentNodeFragmentbasicMutationReturnFields = - DocumentNode(definitions: [ - fragmentDefinitionbasicMutationReturnFields, -]); - -extension ClientExtension$Fragment$basicMutationReturnFields - on graphql.GraphQLClient { - void writeFragment$basicMutationReturnFields({ - required Fragment$basicMutationReturnFields data, - required Map idFields, - bool broadcast = true, - }) => - this.writeFragment( - graphql.FragmentRequest( - idFields: idFields, - fragment: const graphql.Fragment( - fragmentName: 'basicMutationReturnFields', - document: documentNodeFragmentbasicMutationReturnFields, - ), - ), - data: data.toJson(), - broadcast: broadcast, - ); - Fragment$basicMutationReturnFields? readFragment$basicMutationReturnFields({ - required Map idFields, - bool optimistic = true, - }) { - final result = this.readFragment( - graphql.FragmentRequest( - idFields: idFields, - fragment: const graphql.Fragment( - fragmentName: 'basicMutationReturnFields', - document: documentNodeFragmentbasicMutationReturnFields, - ), - ), - optimistic: optimistic, - ); - return result == null - ? null - : Fragment$basicMutationReturnFields.fromJson(result); - } -} - -class Fragment$basicMutationReturnFields$$ApiKeyMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'ApiKeyMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$ApiKeyMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn - on Fragment$basicMutationReturnFields$$ApiKeyMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$ApiKeyMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'AutoUpgradeSettingsMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - on Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - instance, - TRes Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'DeviceApiTokenMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - on Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn instance, - TRes Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$GenericBackupConfigReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'GenericBackupConfigReturn', - }); - - factory Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn - on Fragment$basicMutationReturnFields$$GenericBackupConfigReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$GenericBackupConfigReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$GenericJobMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericJobMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'GenericJobMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$GenericJobMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$GenericJobMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericJobMutationReturn - on Fragment$basicMutationReturnFields$$GenericJobMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - Fragment$basicMutationReturnFields$$GenericJobMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - Fragment$basicMutationReturnFields$$GenericJobMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$GenericJobMutationReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$GenericJobMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$GenericMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'GenericMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$GenericMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$GenericMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericMutationReturn - on Fragment$basicMutationReturnFields$$GenericMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - Fragment$basicMutationReturnFields$$GenericMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn( - Fragment$basicMutationReturnFields$$GenericMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$GenericMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$GenericMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$GenericMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$ServiceJobMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'ServiceJobMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$ServiceJobMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn - on Fragment$basicMutationReturnFields$$ServiceJobMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$ServiceJobMutationReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$ServiceMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$ServiceMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'ServiceMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$ServiceMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$ServiceMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$ServiceMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$ServiceMutationReturn - on Fragment$basicMutationReturnFields$$ServiceMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - Fragment$basicMutationReturnFields$$ServiceMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - Fragment$basicMutationReturnFields$$ServiceMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$ServiceMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$ServiceMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$ServiceMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$ServiceMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$TimezoneMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$TimezoneMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'TimezoneMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$TimezoneMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$TimezoneMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$TimezoneMutationReturn - on Fragment$basicMutationReturnFields$$TimezoneMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - Fragment$basicMutationReturnFields$$TimezoneMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - Fragment$basicMutationReturnFields$$TimezoneMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$TimezoneMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$TimezoneMutationReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$TimezoneMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$UserMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$UserMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'UserMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$UserMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$UserMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$UserMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$UserMutationReturn - on Fragment$basicMutationReturnFields$$UserMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn< - Fragment$basicMutationReturnFields$$UserMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn( - Fragment$basicMutationReturnFields$$UserMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$UserMutationReturn) then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$UserMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$UserMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$UserMutationReturn - implements - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn { - _CopyWithImpl$Fragment$basicMutationReturnFields$$UserMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$UserMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$UserMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$UserMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$UserMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$UserMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} +import 'server_api.graphql.dart'; class Fragment$fragmentDnsRecords { Fragment$fragmentDnsRecords({ diff --git a/lib/logic/api_maps/graphql_maps/schema/services.graphql b/lib/logic/api_maps/graphql_maps/schema/services.graphql index ee5ee245..a2430dcf 100644 --- a/lib/logic/api_maps/graphql_maps/schema/services.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/services.graphql @@ -1,9 +1,3 @@ -fragment basicMutationReturnFields on MutationReturnInterface{ - code - message - success -} - query AllServices { services { allServices { diff --git a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart index 4d33f536..798167fd 100644 --- a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart @@ -1,2289 +1,10 @@ import 'dart:async'; -import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'schema.graphql.dart'; import 'server_api.graphql.dart'; import 'server_settings.graphql.dart'; -class Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields({ - required this.code, - required this.message, - required this.success, - required this.$__typename, - }); - - factory Fragment$basicMutationReturnFields.fromJson( - Map json) { - switch (json["__typename"] as String) { - case "ApiKeyMutationReturn": - return Fragment$basicMutationReturnFields$$ApiKeyMutationReturn - .fromJson(json); - - case "AutoUpgradeSettingsMutationReturn": - return Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - .fromJson(json); - - case "DeviceApiTokenMutationReturn": - return Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - .fromJson(json); - - case "GenericBackupConfigReturn": - return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn - .fromJson(json); - - case "GenericJobMutationReturn": - return Fragment$basicMutationReturnFields$$GenericJobMutationReturn - .fromJson(json); - - case "GenericMutationReturn": - return Fragment$basicMutationReturnFields$$GenericMutationReturn - .fromJson(json); - - case "ServiceJobMutationReturn": - return Fragment$basicMutationReturnFields$$ServiceJobMutationReturn - .fromJson(json); - - case "ServiceMutationReturn": - return Fragment$basicMutationReturnFields$$ServiceMutationReturn - .fromJson(json); - - case "TimezoneMutationReturn": - return Fragment$basicMutationReturnFields$$TimezoneMutationReturn - .fromJson(json); - - case "UserMutationReturn": - return Fragment$basicMutationReturnFields$$UserMutationReturn.fromJson( - json); - - default: - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields - on Fragment$basicMutationReturnFields { - CopyWith$Fragment$basicMutationReturnFields< - Fragment$basicMutationReturnFields> - get copyWith => CopyWith$Fragment$basicMutationReturnFields( - this, - (i) => i, - ); - _T when<_T>({ - required _T Function( - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) - apiKeyMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) - autoUpgradeSettingsMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) - deviceApiTokenMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) - genericBackupConfigReturn, - required _T Function( - Fragment$basicMutationReturnFields$$GenericJobMutationReturn) - genericJobMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$GenericMutationReturn) - genericMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) - serviceJobMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$ServiceMutationReturn) - serviceMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$TimezoneMutationReturn) - timezoneMutationReturn, - required _T Function(Fragment$basicMutationReturnFields$$UserMutationReturn) - userMutationReturn, - required _T Function() orElse, - }) { - switch ($__typename) { - case "ApiKeyMutationReturn": - return apiKeyMutationReturn( - this as Fragment$basicMutationReturnFields$$ApiKeyMutationReturn); - - case "AutoUpgradeSettingsMutationReturn": - return autoUpgradeSettingsMutationReturn(this - as Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn); - - case "DeviceApiTokenMutationReturn": - return deviceApiTokenMutationReturn(this - as Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn); - - case "GenericBackupConfigReturn": - return genericBackupConfigReturn(this - as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); - - case "GenericJobMutationReturn": - return genericJobMutationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); - - case "GenericMutationReturn": - return genericMutationReturn( - this as Fragment$basicMutationReturnFields$$GenericMutationReturn); - - case "ServiceJobMutationReturn": - return serviceJobMutationReturn(this - as Fragment$basicMutationReturnFields$$ServiceJobMutationReturn); - - case "ServiceMutationReturn": - return serviceMutationReturn( - this as Fragment$basicMutationReturnFields$$ServiceMutationReturn); - - case "TimezoneMutationReturn": - return timezoneMutationReturn( - this as Fragment$basicMutationReturnFields$$TimezoneMutationReturn); - - case "UserMutationReturn": - return userMutationReturn( - this as Fragment$basicMutationReturnFields$$UserMutationReturn); - - default: - return orElse(); - } - } - - _T maybeWhen<_T>({ - _T Function(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn)? - apiKeyMutationReturn, - _T Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn)? - autoUpgradeSettingsMutationReturn, - _T Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn)? - deviceApiTokenMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn)? - genericBackupConfigReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn)? - genericJobMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericMutationReturn)? - genericMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn)? - serviceJobMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$ServiceMutationReturn)? - serviceMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$TimezoneMutationReturn)? - timezoneMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$UserMutationReturn)? - userMutationReturn, - required _T Function() orElse, - }) { - switch ($__typename) { - case "ApiKeyMutationReturn": - if (apiKeyMutationReturn != null) { - return apiKeyMutationReturn( - this as Fragment$basicMutationReturnFields$$ApiKeyMutationReturn); - } else { - return orElse(); - } - - case "AutoUpgradeSettingsMutationReturn": - if (autoUpgradeSettingsMutationReturn != null) { - return autoUpgradeSettingsMutationReturn(this - as Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn); - } else { - return orElse(); - } - - case "DeviceApiTokenMutationReturn": - if (deviceApiTokenMutationReturn != null) { - return deviceApiTokenMutationReturn(this - as Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn); - } else { - return orElse(); - } - - case "GenericBackupConfigReturn": - if (genericBackupConfigReturn != null) { - return genericBackupConfigReturn(this - as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); - } else { - return orElse(); - } - - case "GenericJobMutationReturn": - if (genericJobMutationReturn != null) { - return genericJobMutationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); - } else { - return orElse(); - } - - case "GenericMutationReturn": - if (genericMutationReturn != null) { - return genericMutationReturn(this - as Fragment$basicMutationReturnFields$$GenericMutationReturn); - } else { - return orElse(); - } - - case "ServiceJobMutationReturn": - if (serviceJobMutationReturn != null) { - return serviceJobMutationReturn(this - as Fragment$basicMutationReturnFields$$ServiceJobMutationReturn); - } else { - return orElse(); - } - - case "ServiceMutationReturn": - if (serviceMutationReturn != null) { - return serviceMutationReturn(this - as Fragment$basicMutationReturnFields$$ServiceMutationReturn); - } else { - return orElse(); - } - - case "TimezoneMutationReturn": - if (timezoneMutationReturn != null) { - return timezoneMutationReturn(this - as Fragment$basicMutationReturnFields$$TimezoneMutationReturn); - } else { - return orElse(); - } - - case "UserMutationReturn": - if (userMutationReturn != null) { - return userMutationReturn( - this as Fragment$basicMutationReturnFields$$UserMutationReturn); - } else { - return orElse(); - } - - default: - return orElse(); - } - } -} - -abstract class CopyWith$Fragment$basicMutationReturnFields { - factory CopyWith$Fragment$basicMutationReturnFields( - Fragment$basicMutationReturnFields instance, - TRes Function(Fragment$basicMutationReturnFields) then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields; - - factory CopyWith$Fragment$basicMutationReturnFields.stub(TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields - implements CopyWith$Fragment$basicMutationReturnFields { - _CopyWithImpl$Fragment$basicMutationReturnFields( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields _instance; - - final TRes Function(Fragment$basicMutationReturnFields) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields - implements CopyWith$Fragment$basicMutationReturnFields { - _CopyWithStubImpl$Fragment$basicMutationReturnFields(this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -const fragmentDefinitionbasicMutationReturnFields = FragmentDefinitionNode( - name: NameNode(value: 'basicMutationReturnFields'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'MutationReturnInterface'), - isNonNull: false, - )), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'code'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'message'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'success'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: '__typename'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - ]), -); -const documentNodeFragmentbasicMutationReturnFields = - DocumentNode(definitions: [ - fragmentDefinitionbasicMutationReturnFields, -]); - -extension ClientExtension$Fragment$basicMutationReturnFields - on graphql.GraphQLClient { - void writeFragment$basicMutationReturnFields({ - required Fragment$basicMutationReturnFields data, - required Map idFields, - bool broadcast = true, - }) => - this.writeFragment( - graphql.FragmentRequest( - idFields: idFields, - fragment: const graphql.Fragment( - fragmentName: 'basicMutationReturnFields', - document: documentNodeFragmentbasicMutationReturnFields, - ), - ), - data: data.toJson(), - broadcast: broadcast, - ); - Fragment$basicMutationReturnFields? readFragment$basicMutationReturnFields({ - required Map idFields, - bool optimistic = true, - }) { - final result = this.readFragment( - graphql.FragmentRequest( - idFields: idFields, - fragment: const graphql.Fragment( - fragmentName: 'basicMutationReturnFields', - document: documentNodeFragmentbasicMutationReturnFields, - ), - ), - optimistic: optimistic, - ); - return result == null - ? null - : Fragment$basicMutationReturnFields.fromJson(result); - } -} - -class Fragment$basicMutationReturnFields$$ApiKeyMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'ApiKeyMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$ApiKeyMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn - on Fragment$basicMutationReturnFields$$ApiKeyMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$ApiKeyMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'AutoUpgradeSettingsMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - on Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - instance, - TRes Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'DeviceApiTokenMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - on Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn instance, - TRes Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$GenericBackupConfigReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'GenericBackupConfigReturn', - }); - - factory Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn - on Fragment$basicMutationReturnFields$$GenericBackupConfigReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$GenericBackupConfigReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$GenericJobMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericJobMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'GenericJobMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$GenericJobMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$GenericJobMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericJobMutationReturn - on Fragment$basicMutationReturnFields$$GenericJobMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - Fragment$basicMutationReturnFields$$GenericJobMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - Fragment$basicMutationReturnFields$$GenericJobMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$GenericJobMutationReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$GenericJobMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$GenericMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'GenericMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$GenericMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$GenericMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericMutationReturn - on Fragment$basicMutationReturnFields$$GenericMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - Fragment$basicMutationReturnFields$$GenericMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn( - Fragment$basicMutationReturnFields$$GenericMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$GenericMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$GenericMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$GenericMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$ServiceJobMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'ServiceJobMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$ServiceJobMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn - on Fragment$basicMutationReturnFields$$ServiceJobMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$ServiceJobMutationReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$ServiceMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$ServiceMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'ServiceMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$ServiceMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$ServiceMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$ServiceMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$ServiceMutationReturn - on Fragment$basicMutationReturnFields$$ServiceMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - Fragment$basicMutationReturnFields$$ServiceMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - Fragment$basicMutationReturnFields$$ServiceMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$ServiceMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$ServiceMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$ServiceMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$ServiceMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$TimezoneMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$TimezoneMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'TimezoneMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$TimezoneMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$TimezoneMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$TimezoneMutationReturn - on Fragment$basicMutationReturnFields$$TimezoneMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - Fragment$basicMutationReturnFields$$TimezoneMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - Fragment$basicMutationReturnFields$$TimezoneMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$TimezoneMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$TimezoneMutationReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$TimezoneMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$UserMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$UserMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'UserMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$UserMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$UserMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$UserMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$UserMutationReturn - on Fragment$basicMutationReturnFields$$UserMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn< - Fragment$basicMutationReturnFields$$UserMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn( - Fragment$basicMutationReturnFields$$UserMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$UserMutationReturn) then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$UserMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$UserMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$UserMutationReturn - implements - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn { - _CopyWithImpl$Fragment$basicMutationReturnFields$$UserMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$UserMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$UserMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$UserMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$UserMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$UserMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - class Query$AllServices { Query$AllServices({ required this.services, diff --git a/lib/logic/api_maps/graphql_maps/schema/users.graphql b/lib/logic/api_maps/graphql_maps/schema/users.graphql index 78de71ff..7ce64f8a 100644 --- a/lib/logic/api_maps/graphql_maps/schema/users.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/users.graphql @@ -1,9 +1,3 @@ -fragment basicMutationReturnFields on MutationReturnInterface{ - code - message - success -} - fragment userFields on User{ username userType diff --git a/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart index d17316df..5d86dc05 100644 --- a/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart @@ -1,2286 +1,8 @@ import 'dart:async'; -import 'disk_volumes.graphql.dart'; import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'schema.graphql.dart'; - -class Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields({ - required this.code, - required this.message, - required this.success, - required this.$__typename, - }); - - factory Fragment$basicMutationReturnFields.fromJson( - Map json) { - switch (json["__typename"] as String) { - case "ApiKeyMutationReturn": - return Fragment$basicMutationReturnFields$$ApiKeyMutationReturn - .fromJson(json); - - case "AutoUpgradeSettingsMutationReturn": - return Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - .fromJson(json); - - case "DeviceApiTokenMutationReturn": - return Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - .fromJson(json); - - case "GenericBackupConfigReturn": - return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn - .fromJson(json); - - case "GenericJobMutationReturn": - return Fragment$basicMutationReturnFields$$GenericJobMutationReturn - .fromJson(json); - - case "GenericMutationReturn": - return Fragment$basicMutationReturnFields$$GenericMutationReturn - .fromJson(json); - - case "ServiceJobMutationReturn": - return Fragment$basicMutationReturnFields$$ServiceJobMutationReturn - .fromJson(json); - - case "ServiceMutationReturn": - return Fragment$basicMutationReturnFields$$ServiceMutationReturn - .fromJson(json); - - case "TimezoneMutationReturn": - return Fragment$basicMutationReturnFields$$TimezoneMutationReturn - .fromJson(json); - - case "UserMutationReturn": - return Fragment$basicMutationReturnFields$$UserMutationReturn.fromJson( - json); - - default: - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields - on Fragment$basicMutationReturnFields { - CopyWith$Fragment$basicMutationReturnFields< - Fragment$basicMutationReturnFields> - get copyWith => CopyWith$Fragment$basicMutationReturnFields( - this, - (i) => i, - ); - _T when<_T>({ - required _T Function( - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) - apiKeyMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) - autoUpgradeSettingsMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) - deviceApiTokenMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) - genericBackupConfigReturn, - required _T Function( - Fragment$basicMutationReturnFields$$GenericJobMutationReturn) - genericJobMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$GenericMutationReturn) - genericMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) - serviceJobMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$ServiceMutationReturn) - serviceMutationReturn, - required _T Function( - Fragment$basicMutationReturnFields$$TimezoneMutationReturn) - timezoneMutationReturn, - required _T Function(Fragment$basicMutationReturnFields$$UserMutationReturn) - userMutationReturn, - required _T Function() orElse, - }) { - switch ($__typename) { - case "ApiKeyMutationReturn": - return apiKeyMutationReturn( - this as Fragment$basicMutationReturnFields$$ApiKeyMutationReturn); - - case "AutoUpgradeSettingsMutationReturn": - return autoUpgradeSettingsMutationReturn(this - as Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn); - - case "DeviceApiTokenMutationReturn": - return deviceApiTokenMutationReturn(this - as Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn); - - case "GenericBackupConfigReturn": - return genericBackupConfigReturn(this - as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); - - case "GenericJobMutationReturn": - return genericJobMutationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); - - case "GenericMutationReturn": - return genericMutationReturn( - this as Fragment$basicMutationReturnFields$$GenericMutationReturn); - - case "ServiceJobMutationReturn": - return serviceJobMutationReturn(this - as Fragment$basicMutationReturnFields$$ServiceJobMutationReturn); - - case "ServiceMutationReturn": - return serviceMutationReturn( - this as Fragment$basicMutationReturnFields$$ServiceMutationReturn); - - case "TimezoneMutationReturn": - return timezoneMutationReturn( - this as Fragment$basicMutationReturnFields$$TimezoneMutationReturn); - - case "UserMutationReturn": - return userMutationReturn( - this as Fragment$basicMutationReturnFields$$UserMutationReturn); - - default: - return orElse(); - } - } - - _T maybeWhen<_T>({ - _T Function(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn)? - apiKeyMutationReturn, - _T Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn)? - autoUpgradeSettingsMutationReturn, - _T Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn)? - deviceApiTokenMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn)? - genericBackupConfigReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn)? - genericJobMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$GenericMutationReturn)? - genericMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn)? - serviceJobMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$ServiceMutationReturn)? - serviceMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$TimezoneMutationReturn)? - timezoneMutationReturn, - _T Function(Fragment$basicMutationReturnFields$$UserMutationReturn)? - userMutationReturn, - required _T Function() orElse, - }) { - switch ($__typename) { - case "ApiKeyMutationReturn": - if (apiKeyMutationReturn != null) { - return apiKeyMutationReturn( - this as Fragment$basicMutationReturnFields$$ApiKeyMutationReturn); - } else { - return orElse(); - } - - case "AutoUpgradeSettingsMutationReturn": - if (autoUpgradeSettingsMutationReturn != null) { - return autoUpgradeSettingsMutationReturn(this - as Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn); - } else { - return orElse(); - } - - case "DeviceApiTokenMutationReturn": - if (deviceApiTokenMutationReturn != null) { - return deviceApiTokenMutationReturn(this - as Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn); - } else { - return orElse(); - } - - case "GenericBackupConfigReturn": - if (genericBackupConfigReturn != null) { - return genericBackupConfigReturn(this - as Fragment$basicMutationReturnFields$$GenericBackupConfigReturn); - } else { - return orElse(); - } - - case "GenericJobMutationReturn": - if (genericJobMutationReturn != null) { - return genericJobMutationReturn(this - as Fragment$basicMutationReturnFields$$GenericJobMutationReturn); - } else { - return orElse(); - } - - case "GenericMutationReturn": - if (genericMutationReturn != null) { - return genericMutationReturn(this - as Fragment$basicMutationReturnFields$$GenericMutationReturn); - } else { - return orElse(); - } - - case "ServiceJobMutationReturn": - if (serviceJobMutationReturn != null) { - return serviceJobMutationReturn(this - as Fragment$basicMutationReturnFields$$ServiceJobMutationReturn); - } else { - return orElse(); - } - - case "ServiceMutationReturn": - if (serviceMutationReturn != null) { - return serviceMutationReturn(this - as Fragment$basicMutationReturnFields$$ServiceMutationReturn); - } else { - return orElse(); - } - - case "TimezoneMutationReturn": - if (timezoneMutationReturn != null) { - return timezoneMutationReturn(this - as Fragment$basicMutationReturnFields$$TimezoneMutationReturn); - } else { - return orElse(); - } - - case "UserMutationReturn": - if (userMutationReturn != null) { - return userMutationReturn( - this as Fragment$basicMutationReturnFields$$UserMutationReturn); - } else { - return orElse(); - } - - default: - return orElse(); - } - } -} - -abstract class CopyWith$Fragment$basicMutationReturnFields { - factory CopyWith$Fragment$basicMutationReturnFields( - Fragment$basicMutationReturnFields instance, - TRes Function(Fragment$basicMutationReturnFields) then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields; - - factory CopyWith$Fragment$basicMutationReturnFields.stub(TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields - implements CopyWith$Fragment$basicMutationReturnFields { - _CopyWithImpl$Fragment$basicMutationReturnFields( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields _instance; - - final TRes Function(Fragment$basicMutationReturnFields) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields - implements CopyWith$Fragment$basicMutationReturnFields { - _CopyWithStubImpl$Fragment$basicMutationReturnFields(this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -const fragmentDefinitionbasicMutationReturnFields = FragmentDefinitionNode( - name: NameNode(value: 'basicMutationReturnFields'), - typeCondition: TypeConditionNode( - on: NamedTypeNode( - name: NameNode(value: 'MutationReturnInterface'), - isNonNull: false, - )), - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'code'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'message'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: 'success'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - FieldNode( - name: NameNode(value: '__typename'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - ]), -); -const documentNodeFragmentbasicMutationReturnFields = - DocumentNode(definitions: [ - fragmentDefinitionbasicMutationReturnFields, -]); - -extension ClientExtension$Fragment$basicMutationReturnFields - on graphql.GraphQLClient { - void writeFragment$basicMutationReturnFields({ - required Fragment$basicMutationReturnFields data, - required Map idFields, - bool broadcast = true, - }) => - this.writeFragment( - graphql.FragmentRequest( - idFields: idFields, - fragment: const graphql.Fragment( - fragmentName: 'basicMutationReturnFields', - document: documentNodeFragmentbasicMutationReturnFields, - ), - ), - data: data.toJson(), - broadcast: broadcast, - ); - Fragment$basicMutationReturnFields? readFragment$basicMutationReturnFields({ - required Map idFields, - bool optimistic = true, - }) { - final result = this.readFragment( - graphql.FragmentRequest( - idFields: idFields, - fragment: const graphql.Fragment( - fragmentName: 'basicMutationReturnFields', - document: documentNodeFragmentbasicMutationReturnFields, - ), - ), - optimistic: optimistic, - ); - return result == null - ? null - : Fragment$basicMutationReturnFields.fromJson(result); - } -} - -class Fragment$basicMutationReturnFields$$ApiKeyMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'ApiKeyMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$ApiKeyMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn - on Fragment$basicMutationReturnFields$$ApiKeyMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - Fragment$basicMutationReturnFields$$ApiKeyMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$ApiKeyMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ApiKeyMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'AutoUpgradeSettingsMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - on Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - instance, - TRes Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn - _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then( - Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$AutoUpgradeSettingsMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'DeviceApiTokenMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - on Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn instance, - TRes Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn - _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$DeviceApiTokenMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$GenericBackupConfigReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'GenericBackupConfigReturn', - }); - - factory Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn - on Fragment$basicMutationReturnFields$$GenericBackupConfigReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$GenericBackupConfigReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$GenericBackupConfigReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericBackupConfigReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$GenericJobMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericJobMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'GenericJobMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$GenericJobMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$GenericJobMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericJobMutationReturn - on Fragment$basicMutationReturnFields$$GenericJobMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - Fragment$basicMutationReturnFields$$GenericJobMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - Fragment$basicMutationReturnFields$$GenericJobMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericJobMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$GenericJobMutationReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$GenericJobMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericJobMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericJobMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$GenericMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$GenericMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'GenericMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$GenericMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$GenericMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$GenericMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$GenericMutationReturn - on Fragment$basicMutationReturnFields$$GenericMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - Fragment$basicMutationReturnFields$$GenericMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn( - Fragment$basicMutationReturnFields$$GenericMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$GenericMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$GenericMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$GenericMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$GenericMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$GenericMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$GenericMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$ServiceJobMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'ServiceJobMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$ServiceJobMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn - on Fragment$basicMutationReturnFields$$ServiceJobMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$ServiceJobMutationReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$ServiceJobMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceJobMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$ServiceMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$ServiceMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'ServiceMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$ServiceMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$ServiceMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$ServiceMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$ServiceMutationReturn - on Fragment$basicMutationReturnFields$$ServiceMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - Fragment$basicMutationReturnFields$$ServiceMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - Fragment$basicMutationReturnFields$$ServiceMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$ServiceMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$ServiceMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$ServiceMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$ServiceMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$ServiceMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$ServiceMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$TimezoneMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$TimezoneMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'TimezoneMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$TimezoneMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other - is Fragment$basicMutationReturnFields$$TimezoneMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$TimezoneMutationReturn - on Fragment$basicMutationReturnFields$$TimezoneMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - Fragment$basicMutationReturnFields$$TimezoneMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - Fragment$basicMutationReturnFields$$TimezoneMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$TimezoneMutationReturn) - then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> { - _CopyWithImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$TimezoneMutationReturn _instance; - - final TRes Function( - Fragment$basicMutationReturnFields$$TimezoneMutationReturn) _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$TimezoneMutationReturn< - TRes> { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$TimezoneMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} - -class Fragment$basicMutationReturnFields$$UserMutationReturn - implements Fragment$basicMutationReturnFields { - Fragment$basicMutationReturnFields$$UserMutationReturn({ - required this.code, - required this.message, - required this.success, - this.$__typename = 'UserMutationReturn', - }); - - factory Fragment$basicMutationReturnFields$$UserMutationReturn.fromJson( - Map json) { - final l$code = json['code']; - final l$message = json['message']; - final l$success = json['success']; - final l$$__typename = json['__typename']; - return Fragment$basicMutationReturnFields$$UserMutationReturn( - code: (l$code as int), - message: (l$message as String), - success: (l$success as bool), - $__typename: (l$$__typename as String), - ); - } - - final int code; - - final String message; - - final bool success; - - final String $__typename; - - Map toJson() { - final _resultData = {}; - final l$code = code; - _resultData['code'] = l$code; - final l$message = message; - _resultData['message'] = l$message; - final l$success = success; - _resultData['success'] = l$success; - final l$$__typename = $__typename; - _resultData['__typename'] = l$$__typename; - return _resultData; - } - - @override - int get hashCode { - final l$code = code; - final l$message = message; - final l$success = success; - final l$$__typename = $__typename; - return Object.hashAll([ - l$code, - l$message, - l$success, - l$$__typename, - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) { - return true; - } - if (!(other is Fragment$basicMutationReturnFields$$UserMutationReturn) || - runtimeType != other.runtimeType) { - return false; - } - final l$code = code; - final lOther$code = other.code; - if (l$code != lOther$code) { - return false; - } - final l$message = message; - final lOther$message = other.message; - if (l$message != lOther$message) { - return false; - } - final l$success = success; - final lOther$success = other.success; - if (l$success != lOther$success) { - return false; - } - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) { - return false; - } - return true; - } -} - -extension UtilityExtension$Fragment$basicMutationReturnFields$$UserMutationReturn - on Fragment$basicMutationReturnFields$$UserMutationReturn { - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn< - Fragment$basicMutationReturnFields$$UserMutationReturn> - get copyWith => - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn( - this, - (i) => i, - ); -} - -abstract class CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn< - TRes> { - factory CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn( - Fragment$basicMutationReturnFields$$UserMutationReturn instance, - TRes Function(Fragment$basicMutationReturnFields$$UserMutationReturn) then, - ) = _CopyWithImpl$Fragment$basicMutationReturnFields$$UserMutationReturn; - - factory CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn.stub( - TRes res) = - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$UserMutationReturn; - - TRes call({ - int? code, - String? message, - bool? success, - String? $__typename, - }); -} - -class _CopyWithImpl$Fragment$basicMutationReturnFields$$UserMutationReturn - implements - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn { - _CopyWithImpl$Fragment$basicMutationReturnFields$$UserMutationReturn( - this._instance, - this._then, - ); - - final Fragment$basicMutationReturnFields$$UserMutationReturn _instance; - - final TRes Function(Fragment$basicMutationReturnFields$$UserMutationReturn) - _then; - - static const _undefined = {}; - - TRes call({ - Object? code = _undefined, - Object? message = _undefined, - Object? success = _undefined, - Object? $__typename = _undefined, - }) => - _then(Fragment$basicMutationReturnFields$$UserMutationReturn( - code: - code == _undefined || code == null ? _instance.code : (code as int), - message: message == _undefined || message == null - ? _instance.message - : (message as String), - success: success == _undefined || success == null - ? _instance.success - : (success as bool), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String), - )); -} - -class _CopyWithStubImpl$Fragment$basicMutationReturnFields$$UserMutationReturn< - TRes> - implements - CopyWith$Fragment$basicMutationReturnFields$$UserMutationReturn { - _CopyWithStubImpl$Fragment$basicMutationReturnFields$$UserMutationReturn( - this._res); - - TRes _res; - - call({ - int? code, - String? message, - bool? success, - String? $__typename, - }) => - _res; -} +import 'server_api.graphql.dart'; class Fragment$userFields { Fragment$userFields({ diff --git a/lib/logic/api_maps/graphql_maps/server_api/server_api.dart b/lib/logic/api_maps/graphql_maps/server_api/server_api.dart index 91694945..bc28a681 100644 --- a/lib/logic/api_maps/graphql_maps/server_api/server_api.dart +++ b/lib/logic/api_maps/graphql_maps/server_api/server_api.dart @@ -35,7 +35,13 @@ part 'volume_api.dart'; part 'backups_api.dart'; class ServerApi extends GraphQLApiMap - with VolumeApi, JobsApi, ServerActionsApi, ServicesApi, UsersApi, BackupsApi { + with + VolumeApi, + JobsApi, + ServerActionsApi, + ServicesApi, + UsersApi, + BackupsApi { ServerApi({ this.hasLogger = false, this.isWithToken = true, From 290c4166c5e010c459da6fa8e0cb3bbe3f439ca2 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Sun, 2 Jul 2023 18:22:27 +0300 Subject: [PATCH 16/20] feat: Add pub:duration as a dependency --- pubspec.lock | 8 ++++++++ pubspec.yaml | 1 + 2 files changed, 9 insertions(+) diff --git a/pubspec.lock b/pubspec.lock index d812a890..05045a0a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -297,6 +297,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.1.2" + duration: + dependency: "direct main" + description: + name: duration + sha256: d0b29d0a345429e3986ac56d60e4aef65b37d11e653022b2b9a4b361332b777f + url: "https://pub.dev" + source: hosted + version: "3.0.12" dynamic_color: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 4e5e35d7..4fc007e8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,6 +15,7 @@ dependencies: cubit_form: ^2.0.1 device_info_plus: ^9.0.2 dio: ^5.1.2 + duration: 3.0.12 dynamic_color: ^1.6.5 easy_localization: ^3.0.2 either_option: ^2.0.1-dev.1 From 2b8d3ee6d0357fd08f28b318a0609929449b316f Mon Sep 17 00:00:00 2001 From: Inex Code Date: Sun, 2 Jul 2023 18:23:12 +0300 Subject: [PATCH 17/20] refactor: Getters for backup-related jobs --- lib/logic/cubit/backups/backups_cubit.dart | 28 +++++++++++++++---- lib/logic/cubit/backups/backups_state.dart | 10 ++++++- .../cubit/server_jobs/server_jobs_state.dart | 3 +- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/lib/logic/cubit/backups/backups_cubit.dart b/lib/logic/cubit/backups/backups_cubit.dart index 6e34b410..ef3cec4d 100644 --- a/lib/logic/cubit/backups/backups_cubit.dart +++ b/lib/logic/cubit/backups/backups_cubit.dart @@ -35,7 +35,7 @@ class BackupsCubit extends ServerInstallationDependendCubit { state.copyWith( backblazeBucket: bucket, isInitialized: backupConfig?.isInitialized, - autobackupPeriod: backupConfig?.autobackupPeriod, + autobackupPeriod: backupConfig?.autobackupPeriod ?? Duration.zero, backups: backups, preventActions: false, refreshing: false, @@ -164,8 +164,8 @@ class BackupsCubit extends ServerInstallationDependendCubit { Future forceUpdateBackups() async { emit(state.copyWith(preventActions: true)); - await api.forceBackupListReload(); getIt().showSnackBar('backup.refetching_list'.tr()); + await api.forceBackupListReload(); emit(state.copyWith(preventActions: false)); } @@ -187,12 +187,30 @@ class BackupsCubit extends ServerInstallationDependendCubit { Future restoreBackup(final String backupId) async { emit(state.copyWith(preventActions: true)); - - /// TOOD: ??? - //await api.restoreBackup(backupId); + await api.restoreBackup(backupId); emit(state.copyWith(preventActions: false)); } + Future setAutobackupPeriod(final Duration? period) async { + emit(state.copyWith(preventActions: true)); + final result = await api.setAutobackupPeriod(period: period?.inMinutes); + if (result.success == false) { + getIt() + .showSnackBar(result.message ?? 'Unknown error'); + emit(state.copyWith(preventActions: false)); + } else { + getIt() + .showSnackBar('backup.autobackup_period_set'.tr()); + emit( + state.copyWith( + preventActions: false, + autobackupPeriod: period ?? Duration.zero, + ), + ); + } + await updateBackups(); + } + @override void clear() async { emit(const BackupsState()); diff --git a/lib/logic/cubit/backups/backups_state.dart b/lib/logic/cubit/backups/backups_state.dart index 909e7f21..52b9b106 100644 --- a/lib/logic/cubit/backups/backups_state.dart +++ b/lib/logic/cubit/backups/backups_state.dart @@ -19,6 +19,10 @@ class BackupsState extends ServerInstallationDependendState { final Duration? autobackupPeriod; final BackblazeBucket? backblazeBucket; + List serviceBackups(final String serviceId) => backups + .where((final backup) => backup.serviceId == serviceId) + .toList(growable: false); + @override List get props => [ isInitialized, @@ -43,7 +47,11 @@ class BackupsState extends ServerInstallationDependendState { preventActions: preventActions ?? this.preventActions, refreshTimer: refreshTimer ?? this.refreshTimer, refreshing: refreshing ?? this.refreshing, - autobackupPeriod: autobackupPeriod ?? this.autobackupPeriod, + // The autobackupPeriod might be null, so if the duration is set to 0, we + // set it to null. + autobackupPeriod: autobackupPeriod?.inSeconds == 0 + ? null + : autobackupPeriod ?? this.autobackupPeriod, backblazeBucket: backblazeBucket ?? this.backblazeBucket, ); } diff --git a/lib/logic/cubit/server_jobs/server_jobs_state.dart b/lib/logic/cubit/server_jobs/server_jobs_state.dart index 2902ba3b..9a18dd51 100644 --- a/lib/logic/cubit/server_jobs/server_jobs_state.dart +++ b/lib/logic/cubit/server_jobs/server_jobs_state.dart @@ -24,7 +24,8 @@ class ServerJobsState extends ServerInstallationDependendState { List get backupJobList => serverJobList .where( // The backup jobs has the format of 'service..backup' - (final job) => job.typeId.contains('backup'), + (final job) => + job.typeId.contains('backup') || job.typeId.contains('restore'), ) .toList(); From df214a07bc34a27d58a0aea7e40d68bede850b0c Mon Sep 17 00:00:00 2001 From: Inex Code Date: Sun, 2 Jul 2023 18:23:33 +0300 Subject: [PATCH 18/20] refactor: Remove unused utils, add duration formatter --- lib/utils/extensions/duration.dart | 30 +++++++++++--------------- lib/utils/route_transitions/basic.dart | 9 -------- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/lib/utils/extensions/duration.dart b/lib/utils/extensions/duration.dart index 2c302fb8..0e20b07a 100644 --- a/lib/utils/extensions/duration.dart +++ b/lib/utils/extensions/duration.dart @@ -1,13 +1,12 @@ // ignore_for_file: unnecessary_this -extension DurationFormatter on Duration { - String toDayHourMinuteSecondFormat() => [ - this.inHours.remainder(24), - this.inMinutes.remainder(60), - this.inSeconds.remainder(60) - ].map((final int seg) => seg.toString().padLeft(2, '0')).join(':'); +import 'dart:ui'; - String toDayHourMinuteFormat() { +import 'package:duration/duration.dart'; +import 'package:duration/locale.dart'; + +extension DurationFormatter on Duration { + String toTimezoneOffsetFormat() { final designator = this >= Duration.zero ? '+' : '-'; final Iterable segments = [ @@ -18,15 +17,10 @@ extension DurationFormatter on Duration { return '$designator${segments.first}:${segments.last}'; } -// WAT: https://flutterigniter.com/how-to-format-duration/ - String toHoursMinutesSecondsFormat() => - this.toString().split('.').first.padLeft(8, '0'); - - String toDayHourMinuteFormat2() { - final Iterable segments = [ - this.inHours.remainder(24), - this.inMinutes.remainder(60), - ].map((final int seg) => seg.toString().padLeft(2, '0')); - return '${segments.first} h ${segments.last} min'; - } + String toPrettyString(final Locale locale) => + prettyDuration(this, locale: getDurationLocale(locale)); } + +DurationLocale getDurationLocale(final Locale locale) => + DurationLocale.fromLanguageCode(locale.languageCode) ?? + const EnglishDurationLocale(); diff --git a/lib/utils/route_transitions/basic.dart b/lib/utils/route_transitions/basic.dart index a3148e1d..b72d9a94 100644 --- a/lib/utils/route_transitions/basic.dart +++ b/lib/utils/route_transitions/basic.dart @@ -3,12 +3,3 @@ import 'package:flutter/material.dart'; Route materialRoute(final Widget widget) => MaterialPageRoute( builder: (final BuildContext context) => widget, ); - -Route noAnimationRoute(final Widget widget) => PageRouteBuilder( - pageBuilder: ( - final BuildContext context, - final Animation animation1, - final Animation animation2, - ) => - widget, - ); From a4dbba096875283ed2c59b346dda4d0237249299 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Sun, 2 Jul 2023 18:24:07 +0300 Subject: [PATCH 19/20] feat(backups): Backups screens --- assets/translations/en.json | 26 +- .../backup_details.dart | 352 ++++----- lib/ui/pages/backups/backups_list.dart | 85 +++ lib/ui/pages/backups/change_period_modal.dart | 108 +++ .../pages/backups/create_backups_modal.dart | 161 +++++ .../server_details/time_zone/time_zone.dart | 4 +- lib/ui/pages/services/service_page.dart | 13 + lib/ui/router/router.dart | 6 +- lib/ui/router/router.gr.dart | 668 ++++++++++-------- 9 files changed, 901 insertions(+), 522 deletions(-) rename lib/ui/pages/{backup_details => backups}/backup_details.dart (55%) create mode 100644 lib/ui/pages/backups/backups_list.dart create mode 100644 lib/ui/pages/backups/change_period_modal.dart create mode 100644 lib/ui/pages/backups/create_backups_modal.dart diff --git a/assets/translations/en.json b/assets/translations/en.json index 4ca6159a..70756bfa 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -162,6 +162,7 @@ }, "backup": { "card_title": "Backup", + "card_subtitle": "Manage your backups", "description": "Will save your day in case of incident: hackers attack, server deletion, etc.", "reupload_key": "Force reupload key", "reuploaded_key": "Key reuploaded", @@ -176,7 +177,27 @@ "restore_alert": "You are about to restore from backup created on {}. All current data will be lost. Are you sure?", "refresh": "Refresh status", "refetch_backups": "Refetch backup list", - "refetching_list": "In a few minutes list will be updated" + "refetch_backups_subtitle": "Invalidate cache and refetch data from your storage provider. May cause additional charges.", + "reupload_key_subtitle": "Will instruct the server to initialize backup storage again. Use if something is broken.", + "refetching_list": "In a few minutes list will be updated", + "select_all": "Backup everything", + "create_new_select_heading": "Select what to backup", + "start": "Start backup", + "service_busy": "Another backup operation is in progress", + "latest_snapshots": "Latest snapshots", + "latest_snapshots_subtitle": "Showing last 15 snapshots", + "show_more": "Show more", + "autobackup_period_title": "Automatic backups period", + "autobackup_period_subtitle": "Backups created every {period}", + "autobackup_period_never": "Automatic backups are disabled", + "autobackup_period_every": "Every {period}", + "autobackup_period_disable": "Disable automatic backups", + "autobackup_custom": "Custom", + "autobackup_custom_hint": "Enter custom period in minutes", + "autobackup_set_period": "Set period", + "autobackup_period_set": "Period set", + "pending_jobs": "Currently running backup jobs", + "snapshots_title": "Snapshot list" }, "storage": { "card_title": "Server Storage", @@ -210,6 +231,7 @@ "enable": "Enable service", "move": "Move to another volume", "uses": "Uses {usage} on {volume}", + "snapshots": "Backup snapshots", "status": { "active": "Up and running", "inactive": "Stopped", @@ -514,4 +536,4 @@ "reset_onboarding_description": "Reset onboarding switch to show onboarding screen again", "cubit_statuses": "Cubit loading statuses" } -} \ No newline at end of file +} diff --git a/lib/ui/pages/backup_details/backup_details.dart b/lib/ui/pages/backups/backup_details.dart similarity index 55% rename from lib/ui/pages/backup_details/backup_details.dart rename to lib/ui/pages/backups/backup_details.dart index 92491763..0e23e2fe 100644 --- a/lib/ui/pages/backup_details/backup_details.dart +++ b/lib/ui/pages/backups/backup_details.dart @@ -11,10 +11,14 @@ import 'package:selfprivacy/logic/models/json/server_job.dart'; import 'package:selfprivacy/logic/models/service.dart'; import 'package:selfprivacy/logic/models/state_types.dart'; import 'package:selfprivacy/ui/components/buttons/brand_button.dart'; -import 'package:selfprivacy/ui/components/cards/outlined_card.dart'; +import 'package:selfprivacy/ui/components/jobs_content/server_job_card.dart'; import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart'; import 'package:selfprivacy/ui/components/brand_icons/brand_icons.dart'; import 'package:selfprivacy/ui/helpers/modals.dart'; +import 'package:selfprivacy/ui/pages/backups/change_period_modal.dart'; +import 'package:selfprivacy/ui/pages/backups/create_backups_modal.dart'; +import 'package:selfprivacy/ui/router/router.dart'; +import 'package:selfprivacy/utils/extensions/duration.dart'; GlobalKey navigatorKey = GlobalKey(); @@ -43,13 +47,30 @@ class _BackupDetailsPageState extends State final bool refreshing = context.watch().state.refreshing; final List services = context.watch().state.servicesThatCanBeBackedUp; + final Duration? autobackupPeriod = + context.watch().state.autobackupPeriod; + final List backupJobs = context + .watch() + .state + .backupJobList + .where((final job) => job.status != JobStatusEnum.finished) + .toList(); - return BrandHeroScreen( - heroIcon: BrandIcons.save, - heroTitle: 'backup.card_title'.tr(), - heroSubtitle: 'backup.description'.tr(), - children: [ - if (isReady && !isBackupInitialized) + if (!isReady) { + return BrandHeroScreen( + heroIcon: BrandIcons.save, + heroTitle: 'backup.card_title'.tr(), + heroSubtitle: 'not_ready_card.in_menu'.tr(), + children: const [], + ); + } + + if (!isBackupInitialized) { + return BrandHeroScreen( + heroIcon: BrandIcons.save, + heroTitle: 'backup.card_title'.tr(), + heroSubtitle: 'backup.description'.tr(), + children: [ BrandButton.rised( onPressed: preventActions ? null @@ -58,11 +79,19 @@ class _BackupDetailsPageState extends State }, text: 'backup.initialize'.tr(), ), + ], + ); + } + + return BrandHeroScreen( + heroIcon: BrandIcons.save, + heroTitle: 'backup.card_title'.tr(), + heroSubtitle: 'backup.description'.tr(), + children: [ ListTile( onTap: preventActions ? null : () { - // await context.read().createBackup(); showModalBottomSheet( useRootNavigator: true, context: context, @@ -88,7 +117,66 @@ class _BackupDetailsPageState extends State 'backup.create_new'.tr(), ), ), + ListTile( + onTap: preventActions + ? null + : () { + // await context.read().createBackup(); + showModalBottomSheet( + useRootNavigator: true, + context: context, + isScrollControlled: true, + builder: (final BuildContext context) => + DraggableScrollableSheet( + expand: false, + maxChildSize: 0.9, + minChildSize: 0.4, + initialChildSize: 0.6, + builder: (final context, final scrollController) => + ChangeAutobackupsPeriodModal( + scrollController: scrollController, + ), + ), + ); + }, + leading: const Icon( + Icons.manage_history_outlined, + ), + title: Text( + 'backup.autobackup_period_title'.tr(), + ), + subtitle: Text( + autobackupPeriod != null + ? 'backup.autobackup_period_subtitle'.tr( + namedArgs: { + 'period': autobackupPeriod.toPrettyString(context.locale) + }, + ) + : 'backup.autobackup_period_never'.tr(), + ), + ), const SizedBox(height: 16), + if (backupJobs.isNotEmpty) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ListTile( + title: Text( + 'backup.pending_jobs'.tr(), + style: Theme.of(context).textTheme.headlineSmall!.copyWith( + color: Theme.of(context).colorScheme.secondary, + ), + ), + ), + for (final job in backupJobs) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: ServerJobCard( + serverJob: job, + ), + ), + ], + ), // Card with a list of existing backups // Each list item has a date // When clicked, starts the restore action @@ -98,13 +186,13 @@ class _BackupDetailsPageState extends State children: [ ListTile( title: Text( - 'backups.latest_snapshots'.tr(), + 'backup.latest_snapshots'.tr(), style: Theme.of(context).textTheme.headlineSmall!.copyWith( color: Theme.of(context).colorScheme.secondary, ), ), subtitle: Text( - 'backups.latest_snapshots_subtitle'.tr(), + 'backup.latest_snapshots_subtitle'.tr(), style: Theme.of(context).textTheme.labelMedium, ), ), @@ -117,7 +205,7 @@ class _BackupDetailsPageState extends State ), if (backups.isNotEmpty) Column( - children: backups.take(20).map( + children: backups.take(15).map( (final Backup backup) { final service = context .read() @@ -163,221 +251,71 @@ class _BackupDetailsPageState extends State }, ).toList(), ), - if (backups.isNotEmpty && backups.length > 20) + if (backups.isNotEmpty && backups.length > 15) ListTile( title: Text( - 'backups.show_more'.tr(), + 'backup.show_more'.tr(), style: Theme.of(context).textTheme.labelMedium, ), leading: const Icon( Icons.arrow_drop_down, ), - onTap: null, + onTap: () => + context.pushRoute(BackupsListRoute(service: null)), ) ], ), - const SizedBox(height: 16), - OutlinedCard( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + const SizedBox(height: 8), + const Divider(), + const SizedBox(height: 8), + ListTile( + title: Text( + 'backup.refresh'.tr(), + ), + onTap: refreshing + ? null + : () => {context.read().updateBackups()}, + enabled: !refreshing, + leading: const Icon( + Icons.refresh_outlined, + ), + ), + if (providerState != StateType.uninitialized) + Column( children: [ ListTile( title: Text( - 'backup.refresh'.tr(), + 'backup.refetch_backups'.tr(), ), - onTap: refreshing + subtitle: Text( + 'backup.refetch_backups_subtitle'.tr(), + ), + leading: const Icon( + Icons.cached_outlined, + ), + onTap: preventActions ? null - : () => {context.read().updateBackups()}, - enabled: !refreshing, + : () => {context.read().forceUpdateBackups()}, ), - if (providerState != StateType.uninitialized) - Column( - children: [ - const Divider( - height: 1.0, - ), - ListTile( - title: Text( - 'backup.refetch_backups'.tr(), - ), - onTap: preventActions - ? null - : () => { - context - .read() - .forceUpdateBackups() - }, - ), - const Divider( - height: 1.0, - ), - ListTile( - title: Text( - 'backup.reupload_key'.tr(), - ), - onTap: preventActions - ? null - : () => {context.read().reuploadKey()}, - ), - ], + const SizedBox(height: 8), + const Divider(), + const SizedBox(height: 8), + ListTile( + title: Text( + 'backup.reupload_key'.tr(), ), + subtitle: Text( + 'backup.reupload_key_subtitle'.tr(), + ), + leading: const Icon( + Icons.warning_amber_outlined, + ), + onTap: preventActions + ? null + : () => {context.read().reuploadKey()}, + ), ], ), - ), - ], - ); - } -} - -class CreateBackupsModal extends StatefulWidget { - const CreateBackupsModal({ - required this.services, - required this.scrollController, - super.key, - }); - - final List services; - final ScrollController scrollController; - - @override - State createState() => _CreateBackupsModalState(); -} - -class _CreateBackupsModalState extends State { - // Store in state the selected services to backup - List selectedServices = []; - - // Select all services on modal open - @override - void initState() { - super.initState(); - final List busyServices = context - .read() - .state - .backupJobList - .where( - (final ServerJob job) => - job.status == JobStatusEnum.running || - job.status == JobStatusEnum.created, - ) - .map((final ServerJob job) => job.typeId.split('.')[1]) - .toList(); - selectedServices.addAll( - widget.services - .where((final Service service) => !busyServices.contains(service.id)), - ); - } - - @override - Widget build(final BuildContext context) { - final List busyServices = context - .watch() - .state - .backupJobList - .where( - (final ServerJob job) => - job.status == JobStatusEnum.running || - job.status == JobStatusEnum.created, - ) - .map((final ServerJob job) => job.typeId.split('.')[1]) - .toList(); - - return ListView( - controller: widget.scrollController, - padding: const EdgeInsets.all(16), - children: [ - const SizedBox(height: 16), - Text( - 'backup.create_new_select_heading'.tr(), - style: Theme.of(context).textTheme.headlineSmall, - textAlign: TextAlign.center, - ), - const SizedBox(height: 16), - // Select all services tile - CheckboxListTile( - onChanged: (final bool? value) { - setState(() { - if (value ?? true) { - setState(() { - selectedServices.clear(); - selectedServices.addAll( - widget.services.where( - (final service) => !busyServices.contains(service.id), - ), - ); - }); - } else { - selectedServices.clear(); - } - }); - }, - title: Text( - 'backup.select_all'.tr(), - ), - secondary: const Icon( - Icons.checklist_outlined, - ), - value: selectedServices.length >= - widget.services.length - busyServices.length, - ), - const Divider( - height: 1.0, - ), - ...widget.services.map( - (final Service service) { - final bool busy = busyServices.contains(service.id); - return CheckboxListTile( - onChanged: !busy - ? (final bool? value) { - setState(() { - if (value ?? true) { - setState(() { - selectedServices.add(service); - }); - } else { - setState(() { - selectedServices.remove(service); - }); - } - }); - } - : null, - title: Text( - service.displayName, - ), - subtitle: Text( - busy ? 'backup.service_busy'.tr() : service.backupDescription, - ), - secondary: SvgPicture.string( - service.svgIcon, - height: 24, - width: 24, - colorFilter: ColorFilter.mode( - busy - ? Theme.of(context).colorScheme.outlineVariant - : Theme.of(context).colorScheme.onBackground, - BlendMode.srcIn, - ), - ), - value: selectedServices.contains(service), - ); - }, - ), - const SizedBox(height: 16), - // Create backup button - FilledButton( - onPressed: selectedServices.isEmpty - ? null - : () { - context - .read() - .createMultipleBackups(selectedServices); - Navigator.of(context).pop(); - }, - child: Text( - 'backup.start'.tr(), - ), - ), ], ); } diff --git a/lib/ui/pages/backups/backups_list.dart b/lib/ui/pages/backups/backups_list.dart new file mode 100644 index 00000000..5241693a --- /dev/null +++ b/lib/ui/pages/backups/backups_list.dart @@ -0,0 +1,85 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:selfprivacy/logic/cubit/backups/backups_cubit.dart'; +import 'package:selfprivacy/logic/cubit/services/services_cubit.dart'; +import 'package:selfprivacy/logic/models/backup.dart'; +import 'package:selfprivacy/logic/models/service.dart'; +import 'package:selfprivacy/ui/helpers/modals.dart'; +import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart'; + +@RoutePage() +class BackupsListPage extends StatelessWidget { + const BackupsListPage({ + required this.service, + super.key, + }); + + final Service? service; + + @override + Widget build(final BuildContext context) { + // If the service is null, get all backups from state. If not null, call the + // serviceBackups(serviceId) on the backups state. + final List backups = service == null + ? context.watch().state.backups + : context.watch().state.serviceBackups(service!.id); + final bool preventActions = + context.watch().state.preventActions; + return BrandHeroScreen( + heroTitle: 'backup.snapshots_title'.tr(), + children: [ + if (backups.isEmpty) + Center( + child: Text( + 'backup.no_backups'.tr(), + ), + ) + else + ...backups.map((final Backup backup) { + final service = context + .read() + .state + .getServiceById(backup.serviceId); + return ListTile( + onTap: preventActions + ? null + : () { + showPopUpAlert( + alertTitle: 'backup.restoring'.tr(), + description: 'backup.restore_alert'.tr( + args: [backup.time.toString()], + ), + actionButtonTitle: 'modals.yes'.tr(), + actionButtonOnPressed: () => { + context.read().restoreBackup(backup.id) + }, + ); + }, + title: Text( + '${MaterialLocalizations.of(context).formatShortDate(backup.time)} ${TimeOfDay.fromDateTime(backup.time).format(context)}', + ), + subtitle: Text( + service?.displayName ?? backup.fallbackServiceName, + ), + leading: service != null + ? SvgPicture.string( + service.svgIcon, + height: 24, + width: 24, + colorFilter: ColorFilter.mode( + Theme.of(context).colorScheme.onBackground, + BlendMode.srcIn, + ), + ) + : const Icon( + Icons.question_mark_outlined, + ), + ); + }) + ], + ); + } +} diff --git a/lib/ui/pages/backups/change_period_modal.dart b/lib/ui/pages/backups/change_period_modal.dart new file mode 100644 index 00000000..f3fb2ce3 --- /dev/null +++ b/lib/ui/pages/backups/change_period_modal.dart @@ -0,0 +1,108 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart'; +import 'package:selfprivacy/logic/cubit/backups/backups_cubit.dart'; +import 'package:selfprivacy/logic/cubit/server_jobs/server_jobs_cubit.dart'; +import 'package:selfprivacy/utils/extensions/duration.dart'; + +class ChangeAutobackupsPeriodModal extends StatefulWidget { + const ChangeAutobackupsPeriodModal({ + required this.scrollController, + super.key, + }); + + final ScrollController scrollController; + + @override + State createState() => + _ChangeAutobackupsPeriodModalState(); +} + +class _ChangeAutobackupsPeriodModalState + extends State { + // This is a modal with radio buttons to select the autobackup period + // Period might be none, selected from predefined list or custom + // Store in state the selected period + Duration? selectedPeriod; + + static const List autobackupPeriods = [ + Duration(hours: 12), + Duration(days: 1), + Duration(days: 2), + Duration(days: 3), + Duration(days: 7), + ]; + + // Set initial period to the one currently set + @override + void initState() { + super.initState(); + selectedPeriod = context.read().state.autobackupPeriod; + } + + @override + Widget build(final BuildContext context) { + final Duration? initialAutobackupPeriod = + context.watch().state.autobackupPeriod; + return ListView( + controller: widget.scrollController, + padding: const EdgeInsets.all(16), + children: [ + const SizedBox(height: 16), + Text( + 'backup.autobackup_period_title'.tr(), + style: Theme.of(context).textTheme.headlineSmall, + textAlign: TextAlign.center, + ), + const SizedBox(height: 16), + // Select all services tile + RadioListTile( + onChanged: (final Duration? value) { + setState(() { + selectedPeriod = value; + }); + }, + title: Text( + 'backup.autobackup_period_disable'.tr(), + ), + value: null, + groupValue: selectedPeriod, + ), + const Divider( + height: 1.0, + ), + ...autobackupPeriods.map( + (final Duration period) => RadioListTile( + onChanged: (final Duration? value) { + setState(() { + selectedPeriod = value; + }); + }, + title: Text( + 'backup.autobackup_period_every'.tr( + namedArgs: {'period': period.toPrettyString(context.locale)}, + ), + ), + value: period, + groupValue: selectedPeriod, + ), + ), + const SizedBox(height: 16), + // Create backup button + FilledButton( + onPressed: selectedPeriod == initialAutobackupPeriod + ? null + : () { + context + .read() + .setAutobackupPeriod(selectedPeriod); + Navigator.of(context).pop(); + }, + child: Text( + 'backup.autobackup_set_period'.tr(), + ), + ), + ], + ); + } +} diff --git a/lib/ui/pages/backups/create_backups_modal.dart b/lib/ui/pages/backups/create_backups_modal.dart new file mode 100644 index 00000000..3f461da1 --- /dev/null +++ b/lib/ui/pages/backups/create_backups_modal.dart @@ -0,0 +1,161 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:selfprivacy/logic/cubit/backups/backups_cubit.dart'; +import 'package:selfprivacy/logic/cubit/server_jobs/server_jobs_cubit.dart'; +import 'package:selfprivacy/logic/models/json/server_job.dart'; +import 'package:selfprivacy/logic/models/service.dart'; + +class CreateBackupsModal extends StatefulWidget { + const CreateBackupsModal({ + required this.services, + required this.scrollController, + super.key, + }); + + final List services; + final ScrollController scrollController; + + @override + State createState() => _CreateBackupsModalState(); +} + +class _CreateBackupsModalState extends State { + // Store in state the selected services to backup + List selectedServices = []; + + // Select all services on modal open + @override + void initState() { + super.initState(); + final List busyServices = context + .read() + .state + .backupJobList + .where( + (final ServerJob job) => + job.status == JobStatusEnum.running || + job.status == JobStatusEnum.created, + ) + .map((final ServerJob job) => job.typeId.split('.')[1]) + .toList(); + selectedServices.addAll( + widget.services + .where((final Service service) => !busyServices.contains(service.id)), + ); + } + + @override + Widget build(final BuildContext context) { + final List busyServices = context + .watch() + .state + .backupJobList + .where( + (final ServerJob job) => + job.status == JobStatusEnum.running || + job.status == JobStatusEnum.created, + ) + .map((final ServerJob job) => job.typeId.split('.')[1]) + .toList(); + + return ListView( + controller: widget.scrollController, + padding: const EdgeInsets.all(16), + children: [ + const SizedBox(height: 16), + Text( + 'backup.create_new_select_heading'.tr(), + style: Theme.of(context).textTheme.headlineSmall, + textAlign: TextAlign.center, + ), + const SizedBox(height: 16), + // Select all services tile + CheckboxListTile( + onChanged: (final bool? value) { + setState(() { + if (value ?? true) { + setState(() { + selectedServices.clear(); + selectedServices.addAll( + widget.services.where( + (final service) => !busyServices.contains(service.id), + ), + ); + }); + } else { + selectedServices.clear(); + } + }); + }, + title: Text( + 'backup.select_all'.tr(), + ), + secondary: const Icon( + Icons.checklist_outlined, + ), + value: selectedServices.length >= + widget.services.length - busyServices.length, + ), + const Divider( + height: 1.0, + ), + ...widget.services.map( + (final Service service) { + final bool busy = busyServices.contains(service.id); + return CheckboxListTile( + onChanged: !busy + ? (final bool? value) { + setState(() { + if (value ?? true) { + setState(() { + selectedServices.add(service); + }); + } else { + setState(() { + selectedServices.remove(service); + }); + } + }); + } + : null, + title: Text( + service.displayName, + ), + subtitle: Text( + busy ? 'backup.service_busy'.tr() : service.backupDescription, + ), + secondary: SvgPicture.string( + service.svgIcon, + height: 24, + width: 24, + colorFilter: ColorFilter.mode( + busy + ? Theme.of(context).colorScheme.outlineVariant + : Theme.of(context).colorScheme.onBackground, + BlendMode.srcIn, + ), + ), + value: selectedServices.contains(service), + ); + }, + ), + const SizedBox(height: 16), + // Create backup button + FilledButton( + onPressed: selectedServices.isEmpty + ? null + : () { + context + .read() + .createMultipleBackups(selectedServices); + Navigator.of(context).pop(); + }, + child: Text( + 'backup.start'.tr(), + ), + ), + ], + ); + } +} diff --git a/lib/ui/pages/server_details/time_zone/time_zone.dart b/lib/ui/pages/server_details/time_zone/time_zone.dart index 6863bfe8..5eb369bc 100644 --- a/lib/ui/pages/server_details/time_zone/time_zone.dart +++ b/lib/ui/pages/server_details/time_zone/time_zone.dart @@ -107,7 +107,7 @@ class _SelectTimezoneState extends State { Duration( milliseconds: location.currentTimeZone.offset, ) - .toDayHourMinuteFormat() + .toTimezoneOffsetFormat() .contains(timezoneFilterValue!), ) .toList() @@ -137,7 +137,7 @@ class _SelectTimezoneState extends State { location.name, ), subtitle: Text( - 'GMT ${duration.toDayHourMinuteFormat()} ${area.isNotEmpty ? '($area)' : ''}', + 'GMT ${duration.toTimezoneOffsetFormat()} ${area.isNotEmpty ? '($area)' : ''}', ), onTap: () { context.read().repository.setTimezone( diff --git a/lib/ui/pages/services/service_page.dart b/lib/ui/pages/services/service_page.dart index 0c7beafb..0b713e79 100644 --- a/lib/ui/pages/services/service_page.dart +++ b/lib/ui/pages/services/service_page.dart @@ -141,6 +141,19 @@ class _ServicePageState extends State { ), enabled: !serviceDisabled && !serviceLocked, ), + if (service.canBeBackedUp) + ListTile( + iconColor: Theme.of(context).colorScheme.onBackground, + // Open page ServicesMigrationPage + onTap: () => context.pushRoute( + BackupsListRoute(service: service), + ), + leading: const Icon(Icons.settings_backup_restore_outlined), + title: Text( + 'service_page.snapshots'.tr(), + style: Theme.of(context).textTheme.titleMedium, + ), + ), ], ); } diff --git a/lib/ui/router/router.dart b/lib/ui/router/router.dart index af0743ca..764aacd7 100644 --- a/lib/ui/router/router.dart +++ b/lib/ui/router/router.dart @@ -3,7 +3,8 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; import 'package:selfprivacy/logic/models/disk_status.dart'; import 'package:selfprivacy/logic/models/service.dart'; -import 'package:selfprivacy/ui/pages/backup_details/backup_details.dart'; +import 'package:selfprivacy/ui/pages/backups/backup_details.dart'; +import 'package:selfprivacy/ui/pages/backups/backups_list.dart'; import 'package:selfprivacy/ui/pages/devices/devices.dart'; import 'package:selfprivacy/ui/pages/dns_details/dns_details.dart'; import 'package:selfprivacy/ui/pages/more/about_application.dart'; @@ -96,6 +97,7 @@ class RootRouter extends _$RootRouter { AutoRoute(page: ServerDetailsRoute.page), AutoRoute(page: DnsDetailsRoute.page), AutoRoute(page: BackupDetailsRoute.page), + AutoRoute(page: BackupsListRoute.page), AutoRoute(page: ServerStorageRoute.page), AutoRoute(page: ExtendingVolumeRoute.page), ], @@ -141,6 +143,8 @@ String getRouteTitle(final String routeName) { return 'server.card_title'; case 'BackupDetailsRoute': return 'backup.card_title'; + case 'BackupsListRoute': + return 'backup.snapshots_title'; case 'ServerStorageRoute': return 'storage.card_title'; case 'ExtendingVolumeRoute': diff --git a/lib/ui/router/router.gr.dart b/lib/ui/router/router.gr.dart index 6fbfd79b..ef06ccf6 100644 --- a/lib/ui/router/router.gr.dart +++ b/lib/ui/router/router.gr.dart @@ -15,16 +15,103 @@ abstract class _$RootRouter extends RootStackRouter { @override final Map pagesMap = { - BackupDetailsRoute.name: (routeData) { + DevicesRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, - child: const BackupDetailsPage(), + child: const DevicesScreen(), ); }, - RootRoute.name: (routeData) { + DnsDetailsRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, - child: WrappedRoute(child: const RootPage()), + child: const DnsDetailsPage(), + ); + }, + AppSettingsRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const AppSettingsPage(), + ); + }, + DeveloperSettingsRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const DeveloperSettingsPage(), + ); + }, + AboutApplicationRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const AboutApplicationPage(), + ); + }, + MoreRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const MorePage(), + ); + }, + ConsoleRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const ConsolePage(), + ); + }, + OnboardingRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const OnboardingPage(), + ); + }, + ProvidersRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const ProvidersPage(), + ); + }, + RecoveryKeyRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const RecoveryKeyPage(), + ); + }, + ServerDetailsRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const ServerDetailsScreen(), + ); + }, + ServicesMigrationRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( + routeData: routeData, + child: ServicesMigrationPage( + services: args.services, + diskStatus: args.diskStatus, + isMigration: args.isMigration, + key: args.key, + ), + ); + }, + ServerStorageRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( + routeData: routeData, + child: ServerStoragePage( + diskStatus: args.diskStatus, + key: args.key, + ), + ); + }, + ExtendingVolumeRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( + routeData: routeData, + child: ExtendingVolumePage( + diskVolumeToResize: args.diskVolumeToResize, + diskStatus: args.diskStatus, + key: args.key, + ), ); }, ServiceRoute.name: (routeData) { @@ -43,10 +130,16 @@ abstract class _$RootRouter extends RootStackRouter { child: const ServicesPage(), ); }, - ServerDetailsRoute.name: (routeData) { + InitializingRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, - child: const ServerDetailsScreen(), + child: const InitializingPage(), + ); + }, + RecoveryRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const RecoveryRouting(), ); }, UsersRoute.name: (routeData) { @@ -71,274 +164,59 @@ abstract class _$RootRouter extends RootStackRouter { ), ); }, - AppSettingsRoute.name: (routeData) { + RootRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, - child: const AppSettingsPage(), + child: WrappedRoute(child: const RootPage()), ); }, - DeveloperSettingsRoute.name: (routeData) { + BackupDetailsRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, - child: const DeveloperSettingsPage(), + child: const BackupDetailsPage(), ); }, - MoreRoute.name: (routeData) { + BackupsListRoute.name: (routeData) { + final args = routeData.argsAs(); return AutoRoutePage( routeData: routeData, - child: const MorePage(), - ); - }, - AboutApplicationRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const AboutApplicationPage(), - ); - }, - ConsoleRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const ConsolePage(), - ); - }, - ProvidersRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const ProvidersPage(), - ); - }, - RecoveryKeyRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const RecoveryKeyPage(), - ); - }, - DnsDetailsRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const DnsDetailsPage(), - ); - }, - RecoveryRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const RecoveryRouting(), - ); - }, - InitializingRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const InitializingPage(), - ); - }, - ServerStorageRoute.name: (routeData) { - final args = routeData.argsAs(); - return AutoRoutePage( - routeData: routeData, - child: ServerStoragePage( - diskStatus: args.diskStatus, + child: BackupsListPage( + service: args.service, key: args.key, ), ); }, - ExtendingVolumeRoute.name: (routeData) { - final args = routeData.argsAs(); - return AutoRoutePage( - routeData: routeData, - child: ExtendingVolumePage( - diskVolumeToResize: args.diskVolumeToResize, - diskStatus: args.diskStatus, - key: args.key, - ), - ); - }, - ServicesMigrationRoute.name: (routeData) { - final args = routeData.argsAs(); - return AutoRoutePage( - routeData: routeData, - child: ServicesMigrationPage( - services: args.services, - diskStatus: args.diskStatus, - isMigration: args.isMigration, - key: args.key, - ), - ); - }, - DevicesRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const DevicesScreen(), - ); - }, - OnboardingRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const OnboardingPage(), - ); - }, }; } /// generated route for -/// [BackupDetailsPage] -class BackupDetailsRoute extends PageRouteInfo { - const BackupDetailsRoute({List? children}) +/// [DevicesScreen] +class DevicesRoute extends PageRouteInfo { + const DevicesRoute({List? children}) : super( - BackupDetailsRoute.name, + DevicesRoute.name, initialChildren: children, ); - static const String name = 'BackupDetailsRoute'; + static const String name = 'DevicesRoute'; static const PageInfo page = PageInfo(name); } /// generated route for -/// [RootPage] -class RootRoute extends PageRouteInfo { - const RootRoute({List? children}) +/// [DnsDetailsPage] +class DnsDetailsRoute extends PageRouteInfo { + const DnsDetailsRoute({List? children}) : super( - RootRoute.name, + DnsDetailsRoute.name, initialChildren: children, ); - static const String name = 'RootRoute'; + static const String name = 'DnsDetailsRoute'; static const PageInfo page = PageInfo(name); } -/// generated route for -/// [ServicePage] -class ServiceRoute extends PageRouteInfo { - ServiceRoute({ - required String serviceId, - Key? key, - List? children, - }) : super( - ServiceRoute.name, - args: ServiceRouteArgs( - serviceId: serviceId, - key: key, - ), - initialChildren: children, - ); - - static const String name = 'ServiceRoute'; - - static const PageInfo page = - PageInfo(name); -} - -class ServiceRouteArgs { - const ServiceRouteArgs({ - required this.serviceId, - this.key, - }); - - final String serviceId; - - final Key? key; - - @override - String toString() { - return 'ServiceRouteArgs{serviceId: $serviceId, key: $key}'; - } -} - -/// generated route for -/// [ServicesPage] -class ServicesRoute extends PageRouteInfo { - const ServicesRoute({List? children}) - : super( - ServicesRoute.name, - initialChildren: children, - ); - - static const String name = 'ServicesRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [ServerDetailsScreen] -class ServerDetailsRoute extends PageRouteInfo { - const ServerDetailsRoute({List? children}) - : super( - ServerDetailsRoute.name, - initialChildren: children, - ); - - static const String name = 'ServerDetailsRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [UsersPage] -class UsersRoute extends PageRouteInfo { - const UsersRoute({List? children}) - : super( - UsersRoute.name, - initialChildren: children, - ); - - static const String name = 'UsersRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [NewUserPage] -class NewUserRoute extends PageRouteInfo { - const NewUserRoute({List? children}) - : super( - NewUserRoute.name, - initialChildren: children, - ); - - static const String name = 'NewUserRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [UserDetailsPage] -class UserDetailsRoute extends PageRouteInfo { - UserDetailsRoute({ - required String login, - Key? key, - List? children, - }) : super( - UserDetailsRoute.name, - args: UserDetailsRouteArgs( - login: login, - key: key, - ), - initialChildren: children, - ); - - static const String name = 'UserDetailsRoute'; - - static const PageInfo page = - PageInfo(name); -} - -class UserDetailsRouteArgs { - const UserDetailsRouteArgs({ - required this.login, - this.key, - }); - - final String login; - - final Key? key; - - @override - String toString() { - return 'UserDetailsRouteArgs{login: $login, key: $key}'; - } -} - /// generated route for /// [AppSettingsPage] class AppSettingsRoute extends PageRouteInfo { @@ -367,20 +245,6 @@ class DeveloperSettingsRoute extends PageRouteInfo { static const PageInfo page = PageInfo(name); } -/// generated route for -/// [MorePage] -class MoreRoute extends PageRouteInfo { - const MoreRoute({List? children}) - : super( - MoreRoute.name, - initialChildren: children, - ); - - static const String name = 'MoreRoute'; - - static const PageInfo page = PageInfo(name); -} - /// generated route for /// [AboutApplicationPage] class AboutApplicationRoute extends PageRouteInfo { @@ -395,6 +259,20 @@ class AboutApplicationRoute extends PageRouteInfo { static const PageInfo page = PageInfo(name); } +/// generated route for +/// [MorePage] +class MoreRoute extends PageRouteInfo { + const MoreRoute({List? children}) + : super( + MoreRoute.name, + initialChildren: children, + ); + + static const String name = 'MoreRoute'; + + static const PageInfo page = PageInfo(name); +} + /// generated route for /// [ConsolePage] class ConsoleRoute extends PageRouteInfo { @@ -409,6 +287,20 @@ class ConsoleRoute extends PageRouteInfo { static const PageInfo page = PageInfo(name); } +/// generated route for +/// [OnboardingPage] +class OnboardingRoute extends PageRouteInfo { + const OnboardingRoute({List? children}) + : super( + OnboardingRoute.name, + initialChildren: children, + ); + + static const String name = 'OnboardingRoute'; + + static const PageInfo page = PageInfo(name); +} + /// generated route for /// [ProvidersPage] class ProvidersRoute extends PageRouteInfo { @@ -438,45 +330,65 @@ class RecoveryKeyRoute extends PageRouteInfo { } /// generated route for -/// [DnsDetailsPage] -class DnsDetailsRoute extends PageRouteInfo { - const DnsDetailsRoute({List? children}) +/// [ServerDetailsScreen] +class ServerDetailsRoute extends PageRouteInfo { + const ServerDetailsRoute({List? children}) : super( - DnsDetailsRoute.name, + ServerDetailsRoute.name, initialChildren: children, ); - static const String name = 'DnsDetailsRoute'; + static const String name = 'ServerDetailsRoute'; static const PageInfo page = PageInfo(name); } /// generated route for -/// [RecoveryRouting] -class RecoveryRoute extends PageRouteInfo { - const RecoveryRoute({List? children}) - : super( - RecoveryRoute.name, +/// [ServicesMigrationPage] +class ServicesMigrationRoute extends PageRouteInfo { + ServicesMigrationRoute({ + required List services, + required DiskStatus diskStatus, + required bool isMigration, + Key? key, + List? children, + }) : super( + ServicesMigrationRoute.name, + args: ServicesMigrationRouteArgs( + services: services, + diskStatus: diskStatus, + isMigration: isMigration, + key: key, + ), initialChildren: children, ); - static const String name = 'RecoveryRoute'; + static const String name = 'ServicesMigrationRoute'; - static const PageInfo page = PageInfo(name); + static const PageInfo page = + PageInfo(name); } -/// generated route for -/// [InitializingPage] -class InitializingRoute extends PageRouteInfo { - const InitializingRoute({List? children}) - : super( - InitializingRoute.name, - initialChildren: children, - ); +class ServicesMigrationRouteArgs { + const ServicesMigrationRouteArgs({ + required this.services, + required this.diskStatus, + required this.isMigration, + this.key, + }); - static const String name = 'InitializingRoute'; + final List services; - static const PageInfo page = PageInfo(name); + final DiskStatus diskStatus; + + final bool isMigration; + + final Key? key; + + @override + String toString() { + return 'ServicesMigrationRouteArgs{services: $services, diskStatus: $diskStatus, isMigration: $isMigration, key: $key}'; + } } /// generated route for @@ -561,77 +473,213 @@ class ExtendingVolumeRouteArgs { } /// generated route for -/// [ServicesMigrationPage] -class ServicesMigrationRoute extends PageRouteInfo { - ServicesMigrationRoute({ - required List services, - required DiskStatus diskStatus, - required bool isMigration, +/// [ServicePage] +class ServiceRoute extends PageRouteInfo { + ServiceRoute({ + required String serviceId, Key? key, List? children, }) : super( - ServicesMigrationRoute.name, - args: ServicesMigrationRouteArgs( - services: services, - diskStatus: diskStatus, - isMigration: isMigration, + ServiceRoute.name, + args: ServiceRouteArgs( + serviceId: serviceId, key: key, ), initialChildren: children, ); - static const String name = 'ServicesMigrationRoute'; + static const String name = 'ServiceRoute'; - static const PageInfo page = - PageInfo(name); + static const PageInfo page = + PageInfo(name); } -class ServicesMigrationRouteArgs { - const ServicesMigrationRouteArgs({ - required this.services, - required this.diskStatus, - required this.isMigration, +class ServiceRouteArgs { + const ServiceRouteArgs({ + required this.serviceId, this.key, }); - final List services; - - final DiskStatus diskStatus; - - final bool isMigration; + final String serviceId; final Key? key; @override String toString() { - return 'ServicesMigrationRouteArgs{services: $services, diskStatus: $diskStatus, isMigration: $isMigration, key: $key}'; + return 'ServiceRouteArgs{serviceId: $serviceId, key: $key}'; } } /// generated route for -/// [DevicesScreen] -class DevicesRoute extends PageRouteInfo { - const DevicesRoute({List? children}) +/// [ServicesPage] +class ServicesRoute extends PageRouteInfo { + const ServicesRoute({List? children}) : super( - DevicesRoute.name, + ServicesRoute.name, initialChildren: children, ); - static const String name = 'DevicesRoute'; + static const String name = 'ServicesRoute'; static const PageInfo page = PageInfo(name); } /// generated route for -/// [OnboardingPage] -class OnboardingRoute extends PageRouteInfo { - const OnboardingRoute({List? children}) +/// [InitializingPage] +class InitializingRoute extends PageRouteInfo { + const InitializingRoute({List? children}) : super( - OnboardingRoute.name, + InitializingRoute.name, initialChildren: children, ); - static const String name = 'OnboardingRoute'; + static const String name = 'InitializingRoute'; static const PageInfo page = PageInfo(name); } + +/// generated route for +/// [RecoveryRouting] +class RecoveryRoute extends PageRouteInfo { + const RecoveryRoute({List? children}) + : super( + RecoveryRoute.name, + initialChildren: children, + ); + + static const String name = 'RecoveryRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [UsersPage] +class UsersRoute extends PageRouteInfo { + const UsersRoute({List? children}) + : super( + UsersRoute.name, + initialChildren: children, + ); + + static const String name = 'UsersRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [NewUserPage] +class NewUserRoute extends PageRouteInfo { + const NewUserRoute({List? children}) + : super( + NewUserRoute.name, + initialChildren: children, + ); + + static const String name = 'NewUserRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [UserDetailsPage] +class UserDetailsRoute extends PageRouteInfo { + UserDetailsRoute({ + required String login, + Key? key, + List? children, + }) : super( + UserDetailsRoute.name, + args: UserDetailsRouteArgs( + login: login, + key: key, + ), + initialChildren: children, + ); + + static const String name = 'UserDetailsRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class UserDetailsRouteArgs { + const UserDetailsRouteArgs({ + required this.login, + this.key, + }); + + final String login; + + final Key? key; + + @override + String toString() { + return 'UserDetailsRouteArgs{login: $login, key: $key}'; + } +} + +/// generated route for +/// [RootPage] +class RootRoute extends PageRouteInfo { + const RootRoute({List? children}) + : super( + RootRoute.name, + initialChildren: children, + ); + + static const String name = 'RootRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [BackupDetailsPage] +class BackupDetailsRoute extends PageRouteInfo { + const BackupDetailsRoute({List? children}) + : super( + BackupDetailsRoute.name, + initialChildren: children, + ); + + static const String name = 'BackupDetailsRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [BackupsListPage] +class BackupsListRoute extends PageRouteInfo { + BackupsListRoute({ + required Service? service, + Key? key, + List? children, + }) : super( + BackupsListRoute.name, + args: BackupsListRouteArgs( + service: service, + key: key, + ), + initialChildren: children, + ); + + static const String name = 'BackupsListRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class BackupsListRouteArgs { + const BackupsListRouteArgs({ + required this.service, + this.key, + }); + + final Service? service; + + final Key? key; + + @override + String toString() { + return 'BackupsListRouteArgs{service: $service, key: $key}'; + } +} From 7d974159a238e1041e0a37c3d45cfb5c291f1713 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Mon, 3 Jul 2023 23:37:23 +0300 Subject: [PATCH 20/20] style(backups): Fix some UI issues of backup_details.dart --- lib/ui/pages/backups/backup_details.dart | 28 ++++++------------------ 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/lib/ui/pages/backups/backup_details.dart b/lib/ui/pages/backups/backup_details.dart index 0e23e2fe..e3fe427b 100644 --- a/lib/ui/pages/backups/backup_details.dart +++ b/lib/ui/pages/backups/backup_details.dart @@ -20,35 +20,25 @@ import 'package:selfprivacy/ui/pages/backups/create_backups_modal.dart'; import 'package:selfprivacy/ui/router/router.dart'; import 'package:selfprivacy/utils/extensions/duration.dart'; -GlobalKey navigatorKey = GlobalKey(); - @RoutePage() -class BackupDetailsPage extends StatefulWidget { +class BackupDetailsPage extends StatelessWidget { const BackupDetailsPage({super.key}); - @override - State createState() => _BackupDetailsPageState(); -} - -class _BackupDetailsPageState extends State - with SingleTickerProviderStateMixin { @override Widget build(final BuildContext context) { final bool isReady = context.watch().state is ServerInstallationFinished; - final bool isBackupInitialized = - context.watch().state.isInitialized; + final BackupsState backupsState = context.watch().state; + final bool isBackupInitialized = backupsState.isInitialized; final StateType providerState = isReady && isBackupInitialized ? StateType.stable : StateType.uninitialized; - final bool preventActions = - context.watch().state.preventActions; - final List backups = context.watch().state.backups; - final bool refreshing = context.watch().state.refreshing; + final bool preventActions = backupsState.preventActions; + final List backups = backupsState.backups; + final bool refreshing = backupsState.refreshing; final List services = context.watch().state.servicesThatCanBeBackedUp; - final Duration? autobackupPeriod = - context.watch().state.autobackupPeriod; + final Duration? autobackupPeriod = backupsState.autobackupPeriod; final List backupJobs = context .watch() .state @@ -121,7 +111,6 @@ class _BackupDetailsPageState extends State onTap: preventActions ? null : () { - // await context.read().createBackup(); showModalBottomSheet( useRootNavigator: true, context: context, @@ -177,9 +166,6 @@ class _BackupDetailsPageState extends State ), ], ), - // Card with a list of existing backups - // Each list item has a date - // When clicked, starts the restore action if (isBackupInitialized) Column( crossAxisAlignment: CrossAxisAlignment.start,