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(