diff --git a/lib/logic/api_maps/graphql_maps/api_map.dart b/lib/logic/api_maps/graphql_maps/api_map.dart index 90d6a349..c9240f00 100644 --- a/lib/logic/api_maps/graphql_maps/api_map.dart +++ b/lib/logic/api_maps/graphql_maps/api_map.dart @@ -1,4 +1,5 @@ import 'package:graphql_flutter/graphql_flutter.dart'; +import 'package:selfprivacy/config/get_it_config.dart'; abstract class ApiMap { Future getClient() async { @@ -8,7 +9,9 @@ abstract class ApiMap { final Link graphQLLink = isWithToken ? AuthLink( - getToken: () async => authToken, + getToken: () async => customToken == '' + ? getIt().serverDetails!.apiToken + : customToken, ).concat(httpLink) : httpLink; @@ -21,5 +24,5 @@ abstract class ApiMap { abstract final String? rootAddress; abstract final bool hasLogger; abstract final bool isWithToken; - abstract final String authToken; + abstract final String customToken; } diff --git a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql new file mode 100644 index 00000000..c85d05d9 --- /dev/null +++ b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql @@ -0,0 +1,38 @@ +query GetServerDiskVolumesQuery { + storage { + volumes { + freeSpace + model + name + root + serial + totalSpace + type + usedSpace + } + } +} + +mutation MountVolumeMutation($name: String!) { + mountVolume(name: $name) { + code + message + success + } +} + +mutation ResizeVolumeMutation($name: String!) { + resizeVolume(name: $name) { + code + message + success + } +} + +mutation UnmountVolumeMutation($name: String!) { + unmountVolume(name: $name) { + code + message + success + } +} \ No newline at end of file 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 new file mode 100644 index 00000000..527b7168 --- /dev/null +++ b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart @@ -0,0 +1,1915 @@ +import 'dart:async'; +import 'package:gql/ast.dart'; +import 'package:graphql/client.dart' as graphql; +import 'package:json_annotation/json_annotation.dart'; +part 'disk_volumes.graphql.g.dart'; + +@JsonSerializable(explicitToJson: true) +class Query$GetServerDiskVolumesQuery { + Query$GetServerDiskVolumesQuery( + {required this.storage, required this.$__typename}); + + @override + factory Query$GetServerDiskVolumesQuery.fromJson(Map json) => + _$Query$GetServerDiskVolumesQueryFromJson(json); + + final Query$GetServerDiskVolumesQuery$storage storage; + + @JsonKey(name: '__typename') + final String $__typename; + + Map toJson() => + _$Query$GetServerDiskVolumesQueryToJson(this); + int get hashCode { + final l$storage = storage; + final l$$__typename = $__typename; + return Object.hashAll([l$storage, l$$__typename]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) return true; + if (!(other is Query$GetServerDiskVolumesQuery) || + runtimeType != other.runtimeType) return false; + final l$storage = storage; + final lOther$storage = other.storage; + if (l$storage != lOther$storage) return false; + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) return false; + return true; + } +} + +extension UtilityExtension$Query$GetServerDiskVolumesQuery + on Query$GetServerDiskVolumesQuery { + CopyWith$Query$GetServerDiskVolumesQuery + get copyWith => CopyWith$Query$GetServerDiskVolumesQuery(this, (i) => i); +} + +abstract class CopyWith$Query$GetServerDiskVolumesQuery { + factory CopyWith$Query$GetServerDiskVolumesQuery( + Query$GetServerDiskVolumesQuery instance, + TRes Function(Query$GetServerDiskVolumesQuery) then) = + _CopyWithImpl$Query$GetServerDiskVolumesQuery; + + factory CopyWith$Query$GetServerDiskVolumesQuery.stub(TRes res) = + _CopyWithStubImpl$Query$GetServerDiskVolumesQuery; + + TRes call( + {Query$GetServerDiskVolumesQuery$storage? storage, String? $__typename}); + CopyWith$Query$GetServerDiskVolumesQuery$storage get storage; +} + +class _CopyWithImpl$Query$GetServerDiskVolumesQuery + implements CopyWith$Query$GetServerDiskVolumesQuery { + _CopyWithImpl$Query$GetServerDiskVolumesQuery(this._instance, this._then); + + final Query$GetServerDiskVolumesQuery _instance; + + final TRes Function(Query$GetServerDiskVolumesQuery) _then; + + static const _undefined = {}; + + TRes call({Object? storage = _undefined, Object? $__typename = _undefined}) => + _then(Query$GetServerDiskVolumesQuery( + storage: storage == _undefined || storage == null + ? _instance.storage + : (storage as Query$GetServerDiskVolumesQuery$storage), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String))); + CopyWith$Query$GetServerDiskVolumesQuery$storage get storage { + final local$storage = _instance.storage; + return CopyWith$Query$GetServerDiskVolumesQuery$storage( + local$storage, (e) => call(storage: e)); + } +} + +class _CopyWithStubImpl$Query$GetServerDiskVolumesQuery + implements CopyWith$Query$GetServerDiskVolumesQuery { + _CopyWithStubImpl$Query$GetServerDiskVolumesQuery(this._res); + + TRes _res; + + call( + {Query$GetServerDiskVolumesQuery$storage? storage, + String? $__typename}) => + _res; + CopyWith$Query$GetServerDiskVolumesQuery$storage get storage => + CopyWith$Query$GetServerDiskVolumesQuery$storage.stub(_res); +} + +const documentNodeQueryGetServerDiskVolumesQuery = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'GetServerDiskVolumesQuery'), + variableDefinitions: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'storage'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'volumes'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'freeSpace'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'model'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'root'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'serial'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'totalSpace'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'type'), + alias: null, + arguments: [], + directives: [], + selectionSet: null), + FieldNode( + name: NameNode(value: 'usedSpace'), + 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$GetServerDiskVolumesQuery _parserFn$Query$GetServerDiskVolumesQuery( + Map data) => + Query$GetServerDiskVolumesQuery.fromJson(data); + +class Options$Query$GetServerDiskVolumesQuery + extends graphql.QueryOptions { + Options$Query$GetServerDiskVolumesQuery( + {String? operationName, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Duration? pollInterval, + graphql.Context? context}) + : super( + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult, + pollInterval: pollInterval, + context: context, + document: documentNodeQueryGetServerDiskVolumesQuery, + parserFn: _parserFn$Query$GetServerDiskVolumesQuery); +} + +class WatchOptions$Query$GetServerDiskVolumesQuery + extends graphql.WatchQueryOptions { + WatchOptions$Query$GetServerDiskVolumesQuery( + {String? operationName, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + graphql.Context? context, + Duration? pollInterval, + bool? eagerlyFetchResults, + bool carryForwardDataOnException = true, + bool fetchResults = false}) + : super( + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult, + context: context, + document: documentNodeQueryGetServerDiskVolumesQuery, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Query$GetServerDiskVolumesQuery); +} + +class FetchMoreOptions$Query$GetServerDiskVolumesQuery + extends graphql.FetchMoreOptions { + FetchMoreOptions$Query$GetServerDiskVolumesQuery( + {required graphql.UpdateQuery updateQuery}) + : super( + updateQuery: updateQuery, + document: documentNodeQueryGetServerDiskVolumesQuery); +} + +extension ClientExtension$Query$GetServerDiskVolumesQuery + on graphql.GraphQLClient { + Future> + query$GetServerDiskVolumesQuery( + [Options$Query$GetServerDiskVolumesQuery? options]) async => + await this + .query(options ?? Options$Query$GetServerDiskVolumesQuery()); + graphql.ObservableQuery + watchQuery$GetServerDiskVolumesQuery( + [WatchOptions$Query$GetServerDiskVolumesQuery? options]) => + this.watchQuery( + options ?? WatchOptions$Query$GetServerDiskVolumesQuery()); + void writeQuery$GetServerDiskVolumesQuery( + {required Query$GetServerDiskVolumesQuery data, + bool broadcast = true}) => + this.writeQuery( + graphql.Request( + operation: graphql.Operation( + document: documentNodeQueryGetServerDiskVolumesQuery)), + data: data.toJson(), + broadcast: broadcast); + Query$GetServerDiskVolumesQuery? readQuery$GetServerDiskVolumesQuery( + {bool optimistic = true}) { + final result = this.readQuery( + graphql.Request( + operation: graphql.Operation( + document: documentNodeQueryGetServerDiskVolumesQuery)), + optimistic: optimistic); + return result == null + ? null + : Query$GetServerDiskVolumesQuery.fromJson(result); + } +} + +@JsonSerializable(explicitToJson: true) +class Query$GetServerDiskVolumesQuery$storage { + Query$GetServerDiskVolumesQuery$storage( + {required this.volumes, required this.$__typename}); + + @override + factory Query$GetServerDiskVolumesQuery$storage.fromJson( + Map json) => + _$Query$GetServerDiskVolumesQuery$storageFromJson(json); + + final List volumes; + + @JsonKey(name: '__typename') + final String $__typename; + + Map toJson() => + _$Query$GetServerDiskVolumesQuery$storageToJson(this); + int get hashCode { + final l$volumes = volumes; + final l$$__typename = $__typename; + return Object.hashAll( + [Object.hashAll(l$volumes.map((v) => v)), l$$__typename]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) return true; + if (!(other is Query$GetServerDiskVolumesQuery$storage) || + runtimeType != other.runtimeType) return false; + final l$volumes = volumes; + final lOther$volumes = other.volumes; + if (l$volumes.length != lOther$volumes.length) return false; + for (int i = 0; i < l$volumes.length; i++) { + final l$volumes$entry = l$volumes[i]; + final lOther$volumes$entry = lOther$volumes[i]; + if (l$volumes$entry != lOther$volumes$entry) return false; + } + + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) return false; + return true; + } +} + +extension UtilityExtension$Query$GetServerDiskVolumesQuery$storage + on Query$GetServerDiskVolumesQuery$storage { + CopyWith$Query$GetServerDiskVolumesQuery$storage< + Query$GetServerDiskVolumesQuery$storage> + get copyWith => + CopyWith$Query$GetServerDiskVolumesQuery$storage(this, (i) => i); +} + +abstract class CopyWith$Query$GetServerDiskVolumesQuery$storage { + factory CopyWith$Query$GetServerDiskVolumesQuery$storage( + Query$GetServerDiskVolumesQuery$storage instance, + TRes Function(Query$GetServerDiskVolumesQuery$storage) then) = + _CopyWithImpl$Query$GetServerDiskVolumesQuery$storage; + + factory CopyWith$Query$GetServerDiskVolumesQuery$storage.stub(TRes res) = + _CopyWithStubImpl$Query$GetServerDiskVolumesQuery$storage; + + TRes call( + {List? volumes, + String? $__typename}); + TRes volumes( + Iterable Function( + Iterable< + CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes< + Query$GetServerDiskVolumesQuery$storage$volumes>>) + _fn); +} + +class _CopyWithImpl$Query$GetServerDiskVolumesQuery$storage + implements CopyWith$Query$GetServerDiskVolumesQuery$storage { + _CopyWithImpl$Query$GetServerDiskVolumesQuery$storage( + this._instance, this._then); + + final Query$GetServerDiskVolumesQuery$storage _instance; + + final TRes Function(Query$GetServerDiskVolumesQuery$storage) _then; + + static const _undefined = {}; + + TRes call({Object? volumes = _undefined, Object? $__typename = _undefined}) => + _then(Query$GetServerDiskVolumesQuery$storage( + volumes: volumes == _undefined || volumes == null + ? _instance.volumes + : (volumes + as List), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String))); + TRes volumes( + Iterable Function( + Iterable< + CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes< + Query$GetServerDiskVolumesQuery$storage$volumes>>) + _fn) => + call( + volumes: _fn(_instance.volumes.map((e) => + CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes( + e, (i) => i))).toList()); +} + +class _CopyWithStubImpl$Query$GetServerDiskVolumesQuery$storage + implements CopyWith$Query$GetServerDiskVolumesQuery$storage { + _CopyWithStubImpl$Query$GetServerDiskVolumesQuery$storage(this._res); + + TRes _res; + + call( + {List? volumes, + String? $__typename}) => + _res; + volumes(_fn) => _res; +} + +@JsonSerializable(explicitToJson: true) +class Query$GetServerDiskVolumesQuery$storage$volumes { + Query$GetServerDiskVolumesQuery$storage$volumes( + {required this.freeSpace, + required this.model, + required this.name, + required this.root, + required this.serial, + required this.totalSpace, + required this.type, + required this.usedSpace, + required this.$__typename}); + + @override + factory Query$GetServerDiskVolumesQuery$storage$volumes.fromJson( + Map json) => + _$Query$GetServerDiskVolumesQuery$storage$volumesFromJson(json); + + final String freeSpace; + + final String model; + + final String name; + + final bool root; + + final String serial; + + final String totalSpace; + + final String type; + + final String usedSpace; + + @JsonKey(name: '__typename') + final String $__typename; + + Map toJson() => + _$Query$GetServerDiskVolumesQuery$storage$volumesToJson(this); + int get hashCode { + final l$freeSpace = freeSpace; + final l$model = model; + final l$name = name; + final l$root = root; + final l$serial = serial; + final l$totalSpace = totalSpace; + final l$type = type; + final l$usedSpace = usedSpace; + final l$$__typename = $__typename; + return Object.hashAll([ + l$freeSpace, + l$model, + l$name, + l$root, + l$serial, + l$totalSpace, + l$type, + l$usedSpace, + l$$__typename + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) return true; + if (!(other is Query$GetServerDiskVolumesQuery$storage$volumes) || + runtimeType != other.runtimeType) return false; + final l$freeSpace = freeSpace; + final lOther$freeSpace = other.freeSpace; + if (l$freeSpace != lOther$freeSpace) return false; + final l$model = model; + final lOther$model = other.model; + if (l$model != lOther$model) return false; + final l$name = name; + final lOther$name = other.name; + if (l$name != lOther$name) return false; + final l$root = root; + final lOther$root = other.root; + if (l$root != lOther$root) return false; + final l$serial = serial; + final lOther$serial = other.serial; + if (l$serial != lOther$serial) return false; + final l$totalSpace = totalSpace; + final lOther$totalSpace = other.totalSpace; + if (l$totalSpace != lOther$totalSpace) return false; + final l$type = type; + final lOther$type = other.type; + if (l$type != lOther$type) return false; + final l$usedSpace = usedSpace; + final lOther$usedSpace = other.usedSpace; + if (l$usedSpace != lOther$usedSpace) return false; + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) return false; + return true; + } +} + +extension UtilityExtension$Query$GetServerDiskVolumesQuery$storage$volumes + on Query$GetServerDiskVolumesQuery$storage$volumes { + CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes< + Query$GetServerDiskVolumesQuery$storage$volumes> + get copyWith => CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes( + this, (i) => i); +} + +abstract class CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes { + factory CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes( + Query$GetServerDiskVolumesQuery$storage$volumes instance, + TRes Function(Query$GetServerDiskVolumesQuery$storage$volumes) then) = + _CopyWithImpl$Query$GetServerDiskVolumesQuery$storage$volumes; + + factory CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes.stub( + TRes res) = + _CopyWithStubImpl$Query$GetServerDiskVolumesQuery$storage$volumes; + + TRes call( + {String? freeSpace, + String? model, + String? name, + bool? root, + String? serial, + String? totalSpace, + String? type, + String? usedSpace, + String? $__typename}); +} + +class _CopyWithImpl$Query$GetServerDiskVolumesQuery$storage$volumes + implements CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes { + _CopyWithImpl$Query$GetServerDiskVolumesQuery$storage$volumes( + this._instance, this._then); + + final Query$GetServerDiskVolumesQuery$storage$volumes _instance; + + final TRes Function(Query$GetServerDiskVolumesQuery$storage$volumes) _then; + + static const _undefined = {}; + + TRes call( + {Object? freeSpace = _undefined, + Object? model = _undefined, + Object? name = _undefined, + Object? root = _undefined, + Object? serial = _undefined, + Object? totalSpace = _undefined, + Object? type = _undefined, + Object? usedSpace = _undefined, + Object? $__typename = _undefined}) => + _then(Query$GetServerDiskVolumesQuery$storage$volumes( + freeSpace: freeSpace == _undefined || freeSpace == null + ? _instance.freeSpace + : (freeSpace as String), + model: model == _undefined || model == null + ? _instance.model + : (model as String), + name: name == _undefined || name == null + ? _instance.name + : (name as String), + root: root == _undefined || root == null + ? _instance.root + : (root as bool), + serial: serial == _undefined || serial == null + ? _instance.serial + : (serial as String), + totalSpace: totalSpace == _undefined || totalSpace == null + ? _instance.totalSpace + : (totalSpace as String), + type: type == _undefined || type == null + ? _instance.type + : (type as String), + usedSpace: usedSpace == _undefined || usedSpace == null + ? _instance.usedSpace + : (usedSpace as String), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String))); +} + +class _CopyWithStubImpl$Query$GetServerDiskVolumesQuery$storage$volumes + implements CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes { + _CopyWithStubImpl$Query$GetServerDiskVolumesQuery$storage$volumes(this._res); + + TRes _res; + + call( + {String? freeSpace, + String? model, + String? name, + bool? root, + String? serial, + String? totalSpace, + String? type, + String? usedSpace, + String? $__typename}) => + _res; +} + +@JsonSerializable(explicitToJson: true) +class Variables$Mutation$MountVolumeMutation { + Variables$Mutation$MountVolumeMutation({required this.name}); + + @override + factory Variables$Mutation$MountVolumeMutation.fromJson( + Map json) => + _$Variables$Mutation$MountVolumeMutationFromJson(json); + + final String name; + + Map toJson() => + _$Variables$Mutation$MountVolumeMutationToJson(this); + int get hashCode { + final l$name = name; + return Object.hashAll([l$name]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) return true; + if (!(other is Variables$Mutation$MountVolumeMutation) || + runtimeType != other.runtimeType) return false; + final l$name = name; + final lOther$name = other.name; + if (l$name != lOther$name) return false; + return true; + } + + CopyWith$Variables$Mutation$MountVolumeMutation< + Variables$Mutation$MountVolumeMutation> + get copyWith => + CopyWith$Variables$Mutation$MountVolumeMutation(this, (i) => i); +} + +abstract class CopyWith$Variables$Mutation$MountVolumeMutation { + factory CopyWith$Variables$Mutation$MountVolumeMutation( + Variables$Mutation$MountVolumeMutation instance, + TRes Function(Variables$Mutation$MountVolumeMutation) then) = + _CopyWithImpl$Variables$Mutation$MountVolumeMutation; + + factory CopyWith$Variables$Mutation$MountVolumeMutation.stub(TRes res) = + _CopyWithStubImpl$Variables$Mutation$MountVolumeMutation; + + TRes call({String? name}); +} + +class _CopyWithImpl$Variables$Mutation$MountVolumeMutation + implements CopyWith$Variables$Mutation$MountVolumeMutation { + _CopyWithImpl$Variables$Mutation$MountVolumeMutation( + this._instance, this._then); + + final Variables$Mutation$MountVolumeMutation _instance; + + final TRes Function(Variables$Mutation$MountVolumeMutation) _then; + + static const _undefined = {}; + + TRes call({Object? name = _undefined}) => + _then(Variables$Mutation$MountVolumeMutation( + name: name == _undefined || name == null + ? _instance.name + : (name as String))); +} + +class _CopyWithStubImpl$Variables$Mutation$MountVolumeMutation + implements CopyWith$Variables$Mutation$MountVolumeMutation { + _CopyWithStubImpl$Variables$Mutation$MountVolumeMutation(this._res); + + TRes _res; + + call({String? name}) => _res; +} + +@JsonSerializable(explicitToJson: true) +class Mutation$MountVolumeMutation { + Mutation$MountVolumeMutation( + {required this.mountVolume, required this.$__typename}); + + @override + factory Mutation$MountVolumeMutation.fromJson(Map json) => + _$Mutation$MountVolumeMutationFromJson(json); + + final Mutation$MountVolumeMutation$mountVolume mountVolume; + + @JsonKey(name: '__typename') + final String $__typename; + + Map toJson() => _$Mutation$MountVolumeMutationToJson(this); + int get hashCode { + final l$mountVolume = mountVolume; + final l$$__typename = $__typename; + return Object.hashAll([l$mountVolume, l$$__typename]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) return true; + if (!(other is Mutation$MountVolumeMutation) || + runtimeType != other.runtimeType) return false; + final l$mountVolume = mountVolume; + final lOther$mountVolume = other.mountVolume; + if (l$mountVolume != lOther$mountVolume) return false; + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) return false; + return true; + } +} + +extension UtilityExtension$Mutation$MountVolumeMutation + on Mutation$MountVolumeMutation { + CopyWith$Mutation$MountVolumeMutation + get copyWith => CopyWith$Mutation$MountVolumeMutation(this, (i) => i); +} + +abstract class CopyWith$Mutation$MountVolumeMutation { + factory CopyWith$Mutation$MountVolumeMutation( + Mutation$MountVolumeMutation instance, + TRes Function(Mutation$MountVolumeMutation) then) = + _CopyWithImpl$Mutation$MountVolumeMutation; + + factory CopyWith$Mutation$MountVolumeMutation.stub(TRes res) = + _CopyWithStubImpl$Mutation$MountVolumeMutation; + + TRes call( + {Mutation$MountVolumeMutation$mountVolume? mountVolume, + String? $__typename}); + CopyWith$Mutation$MountVolumeMutation$mountVolume get mountVolume; +} + +class _CopyWithImpl$Mutation$MountVolumeMutation + implements CopyWith$Mutation$MountVolumeMutation { + _CopyWithImpl$Mutation$MountVolumeMutation(this._instance, this._then); + + final Mutation$MountVolumeMutation _instance; + + final TRes Function(Mutation$MountVolumeMutation) _then; + + static const _undefined = {}; + + TRes call( + {Object? mountVolume = _undefined, + Object? $__typename = _undefined}) => + _then(Mutation$MountVolumeMutation( + mountVolume: mountVolume == _undefined || mountVolume == null + ? _instance.mountVolume + : (mountVolume as Mutation$MountVolumeMutation$mountVolume), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String))); + CopyWith$Mutation$MountVolumeMutation$mountVolume get mountVolume { + final local$mountVolume = _instance.mountVolume; + return CopyWith$Mutation$MountVolumeMutation$mountVolume( + local$mountVolume, (e) => call(mountVolume: e)); + } +} + +class _CopyWithStubImpl$Mutation$MountVolumeMutation + implements CopyWith$Mutation$MountVolumeMutation { + _CopyWithStubImpl$Mutation$MountVolumeMutation(this._res); + + TRes _res; + + call( + {Mutation$MountVolumeMutation$mountVolume? mountVolume, + String? $__typename}) => + _res; + CopyWith$Mutation$MountVolumeMutation$mountVolume get mountVolume => + CopyWith$Mutation$MountVolumeMutation$mountVolume.stub(_res); +} + +const documentNodeMutationMountVolumeMutation = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'MountVolumeMutation'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'name')), + type: + NamedTypeNode(name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'mountVolume'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'name'), + value: VariableNode(name: NameNode(value: 'name'))) + ], + 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) + ])), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), +]); +Mutation$MountVolumeMutation _parserFn$Mutation$MountVolumeMutation( + Map data) => + Mutation$MountVolumeMutation.fromJson(data); +typedef OnMutationCompleted$Mutation$MountVolumeMutation = FutureOr + Function(dynamic, Mutation$MountVolumeMutation?); + +class Options$Mutation$MountVolumeMutation + extends graphql.MutationOptions { + Options$Mutation$MountVolumeMutation( + {String? operationName, + required Variables$Mutation$MountVolumeMutation variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + graphql.Context? context, + OnMutationCompleted$Mutation$MountVolumeMutation? onCompleted, + graphql.OnMutationUpdate? update, + graphql.OnError? onError}) + : onCompletedWithParsed = onCompleted, + super( + variables: variables.toJson(), + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult, + context: context, + onCompleted: onCompleted == null + ? null + : (data) => onCompleted( + data, + data == null + ? null + : _parserFn$Mutation$MountVolumeMutation(data)), + update: update, + onError: onError, + document: documentNodeMutationMountVolumeMutation, + parserFn: _parserFn$Mutation$MountVolumeMutation); + + final OnMutationCompleted$Mutation$MountVolumeMutation? onCompletedWithParsed; + + @override + List get properties => [ + ...super.onCompleted == null + ? super.properties + : super.properties.where((property) => property != onCompleted), + onCompletedWithParsed + ]; +} + +class WatchOptions$Mutation$MountVolumeMutation + extends graphql.WatchQueryOptions { + WatchOptions$Mutation$MountVolumeMutation( + {String? operationName, + required Variables$Mutation$MountVolumeMutation variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + 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, + context: context, + document: documentNodeMutationMountVolumeMutation, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Mutation$MountVolumeMutation); +} + +extension ClientExtension$Mutation$MountVolumeMutation + on graphql.GraphQLClient { + Future> + mutate$MountVolumeMutation( + Options$Mutation$MountVolumeMutation options) async => + await this.mutate(options); + graphql.ObservableQuery + watchMutation$MountVolumeMutation( + WatchOptions$Mutation$MountVolumeMutation options) => + this.watchMutation(options); +} + +@JsonSerializable(explicitToJson: true) +class Mutation$MountVolumeMutation$mountVolume { + Mutation$MountVolumeMutation$mountVolume( + {required this.code, + required this.message, + required this.success, + required this.$__typename}); + + @override + factory Mutation$MountVolumeMutation$mountVolume.fromJson( + Map json) => + _$Mutation$MountVolumeMutation$mountVolumeFromJson(json); + + final int code; + + final String message; + + final bool success; + + @JsonKey(name: '__typename') + final String $__typename; + + Map toJson() => + _$Mutation$MountVolumeMutation$mountVolumeToJson(this); + 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$MountVolumeMutation$mountVolume) || + 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$MountVolumeMutation$mountVolume + on Mutation$MountVolumeMutation$mountVolume { + CopyWith$Mutation$MountVolumeMutation$mountVolume< + Mutation$MountVolumeMutation$mountVolume> + get copyWith => + CopyWith$Mutation$MountVolumeMutation$mountVolume(this, (i) => i); +} + +abstract class CopyWith$Mutation$MountVolumeMutation$mountVolume { + factory CopyWith$Mutation$MountVolumeMutation$mountVolume( + Mutation$MountVolumeMutation$mountVolume instance, + TRes Function(Mutation$MountVolumeMutation$mountVolume) then) = + _CopyWithImpl$Mutation$MountVolumeMutation$mountVolume; + + factory CopyWith$Mutation$MountVolumeMutation$mountVolume.stub(TRes res) = + _CopyWithStubImpl$Mutation$MountVolumeMutation$mountVolume; + + TRes call({int? code, String? message, bool? success, String? $__typename}); +} + +class _CopyWithImpl$Mutation$MountVolumeMutation$mountVolume + implements CopyWith$Mutation$MountVolumeMutation$mountVolume { + _CopyWithImpl$Mutation$MountVolumeMutation$mountVolume( + this._instance, this._then); + + final Mutation$MountVolumeMutation$mountVolume _instance; + + final TRes Function(Mutation$MountVolumeMutation$mountVolume) _then; + + static const _undefined = {}; + + TRes call( + {Object? code = _undefined, + Object? message = _undefined, + Object? success = _undefined, + Object? $__typename = _undefined}) => + _then(Mutation$MountVolumeMutation$mountVolume( + 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$MountVolumeMutation$mountVolume + implements CopyWith$Mutation$MountVolumeMutation$mountVolume { + _CopyWithStubImpl$Mutation$MountVolumeMutation$mountVolume(this._res); + + TRes _res; + + call({int? code, String? message, bool? success, String? $__typename}) => + _res; +} + +@JsonSerializable(explicitToJson: true) +class Variables$Mutation$ResizeVolumeMutation { + Variables$Mutation$ResizeVolumeMutation({required this.name}); + + @override + factory Variables$Mutation$ResizeVolumeMutation.fromJson( + Map json) => + _$Variables$Mutation$ResizeVolumeMutationFromJson(json); + + final String name; + + Map toJson() => + _$Variables$Mutation$ResizeVolumeMutationToJson(this); + int get hashCode { + final l$name = name; + return Object.hashAll([l$name]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) return true; + if (!(other is Variables$Mutation$ResizeVolumeMutation) || + runtimeType != other.runtimeType) return false; + final l$name = name; + final lOther$name = other.name; + if (l$name != lOther$name) return false; + return true; + } + + CopyWith$Variables$Mutation$ResizeVolumeMutation< + Variables$Mutation$ResizeVolumeMutation> + get copyWith => + CopyWith$Variables$Mutation$ResizeVolumeMutation(this, (i) => i); +} + +abstract class CopyWith$Variables$Mutation$ResizeVolumeMutation { + factory CopyWith$Variables$Mutation$ResizeVolumeMutation( + Variables$Mutation$ResizeVolumeMutation instance, + TRes Function(Variables$Mutation$ResizeVolumeMutation) then) = + _CopyWithImpl$Variables$Mutation$ResizeVolumeMutation; + + factory CopyWith$Variables$Mutation$ResizeVolumeMutation.stub(TRes res) = + _CopyWithStubImpl$Variables$Mutation$ResizeVolumeMutation; + + TRes call({String? name}); +} + +class _CopyWithImpl$Variables$Mutation$ResizeVolumeMutation + implements CopyWith$Variables$Mutation$ResizeVolumeMutation { + _CopyWithImpl$Variables$Mutation$ResizeVolumeMutation( + this._instance, this._then); + + final Variables$Mutation$ResizeVolumeMutation _instance; + + final TRes Function(Variables$Mutation$ResizeVolumeMutation) _then; + + static const _undefined = {}; + + TRes call({Object? name = _undefined}) => + _then(Variables$Mutation$ResizeVolumeMutation( + name: name == _undefined || name == null + ? _instance.name + : (name as String))); +} + +class _CopyWithStubImpl$Variables$Mutation$ResizeVolumeMutation + implements CopyWith$Variables$Mutation$ResizeVolumeMutation { + _CopyWithStubImpl$Variables$Mutation$ResizeVolumeMutation(this._res); + + TRes _res; + + call({String? name}) => _res; +} + +@JsonSerializable(explicitToJson: true) +class Mutation$ResizeVolumeMutation { + Mutation$ResizeVolumeMutation( + {required this.resizeVolume, required this.$__typename}); + + @override + factory Mutation$ResizeVolumeMutation.fromJson(Map json) => + _$Mutation$ResizeVolumeMutationFromJson(json); + + final Mutation$ResizeVolumeMutation$resizeVolume resizeVolume; + + @JsonKey(name: '__typename') + final String $__typename; + + Map toJson() => _$Mutation$ResizeVolumeMutationToJson(this); + int get hashCode { + final l$resizeVolume = resizeVolume; + final l$$__typename = $__typename; + return Object.hashAll([l$resizeVolume, l$$__typename]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) return true; + if (!(other is Mutation$ResizeVolumeMutation) || + runtimeType != other.runtimeType) return false; + final l$resizeVolume = resizeVolume; + final lOther$resizeVolume = other.resizeVolume; + if (l$resizeVolume != lOther$resizeVolume) return false; + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) return false; + return true; + } +} + +extension UtilityExtension$Mutation$ResizeVolumeMutation + on Mutation$ResizeVolumeMutation { + CopyWith$Mutation$ResizeVolumeMutation + get copyWith => CopyWith$Mutation$ResizeVolumeMutation(this, (i) => i); +} + +abstract class CopyWith$Mutation$ResizeVolumeMutation { + factory CopyWith$Mutation$ResizeVolumeMutation( + Mutation$ResizeVolumeMutation instance, + TRes Function(Mutation$ResizeVolumeMutation) then) = + _CopyWithImpl$Mutation$ResizeVolumeMutation; + + factory CopyWith$Mutation$ResizeVolumeMutation.stub(TRes res) = + _CopyWithStubImpl$Mutation$ResizeVolumeMutation; + + TRes call( + {Mutation$ResizeVolumeMutation$resizeVolume? resizeVolume, + String? $__typename}); + CopyWith$Mutation$ResizeVolumeMutation$resizeVolume get resizeVolume; +} + +class _CopyWithImpl$Mutation$ResizeVolumeMutation + implements CopyWith$Mutation$ResizeVolumeMutation { + _CopyWithImpl$Mutation$ResizeVolumeMutation(this._instance, this._then); + + final Mutation$ResizeVolumeMutation _instance; + + final TRes Function(Mutation$ResizeVolumeMutation) _then; + + static const _undefined = {}; + + TRes call( + {Object? resizeVolume = _undefined, + Object? $__typename = _undefined}) => + _then(Mutation$ResizeVolumeMutation( + resizeVolume: resizeVolume == _undefined || resizeVolume == null + ? _instance.resizeVolume + : (resizeVolume as Mutation$ResizeVolumeMutation$resizeVolume), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String))); + CopyWith$Mutation$ResizeVolumeMutation$resizeVolume get resizeVolume { + final local$resizeVolume = _instance.resizeVolume; + return CopyWith$Mutation$ResizeVolumeMutation$resizeVolume( + local$resizeVolume, (e) => call(resizeVolume: e)); + } +} + +class _CopyWithStubImpl$Mutation$ResizeVolumeMutation + implements CopyWith$Mutation$ResizeVolumeMutation { + _CopyWithStubImpl$Mutation$ResizeVolumeMutation(this._res); + + TRes _res; + + call( + {Mutation$ResizeVolumeMutation$resizeVolume? resizeVolume, + String? $__typename}) => + _res; + CopyWith$Mutation$ResizeVolumeMutation$resizeVolume get resizeVolume => + CopyWith$Mutation$ResizeVolumeMutation$resizeVolume.stub(_res); +} + +const documentNodeMutationResizeVolumeMutation = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'ResizeVolumeMutation'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'name')), + type: + NamedTypeNode(name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'resizeVolume'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'name'), + value: VariableNode(name: NameNode(value: 'name'))) + ], + 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) + ])), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), +]); +Mutation$ResizeVolumeMutation _parserFn$Mutation$ResizeVolumeMutation( + Map data) => + Mutation$ResizeVolumeMutation.fromJson(data); +typedef OnMutationCompleted$Mutation$ResizeVolumeMutation = FutureOr + Function(dynamic, Mutation$ResizeVolumeMutation?); + +class Options$Mutation$ResizeVolumeMutation + extends graphql.MutationOptions { + Options$Mutation$ResizeVolumeMutation( + {String? operationName, + required Variables$Mutation$ResizeVolumeMutation variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + graphql.Context? context, + OnMutationCompleted$Mutation$ResizeVolumeMutation? onCompleted, + graphql.OnMutationUpdate? update, + graphql.OnError? onError}) + : onCompletedWithParsed = onCompleted, + super( + variables: variables.toJson(), + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult, + context: context, + onCompleted: onCompleted == null + ? null + : (data) => onCompleted( + data, + data == null + ? null + : _parserFn$Mutation$ResizeVolumeMutation(data)), + update: update, + onError: onError, + document: documentNodeMutationResizeVolumeMutation, + parserFn: _parserFn$Mutation$ResizeVolumeMutation); + + final OnMutationCompleted$Mutation$ResizeVolumeMutation? + onCompletedWithParsed; + + @override + List get properties => [ + ...super.onCompleted == null + ? super.properties + : super.properties.where((property) => property != onCompleted), + onCompletedWithParsed + ]; +} + +class WatchOptions$Mutation$ResizeVolumeMutation + extends graphql.WatchQueryOptions { + WatchOptions$Mutation$ResizeVolumeMutation( + {String? operationName, + required Variables$Mutation$ResizeVolumeMutation variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + 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, + context: context, + document: documentNodeMutationResizeVolumeMutation, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Mutation$ResizeVolumeMutation); +} + +extension ClientExtension$Mutation$ResizeVolumeMutation + on graphql.GraphQLClient { + Future> + mutate$ResizeVolumeMutation( + Options$Mutation$ResizeVolumeMutation options) async => + await this.mutate(options); + graphql.ObservableQuery + watchMutation$ResizeVolumeMutation( + WatchOptions$Mutation$ResizeVolumeMutation options) => + this.watchMutation(options); +} + +@JsonSerializable(explicitToJson: true) +class Mutation$ResizeVolumeMutation$resizeVolume { + Mutation$ResizeVolumeMutation$resizeVolume( + {required this.code, + required this.message, + required this.success, + required this.$__typename}); + + @override + factory Mutation$ResizeVolumeMutation$resizeVolume.fromJson( + Map json) => + _$Mutation$ResizeVolumeMutation$resizeVolumeFromJson(json); + + final int code; + + final String message; + + final bool success; + + @JsonKey(name: '__typename') + final String $__typename; + + Map toJson() => + _$Mutation$ResizeVolumeMutation$resizeVolumeToJson(this); + 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$ResizeVolumeMutation$resizeVolume) || + 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$ResizeVolumeMutation$resizeVolume + on Mutation$ResizeVolumeMutation$resizeVolume { + CopyWith$Mutation$ResizeVolumeMutation$resizeVolume< + Mutation$ResizeVolumeMutation$resizeVolume> + get copyWith => + CopyWith$Mutation$ResizeVolumeMutation$resizeVolume(this, (i) => i); +} + +abstract class CopyWith$Mutation$ResizeVolumeMutation$resizeVolume { + factory CopyWith$Mutation$ResizeVolumeMutation$resizeVolume( + Mutation$ResizeVolumeMutation$resizeVolume instance, + TRes Function(Mutation$ResizeVolumeMutation$resizeVolume) then) = + _CopyWithImpl$Mutation$ResizeVolumeMutation$resizeVolume; + + factory CopyWith$Mutation$ResizeVolumeMutation$resizeVolume.stub(TRes res) = + _CopyWithStubImpl$Mutation$ResizeVolumeMutation$resizeVolume; + + TRes call({int? code, String? message, bool? success, String? $__typename}); +} + +class _CopyWithImpl$Mutation$ResizeVolumeMutation$resizeVolume + implements CopyWith$Mutation$ResizeVolumeMutation$resizeVolume { + _CopyWithImpl$Mutation$ResizeVolumeMutation$resizeVolume( + this._instance, this._then); + + final Mutation$ResizeVolumeMutation$resizeVolume _instance; + + final TRes Function(Mutation$ResizeVolumeMutation$resizeVolume) _then; + + static const _undefined = {}; + + TRes call( + {Object? code = _undefined, + Object? message = _undefined, + Object? success = _undefined, + Object? $__typename = _undefined}) => + _then(Mutation$ResizeVolumeMutation$resizeVolume( + 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$ResizeVolumeMutation$resizeVolume + implements CopyWith$Mutation$ResizeVolumeMutation$resizeVolume { + _CopyWithStubImpl$Mutation$ResizeVolumeMutation$resizeVolume(this._res); + + TRes _res; + + call({int? code, String? message, bool? success, String? $__typename}) => + _res; +} + +@JsonSerializable(explicitToJson: true) +class Variables$Mutation$UnmountVolumeMutation { + Variables$Mutation$UnmountVolumeMutation({required this.name}); + + @override + factory Variables$Mutation$UnmountVolumeMutation.fromJson( + Map json) => + _$Variables$Mutation$UnmountVolumeMutationFromJson(json); + + final String name; + + Map toJson() => + _$Variables$Mutation$UnmountVolumeMutationToJson(this); + int get hashCode { + final l$name = name; + return Object.hashAll([l$name]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) return true; + if (!(other is Variables$Mutation$UnmountVolumeMutation) || + runtimeType != other.runtimeType) return false; + final l$name = name; + final lOther$name = other.name; + if (l$name != lOther$name) return false; + return true; + } + + CopyWith$Variables$Mutation$UnmountVolumeMutation< + Variables$Mutation$UnmountVolumeMutation> + get copyWith => + CopyWith$Variables$Mutation$UnmountVolumeMutation(this, (i) => i); +} + +abstract class CopyWith$Variables$Mutation$UnmountVolumeMutation { + factory CopyWith$Variables$Mutation$UnmountVolumeMutation( + Variables$Mutation$UnmountVolumeMutation instance, + TRes Function(Variables$Mutation$UnmountVolumeMutation) then) = + _CopyWithImpl$Variables$Mutation$UnmountVolumeMutation; + + factory CopyWith$Variables$Mutation$UnmountVolumeMutation.stub(TRes res) = + _CopyWithStubImpl$Variables$Mutation$UnmountVolumeMutation; + + TRes call({String? name}); +} + +class _CopyWithImpl$Variables$Mutation$UnmountVolumeMutation + implements CopyWith$Variables$Mutation$UnmountVolumeMutation { + _CopyWithImpl$Variables$Mutation$UnmountVolumeMutation( + this._instance, this._then); + + final Variables$Mutation$UnmountVolumeMutation _instance; + + final TRes Function(Variables$Mutation$UnmountVolumeMutation) _then; + + static const _undefined = {}; + + TRes call({Object? name = _undefined}) => + _then(Variables$Mutation$UnmountVolumeMutation( + name: name == _undefined || name == null + ? _instance.name + : (name as String))); +} + +class _CopyWithStubImpl$Variables$Mutation$UnmountVolumeMutation + implements CopyWith$Variables$Mutation$UnmountVolumeMutation { + _CopyWithStubImpl$Variables$Mutation$UnmountVolumeMutation(this._res); + + TRes _res; + + call({String? name}) => _res; +} + +@JsonSerializable(explicitToJson: true) +class Mutation$UnmountVolumeMutation { + Mutation$UnmountVolumeMutation( + {required this.unmountVolume, required this.$__typename}); + + @override + factory Mutation$UnmountVolumeMutation.fromJson(Map json) => + _$Mutation$UnmountVolumeMutationFromJson(json); + + final Mutation$UnmountVolumeMutation$unmountVolume unmountVolume; + + @JsonKey(name: '__typename') + final String $__typename; + + Map toJson() => _$Mutation$UnmountVolumeMutationToJson(this); + int get hashCode { + final l$unmountVolume = unmountVolume; + final l$$__typename = $__typename; + return Object.hashAll([l$unmountVolume, l$$__typename]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) return true; + if (!(other is Mutation$UnmountVolumeMutation) || + runtimeType != other.runtimeType) return false; + final l$unmountVolume = unmountVolume; + final lOther$unmountVolume = other.unmountVolume; + if (l$unmountVolume != lOther$unmountVolume) return false; + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) return false; + return true; + } +} + +extension UtilityExtension$Mutation$UnmountVolumeMutation + on Mutation$UnmountVolumeMutation { + CopyWith$Mutation$UnmountVolumeMutation + get copyWith => CopyWith$Mutation$UnmountVolumeMutation(this, (i) => i); +} + +abstract class CopyWith$Mutation$UnmountVolumeMutation { + factory CopyWith$Mutation$UnmountVolumeMutation( + Mutation$UnmountVolumeMutation instance, + TRes Function(Mutation$UnmountVolumeMutation) then) = + _CopyWithImpl$Mutation$UnmountVolumeMutation; + + factory CopyWith$Mutation$UnmountVolumeMutation.stub(TRes res) = + _CopyWithStubImpl$Mutation$UnmountVolumeMutation; + + TRes call( + {Mutation$UnmountVolumeMutation$unmountVolume? unmountVolume, + String? $__typename}); + CopyWith$Mutation$UnmountVolumeMutation$unmountVolume get unmountVolume; +} + +class _CopyWithImpl$Mutation$UnmountVolumeMutation + implements CopyWith$Mutation$UnmountVolumeMutation { + _CopyWithImpl$Mutation$UnmountVolumeMutation(this._instance, this._then); + + final Mutation$UnmountVolumeMutation _instance; + + final TRes Function(Mutation$UnmountVolumeMutation) _then; + + static const _undefined = {}; + + TRes call( + {Object? unmountVolume = _undefined, + Object? $__typename = _undefined}) => + _then(Mutation$UnmountVolumeMutation( + unmountVolume: unmountVolume == _undefined || unmountVolume == null + ? _instance.unmountVolume + : (unmountVolume as Mutation$UnmountVolumeMutation$unmountVolume), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String))); + CopyWith$Mutation$UnmountVolumeMutation$unmountVolume + get unmountVolume { + final local$unmountVolume = _instance.unmountVolume; + return CopyWith$Mutation$UnmountVolumeMutation$unmountVolume( + local$unmountVolume, (e) => call(unmountVolume: e)); + } +} + +class _CopyWithStubImpl$Mutation$UnmountVolumeMutation + implements CopyWith$Mutation$UnmountVolumeMutation { + _CopyWithStubImpl$Mutation$UnmountVolumeMutation(this._res); + + TRes _res; + + call( + {Mutation$UnmountVolumeMutation$unmountVolume? unmountVolume, + String? $__typename}) => + _res; + CopyWith$Mutation$UnmountVolumeMutation$unmountVolume + get unmountVolume => + CopyWith$Mutation$UnmountVolumeMutation$unmountVolume.stub(_res); +} + +const documentNodeMutationUnmountVolumeMutation = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'UnmountVolumeMutation'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'name')), + type: + NamedTypeNode(name: NameNode(value: 'String'), isNonNull: true), + defaultValue: DefaultValueNode(value: null), + directives: []) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'unmountVolume'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'name'), + value: VariableNode(name: NameNode(value: 'name'))) + ], + 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) + ])), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null) + ])), +]); +Mutation$UnmountVolumeMutation _parserFn$Mutation$UnmountVolumeMutation( + Map data) => + Mutation$UnmountVolumeMutation.fromJson(data); +typedef OnMutationCompleted$Mutation$UnmountVolumeMutation = FutureOr + Function(dynamic, Mutation$UnmountVolumeMutation?); + +class Options$Mutation$UnmountVolumeMutation + extends graphql.MutationOptions { + Options$Mutation$UnmountVolumeMutation( + {String? operationName, + required Variables$Mutation$UnmountVolumeMutation variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + graphql.Context? context, + OnMutationCompleted$Mutation$UnmountVolumeMutation? onCompleted, + graphql.OnMutationUpdate? update, + graphql.OnError? onError}) + : onCompletedWithParsed = onCompleted, + super( + variables: variables.toJson(), + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult, + context: context, + onCompleted: onCompleted == null + ? null + : (data) => onCompleted( + data, + data == null + ? null + : _parserFn$Mutation$UnmountVolumeMutation(data)), + update: update, + onError: onError, + document: documentNodeMutationUnmountVolumeMutation, + parserFn: _parserFn$Mutation$UnmountVolumeMutation); + + final OnMutationCompleted$Mutation$UnmountVolumeMutation? + onCompletedWithParsed; + + @override + List get properties => [ + ...super.onCompleted == null + ? super.properties + : super.properties.where((property) => property != onCompleted), + onCompletedWithParsed + ]; +} + +class WatchOptions$Mutation$UnmountVolumeMutation + extends graphql.WatchQueryOptions { + WatchOptions$Mutation$UnmountVolumeMutation( + {String? operationName, + required Variables$Mutation$UnmountVolumeMutation variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + 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, + context: context, + document: documentNodeMutationUnmountVolumeMutation, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Mutation$UnmountVolumeMutation); +} + +extension ClientExtension$Mutation$UnmountVolumeMutation + on graphql.GraphQLClient { + Future> + mutate$UnmountVolumeMutation( + Options$Mutation$UnmountVolumeMutation options) async => + await this.mutate(options); + graphql.ObservableQuery + watchMutation$UnmountVolumeMutation( + WatchOptions$Mutation$UnmountVolumeMutation options) => + this.watchMutation(options); +} + +@JsonSerializable(explicitToJson: true) +class Mutation$UnmountVolumeMutation$unmountVolume { + Mutation$UnmountVolumeMutation$unmountVolume( + {required this.code, + required this.message, + required this.success, + required this.$__typename}); + + @override + factory Mutation$UnmountVolumeMutation$unmountVolume.fromJson( + Map json) => + _$Mutation$UnmountVolumeMutation$unmountVolumeFromJson(json); + + final int code; + + final String message; + + final bool success; + + @JsonKey(name: '__typename') + final String $__typename; + + Map toJson() => + _$Mutation$UnmountVolumeMutation$unmountVolumeToJson(this); + 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$UnmountVolumeMutation$unmountVolume) || + 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$UnmountVolumeMutation$unmountVolume + on Mutation$UnmountVolumeMutation$unmountVolume { + CopyWith$Mutation$UnmountVolumeMutation$unmountVolume< + Mutation$UnmountVolumeMutation$unmountVolume> + get copyWith => + CopyWith$Mutation$UnmountVolumeMutation$unmountVolume(this, (i) => i); +} + +abstract class CopyWith$Mutation$UnmountVolumeMutation$unmountVolume { + factory CopyWith$Mutation$UnmountVolumeMutation$unmountVolume( + Mutation$UnmountVolumeMutation$unmountVolume instance, + TRes Function(Mutation$UnmountVolumeMutation$unmountVolume) then) = + _CopyWithImpl$Mutation$UnmountVolumeMutation$unmountVolume; + + factory CopyWith$Mutation$UnmountVolumeMutation$unmountVolume.stub(TRes res) = + _CopyWithStubImpl$Mutation$UnmountVolumeMutation$unmountVolume; + + TRes call({int? code, String? message, bool? success, String? $__typename}); +} + +class _CopyWithImpl$Mutation$UnmountVolumeMutation$unmountVolume + implements CopyWith$Mutation$UnmountVolumeMutation$unmountVolume { + _CopyWithImpl$Mutation$UnmountVolumeMutation$unmountVolume( + this._instance, this._then); + + final Mutation$UnmountVolumeMutation$unmountVolume _instance; + + final TRes Function(Mutation$UnmountVolumeMutation$unmountVolume) _then; + + static const _undefined = {}; + + TRes call( + {Object? code = _undefined, + Object? message = _undefined, + Object? success = _undefined, + Object? $__typename = _undefined}) => + _then(Mutation$UnmountVolumeMutation$unmountVolume( + 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$UnmountVolumeMutation$unmountVolume + implements CopyWith$Mutation$UnmountVolumeMutation$unmountVolume { + _CopyWithStubImpl$Mutation$UnmountVolumeMutation$unmountVolume(this._res); + + TRes _res; + + call({int? code, String? message, bool? success, String? $__typename}) => + _res; +} diff --git a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.g.dart b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.g.dart new file mode 100644 index 00000000..49a749fe --- /dev/null +++ b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.g.dart @@ -0,0 +1,211 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'disk_volumes.graphql.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Query$GetServerDiskVolumesQuery _$Query$GetServerDiskVolumesQueryFromJson( + Map json) => + Query$GetServerDiskVolumesQuery( + storage: Query$GetServerDiskVolumesQuery$storage.fromJson( + json['storage'] as Map), + $__typename: json['__typename'] as String, + ); + +Map _$Query$GetServerDiskVolumesQueryToJson( + Query$GetServerDiskVolumesQuery instance) => + { + 'storage': instance.storage.toJson(), + '__typename': instance.$__typename, + }; + +Query$GetServerDiskVolumesQuery$storage + _$Query$GetServerDiskVolumesQuery$storageFromJson( + Map json) => + Query$GetServerDiskVolumesQuery$storage( + volumes: (json['volumes'] as List) + .map((e) => + Query$GetServerDiskVolumesQuery$storage$volumes.fromJson( + e as Map)) + .toList(), + $__typename: json['__typename'] as String, + ); + +Map _$Query$GetServerDiskVolumesQuery$storageToJson( + Query$GetServerDiskVolumesQuery$storage instance) => + { + 'volumes': instance.volumes.map((e) => e.toJson()).toList(), + '__typename': instance.$__typename, + }; + +Query$GetServerDiskVolumesQuery$storage$volumes + _$Query$GetServerDiskVolumesQuery$storage$volumesFromJson( + Map json) => + Query$GetServerDiskVolumesQuery$storage$volumes( + freeSpace: json['freeSpace'] as String, + model: json['model'] as String, + name: json['name'] as String, + root: json['root'] as bool, + serial: json['serial'] as String, + totalSpace: json['totalSpace'] as String, + type: json['type'] as String, + usedSpace: json['usedSpace'] as String, + $__typename: json['__typename'] as String, + ); + +Map _$Query$GetServerDiskVolumesQuery$storage$volumesToJson( + Query$GetServerDiskVolumesQuery$storage$volumes instance) => + { + 'freeSpace': instance.freeSpace, + 'model': instance.model, + 'name': instance.name, + 'root': instance.root, + 'serial': instance.serial, + 'totalSpace': instance.totalSpace, + 'type': instance.type, + 'usedSpace': instance.usedSpace, + '__typename': instance.$__typename, + }; + +Variables$Mutation$MountVolumeMutation + _$Variables$Mutation$MountVolumeMutationFromJson( + Map json) => + Variables$Mutation$MountVolumeMutation( + name: json['name'] as String, + ); + +Map _$Variables$Mutation$MountVolumeMutationToJson( + Variables$Mutation$MountVolumeMutation instance) => + { + 'name': instance.name, + }; + +Mutation$MountVolumeMutation _$Mutation$MountVolumeMutationFromJson( + Map json) => + Mutation$MountVolumeMutation( + mountVolume: Mutation$MountVolumeMutation$mountVolume.fromJson( + json['mountVolume'] as Map), + $__typename: json['__typename'] as String, + ); + +Map _$Mutation$MountVolumeMutationToJson( + Mutation$MountVolumeMutation instance) => + { + 'mountVolume': instance.mountVolume.toJson(), + '__typename': instance.$__typename, + }; + +Mutation$MountVolumeMutation$mountVolume + _$Mutation$MountVolumeMutation$mountVolumeFromJson( + Map json) => + Mutation$MountVolumeMutation$mountVolume( + code: json['code'] as int, + message: json['message'] as String, + success: json['success'] as bool, + $__typename: json['__typename'] as String, + ); + +Map _$Mutation$MountVolumeMutation$mountVolumeToJson( + Mutation$MountVolumeMutation$mountVolume instance) => + { + 'code': instance.code, + 'message': instance.message, + 'success': instance.success, + '__typename': instance.$__typename, + }; + +Variables$Mutation$ResizeVolumeMutation + _$Variables$Mutation$ResizeVolumeMutationFromJson( + Map json) => + Variables$Mutation$ResizeVolumeMutation( + name: json['name'] as String, + ); + +Map _$Variables$Mutation$ResizeVolumeMutationToJson( + Variables$Mutation$ResizeVolumeMutation instance) => + { + 'name': instance.name, + }; + +Mutation$ResizeVolumeMutation _$Mutation$ResizeVolumeMutationFromJson( + Map json) => + Mutation$ResizeVolumeMutation( + resizeVolume: Mutation$ResizeVolumeMutation$resizeVolume.fromJson( + json['resizeVolume'] as Map), + $__typename: json['__typename'] as String, + ); + +Map _$Mutation$ResizeVolumeMutationToJson( + Mutation$ResizeVolumeMutation instance) => + { + 'resizeVolume': instance.resizeVolume.toJson(), + '__typename': instance.$__typename, + }; + +Mutation$ResizeVolumeMutation$resizeVolume + _$Mutation$ResizeVolumeMutation$resizeVolumeFromJson( + Map json) => + Mutation$ResizeVolumeMutation$resizeVolume( + code: json['code'] as int, + message: json['message'] as String, + success: json['success'] as bool, + $__typename: json['__typename'] as String, + ); + +Map _$Mutation$ResizeVolumeMutation$resizeVolumeToJson( + Mutation$ResizeVolumeMutation$resizeVolume instance) => + { + 'code': instance.code, + 'message': instance.message, + 'success': instance.success, + '__typename': instance.$__typename, + }; + +Variables$Mutation$UnmountVolumeMutation + _$Variables$Mutation$UnmountVolumeMutationFromJson( + Map json) => + Variables$Mutation$UnmountVolumeMutation( + name: json['name'] as String, + ); + +Map _$Variables$Mutation$UnmountVolumeMutationToJson( + Variables$Mutation$UnmountVolumeMutation instance) => + { + 'name': instance.name, + }; + +Mutation$UnmountVolumeMutation _$Mutation$UnmountVolumeMutationFromJson( + Map json) => + Mutation$UnmountVolumeMutation( + unmountVolume: Mutation$UnmountVolumeMutation$unmountVolume.fromJson( + json['unmountVolume'] as Map), + $__typename: json['__typename'] as String, + ); + +Map _$Mutation$UnmountVolumeMutationToJson( + Mutation$UnmountVolumeMutation instance) => + { + 'unmountVolume': instance.unmountVolume.toJson(), + '__typename': instance.$__typename, + }; + +Mutation$UnmountVolumeMutation$unmountVolume + _$Mutation$UnmountVolumeMutation$unmountVolumeFromJson( + Map json) => + Mutation$UnmountVolumeMutation$unmountVolume( + code: json['code'] as int, + message: json['message'] as String, + success: json['success'] as bool, + $__typename: json['__typename'] as String, + ); + +Map _$Mutation$UnmountVolumeMutation$unmountVolumeToJson( + Mutation$UnmountVolumeMutation$unmountVolume instance) => + { + 'code': instance.code, + 'message': instance.message, + 'success': instance.success, + '__typename': instance.$__typename, + }; diff --git a/lib/logic/api_maps/graphql_maps/schema/get_api_version.graphql b/lib/logic/api_maps/graphql_maps/schema/get_api_version.graphql deleted file mode 100644 index cbfeb870..00000000 --- a/lib/logic/api_maps/graphql_maps/schema/get_api_version.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query GetApiVersionQuery { - api { - version - } -} \ No newline at end of file diff --git a/lib/logic/api_maps/graphql_maps/schema/get_api_version.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/get_api_version.graphql.dart deleted file mode 100644 index 8d255fe6..00000000 --- a/lib/logic/api_maps/graphql_maps/schema/get_api_version.graphql.dart +++ /dev/null @@ -1,301 +0,0 @@ -import 'package:gql/ast.dart'; -import 'package:graphql/client.dart' as graphql; -import 'package:json_annotation/json_annotation.dart'; -part 'get_api_version.graphql.g.dart'; - -@JsonSerializable(explicitToJson: true) -class Query$GetApiVersionQuery { - Query$GetApiVersionQuery({required this.api, required this.$__typename}); - - @override - factory Query$GetApiVersionQuery.fromJson(Map json) => - _$Query$GetApiVersionQueryFromJson(json); - - final Query$GetApiVersionQuery$api api; - - @JsonKey(name: '__typename') - final String $__typename; - - Map toJson() => _$Query$GetApiVersionQueryToJson(this); - int get hashCode { - final l$api = api; - final l$$__typename = $__typename; - return Object.hashAll([l$api, l$$__typename]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) return true; - if (!(other is Query$GetApiVersionQuery) || - runtimeType != other.runtimeType) return false; - final l$api = api; - final lOther$api = other.api; - if (l$api != lOther$api) return false; - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) return false; - return true; - } -} - -extension UtilityExtension$Query$GetApiVersionQuery - on Query$GetApiVersionQuery { - CopyWith$Query$GetApiVersionQuery get copyWith => - CopyWith$Query$GetApiVersionQuery(this, (i) => i); -} - -abstract class CopyWith$Query$GetApiVersionQuery { - factory CopyWith$Query$GetApiVersionQuery(Query$GetApiVersionQuery instance, - TRes Function(Query$GetApiVersionQuery) then) = - _CopyWithImpl$Query$GetApiVersionQuery; - - factory CopyWith$Query$GetApiVersionQuery.stub(TRes res) = - _CopyWithStubImpl$Query$GetApiVersionQuery; - - TRes call({Query$GetApiVersionQuery$api? api, String? $__typename}); - CopyWith$Query$GetApiVersionQuery$api get api; -} - -class _CopyWithImpl$Query$GetApiVersionQuery - implements CopyWith$Query$GetApiVersionQuery { - _CopyWithImpl$Query$GetApiVersionQuery(this._instance, this._then); - - final Query$GetApiVersionQuery _instance; - - final TRes Function(Query$GetApiVersionQuery) _then; - - static const _undefined = {}; - - TRes call({Object? api = _undefined, Object? $__typename = _undefined}) => - _then(Query$GetApiVersionQuery( - api: api == _undefined || api == null - ? _instance.api - : (api as Query$GetApiVersionQuery$api), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String))); - CopyWith$Query$GetApiVersionQuery$api get api { - final local$api = _instance.api; - return CopyWith$Query$GetApiVersionQuery$api( - local$api, (e) => call(api: e)); - } -} - -class _CopyWithStubImpl$Query$GetApiVersionQuery - implements CopyWith$Query$GetApiVersionQuery { - _CopyWithStubImpl$Query$GetApiVersionQuery(this._res); - - TRes _res; - - call({Query$GetApiVersionQuery$api? api, String? $__typename}) => _res; - CopyWith$Query$GetApiVersionQuery$api get api => - CopyWith$Query$GetApiVersionQuery$api.stub(_res); -} - -const documentNodeQueryGetApiVersionQuery = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'GetApiVersionQuery'), - variableDefinitions: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'api'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'version'), - 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$GetApiVersionQuery _parserFn$Query$GetApiVersionQuery( - Map data) => - Query$GetApiVersionQuery.fromJson(data); - -class Options$Query$GetApiVersionQuery - extends graphql.QueryOptions { - Options$Query$GetApiVersionQuery( - {String? operationName, - graphql.FetchPolicy? fetchPolicy, - graphql.ErrorPolicy? errorPolicy, - graphql.CacheRereadPolicy? cacheRereadPolicy, - Object? optimisticResult, - Duration? pollInterval, - graphql.Context? context}) - : super( - operationName: operationName, - fetchPolicy: fetchPolicy, - errorPolicy: errorPolicy, - cacheRereadPolicy: cacheRereadPolicy, - optimisticResult: optimisticResult, - pollInterval: pollInterval, - context: context, - document: documentNodeQueryGetApiVersionQuery, - parserFn: _parserFn$Query$GetApiVersionQuery); -} - -class WatchOptions$Query$GetApiVersionQuery - extends graphql.WatchQueryOptions { - WatchOptions$Query$GetApiVersionQuery( - {String? operationName, - graphql.FetchPolicy? fetchPolicy, - graphql.ErrorPolicy? errorPolicy, - graphql.CacheRereadPolicy? cacheRereadPolicy, - Object? optimisticResult, - graphql.Context? context, - Duration? pollInterval, - bool? eagerlyFetchResults, - bool carryForwardDataOnException = true, - bool fetchResults = false}) - : super( - operationName: operationName, - fetchPolicy: fetchPolicy, - errorPolicy: errorPolicy, - cacheRereadPolicy: cacheRereadPolicy, - optimisticResult: optimisticResult, - context: context, - document: documentNodeQueryGetApiVersionQuery, - pollInterval: pollInterval, - eagerlyFetchResults: eagerlyFetchResults, - carryForwardDataOnException: carryForwardDataOnException, - fetchResults: fetchResults, - parserFn: _parserFn$Query$GetApiVersionQuery); -} - -class FetchMoreOptions$Query$GetApiVersionQuery - extends graphql.FetchMoreOptions { - FetchMoreOptions$Query$GetApiVersionQuery( - {required graphql.UpdateQuery updateQuery}) - : super( - updateQuery: updateQuery, - document: documentNodeQueryGetApiVersionQuery); -} - -extension ClientExtension$Query$GetApiVersionQuery on graphql.GraphQLClient { - Future> - query$GetApiVersionQuery( - [Options$Query$GetApiVersionQuery? options]) async => - await this.query(options ?? Options$Query$GetApiVersionQuery()); - graphql.ObservableQuery - watchQuery$GetApiVersionQuery( - [WatchOptions$Query$GetApiVersionQuery? options]) => - this.watchQuery(options ?? WatchOptions$Query$GetApiVersionQuery()); - void writeQuery$GetApiVersionQuery( - {required Query$GetApiVersionQuery data, bool broadcast = true}) => - this.writeQuery( - graphql.Request( - operation: graphql.Operation( - document: documentNodeQueryGetApiVersionQuery)), - data: data.toJson(), - broadcast: broadcast); - Query$GetApiVersionQuery? readQuery$GetApiVersionQuery( - {bool optimistic = true}) { - final result = this.readQuery( - graphql.Request( - operation: graphql.Operation( - document: documentNodeQueryGetApiVersionQuery)), - optimistic: optimistic); - return result == null ? null : Query$GetApiVersionQuery.fromJson(result); - } -} - -@JsonSerializable(explicitToJson: true) -class Query$GetApiVersionQuery$api { - Query$GetApiVersionQuery$api( - {required this.version, required this.$__typename}); - - @override - factory Query$GetApiVersionQuery$api.fromJson(Map json) => - _$Query$GetApiVersionQuery$apiFromJson(json); - - final String version; - - @JsonKey(name: '__typename') - final String $__typename; - - Map toJson() => _$Query$GetApiVersionQuery$apiToJson(this); - int get hashCode { - final l$version = version; - final l$$__typename = $__typename; - return Object.hashAll([l$version, l$$__typename]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) return true; - if (!(other is Query$GetApiVersionQuery$api) || - runtimeType != other.runtimeType) return false; - final l$version = version; - final lOther$version = other.version; - if (l$version != lOther$version) return false; - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) return false; - return true; - } -} - -extension UtilityExtension$Query$GetApiVersionQuery$api - on Query$GetApiVersionQuery$api { - CopyWith$Query$GetApiVersionQuery$api - get copyWith => CopyWith$Query$GetApiVersionQuery$api(this, (i) => i); -} - -abstract class CopyWith$Query$GetApiVersionQuery$api { - factory CopyWith$Query$GetApiVersionQuery$api( - Query$GetApiVersionQuery$api instance, - TRes Function(Query$GetApiVersionQuery$api) then) = - _CopyWithImpl$Query$GetApiVersionQuery$api; - - factory CopyWith$Query$GetApiVersionQuery$api.stub(TRes res) = - _CopyWithStubImpl$Query$GetApiVersionQuery$api; - - TRes call({String? version, String? $__typename}); -} - -class _CopyWithImpl$Query$GetApiVersionQuery$api - implements CopyWith$Query$GetApiVersionQuery$api { - _CopyWithImpl$Query$GetApiVersionQuery$api(this._instance, this._then); - - final Query$GetApiVersionQuery$api _instance; - - final TRes Function(Query$GetApiVersionQuery$api) _then; - - static const _undefined = {}; - - TRes call({Object? version = _undefined, Object? $__typename = _undefined}) => - _then(Query$GetApiVersionQuery$api( - version: version == _undefined || version == null - ? _instance.version - : (version as String), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String))); -} - -class _CopyWithStubImpl$Query$GetApiVersionQuery$api - implements CopyWith$Query$GetApiVersionQuery$api { - _CopyWithStubImpl$Query$GetApiVersionQuery$api(this._res); - - TRes _res; - - call({String? version, String? $__typename}) => _res; -} diff --git a/lib/logic/api_maps/graphql_maps/schema/get_api_version.graphql.g.dart b/lib/logic/api_maps/graphql_maps/schema/get_api_version.graphql.g.dart deleted file mode 100644 index 0c051786..00000000 --- a/lib/logic/api_maps/graphql_maps/schema/get_api_version.graphql.g.dart +++ /dev/null @@ -1,36 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'get_api_version.graphql.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -Query$GetApiVersionQuery _$Query$GetApiVersionQueryFromJson( - Map json) => - Query$GetApiVersionQuery( - api: Query$GetApiVersionQuery$api.fromJson( - json['api'] as Map), - $__typename: json['__typename'] as String, - ); - -Map _$Query$GetApiVersionQueryToJson( - Query$GetApiVersionQuery instance) => - { - 'api': instance.api.toJson(), - '__typename': instance.$__typename, - }; - -Query$GetApiVersionQuery$api _$Query$GetApiVersionQuery$apiFromJson( - Map json) => - Query$GetApiVersionQuery$api( - version: json['version'] as String, - $__typename: json['__typename'] as String, - ); - -Map _$Query$GetApiVersionQuery$apiToJson( - Query$GetApiVersionQuery$api instance) => - { - 'version': instance.version, - '__typename': instance.$__typename, - }; diff --git a/lib/logic/api_maps/graphql_maps/schema/get_server_disk_volumes.graphql b/lib/logic/api_maps/graphql_maps/schema/get_server_disk_volumes.graphql deleted file mode 100644 index 2a566271..00000000 --- a/lib/logic/api_maps/graphql_maps/schema/get_server_disk_volumes.graphql +++ /dev/null @@ -1,11 +0,0 @@ -query GetServerDiskVolumesQuery { - storage { - volumes { - freeSpace - name - root - totalSpace - usedSpace - } - } -} \ No newline at end of file diff --git a/lib/logic/api_maps/graphql_maps/schema/get_server_disk_volumes.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/get_server_disk_volumes.graphql.dart deleted file mode 100644 index 007adc55..00000000 --- a/lib/logic/api_maps/graphql_maps/schema/get_server_disk_volumes.graphql.dart +++ /dev/null @@ -1,542 +0,0 @@ -import 'package:gql/ast.dart'; -import 'package:graphql/client.dart' as graphql; -import 'package:json_annotation/json_annotation.dart'; -part 'get_server_disk_volumes.graphql.g.dart'; - -@JsonSerializable(explicitToJson: true) -class Query$GetServerDiskVolumesQuery { - Query$GetServerDiskVolumesQuery( - {required this.storage, required this.$__typename}); - - @override - factory Query$GetServerDiskVolumesQuery.fromJson(Map json) => - _$Query$GetServerDiskVolumesQueryFromJson(json); - - final Query$GetServerDiskVolumesQuery$storage storage; - - @JsonKey(name: '__typename') - final String $__typename; - - Map toJson() => - _$Query$GetServerDiskVolumesQueryToJson(this); - int get hashCode { - final l$storage = storage; - final l$$__typename = $__typename; - return Object.hashAll([l$storage, l$$__typename]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) return true; - if (!(other is Query$GetServerDiskVolumesQuery) || - runtimeType != other.runtimeType) return false; - final l$storage = storage; - final lOther$storage = other.storage; - if (l$storage != lOther$storage) return false; - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) return false; - return true; - } -} - -extension UtilityExtension$Query$GetServerDiskVolumesQuery - on Query$GetServerDiskVolumesQuery { - CopyWith$Query$GetServerDiskVolumesQuery - get copyWith => CopyWith$Query$GetServerDiskVolumesQuery(this, (i) => i); -} - -abstract class CopyWith$Query$GetServerDiskVolumesQuery { - factory CopyWith$Query$GetServerDiskVolumesQuery( - Query$GetServerDiskVolumesQuery instance, - TRes Function(Query$GetServerDiskVolumesQuery) then) = - _CopyWithImpl$Query$GetServerDiskVolumesQuery; - - factory CopyWith$Query$GetServerDiskVolumesQuery.stub(TRes res) = - _CopyWithStubImpl$Query$GetServerDiskVolumesQuery; - - TRes call( - {Query$GetServerDiskVolumesQuery$storage? storage, String? $__typename}); - CopyWith$Query$GetServerDiskVolumesQuery$storage get storage; -} - -class _CopyWithImpl$Query$GetServerDiskVolumesQuery - implements CopyWith$Query$GetServerDiskVolumesQuery { - _CopyWithImpl$Query$GetServerDiskVolumesQuery(this._instance, this._then); - - final Query$GetServerDiskVolumesQuery _instance; - - final TRes Function(Query$GetServerDiskVolumesQuery) _then; - - static const _undefined = {}; - - TRes call({Object? storage = _undefined, Object? $__typename = _undefined}) => - _then(Query$GetServerDiskVolumesQuery( - storage: storage == _undefined || storage == null - ? _instance.storage - : (storage as Query$GetServerDiskVolumesQuery$storage), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String))); - CopyWith$Query$GetServerDiskVolumesQuery$storage get storage { - final local$storage = _instance.storage; - return CopyWith$Query$GetServerDiskVolumesQuery$storage( - local$storage, (e) => call(storage: e)); - } -} - -class _CopyWithStubImpl$Query$GetServerDiskVolumesQuery - implements CopyWith$Query$GetServerDiskVolumesQuery { - _CopyWithStubImpl$Query$GetServerDiskVolumesQuery(this._res); - - TRes _res; - - call( - {Query$GetServerDiskVolumesQuery$storage? storage, - String? $__typename}) => - _res; - CopyWith$Query$GetServerDiskVolumesQuery$storage get storage => - CopyWith$Query$GetServerDiskVolumesQuery$storage.stub(_res); -} - -const documentNodeQueryGetServerDiskVolumesQuery = DocumentNode(definitions: [ - OperationDefinitionNode( - type: OperationType.query, - name: NameNode(value: 'GetServerDiskVolumesQuery'), - variableDefinitions: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'storage'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'volumes'), - alias: null, - arguments: [], - directives: [], - selectionSet: SelectionSetNode(selections: [ - FieldNode( - name: NameNode(value: 'freeSpace'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'root'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'totalSpace'), - alias: null, - arguments: [], - directives: [], - selectionSet: null), - FieldNode( - name: NameNode(value: 'usedSpace'), - 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$GetServerDiskVolumesQuery _parserFn$Query$GetServerDiskVolumesQuery( - Map data) => - Query$GetServerDiskVolumesQuery.fromJson(data); - -class Options$Query$GetServerDiskVolumesQuery - extends graphql.QueryOptions { - Options$Query$GetServerDiskVolumesQuery( - {String? operationName, - graphql.FetchPolicy? fetchPolicy, - graphql.ErrorPolicy? errorPolicy, - graphql.CacheRereadPolicy? cacheRereadPolicy, - Object? optimisticResult, - Duration? pollInterval, - graphql.Context? context}) - : super( - operationName: operationName, - fetchPolicy: fetchPolicy, - errorPolicy: errorPolicy, - cacheRereadPolicy: cacheRereadPolicy, - optimisticResult: optimisticResult, - pollInterval: pollInterval, - context: context, - document: documentNodeQueryGetServerDiskVolumesQuery, - parserFn: _parserFn$Query$GetServerDiskVolumesQuery); -} - -class WatchOptions$Query$GetServerDiskVolumesQuery - extends graphql.WatchQueryOptions { - WatchOptions$Query$GetServerDiskVolumesQuery( - {String? operationName, - graphql.FetchPolicy? fetchPolicy, - graphql.ErrorPolicy? errorPolicy, - graphql.CacheRereadPolicy? cacheRereadPolicy, - Object? optimisticResult, - graphql.Context? context, - Duration? pollInterval, - bool? eagerlyFetchResults, - bool carryForwardDataOnException = true, - bool fetchResults = false}) - : super( - operationName: operationName, - fetchPolicy: fetchPolicy, - errorPolicy: errorPolicy, - cacheRereadPolicy: cacheRereadPolicy, - optimisticResult: optimisticResult, - context: context, - document: documentNodeQueryGetServerDiskVolumesQuery, - pollInterval: pollInterval, - eagerlyFetchResults: eagerlyFetchResults, - carryForwardDataOnException: carryForwardDataOnException, - fetchResults: fetchResults, - parserFn: _parserFn$Query$GetServerDiskVolumesQuery); -} - -class FetchMoreOptions$Query$GetServerDiskVolumesQuery - extends graphql.FetchMoreOptions { - FetchMoreOptions$Query$GetServerDiskVolumesQuery( - {required graphql.UpdateQuery updateQuery}) - : super( - updateQuery: updateQuery, - document: documentNodeQueryGetServerDiskVolumesQuery); -} - -extension ClientExtension$Query$GetServerDiskVolumesQuery - on graphql.GraphQLClient { - Future> - query$GetServerDiskVolumesQuery( - [Options$Query$GetServerDiskVolumesQuery? options]) async => - await this - .query(options ?? Options$Query$GetServerDiskVolumesQuery()); - graphql.ObservableQuery - watchQuery$GetServerDiskVolumesQuery( - [WatchOptions$Query$GetServerDiskVolumesQuery? options]) => - this.watchQuery( - options ?? WatchOptions$Query$GetServerDiskVolumesQuery()); - void writeQuery$GetServerDiskVolumesQuery( - {required Query$GetServerDiskVolumesQuery data, - bool broadcast = true}) => - this.writeQuery( - graphql.Request( - operation: graphql.Operation( - document: documentNodeQueryGetServerDiskVolumesQuery)), - data: data.toJson(), - broadcast: broadcast); - Query$GetServerDiskVolumesQuery? readQuery$GetServerDiskVolumesQuery( - {bool optimistic = true}) { - final result = this.readQuery( - graphql.Request( - operation: graphql.Operation( - document: documentNodeQueryGetServerDiskVolumesQuery)), - optimistic: optimistic); - return result == null - ? null - : Query$GetServerDiskVolumesQuery.fromJson(result); - } -} - -@JsonSerializable(explicitToJson: true) -class Query$GetServerDiskVolumesQuery$storage { - Query$GetServerDiskVolumesQuery$storage( - {required this.volumes, required this.$__typename}); - - @override - factory Query$GetServerDiskVolumesQuery$storage.fromJson( - Map json) => - _$Query$GetServerDiskVolumesQuery$storageFromJson(json); - - final List volumes; - - @JsonKey(name: '__typename') - final String $__typename; - - Map toJson() => - _$Query$GetServerDiskVolumesQuery$storageToJson(this); - int get hashCode { - final l$volumes = volumes; - final l$$__typename = $__typename; - return Object.hashAll( - [Object.hashAll(l$volumes.map((v) => v)), l$$__typename]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) return true; - if (!(other is Query$GetServerDiskVolumesQuery$storage) || - runtimeType != other.runtimeType) return false; - final l$volumes = volumes; - final lOther$volumes = other.volumes; - if (l$volumes.length != lOther$volumes.length) return false; - for (int i = 0; i < l$volumes.length; i++) { - final l$volumes$entry = l$volumes[i]; - final lOther$volumes$entry = lOther$volumes[i]; - if (l$volumes$entry != lOther$volumes$entry) return false; - } - - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) return false; - return true; - } -} - -extension UtilityExtension$Query$GetServerDiskVolumesQuery$storage - on Query$GetServerDiskVolumesQuery$storage { - CopyWith$Query$GetServerDiskVolumesQuery$storage< - Query$GetServerDiskVolumesQuery$storage> - get copyWith => - CopyWith$Query$GetServerDiskVolumesQuery$storage(this, (i) => i); -} - -abstract class CopyWith$Query$GetServerDiskVolumesQuery$storage { - factory CopyWith$Query$GetServerDiskVolumesQuery$storage( - Query$GetServerDiskVolumesQuery$storage instance, - TRes Function(Query$GetServerDiskVolumesQuery$storage) then) = - _CopyWithImpl$Query$GetServerDiskVolumesQuery$storage; - - factory CopyWith$Query$GetServerDiskVolumesQuery$storage.stub(TRes res) = - _CopyWithStubImpl$Query$GetServerDiskVolumesQuery$storage; - - TRes call( - {List? volumes, - String? $__typename}); - TRes volumes( - Iterable Function( - Iterable< - CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes< - Query$GetServerDiskVolumesQuery$storage$volumes>>) - _fn); -} - -class _CopyWithImpl$Query$GetServerDiskVolumesQuery$storage - implements CopyWith$Query$GetServerDiskVolumesQuery$storage { - _CopyWithImpl$Query$GetServerDiskVolumesQuery$storage( - this._instance, this._then); - - final Query$GetServerDiskVolumesQuery$storage _instance; - - final TRes Function(Query$GetServerDiskVolumesQuery$storage) _then; - - static const _undefined = {}; - - TRes call({Object? volumes = _undefined, Object? $__typename = _undefined}) => - _then(Query$GetServerDiskVolumesQuery$storage( - volumes: volumes == _undefined || volumes == null - ? _instance.volumes - : (volumes - as List), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String))); - TRes volumes( - Iterable Function( - Iterable< - CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes< - Query$GetServerDiskVolumesQuery$storage$volumes>>) - _fn) => - call( - volumes: _fn(_instance.volumes.map((e) => - CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes( - e, (i) => i))).toList()); -} - -class _CopyWithStubImpl$Query$GetServerDiskVolumesQuery$storage - implements CopyWith$Query$GetServerDiskVolumesQuery$storage { - _CopyWithStubImpl$Query$GetServerDiskVolumesQuery$storage(this._res); - - TRes _res; - - call( - {List? volumes, - String? $__typename}) => - _res; - volumes(_fn) => _res; -} - -@JsonSerializable(explicitToJson: true) -class Query$GetServerDiskVolumesQuery$storage$volumes { - Query$GetServerDiskVolumesQuery$storage$volumes( - {required this.freeSpace, - required this.name, - required this.root, - required this.totalSpace, - required this.usedSpace, - required this.$__typename}); - - @override - factory Query$GetServerDiskVolumesQuery$storage$volumes.fromJson( - Map json) => - _$Query$GetServerDiskVolumesQuery$storage$volumesFromJson(json); - - final String freeSpace; - - final String name; - - final bool root; - - final String totalSpace; - - final String usedSpace; - - @JsonKey(name: '__typename') - final String $__typename; - - Map toJson() => - _$Query$GetServerDiskVolumesQuery$storage$volumesToJson(this); - int get hashCode { - final l$freeSpace = freeSpace; - final l$name = name; - final l$root = root; - final l$totalSpace = totalSpace; - final l$usedSpace = usedSpace; - final l$$__typename = $__typename; - return Object.hashAll([ - l$freeSpace, - l$name, - l$root, - l$totalSpace, - l$usedSpace, - l$$__typename - ]); - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) return true; - if (!(other is Query$GetServerDiskVolumesQuery$storage$volumes) || - runtimeType != other.runtimeType) return false; - final l$freeSpace = freeSpace; - final lOther$freeSpace = other.freeSpace; - if (l$freeSpace != lOther$freeSpace) return false; - final l$name = name; - final lOther$name = other.name; - if (l$name != lOther$name) return false; - final l$root = root; - final lOther$root = other.root; - if (l$root != lOther$root) return false; - final l$totalSpace = totalSpace; - final lOther$totalSpace = other.totalSpace; - if (l$totalSpace != lOther$totalSpace) return false; - final l$usedSpace = usedSpace; - final lOther$usedSpace = other.usedSpace; - if (l$usedSpace != lOther$usedSpace) return false; - final l$$__typename = $__typename; - final lOther$$__typename = other.$__typename; - if (l$$__typename != lOther$$__typename) return false; - return true; - } -} - -extension UtilityExtension$Query$GetServerDiskVolumesQuery$storage$volumes - on Query$GetServerDiskVolumesQuery$storage$volumes { - CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes< - Query$GetServerDiskVolumesQuery$storage$volumes> - get copyWith => CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes( - this, (i) => i); -} - -abstract class CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes { - factory CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes( - Query$GetServerDiskVolumesQuery$storage$volumes instance, - TRes Function(Query$GetServerDiskVolumesQuery$storage$volumes) then) = - _CopyWithImpl$Query$GetServerDiskVolumesQuery$storage$volumes; - - factory CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes.stub( - TRes res) = - _CopyWithStubImpl$Query$GetServerDiskVolumesQuery$storage$volumes; - - TRes call( - {String? freeSpace, - String? name, - bool? root, - String? totalSpace, - String? usedSpace, - String? $__typename}); -} - -class _CopyWithImpl$Query$GetServerDiskVolumesQuery$storage$volumes - implements CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes { - _CopyWithImpl$Query$GetServerDiskVolumesQuery$storage$volumes( - this._instance, this._then); - - final Query$GetServerDiskVolumesQuery$storage$volumes _instance; - - final TRes Function(Query$GetServerDiskVolumesQuery$storage$volumes) _then; - - static const _undefined = {}; - - TRes call( - {Object? freeSpace = _undefined, - Object? name = _undefined, - Object? root = _undefined, - Object? totalSpace = _undefined, - Object? usedSpace = _undefined, - Object? $__typename = _undefined}) => - _then(Query$GetServerDiskVolumesQuery$storage$volumes( - freeSpace: freeSpace == _undefined || freeSpace == null - ? _instance.freeSpace - : (freeSpace as String), - name: name == _undefined || name == null - ? _instance.name - : (name as String), - root: root == _undefined || root == null - ? _instance.root - : (root as bool), - totalSpace: totalSpace == _undefined || totalSpace == null - ? _instance.totalSpace - : (totalSpace as String), - usedSpace: usedSpace == _undefined || usedSpace == null - ? _instance.usedSpace - : (usedSpace as String), - $__typename: $__typename == _undefined || $__typename == null - ? _instance.$__typename - : ($__typename as String))); -} - -class _CopyWithStubImpl$Query$GetServerDiskVolumesQuery$storage$volumes - implements CopyWith$Query$GetServerDiskVolumesQuery$storage$volumes { - _CopyWithStubImpl$Query$GetServerDiskVolumesQuery$storage$volumes(this._res); - - TRes _res; - - call( - {String? freeSpace, - String? name, - bool? root, - String? totalSpace, - String? usedSpace, - String? $__typename}) => - _res; -} diff --git a/lib/logic/api_maps/graphql_maps/schema/get_server_disk_volumes.graphql.g.dart b/lib/logic/api_maps/graphql_maps/schema/get_server_disk_volumes.graphql.g.dart deleted file mode 100644 index ecbd5a02..00000000 --- a/lib/logic/api_maps/graphql_maps/schema/get_server_disk_volumes.graphql.g.dart +++ /dev/null @@ -1,64 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'get_server_disk_volumes.graphql.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -Query$GetServerDiskVolumesQuery _$Query$GetServerDiskVolumesQueryFromJson( - Map json) => - Query$GetServerDiskVolumesQuery( - storage: Query$GetServerDiskVolumesQuery$storage.fromJson( - json['storage'] as Map), - $__typename: json['__typename'] as String, - ); - -Map _$Query$GetServerDiskVolumesQueryToJson( - Query$GetServerDiskVolumesQuery instance) => - { - 'storage': instance.storage.toJson(), - '__typename': instance.$__typename, - }; - -Query$GetServerDiskVolumesQuery$storage - _$Query$GetServerDiskVolumesQuery$storageFromJson( - Map json) => - Query$GetServerDiskVolumesQuery$storage( - volumes: (json['volumes'] as List) - .map((e) => - Query$GetServerDiskVolumesQuery$storage$volumes.fromJson( - e as Map)) - .toList(), - $__typename: json['__typename'] as String, - ); - -Map _$Query$GetServerDiskVolumesQuery$storageToJson( - Query$GetServerDiskVolumesQuery$storage instance) => - { - 'volumes': instance.volumes.map((e) => e.toJson()).toList(), - '__typename': instance.$__typename, - }; - -Query$GetServerDiskVolumesQuery$storage$volumes - _$Query$GetServerDiskVolumesQuery$storage$volumesFromJson( - Map json) => - Query$GetServerDiskVolumesQuery$storage$volumes( - freeSpace: json['freeSpace'] as String, - name: json['name'] as String, - root: json['root'] as bool, - totalSpace: json['totalSpace'] as String, - usedSpace: json['usedSpace'] as String, - $__typename: json['__typename'] as String, - ); - -Map _$Query$GetServerDiskVolumesQuery$storage$volumesToJson( - Query$GetServerDiskVolumesQuery$storage$volumes instance) => - { - 'freeSpace': instance.freeSpace, - 'name': instance.name, - 'root': instance.root, - 'totalSpace': instance.totalSpace, - 'usedSpace': instance.usedSpace, - '__typename': instance.$__typename, - }; diff --git a/lib/logic/api_maps/graphql_maps/schema/schema.graphql b/lib/logic/api_maps/graphql_maps/schema/schema.graphql index 3ad04e3f..81ab4bc5 100644 --- a/lib/logic/api_maps/graphql_maps/schema/schema.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/schema.graphql @@ -7,18 +7,21 @@ type Alert { timestamp: DateTime } -type Storage { - volumes: [StorageVolume!]! -} - type StorageVolume { freeSpace: String! + model: String! name: String! root: Boolean! + serial: String! totalSpace: String! + type: String! usedSpace: String! } +type Storage { + volumes: [StorageVolume!]! +} + type Api { version: String! devices: [ApiDevice!]! @@ -84,6 +87,9 @@ type Mutation { getNewDeviceApiKey: ApiKeyMutationReturn! invalidateNewDeviceApiKey: GenericMutationReturn! authorizeWithNewDeviceApiKey(input: UseNewDeviceKeyInput!): DeviceApiTokenMutationReturn! + resizeVolume(name: String!): GenericMutationReturn! + unmountVolume(name: String!): GenericMutationReturn! + mountVolume(name: String!): GenericMutationReturn! } interface MutationReturnInterface { @@ -161,4 +167,4 @@ input UseNewDeviceKeyInput { input UseRecoveryKeyInput { key: String! deviceName: String! -} +} \ No newline at end of file diff --git a/lib/logic/api_maps/graphql_maps/schema/server.dart b/lib/logic/api_maps/graphql_maps/schema/server.dart index ab4fe197..4b419a15 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server.dart @@ -1,9 +1,8 @@ import 'package:graphql/client.dart'; import 'package:selfprivacy/config/get_it_config.dart'; import 'package:selfprivacy/logic/api_maps/graphql_maps/api_map.dart'; -import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/get_api_tokens.graphql.dart'; -import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/get_api_version.graphql.dart'; -import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/get_server_disk_volumes.graphql.dart'; +import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/server_api.graphql.dart'; +import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart'; import 'package:selfprivacy/logic/models/hive/server_domain.dart'; import 'package:selfprivacy/logic/models/json/api_token.dart'; import 'package:selfprivacy/logic/models/json/server_disk_volume.dart'; @@ -12,7 +11,7 @@ class ServerApi extends ApiMap { ServerApi({ this.hasLogger = false, this.isWithToken = true, - this.authToken = '', + this.customToken = '', }) { final ServerDomain? serverDomain = getIt().serverDomain; rootAddress = serverDomain?.domainName ?? ''; @@ -22,7 +21,7 @@ class ServerApi extends ApiMap { @override bool isWithToken; @override - String authToken; + String customToken; @override String? rootAddress; @@ -73,4 +72,43 @@ class ServerApi extends ApiMap { return volumes; } + + Future mountVolume(final String volumeName) async { + try { + final GraphQLClient client = await getClient(); + final variables = + Variables$Mutation$MountVolumeMutation(name: volumeName); + final mountVolumeMutation = + Options$Mutation$MountVolumeMutation(variables: variables); + await client.mutate$MountVolumeMutation(mountVolumeMutation); + } catch (e) { + print(e); + } + } + + Future unmountVolume(final String volumeName) async { + try { + final GraphQLClient client = await getClient(); + final variables = + Variables$Mutation$UnmountVolumeMutation(name: volumeName); + final unmountVolumeMutation = + Options$Mutation$UnmountVolumeMutation(variables: variables); + await client.mutate$UnmountVolumeMutation(unmountVolumeMutation); + } catch (e) { + print(e); + } + } + + Future resizeVolume(final String volumeName) async { + try { + final GraphQLClient client = await getClient(); + final variables = + Variables$Mutation$ResizeVolumeMutation(name: volumeName); + final resizeVolumeMutation = + Options$Mutation$ResizeVolumeMutation(variables: variables); + await client.mutate$ResizeVolumeMutation(resizeVolumeMutation); + } catch (e) { + print(e); + } + } } diff --git a/lib/logic/api_maps/graphql_maps/schema/get_api_tokens.graphql b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql similarity index 65% rename from lib/logic/api_maps/graphql_maps/schema/get_api_tokens.graphql rename to lib/logic/api_maps/graphql_maps/schema/server_api.graphql index df9569c0..f88b3346 100644 --- a/lib/logic/api_maps/graphql_maps/schema/get_api_tokens.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql @@ -6,4 +6,10 @@ query GetApiTokensQuery { name } } +} + +query GetApiVersionQuery { + api { + version + } } \ No newline at end of file diff --git a/lib/logic/api_maps/graphql_maps/schema/get_api_tokens.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart similarity index 61% rename from lib/logic/api_maps/graphql_maps/schema/get_api_tokens.graphql.dart rename to lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart index 763ffcc4..2394d113 100644 --- a/lib/logic/api_maps/graphql_maps/schema/get_api_tokens.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart @@ -2,7 +2,7 @@ import 'package:gql/ast.dart'; import 'package:graphql/client.dart' as graphql; import 'package:json_annotation/json_annotation.dart'; import 'package:selfprivacy/utils/scalars.dart'; -part 'get_api_tokens.graphql.g.dart'; +part 'server_api.graphql.g.dart'; @JsonSerializable(explicitToJson: true) class Query$GetApiTokensQuery { @@ -472,3 +472,300 @@ class _CopyWithStubImpl$Query$GetApiTokensQuery$api$devices String? $__typename}) => _res; } + +@JsonSerializable(explicitToJson: true) +class Query$GetApiVersionQuery { + Query$GetApiVersionQuery({required this.api, required this.$__typename}); + + @override + factory Query$GetApiVersionQuery.fromJson(Map json) => + _$Query$GetApiVersionQueryFromJson(json); + + final Query$GetApiVersionQuery$api api; + + @JsonKey(name: '__typename') + final String $__typename; + + Map toJson() => _$Query$GetApiVersionQueryToJson(this); + int get hashCode { + final l$api = api; + final l$$__typename = $__typename; + return Object.hashAll([l$api, l$$__typename]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) return true; + if (!(other is Query$GetApiVersionQuery) || + runtimeType != other.runtimeType) return false; + final l$api = api; + final lOther$api = other.api; + if (l$api != lOther$api) return false; + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) return false; + return true; + } +} + +extension UtilityExtension$Query$GetApiVersionQuery + on Query$GetApiVersionQuery { + CopyWith$Query$GetApiVersionQuery get copyWith => + CopyWith$Query$GetApiVersionQuery(this, (i) => i); +} + +abstract class CopyWith$Query$GetApiVersionQuery { + factory CopyWith$Query$GetApiVersionQuery(Query$GetApiVersionQuery instance, + TRes Function(Query$GetApiVersionQuery) then) = + _CopyWithImpl$Query$GetApiVersionQuery; + + factory CopyWith$Query$GetApiVersionQuery.stub(TRes res) = + _CopyWithStubImpl$Query$GetApiVersionQuery; + + TRes call({Query$GetApiVersionQuery$api? api, String? $__typename}); + CopyWith$Query$GetApiVersionQuery$api get api; +} + +class _CopyWithImpl$Query$GetApiVersionQuery + implements CopyWith$Query$GetApiVersionQuery { + _CopyWithImpl$Query$GetApiVersionQuery(this._instance, this._then); + + final Query$GetApiVersionQuery _instance; + + final TRes Function(Query$GetApiVersionQuery) _then; + + static const _undefined = {}; + + TRes call({Object? api = _undefined, Object? $__typename = _undefined}) => + _then(Query$GetApiVersionQuery( + api: api == _undefined || api == null + ? _instance.api + : (api as Query$GetApiVersionQuery$api), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String))); + CopyWith$Query$GetApiVersionQuery$api get api { + final local$api = _instance.api; + return CopyWith$Query$GetApiVersionQuery$api( + local$api, (e) => call(api: e)); + } +} + +class _CopyWithStubImpl$Query$GetApiVersionQuery + implements CopyWith$Query$GetApiVersionQuery { + _CopyWithStubImpl$Query$GetApiVersionQuery(this._res); + + TRes _res; + + call({Query$GetApiVersionQuery$api? api, String? $__typename}) => _res; + CopyWith$Query$GetApiVersionQuery$api get api => + CopyWith$Query$GetApiVersionQuery$api.stub(_res); +} + +const documentNodeQueryGetApiVersionQuery = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'GetApiVersionQuery'), + variableDefinitions: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'api'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'version'), + 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$GetApiVersionQuery _parserFn$Query$GetApiVersionQuery( + Map data) => + Query$GetApiVersionQuery.fromJson(data); + +class Options$Query$GetApiVersionQuery + extends graphql.QueryOptions { + Options$Query$GetApiVersionQuery( + {String? operationName, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Duration? pollInterval, + graphql.Context? context}) + : super( + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult, + pollInterval: pollInterval, + context: context, + document: documentNodeQueryGetApiVersionQuery, + parserFn: _parserFn$Query$GetApiVersionQuery); +} + +class WatchOptions$Query$GetApiVersionQuery + extends graphql.WatchQueryOptions { + WatchOptions$Query$GetApiVersionQuery( + {String? operationName, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + graphql.Context? context, + Duration? pollInterval, + bool? eagerlyFetchResults, + bool carryForwardDataOnException = true, + bool fetchResults = false}) + : super( + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult, + context: context, + document: documentNodeQueryGetApiVersionQuery, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Query$GetApiVersionQuery); +} + +class FetchMoreOptions$Query$GetApiVersionQuery + extends graphql.FetchMoreOptions { + FetchMoreOptions$Query$GetApiVersionQuery( + {required graphql.UpdateQuery updateQuery}) + : super( + updateQuery: updateQuery, + document: documentNodeQueryGetApiVersionQuery); +} + +extension ClientExtension$Query$GetApiVersionQuery on graphql.GraphQLClient { + Future> + query$GetApiVersionQuery( + [Options$Query$GetApiVersionQuery? options]) async => + await this.query(options ?? Options$Query$GetApiVersionQuery()); + graphql.ObservableQuery + watchQuery$GetApiVersionQuery( + [WatchOptions$Query$GetApiVersionQuery? options]) => + this.watchQuery(options ?? WatchOptions$Query$GetApiVersionQuery()); + void writeQuery$GetApiVersionQuery( + {required Query$GetApiVersionQuery data, bool broadcast = true}) => + this.writeQuery( + graphql.Request( + operation: graphql.Operation( + document: documentNodeQueryGetApiVersionQuery)), + data: data.toJson(), + broadcast: broadcast); + Query$GetApiVersionQuery? readQuery$GetApiVersionQuery( + {bool optimistic = true}) { + final result = this.readQuery( + graphql.Request( + operation: graphql.Operation( + document: documentNodeQueryGetApiVersionQuery)), + optimistic: optimistic); + return result == null ? null : Query$GetApiVersionQuery.fromJson(result); + } +} + +@JsonSerializable(explicitToJson: true) +class Query$GetApiVersionQuery$api { + Query$GetApiVersionQuery$api( + {required this.version, required this.$__typename}); + + @override + factory Query$GetApiVersionQuery$api.fromJson(Map json) => + _$Query$GetApiVersionQuery$apiFromJson(json); + + final String version; + + @JsonKey(name: '__typename') + final String $__typename; + + Map toJson() => _$Query$GetApiVersionQuery$apiToJson(this); + int get hashCode { + final l$version = version; + final l$$__typename = $__typename; + return Object.hashAll([l$version, l$$__typename]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) return true; + if (!(other is Query$GetApiVersionQuery$api) || + runtimeType != other.runtimeType) return false; + final l$version = version; + final lOther$version = other.version; + if (l$version != lOther$version) return false; + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) return false; + return true; + } +} + +extension UtilityExtension$Query$GetApiVersionQuery$api + on Query$GetApiVersionQuery$api { + CopyWith$Query$GetApiVersionQuery$api + get copyWith => CopyWith$Query$GetApiVersionQuery$api(this, (i) => i); +} + +abstract class CopyWith$Query$GetApiVersionQuery$api { + factory CopyWith$Query$GetApiVersionQuery$api( + Query$GetApiVersionQuery$api instance, + TRes Function(Query$GetApiVersionQuery$api) then) = + _CopyWithImpl$Query$GetApiVersionQuery$api; + + factory CopyWith$Query$GetApiVersionQuery$api.stub(TRes res) = + _CopyWithStubImpl$Query$GetApiVersionQuery$api; + + TRes call({String? version, String? $__typename}); +} + +class _CopyWithImpl$Query$GetApiVersionQuery$api + implements CopyWith$Query$GetApiVersionQuery$api { + _CopyWithImpl$Query$GetApiVersionQuery$api(this._instance, this._then); + + final Query$GetApiVersionQuery$api _instance; + + final TRes Function(Query$GetApiVersionQuery$api) _then; + + static const _undefined = {}; + + TRes call({Object? version = _undefined, Object? $__typename = _undefined}) => + _then(Query$GetApiVersionQuery$api( + version: version == _undefined || version == null + ? _instance.version + : (version as String), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String))); +} + +class _CopyWithStubImpl$Query$GetApiVersionQuery$api + implements CopyWith$Query$GetApiVersionQuery$api { + _CopyWithStubImpl$Query$GetApiVersionQuery$api(this._res); + + TRes _res; + + call({String? version, String? $__typename}) => _res; +} diff --git a/lib/logic/api_maps/graphql_maps/schema/get_api_tokens.graphql.g.dart b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.g.dart similarity index 67% rename from lib/logic/api_maps/graphql_maps/schema/get_api_tokens.graphql.g.dart rename to lib/logic/api_maps/graphql_maps/schema/server_api.graphql.g.dart index bb5e5bae..dcb8ba01 100644 --- a/lib/logic/api_maps/graphql_maps/schema/get_api_tokens.graphql.g.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'get_api_tokens.graphql.dart'; +part of 'server_api.graphql.dart'; // ************************************************************************** // JsonSerializableGenerator @@ -55,3 +55,32 @@ Map _$Query$GetApiTokensQuery$api$devicesToJson( 'name': instance.name, '__typename': instance.$__typename, }; + +Query$GetApiVersionQuery _$Query$GetApiVersionQueryFromJson( + Map json) => + Query$GetApiVersionQuery( + api: Query$GetApiVersionQuery$api.fromJson( + json['api'] as Map), + $__typename: json['__typename'] as String, + ); + +Map _$Query$GetApiVersionQueryToJson( + Query$GetApiVersionQuery instance) => + { + 'api': instance.api.toJson(), + '__typename': instance.$__typename, + }; + +Query$GetApiVersionQuery$api _$Query$GetApiVersionQuery$apiFromJson( + Map json) => + Query$GetApiVersionQuery$api( + version: json['version'] as String, + $__typename: json['__typename'] as String, + ); + +Map _$Query$GetApiVersionQuery$apiToJson( + Query$GetApiVersionQuery$api instance) => + { + 'version': instance.version, + '__typename': instance.$__typename, + }; diff --git a/lib/logic/api_maps/rest_maps/server_providers/hetzner/hetzner.dart b/lib/logic/api_maps/rest_maps/server_providers/hetzner/hetzner.dart index fa75db17..c944efe6 100644 --- a/lib/logic/api_maps/rest_maps/server_providers/hetzner/hetzner.dart +++ b/lib/logic/api_maps/rest_maps/server_providers/hetzner/hetzner.dart @@ -96,11 +96,13 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi { final dbSize = dbCreateResponse.data['volume']['size']; final dbServer = dbCreateResponse.data['volume']['server']; final dbName = dbCreateResponse.data['volume']['name']; + final dbDevice = dbCreateResponse.data['volume']['linux_device']; volume = ServerVolume( id: dbId, name: dbName, sizeByte: dbSize, serverId: dbServer, + linuxDevice: dbDevice, ); } catch (e) { print(e); @@ -130,11 +132,13 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi { final int dbSize = rawVolume['size']; final dbServer = rawVolume['server']; final String dbName = rawVolume['name']; + final dbDevice = rawVolume['linux_device']; final volume = ServerVolume( id: dbId, name: dbName, sizeByte: dbSize, serverId: dbServer, + linuxDevice: dbDevice, ); volumes.add(volume); } @@ -159,11 +163,13 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi { final int dbSize = dbGetResponse.data['volume']['size']; final int dbServer = dbGetResponse.data['volume']['server']; final String dbName = dbGetResponse.data['volume']['name']; + final dbDevice = dbGetResponse.data['volume']['linux_device']; volume = ServerVolume( id: dbId, name: dbName, sizeByte: dbSize, serverId: dbServer, + linuxDevice: dbDevice, ); } catch (e) { print(e); diff --git a/lib/logic/cubit/server_installation/server_installation_cubit.dart b/lib/logic/cubit/server_installation/server_installation_cubit.dart index 4ed0d382..c17c1ff2 100644 --- a/lib/logic/cubit/server_installation/server_installation_cubit.dart +++ b/lib/logic/cubit/server_installation/server_installation_cubit.dart @@ -541,6 +541,7 @@ class ServerInstallationCubit extends Cubit { name: 'recovered_volume', sizeByte: 0, serverId: server.id, + linuxDevice: '', ), apiToken: dataState.serverDetails!.apiToken, provider: ServerProvider.hetzner, @@ -556,8 +557,7 @@ class ServerInstallationCubit extends Cubit { } Future> getServerDiskVolumes() async => - ServerApi(authToken: 'HARDCODE OUR BEARER HERE FOR NOW') - .getServerDiskVolumes(); + ServerApi().getServerDiskVolumes(); Future setAndValidateCloudflareToken(final String token) async { final ServerInstallationRecovery dataState = diff --git a/lib/logic/cubit/server_installation/server_installation_repository.dart b/lib/logic/cubit/server_installation/server_installation_repository.dart index 1c94a2d0..f09599eb 100644 --- a/lib/logic/cubit/server_installation/server_installation_repository.dart +++ b/lib/logic/cubit/server_installation/server_installation_repository.dart @@ -475,6 +475,7 @@ class ServerInstallationRepository { name: '', sizeByte: 0, serverId: 0, + linuxDevice: '', ), provider: ServerProvider.unknown, id: 0, @@ -511,6 +512,7 @@ class ServerInstallationRepository { name: '', sizeByte: 0, serverId: 0, + linuxDevice: '', ), provider: ServerProvider.unknown, id: 0, @@ -547,6 +549,7 @@ class ServerInstallationRepository { name: '', serverId: 0, sizeByte: 0, + linuxDevice: '', ), provider: ServerProvider.unknown, id: 0, @@ -574,6 +577,7 @@ class ServerInstallationRepository { name: '', sizeByte: 0, serverId: 0, + linuxDevice: '', ), provider: ServerProvider.unknown, id: 0, diff --git a/lib/logic/cubit/volumes/volumes_cubit.dart b/lib/logic/cubit/volumes/volumes_cubit.dart index 2645e502..4e494f3a 100644 --- a/lib/logic/cubit/volumes/volumes_cubit.dart +++ b/lib/logic/cubit/volumes/volumes_cubit.dart @@ -1,9 +1,11 @@ import 'package:selfprivacy/config/get_it_config.dart'; +import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/server.dart'; import 'package:selfprivacy/logic/api_maps/rest_maps/api_factory_creator.dart'; import 'package:selfprivacy/logic/api_maps/rest_maps/server_providers/server_provider_factory.dart'; import 'package:selfprivacy/logic/common_enum/common_enum.dart'; import 'package:selfprivacy/logic/cubit/app_config_dependent/authentication_dependend_cubit.dart'; import 'package:selfprivacy/logic/models/hive/server_details.dart'; +import 'package:selfprivacy/logic/models/json/server_disk_volume.dart'; part 'volumes_state.dart'; @@ -18,18 +20,18 @@ class ApiVolumesCubit ); @override - void load() async { + Future load() async { if (serverInstallationCubit.state is ServerInstallationFinished) { _refetch(); } } - void refresh() async { + Future refresh() async { emit(const ApiVolumesState([], LoadingStatus.refreshing)); _refetch(); } - void _refetch() async { + Future _refetch() async { final List volumes = await providerApi.getVolumeProvider().getVolumes(); if (volumes.isNotEmpty) { @@ -39,31 +41,51 @@ class ApiVolumesCubit } } - void attachVolume(final ServerVolume volume) async { + Future attachVolume(final ServerVolume volume) async { final ServerHostingDetails server = getIt().serverDetails!; await providerApi.getVolumeProvider().attachVolume(volume.id, server.id); refresh(); } - void detachVolume(final ServerVolume volume) async { + Future detachVolume(final ServerVolume volume) async { await providerApi.getVolumeProvider().detachVolume(volume.id); refresh(); } - void resizeVolume(final ServerVolume volume, final int newSizeGb) async { - //if (volume.sizeByte < newSizeGb) { - await providerApi.getVolumeProvider().resizeVolume(volume.id, newSizeGb); + Future resizeVolume( + final ServerDiskVolume volume, + final int newSizeGb, + ) async { + final ServerVolume? providerVolume = await fetchProdiverVolume(volume); + final bool resized = await providerApi.getVolumeProvider().resizeVolume( + providerVolume!.id, + newSizeGb, + ); + + if (!resized) { + return false; + } + + await ServerApi().resizeVolume(volume.name); refresh(); - //} + return true; } - void createVolume() async { - await providerApi.getVolumeProvider().createVolume(); + Future createVolume() async { + final ServerVolume? volume = + await providerApi.getVolumeProvider().createVolume(); + await attachVolume(volume!); + + await Future.delayed(const Duration(seconds: 10)); + + final ServerDiskVolume? diskVolume = await fetchServerDiskVolume(volume); + await ServerApi().mountVolume(diskVolume!.name); refresh(); } - void deleteVolume(final ServerVolume volume) async { - await providerApi.getVolumeProvider().deleteVolume(volume.id); + Future deleteVolume(final ServerDiskVolume volume) async { + final ServerVolume? providerVolume = await fetchProdiverVolume(volume); + await providerApi.getVolumeProvider().deleteVolume(providerVolume!.id); refresh(); } @@ -71,4 +93,54 @@ class ApiVolumesCubit void clear() { emit(const ApiVolumesState.initial()); } + + Future fetchProdiverVolume( + final ServerDiskVolume volume, + ) async { + ServerVolume? fetchedVolume; + final List volumes = + await providerApi.getVolumeProvider().getVolumes(); + + for (final ServerVolume providerVolume in volumes) { + if (providerVolume.linuxDevice == null) { + continue; + } + + final String deviceId = providerVolume.linuxDevice!.split('/').last; + if (deviceId.contains(volume.model!) && + deviceId.contains(volume.serial!)) { + fetchedVolume = providerVolume; + break; + } + } + + return fetchedVolume; + } + + Future fetchServerDiskVolume( + final ServerVolume volume, + ) async { + ServerDiskVolume? fetchedVolume; + if (volume.linuxDevice == null) { + return fetchedVolume; + } + + final List volumes = + await ServerApi().getServerDiskVolumes(); + + for (final ServerDiskVolume serverDiskVolumes in volumes) { + if (serverDiskVolumes.model == null || serverDiskVolumes.serial == null) { + continue; + } + + final String deviceId = volume.linuxDevice!.split('/').last; + if (deviceId.contains(serverDiskVolumes.model!) && + deviceId.contains(serverDiskVolumes.serial!)) { + fetchedVolume = serverDiskVolumes; + break; + } + } + + return fetchedVolume; + } } diff --git a/lib/logic/models/hive/server_details.dart b/lib/logic/models/hive/server_details.dart index 44c8d5b3..3791c664 100644 --- a/lib/logic/models/hive/server_details.dart +++ b/lib/logic/models/hive/server_details.dart @@ -57,6 +57,7 @@ class ServerVolume { required this.name, required this.sizeByte, required this.serverId, + required this.linuxDevice, }); @HiveField(1) @@ -67,6 +68,8 @@ class ServerVolume { int sizeByte; @HiveField(4, defaultValue: null) int? serverId; + @HiveField(5, defaultValue: null) + String? linuxDevice; } @HiveType(typeId: 101) diff --git a/lib/logic/models/hive/server_details.g.dart b/lib/logic/models/hive/server_details.g.dart index d4ea9b01..29716607 100644 --- a/lib/logic/models/hive/server_details.g.dart +++ b/lib/logic/models/hive/server_details.g.dart @@ -75,13 +75,14 @@ class ServerVolumeAdapter extends TypeAdapter { name: fields[2] as String, sizeByte: fields[3] == null ? 10737418240 : fields[3] as int, serverId: fields[4] as int?, + linuxDevice: fields[5] as String?, ); } @override void write(BinaryWriter writer, ServerVolume obj) { writer - ..writeByte(4) + ..writeByte(5) ..writeByte(1) ..write(obj.id) ..writeByte(2) @@ -89,7 +90,9 @@ class ServerVolumeAdapter extends TypeAdapter { ..writeByte(3) ..write(obj.sizeByte) ..writeByte(4) - ..write(obj.serverId); + ..write(obj.serverId) + ..writeByte(5) + ..write(obj.linuxDevice); } @override diff --git a/lib/logic/models/json/server_disk_volume.dart b/lib/logic/models/json/server_disk_volume.dart index b7d4bfca..873b5d97 100644 --- a/lib/logic/models/json/server_disk_volume.dart +++ b/lib/logic/models/json/server_disk_volume.dart @@ -8,15 +8,21 @@ class ServerDiskVolume { _$ServerDiskVolumeFromJson(json); ServerDiskVolume({ required this.freeSpace, + required this.model, required this.name, required this.root, + required this.serial, required this.totalSpace, + required this.type, required this.usedSpace, }); final String freeSpace; + final String? model; final String name; final bool root; + final String? serial; final String totalSpace; + final String type; final String usedSpace; } diff --git a/lib/logic/models/json/server_disk_volume.g.dart b/lib/logic/models/json/server_disk_volume.g.dart index 95f5788b..81a9d86e 100644 --- a/lib/logic/models/json/server_disk_volume.g.dart +++ b/lib/logic/models/json/server_disk_volume.g.dart @@ -9,17 +9,23 @@ part of 'server_disk_volume.dart'; ServerDiskVolume _$ServerDiskVolumeFromJson(Map json) => ServerDiskVolume( freeSpace: json['freeSpace'] as String, + model: json['model'] as String?, name: json['name'] as String, root: json['root'] as bool, + serial: json['serial'] as String?, totalSpace: json['totalSpace'] as String, + type: json['type'] as String, usedSpace: json['usedSpace'] as String, ); Map _$ServerDiskVolumeToJson(ServerDiskVolume instance) => { 'freeSpace': instance.freeSpace, + 'model': instance.model, 'name': instance.name, 'root': instance.root, + 'serial': instance.serial, 'totalSpace': instance.totalSpace, + 'type': instance.type, 'usedSpace': instance.usedSpace, }; diff --git a/lib/ui/pages/providers/providers.dart b/lib/ui/pages/providers/providers.dart index 36903d1f..fa231c45 100644 --- a/lib/ui/pages/providers/providers.dart +++ b/lib/ui/pages/providers/providers.dart @@ -122,9 +122,6 @@ class _Card extends StatelessWidget { final ServerInstallationState appConfig = context.watch().state; - final String domainName = - appConfig.isDomainFilled ? appConfig.serverDomain!.domainName : ''; - switch (provider.type) { case ProviderType.server: title = 'providers.server.card_title'.tr(); @@ -140,7 +137,8 @@ class _Card extends StatelessWidget { break; case ProviderType.domain: title = 'providers.domain.screen_title'.tr(); - message = domainName; + message = + appConfig.isDomainFilled ? appConfig.serverDomain!.domainName : ''; stableText = 'providers.domain.status'.tr(); onTap = () => Navigator.of(context).push( diff --git a/lib/ui/pages/providers/storage_card.dart b/lib/ui/pages/providers/storage_card.dart index 51c510e4..74e0770f 100644 --- a/lib/ui/pages/providers/storage_card.dart +++ b/lib/ui/pages/providers/storage_card.dart @@ -1,5 +1,3 @@ -import 'dart:ffi'; - import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:selfprivacy/logic/cubit/providers/providers_cubit.dart'; @@ -7,21 +5,9 @@ import 'package:selfprivacy/logic/models/json/server_disk_volume.dart'; import 'package:selfprivacy/ui/components/brand_cards/brand_cards.dart'; import 'package:selfprivacy/ui/components/brand_linear_indicator/brand_linear_indicator.dart'; import 'package:selfprivacy/ui/components/icon_status_mask/icon_status_mask.dart'; - -class DiskVolume { - int gbUsed = 0; - int gbTotal = 0; - String name = ''; - bool root = false; - - /// from 0.0 to 1.0 - double percentage = 0.0; -} - -class DiskStatus { - bool isDiskOkay = false; - List diskVolumes = []; -} +import 'package:selfprivacy/ui/pages/server_storage/disk_status.dart'; +import 'package:selfprivacy/ui/pages/server_storage/server_storage.dart'; +import 'package:selfprivacy/utils/route_transitions/basic.dart'; class StorageCard extends StatelessWidget { const StorageCard({required this.volumes, final super.key}); @@ -29,9 +15,7 @@ class StorageCard extends StatelessWidget { final List volumes; @override - Widget build( - final BuildContext context, - ) { + Widget build(final BuildContext context) { final DiskStatus diskStatus = toDiskStatus(volumes); final List sections = []; @@ -41,7 +25,11 @@ class StorageCard extends StatelessWidget { ); sections.add( Text( - 'providers.storage.disk_usage'.tr(args: [volume.gbUsed.toString()]), + 'providers.storage.disk_usage'.tr( + args: [ + volume.gbUsed.toString(), + ], + ), style: Theme.of(context).textTheme.titleMedium, ), ); @@ -63,17 +51,25 @@ class StorageCard extends StatelessWidget { ); sections.add( Text( - 'providers.storage.disk_total'.tr(args: [ - volume.gbTotal.toString(), - volume.name, - ]), + 'providers.storage.disk_total'.tr( + args: [ + volume.gbTotal.toString(), + volume.name, + ], + ), style: Theme.of(context).textTheme.bodySmall, ), ); } return GestureDetector( - onTap: null, + onTap: () => Navigator.of(context).push( + materialRoute( + ServerStoragePage( + diskStatus: diskStatus, + ), + ), + ), child: BrandCards.big( child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/ui/pages/server_storage/disk_status.dart b/lib/ui/pages/server_storage/disk_status.dart new file mode 100644 index 00000000..ec2d2872 --- /dev/null +++ b/lib/ui/pages/server_storage/disk_status.dart @@ -0,0 +1,14 @@ +class DiskVolume { + int gbUsed = 0; + int gbTotal = 0; + String name = ''; + bool root = false; + + /// from 0.0 to 1.0 + double percentage = 0.0; +} + +class DiskStatus { + bool isDiskOkay = false; + List diskVolumes = []; +} diff --git a/lib/ui/pages/server_storage/server_storage.dart b/lib/ui/pages/server_storage/server_storage.dart new file mode 100644 index 00000000..82d59c2c --- /dev/null +++ b/lib/ui/pages/server_storage/server_storage.dart @@ -0,0 +1,96 @@ +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/ui/components/brand_hero_screen/brand_hero_screen.dart'; +import 'package:selfprivacy/ui/components/brand_linear_indicator/brand_linear_indicator.dart'; +import 'package:selfprivacy/ui/pages/server_storage/disk_status.dart'; + +class ServerStoragePage extends StatefulWidget { + const ServerStoragePage({required this.diskStatus, final super.key}); + + final DiskStatus diskStatus; + + @override + State createState() => _ServerStoragePageState(); +} + +class _ServerStoragePageState extends State { + @override + Widget build(final BuildContext context) { + final bool isReady = context.watch().state + is ServerInstallationFinished; + + if (!isReady) { + return BrandHeroScreen( + hasBackButton: true, + heroTitle: 'providers.storage.card_title'.tr(), + children: const [], + ); + } + + final List sections = []; + for (final DiskVolume volume in widget.diskStatus.diskVolumes) { + sections.add( + const SizedBox(height: 16), + ); + sections.add( + Text( + 'providers.storage.disk_usage'.tr( + args: [ + volume.gbUsed.toString(), + ], + ), + style: Theme.of(context).textTheme.titleMedium, + ), + ); + sections.add( + const SizedBox(height: 4), + ); + sections.add( + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + const Icon( + Icons.storage_outlined, + size: 24, + color: Colors.white, + ), + Expanded( + child: BrandLinearIndicator( + value: volume.percentage, + color: volume.root + ? Theme.of(context).colorScheme.primary + : Theme.of(context).colorScheme.secondary, + backgroundColor: Theme.of(context).colorScheme.surfaceVariant, + height: 14.0, + ), + ), + ], + ), + ); + sections.add( + const SizedBox(height: 4), + ); + sections.add( + Text( + 'providers.storage.disk_total'.tr( + args: [ + volume.gbTotal.toString(), + volume.name, + ], + ), + style: Theme.of(context).textTheme.bodySmall, + ), + ); + } + + return BrandHeroScreen( + hasBackButton: true, + heroTitle: 'providers.storage.card_title'.tr(), + children: [ + ...sections, + const SizedBox(height: 8), + ], + ); + } +}