From e065463ffb5062b6fec6866ad05d801c529b4fa5 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Tue, 30 Jul 2024 07:13:56 +0300 Subject: [PATCH] feat: CPU, Network and RAM stats from the server --- assets/translations/en.json | 7 +- .../graphql_maps/schema/monitoring.graphql | 68 + .../schema/monitoring.graphql.dart | 8914 +++++++++++++++++ .../graphql_maps/schema/schema.graphql | 2 +- .../server_api/monitoring_api.dart | 122 + .../graphql_maps/server_api/server_api.dart | 6 +- lib/logic/cubit/metrics/metrics_cubit.dart | 11 +- .../cubit/metrics/metrics_repository.dart | 64 +- lib/logic/cubit/metrics/metrics_state.dart | 14 +- lib/logic/models/metrics.dart | 124 + lib/ui/pages/server_details/charts/chart.dart | 61 + .../server_details/charts/memory_chart.dart | 179 + .../memory_usage_by_service_screen.dart | 156 + .../server_details/server_details_screen.dart | 1 + lib/ui/router/router.dart | 4 + lib/ui/router/router.gr.dart | 20 + 16 files changed, 9747 insertions(+), 6 deletions(-) create mode 100644 lib/logic/api_maps/graphql_maps/schema/monitoring.graphql create mode 100644 lib/logic/api_maps/graphql_maps/schema/monitoring.graphql.dart create mode 100644 lib/logic/api_maps/graphql_maps/server_api/monitoring_api.dart create mode 100644 lib/ui/pages/server_details/charts/memory_chart.dart create mode 100644 lib/ui/pages/server_details/memory_usage_by_service_screen.dart diff --git a/assets/translations/en.json b/assets/translations/en.json index 9f5fa0bb..e628c9d2 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -139,7 +139,12 @@ "network_title": "Network Usage", "in": "In", "out": "Out", - "unsupported": "You can't view resource usage charts without the server provider token." + "memory": "Memory usage", + "view_usage_by_service": "View usage by service", + "unsupported": "You can't view resource usage charts without the server provider token.", + "system": "System", + "ssh_users": "SSH users", + "ram_usage": "Average usage: {average}. Maximum: {max}." }, "server": { "card_title": "Server", diff --git a/lib/logic/api_maps/graphql_maps/schema/monitoring.graphql b/lib/logic/api_maps/graphql_maps/schema/monitoring.graphql new file mode 100644 index 00000000..16866c69 --- /dev/null +++ b/lib/logic/api_maps/graphql_maps/schema/monitoring.graphql @@ -0,0 +1,68 @@ +fragment MonitoringMetrics on MonitoringMetrics { + metrics { + metricId + values { + timestamp + value + } + } +} + +fragment MonitoringValues on MonitoringValues { + values { + value + timestamp + } +} + +fragment MonitoringQueryError on MonitoringQueryError { + error +} + + +query GetOverallCpuAndNetworkMetrics($start: DateTime, $end: DateTime, $step: Int!) { + monitoring { + cpuUsage(start: $start, end: $end, step: $step) { + overallUsage { + ... MonitoringQueryError + ... MonitoringValues + } + } + networkUsage(start: $start, end: $end, step: $step) { + overallUsage { + ... MonitoringQueryError + ... MonitoringMetrics + } + } + } +} + +query GetMemoryMetrics($start: DateTime, $end: DateTime, $step: Int!) { + monitoring { + memoryUsage(start: $start, end: $end, step: $step) { + overallUsage { + ... MonitoringQueryError + ... MonitoringValues + } + averageUsageByService { + ... MonitoringQueryError + ... MonitoringMetrics + } + maxUsageByService { + ... MonitoringQueryError + ... MonitoringMetrics + } + } + } +} + +query GetDiskMetrics($start: DateTime, $end: DateTime, $step: Int!) { + monitoring { + diskUsage(start: $start, end: $end, step: $step) { + overallUsage { + ... MonitoringQueryError + ... MonitoringMetrics + } + } + } +} diff --git a/lib/logic/api_maps/graphql_maps/schema/monitoring.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/monitoring.graphql.dart new file mode 100644 index 00000000..683f2d1b --- /dev/null +++ b/lib/logic/api_maps/graphql_maps/schema/monitoring.graphql.dart @@ -0,0 +1,8914 @@ +import 'dart:async'; +import 'package:gql/ast.dart'; +import 'package:graphql/client.dart' as graphql; +import 'package:selfprivacy/utils/scalars.dart'; + +class Fragment$MonitoringMetrics { + Fragment$MonitoringMetrics({ + required this.metrics, + this.$__typename = 'MonitoringMetrics', + }); + + factory Fragment$MonitoringMetrics.fromJson(Map json) { + final l$metrics = json['metrics']; + final l$$__typename = json['__typename']; + return Fragment$MonitoringMetrics( + metrics: (l$metrics as List) + .map((e) => Fragment$MonitoringMetrics$metrics.fromJson( + (e as Map))) + .toList(), + $__typename: (l$$__typename as String), + ); + } + + final List metrics; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$metrics = metrics; + _resultData['metrics'] = l$metrics.map((e) => e.toJson()).toList(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$metrics = metrics; + final l$$__typename = $__typename; + return Object.hashAll([ + Object.hashAll(l$metrics.map((v) => v)), + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Fragment$MonitoringMetrics) || + runtimeType != other.runtimeType) { + return false; + } + final l$metrics = metrics; + final lOther$metrics = other.metrics; + if (l$metrics.length != lOther$metrics.length) { + return false; + } + for (int i = 0; i < l$metrics.length; i++) { + final l$metrics$entry = l$metrics[i]; + final lOther$metrics$entry = lOther$metrics[i]; + if (l$metrics$entry != lOther$metrics$entry) { + return false; + } + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$MonitoringMetrics + on Fragment$MonitoringMetrics { + CopyWith$Fragment$MonitoringMetrics + get copyWith => CopyWith$Fragment$MonitoringMetrics( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$MonitoringMetrics { + factory CopyWith$Fragment$MonitoringMetrics( + Fragment$MonitoringMetrics instance, + TRes Function(Fragment$MonitoringMetrics) then, + ) = _CopyWithImpl$Fragment$MonitoringMetrics; + + factory CopyWith$Fragment$MonitoringMetrics.stub(TRes res) = + _CopyWithStubImpl$Fragment$MonitoringMetrics; + + TRes call({ + List? metrics, + String? $__typename, + }); + TRes metrics( + Iterable Function( + Iterable< + CopyWith$Fragment$MonitoringMetrics$metrics< + Fragment$MonitoringMetrics$metrics>>) + _fn); +} + +class _CopyWithImpl$Fragment$MonitoringMetrics + implements CopyWith$Fragment$MonitoringMetrics { + _CopyWithImpl$Fragment$MonitoringMetrics( + this._instance, + this._then, + ); + + final Fragment$MonitoringMetrics _instance; + + final TRes Function(Fragment$MonitoringMetrics) _then; + + static const _undefined = {}; + + TRes call({ + Object? metrics = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$MonitoringMetrics( + metrics: metrics == _undefined || metrics == null + ? _instance.metrics + : (metrics as List), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + TRes metrics( + Iterable Function( + Iterable< + CopyWith$Fragment$MonitoringMetrics$metrics< + Fragment$MonitoringMetrics$metrics>>) + _fn) => + call( + metrics: _fn(_instance.metrics + .map((e) => CopyWith$Fragment$MonitoringMetrics$metrics( + e, + (i) => i, + ))).toList()); +} + +class _CopyWithStubImpl$Fragment$MonitoringMetrics + implements CopyWith$Fragment$MonitoringMetrics { + _CopyWithStubImpl$Fragment$MonitoringMetrics(this._res); + + TRes _res; + + call({ + List? metrics, + String? $__typename, + }) => + _res; + + metrics(_fn) => _res; +} + +const fragmentDefinitionMonitoringMetrics = FragmentDefinitionNode( + name: NameNode(value: 'MonitoringMetrics'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'MonitoringMetrics'), + isNonNull: false, + )), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'metrics'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'metricId'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'values'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'timestamp'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'value'), + 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, + ), + ]), +); +const documentNodeFragmentMonitoringMetrics = DocumentNode(definitions: [ + fragmentDefinitionMonitoringMetrics, +]); + +extension ClientExtension$Fragment$MonitoringMetrics on graphql.GraphQLClient { + void writeFragment$MonitoringMetrics({ + required Fragment$MonitoringMetrics data, + required Map idFields, + bool broadcast = true, + }) => + this.writeFragment( + graphql.FragmentRequest( + idFields: idFields, + fragment: const graphql.Fragment( + fragmentName: 'MonitoringMetrics', + document: documentNodeFragmentMonitoringMetrics, + ), + ), + data: data.toJson(), + broadcast: broadcast, + ); + Fragment$MonitoringMetrics? readFragment$MonitoringMetrics({ + required Map idFields, + bool optimistic = true, + }) { + final result = this.readFragment( + graphql.FragmentRequest( + idFields: idFields, + fragment: const graphql.Fragment( + fragmentName: 'MonitoringMetrics', + document: documentNodeFragmentMonitoringMetrics, + ), + ), + optimistic: optimistic, + ); + return result == null ? null : Fragment$MonitoringMetrics.fromJson(result); + } +} + +class Fragment$MonitoringMetrics$metrics { + Fragment$MonitoringMetrics$metrics({ + required this.metricId, + required this.values, + this.$__typename = 'MonitoringMetric', + }); + + factory Fragment$MonitoringMetrics$metrics.fromJson( + Map json) { + final l$metricId = json['metricId']; + final l$values = json['values']; + final l$$__typename = json['__typename']; + return Fragment$MonitoringMetrics$metrics( + metricId: (l$metricId as String), + values: (l$values as List) + .map((e) => Fragment$MonitoringMetrics$metrics$values.fromJson( + (e as Map))) + .toList(), + $__typename: (l$$__typename as String), + ); + } + + final String metricId; + + final List values; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$metricId = metricId; + _resultData['metricId'] = l$metricId; + final l$values = values; + _resultData['values'] = l$values.map((e) => e.toJson()).toList(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$metricId = metricId; + final l$values = values; + final l$$__typename = $__typename; + return Object.hashAll([ + l$metricId, + Object.hashAll(l$values.map((v) => v)), + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Fragment$MonitoringMetrics$metrics) || + runtimeType != other.runtimeType) { + return false; + } + final l$metricId = metricId; + final lOther$metricId = other.metricId; + if (l$metricId != lOther$metricId) { + return false; + } + final l$values = values; + final lOther$values = other.values; + if (l$values.length != lOther$values.length) { + return false; + } + for (int i = 0; i < l$values.length; i++) { + final l$values$entry = l$values[i]; + final lOther$values$entry = lOther$values[i]; + if (l$values$entry != lOther$values$entry) { + return false; + } + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$MonitoringMetrics$metrics + on Fragment$MonitoringMetrics$metrics { + CopyWith$Fragment$MonitoringMetrics$metrics< + Fragment$MonitoringMetrics$metrics> + get copyWith => CopyWith$Fragment$MonitoringMetrics$metrics( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$MonitoringMetrics$metrics { + factory CopyWith$Fragment$MonitoringMetrics$metrics( + Fragment$MonitoringMetrics$metrics instance, + TRes Function(Fragment$MonitoringMetrics$metrics) then, + ) = _CopyWithImpl$Fragment$MonitoringMetrics$metrics; + + factory CopyWith$Fragment$MonitoringMetrics$metrics.stub(TRes res) = + _CopyWithStubImpl$Fragment$MonitoringMetrics$metrics; + + TRes call({ + String? metricId, + List? values, + String? $__typename, + }); + TRes values( + Iterable Function( + Iterable< + CopyWith$Fragment$MonitoringMetrics$metrics$values< + Fragment$MonitoringMetrics$metrics$values>>) + _fn); +} + +class _CopyWithImpl$Fragment$MonitoringMetrics$metrics + implements CopyWith$Fragment$MonitoringMetrics$metrics { + _CopyWithImpl$Fragment$MonitoringMetrics$metrics( + this._instance, + this._then, + ); + + final Fragment$MonitoringMetrics$metrics _instance; + + final TRes Function(Fragment$MonitoringMetrics$metrics) _then; + + static const _undefined = {}; + + TRes call({ + Object? metricId = _undefined, + Object? values = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$MonitoringMetrics$metrics( + metricId: metricId == _undefined || metricId == null + ? _instance.metricId + : (metricId as String), + values: values == _undefined || values == null + ? _instance.values + : (values as List), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + TRes values( + Iterable Function( + Iterable< + CopyWith$Fragment$MonitoringMetrics$metrics$values< + Fragment$MonitoringMetrics$metrics$values>>) + _fn) => + call( + values: _fn(_instance.values + .map((e) => CopyWith$Fragment$MonitoringMetrics$metrics$values( + e, + (i) => i, + ))).toList()); +} + +class _CopyWithStubImpl$Fragment$MonitoringMetrics$metrics + implements CopyWith$Fragment$MonitoringMetrics$metrics { + _CopyWithStubImpl$Fragment$MonitoringMetrics$metrics(this._res); + + TRes _res; + + call({ + String? metricId, + List? values, + String? $__typename, + }) => + _res; + + values(_fn) => _res; +} + +class Fragment$MonitoringMetrics$metrics$values { + Fragment$MonitoringMetrics$metrics$values({ + required this.timestamp, + required this.value, + this.$__typename = 'MonitoringValue', + }); + + factory Fragment$MonitoringMetrics$metrics$values.fromJson( + Map json) { + final l$timestamp = json['timestamp']; + final l$value = json['value']; + final l$$__typename = json['__typename']; + return Fragment$MonitoringMetrics$metrics$values( + timestamp: dateTimeFromJson(l$timestamp), + value: (l$value as String), + $__typename: (l$$__typename as String), + ); + } + + final DateTime timestamp; + + final String value; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$timestamp = timestamp; + _resultData['timestamp'] = dateTimeToJson(l$timestamp); + final l$value = value; + _resultData['value'] = l$value; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$timestamp = timestamp; + final l$value = value; + final l$$__typename = $__typename; + return Object.hashAll([ + l$timestamp, + l$value, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Fragment$MonitoringMetrics$metrics$values) || + runtimeType != other.runtimeType) { + return false; + } + final l$timestamp = timestamp; + final lOther$timestamp = other.timestamp; + if (l$timestamp != lOther$timestamp) { + return false; + } + final l$value = value; + final lOther$value = other.value; + if (l$value != lOther$value) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$MonitoringMetrics$metrics$values + on Fragment$MonitoringMetrics$metrics$values { + CopyWith$Fragment$MonitoringMetrics$metrics$values< + Fragment$MonitoringMetrics$metrics$values> + get copyWith => CopyWith$Fragment$MonitoringMetrics$metrics$values( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$MonitoringMetrics$metrics$values { + factory CopyWith$Fragment$MonitoringMetrics$metrics$values( + Fragment$MonitoringMetrics$metrics$values instance, + TRes Function(Fragment$MonitoringMetrics$metrics$values) then, + ) = _CopyWithImpl$Fragment$MonitoringMetrics$metrics$values; + + factory CopyWith$Fragment$MonitoringMetrics$metrics$values.stub(TRes res) = + _CopyWithStubImpl$Fragment$MonitoringMetrics$metrics$values; + + TRes call({ + DateTime? timestamp, + String? value, + String? $__typename, + }); +} + +class _CopyWithImpl$Fragment$MonitoringMetrics$metrics$values + implements CopyWith$Fragment$MonitoringMetrics$metrics$values { + _CopyWithImpl$Fragment$MonitoringMetrics$metrics$values( + this._instance, + this._then, + ); + + final Fragment$MonitoringMetrics$metrics$values _instance; + + final TRes Function(Fragment$MonitoringMetrics$metrics$values) _then; + + static const _undefined = {}; + + TRes call({ + Object? timestamp = _undefined, + Object? value = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$MonitoringMetrics$metrics$values( + timestamp: timestamp == _undefined || timestamp == null + ? _instance.timestamp + : (timestamp as DateTime), + value: value == _undefined || value == null + ? _instance.value + : (value as String), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Fragment$MonitoringMetrics$metrics$values + implements CopyWith$Fragment$MonitoringMetrics$metrics$values { + _CopyWithStubImpl$Fragment$MonitoringMetrics$metrics$values(this._res); + + TRes _res; + + call({ + DateTime? timestamp, + String? value, + String? $__typename, + }) => + _res; +} + +class Fragment$MonitoringValues { + Fragment$MonitoringValues({ + required this.values, + this.$__typename = 'MonitoringValues', + }); + + factory Fragment$MonitoringValues.fromJson(Map json) { + final l$values = json['values']; + final l$$__typename = json['__typename']; + return Fragment$MonitoringValues( + values: (l$values as List) + .map((e) => Fragment$MonitoringValues$values.fromJson( + (e as Map))) + .toList(), + $__typename: (l$$__typename as String), + ); + } + + final List values; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$values = values; + _resultData['values'] = l$values.map((e) => e.toJson()).toList(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$values = values; + final l$$__typename = $__typename; + return Object.hashAll([ + Object.hashAll(l$values.map((v) => v)), + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Fragment$MonitoringValues) || + runtimeType != other.runtimeType) { + return false; + } + final l$values = values; + final lOther$values = other.values; + if (l$values.length != lOther$values.length) { + return false; + } + for (int i = 0; i < l$values.length; i++) { + final l$values$entry = l$values[i]; + final lOther$values$entry = lOther$values[i]; + if (l$values$entry != lOther$values$entry) { + return false; + } + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$MonitoringValues + on Fragment$MonitoringValues { + CopyWith$Fragment$MonitoringValues get copyWith => + CopyWith$Fragment$MonitoringValues( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$MonitoringValues { + factory CopyWith$Fragment$MonitoringValues( + Fragment$MonitoringValues instance, + TRes Function(Fragment$MonitoringValues) then, + ) = _CopyWithImpl$Fragment$MonitoringValues; + + factory CopyWith$Fragment$MonitoringValues.stub(TRes res) = + _CopyWithStubImpl$Fragment$MonitoringValues; + + TRes call({ + List? values, + String? $__typename, + }); + TRes values( + Iterable Function( + Iterable< + CopyWith$Fragment$MonitoringValues$values< + Fragment$MonitoringValues$values>>) + _fn); +} + +class _CopyWithImpl$Fragment$MonitoringValues + implements CopyWith$Fragment$MonitoringValues { + _CopyWithImpl$Fragment$MonitoringValues( + this._instance, + this._then, + ); + + final Fragment$MonitoringValues _instance; + + final TRes Function(Fragment$MonitoringValues) _then; + + static const _undefined = {}; + + TRes call({ + Object? values = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$MonitoringValues( + values: values == _undefined || values == null + ? _instance.values + : (values as List), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + TRes values( + Iterable Function( + Iterable< + CopyWith$Fragment$MonitoringValues$values< + Fragment$MonitoringValues$values>>) + _fn) => + call( + values: _fn(_instance.values + .map((e) => CopyWith$Fragment$MonitoringValues$values( + e, + (i) => i, + ))).toList()); +} + +class _CopyWithStubImpl$Fragment$MonitoringValues + implements CopyWith$Fragment$MonitoringValues { + _CopyWithStubImpl$Fragment$MonitoringValues(this._res); + + TRes _res; + + call({ + List? values, + String? $__typename, + }) => + _res; + + values(_fn) => _res; +} + +const fragmentDefinitionMonitoringValues = FragmentDefinitionNode( + name: NameNode(value: 'MonitoringValues'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'MonitoringValues'), + isNonNull: false, + )), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'values'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'value'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'timestamp'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), +); +const documentNodeFragmentMonitoringValues = DocumentNode(definitions: [ + fragmentDefinitionMonitoringValues, +]); + +extension ClientExtension$Fragment$MonitoringValues on graphql.GraphQLClient { + void writeFragment$MonitoringValues({ + required Fragment$MonitoringValues data, + required Map idFields, + bool broadcast = true, + }) => + this.writeFragment( + graphql.FragmentRequest( + idFields: idFields, + fragment: const graphql.Fragment( + fragmentName: 'MonitoringValues', + document: documentNodeFragmentMonitoringValues, + ), + ), + data: data.toJson(), + broadcast: broadcast, + ); + Fragment$MonitoringValues? readFragment$MonitoringValues({ + required Map idFields, + bool optimistic = true, + }) { + final result = this.readFragment( + graphql.FragmentRequest( + idFields: idFields, + fragment: const graphql.Fragment( + fragmentName: 'MonitoringValues', + document: documentNodeFragmentMonitoringValues, + ), + ), + optimistic: optimistic, + ); + return result == null ? null : Fragment$MonitoringValues.fromJson(result); + } +} + +class Fragment$MonitoringValues$values { + Fragment$MonitoringValues$values({ + required this.value, + required this.timestamp, + this.$__typename = 'MonitoringValue', + }); + + factory Fragment$MonitoringValues$values.fromJson(Map json) { + final l$value = json['value']; + final l$timestamp = json['timestamp']; + final l$$__typename = json['__typename']; + return Fragment$MonitoringValues$values( + value: (l$value as String), + timestamp: dateTimeFromJson(l$timestamp), + $__typename: (l$$__typename as String), + ); + } + + final String value; + + final DateTime timestamp; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$value = value; + _resultData['value'] = l$value; + final l$timestamp = timestamp; + _resultData['timestamp'] = dateTimeToJson(l$timestamp); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$value = value; + final l$timestamp = timestamp; + final l$$__typename = $__typename; + return Object.hashAll([ + l$value, + l$timestamp, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Fragment$MonitoringValues$values) || + runtimeType != other.runtimeType) { + return false; + } + final l$value = value; + final lOther$value = other.value; + if (l$value != lOther$value) { + return false; + } + final l$timestamp = timestamp; + final lOther$timestamp = other.timestamp; + if (l$timestamp != lOther$timestamp) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$MonitoringValues$values + on Fragment$MonitoringValues$values { + CopyWith$Fragment$MonitoringValues$values + get copyWith => CopyWith$Fragment$MonitoringValues$values( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$MonitoringValues$values { + factory CopyWith$Fragment$MonitoringValues$values( + Fragment$MonitoringValues$values instance, + TRes Function(Fragment$MonitoringValues$values) then, + ) = _CopyWithImpl$Fragment$MonitoringValues$values; + + factory CopyWith$Fragment$MonitoringValues$values.stub(TRes res) = + _CopyWithStubImpl$Fragment$MonitoringValues$values; + + TRes call({ + String? value, + DateTime? timestamp, + String? $__typename, + }); +} + +class _CopyWithImpl$Fragment$MonitoringValues$values + implements CopyWith$Fragment$MonitoringValues$values { + _CopyWithImpl$Fragment$MonitoringValues$values( + this._instance, + this._then, + ); + + final Fragment$MonitoringValues$values _instance; + + final TRes Function(Fragment$MonitoringValues$values) _then; + + static const _undefined = {}; + + TRes call({ + Object? value = _undefined, + Object? timestamp = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$MonitoringValues$values( + value: value == _undefined || value == null + ? _instance.value + : (value as String), + timestamp: timestamp == _undefined || timestamp == null + ? _instance.timestamp + : (timestamp as DateTime), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Fragment$MonitoringValues$values + implements CopyWith$Fragment$MonitoringValues$values { + _CopyWithStubImpl$Fragment$MonitoringValues$values(this._res); + + TRes _res; + + call({ + String? value, + DateTime? timestamp, + String? $__typename, + }) => + _res; +} + +class Fragment$MonitoringQueryError { + Fragment$MonitoringQueryError({ + required this.error, + this.$__typename = 'MonitoringQueryError', + }); + + factory Fragment$MonitoringQueryError.fromJson(Map json) { + final l$error = json['error']; + final l$$__typename = json['__typename']; + return Fragment$MonitoringQueryError( + error: (l$error as String), + $__typename: (l$$__typename as String), + ); + } + + final String error; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$error = error; + _resultData['error'] = l$error; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$error = error; + final l$$__typename = $__typename; + return Object.hashAll([ + l$error, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Fragment$MonitoringQueryError) || + runtimeType != other.runtimeType) { + return false; + } + final l$error = error; + final lOther$error = other.error; + if (l$error != lOther$error) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$MonitoringQueryError + on Fragment$MonitoringQueryError { + CopyWith$Fragment$MonitoringQueryError + get copyWith => CopyWith$Fragment$MonitoringQueryError( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$MonitoringQueryError { + factory CopyWith$Fragment$MonitoringQueryError( + Fragment$MonitoringQueryError instance, + TRes Function(Fragment$MonitoringQueryError) then, + ) = _CopyWithImpl$Fragment$MonitoringQueryError; + + factory CopyWith$Fragment$MonitoringQueryError.stub(TRes res) = + _CopyWithStubImpl$Fragment$MonitoringQueryError; + + TRes call({ + String? error, + String? $__typename, + }); +} + +class _CopyWithImpl$Fragment$MonitoringQueryError + implements CopyWith$Fragment$MonitoringQueryError { + _CopyWithImpl$Fragment$MonitoringQueryError( + this._instance, + this._then, + ); + + final Fragment$MonitoringQueryError _instance; + + final TRes Function(Fragment$MonitoringQueryError) _then; + + static const _undefined = {}; + + TRes call({ + Object? error = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$MonitoringQueryError( + error: error == _undefined || error == null + ? _instance.error + : (error as String), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Fragment$MonitoringQueryError + implements CopyWith$Fragment$MonitoringQueryError { + _CopyWithStubImpl$Fragment$MonitoringQueryError(this._res); + + TRes _res; + + call({ + String? error, + String? $__typename, + }) => + _res; +} + +const fragmentDefinitionMonitoringQueryError = FragmentDefinitionNode( + name: NameNode(value: 'MonitoringQueryError'), + typeCondition: TypeConditionNode( + on: NamedTypeNode( + name: NameNode(value: 'MonitoringQueryError'), + isNonNull: false, + )), + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'error'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), +); +const documentNodeFragmentMonitoringQueryError = DocumentNode(definitions: [ + fragmentDefinitionMonitoringQueryError, +]); + +extension ClientExtension$Fragment$MonitoringQueryError + on graphql.GraphQLClient { + void writeFragment$MonitoringQueryError({ + required Fragment$MonitoringQueryError data, + required Map idFields, + bool broadcast = true, + }) => + this.writeFragment( + graphql.FragmentRequest( + idFields: idFields, + fragment: const graphql.Fragment( + fragmentName: 'MonitoringQueryError', + document: documentNodeFragmentMonitoringQueryError, + ), + ), + data: data.toJson(), + broadcast: broadcast, + ); + Fragment$MonitoringQueryError? readFragment$MonitoringQueryError({ + required Map idFields, + bool optimistic = true, + }) { + final result = this.readFragment( + graphql.FragmentRequest( + idFields: idFields, + fragment: const graphql.Fragment( + fragmentName: 'MonitoringQueryError', + document: documentNodeFragmentMonitoringQueryError, + ), + ), + optimistic: optimistic, + ); + return result == null + ? null + : Fragment$MonitoringQueryError.fromJson(result); + } +} + +class Variables$Query$GetOverallCpuAndNetworkMetrics { + factory Variables$Query$GetOverallCpuAndNetworkMetrics({ + DateTime? start, + DateTime? end, + required int step, + }) => + Variables$Query$GetOverallCpuAndNetworkMetrics._({ + if (start != null) r'start': start, + if (end != null) r'end': end, + r'step': step, + }); + + Variables$Query$GetOverallCpuAndNetworkMetrics._(this._$data); + + factory Variables$Query$GetOverallCpuAndNetworkMetrics.fromJson( + Map data) { + final result$data = {}; + if (data.containsKey('start')) { + final l$start = data['start']; + result$data['start'] = l$start == null ? null : dateTimeFromJson(l$start); + } + if (data.containsKey('end')) { + final l$end = data['end']; + result$data['end'] = l$end == null ? null : dateTimeFromJson(l$end); + } + final l$step = data['step']; + result$data['step'] = (l$step as int); + return Variables$Query$GetOverallCpuAndNetworkMetrics._(result$data); + } + + Map _$data; + + DateTime? get start => (_$data['start'] as DateTime?); + + DateTime? get end => (_$data['end'] as DateTime?); + + int get step => (_$data['step'] as int); + + Map toJson() { + final result$data = {}; + if (_$data.containsKey('start')) { + final l$start = start; + result$data['start'] = l$start == null ? null : dateTimeToJson(l$start); + } + if (_$data.containsKey('end')) { + final l$end = end; + result$data['end'] = l$end == null ? null : dateTimeToJson(l$end); + } + final l$step = step; + result$data['step'] = l$step; + return result$data; + } + + CopyWith$Variables$Query$GetOverallCpuAndNetworkMetrics< + Variables$Query$GetOverallCpuAndNetworkMetrics> + get copyWith => CopyWith$Variables$Query$GetOverallCpuAndNetworkMetrics( + this, + (i) => i, + ); + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Variables$Query$GetOverallCpuAndNetworkMetrics) || + runtimeType != other.runtimeType) { + return false; + } + final l$start = start; + final lOther$start = other.start; + if (_$data.containsKey('start') != other._$data.containsKey('start')) { + return false; + } + if (l$start != lOther$start) { + return false; + } + final l$end = end; + final lOther$end = other.end; + if (_$data.containsKey('end') != other._$data.containsKey('end')) { + return false; + } + if (l$end != lOther$end) { + return false; + } + final l$step = step; + final lOther$step = other.step; + if (l$step != lOther$step) { + return false; + } + return true; + } + + @override + int get hashCode { + final l$start = start; + final l$end = end; + final l$step = step; + return Object.hashAll([ + _$data.containsKey('start') ? l$start : const {}, + _$data.containsKey('end') ? l$end : const {}, + l$step, + ]); + } +} + +abstract class CopyWith$Variables$Query$GetOverallCpuAndNetworkMetrics { + factory CopyWith$Variables$Query$GetOverallCpuAndNetworkMetrics( + Variables$Query$GetOverallCpuAndNetworkMetrics instance, + TRes Function(Variables$Query$GetOverallCpuAndNetworkMetrics) then, + ) = _CopyWithImpl$Variables$Query$GetOverallCpuAndNetworkMetrics; + + factory CopyWith$Variables$Query$GetOverallCpuAndNetworkMetrics.stub( + TRes res) = + _CopyWithStubImpl$Variables$Query$GetOverallCpuAndNetworkMetrics; + + TRes call({ + DateTime? start, + DateTime? end, + int? step, + }); +} + +class _CopyWithImpl$Variables$Query$GetOverallCpuAndNetworkMetrics + implements CopyWith$Variables$Query$GetOverallCpuAndNetworkMetrics { + _CopyWithImpl$Variables$Query$GetOverallCpuAndNetworkMetrics( + this._instance, + this._then, + ); + + final Variables$Query$GetOverallCpuAndNetworkMetrics _instance; + + final TRes Function(Variables$Query$GetOverallCpuAndNetworkMetrics) _then; + + static const _undefined = {}; + + TRes call({ + Object? start = _undefined, + Object? end = _undefined, + Object? step = _undefined, + }) => + _then(Variables$Query$GetOverallCpuAndNetworkMetrics._({ + ..._instance._$data, + if (start != _undefined) 'start': (start as DateTime?), + if (end != _undefined) 'end': (end as DateTime?), + if (step != _undefined && step != null) 'step': (step as int), + })); +} + +class _CopyWithStubImpl$Variables$Query$GetOverallCpuAndNetworkMetrics + implements CopyWith$Variables$Query$GetOverallCpuAndNetworkMetrics { + _CopyWithStubImpl$Variables$Query$GetOverallCpuAndNetworkMetrics(this._res); + + TRes _res; + + call({ + DateTime? start, + DateTime? end, + int? step, + }) => + _res; +} + +class Query$GetOverallCpuAndNetworkMetrics { + Query$GetOverallCpuAndNetworkMetrics({ + required this.monitoring, + this.$__typename = 'Query', + }); + + factory Query$GetOverallCpuAndNetworkMetrics.fromJson( + Map json) { + final l$monitoring = json['monitoring']; + final l$$__typename = json['__typename']; + return Query$GetOverallCpuAndNetworkMetrics( + monitoring: Query$GetOverallCpuAndNetworkMetrics$monitoring.fromJson( + (l$monitoring as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Query$GetOverallCpuAndNetworkMetrics$monitoring monitoring; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$monitoring = monitoring; + _resultData['monitoring'] = l$monitoring.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$monitoring = monitoring; + final l$$__typename = $__typename; + return Object.hashAll([ + l$monitoring, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$GetOverallCpuAndNetworkMetrics) || + runtimeType != other.runtimeType) { + return false; + } + final l$monitoring = monitoring; + final lOther$monitoring = other.monitoring; + if (l$monitoring != lOther$monitoring) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetOverallCpuAndNetworkMetrics + on Query$GetOverallCpuAndNetworkMetrics { + CopyWith$Query$GetOverallCpuAndNetworkMetrics< + Query$GetOverallCpuAndNetworkMetrics> + get copyWith => CopyWith$Query$GetOverallCpuAndNetworkMetrics( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetOverallCpuAndNetworkMetrics { + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics( + Query$GetOverallCpuAndNetworkMetrics instance, + TRes Function(Query$GetOverallCpuAndNetworkMetrics) then, + ) = _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics; + + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics.stub(TRes res) = + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics; + + TRes call({ + Query$GetOverallCpuAndNetworkMetrics$monitoring? monitoring, + String? $__typename, + }); + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring get monitoring; +} + +class _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics + implements CopyWith$Query$GetOverallCpuAndNetworkMetrics { + _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics( + this._instance, + this._then, + ); + + final Query$GetOverallCpuAndNetworkMetrics _instance; + + final TRes Function(Query$GetOverallCpuAndNetworkMetrics) _then; + + static const _undefined = {}; + + TRes call({ + Object? monitoring = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$GetOverallCpuAndNetworkMetrics( + monitoring: monitoring == _undefined || monitoring == null + ? _instance.monitoring + : (monitoring as Query$GetOverallCpuAndNetworkMetrics$monitoring), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring + get monitoring { + final local$monitoring = _instance.monitoring; + return CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring( + local$monitoring, (e) => call(monitoring: e)); + } +} + +class _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics + implements CopyWith$Query$GetOverallCpuAndNetworkMetrics { + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics(this._res); + + TRes _res; + + call({ + Query$GetOverallCpuAndNetworkMetrics$monitoring? monitoring, + String? $__typename, + }) => + _res; + + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring + get monitoring => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring.stub(_res); +} + +const documentNodeQueryGetOverallCpuAndNetworkMetrics = + DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'GetOverallCpuAndNetworkMetrics'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'start')), + type: NamedTypeNode( + name: NameNode(value: 'DateTime'), + isNonNull: false, + ), + defaultValue: DefaultValueNode(value: null), + directives: [], + ), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'end')), + type: NamedTypeNode( + name: NameNode(value: 'DateTime'), + isNonNull: false, + ), + defaultValue: DefaultValueNode(value: null), + directives: [], + ), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'step')), + type: NamedTypeNode( + name: NameNode(value: 'Int'), + isNonNull: true, + ), + defaultValue: DefaultValueNode(value: null), + directives: [], + ), + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'monitoring'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'cpuUsage'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'start'), + value: VariableNode(name: NameNode(value: 'start')), + ), + ArgumentNode( + name: NameNode(value: 'end'), + value: VariableNode(name: NameNode(value: 'end')), + ), + ArgumentNode( + name: NameNode(value: 'step'), + value: VariableNode(name: NameNode(value: 'step')), + ), + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'overallUsage'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'MonitoringQueryError'), + directives: [], + ), + FragmentSpreadNode( + name: NameNode(value: 'MonitoringValues'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: 'networkUsage'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'start'), + value: VariableNode(name: NameNode(value: 'start')), + ), + ArgumentNode( + name: NameNode(value: 'end'), + value: VariableNode(name: NameNode(value: 'end')), + ), + ArgumentNode( + name: NameNode(value: 'step'), + value: VariableNode(name: NameNode(value: 'step')), + ), + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'overallUsage'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'MonitoringQueryError'), + directives: [], + ), + FragmentSpreadNode( + name: NameNode(value: 'MonitoringMetrics'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + fragmentDefinitionMonitoringQueryError, + fragmentDefinitionMonitoringValues, + fragmentDefinitionMonitoringMetrics, +]); +Query$GetOverallCpuAndNetworkMetrics + _parserFn$Query$GetOverallCpuAndNetworkMetrics(Map data) => + Query$GetOverallCpuAndNetworkMetrics.fromJson(data); +typedef OnQueryComplete$Query$GetOverallCpuAndNetworkMetrics = FutureOr + Function( + Map?, + Query$GetOverallCpuAndNetworkMetrics?, +); + +class Options$Query$GetOverallCpuAndNetworkMetrics + extends graphql.QueryOptions { + Options$Query$GetOverallCpuAndNetworkMetrics({ + String? operationName, + required Variables$Query$GetOverallCpuAndNetworkMetrics variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Query$GetOverallCpuAndNetworkMetrics? typedOptimisticResult, + Duration? pollInterval, + graphql.Context? context, + OnQueryComplete$Query$GetOverallCpuAndNetworkMetrics? onComplete, + graphql.OnQueryError? onError, + }) : onCompleteWithParsed = onComplete, + super( + variables: variables.toJson(), + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + pollInterval: pollInterval, + context: context, + onComplete: onComplete == null + ? null + : (data) => onComplete( + data, + data == null + ? null + : _parserFn$Query$GetOverallCpuAndNetworkMetrics(data), + ), + onError: onError, + document: documentNodeQueryGetOverallCpuAndNetworkMetrics, + parserFn: _parserFn$Query$GetOverallCpuAndNetworkMetrics, + ); + + final OnQueryComplete$Query$GetOverallCpuAndNetworkMetrics? + onCompleteWithParsed; + + @override + List get properties => [ + ...super.onComplete == null + ? super.properties + : super.properties.where((property) => property != onComplete), + onCompleteWithParsed, + ]; +} + +class WatchOptions$Query$GetOverallCpuAndNetworkMetrics + extends graphql.WatchQueryOptions { + WatchOptions$Query$GetOverallCpuAndNetworkMetrics({ + String? operationName, + required Variables$Query$GetOverallCpuAndNetworkMetrics variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Query$GetOverallCpuAndNetworkMetrics? typedOptimisticResult, + graphql.Context? context, + Duration? pollInterval, + bool? eagerlyFetchResults, + bool carryForwardDataOnException = true, + bool fetchResults = false, + }) : super( + variables: variables.toJson(), + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + document: documentNodeQueryGetOverallCpuAndNetworkMetrics, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Query$GetOverallCpuAndNetworkMetrics, + ); +} + +class FetchMoreOptions$Query$GetOverallCpuAndNetworkMetrics + extends graphql.FetchMoreOptions { + FetchMoreOptions$Query$GetOverallCpuAndNetworkMetrics({ + required graphql.UpdateQuery updateQuery, + required Variables$Query$GetOverallCpuAndNetworkMetrics variables, + }) : super( + updateQuery: updateQuery, + variables: variables.toJson(), + document: documentNodeQueryGetOverallCpuAndNetworkMetrics, + ); +} + +extension ClientExtension$Query$GetOverallCpuAndNetworkMetrics + on graphql.GraphQLClient { + Future> + query$GetOverallCpuAndNetworkMetrics( + Options$Query$GetOverallCpuAndNetworkMetrics options) async => + await this.query(options); + graphql.ObservableQuery + watchQuery$GetOverallCpuAndNetworkMetrics( + WatchOptions$Query$GetOverallCpuAndNetworkMetrics options) => + this.watchQuery(options); + void writeQuery$GetOverallCpuAndNetworkMetrics({ + required Query$GetOverallCpuAndNetworkMetrics data, + required Variables$Query$GetOverallCpuAndNetworkMetrics variables, + bool broadcast = true, + }) => + this.writeQuery( + graphql.Request( + operation: graphql.Operation( + document: documentNodeQueryGetOverallCpuAndNetworkMetrics), + variables: variables.toJson(), + ), + data: data.toJson(), + broadcast: broadcast, + ); + Query$GetOverallCpuAndNetworkMetrics? + readQuery$GetOverallCpuAndNetworkMetrics({ + required Variables$Query$GetOverallCpuAndNetworkMetrics variables, + bool optimistic = true, + }) { + final result = this.readQuery( + graphql.Request( + operation: graphql.Operation( + document: documentNodeQueryGetOverallCpuAndNetworkMetrics), + variables: variables.toJson(), + ), + optimistic: optimistic, + ); + return result == null + ? null + : Query$GetOverallCpuAndNetworkMetrics.fromJson(result); + } +} + +class Query$GetOverallCpuAndNetworkMetrics$monitoring { + Query$GetOverallCpuAndNetworkMetrics$monitoring({ + required this.cpuUsage, + required this.networkUsage, + this.$__typename = 'Monitoring', + }); + + factory Query$GetOverallCpuAndNetworkMetrics$monitoring.fromJson( + Map json) { + final l$cpuUsage = json['cpuUsage']; + final l$networkUsage = json['networkUsage']; + final l$$__typename = json['__typename']; + return Query$GetOverallCpuAndNetworkMetrics$monitoring( + cpuUsage: + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage.fromJson( + (l$cpuUsage as Map)), + networkUsage: + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage.fromJson( + (l$networkUsage as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage cpuUsage; + + final Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage + networkUsage; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$cpuUsage = cpuUsage; + _resultData['cpuUsage'] = l$cpuUsage.toJson(); + final l$networkUsage = networkUsage; + _resultData['networkUsage'] = l$networkUsage.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$cpuUsage = cpuUsage; + final l$networkUsage = networkUsage; + final l$$__typename = $__typename; + return Object.hashAll([ + l$cpuUsage, + l$networkUsage, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$GetOverallCpuAndNetworkMetrics$monitoring) || + runtimeType != other.runtimeType) { + return false; + } + final l$cpuUsage = cpuUsage; + final lOther$cpuUsage = other.cpuUsage; + if (l$cpuUsage != lOther$cpuUsage) { + return false; + } + final l$networkUsage = networkUsage; + final lOther$networkUsage = other.networkUsage; + if (l$networkUsage != lOther$networkUsage) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetOverallCpuAndNetworkMetrics$monitoring + on Query$GetOverallCpuAndNetworkMetrics$monitoring { + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring< + Query$GetOverallCpuAndNetworkMetrics$monitoring> + get copyWith => CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring { + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring( + Query$GetOverallCpuAndNetworkMetrics$monitoring instance, + TRes Function(Query$GetOverallCpuAndNetworkMetrics$monitoring) then, + ) = _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring; + + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring.stub( + TRes res) = + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring; + + TRes call({ + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage? cpuUsage, + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage? networkUsage, + String? $__typename, + }); + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage + get cpuUsage; + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage + get networkUsage; +} + +class _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring + implements CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring { + _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring( + this._instance, + this._then, + ); + + final Query$GetOverallCpuAndNetworkMetrics$monitoring _instance; + + final TRes Function(Query$GetOverallCpuAndNetworkMetrics$monitoring) _then; + + static const _undefined = {}; + + TRes call({ + Object? cpuUsage = _undefined, + Object? networkUsage = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$GetOverallCpuAndNetworkMetrics$monitoring( + cpuUsage: cpuUsage == _undefined || cpuUsage == null + ? _instance.cpuUsage + : (cpuUsage + as Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage), + networkUsage: networkUsage == _undefined || networkUsage == null + ? _instance.networkUsage + : (networkUsage + as Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage + get cpuUsage { + final local$cpuUsage = _instance.cpuUsage; + return CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage( + local$cpuUsage, (e) => call(cpuUsage: e)); + } + + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage + get networkUsage { + final local$networkUsage = _instance.networkUsage; + return CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage( + local$networkUsage, (e) => call(networkUsage: e)); + } +} + +class _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring + implements CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring { + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring(this._res); + + TRes _res; + + call({ + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage? cpuUsage, + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage? networkUsage, + String? $__typename, + }) => + _res; + + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage + get cpuUsage => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage + .stub(_res); + + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage + get networkUsage => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage + .stub(_res); +} + +class Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage { + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage({ + required this.overallUsage, + this.$__typename = 'CpuMonitoring', + }); + + factory Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage.fromJson( + Map json) { + final l$overallUsage = json['overallUsage']; + final l$$__typename = json['__typename']; + return Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage( + overallUsage: + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage + .fromJson((l$overallUsage as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage + overallUsage; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$overallUsage = overallUsage; + _resultData['overallUsage'] = l$overallUsage.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$overallUsage = overallUsage; + final l$$__typename = $__typename; + return Object.hashAll([ + l$overallUsage, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage) || + runtimeType != other.runtimeType) { + return false; + } + final l$overallUsage = overallUsage; + final lOther$overallUsage = other.overallUsage; + if (l$overallUsage != lOther$overallUsage) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage + on Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage { + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage< + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage> + get copyWith => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage< + TRes> { + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage instance, + TRes Function(Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage) + then, + ) = _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage; + + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage.stub( + TRes res) = + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage; + + TRes call({ + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage? + overallUsage, + String? $__typename, + }); + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage< + TRes> get overallUsage; +} + +class _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage< + TRes> { + _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage( + this._instance, + this._then, + ); + + final Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage _instance; + + final TRes Function(Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage) + _then; + + static const _undefined = {}; + + TRes call({ + Object? overallUsage = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage( + overallUsage: overallUsage == _undefined || overallUsage == null + ? _instance.overallUsage + : (overallUsage + as Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage< + TRes> get overallUsage { + final local$overallUsage = _instance.overallUsage; + return CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage( + local$overallUsage, (e) => call(overallUsage: e)); + } +} + +class _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage< + TRes> { + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage( + this._res); + + TRes _res; + + call({ + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage? + overallUsage, + String? $__typename, + }) => + _res; + + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage< + TRes> + get overallUsage => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage + .stub(_res); +} + +class Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage { + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage( + {required this.$__typename}); + + factory Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage.fromJson( + Map json) { + switch (json["__typename"] as String) { + case "MonitoringValues": + return Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues + .fromJson(json); + + case "MonitoringQueryError": + return Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError + .fromJson(json); + + default: + final l$$__typename = json['__typename']; + return Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage( + $__typename: (l$$__typename as String)); + } + } + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$$__typename = $__typename; + return Object.hashAll([l$$__typename]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage) || + runtimeType != other.runtimeType) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage + on Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage { + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage< + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage> + get copyWith => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage( + this, + (i) => i, + ); + _T when<_T>({ + required _T Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues) + monitoringValues, + required _T Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError) + monitoringQueryError, + required _T Function() orElse, + }) { + switch ($__typename) { + case "MonitoringValues": + return monitoringValues(this + as Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues); + + case "MonitoringQueryError": + return monitoringQueryError(this + as Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError); + + default: + return orElse(); + } + } + + _T maybeWhen<_T>({ + _T Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues)? + monitoringValues, + _T Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError)? + monitoringQueryError, + required _T Function() orElse, + }) { + switch ($__typename) { + case "MonitoringValues": + if (monitoringValues != null) { + return monitoringValues(this + as Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues); + } else { + return orElse(); + } + + case "MonitoringQueryError": + if (monitoringQueryError != null) { + return monitoringQueryError(this + as Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError); + } else { + return orElse(); + } + + default: + return orElse(); + } + } +} + +abstract class CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage< + TRes> { + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage + instance, + TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage) + then, + ) = _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage; + + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage.stub( + TRes res) = + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage; + + TRes call({String? $__typename}); +} + +class _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage< + TRes> { + _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage( + this._instance, + this._then, + ); + + final Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage + _instance; + + final TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage) + _then; + + static const _undefined = {}; + + TRes call({Object? $__typename = _undefined}) => _then( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage( + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String))); +} + +class _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage< + TRes> { + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage( + this._res); + + TRes _res; + + call({String? $__typename}) => _res; +} + +class Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues + implements + Fragment$MonitoringValues, + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage { + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues({ + required this.values, + this.$__typename = 'MonitoringValues', + }); + + factory Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues.fromJson( + Map json) { + final l$values = json['values']; + final l$$__typename = json['__typename']; + return Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues( + values: (l$values as List) + .map((e) => + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values + .fromJson((e as Map))) + .toList(), + $__typename: (l$$__typename as String), + ); + } + + final List< + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values> + values; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$values = values; + _resultData['values'] = l$values.map((e) => e.toJson()).toList(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$values = values; + final l$$__typename = $__typename; + return Object.hashAll([ + Object.hashAll(l$values.map((v) => v)), + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues) || + runtimeType != other.runtimeType) { + return false; + } + final l$values = values; + final lOther$values = other.values; + if (l$values.length != lOther$values.length) { + return false; + } + for (int i = 0; i < l$values.length; i++) { + final l$values$entry = l$values[i]; + final lOther$values$entry = lOther$values[i]; + if (l$values$entry != lOther$values$entry) { + return false; + } + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues + on Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues { + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues< + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues> + get copyWith => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues< + TRes> { + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues + instance, + TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues) + then, + ) = _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues; + + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues.stub( + TRes res) = + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues; + + TRes call({ + List? + values, + String? $__typename, + }); + TRes values( + Iterable Function( + Iterable< + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values< + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values>>) + _fn); +} + +class _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues< + TRes> { + _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues( + this._instance, + this._then, + ); + + final Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues + _instance; + + final TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues) + _then; + + static const _undefined = {}; + + TRes call({ + Object? values = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues( + values: values == _undefined || values == null + ? _instance.values + : (values as List< + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values>), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + TRes values( + Iterable Function( + Iterable< + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values< + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values>>) + _fn) => + call( + values: _fn(_instance.values.map((e) => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values( + e, + (i) => i, + ))).toList()); +} + +class _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues< + TRes> { + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues( + this._res); + + TRes _res; + + call({ + List? + values, + String? $__typename, + }) => + _res; + + values(_fn) => _res; +} + +class Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values + implements Fragment$MonitoringValues$values { + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values({ + required this.value, + required this.timestamp, + this.$__typename = 'MonitoringValue', + }); + + factory Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values.fromJson( + Map json) { + final l$value = json['value']; + final l$timestamp = json['timestamp']; + final l$$__typename = json['__typename']; + return Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values( + value: (l$value as String), + timestamp: dateTimeFromJson(l$timestamp), + $__typename: (l$$__typename as String), + ); + } + + final String value; + + final DateTime timestamp; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$value = value; + _resultData['value'] = l$value; + final l$timestamp = timestamp; + _resultData['timestamp'] = dateTimeToJson(l$timestamp); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$value = value; + final l$timestamp = timestamp; + final l$$__typename = $__typename; + return Object.hashAll([ + l$value, + l$timestamp, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values) || + runtimeType != other.runtimeType) { + return false; + } + final l$value = value; + final lOther$value = other.value; + if (l$value != lOther$value) { + return false; + } + final l$timestamp = timestamp; + final lOther$timestamp = other.timestamp; + if (l$timestamp != lOther$timestamp) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values + on Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values { + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values< + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values> + get copyWith => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values< + TRes> { + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values + instance, + TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values) + then, + ) = _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values; + + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values.stub( + TRes res) = + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values; + + TRes call({ + String? value, + DateTime? timestamp, + String? $__typename, + }); +} + +class _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values< + TRes> { + _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values( + this._instance, + this._then, + ); + + final Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values + _instance; + + final TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values) + _then; + + static const _undefined = {}; + + TRes call({ + Object? value = _undefined, + Object? timestamp = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values( + value: value == _undefined || value == null + ? _instance.value + : (value as String), + timestamp: timestamp == _undefined || timestamp == null + ? _instance.timestamp + : (timestamp as DateTime), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values< + TRes> { + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringValues$values( + this._res); + + TRes _res; + + call({ + String? value, + DateTime? timestamp, + String? $__typename, + }) => + _res; +} + +class Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError + implements + Fragment$MonitoringQueryError, + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage { + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError({ + required this.error, + this.$__typename = 'MonitoringQueryError', + }); + + factory Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError.fromJson( + Map json) { + final l$error = json['error']; + final l$$__typename = json['__typename']; + return Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError( + error: (l$error as String), + $__typename: (l$$__typename as String), + ); + } + + final String error; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$error = error; + _resultData['error'] = l$error; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$error = error; + final l$$__typename = $__typename; + return Object.hashAll([ + l$error, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError) || + runtimeType != other.runtimeType) { + return false; + } + final l$error = error; + final lOther$error = other.error; + if (l$error != lOther$error) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError + on Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError { + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError< + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError> + get copyWith => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError< + TRes> { + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError + instance, + TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError) + then, + ) = _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError; + + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError.stub( + TRes res) = + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError; + + TRes call({ + String? error, + String? $__typename, + }); +} + +class _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError< + TRes> { + _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError( + this._instance, + this._then, + ); + + final Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError + _instance; + + final TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError) + _then; + + static const _undefined = {}; + + TRes call({ + Object? error = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError( + error: error == _undefined || error == null + ? _instance.error + : (error as String), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError< + TRes> { + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$cpuUsage$overallUsage$$MonitoringQueryError( + this._res); + + TRes _res; + + call({ + String? error, + String? $__typename, + }) => + _res; +} + +class Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage { + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage({ + required this.overallUsage, + this.$__typename = 'NetworkMonitoring', + }); + + factory Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage.fromJson( + Map json) { + final l$overallUsage = json['overallUsage']; + final l$$__typename = json['__typename']; + return Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage( + overallUsage: + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage + .fromJson((l$overallUsage as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage + overallUsage; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$overallUsage = overallUsage; + _resultData['overallUsage'] = l$overallUsage.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$overallUsage = overallUsage; + final l$$__typename = $__typename; + return Object.hashAll([ + l$overallUsage, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage) || + runtimeType != other.runtimeType) { + return false; + } + final l$overallUsage = overallUsage; + final lOther$overallUsage = other.overallUsage; + if (l$overallUsage != lOther$overallUsage) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage + on Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage { + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage< + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage> + get copyWith => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage< + TRes> { + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage instance, + TRes Function(Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage) + then, + ) = _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage; + + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage.stub( + TRes res) = + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage; + + TRes call({ + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage? + overallUsage, + String? $__typename, + }); + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage< + TRes> get overallUsage; +} + +class _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage< + TRes> { + _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage( + this._instance, + this._then, + ); + + final Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage _instance; + + final TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage) _then; + + static const _undefined = {}; + + TRes call({ + Object? overallUsage = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage( + overallUsage: overallUsage == _undefined || overallUsage == null + ? _instance.overallUsage + : (overallUsage + as Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage< + TRes> get overallUsage { + final local$overallUsage = _instance.overallUsage; + return CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage( + local$overallUsage, (e) => call(overallUsage: e)); + } +} + +class _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage< + TRes> { + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage( + this._res); + + TRes _res; + + call({ + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage? + overallUsage, + String? $__typename, + }) => + _res; + + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage< + TRes> + get overallUsage => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage + .stub(_res); +} + +class Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage { + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage( + {required this.$__typename}); + + factory Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage.fromJson( + Map json) { + switch (json["__typename"] as String) { + case "MonitoringMetrics": + return Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics + .fromJson(json); + + case "MonitoringQueryError": + return Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError + .fromJson(json); + + default: + final l$$__typename = json['__typename']; + return Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage( + $__typename: (l$$__typename as String)); + } + } + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$$__typename = $__typename; + return Object.hashAll([l$$__typename]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage) || + runtimeType != other.runtimeType) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage + on Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage { + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage< + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage> + get copyWith => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage( + this, + (i) => i, + ); + _T when<_T>({ + required _T Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics) + monitoringMetrics, + required _T Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError) + monitoringQueryError, + required _T Function() orElse, + }) { + switch ($__typename) { + case "MonitoringMetrics": + return monitoringMetrics(this + as Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics); + + case "MonitoringQueryError": + return monitoringQueryError(this + as Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError); + + default: + return orElse(); + } + } + + _T maybeWhen<_T>({ + _T Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics)? + monitoringMetrics, + _T Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError)? + monitoringQueryError, + required _T Function() orElse, + }) { + switch ($__typename) { + case "MonitoringMetrics": + if (monitoringMetrics != null) { + return monitoringMetrics(this + as Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics); + } else { + return orElse(); + } + + case "MonitoringQueryError": + if (monitoringQueryError != null) { + return monitoringQueryError(this + as Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError); + } else { + return orElse(); + } + + default: + return orElse(); + } + } +} + +abstract class CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage< + TRes> { + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage + instance, + TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage) + then, + ) = _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage; + + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage.stub( + TRes res) = + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage; + + TRes call({String? $__typename}); +} + +class _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage< + TRes> { + _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage( + this._instance, + this._then, + ); + + final Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage + _instance; + + final TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage) + _then; + + static const _undefined = {}; + + TRes call({Object? $__typename = _undefined}) => _then( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage( + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String))); +} + +class _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage< + TRes> { + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage( + this._res); + + TRes _res; + + call({String? $__typename}) => _res; +} + +class Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics + implements + Fragment$MonitoringMetrics, + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage { + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics({ + required this.metrics, + this.$__typename = 'MonitoringMetrics', + }); + + factory Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics.fromJson( + Map json) { + final l$metrics = json['metrics']; + final l$$__typename = json['__typename']; + return Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics( + metrics: (l$metrics as List) + .map((e) => + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics + .fromJson((e as Map))) + .toList(), + $__typename: (l$$__typename as String), + ); + } + + final List< + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics> + metrics; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$metrics = metrics; + _resultData['metrics'] = l$metrics.map((e) => e.toJson()).toList(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$metrics = metrics; + final l$$__typename = $__typename; + return Object.hashAll([ + Object.hashAll(l$metrics.map((v) => v)), + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics) || + runtimeType != other.runtimeType) { + return false; + } + final l$metrics = metrics; + final lOther$metrics = other.metrics; + if (l$metrics.length != lOther$metrics.length) { + return false; + } + for (int i = 0; i < l$metrics.length; i++) { + final l$metrics$entry = l$metrics[i]; + final lOther$metrics$entry = lOther$metrics[i]; + if (l$metrics$entry != lOther$metrics$entry) { + return false; + } + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics + on Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics { + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics< + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics> + get copyWith => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics< + TRes> { + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics + instance, + TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics) + then, + ) = _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics; + + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics.stub( + TRes res) = + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics; + + TRes call({ + List? + metrics, + String? $__typename, + }); + TRes metrics( + Iterable Function( + Iterable< + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics< + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics>>) + _fn); +} + +class _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics< + TRes> { + _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics( + this._instance, + this._then, + ); + + final Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics + _instance; + + final TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics) + _then; + + static const _undefined = {}; + + TRes call({ + Object? metrics = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics( + metrics: metrics == _undefined || metrics == null + ? _instance.metrics + : (metrics as List< + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics>), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + TRes metrics( + Iterable Function( + Iterable< + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics< + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics>>) + _fn) => + call( + metrics: _fn(_instance.metrics.map((e) => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics( + e, + (i) => i, + ))).toList()); +} + +class _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics< + TRes> { + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics( + this._res); + + TRes _res; + + call({ + List? + metrics, + String? $__typename, + }) => + _res; + + metrics(_fn) => _res; +} + +class Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics + implements Fragment$MonitoringMetrics$metrics { + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics({ + required this.metricId, + required this.values, + this.$__typename = 'MonitoringMetric', + }); + + factory Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics.fromJson( + Map json) { + final l$metricId = json['metricId']; + final l$values = json['values']; + final l$$__typename = json['__typename']; + return Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics( + metricId: (l$metricId as String), + values: (l$values as List) + .map((e) => + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values + .fromJson((e as Map))) + .toList(), + $__typename: (l$$__typename as String), + ); + } + + final String metricId; + + final List< + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values> + values; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$metricId = metricId; + _resultData['metricId'] = l$metricId; + final l$values = values; + _resultData['values'] = l$values.map((e) => e.toJson()).toList(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$metricId = metricId; + final l$values = values; + final l$$__typename = $__typename; + return Object.hashAll([ + l$metricId, + Object.hashAll(l$values.map((v) => v)), + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics) || + runtimeType != other.runtimeType) { + return false; + } + final l$metricId = metricId; + final lOther$metricId = other.metricId; + if (l$metricId != lOther$metricId) { + return false; + } + final l$values = values; + final lOther$values = other.values; + if (l$values.length != lOther$values.length) { + return false; + } + for (int i = 0; i < l$values.length; i++) { + final l$values$entry = l$values[i]; + final lOther$values$entry = lOther$values[i]; + if (l$values$entry != lOther$values$entry) { + return false; + } + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics + on Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics { + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics< + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics> + get copyWith => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics< + TRes> { + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics + instance, + TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics) + then, + ) = _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics; + + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics.stub( + TRes res) = + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics; + + TRes call({ + String? metricId, + List? + values, + String? $__typename, + }); + TRes values( + Iterable Function( + Iterable< + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values< + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values>>) + _fn); +} + +class _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics< + TRes> { + _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics( + this._instance, + this._then, + ); + + final Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics + _instance; + + final TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics) + _then; + + static const _undefined = {}; + + TRes call({ + Object? metricId = _undefined, + Object? values = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics( + metricId: metricId == _undefined || metricId == null + ? _instance.metricId + : (metricId as String), + values: values == _undefined || values == null + ? _instance.values + : (values as List< + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values>), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + TRes values( + Iterable Function( + Iterable< + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values< + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values>>) + _fn) => + call( + values: _fn(_instance.values.map((e) => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values( + e, + (i) => i, + ))).toList()); +} + +class _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics< + TRes> { + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics( + this._res); + + TRes _res; + + call({ + String? metricId, + List? + values, + String? $__typename, + }) => + _res; + + values(_fn) => _res; +} + +class Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values + implements Fragment$MonitoringMetrics$metrics$values { + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values({ + required this.timestamp, + required this.value, + this.$__typename = 'MonitoringValue', + }); + + factory Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values.fromJson( + Map json) { + final l$timestamp = json['timestamp']; + final l$value = json['value']; + final l$$__typename = json['__typename']; + return Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values( + timestamp: dateTimeFromJson(l$timestamp), + value: (l$value as String), + $__typename: (l$$__typename as String), + ); + } + + final DateTime timestamp; + + final String value; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$timestamp = timestamp; + _resultData['timestamp'] = dateTimeToJson(l$timestamp); + final l$value = value; + _resultData['value'] = l$value; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$timestamp = timestamp; + final l$value = value; + final l$$__typename = $__typename; + return Object.hashAll([ + l$timestamp, + l$value, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values) || + runtimeType != other.runtimeType) { + return false; + } + final l$timestamp = timestamp; + final lOther$timestamp = other.timestamp; + if (l$timestamp != lOther$timestamp) { + return false; + } + final l$value = value; + final lOther$value = other.value; + if (l$value != lOther$value) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values + on Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values { + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values< + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values> + get copyWith => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values< + TRes> { + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values + instance, + TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values) + then, + ) = _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values; + + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values.stub( + TRes res) = + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values; + + TRes call({ + DateTime? timestamp, + String? value, + String? $__typename, + }); +} + +class _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values< + TRes> { + _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values( + this._instance, + this._then, + ); + + final Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values + _instance; + + final TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values) + _then; + + static const _undefined = {}; + + TRes call({ + Object? timestamp = _undefined, + Object? value = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values( + timestamp: timestamp == _undefined || timestamp == null + ? _instance.timestamp + : (timestamp as DateTime), + value: value == _undefined || value == null + ? _instance.value + : (value as String), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values< + TRes> { + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringMetrics$metrics$values( + this._res); + + TRes _res; + + call({ + DateTime? timestamp, + String? value, + String? $__typename, + }) => + _res; +} + +class Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError + implements + Fragment$MonitoringQueryError, + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage { + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError({ + required this.error, + this.$__typename = 'MonitoringQueryError', + }); + + factory Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError.fromJson( + Map json) { + final l$error = json['error']; + final l$$__typename = json['__typename']; + return Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError( + error: (l$error as String), + $__typename: (l$$__typename as String), + ); + } + + final String error; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$error = error; + _resultData['error'] = l$error; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$error = error; + final l$$__typename = $__typename; + return Object.hashAll([ + l$error, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError) || + runtimeType != other.runtimeType) { + return false; + } + final l$error = error; + final lOther$error = other.error; + if (l$error != lOther$error) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError + on Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError { + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError< + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError> + get copyWith => + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError< + TRes> { + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError + instance, + TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError) + then, + ) = _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError; + + factory CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError.stub( + TRes res) = + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError; + + TRes call({ + String? error, + String? $__typename, + }); +} + +class _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError< + TRes> { + _CopyWithImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError( + this._instance, + this._then, + ); + + final Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError + _instance; + + final TRes Function( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError) + _then; + + static const _undefined = {}; + + TRes call({ + Object? error = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError( + error: error == _undefined || error == null + ? _instance.error + : (error as String), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError< + TRes> + implements + CopyWith$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError< + TRes> { + _CopyWithStubImpl$Query$GetOverallCpuAndNetworkMetrics$monitoring$networkUsage$overallUsage$$MonitoringQueryError( + this._res); + + TRes _res; + + call({ + String? error, + String? $__typename, + }) => + _res; +} + +class Variables$Query$GetMemoryMetrics { + factory Variables$Query$GetMemoryMetrics({ + DateTime? start, + DateTime? end, + required int step, + }) => + Variables$Query$GetMemoryMetrics._({ + if (start != null) r'start': start, + if (end != null) r'end': end, + r'step': step, + }); + + Variables$Query$GetMemoryMetrics._(this._$data); + + factory Variables$Query$GetMemoryMetrics.fromJson(Map data) { + final result$data = {}; + if (data.containsKey('start')) { + final l$start = data['start']; + result$data['start'] = l$start == null ? null : dateTimeFromJson(l$start); + } + if (data.containsKey('end')) { + final l$end = data['end']; + result$data['end'] = l$end == null ? null : dateTimeFromJson(l$end); + } + final l$step = data['step']; + result$data['step'] = (l$step as int); + return Variables$Query$GetMemoryMetrics._(result$data); + } + + Map _$data; + + DateTime? get start => (_$data['start'] as DateTime?); + + DateTime? get end => (_$data['end'] as DateTime?); + + int get step => (_$data['step'] as int); + + Map toJson() { + final result$data = {}; + if (_$data.containsKey('start')) { + final l$start = start; + result$data['start'] = l$start == null ? null : dateTimeToJson(l$start); + } + if (_$data.containsKey('end')) { + final l$end = end; + result$data['end'] = l$end == null ? null : dateTimeToJson(l$end); + } + final l$step = step; + result$data['step'] = l$step; + return result$data; + } + + CopyWith$Variables$Query$GetMemoryMetrics + get copyWith => CopyWith$Variables$Query$GetMemoryMetrics( + this, + (i) => i, + ); + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Variables$Query$GetMemoryMetrics) || + runtimeType != other.runtimeType) { + return false; + } + final l$start = start; + final lOther$start = other.start; + if (_$data.containsKey('start') != other._$data.containsKey('start')) { + return false; + } + if (l$start != lOther$start) { + return false; + } + final l$end = end; + final lOther$end = other.end; + if (_$data.containsKey('end') != other._$data.containsKey('end')) { + return false; + } + if (l$end != lOther$end) { + return false; + } + final l$step = step; + final lOther$step = other.step; + if (l$step != lOther$step) { + return false; + } + return true; + } + + @override + int get hashCode { + final l$start = start; + final l$end = end; + final l$step = step; + return Object.hashAll([ + _$data.containsKey('start') ? l$start : const {}, + _$data.containsKey('end') ? l$end : const {}, + l$step, + ]); + } +} + +abstract class CopyWith$Variables$Query$GetMemoryMetrics { + factory CopyWith$Variables$Query$GetMemoryMetrics( + Variables$Query$GetMemoryMetrics instance, + TRes Function(Variables$Query$GetMemoryMetrics) then, + ) = _CopyWithImpl$Variables$Query$GetMemoryMetrics; + + factory CopyWith$Variables$Query$GetMemoryMetrics.stub(TRes res) = + _CopyWithStubImpl$Variables$Query$GetMemoryMetrics; + + TRes call({ + DateTime? start, + DateTime? end, + int? step, + }); +} + +class _CopyWithImpl$Variables$Query$GetMemoryMetrics + implements CopyWith$Variables$Query$GetMemoryMetrics { + _CopyWithImpl$Variables$Query$GetMemoryMetrics( + this._instance, + this._then, + ); + + final Variables$Query$GetMemoryMetrics _instance; + + final TRes Function(Variables$Query$GetMemoryMetrics) _then; + + static const _undefined = {}; + + TRes call({ + Object? start = _undefined, + Object? end = _undefined, + Object? step = _undefined, + }) => + _then(Variables$Query$GetMemoryMetrics._({ + ..._instance._$data, + if (start != _undefined) 'start': (start as DateTime?), + if (end != _undefined) 'end': (end as DateTime?), + if (step != _undefined && step != null) 'step': (step as int), + })); +} + +class _CopyWithStubImpl$Variables$Query$GetMemoryMetrics + implements CopyWith$Variables$Query$GetMemoryMetrics { + _CopyWithStubImpl$Variables$Query$GetMemoryMetrics(this._res); + + TRes _res; + + call({ + DateTime? start, + DateTime? end, + int? step, + }) => + _res; +} + +class Query$GetMemoryMetrics { + Query$GetMemoryMetrics({ + required this.monitoring, + this.$__typename = 'Query', + }); + + factory Query$GetMemoryMetrics.fromJson(Map json) { + final l$monitoring = json['monitoring']; + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics( + monitoring: Query$GetMemoryMetrics$monitoring.fromJson( + (l$monitoring as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Query$GetMemoryMetrics$monitoring monitoring; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$monitoring = monitoring; + _resultData['monitoring'] = l$monitoring.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$monitoring = monitoring; + final l$$__typename = $__typename; + return Object.hashAll([ + l$monitoring, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$GetMemoryMetrics) || + runtimeType != other.runtimeType) { + return false; + } + final l$monitoring = monitoring; + final lOther$monitoring = other.monitoring; + if (l$monitoring != lOther$monitoring) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics on Query$GetMemoryMetrics { + CopyWith$Query$GetMemoryMetrics get copyWith => + CopyWith$Query$GetMemoryMetrics( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetMemoryMetrics { + factory CopyWith$Query$GetMemoryMetrics( + Query$GetMemoryMetrics instance, + TRes Function(Query$GetMemoryMetrics) then, + ) = _CopyWithImpl$Query$GetMemoryMetrics; + + factory CopyWith$Query$GetMemoryMetrics.stub(TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics; + + TRes call({ + Query$GetMemoryMetrics$monitoring? monitoring, + String? $__typename, + }); + CopyWith$Query$GetMemoryMetrics$monitoring get monitoring; +} + +class _CopyWithImpl$Query$GetMemoryMetrics + implements CopyWith$Query$GetMemoryMetrics { + _CopyWithImpl$Query$GetMemoryMetrics( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics _instance; + + final TRes Function(Query$GetMemoryMetrics) _then; + + static const _undefined = {}; + + TRes call({ + Object? monitoring = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$GetMemoryMetrics( + monitoring: monitoring == _undefined || monitoring == null + ? _instance.monitoring + : (monitoring as Query$GetMemoryMetrics$monitoring), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + CopyWith$Query$GetMemoryMetrics$monitoring get monitoring { + final local$monitoring = _instance.monitoring; + return CopyWith$Query$GetMemoryMetrics$monitoring( + local$monitoring, (e) => call(monitoring: e)); + } +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics + implements CopyWith$Query$GetMemoryMetrics { + _CopyWithStubImpl$Query$GetMemoryMetrics(this._res); + + TRes _res; + + call({ + Query$GetMemoryMetrics$monitoring? monitoring, + String? $__typename, + }) => + _res; + + CopyWith$Query$GetMemoryMetrics$monitoring get monitoring => + CopyWith$Query$GetMemoryMetrics$monitoring.stub(_res); +} + +const documentNodeQueryGetMemoryMetrics = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'GetMemoryMetrics'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'start')), + type: NamedTypeNode( + name: NameNode(value: 'DateTime'), + isNonNull: false, + ), + defaultValue: DefaultValueNode(value: null), + directives: [], + ), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'end')), + type: NamedTypeNode( + name: NameNode(value: 'DateTime'), + isNonNull: false, + ), + defaultValue: DefaultValueNode(value: null), + directives: [], + ), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'step')), + type: NamedTypeNode( + name: NameNode(value: 'Int'), + isNonNull: true, + ), + defaultValue: DefaultValueNode(value: null), + directives: [], + ), + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'monitoring'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'memoryUsage'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'start'), + value: VariableNode(name: NameNode(value: 'start')), + ), + ArgumentNode( + name: NameNode(value: 'end'), + value: VariableNode(name: NameNode(value: 'end')), + ), + ArgumentNode( + name: NameNode(value: 'step'), + value: VariableNode(name: NameNode(value: 'step')), + ), + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'overallUsage'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'MonitoringQueryError'), + directives: [], + ), + FragmentSpreadNode( + name: NameNode(value: 'MonitoringValues'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: 'averageUsageByService'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'MonitoringQueryError'), + directives: [], + ), + FragmentSpreadNode( + name: NameNode(value: 'MonitoringMetrics'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: 'maxUsageByService'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'MonitoringQueryError'), + directives: [], + ), + FragmentSpreadNode( + name: NameNode(value: 'MonitoringMetrics'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + fragmentDefinitionMonitoringQueryError, + fragmentDefinitionMonitoringValues, + fragmentDefinitionMonitoringMetrics, +]); +Query$GetMemoryMetrics _parserFn$Query$GetMemoryMetrics( + Map data) => + Query$GetMemoryMetrics.fromJson(data); +typedef OnQueryComplete$Query$GetMemoryMetrics = FutureOr Function( + Map?, + Query$GetMemoryMetrics?, +); + +class Options$Query$GetMemoryMetrics + extends graphql.QueryOptions { + Options$Query$GetMemoryMetrics({ + String? operationName, + required Variables$Query$GetMemoryMetrics variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Query$GetMemoryMetrics? typedOptimisticResult, + Duration? pollInterval, + graphql.Context? context, + OnQueryComplete$Query$GetMemoryMetrics? onComplete, + graphql.OnQueryError? onError, + }) : onCompleteWithParsed = onComplete, + super( + variables: variables.toJson(), + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + pollInterval: pollInterval, + context: context, + onComplete: onComplete == null + ? null + : (data) => onComplete( + data, + data == null + ? null + : _parserFn$Query$GetMemoryMetrics(data), + ), + onError: onError, + document: documentNodeQueryGetMemoryMetrics, + parserFn: _parserFn$Query$GetMemoryMetrics, + ); + + final OnQueryComplete$Query$GetMemoryMetrics? onCompleteWithParsed; + + @override + List get properties => [ + ...super.onComplete == null + ? super.properties + : super.properties.where((property) => property != onComplete), + onCompleteWithParsed, + ]; +} + +class WatchOptions$Query$GetMemoryMetrics + extends graphql.WatchQueryOptions { + WatchOptions$Query$GetMemoryMetrics({ + String? operationName, + required Variables$Query$GetMemoryMetrics variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Query$GetMemoryMetrics? typedOptimisticResult, + graphql.Context? context, + Duration? pollInterval, + bool? eagerlyFetchResults, + bool carryForwardDataOnException = true, + bool fetchResults = false, + }) : super( + variables: variables.toJson(), + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + document: documentNodeQueryGetMemoryMetrics, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Query$GetMemoryMetrics, + ); +} + +class FetchMoreOptions$Query$GetMemoryMetrics extends graphql.FetchMoreOptions { + FetchMoreOptions$Query$GetMemoryMetrics({ + required graphql.UpdateQuery updateQuery, + required Variables$Query$GetMemoryMetrics variables, + }) : super( + updateQuery: updateQuery, + variables: variables.toJson(), + document: documentNodeQueryGetMemoryMetrics, + ); +} + +extension ClientExtension$Query$GetMemoryMetrics on graphql.GraphQLClient { + Future> query$GetMemoryMetrics( + Options$Query$GetMemoryMetrics options) async => + await this.query(options); + graphql.ObservableQuery watchQuery$GetMemoryMetrics( + WatchOptions$Query$GetMemoryMetrics options) => + this.watchQuery(options); + void writeQuery$GetMemoryMetrics({ + required Query$GetMemoryMetrics data, + required Variables$Query$GetMemoryMetrics variables, + bool broadcast = true, + }) => + this.writeQuery( + graphql.Request( + operation: + graphql.Operation(document: documentNodeQueryGetMemoryMetrics), + variables: variables.toJson(), + ), + data: data.toJson(), + broadcast: broadcast, + ); + Query$GetMemoryMetrics? readQuery$GetMemoryMetrics({ + required Variables$Query$GetMemoryMetrics variables, + bool optimistic = true, + }) { + final result = this.readQuery( + graphql.Request( + operation: + graphql.Operation(document: documentNodeQueryGetMemoryMetrics), + variables: variables.toJson(), + ), + optimistic: optimistic, + ); + return result == null ? null : Query$GetMemoryMetrics.fromJson(result); + } +} + +class Query$GetMemoryMetrics$monitoring { + Query$GetMemoryMetrics$monitoring({ + required this.memoryUsage, + this.$__typename = 'Monitoring', + }); + + factory Query$GetMemoryMetrics$monitoring.fromJson( + Map json) { + final l$memoryUsage = json['memoryUsage']; + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring( + memoryUsage: Query$GetMemoryMetrics$monitoring$memoryUsage.fromJson( + (l$memoryUsage as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Query$GetMemoryMetrics$monitoring$memoryUsage memoryUsage; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$memoryUsage = memoryUsage; + _resultData['memoryUsage'] = l$memoryUsage.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$memoryUsage = memoryUsage; + final l$$__typename = $__typename; + return Object.hashAll([ + l$memoryUsage, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$GetMemoryMetrics$monitoring) || + runtimeType != other.runtimeType) { + return false; + } + final l$memoryUsage = memoryUsage; + final lOther$memoryUsage = other.memoryUsage; + if (l$memoryUsage != lOther$memoryUsage) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring + on Query$GetMemoryMetrics$monitoring { + CopyWith$Query$GetMemoryMetrics$monitoring + get copyWith => CopyWith$Query$GetMemoryMetrics$monitoring( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring { + factory CopyWith$Query$GetMemoryMetrics$monitoring( + Query$GetMemoryMetrics$monitoring instance, + TRes Function(Query$GetMemoryMetrics$monitoring) then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring; + + factory CopyWith$Query$GetMemoryMetrics$monitoring.stub(TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring; + + TRes call({ + Query$GetMemoryMetrics$monitoring$memoryUsage? memoryUsage, + String? $__typename, + }); + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage get memoryUsage; +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring + implements CopyWith$Query$GetMemoryMetrics$monitoring { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring _instance; + + final TRes Function(Query$GetMemoryMetrics$monitoring) _then; + + static const _undefined = {}; + + TRes call({ + Object? memoryUsage = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$GetMemoryMetrics$monitoring( + memoryUsage: memoryUsage == _undefined || memoryUsage == null + ? _instance.memoryUsage + : (memoryUsage as Query$GetMemoryMetrics$monitoring$memoryUsage), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage get memoryUsage { + final local$memoryUsage = _instance.memoryUsage; + return CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage( + local$memoryUsage, (e) => call(memoryUsage: e)); + } +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring + implements CopyWith$Query$GetMemoryMetrics$monitoring { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring(this._res); + + TRes _res; + + call({ + Query$GetMemoryMetrics$monitoring$memoryUsage? memoryUsage, + String? $__typename, + }) => + _res; + + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage + get memoryUsage => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage.stub(_res); +} + +class Query$GetMemoryMetrics$monitoring$memoryUsage { + Query$GetMemoryMetrics$monitoring$memoryUsage({ + required this.overallUsage, + required this.averageUsageByService, + required this.maxUsageByService, + this.$__typename = 'MemoryMonitoring', + }); + + factory Query$GetMemoryMetrics$monitoring$memoryUsage.fromJson( + Map json) { + final l$overallUsage = json['overallUsage']; + final l$averageUsageByService = json['averageUsageByService']; + final l$maxUsageByService = json['maxUsageByService']; + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring$memoryUsage( + overallUsage: + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage.fromJson( + (l$overallUsage as Map)), + averageUsageByService: + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService + .fromJson((l$averageUsageByService as Map)), + maxUsageByService: + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService + .fromJson((l$maxUsageByService as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage overallUsage; + + final Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService + averageUsageByService; + + final Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService + maxUsageByService; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$overallUsage = overallUsage; + _resultData['overallUsage'] = l$overallUsage.toJson(); + final l$averageUsageByService = averageUsageByService; + _resultData['averageUsageByService'] = l$averageUsageByService.toJson(); + final l$maxUsageByService = maxUsageByService; + _resultData['maxUsageByService'] = l$maxUsageByService.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$overallUsage = overallUsage; + final l$averageUsageByService = averageUsageByService; + final l$maxUsageByService = maxUsageByService; + final l$$__typename = $__typename; + return Object.hashAll([ + l$overallUsage, + l$averageUsageByService, + l$maxUsageByService, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$GetMemoryMetrics$monitoring$memoryUsage) || + runtimeType != other.runtimeType) { + return false; + } + final l$overallUsage = overallUsage; + final lOther$overallUsage = other.overallUsage; + if (l$overallUsage != lOther$overallUsage) { + return false; + } + final l$averageUsageByService = averageUsageByService; + final lOther$averageUsageByService = other.averageUsageByService; + if (l$averageUsageByService != lOther$averageUsageByService) { + return false; + } + final l$maxUsageByService = maxUsageByService; + final lOther$maxUsageByService = other.maxUsageByService; + if (l$maxUsageByService != lOther$maxUsageByService) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring$memoryUsage + on Query$GetMemoryMetrics$monitoring$memoryUsage { + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage< + Query$GetMemoryMetrics$monitoring$memoryUsage> + get copyWith => CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage { + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage( + Query$GetMemoryMetrics$monitoring$memoryUsage instance, + TRes Function(Query$GetMemoryMetrics$monitoring$memoryUsage) then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage; + + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage.stub( + TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage; + + TRes call({ + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage? overallUsage, + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService? + averageUsageByService, + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService? + maxUsageByService, + String? $__typename, + }); + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage + get overallUsage; + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService< + TRes> get averageUsageByService; + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService + get maxUsageByService; +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage + implements CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring$memoryUsage _instance; + + final TRes Function(Query$GetMemoryMetrics$monitoring$memoryUsage) _then; + + static const _undefined = {}; + + TRes call({ + Object? overallUsage = _undefined, + Object? averageUsageByService = _undefined, + Object? maxUsageByService = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$GetMemoryMetrics$monitoring$memoryUsage( + overallUsage: overallUsage == _undefined || overallUsage == null + ? _instance.overallUsage + : (overallUsage + as Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage), + averageUsageByService: averageUsageByService == _undefined || + averageUsageByService == null + ? _instance.averageUsageByService + : (averageUsageByService + as Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService), + maxUsageByService: maxUsageByService == _undefined || + maxUsageByService == null + ? _instance.maxUsageByService + : (maxUsageByService + as Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage + get overallUsage { + final local$overallUsage = _instance.overallUsage; + return CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage( + local$overallUsage, (e) => call(overallUsage: e)); + } + + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService< + TRes> get averageUsageByService { + final local$averageUsageByService = _instance.averageUsageByService; + return CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService( + local$averageUsageByService, (e) => call(averageUsageByService: e)); + } + + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService + get maxUsageByService { + final local$maxUsageByService = _instance.maxUsageByService; + return CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService( + local$maxUsageByService, (e) => call(maxUsageByService: e)); + } +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage + implements CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage(this._res); + + TRes _res; + + call({ + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage? overallUsage, + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService? + averageUsageByService, + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService? + maxUsageByService, + String? $__typename, + }) => + _res; + + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage + get overallUsage => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage + .stub(_res); + + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService< + TRes> + get averageUsageByService => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService + .stub(_res); + + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService + get maxUsageByService => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService + .stub(_res); +} + +class Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage { + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage( + {required this.$__typename}); + + factory Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage.fromJson( + Map json) { + switch (json["__typename"] as String) { + case "MonitoringValues": + return Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues + .fromJson(json); + + case "MonitoringQueryError": + return Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError + .fromJson(json); + + default: + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage( + $__typename: (l$$__typename as String)); + } + } + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$$__typename = $__typename; + return Object.hashAll([l$$__typename]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage) || + runtimeType != other.runtimeType) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage + on Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage { + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage< + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage> + get copyWith => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage( + this, + (i) => i, + ); + _T when<_T>({ + required _T Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues) + monitoringValues, + required _T Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError) + monitoringQueryError, + required _T Function() orElse, + }) { + switch ($__typename) { + case "MonitoringValues": + return monitoringValues(this + as Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues); + + case "MonitoringQueryError": + return monitoringQueryError(this + as Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError); + + default: + return orElse(); + } + } + + _T maybeWhen<_T>({ + _T Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues)? + monitoringValues, + _T Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError)? + monitoringQueryError, + required _T Function() orElse, + }) { + switch ($__typename) { + case "MonitoringValues": + if (monitoringValues != null) { + return monitoringValues(this + as Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues); + } else { + return orElse(); + } + + case "MonitoringQueryError": + if (monitoringQueryError != null) { + return monitoringQueryError(this + as Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError); + } else { + return orElse(); + } + + default: + return orElse(); + } + } +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage< + TRes> { + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage instance, + TRes Function(Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage) + then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage; + + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage.stub( + TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage; + + TRes call({String? $__typename}); +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage< + TRes> { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage _instance; + + final TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage) _then; + + static const _undefined = {}; + + TRes call({Object? $__typename = _undefined}) => + _then(Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage( + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String))); +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage< + TRes> { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage( + this._res); + + TRes _res; + + call({String? $__typename}) => _res; +} + +class Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues + implements + Fragment$MonitoringValues, + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage { + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues({ + required this.values, + this.$__typename = 'MonitoringValues', + }); + + factory Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues.fromJson( + Map json) { + final l$values = json['values']; + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues( + values: (l$values as List) + .map((e) => + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values + .fromJson((e as Map))) + .toList(), + $__typename: (l$$__typename as String), + ); + } + + final List< + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values> + values; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$values = values; + _resultData['values'] = l$values.map((e) => e.toJson()).toList(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$values = values; + final l$$__typename = $__typename; + return Object.hashAll([ + Object.hashAll(l$values.map((v) => v)), + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues) || + runtimeType != other.runtimeType) { + return false; + } + final l$values = values; + final lOther$values = other.values; + if (l$values.length != lOther$values.length) { + return false; + } + for (int i = 0; i < l$values.length; i++) { + final l$values$entry = l$values[i]; + final lOther$values$entry = lOther$values[i]; + if (l$values$entry != lOther$values$entry) { + return false; + } + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues + on Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues { + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues< + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues> + get copyWith => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues< + TRes> { + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues + instance, + TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues) + then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues; + + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues.stub( + TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues; + + TRes call({ + List? + values, + String? $__typename, + }); + TRes values( + Iterable Function( + Iterable< + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values< + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values>>) + _fn); +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues< + TRes> { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues + _instance; + + final TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues) + _then; + + static const _undefined = {}; + + TRes call({ + Object? values = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues( + values: values == _undefined || values == null + ? _instance.values + : (values as List< + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values>), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + TRes values( + Iterable Function( + Iterable< + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values< + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values>>) + _fn) => + call( + values: _fn(_instance.values.map((e) => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values( + e, + (i) => i, + ))).toList()); +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues< + TRes> { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues( + this._res); + + TRes _res; + + call({ + List? + values, + String? $__typename, + }) => + _res; + + values(_fn) => _res; +} + +class Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values + implements Fragment$MonitoringValues$values { + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values({ + required this.value, + required this.timestamp, + this.$__typename = 'MonitoringValue', + }); + + factory Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values.fromJson( + Map json) { + final l$value = json['value']; + final l$timestamp = json['timestamp']; + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values( + value: (l$value as String), + timestamp: dateTimeFromJson(l$timestamp), + $__typename: (l$$__typename as String), + ); + } + + final String value; + + final DateTime timestamp; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$value = value; + _resultData['value'] = l$value; + final l$timestamp = timestamp; + _resultData['timestamp'] = dateTimeToJson(l$timestamp); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$value = value; + final l$timestamp = timestamp; + final l$$__typename = $__typename; + return Object.hashAll([ + l$value, + l$timestamp, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values) || + runtimeType != other.runtimeType) { + return false; + } + final l$value = value; + final lOther$value = other.value; + if (l$value != lOther$value) { + return false; + } + final l$timestamp = timestamp; + final lOther$timestamp = other.timestamp; + if (l$timestamp != lOther$timestamp) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values + on Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values { + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values< + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values> + get copyWith => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values< + TRes> { + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values + instance, + TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values) + then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values; + + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values.stub( + TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values; + + TRes call({ + String? value, + DateTime? timestamp, + String? $__typename, + }); +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values< + TRes> { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values + _instance; + + final TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values) + _then; + + static const _undefined = {}; + + TRes call({ + Object? value = _undefined, + Object? timestamp = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values( + value: value == _undefined || value == null + ? _instance.value + : (value as String), + timestamp: timestamp == _undefined || timestamp == null + ? _instance.timestamp + : (timestamp as DateTime), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values< + TRes> { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringValues$values( + this._res); + + TRes _res; + + call({ + String? value, + DateTime? timestamp, + String? $__typename, + }) => + _res; +} + +class Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError + implements + Fragment$MonitoringQueryError, + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage { + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError({ + required this.error, + this.$__typename = 'MonitoringQueryError', + }); + + factory Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError.fromJson( + Map json) { + final l$error = json['error']; + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError( + error: (l$error as String), + $__typename: (l$$__typename as String), + ); + } + + final String error; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$error = error; + _resultData['error'] = l$error; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$error = error; + final l$$__typename = $__typename; + return Object.hashAll([ + l$error, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError) || + runtimeType != other.runtimeType) { + return false; + } + final l$error = error; + final lOther$error = other.error; + if (l$error != lOther$error) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError + on Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError { + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError< + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError> + get copyWith => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError< + TRes> { + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError + instance, + TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError) + then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError; + + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError.stub( + TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError; + + TRes call({ + String? error, + String? $__typename, + }); +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError< + TRes> { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError + _instance; + + final TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError) + _then; + + static const _undefined = {}; + + TRes call({ + Object? error = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError( + error: error == _undefined || error == null + ? _instance.error + : (error as String), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError< + TRes> { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$overallUsage$$MonitoringQueryError( + this._res); + + TRes _res; + + call({ + String? error, + String? $__typename, + }) => + _res; +} + +class Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService { + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService( + {required this.$__typename}); + + factory Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService.fromJson( + Map json) { + switch (json["__typename"] as String) { + case "MonitoringMetrics": + return Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics + .fromJson(json); + + case "MonitoringQueryError": + return Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError + .fromJson(json); + + default: + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService( + $__typename: (l$$__typename as String)); + } + } + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$$__typename = $__typename; + return Object.hashAll([l$$__typename]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService) || + runtimeType != other.runtimeType) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService + on Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService { + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService< + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService> + get copyWith => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService( + this, + (i) => i, + ); + _T when<_T>({ + required _T Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics) + monitoringMetrics, + required _T Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError) + monitoringQueryError, + required _T Function() orElse, + }) { + switch ($__typename) { + case "MonitoringMetrics": + return monitoringMetrics(this + as Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics); + + case "MonitoringQueryError": + return monitoringQueryError(this + as Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError); + + default: + return orElse(); + } + } + + _T maybeWhen<_T>({ + _T Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics)? + monitoringMetrics, + _T Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError)? + monitoringQueryError, + required _T Function() orElse, + }) { + switch ($__typename) { + case "MonitoringMetrics": + if (monitoringMetrics != null) { + return monitoringMetrics(this + as Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics); + } else { + return orElse(); + } + + case "MonitoringQueryError": + if (monitoringQueryError != null) { + return monitoringQueryError(this + as Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError); + } else { + return orElse(); + } + + default: + return orElse(); + } + } +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService< + TRes> { + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService + instance, + TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService) + then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService; + + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService.stub( + TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService; + + TRes call({String? $__typename}); +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService< + TRes> { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService + _instance; + + final TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService) + _then; + + static const _undefined = {}; + + TRes call({Object? $__typename = _undefined}) => + _then(Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService( + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String))); +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService< + TRes> { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService( + this._res); + + TRes _res; + + call({String? $__typename}) => _res; +} + +class Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics + implements + Fragment$MonitoringMetrics, + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService { + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics({ + required this.metrics, + this.$__typename = 'MonitoringMetrics', + }); + + factory Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics.fromJson( + Map json) { + final l$metrics = json['metrics']; + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics( + metrics: (l$metrics as List) + .map((e) => + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics + .fromJson((e as Map))) + .toList(), + $__typename: (l$$__typename as String), + ); + } + + final List< + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics> + metrics; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$metrics = metrics; + _resultData['metrics'] = l$metrics.map((e) => e.toJson()).toList(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$metrics = metrics; + final l$$__typename = $__typename; + return Object.hashAll([ + Object.hashAll(l$metrics.map((v) => v)), + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics) || + runtimeType != other.runtimeType) { + return false; + } + final l$metrics = metrics; + final lOther$metrics = other.metrics; + if (l$metrics.length != lOther$metrics.length) { + return false; + } + for (int i = 0; i < l$metrics.length; i++) { + final l$metrics$entry = l$metrics[i]; + final lOther$metrics$entry = lOther$metrics[i]; + if (l$metrics$entry != lOther$metrics$entry) { + return false; + } + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics + on Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics { + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics< + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics> + get copyWith => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics< + TRes> { + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics + instance, + TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics) + then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics; + + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics.stub( + TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics; + + TRes call({ + List? + metrics, + String? $__typename, + }); + TRes metrics( + Iterable Function( + Iterable< + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics< + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics>>) + _fn); +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics< + TRes> { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics + _instance; + + final TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics) + _then; + + static const _undefined = {}; + + TRes call({ + Object? metrics = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics( + metrics: metrics == _undefined || metrics == null + ? _instance.metrics + : (metrics as List< + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics>), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + TRes metrics( + Iterable Function( + Iterable< + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics< + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics>>) + _fn) => + call( + metrics: _fn(_instance.metrics.map((e) => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics( + e, + (i) => i, + ))).toList()); +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics< + TRes> { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics( + this._res); + + TRes _res; + + call({ + List? + metrics, + String? $__typename, + }) => + _res; + + metrics(_fn) => _res; +} + +class Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics + implements Fragment$MonitoringMetrics$metrics { + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics({ + required this.metricId, + required this.values, + this.$__typename = 'MonitoringMetric', + }); + + factory Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics.fromJson( + Map json) { + final l$metricId = json['metricId']; + final l$values = json['values']; + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics( + metricId: (l$metricId as String), + values: (l$values as List) + .map((e) => + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values + .fromJson((e as Map))) + .toList(), + $__typename: (l$$__typename as String), + ); + } + + final String metricId; + + final List< + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values> + values; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$metricId = metricId; + _resultData['metricId'] = l$metricId; + final l$values = values; + _resultData['values'] = l$values.map((e) => e.toJson()).toList(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$metricId = metricId; + final l$values = values; + final l$$__typename = $__typename; + return Object.hashAll([ + l$metricId, + Object.hashAll(l$values.map((v) => v)), + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics) || + runtimeType != other.runtimeType) { + return false; + } + final l$metricId = metricId; + final lOther$metricId = other.metricId; + if (l$metricId != lOther$metricId) { + return false; + } + final l$values = values; + final lOther$values = other.values; + if (l$values.length != lOther$values.length) { + return false; + } + for (int i = 0; i < l$values.length; i++) { + final l$values$entry = l$values[i]; + final lOther$values$entry = lOther$values[i]; + if (l$values$entry != lOther$values$entry) { + return false; + } + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics + on Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics { + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics< + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics> + get copyWith => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics< + TRes> { + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics + instance, + TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics) + then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics; + + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics.stub( + TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics; + + TRes call({ + String? metricId, + List? + values, + String? $__typename, + }); + TRes values( + Iterable Function( + Iterable< + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values< + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values>>) + _fn); +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics< + TRes> { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics + _instance; + + final TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics) + _then; + + static const _undefined = {}; + + TRes call({ + Object? metricId = _undefined, + Object? values = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics( + metricId: metricId == _undefined || metricId == null + ? _instance.metricId + : (metricId as String), + values: values == _undefined || values == null + ? _instance.values + : (values as List< + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values>), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + TRes values( + Iterable Function( + Iterable< + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values< + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values>>) + _fn) => + call( + values: _fn(_instance.values.map((e) => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values( + e, + (i) => i, + ))).toList()); +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics< + TRes> { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics( + this._res); + + TRes _res; + + call({ + String? metricId, + List? + values, + String? $__typename, + }) => + _res; + + values(_fn) => _res; +} + +class Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values + implements Fragment$MonitoringMetrics$metrics$values { + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values({ + required this.timestamp, + required this.value, + this.$__typename = 'MonitoringValue', + }); + + factory Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values.fromJson( + Map json) { + final l$timestamp = json['timestamp']; + final l$value = json['value']; + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values( + timestamp: dateTimeFromJson(l$timestamp), + value: (l$value as String), + $__typename: (l$$__typename as String), + ); + } + + final DateTime timestamp; + + final String value; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$timestamp = timestamp; + _resultData['timestamp'] = dateTimeToJson(l$timestamp); + final l$value = value; + _resultData['value'] = l$value; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$timestamp = timestamp; + final l$value = value; + final l$$__typename = $__typename; + return Object.hashAll([ + l$timestamp, + l$value, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values) || + runtimeType != other.runtimeType) { + return false; + } + final l$timestamp = timestamp; + final lOther$timestamp = other.timestamp; + if (l$timestamp != lOther$timestamp) { + return false; + } + final l$value = value; + final lOther$value = other.value; + if (l$value != lOther$value) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values + on Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values { + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values< + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values> + get copyWith => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values< + TRes> { + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values + instance, + TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values) + then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values; + + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values.stub( + TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values; + + TRes call({ + DateTime? timestamp, + String? value, + String? $__typename, + }); +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values< + TRes> { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values + _instance; + + final TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values) + _then; + + static const _undefined = {}; + + TRes call({ + Object? timestamp = _undefined, + Object? value = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values( + timestamp: timestamp == _undefined || timestamp == null + ? _instance.timestamp + : (timestamp as DateTime), + value: value == _undefined || value == null + ? _instance.value + : (value as String), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values< + TRes> { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringMetrics$metrics$values( + this._res); + + TRes _res; + + call({ + DateTime? timestamp, + String? value, + String? $__typename, + }) => + _res; +} + +class Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError + implements + Fragment$MonitoringQueryError, + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService { + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError({ + required this.error, + this.$__typename = 'MonitoringQueryError', + }); + + factory Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError.fromJson( + Map json) { + final l$error = json['error']; + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError( + error: (l$error as String), + $__typename: (l$$__typename as String), + ); + } + + final String error; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$error = error; + _resultData['error'] = l$error; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$error = error; + final l$$__typename = $__typename; + return Object.hashAll([ + l$error, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError) || + runtimeType != other.runtimeType) { + return false; + } + final l$error = error; + final lOther$error = other.error; + if (l$error != lOther$error) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError + on Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError { + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError< + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError> + get copyWith => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError< + TRes> { + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError + instance, + TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError) + then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError; + + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError.stub( + TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError; + + TRes call({ + String? error, + String? $__typename, + }); +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError< + TRes> { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError + _instance; + + final TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError) + _then; + + static const _undefined = {}; + + TRes call({ + Object? error = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError( + error: error == _undefined || error == null + ? _instance.error + : (error as String), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError< + TRes> { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$averageUsageByService$$MonitoringQueryError( + this._res); + + TRes _res; + + call({ + String? error, + String? $__typename, + }) => + _res; +} + +class Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService { + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService( + {required this.$__typename}); + + factory Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService.fromJson( + Map json) { + switch (json["__typename"] as String) { + case "MonitoringMetrics": + return Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics + .fromJson(json); + + case "MonitoringQueryError": + return Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError + .fromJson(json); + + default: + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService( + $__typename: (l$$__typename as String)); + } + } + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$$__typename = $__typename; + return Object.hashAll([l$$__typename]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService) || + runtimeType != other.runtimeType) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService + on Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService { + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService< + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService> + get copyWith => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService( + this, + (i) => i, + ); + _T when<_T>({ + required _T Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics) + monitoringMetrics, + required _T Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError) + monitoringQueryError, + required _T Function() orElse, + }) { + switch ($__typename) { + case "MonitoringMetrics": + return monitoringMetrics(this + as Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics); + + case "MonitoringQueryError": + return monitoringQueryError(this + as Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError); + + default: + return orElse(); + } + } + + _T maybeWhen<_T>({ + _T Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics)? + monitoringMetrics, + _T Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError)? + monitoringQueryError, + required _T Function() orElse, + }) { + switch ($__typename) { + case "MonitoringMetrics": + if (monitoringMetrics != null) { + return monitoringMetrics(this + as Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics); + } else { + return orElse(); + } + + case "MonitoringQueryError": + if (monitoringQueryError != null) { + return monitoringQueryError(this + as Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError); + } else { + return orElse(); + } + + default: + return orElse(); + } + } +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService< + TRes> { + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService instance, + TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService) + then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService; + + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService.stub( + TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService; + + TRes call({String? $__typename}); +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService< + TRes> { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService + _instance; + + final TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService) _then; + + static const _undefined = {}; + + TRes call({Object? $__typename = _undefined}) => + _then(Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService( + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String))); +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService< + TRes> { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService( + this._res); + + TRes _res; + + call({String? $__typename}) => _res; +} + +class Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics + implements + Fragment$MonitoringMetrics, + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService { + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics({ + required this.metrics, + this.$__typename = 'MonitoringMetrics', + }); + + factory Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics.fromJson( + Map json) { + final l$metrics = json['metrics']; + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics( + metrics: (l$metrics as List) + .map((e) => + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics + .fromJson((e as Map))) + .toList(), + $__typename: (l$$__typename as String), + ); + } + + final List< + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics> + metrics; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$metrics = metrics; + _resultData['metrics'] = l$metrics.map((e) => e.toJson()).toList(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$metrics = metrics; + final l$$__typename = $__typename; + return Object.hashAll([ + Object.hashAll(l$metrics.map((v) => v)), + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics) || + runtimeType != other.runtimeType) { + return false; + } + final l$metrics = metrics; + final lOther$metrics = other.metrics; + if (l$metrics.length != lOther$metrics.length) { + return false; + } + for (int i = 0; i < l$metrics.length; i++) { + final l$metrics$entry = l$metrics[i]; + final lOther$metrics$entry = lOther$metrics[i]; + if (l$metrics$entry != lOther$metrics$entry) { + return false; + } + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics + on Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics { + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics< + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics> + get copyWith => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics< + TRes> { + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics + instance, + TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics) + then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics; + + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics.stub( + TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics; + + TRes call({ + List? + metrics, + String? $__typename, + }); + TRes metrics( + Iterable Function( + Iterable< + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics< + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics>>) + _fn); +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics< + TRes> { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics + _instance; + + final TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics) + _then; + + static const _undefined = {}; + + TRes call({ + Object? metrics = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics( + metrics: metrics == _undefined || metrics == null + ? _instance.metrics + : (metrics as List< + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics>), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + TRes metrics( + Iterable Function( + Iterable< + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics< + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics>>) + _fn) => + call( + metrics: _fn(_instance.metrics.map((e) => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics( + e, + (i) => i, + ))).toList()); +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics< + TRes> { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics( + this._res); + + TRes _res; + + call({ + List? + metrics, + String? $__typename, + }) => + _res; + + metrics(_fn) => _res; +} + +class Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics + implements Fragment$MonitoringMetrics$metrics { + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics({ + required this.metricId, + required this.values, + this.$__typename = 'MonitoringMetric', + }); + + factory Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics.fromJson( + Map json) { + final l$metricId = json['metricId']; + final l$values = json['values']; + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics( + metricId: (l$metricId as String), + values: (l$values as List) + .map((e) => + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values + .fromJson((e as Map))) + .toList(), + $__typename: (l$$__typename as String), + ); + } + + final String metricId; + + final List< + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values> + values; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$metricId = metricId; + _resultData['metricId'] = l$metricId; + final l$values = values; + _resultData['values'] = l$values.map((e) => e.toJson()).toList(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$metricId = metricId; + final l$values = values; + final l$$__typename = $__typename; + return Object.hashAll([ + l$metricId, + Object.hashAll(l$values.map((v) => v)), + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics) || + runtimeType != other.runtimeType) { + return false; + } + final l$metricId = metricId; + final lOther$metricId = other.metricId; + if (l$metricId != lOther$metricId) { + return false; + } + final l$values = values; + final lOther$values = other.values; + if (l$values.length != lOther$values.length) { + return false; + } + for (int i = 0; i < l$values.length; i++) { + final l$values$entry = l$values[i]; + final lOther$values$entry = lOther$values[i]; + if (l$values$entry != lOther$values$entry) { + return false; + } + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics + on Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics { + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics< + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics> + get copyWith => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics< + TRes> { + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics + instance, + TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics) + then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics; + + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics.stub( + TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics; + + TRes call({ + String? metricId, + List? + values, + String? $__typename, + }); + TRes values( + Iterable Function( + Iterable< + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values< + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values>>) + _fn); +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics< + TRes> { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics + _instance; + + final TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics) + _then; + + static const _undefined = {}; + + TRes call({ + Object? metricId = _undefined, + Object? values = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics( + metricId: metricId == _undefined || metricId == null + ? _instance.metricId + : (metricId as String), + values: values == _undefined || values == null + ? _instance.values + : (values as List< + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values>), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + TRes values( + Iterable Function( + Iterable< + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values< + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values>>) + _fn) => + call( + values: _fn(_instance.values.map((e) => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values( + e, + (i) => i, + ))).toList()); +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics< + TRes> { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics( + this._res); + + TRes _res; + + call({ + String? metricId, + List? + values, + String? $__typename, + }) => + _res; + + values(_fn) => _res; +} + +class Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values + implements Fragment$MonitoringMetrics$metrics$values { + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values({ + required this.timestamp, + required this.value, + this.$__typename = 'MonitoringValue', + }); + + factory Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values.fromJson( + Map json) { + final l$timestamp = json['timestamp']; + final l$value = json['value']; + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values( + timestamp: dateTimeFromJson(l$timestamp), + value: (l$value as String), + $__typename: (l$$__typename as String), + ); + } + + final DateTime timestamp; + + final String value; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$timestamp = timestamp; + _resultData['timestamp'] = dateTimeToJson(l$timestamp); + final l$value = value; + _resultData['value'] = l$value; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$timestamp = timestamp; + final l$value = value; + final l$$__typename = $__typename; + return Object.hashAll([ + l$timestamp, + l$value, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values) || + runtimeType != other.runtimeType) { + return false; + } + final l$timestamp = timestamp; + final lOther$timestamp = other.timestamp; + if (l$timestamp != lOther$timestamp) { + return false; + } + final l$value = value; + final lOther$value = other.value; + if (l$value != lOther$value) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values + on Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values { + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values< + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values> + get copyWith => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values< + TRes> { + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values + instance, + TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values) + then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values; + + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values.stub( + TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values; + + TRes call({ + DateTime? timestamp, + String? value, + String? $__typename, + }); +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values< + TRes> { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values + _instance; + + final TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values) + _then; + + static const _undefined = {}; + + TRes call({ + Object? timestamp = _undefined, + Object? value = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values( + timestamp: timestamp == _undefined || timestamp == null + ? _instance.timestamp + : (timestamp as DateTime), + value: value == _undefined || value == null + ? _instance.value + : (value as String), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values< + TRes> { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringMetrics$metrics$values( + this._res); + + TRes _res; + + call({ + DateTime? timestamp, + String? value, + String? $__typename, + }) => + _res; +} + +class Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError + implements + Fragment$MonitoringQueryError, + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService { + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError({ + required this.error, + this.$__typename = 'MonitoringQueryError', + }); + + factory Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError.fromJson( + Map json) { + final l$error = json['error']; + final l$$__typename = json['__typename']; + return Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError( + error: (l$error as String), + $__typename: (l$$__typename as String), + ); + } + + final String error; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$error = error; + _resultData['error'] = l$error; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$error = error; + final l$$__typename = $__typename; + return Object.hashAll([ + l$error, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError) || + runtimeType != other.runtimeType) { + return false; + } + final l$error = error; + final lOther$error = other.error; + if (l$error != lOther$error) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError + on Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError { + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError< + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError> + get copyWith => + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError< + TRes> { + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError + instance, + TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError) + then, + ) = _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError; + + factory CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError.stub( + TRes res) = + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError; + + TRes call({ + String? error, + String? $__typename, + }); +} + +class _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError< + TRes> { + _CopyWithImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError( + this._instance, + this._then, + ); + + final Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError + _instance; + + final TRes Function( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError) + _then; + + static const _undefined = {}; + + TRes call({ + Object? error = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError( + error: error == _undefined || error == null + ? _instance.error + : (error as String), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError< + TRes> + implements + CopyWith$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError< + TRes> { + _CopyWithStubImpl$Query$GetMemoryMetrics$monitoring$memoryUsage$maxUsageByService$$MonitoringQueryError( + this._res); + + TRes _res; + + call({ + String? error, + String? $__typename, + }) => + _res; +} + +class Variables$Query$GetDiskMetrics { + factory Variables$Query$GetDiskMetrics({ + DateTime? start, + DateTime? end, + required int step, + }) => + Variables$Query$GetDiskMetrics._({ + if (start != null) r'start': start, + if (end != null) r'end': end, + r'step': step, + }); + + Variables$Query$GetDiskMetrics._(this._$data); + + factory Variables$Query$GetDiskMetrics.fromJson(Map data) { + final result$data = {}; + if (data.containsKey('start')) { + final l$start = data['start']; + result$data['start'] = l$start == null ? null : dateTimeFromJson(l$start); + } + if (data.containsKey('end')) { + final l$end = data['end']; + result$data['end'] = l$end == null ? null : dateTimeFromJson(l$end); + } + final l$step = data['step']; + result$data['step'] = (l$step as int); + return Variables$Query$GetDiskMetrics._(result$data); + } + + Map _$data; + + DateTime? get start => (_$data['start'] as DateTime?); + + DateTime? get end => (_$data['end'] as DateTime?); + + int get step => (_$data['step'] as int); + + Map toJson() { + final result$data = {}; + if (_$data.containsKey('start')) { + final l$start = start; + result$data['start'] = l$start == null ? null : dateTimeToJson(l$start); + } + if (_$data.containsKey('end')) { + final l$end = end; + result$data['end'] = l$end == null ? null : dateTimeToJson(l$end); + } + final l$step = step; + result$data['step'] = l$step; + return result$data; + } + + CopyWith$Variables$Query$GetDiskMetrics + get copyWith => CopyWith$Variables$Query$GetDiskMetrics( + this, + (i) => i, + ); + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Variables$Query$GetDiskMetrics) || + runtimeType != other.runtimeType) { + return false; + } + final l$start = start; + final lOther$start = other.start; + if (_$data.containsKey('start') != other._$data.containsKey('start')) { + return false; + } + if (l$start != lOther$start) { + return false; + } + final l$end = end; + final lOther$end = other.end; + if (_$data.containsKey('end') != other._$data.containsKey('end')) { + return false; + } + if (l$end != lOther$end) { + return false; + } + final l$step = step; + final lOther$step = other.step; + if (l$step != lOther$step) { + return false; + } + return true; + } + + @override + int get hashCode { + final l$start = start; + final l$end = end; + final l$step = step; + return Object.hashAll([ + _$data.containsKey('start') ? l$start : const {}, + _$data.containsKey('end') ? l$end : const {}, + l$step, + ]); + } +} + +abstract class CopyWith$Variables$Query$GetDiskMetrics { + factory CopyWith$Variables$Query$GetDiskMetrics( + Variables$Query$GetDiskMetrics instance, + TRes Function(Variables$Query$GetDiskMetrics) then, + ) = _CopyWithImpl$Variables$Query$GetDiskMetrics; + + factory CopyWith$Variables$Query$GetDiskMetrics.stub(TRes res) = + _CopyWithStubImpl$Variables$Query$GetDiskMetrics; + + TRes call({ + DateTime? start, + DateTime? end, + int? step, + }); +} + +class _CopyWithImpl$Variables$Query$GetDiskMetrics + implements CopyWith$Variables$Query$GetDiskMetrics { + _CopyWithImpl$Variables$Query$GetDiskMetrics( + this._instance, + this._then, + ); + + final Variables$Query$GetDiskMetrics _instance; + + final TRes Function(Variables$Query$GetDiskMetrics) _then; + + static const _undefined = {}; + + TRes call({ + Object? start = _undefined, + Object? end = _undefined, + Object? step = _undefined, + }) => + _then(Variables$Query$GetDiskMetrics._({ + ..._instance._$data, + if (start != _undefined) 'start': (start as DateTime?), + if (end != _undefined) 'end': (end as DateTime?), + if (step != _undefined && step != null) 'step': (step as int), + })); +} + +class _CopyWithStubImpl$Variables$Query$GetDiskMetrics + implements CopyWith$Variables$Query$GetDiskMetrics { + _CopyWithStubImpl$Variables$Query$GetDiskMetrics(this._res); + + TRes _res; + + call({ + DateTime? start, + DateTime? end, + int? step, + }) => + _res; +} + +class Query$GetDiskMetrics { + Query$GetDiskMetrics({ + required this.monitoring, + this.$__typename = 'Query', + }); + + factory Query$GetDiskMetrics.fromJson(Map json) { + final l$monitoring = json['monitoring']; + final l$$__typename = json['__typename']; + return Query$GetDiskMetrics( + monitoring: Query$GetDiskMetrics$monitoring.fromJson( + (l$monitoring as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Query$GetDiskMetrics$monitoring monitoring; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$monitoring = monitoring; + _resultData['monitoring'] = l$monitoring.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$monitoring = monitoring; + final l$$__typename = $__typename; + return Object.hashAll([ + l$monitoring, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$GetDiskMetrics) || runtimeType != other.runtimeType) { + return false; + } + final l$monitoring = monitoring; + final lOther$monitoring = other.monitoring; + if (l$monitoring != lOther$monitoring) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetDiskMetrics on Query$GetDiskMetrics { + CopyWith$Query$GetDiskMetrics get copyWith => + CopyWith$Query$GetDiskMetrics( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetDiskMetrics { + factory CopyWith$Query$GetDiskMetrics( + Query$GetDiskMetrics instance, + TRes Function(Query$GetDiskMetrics) then, + ) = _CopyWithImpl$Query$GetDiskMetrics; + + factory CopyWith$Query$GetDiskMetrics.stub(TRes res) = + _CopyWithStubImpl$Query$GetDiskMetrics; + + TRes call({ + Query$GetDiskMetrics$monitoring? monitoring, + String? $__typename, + }); + CopyWith$Query$GetDiskMetrics$monitoring get monitoring; +} + +class _CopyWithImpl$Query$GetDiskMetrics + implements CopyWith$Query$GetDiskMetrics { + _CopyWithImpl$Query$GetDiskMetrics( + this._instance, + this._then, + ); + + final Query$GetDiskMetrics _instance; + + final TRes Function(Query$GetDiskMetrics) _then; + + static const _undefined = {}; + + TRes call({ + Object? monitoring = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$GetDiskMetrics( + monitoring: monitoring == _undefined || monitoring == null + ? _instance.monitoring + : (monitoring as Query$GetDiskMetrics$monitoring), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + CopyWith$Query$GetDiskMetrics$monitoring get monitoring { + final local$monitoring = _instance.monitoring; + return CopyWith$Query$GetDiskMetrics$monitoring( + local$monitoring, (e) => call(monitoring: e)); + } +} + +class _CopyWithStubImpl$Query$GetDiskMetrics + implements CopyWith$Query$GetDiskMetrics { + _CopyWithStubImpl$Query$GetDiskMetrics(this._res); + + TRes _res; + + call({ + Query$GetDiskMetrics$monitoring? monitoring, + String? $__typename, + }) => + _res; + + CopyWith$Query$GetDiskMetrics$monitoring get monitoring => + CopyWith$Query$GetDiskMetrics$monitoring.stub(_res); +} + +const documentNodeQueryGetDiskMetrics = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.query, + name: NameNode(value: 'GetDiskMetrics'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'start')), + type: NamedTypeNode( + name: NameNode(value: 'DateTime'), + isNonNull: false, + ), + defaultValue: DefaultValueNode(value: null), + directives: [], + ), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'end')), + type: NamedTypeNode( + name: NameNode(value: 'DateTime'), + isNonNull: false, + ), + defaultValue: DefaultValueNode(value: null), + directives: [], + ), + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'step')), + type: NamedTypeNode( + name: NameNode(value: 'Int'), + isNonNull: true, + ), + defaultValue: DefaultValueNode(value: null), + directives: [], + ), + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'monitoring'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'diskUsage'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'start'), + value: VariableNode(name: NameNode(value: 'start')), + ), + ArgumentNode( + name: NameNode(value: 'end'), + value: VariableNode(name: NameNode(value: 'end')), + ), + ArgumentNode( + name: NameNode(value: 'step'), + value: VariableNode(name: NameNode(value: 'step')), + ), + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'overallUsage'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'MonitoringQueryError'), + directives: [], + ), + FragmentSpreadNode( + name: NameNode(value: 'MonitoringMetrics'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + fragmentDefinitionMonitoringQueryError, + fragmentDefinitionMonitoringMetrics, +]); +Query$GetDiskMetrics _parserFn$Query$GetDiskMetrics( + Map data) => + Query$GetDiskMetrics.fromJson(data); +typedef OnQueryComplete$Query$GetDiskMetrics = FutureOr Function( + Map?, + Query$GetDiskMetrics?, +); + +class Options$Query$GetDiskMetrics + extends graphql.QueryOptions { + Options$Query$GetDiskMetrics({ + String? operationName, + required Variables$Query$GetDiskMetrics variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Query$GetDiskMetrics? typedOptimisticResult, + Duration? pollInterval, + graphql.Context? context, + OnQueryComplete$Query$GetDiskMetrics? onComplete, + graphql.OnQueryError? onError, + }) : onCompleteWithParsed = onComplete, + super( + variables: variables.toJson(), + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + pollInterval: pollInterval, + context: context, + onComplete: onComplete == null + ? null + : (data) => onComplete( + data, + data == null ? null : _parserFn$Query$GetDiskMetrics(data), + ), + onError: onError, + document: documentNodeQueryGetDiskMetrics, + parserFn: _parserFn$Query$GetDiskMetrics, + ); + + final OnQueryComplete$Query$GetDiskMetrics? onCompleteWithParsed; + + @override + List get properties => [ + ...super.onComplete == null + ? super.properties + : super.properties.where((property) => property != onComplete), + onCompleteWithParsed, + ]; +} + +class WatchOptions$Query$GetDiskMetrics + extends graphql.WatchQueryOptions { + WatchOptions$Query$GetDiskMetrics({ + String? operationName, + required Variables$Query$GetDiskMetrics variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Query$GetDiskMetrics? typedOptimisticResult, + graphql.Context? context, + Duration? pollInterval, + bool? eagerlyFetchResults, + bool carryForwardDataOnException = true, + bool fetchResults = false, + }) : super( + variables: variables.toJson(), + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + document: documentNodeQueryGetDiskMetrics, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Query$GetDiskMetrics, + ); +} + +class FetchMoreOptions$Query$GetDiskMetrics extends graphql.FetchMoreOptions { + FetchMoreOptions$Query$GetDiskMetrics({ + required graphql.UpdateQuery updateQuery, + required Variables$Query$GetDiskMetrics variables, + }) : super( + updateQuery: updateQuery, + variables: variables.toJson(), + document: documentNodeQueryGetDiskMetrics, + ); +} + +extension ClientExtension$Query$GetDiskMetrics on graphql.GraphQLClient { + Future> query$GetDiskMetrics( + Options$Query$GetDiskMetrics options) async => + await this.query(options); + graphql.ObservableQuery watchQuery$GetDiskMetrics( + WatchOptions$Query$GetDiskMetrics options) => + this.watchQuery(options); + void writeQuery$GetDiskMetrics({ + required Query$GetDiskMetrics data, + required Variables$Query$GetDiskMetrics variables, + bool broadcast = true, + }) => + this.writeQuery( + graphql.Request( + operation: + graphql.Operation(document: documentNodeQueryGetDiskMetrics), + variables: variables.toJson(), + ), + data: data.toJson(), + broadcast: broadcast, + ); + Query$GetDiskMetrics? readQuery$GetDiskMetrics({ + required Variables$Query$GetDiskMetrics variables, + bool optimistic = true, + }) { + final result = this.readQuery( + graphql.Request( + operation: graphql.Operation(document: documentNodeQueryGetDiskMetrics), + variables: variables.toJson(), + ), + optimistic: optimistic, + ); + return result == null ? null : Query$GetDiskMetrics.fromJson(result); + } +} + +class Query$GetDiskMetrics$monitoring { + Query$GetDiskMetrics$monitoring({ + required this.diskUsage, + this.$__typename = 'Monitoring', + }); + + factory Query$GetDiskMetrics$monitoring.fromJson(Map json) { + final l$diskUsage = json['diskUsage']; + final l$$__typename = json['__typename']; + return Query$GetDiskMetrics$monitoring( + diskUsage: Query$GetDiskMetrics$monitoring$diskUsage.fromJson( + (l$diskUsage as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Query$GetDiskMetrics$monitoring$diskUsage diskUsage; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$diskUsage = diskUsage; + _resultData['diskUsage'] = l$diskUsage.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$diskUsage = diskUsage; + final l$$__typename = $__typename; + return Object.hashAll([ + l$diskUsage, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$GetDiskMetrics$monitoring) || + runtimeType != other.runtimeType) { + return false; + } + final l$diskUsage = diskUsage; + final lOther$diskUsage = other.diskUsage; + if (l$diskUsage != lOther$diskUsage) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetDiskMetrics$monitoring + on Query$GetDiskMetrics$monitoring { + CopyWith$Query$GetDiskMetrics$monitoring + get copyWith => CopyWith$Query$GetDiskMetrics$monitoring( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetDiskMetrics$monitoring { + factory CopyWith$Query$GetDiskMetrics$monitoring( + Query$GetDiskMetrics$monitoring instance, + TRes Function(Query$GetDiskMetrics$monitoring) then, + ) = _CopyWithImpl$Query$GetDiskMetrics$monitoring; + + factory CopyWith$Query$GetDiskMetrics$monitoring.stub(TRes res) = + _CopyWithStubImpl$Query$GetDiskMetrics$monitoring; + + TRes call({ + Query$GetDiskMetrics$monitoring$diskUsage? diskUsage, + String? $__typename, + }); + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage get diskUsage; +} + +class _CopyWithImpl$Query$GetDiskMetrics$monitoring + implements CopyWith$Query$GetDiskMetrics$monitoring { + _CopyWithImpl$Query$GetDiskMetrics$monitoring( + this._instance, + this._then, + ); + + final Query$GetDiskMetrics$monitoring _instance; + + final TRes Function(Query$GetDiskMetrics$monitoring) _then; + + static const _undefined = {}; + + TRes call({ + Object? diskUsage = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$GetDiskMetrics$monitoring( + diskUsage: diskUsage == _undefined || diskUsage == null + ? _instance.diskUsage + : (diskUsage as Query$GetDiskMetrics$monitoring$diskUsage), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage get diskUsage { + final local$diskUsage = _instance.diskUsage; + return CopyWith$Query$GetDiskMetrics$monitoring$diskUsage( + local$diskUsage, (e) => call(diskUsage: e)); + } +} + +class _CopyWithStubImpl$Query$GetDiskMetrics$monitoring + implements CopyWith$Query$GetDiskMetrics$monitoring { + _CopyWithStubImpl$Query$GetDiskMetrics$monitoring(this._res); + + TRes _res; + + call({ + Query$GetDiskMetrics$monitoring$diskUsage? diskUsage, + String? $__typename, + }) => + _res; + + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage get diskUsage => + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage.stub(_res); +} + +class Query$GetDiskMetrics$monitoring$diskUsage { + Query$GetDiskMetrics$monitoring$diskUsage({ + required this.overallUsage, + this.$__typename = 'DiskMonitoring', + }); + + factory Query$GetDiskMetrics$monitoring$diskUsage.fromJson( + Map json) { + final l$overallUsage = json['overallUsage']; + final l$$__typename = json['__typename']; + return Query$GetDiskMetrics$monitoring$diskUsage( + overallUsage: + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage.fromJson( + (l$overallUsage as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Query$GetDiskMetrics$monitoring$diskUsage$overallUsage overallUsage; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$overallUsage = overallUsage; + _resultData['overallUsage'] = l$overallUsage.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$overallUsage = overallUsage; + final l$$__typename = $__typename; + return Object.hashAll([ + l$overallUsage, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$GetDiskMetrics$monitoring$diskUsage) || + runtimeType != other.runtimeType) { + return false; + } + final l$overallUsage = overallUsage; + final lOther$overallUsage = other.overallUsage; + if (l$overallUsage != lOther$overallUsage) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetDiskMetrics$monitoring$diskUsage + on Query$GetDiskMetrics$monitoring$diskUsage { + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage< + Query$GetDiskMetrics$monitoring$diskUsage> + get copyWith => CopyWith$Query$GetDiskMetrics$monitoring$diskUsage( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetDiskMetrics$monitoring$diskUsage { + factory CopyWith$Query$GetDiskMetrics$monitoring$diskUsage( + Query$GetDiskMetrics$monitoring$diskUsage instance, + TRes Function(Query$GetDiskMetrics$monitoring$diskUsage) then, + ) = _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage; + + factory CopyWith$Query$GetDiskMetrics$monitoring$diskUsage.stub(TRes res) = + _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage; + + TRes call({ + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage? overallUsage, + String? $__typename, + }); + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage + get overallUsage; +} + +class _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage + implements CopyWith$Query$GetDiskMetrics$monitoring$diskUsage { + _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage( + this._instance, + this._then, + ); + + final Query$GetDiskMetrics$monitoring$diskUsage _instance; + + final TRes Function(Query$GetDiskMetrics$monitoring$diskUsage) _then; + + static const _undefined = {}; + + TRes call({ + Object? overallUsage = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$GetDiskMetrics$monitoring$diskUsage( + overallUsage: overallUsage == _undefined || overallUsage == null + ? _instance.overallUsage + : (overallUsage + as Query$GetDiskMetrics$monitoring$diskUsage$overallUsage), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage + get overallUsage { + final local$overallUsage = _instance.overallUsage; + return CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage( + local$overallUsage, (e) => call(overallUsage: e)); + } +} + +class _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage + implements CopyWith$Query$GetDiskMetrics$monitoring$diskUsage { + _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage(this._res); + + TRes _res; + + call({ + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage? overallUsage, + String? $__typename, + }) => + _res; + + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage + get overallUsage => + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage.stub( + _res); +} + +class Query$GetDiskMetrics$monitoring$diskUsage$overallUsage { + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage( + {required this.$__typename}); + + factory Query$GetDiskMetrics$monitoring$diskUsage$overallUsage.fromJson( + Map json) { + switch (json["__typename"] as String) { + case "MonitoringMetrics": + return Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics + .fromJson(json); + + case "MonitoringQueryError": + return Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError + .fromJson(json); + + default: + final l$$__typename = json['__typename']; + return Query$GetDiskMetrics$monitoring$diskUsage$overallUsage( + $__typename: (l$$__typename as String)); + } + } + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$$__typename = $__typename; + return Object.hashAll([l$$__typename]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Query$GetDiskMetrics$monitoring$diskUsage$overallUsage) || + runtimeType != other.runtimeType) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage + on Query$GetDiskMetrics$monitoring$diskUsage$overallUsage { + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage< + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage> + get copyWith => + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage( + this, + (i) => i, + ); + _T when<_T>({ + required _T Function( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics) + monitoringMetrics, + required _T Function( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError) + monitoringQueryError, + required _T Function() orElse, + }) { + switch ($__typename) { + case "MonitoringMetrics": + return monitoringMetrics(this + as Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics); + + case "MonitoringQueryError": + return monitoringQueryError(this + as Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError); + + default: + return orElse(); + } + } + + _T maybeWhen<_T>({ + _T Function( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics)? + monitoringMetrics, + _T Function( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError)? + monitoringQueryError, + required _T Function() orElse, + }) { + switch ($__typename) { + case "MonitoringMetrics": + if (monitoringMetrics != null) { + return monitoringMetrics(this + as Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics); + } else { + return orElse(); + } + + case "MonitoringQueryError": + if (monitoringQueryError != null) { + return monitoringQueryError(this + as Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError); + } else { + return orElse(); + } + + default: + return orElse(); + } + } +} + +abstract class CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage< + TRes> { + factory CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage instance, + TRes Function(Query$GetDiskMetrics$monitoring$diskUsage$overallUsage) then, + ) = _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage; + + factory CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage.stub( + TRes res) = + _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage; + + TRes call({String? $__typename}); +} + +class _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage + implements + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage { + _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage( + this._instance, + this._then, + ); + + final Query$GetDiskMetrics$monitoring$diskUsage$overallUsage _instance; + + final TRes Function(Query$GetDiskMetrics$monitoring$diskUsage$overallUsage) + _then; + + static const _undefined = {}; + + TRes call({Object? $__typename = _undefined}) => + _then(Query$GetDiskMetrics$monitoring$diskUsage$overallUsage( + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String))); +} + +class _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage< + TRes> + implements + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage { + _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage( + this._res); + + TRes _res; + + call({String? $__typename}) => _res; +} + +class Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics + implements + Fragment$MonitoringMetrics, + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage { + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics({ + required this.metrics, + this.$__typename = 'MonitoringMetrics', + }); + + factory Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics.fromJson( + Map json) { + final l$metrics = json['metrics']; + final l$$__typename = json['__typename']; + return Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics( + metrics: (l$metrics as List) + .map((e) => + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics + .fromJson((e as Map))) + .toList(), + $__typename: (l$$__typename as String), + ); + } + + final List< + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics> + metrics; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$metrics = metrics; + _resultData['metrics'] = l$metrics.map((e) => e.toJson()).toList(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$metrics = metrics; + final l$$__typename = $__typename; + return Object.hashAll([ + Object.hashAll(l$metrics.map((v) => v)), + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics) || + runtimeType != other.runtimeType) { + return false; + } + final l$metrics = metrics; + final lOther$metrics = other.metrics; + if (l$metrics.length != lOther$metrics.length) { + return false; + } + for (int i = 0; i < l$metrics.length; i++) { + final l$metrics$entry = l$metrics[i]; + final lOther$metrics$entry = lOther$metrics[i]; + if (l$metrics$entry != lOther$metrics$entry) { + return false; + } + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics + on Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics { + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics< + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics> + get copyWith => + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics< + TRes> { + factory CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics + instance, + TRes Function( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics) + then, + ) = _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics; + + factory CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics.stub( + TRes res) = + _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics; + + TRes call({ + List? + metrics, + String? $__typename, + }); + TRes metrics( + Iterable Function( + Iterable< + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics< + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics>>) + _fn); +} + +class _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics< + TRes> + implements + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics< + TRes> { + _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics( + this._instance, + this._then, + ); + + final Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics + _instance; + + final TRes Function( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics) + _then; + + static const _undefined = {}; + + TRes call({ + Object? metrics = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics( + metrics: metrics == _undefined || metrics == null + ? _instance.metrics + : (metrics as List< + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics>), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + TRes metrics( + Iterable Function( + Iterable< + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics< + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics>>) + _fn) => + call( + metrics: _fn(_instance.metrics.map((e) => + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics( + e, + (i) => i, + ))).toList()); +} + +class _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics< + TRes> + implements + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics< + TRes> { + _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics( + this._res); + + TRes _res; + + call({ + List? + metrics, + String? $__typename, + }) => + _res; + + metrics(_fn) => _res; +} + +class Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics + implements Fragment$MonitoringMetrics$metrics { + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics({ + required this.metricId, + required this.values, + this.$__typename = 'MonitoringMetric', + }); + + factory Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics.fromJson( + Map json) { + final l$metricId = json['metricId']; + final l$values = json['values']; + final l$$__typename = json['__typename']; + return Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics( + metricId: (l$metricId as String), + values: (l$values as List) + .map((e) => + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values + .fromJson((e as Map))) + .toList(), + $__typename: (l$$__typename as String), + ); + } + + final String metricId; + + final List< + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values> + values; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$metricId = metricId; + _resultData['metricId'] = l$metricId; + final l$values = values; + _resultData['values'] = l$values.map((e) => e.toJson()).toList(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$metricId = metricId; + final l$values = values; + final l$$__typename = $__typename; + return Object.hashAll([ + l$metricId, + Object.hashAll(l$values.map((v) => v)), + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics) || + runtimeType != other.runtimeType) { + return false; + } + final l$metricId = metricId; + final lOther$metricId = other.metricId; + if (l$metricId != lOther$metricId) { + return false; + } + final l$values = values; + final lOther$values = other.values; + if (l$values.length != lOther$values.length) { + return false; + } + for (int i = 0; i < l$values.length; i++) { + final l$values$entry = l$values[i]; + final lOther$values$entry = lOther$values[i]; + if (l$values$entry != lOther$values$entry) { + return false; + } + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics + on Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics { + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics< + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics> + get copyWith => + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics< + TRes> { + factory CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics + instance, + TRes Function( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics) + then, + ) = _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics; + + factory CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics.stub( + TRes res) = + _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics; + + TRes call({ + String? metricId, + List? + values, + String? $__typename, + }); + TRes values( + Iterable Function( + Iterable< + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values< + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values>>) + _fn); +} + +class _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics< + TRes> + implements + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics< + TRes> { + _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics( + this._instance, + this._then, + ); + + final Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics + _instance; + + final TRes Function( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics) + _then; + + static const _undefined = {}; + + TRes call({ + Object? metricId = _undefined, + Object? values = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics( + metricId: metricId == _undefined || metricId == null + ? _instance.metricId + : (metricId as String), + values: values == _undefined || values == null + ? _instance.values + : (values as List< + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values>), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + + TRes values( + Iterable Function( + Iterable< + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values< + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values>>) + _fn) => + call( + values: _fn(_instance.values.map((e) => + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values( + e, + (i) => i, + ))).toList()); +} + +class _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics< + TRes> + implements + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics< + TRes> { + _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics( + this._res); + + TRes _res; + + call({ + String? metricId, + List? + values, + String? $__typename, + }) => + _res; + + values(_fn) => _res; +} + +class Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values + implements Fragment$MonitoringMetrics$metrics$values { + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values({ + required this.timestamp, + required this.value, + this.$__typename = 'MonitoringValue', + }); + + factory Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values.fromJson( + Map json) { + final l$timestamp = json['timestamp']; + final l$value = json['value']; + final l$$__typename = json['__typename']; + return Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values( + timestamp: dateTimeFromJson(l$timestamp), + value: (l$value as String), + $__typename: (l$$__typename as String), + ); + } + + final DateTime timestamp; + + final String value; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$timestamp = timestamp; + _resultData['timestamp'] = dateTimeToJson(l$timestamp); + final l$value = value; + _resultData['value'] = l$value; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$timestamp = timestamp; + final l$value = value; + final l$$__typename = $__typename; + return Object.hashAll([ + l$timestamp, + l$value, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values) || + runtimeType != other.runtimeType) { + return false; + } + final l$timestamp = timestamp; + final lOther$timestamp = other.timestamp; + if (l$timestamp != lOther$timestamp) { + return false; + } + final l$value = value; + final lOther$value = other.value; + if (l$value != lOther$value) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values + on Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values { + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values< + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values> + get copyWith => + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values< + TRes> { + factory CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values + instance, + TRes Function( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values) + then, + ) = _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values; + + factory CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values.stub( + TRes res) = + _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values; + + TRes call({ + DateTime? timestamp, + String? value, + String? $__typename, + }); +} + +class _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values< + TRes> + implements + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values< + TRes> { + _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values( + this._instance, + this._then, + ); + + final Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values + _instance; + + final TRes Function( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values) + _then; + + static const _undefined = {}; + + TRes call({ + Object? timestamp = _undefined, + Object? value = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values( + timestamp: timestamp == _undefined || timestamp == null + ? _instance.timestamp + : (timestamp as DateTime), + value: value == _undefined || value == null + ? _instance.value + : (value as String), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values< + TRes> + implements + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values< + TRes> { + _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringMetrics$metrics$values( + this._res); + + TRes _res; + + call({ + DateTime? timestamp, + String? value, + String? $__typename, + }) => + _res; +} + +class Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError + implements + Fragment$MonitoringQueryError, + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage { + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError({ + required this.error, + this.$__typename = 'MonitoringQueryError', + }); + + factory Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError.fromJson( + Map json) { + final l$error = json['error']; + final l$$__typename = json['__typename']; + return Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError( + error: (l$error as String), + $__typename: (l$$__typename as String), + ); + } + + final String error; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$error = error; + _resultData['error'] = l$error; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$error = error; + final l$$__typename = $__typename; + return Object.hashAll([ + l$error, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError) || + runtimeType != other.runtimeType) { + return false; + } + final l$error = error; + final lOther$error = other.error; + if (l$error != lOther$error) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError + on Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError { + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError< + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError> + get copyWith => + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError< + TRes> { + factory CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError + instance, + TRes Function( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError) + then, + ) = _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError; + + factory CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError.stub( + TRes res) = + _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError; + + TRes call({ + String? error, + String? $__typename, + }); +} + +class _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError< + TRes> + implements + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError< + TRes> { + _CopyWithImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError( + this._instance, + this._then, + ); + + final Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError + _instance; + + final TRes Function( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError) + _then; + + static const _undefined = {}; + + TRes call({ + Object? error = _undefined, + Object? $__typename = _undefined, + }) => + _then( + Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError( + error: error == _undefined || error == null + ? _instance.error + : (error as String), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError< + TRes> + implements + CopyWith$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError< + TRes> { + _CopyWithStubImpl$Query$GetDiskMetrics$monitoring$diskUsage$overallUsage$$MonitoringQueryError( + this._res); + + TRes _res; + + call({ + String? error, + String? $__typename, + }) => + _res; +} diff --git a/lib/logic/api_maps/graphql_maps/schema/schema.graphql b/lib/logic/api_maps/graphql_maps/schema/schema.graphql index 7d9b15dc..ee250f3b 100644 --- a/lib/logic/api_maps/graphql_maps/schema/schema.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/schema.graphql @@ -280,7 +280,7 @@ type Monitoring { } type MonitoringMetric { - id: String! + metricId: String! values: [MonitoringValue!]! } diff --git a/lib/logic/api_maps/graphql_maps/server_api/monitoring_api.dart b/lib/logic/api_maps/graphql_maps/server_api/monitoring_api.dart new file mode 100644 index 00000000..66f1e02a --- /dev/null +++ b/lib/logic/api_maps/graphql_maps/server_api/monitoring_api.dart @@ -0,0 +1,122 @@ +part of 'server_api.dart'; + +mixin MonitoringApi on GraphQLApiMap { + Future> getServerMetrics({ + required final int step, + required final DateTime start, + required final DateTime end, + }) async { + QueryResult response; + + try { + final GraphQLClient client = await getClient(); + final variables = Variables$Query$GetOverallCpuAndNetworkMetrics( + step: step, + start: start, + end: end, + ); + final query = + Options$Query$GetOverallCpuAndNetworkMetrics(variables: variables); + response = await client.query$GetOverallCpuAndNetworkMetrics(query); + if (response.hasException) { + print(response.exception.toString()); + return GenericResult( + success: false, + data: null, + ); + } + if (response.parsedData == null) { + return GenericResult( + success: false, + data: null, + ); + } + if (response.parsedData?.monitoring.cpuUsage.overallUsage + is Fragment$MonitoringQueryError || + response.parsedData?.monitoring.networkUsage.overallUsage + is Fragment$MonitoringQueryError) { + return GenericResult( + success: false, + data: null, + ); + } + final metrics = ServerMetrics.fromGraphQL( + data: response.parsedData!.monitoring, + stepsInSecond: step, + start: start, + end: end, + ); + return GenericResult( + success: true, + data: metrics, + ); + } catch (e) { + print(e); + return GenericResult( + success: false, + data: null, + message: e.toString(), + ); + } + } + + Future> getMemoryMetrics({ + required final int step, + required final DateTime start, + required final DateTime end, + }) async { + QueryResult response; + + try { + final GraphQLClient client = await getClient(); + final variables = Variables$Query$GetMemoryMetrics( + step: step, + start: start, + end: end, + ); + final query = Options$Query$GetMemoryMetrics(variables: variables); + response = await client.query$GetMemoryMetrics(query); + if (response.hasException) { + print(response.exception.toString()); + return GenericResult( + success: false, + data: null, + ); + } + if (response.parsedData == null) { + return GenericResult( + success: false, + data: null, + ); + } + if (response.parsedData?.monitoring.memoryUsage.overallUsage + is Fragment$MonitoringQueryError || + response.parsedData?.monitoring.memoryUsage.averageUsageByService + is Fragment$MonitoringQueryError || + response.parsedData?.monitoring.memoryUsage.maxUsageByService + is Fragment$MonitoringQueryError) { + return GenericResult( + success: false, + data: null, + ); + } + final metrics = MemoryMetrics.fromGraphQL( + data: response.parsedData!.monitoring, + stepsInSecond: step, + start: start, + end: end, + ); + return GenericResult( + success: true, + data: metrics, + ); + } catch (e) { + print(e); + return GenericResult( + success: false, + data: null, + message: e.toString(), + ); + } + } +} diff --git a/lib/logic/api_maps/graphql_maps/server_api/server_api.dart b/lib/logic/api_maps/graphql_maps/server_api/server_api.dart index 057fa5e8..8e9f4a5c 100644 --- a/lib/logic/api_maps/graphql_maps/server_api/server_api.dart +++ b/lib/logic/api_maps/graphql_maps/server_api/server_api.dart @@ -5,6 +5,7 @@ import 'package:selfprivacy/logic/api_maps/graphql_maps/graphql_api_map.dart'; import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/backups.graphql.dart'; import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart'; import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/logs.graphql.dart'; +import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/monitoring.graphql.dart'; import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/schema.graphql.dart'; import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/server_api.graphql.dart'; import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart'; @@ -23,6 +24,7 @@ import 'package:selfprivacy/logic/models/json/dns_records.dart'; import 'package:selfprivacy/logic/models/json/recovery_token_status.dart'; import 'package:selfprivacy/logic/models/json/server_disk_volume.dart'; import 'package:selfprivacy/logic/models/json/server_job.dart'; +import 'package:selfprivacy/logic/models/metrics.dart'; import 'package:selfprivacy/logic/models/server_logs.dart'; import 'package:selfprivacy/logic/models/service.dart'; import 'package:selfprivacy/logic/models/ssh_settings.dart'; @@ -37,6 +39,7 @@ part 'services_api.dart'; part 'users_api.dart'; part 'volume_api.dart'; part 'logs_api.dart'; +part 'monitoring_api.dart'; class ServerApi extends GraphQLApiMap with @@ -46,7 +49,8 @@ class ServerApi extends GraphQLApiMap ServicesApi, UsersApi, BackupsApi, - LogsApi { + LogsApi, + MonitoringApi { ServerApi({ this.hasLogger = false, this.isWithToken = true, diff --git a/lib/logic/cubit/metrics/metrics_cubit.dart b/lib/logic/cubit/metrics/metrics_cubit.dart index 7d6394c1..15d21eba 100644 --- a/lib/logic/cubit/metrics/metrics_cubit.dart +++ b/lib/logic/cubit/metrics/metrics_cubit.dart @@ -39,7 +39,16 @@ class MetricsCubit extends Cubit { void load(final Period period) async { try { - final MetricsLoaded newState = await repository.getMetrics(period); + final MetricsLoaded newState = await repository.getServerMetrics(period); + timer = Timer( + Duration(seconds: newState.metrics.stepsInSecond.toInt()), + () => load(newState.period), + ); + emit(newState); + return; + } catch (_) {} + try { + final MetricsLoaded newState = await repository.getLegacyMetrics(period); timer = Timer( Duration(seconds: newState.metrics.stepsInSecond.toInt()), () => load(newState.period), diff --git a/lib/logic/cubit/metrics/metrics_repository.dart b/lib/logic/cubit/metrics/metrics_repository.dart index 53a43ab3..9e8652a0 100644 --- a/lib/logic/cubit/metrics/metrics_repository.dart +++ b/lib/logic/cubit/metrics/metrics_repository.dart @@ -1,3 +1,5 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:pub_semver/pub_semver.dart'; import 'package:selfprivacy/config/get_it_config.dart'; import 'package:selfprivacy/logic/common_enum/common_enum.dart'; @@ -16,7 +18,66 @@ class MetricsUnsupportedException implements Exception { } class MetricsRepository { - Future getMetrics(final Period period) async { + static const String metricsSupportedVersion = '>=3.3.0'; + Future getServerMetrics(final Period period) async { + final String? apiVersion = + getIt().apiData.apiVersion.data; + if (apiVersion == null) { + throw Exception('basis.network_error'.tr()); + } + if (!VersionConstraint.parse(metricsSupportedVersion) + .allows(Version.parse(apiVersion))) { + throw Exception( + 'basis.feature_unsupported_on_api_version'.tr( + namedArgs: { + 'versionConstraint': metricsSupportedVersion, + 'currentVersion': apiVersion, + }, + ), + ); + } + + final DateTime end = DateTime.now(); + DateTime start; + + switch (period) { + case Period.hour: + start = end.subtract(const Duration(hours: 1)); + break; + case Period.day: + start = end.subtract(const Duration(days: 1)); + break; + case Period.month: + start = end.subtract(const Duration(days: 15)); + break; + } + + final result = await getIt().api.getServerMetrics( + start: start, + end: end, + step: end.difference(start).inSeconds ~/ 120, + ); + + if (result.data == null || !result.success) { + throw MetricsLoadException('Metrics data is null'); + } + + final memoryResult = + await getIt().api.getMemoryMetrics( + start: start, + end: end, + step: end.difference(start).inSeconds ~/ 120, + ); + + return MetricsLoaded( + period: period, + metrics: result.data!, + source: MetricsDataSource.server, + memoryMetrics: memoryResult.data, + ); + } + + Future getLegacyMetrics(final Period period) async { if (!(ProvidersController.currentServerProvider?.isAuthorized ?? false)) { throw MetricsUnsupportedException('Server Provider data is null'); } @@ -50,6 +111,7 @@ class MetricsRepository { return MetricsLoaded( period: period, metrics: result.data!, + source: MetricsDataSource.legacy, ); } } diff --git a/lib/logic/cubit/metrics/metrics_state.dart b/lib/logic/cubit/metrics/metrics_state.dart index f1bd78dd..a8b36467 100644 --- a/lib/logic/cubit/metrics/metrics_state.dart +++ b/lib/logic/cubit/metrics/metrics_state.dart @@ -15,19 +15,31 @@ class MetricsLoading extends MetricsState { List get props => [period]; } +enum MetricsDataSource { + server, + legacy, +} + class MetricsLoaded extends MetricsState { const MetricsLoaded({ required this.period, required this.metrics, + required this.source, + this.memoryMetrics, + this.diskMetrics, }); @override final Period period; final ServerMetrics metrics; + final MemoryMetrics? memoryMetrics; + final DiskMetrics? diskMetrics; + final MetricsDataSource source; @override - List get props => [period, metrics]; + List get props => + [period, metrics, memoryMetrics, diskMetrics, source]; } class MetricsUnsupported extends MetricsState { diff --git a/lib/logic/models/metrics.dart b/lib/logic/models/metrics.dart index 4f5d3efc..acb0d5e7 100644 --- a/lib/logic/models/metrics.dart +++ b/lib/logic/models/metrics.dart @@ -1,3 +1,5 @@ +import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/monitoring.graphql.dart'; + class TimeSeriesData { TimeSeriesData( this.secondsSinceEpoch, @@ -20,6 +22,52 @@ class ServerMetrics { required this.end, }); + ServerMetrics.fromGraphQL({ + required final Query$GetOverallCpuAndNetworkMetrics$monitoring data, + required final int stepsInSecond, + required final DateTime start, + required final DateTime end, + }) : this( + stepsInSecond: stepsInSecond, + cpu: (data.cpuUsage.overallUsage as Fragment$MonitoringValues) + .values + .map( + (final metric) => TimeSeriesData( + // Convert DateTime to seconds since epoch + metric.timestamp.millisecondsSinceEpoch ~/ 1000, + // Parse string as a float + double.parse(metric.value), + ), + ) + .toList(), + bandwidthIn: + (data.networkUsage.overallUsage as Fragment$MonitoringMetrics) + .metrics + .firstWhere((final element) => element.metricId == 'receive') + .values + .map( + (final metric) => TimeSeriesData( + metric.timestamp.millisecondsSinceEpoch ~/ 1000, + double.parse(metric.value), + ), + ) + .toList(), + bandwidthOut: + (data.networkUsage.overallUsage as Fragment$MonitoringMetrics) + .metrics + .firstWhere((final element) => element.metricId == 'transmit') + .values + .map( + (final metric) => TimeSeriesData( + metric.timestamp.millisecondsSinceEpoch ~/ 1000, + double.parse(metric.value), + ), + ) + .toList(), + start: start, + end: end, + ); + final num stepsInSecond; final List cpu; final List bandwidthIn; @@ -28,3 +76,79 @@ class ServerMetrics { final DateTime start; final DateTime end; } + +class MemoryMetrics { + MemoryMetrics({ + required this.stepsInSecond, + required this.overallMetrics, + required this.averageMetricsByService, + required this.maxMetricsByService, + required this.start, + required this.end, + }); + + MemoryMetrics.fromGraphQL({ + required final Query$GetMemoryMetrics$monitoring data, + required final int stepsInSecond, + required final DateTime start, + required final DateTime end, + }) : this( + stepsInSecond: stepsInSecond, + overallMetrics: + (data.memoryUsage.overallUsage as Fragment$MonitoringValues) + .values + .map( + (final metric) => TimeSeriesData( + metric.timestamp.millisecondsSinceEpoch ~/ 1000, + double.parse(metric.value), + ), + ) + .toList(), + averageMetricsByService: Map.fromEntries( + (data.memoryUsage.averageUsageByService + as Fragment$MonitoringMetrics) + .metrics + .map( + (final metric) => MapEntry( + metric.metricId, + double.parse(metric.values.first.value), + ), + ), + ), + maxMetricsByService: Map.fromEntries( + (data.memoryUsage.maxUsageByService as Fragment$MonitoringMetrics) + .metrics + .map( + (final metric) => MapEntry( + metric.metricId, + double.parse(metric.values.first.value), + ), + ), + ), + start: start, + end: end, + ); + + final num stepsInSecond; + final List overallMetrics; + final Map averageMetricsByService; + final Map maxMetricsByService; + + final DateTime start; + final DateTime end; +} + +class DiskMetrics { + DiskMetrics({ + required this.stepsInSecond, + required this.diskMetrics, + required this.start, + required this.end, + }); + + final num stepsInSecond; + final List diskMetrics; + + final DateTime start; + final DateTime end; +} diff --git a/lib/ui/pages/server_details/charts/chart.dart b/lib/ui/pages/server_details/charts/chart.dart index 6066aa32..b2a30657 100644 --- a/lib/ui/pages/server_details/charts/chart.dart +++ b/lib/ui/pages/server_details/charts/chart.dart @@ -39,6 +39,50 @@ class _Chart extends StatelessWidget { ), ), const SizedBox(height: 8), + FilledCard( + clipped: false, + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'resource_chart.memory'.tr(), + style: Theme.of(context).textTheme.titleMedium?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + ), + const SizedBox(height: 16), + Stack( + alignment: Alignment.center, + children: [ + if (state is MetricsLoaded && state.memoryMetrics != null) + getMemoryChart(state), + AnimatedOpacity( + duration: const Duration(milliseconds: 200), + opacity: state is MetricsLoading ? 1 : 0, + child: const _GraphLoadingCardContent(), + ), + ], + ), + const Divider(), + ListTile( + title: Text('resource_chart.view_usage_by_service'.tr()), + leading: Icon( + Icons.area_chart_outlined, + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + onTap: () { + context.pushRoute( + const MemoryUsageByServiceRoute(), + ); + }, + ), + ], + ), + ), + ), + const SizedBox(height: 8), FilledCard( clipped: false, child: Padding( @@ -171,6 +215,23 @@ class _Chart extends StatelessWidget { ); } + Widget getMemoryChart(final MetricsLoaded state) { + final data = state.memoryMetrics; + + if (data == null) { + return const SizedBox(); + } + + return SizedBox( + height: 200, + child: MemoryChart( + data: data.overallMetrics, + period: state.period, + start: state.metrics.start, + ), + ); + } + Widget getBandwidthChart(final MetricsLoaded state) { final ppsIn = state.metrics.bandwidthIn; final ppsOut = state.metrics.bandwidthOut; diff --git a/lib/ui/pages/server_details/charts/memory_chart.dart b/lib/ui/pages/server_details/charts/memory_chart.dart new file mode 100644 index 00000000..6379f16b --- /dev/null +++ b/lib/ui/pages/server_details/charts/memory_chart.dart @@ -0,0 +1,179 @@ +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:selfprivacy/logic/common_enum/common_enum.dart'; +import 'package:selfprivacy/logic/models/metrics.dart'; +import 'package:selfprivacy/ui/pages/server_details/charts/bottom_title.dart'; + +class MemoryChart extends StatelessWidget { + const MemoryChart({ + required this.data, + required this.period, + required this.start, + super.key, + }); + + final List data; + final Period period; + final DateTime start; + + List getSpots() { + var i = 0; + final List res = []; + + for (final d in data) { + res.add(FlSpot(i.toDouble(), d.value)); + i++; + } + + return res; + } + + @override + Widget build(final BuildContext context) => LineChart( + LineChartData( + lineTouchData: LineTouchData( + enabled: true, + touchTooltipData: LineTouchTooltipData( + getTooltipColor: (final LineBarSpot _) => + Theme.of(context).colorScheme.surface, + tooltipPadding: const EdgeInsets.all(8), + getTooltipItems: (final List touchedBarSpots) { + final List res = []; + + for (final spot in touchedBarSpots) { + final value = spot.y; + final date = data[spot.x.toInt()].time; + + res.add( + LineTooltipItem( + '${value.toStringAsFixed(2)}% at ${DateFormat('HH:mm dd.MM.yyyy').format(date)}', + TextStyle( + color: Theme.of(context).colorScheme.onSurface, + fontWeight: FontWeight.bold, + ), + ), + ); + } + + return res; + }, + ), + ), + lineBarsData: [ + LineChartBarData( + spots: getSpots(), + isCurved: false, + barWidth: 2, + color: Theme.of(context).colorScheme.primary, + dotData: const FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: true, + gradient: LinearGradient( + colors: [ + Theme.of(context).colorScheme.primary.withOpacity(0.5), + Theme.of(context).colorScheme.primary.withOpacity(0.0), + ], + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + ), + ), + ), + ], + minY: 0, + // Maximal value of data by 100 step + maxY: 100, + minX: 0, + titlesData: FlTitlesData( + topTitles: const AxisTitles( + sideTitles: SideTitles(showTitles: false), + ), + bottomTitles: AxisTitles( + sideTitles: SideTitles( + interval: 40, + reservedSize: 30, + getTitlesWidget: (final value, final titleMeta) => Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + bottomTitle( + value.toInt(), + data, + period, + ), + style: Theme.of(context).textTheme.labelSmall?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + ), + ), + showTitles: true, + ), + ), + leftTitles: const AxisTitles( + sideTitles: SideTitles( + showTitles: false, + ), + ), + rightTitles: const AxisTitles( + sideTitles: SideTitles( + showTitles: false, + ), + ), + ), + gridData: FlGridData( + show: true, + drawVerticalLine: true, + horizontalInterval: 25, + verticalInterval: 40, + getDrawingHorizontalLine: (final value) => FlLine( + color: Theme.of(context).colorScheme.outline.withOpacity(0.3), + strokeWidth: 1, + ), + getDrawingVerticalLine: (final value) => FlLine( + color: Theme.of(context).colorScheme.outline.withOpacity(0.3), + strokeWidth: 1, + ), + ), + borderData: FlBorderData( + show: true, + border: Border( + bottom: BorderSide( + color: Theme.of(context).colorScheme.outline.withOpacity(0.3), + width: 1, + ), + left: BorderSide( + color: Theme.of(context).colorScheme.outline.withOpacity(0.3), + width: 1, + ), + right: BorderSide( + color: Theme.of(context).colorScheme.outline.withOpacity(0.3), + width: 1, + ), + top: BorderSide( + color: Theme.of(context).colorScheme.outline.withOpacity(0.3), + width: 1, + ), + ), + ), + ), + ); + + bool checkToShowTitle( + final double minValue, + final double maxValue, + final SideTitles sideTitles, + final double appliedInterval, + final double value, + ) { + if (value < 0) { + return false; + } else if (value == 0) { + return true; + } + + final localValue = value - minValue; + final v = localValue / 20; + return v - v.floor() == 0; + } +} diff --git a/lib/ui/pages/server_details/memory_usage_by_service_screen.dart b/lib/ui/pages/server_details/memory_usage_by_service_screen.dart new file mode 100644 index 00000000..c9727405 --- /dev/null +++ b/lib/ui/pages/server_details/memory_usage_by_service_screen.dart @@ -0,0 +1,156 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:collection/collection.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:selfprivacy/logic/bloc/services/services_bloc.dart'; +import 'package:selfprivacy/logic/common_enum/common_enum.dart'; +import 'package:selfprivacy/logic/cubit/metrics/metrics_cubit.dart'; +import 'package:selfprivacy/logic/models/disk_size.dart'; +import 'package:selfprivacy/ui/components/brand_icons/brand_icons.dart'; +import 'package:selfprivacy/ui/components/buttons/segmented_buttons.dart'; +import 'package:selfprivacy/ui/helpers/empty_page_placeholder.dart'; +import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart'; + +@RoutePage() +class MemoryUsageByServiceScreen extends StatelessWidget { + const MemoryUsageByServiceScreen({super.key}); + + @override + Widget build(final BuildContext context) => BlocProvider( + create: (final context) => MetricsCubit()..restart(), + child: const _MemoryUsageByServiceContents(), + ); +} + +class _MemoryUsageByServiceContents extends StatelessWidget { + const _MemoryUsageByServiceContents(); + + @override + Widget build(final BuildContext context) { + final MetricsCubit cubit = context.watch(); + final Period period = cubit.state.period; + final MetricsState state = cubit.state; + + if (state is MetricsUnsupported || + (state is MetricsLoaded && state.memoryMetrics == null)) { + return BrandHeroScreen( + heroTitle: 'resource_chart.memory'.tr(), + children: [ + Center( + child: Center( + child: EmptyPagePlaceholder( + title: 'basis.error'.tr(), + iconData: Icons.error_outline_outlined, + ), + ), + ), + ], + ); + } + if (state is MetricsLoading) { + return BrandHeroScreen( + heroTitle: 'resource_chart.memory'.tr(), + children: const [ + Center( + child: CircularProgressIndicator(), + ), + ], + ); + } + + final averageUsageByServices = + (state as MetricsLoaded).memoryMetrics!.averageMetricsByService; + final maxUsageByServices = state.memoryMetrics!.maxMetricsByService; + + // For each service, gather average and max usages + final List children = []; + for (final slice in averageUsageByServices.keys.sorted()) { + final DiskSize averageUsage = + DiskSize(byte: averageUsageByServices[slice]?.toInt() ?? 0); + final DiskSize maxUsage = + DiskSize(byte: maxUsageByServices[slice]?.toInt() ?? 0); + String? serviceName; + Widget? icon; + if (slice == 'system') { + serviceName = 'resource_chart.system'.tr(); + icon = const Icon(BrandIcons.server); + } else if (slice == 'user') { + serviceName = 'resource_chart.ssh_users'.tr(); + icon = const Icon(BrandIcons.terminal); + } else { + final service = context + .read() + .state + .getServiceById(slice.replaceAll('_', '-')); + serviceName = service?.displayName ?? slice; + icon = service?.svgIcon != null + ? SvgPicture.string( + service!.svgIcon, + width: 22.0, + height: 24.0, + colorFilter: ColorFilter.mode( + Theme.of(context).colorScheme.onBackground, + BlendMode.srcIn, + ), + ) + : const Icon(BrandIcons.box); + } + + if (serviceName == slice && + averageUsage.byte == 0 && + maxUsage.byte == 0) { + continue; + } + + children.add( + ListTile( + title: Text(serviceName), + subtitle: Text( + 'resource_chart.ram_usage'.tr( + namedArgs: { + 'average': averageUsage.toString(), + 'max': maxUsage.toString(), + }, + ), + ), + dense: true, + leading: icon, + ), + ); + } + + return BrandHeroScreen( + heroTitle: 'resource_chart.memory'.tr(), + children: [ + SegmentedButtons( + isSelected: [ + period == Period.month, + period == Period.day, + period == Period.hour, + ], + onPressed: (final index) { + switch (index) { + case 0: + cubit.changePeriod(Period.month); + break; + case 1: + cubit.changePeriod(Period.day); + break; + case 2: + cubit.changePeriod(Period.hour); + break; + } + }, + titles: [ + 'resource_chart.month'.tr(), + 'resource_chart.day'.tr(), + 'resource_chart.hour'.tr(), + ], + ), + ...children, + ], + ); + } +} diff --git a/lib/ui/pages/server_details/server_details_screen.dart b/lib/ui/pages/server_details/server_details_screen.dart index 064f0740..00871c32 100644 --- a/lib/ui/pages/server_details/server_details_screen.dart +++ b/lib/ui/pages/server_details/server_details_screen.dart @@ -13,6 +13,7 @@ import 'package:selfprivacy/ui/components/cards/filled_card.dart'; import 'package:selfprivacy/ui/components/list_tiles/list_tile_on_surface_variant.dart'; import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart'; import 'package:selfprivacy/ui/pages/server_details/charts/cpu_chart.dart'; +import 'package:selfprivacy/ui/pages/server_details/charts/memory_chart.dart'; import 'package:selfprivacy/ui/pages/server_details/charts/network_charts.dart'; import 'package:selfprivacy/ui/pages/server_storage/storage_card.dart'; import 'package:selfprivacy/ui/router/router.dart'; diff --git a/lib/ui/router/router.dart b/lib/ui/router/router.dart index 05126d25..7c1d9fe3 100644 --- a/lib/ui/router/router.dart +++ b/lib/ui/router/router.dart @@ -18,6 +18,7 @@ import 'package:selfprivacy/ui/pages/providers/providers.dart'; import 'package:selfprivacy/ui/pages/recovery_key/recovery_key.dart'; import 'package:selfprivacy/ui/pages/root_route.dart'; import 'package:selfprivacy/ui/pages/server_details/logs/logs_screen.dart'; +import 'package:selfprivacy/ui/pages/server_details/memory_usage_by_service_screen.dart'; import 'package:selfprivacy/ui/pages/server_details/server_details_screen.dart'; import 'package:selfprivacy/ui/pages/server_details/server_settings_screen.dart'; import 'package:selfprivacy/ui/pages/server_storage/binds_migration/services_migration.dart'; @@ -109,6 +110,7 @@ class RootRouter extends _$RootRouter { AutoRoute(page: ServerSettingsRoute.page), AutoRoute(page: ServerLogsRoute.page), AutoRoute(page: TokensRoute.page), + AutoRoute(page: MemoryUsageByServiceRoute.page), ], ), AutoRoute(page: ServicesMigrationRoute.page), @@ -166,6 +168,8 @@ String getRouteTitle(final String routeName) { return 'storage.extending_volume_title'; case 'TokensRoute': return 'tokens.title'; + case 'MemoryUsageByServiceRoute': + return 'resource_chart.memory'; default: return routeName; } diff --git a/lib/ui/router/router.gr.dart b/lib/ui/router/router.gr.dart index ff67e07b..2936f3fe 100644 --- a/lib/ui/router/router.gr.dart +++ b/lib/ui/router/router.gr.dart @@ -84,6 +84,12 @@ abstract class _$RootRouter extends RootStackRouter { child: const InitializingPage(), ); }, + MemoryUsageByServiceRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const MemoryUsageByServiceScreen(), + ); + }, MoreRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, @@ -415,6 +421,20 @@ class InitializingRoute extends PageRouteInfo { static const PageInfo page = PageInfo(name); } +/// generated route for +/// [MemoryUsageByServiceScreen] +class MemoryUsageByServiceRoute extends PageRouteInfo { + const MemoryUsageByServiceRoute({List? children}) + : super( + MemoryUsageByServiceRoute.name, + initialChildren: children, + ); + + static const String name = 'MemoryUsageByServiceRoute'; + + static const PageInfo page = PageInfo(name); +} + /// generated route for /// [MorePage] class MoreRoute extends PageRouteInfo {