diff --git a/veilid-flutter/analysis_options.yaml b/veilid-flutter/analysis_options.yaml index a5744c1c..e07e9e94 100644 --- a/veilid-flutter/analysis_options.yaml +++ b/veilid-flutter/analysis_options.yaml @@ -1,4 +1,5 @@ include: package:flutter_lints/flutter.yaml -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options +analyzer: + errors: + invalid_annotation_target: ignore diff --git a/veilid-flutter/build.sh b/veilid-flutter/build.sh new file mode 100755 index 00000000..1f08284e --- /dev/null +++ b/veilid-flutter/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -e +dart run build_runner build diff --git a/veilid-flutter/build.yaml b/veilid-flutter/build.yaml new file mode 100644 index 00000000..84fde8c8 --- /dev/null +++ b/veilid-flutter/build.yaml @@ -0,0 +1,10 @@ +targets: + $default: + sources: + exclude: + - example/** + builders: + json_serializable: + options: + explicit_to_json: true + field_rename: snake diff --git a/veilid-flutter/example/analysis_options.yaml b/veilid-flutter/example/analysis_options.yaml index 61b6c4de..e07e9e94 100644 --- a/veilid-flutter/example/analysis_options.yaml +++ b/veilid-flutter/example/analysis_options.yaml @@ -1,29 +1,5 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. include: package:flutter_lints/flutter.yaml -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options +analyzer: + errors: + invalid_annotation_target: ignore diff --git a/veilid-flutter/example/build.sh b/veilid-flutter/example/build.sh new file mode 100755 index 00000000..c5558594 --- /dev/null +++ b/veilid-flutter/example/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -e +dart run build_runner build + diff --git a/veilid-flutter/example/lib/app.dart b/veilid-flutter/example/lib/app.dart index 4907f682..5acc1ef9 100644 --- a/veilid-flutter/example/lib/app.dart +++ b/veilid-flutter/example/lib/app.dart @@ -112,13 +112,16 @@ class _MyAppState extends State with UiLoggy { if (startup && !_startedUp) { var config = await getDefaultVeilidConfig("Veilid Plugin Example"); if (const String.fromEnvironment("DELETE_TABLE_STORE") == "1") { - config.tableStore.delete = true; + config = config.copyWith( + tableStore: config.tableStore.copyWith(delete: true)); } if (const String.fromEnvironment("DELETE_PROTECTED_STORE") == "1") { - config.protectedStore.delete = true; + config = config.copyWith( + protectedStore: config.protectedStore.copyWith(delete: true)); } if (const String.fromEnvironment("DELETE_BLOCK_STORE") == "1") { - config.blockStore.delete = true; + config = config.copyWith( + blockStore: config.blockStore.copyWith(delete: true)); } var updateStream = await Veilid.instance.startupVeilidCore(config); diff --git a/veilid-flutter/example/pubspec.lock b/veilid-flutter/example/pubspec.lock index 1daa306a..1df623b0 100644 --- a/veilid-flutter/example/pubspec.lock +++ b/veilid-flutter/example/pubspec.lock @@ -1,6 +1,22 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + url: "https://pub.dev" + source: hosted + version: "61.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + url: "https://pub.dev" + source: hosted + version: "5.13.0" ansicolor: dependency: "direct main" description: @@ -9,6 +25,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.1" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" async: dependency: transitive description: @@ -25,6 +49,70 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + build: + dependency: transitive + description: + name: build + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" + source: hosted + version: "1.1.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "6c4dd11d05d056e76320b828a1db0fc01ccd376922526f8e9d6c796a5adbac20" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b" + url: "https://pub.dev" + source: hosted + version: "2.4.6" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: "6d6ee4276b1c5f34f21fdf39425202712d2be82019983d52f351c94aafbc2c41" + url: "https://pub.dev" + source: hosted + version: "7.2.10" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: "598a2a682e2a7a90f08ba39c0aaa9374c5112340f0a2e275f61b59389543d166" + url: "https://pub.dev" + source: hosted + version: "8.6.1" change_case: dependency: transitive description: @@ -49,6 +137,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" clock: dependency: transitive description: @@ -57,6 +153,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "4ad01d6e56db961d29661561effde45e519939fdaeb46c351275b182eac70189" + url: "https://pub.dev" + source: hosted + version: "4.5.0" collection: dependency: transitive description: @@ -73,6 +177,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" cupertino_icons: dependency: "direct main" description: @@ -81,6 +193,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.5" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" + source: hosted + version: "2.3.2" equatable: dependency: transitive description: @@ -121,6 +241,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" flutter: dependency: "direct main" description: flutter @@ -130,18 +258,18 @@ packages: dependency: "direct main" description: name: flutter_acrylic - sha256: "5aea2c850c560c07717a62434ea9cb1565c2282dc78dd2e60f98a78c05f13d7b" + sha256: a9a1fdf91ff1fb47858fd82507f57e255a132a5d355056694fdb9fd303633b18 url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.1.3" flutter_lints: dependency: "direct dev" description: name: flutter_lints - sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" flutter_test: dependency: "direct dev" description: flutter @@ -152,6 +280,38 @@ packages: description: flutter source: sdk version: "0.0.0" + freezed: + dependency: "direct dev" + description: + name: freezed + sha256: a9520490532087cf38bf3f7de478ab6ebeb5f68bb1eb2641546d92719b224445 + url: "https://pub.dev" + source: hosted + version: "2.3.5" + freezed_annotation: + dependency: "direct main" + description: + name: freezed_annotation + sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 + url: "https://pub.dev" + source: hosted + version: "2.2.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" globbing: dependency: transitive description: @@ -160,6 +320,38 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.0" + graphs: + dependency: transitive + description: + name: graphs + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + url: "https://pub.dev" + source: hosted + version: "2.3.1" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" js: dependency: transitive description: @@ -168,14 +360,38 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" + json_annotation: + dependency: "direct main" + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + sha256: aa1f5a8912615733e0fdc7a02af03308933c93235bdc8d50d0b0c8a8ccb0b969 + url: "https://pub.dev" + source: hosted + version: "6.7.1" lints: dependency: transitive description: name: lints - sha256: "6b0206b0bf4f04961fc5438198ccb3a885685cd67d4d4a32cc20ad7f8adbe015" + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" + source: hosted + version: "1.2.0" loggy: dependency: "direct main" description: @@ -188,10 +404,10 @@ packages: dependency: transitive description: name: macos_window_utils - sha256: "510de576b5432dd9ef9e4c258abcc021c6dfbb17a78a344688848a6784b352b8" + sha256: b78a210aa70ca7ccad6e7b7b810fb4689c507f4a46e299214900b2a1eb70ea23 url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.1.3" matcher: dependency: transitive description: @@ -216,6 +432,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.1" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" path: dependency: "direct main" description: @@ -252,10 +484,10 @@ packages: dependency: transitive description: name: path_provider_linux - sha256: "2ae08f2216225427e64ad224a24354221c2c7907e448e6e0e8b57b1eb9f10ad1" + sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57 url: "https://pub.dev" source: hosted - version: "2.1.10" + version: "2.1.11" path_provider_platform_interface: dependency: transitive description: @@ -268,10 +500,10 @@ packages: dependency: transitive description: name: path_provider_windows - sha256: d3f80b32e83ec208ac95253e0cd4d298e104fbc63cb29c5c69edaed43b0c69d6 + sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96" url: "https://pub.dev" source: hosted - version: "2.1.6" + version: "2.1.7" platform: dependency: transitive description: @@ -296,6 +528,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" process: dependency: transitive description: @@ -304,6 +544,22 @@ packages: url: "https://pub.dev" source: hosted version: "4.2.4" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + url: "https://pub.dev" + source: hosted + version: "1.2.3" quiver: dependency: transitive description: @@ -312,11 +568,43 @@ packages: url: "https://pub.dev" source: hosted version: "3.2.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" + source: hosted + version: "1.0.4" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" + url: "https://pub.dev" + source: hosted + version: "1.3.4" source_span: dependency: transitive description: @@ -341,6 +629,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" string_scanner: dependency: transitive description: @@ -373,6 +669,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.1" + timing: + dependency: transitive + description: + name: timing + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" + source: hosted + version: "1.0.1" typed_data: dependency: transitive description: @@ -396,14 +700,30 @@ packages: relative: true source: path version: "0.0.1" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" + source: hosted + version: "2.4.0" win32: dependency: transitive description: name: win32 - sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c" + sha256: dfdf0136e0aa7a1b474ea133e67cb0154a0acd2599c4f3ada3b49d38d38793ee url: "https://pub.dev" source: hosted - version: "4.1.4" + version: "5.0.5" xdg_directories: dependency: transitive description: @@ -420,6 +740,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.5.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" sdks: dart: ">=3.0.0 <4.0.0" flutter: ">=3.7.0" diff --git a/veilid-flutter/example/pubspec.yaml b/veilid-flutter/example/pubspec.yaml index a3ac6915..47a40edc 100644 --- a/veilid-flutter/example/pubspec.yaml +++ b/veilid-flutter/example/pubspec.yaml @@ -38,6 +38,8 @@ dependencies: xterm: ^3.4.0 flutter_acrylic: ^1.0.0+2 ansicolor: ^2.0.1 + freezed_annotation: ^2.2.0 + json_annotation: ^4.8.1 dev_dependencies: flutter_test: @@ -49,6 +51,9 @@ dev_dependencies: # package. See that file for information about deactivating specific lint # rules and activating additional ones. flutter_lints: ^2.0.1 + build_runner: ^2.4.6 + freezed: ^2.3.5 + json_serializable: ^6.7.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/veilid-flutter/example/run_with_reset.bat b/veilid-flutter/example/reset_run.bat similarity index 100% rename from veilid-flutter/example/run_with_reset.bat rename to veilid-flutter/example/reset_run.bat diff --git a/veilid-flutter/example/run_with_reset.sh b/veilid-flutter/example/reset_run.sh similarity index 100% rename from veilid-flutter/example/run_with_reset.sh rename to veilid-flutter/example/reset_run.sh diff --git a/veilid-flutter/example/run.sh b/veilid-flutter/example/run.sh new file mode 100755 index 00000000..754c21a9 --- /dev/null +++ b/veilid-flutter/example/run.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +./build.sh +flutter run $@ diff --git a/veilid-flutter/lib/veilid.dart b/veilid-flutter/lib/veilid.dart index 650513a7..02ecd818 100644 --- a/veilid-flutter/lib/veilid.dart +++ b/veilid-flutter/lib/veilid.dart @@ -1,6 +1,9 @@ import 'dart:async'; import 'dart:typed_data'; +import 'package:equatable/equatable.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; + import 'veilid_stub.dart' if (dart.library.io) 'veilid_ffi.dart' if (dart.library.js) 'veilid_js.dart'; @@ -56,64 +59,61 @@ List Function(dynamic) jsonListConstructor( ////////////////////////////////////// /// VeilidVersion -class VeilidVersion { +@immutable +class VeilidVersion extends Equatable { final int major; final int minor; final int patch; + @override + List get props => [major, minor, patch]; - VeilidVersion(this.major, this.minor, this.patch); + const VeilidVersion(this.major, this.minor, this.patch); } ////////////////////////////////////// /// Timestamp -class Timestamp { +@immutable +class Timestamp extends Equatable { final BigInt value; - Timestamp({required this.value}); + @override + List get props => [value]; + + const Timestamp({required this.value}); @override - String toString() { - return value.toString(); - } + String toString() => value.toString(); + factory Timestamp.fromString(String s) => Timestamp(value: BigInt.parse(s)); - Timestamp.fromString(String s) : value = BigInt.parse(s); + String toJson() => toString(); + factory Timestamp.fromJson(dynamic json) => + Timestamp.fromString(json as String); - Timestamp.fromJson(dynamic json) : this.fromString(json as String); - String toJson() { - return toString(); - } + TimestampDuration diff(Timestamp other) => + TimestampDuration(value: value - other.value); - TimestampDuration diff(Timestamp other) { - return TimestampDuration(value: value - other.value); - } - - Timestamp offset(TimestampDuration dur) { - return Timestamp(value: value + dur.value); - } + Timestamp offset(TimestampDuration dur) => + Timestamp(value: value + dur.value); } -class TimestampDuration { +@immutable +class TimestampDuration extends Equatable { final BigInt value; - TimestampDuration({required this.value}); + @override + List get props => [value]; + + const TimestampDuration({required this.value}); @override - String toString() { - return value.toString(); - } + String toString() => value.toString(); + factory TimestampDuration.fromString(String s) => + TimestampDuration(value: BigInt.parse(s)); - TimestampDuration.fromString(String s) : value = BigInt.parse(s); + String toJson() => toString(); + factory TimestampDuration.fromJson(dynamic json) => + TimestampDuration.fromString(json as String); - TimestampDuration.fromJson(dynamic json) : this.fromString(json as String); - String toJson() { - return toString(); - } - - int toMillis() { - return (value ~/ BigInt.from(1000)).toInt(); - } - - BigInt toMicros(Timestamp other) { - return value; - } + int toMillis() => (value ~/ BigInt.from(1000)).toInt(); + BigInt toMicros() => value; } ////////////////////////////////////// diff --git a/veilid-flutter/lib/veilid_api_exception.dart b/veilid-flutter/lib/veilid_api_exception.dart index 40a9db66..e08525bb 100644 --- a/veilid-flutter/lib/veilid_api_exception.dart +++ b/veilid-flutter/lib/veilid_api_exception.dart @@ -1,6 +1,9 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + ////////////////////////////////////// /// VeilidAPIException +@immutable abstract class VeilidAPIException implements Exception { factory VeilidAPIException.fromJson(dynamic json) { switch (json["kind"]) { @@ -73,6 +76,7 @@ abstract class VeilidAPIException implements Exception { String toDisplayError(); } +@immutable class VeilidAPIExceptionNotInitialized implements VeilidAPIException { @override String toString() { @@ -85,6 +89,7 @@ class VeilidAPIExceptionNotInitialized implements VeilidAPIException { } } +@immutable class VeilidAPIExceptionAlreadyInitialized implements VeilidAPIException { @override String toString() { @@ -97,6 +102,7 @@ class VeilidAPIExceptionAlreadyInitialized implements VeilidAPIException { } } +@immutable class VeilidAPIExceptionTimeout implements VeilidAPIException { @override String toString() { @@ -109,6 +115,7 @@ class VeilidAPIExceptionTimeout implements VeilidAPIException { } } +@immutable class VeilidAPIExceptionTryAgain implements VeilidAPIException { @override String toString() { @@ -121,6 +128,7 @@ class VeilidAPIExceptionTryAgain implements VeilidAPIException { } } +@immutable class VeilidAPIExceptionShutdown implements VeilidAPIException { @override String toString() { @@ -133,6 +141,7 @@ class VeilidAPIExceptionShutdown implements VeilidAPIException { } } +@immutable class VeilidAPIExceptionInvalidTarget implements VeilidAPIException { @override String toString() { @@ -145,9 +154,9 @@ class VeilidAPIExceptionInvalidTarget implements VeilidAPIException { } } +@immutable class VeilidAPIExceptionNoConnection implements VeilidAPIException { final String message; - @override String toString() { return "VeilidAPIException: NoConnection (message: $message)"; @@ -159,12 +168,12 @@ class VeilidAPIExceptionNoConnection implements VeilidAPIException { } // - VeilidAPIExceptionNoConnection(this.message); + const VeilidAPIExceptionNoConnection(this.message); } +@immutable class VeilidAPIExceptionKeyNotFound implements VeilidAPIException { final String key; - @override String toString() { return "VeilidAPIException: KeyNotFound (key: $key)"; @@ -176,9 +185,10 @@ class VeilidAPIExceptionKeyNotFound implements VeilidAPIException { } // - VeilidAPIExceptionKeyNotFound(this.key); + const VeilidAPIExceptionKeyNotFound(this.key); } +@immutable class VeilidAPIExceptionInternal implements VeilidAPIException { final String message; @@ -193,9 +203,10 @@ class VeilidAPIExceptionInternal implements VeilidAPIException { } // - VeilidAPIExceptionInternal(this.message); + const VeilidAPIExceptionInternal(this.message); } +@immutable class VeilidAPIExceptionUnimplemented implements VeilidAPIException { final String message; @@ -210,9 +221,10 @@ class VeilidAPIExceptionUnimplemented implements VeilidAPIException { } // - VeilidAPIExceptionUnimplemented(this.message); + const VeilidAPIExceptionUnimplemented(this.message); } +@immutable class VeilidAPIExceptionParseError implements VeilidAPIException { final String message; final String value; @@ -228,9 +240,10 @@ class VeilidAPIExceptionParseError implements VeilidAPIException { } // - VeilidAPIExceptionParseError(this.message, this.value); + const VeilidAPIExceptionParseError(this.message, this.value); } +@immutable class VeilidAPIExceptionInvalidArgument implements VeilidAPIException { final String context; final String argument; @@ -247,9 +260,11 @@ class VeilidAPIExceptionInvalidArgument implements VeilidAPIException { } // - VeilidAPIExceptionInvalidArgument(this.context, this.argument, this.value); + const VeilidAPIExceptionInvalidArgument( + this.context, this.argument, this.value); } +@immutable class VeilidAPIExceptionMissingArgument implements VeilidAPIException { final String context; final String argument; @@ -265,9 +280,10 @@ class VeilidAPIExceptionMissingArgument implements VeilidAPIException { } // - VeilidAPIExceptionMissingArgument(this.context, this.argument); + const VeilidAPIExceptionMissingArgument(this.context, this.argument); } +@immutable class VeilidAPIExceptionGeneric implements VeilidAPIException { final String message; @@ -282,5 +298,5 @@ class VeilidAPIExceptionGeneric implements VeilidAPIException { } // - VeilidAPIExceptionGeneric(this.message); + const VeilidAPIExceptionGeneric(this.message); } diff --git a/veilid-flutter/lib/veilid_config.dart b/veilid-flutter/lib/veilid_config.dart index 3f98649e..4f48271d 100644 --- a/veilid-flutter/lib/veilid_config.dart +++ b/veilid-flutter/lib/veilid_config.dart @@ -1,118 +1,118 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:flutter/foundation.dart'; import 'package:change_case/change_case.dart'; - import 'veilid.dart'; +import 'veilid_encoding.dart'; +import 'veilid_crypto.dart'; + +part 'veilid_config.freezed.dart'; +part 'veilid_config.g.dart'; ////////////////////////////////////////////////////////// // FFI Platform-specific config +@freezed +class VeilidFFIConfigLoggingTerminal with _$VeilidFFIConfigLoggingTerminal { + const factory VeilidFFIConfigLoggingTerminal({ + required bool enabled, + required VeilidConfigLogLevel level, + }) = _VeilidFFIConfigLoggingTerminal; -class VeilidFFIConfigLoggingTerminal { - bool enabled; - VeilidConfigLogLevel level; - - VeilidFFIConfigLoggingTerminal({ - required this.enabled, - required this.level, - }); - - Map toJson() { - return { - 'enabled': enabled, - 'level': level.toJson(), - }; - } - - VeilidFFIConfigLoggingTerminal.fromJson(dynamic json) - : enabled = json['enabled'], - level = VeilidConfigLogLevel.fromJson(json['level']); + factory VeilidFFIConfigLoggingTerminal.fromJson(Map json) => + _$VeilidFFIConfigLoggingTerminalFromJson(json); } -class VeilidFFIConfigLoggingOtlp { - bool enabled; - VeilidConfigLogLevel level; - String grpcEndpoint; - String serviceName; +@freezed +class VeilidFFIConfigLoggingOtlp with _$VeilidFFIConfigLoggingOtlp { + const factory VeilidFFIConfigLoggingOtlp({ + required bool enabled, + required VeilidConfigLogLevel level, + required String grpcEndpoint, + required String serviceName, + }) = _VeilidFFIConfigLoggingOtlp; - VeilidFFIConfigLoggingOtlp({ - required this.enabled, - required this.level, - required this.grpcEndpoint, - required this.serviceName, - }); - - Map toJson() { - return { - 'enabled': enabled, - 'level': level.toJson(), - 'grpc_endpoint': grpcEndpoint, - 'service_name': serviceName, - }; - } - - VeilidFFIConfigLoggingOtlp.fromJson(dynamic json) - : enabled = json['enabled'], - level = VeilidConfigLogLevel.fromJson(json['level']), - grpcEndpoint = json['grpc_endpoint'], - serviceName = json['service_name']; + factory VeilidFFIConfigLoggingOtlp.fromJson(Map json) => + _$VeilidFFIConfigLoggingOtlpFromJson(json); } -class VeilidFFIConfigLoggingApi { - bool enabled; - VeilidConfigLogLevel level; +@freezed +class VeilidFFIConfigLoggingApi with _$VeilidFFIConfigLoggingApi { + const factory VeilidFFIConfigLoggingApi({ + required bool enabled, + required VeilidConfigLogLevel level, + }) = _VeilidFFIConfigLoggingApi; - VeilidFFIConfigLoggingApi({ - required this.enabled, - required this.level, - }); - - Map toJson() { - return { - 'enabled': enabled, - 'level': level.toJson(), - }; - } - - VeilidFFIConfigLoggingApi.fromJson(dynamic json) - : enabled = json['enabled'], - level = VeilidConfigLogLevel.fromJson(json['level']); + factory VeilidFFIConfigLoggingApi.fromJson(Map json) => + _$VeilidFFIConfigLoggingApiFromJson(json); } -class VeilidFFIConfigLogging { - VeilidFFIConfigLoggingTerminal terminal; - VeilidFFIConfigLoggingOtlp otlp; - VeilidFFIConfigLoggingApi api; +@freezed +class VeilidFFIConfigLogging with _$VeilidFFIConfigLogging { + const factory VeilidFFIConfigLogging( + {required VeilidFFIConfigLoggingTerminal terminal, + required VeilidFFIConfigLoggingOtlp otlp, + required VeilidFFIConfigLoggingApi api}) = _VeilidFFIConfigLogging; - VeilidFFIConfigLogging( - {required this.terminal, required this.otlp, required this.api}); - - Map toJson() { - return { - 'terminal': terminal.toJson(), - 'otlp': otlp.toJson(), - 'api': api.toJson(), - }; - } - - VeilidFFIConfigLogging.fromJson(dynamic json) - : terminal = VeilidFFIConfigLoggingTerminal.fromJson(json['terminal']), - otlp = VeilidFFIConfigLoggingOtlp.fromJson(json['otlp']), - api = VeilidFFIConfigLoggingApi.fromJson(json['api']); + factory VeilidFFIConfigLogging.fromJson(Map json) => + _$VeilidFFIConfigLoggingFromJson(json); } -class VeilidFFIConfig { - VeilidFFIConfigLogging logging; +@freezed +class VeilidFFIConfig with _$VeilidFFIConfig { + const factory VeilidFFIConfig({ + required VeilidFFIConfigLogging logging, + }) = _VeilidFFIConfig; - VeilidFFIConfig({ - required this.logging, - }); + factory VeilidFFIConfig.fromJson(Map json) => + _$VeilidFFIConfigFromJson(json); +} - Map toJson() { - return { - 'logging': logging.toJson(), - }; - } +////////////////////////////////////////////////////////// +// WASM Platform-specific config - VeilidFFIConfig.fromJson(Map json) - : logging = VeilidFFIConfigLogging.fromJson(json['logging']); +@freezed +class VeilidWASMConfigLoggingPerformance + with _$VeilidWASMConfigLoggingPerformance { + const factory VeilidWASMConfigLoggingPerformance({ + required bool enabled, + required VeilidConfigLogLevel level, + required bool logsInTimings, + required bool logsInConsole, + }) = _VeilidWASMConfigLoggingPerformance; + + factory VeilidWASMConfigLoggingPerformance.fromJson( + Map json) => + _$VeilidWASMConfigLoggingPerformanceFromJson(json); +} + +@freezed +class VeilidWASMConfigLoggingApi with _$VeilidWASMConfigLoggingApi { + const factory VeilidWASMConfigLoggingApi({ + required bool enabled, + required VeilidConfigLogLevel level, + }) = _VeilidWASMConfigLoggingApi; + + factory VeilidWASMConfigLoggingApi.fromJson(Map json) => + _$VeilidWASMConfigLoggingApiFromJson(json); +} + +@freezed +class VeilidWASMConfigLogging with _$VeilidWASMConfigLogging { + const factory VeilidWASMConfigLogging( + {required VeilidWASMConfigLoggingPerformance performance, + required VeilidWASMConfigLoggingApi api}) = _VeilidWASMConfigLogging; + + factory VeilidWASMConfigLogging.fromJson(Map json) => + _$VeilidWASMConfigLoggingFromJson(json); +} + +@freezed +class VeilidWASMConfig with _$VeilidWASMConfig { + const factory VeilidWASMConfig({ + required VeilidWASMConfigLogging logging, + }) = _VeilidWASMConfig; + + factory VeilidWASMConfig.fromJson(Map json) => + _$VeilidWASMConfigFromJson(json); } ////////////////////////////////////// @@ -135,794 +135,298 @@ enum VeilidConfigLogLevel { } } -////////////////////////////////////////////////////////// -// WASM Platform-specific config - -class VeilidWASMConfigLoggingPerformance { - bool enabled; - VeilidConfigLogLevel level; - bool logsInTimings; - bool logsInConsole; - - VeilidWASMConfigLoggingPerformance({ - required this.enabled, - required this.level, - required this.logsInTimings, - required this.logsInConsole, - }); - - Map toJson() { - return { - 'enabled': enabled, - 'level': level.toJson(), - 'logs_in_timings': logsInTimings, - 'logs_in_console': logsInConsole, - }; - } - - VeilidWASMConfigLoggingPerformance.fromJson(dynamic json) - : enabled = json['enabled'], - level = VeilidConfigLogLevel.fromJson(json['level']), - logsInTimings = json['logs_in_timings'], - logsInConsole = json['logs_in_console']; -} - -class VeilidWASMConfigLoggingApi { - bool enabled; - VeilidConfigLogLevel level; - - VeilidWASMConfigLoggingApi({ - required this.enabled, - required this.level, - }); - - Map toJson() { - return { - 'enabled': enabled, - 'level': level.toJson(), - }; - } - - VeilidWASMConfigLoggingApi.fromJson(dynamic json) - : enabled = json['enabled'], - level = VeilidConfigLogLevel.fromJson(json['level']); -} - -class VeilidWASMConfigLogging { - VeilidWASMConfigLoggingPerformance performance; - VeilidWASMConfigLoggingApi api; - - VeilidWASMConfigLogging({required this.performance, required this.api}); - - Map toJson() { - return { - 'performance': performance.toJson(), - 'api': api.toJson(), - }; - } - - VeilidWASMConfigLogging.fromJson(dynamic json) - : performance = - VeilidWASMConfigLoggingPerformance.fromJson(json['performance']), - api = VeilidWASMConfigLoggingApi.fromJson(json['api']); -} - -class VeilidWASMConfig { - VeilidWASMConfigLogging logging; - - VeilidWASMConfig({ - required this.logging, - }); - - Map toJson() { - return { - 'logging': logging.toJson(), - }; - } - - VeilidWASMConfig.fromJson(dynamic json) - : logging = VeilidWASMConfigLogging.fromJson(json['logging']); -} - ////////////////////////////////////// /// VeilidConfig -class VeilidConfigHTTPS { - bool enabled; - String listenAddress; - String path; - String? url; +@freezed +class VeilidConfigHTTPS with _$VeilidConfigHTTPS { + const factory VeilidConfigHTTPS({ + required bool enabled, + required String listenAddress, + required String path, + String? url, + }) = _VeilidConfigHTTPS; - VeilidConfigHTTPS({ - required this.enabled, - required this.listenAddress, - required this.path, - this.url, - }); - - Map toJson() { - return { - 'enabled': enabled, - 'listen_address': listenAddress, - 'path': path, - 'url': url - }; - } - - VeilidConfigHTTPS.fromJson(dynamic json) - : enabled = json['enabled'], - listenAddress = json['listen_address'], - path = json['path'], - url = json['url']; + factory VeilidConfigHTTPS.fromJson(Map json) => + _$VeilidConfigHTTPSFromJson(json); } //////////// -class VeilidConfigHTTP { - bool enabled; - String listenAddress; - String path; - String? url; +@freezed +class VeilidConfigHTTP with _$VeilidConfigHTTP { + const factory VeilidConfigHTTP({ + required bool enabled, + required String listenAddress, + required String path, + String? url, + }) = _VeilidConfigHTTP; - VeilidConfigHTTP({ - required this.enabled, - required this.listenAddress, - required this.path, - this.url, - }); - - Map toJson() { - return { - 'enabled': enabled, - 'listen_address': listenAddress, - 'path': path, - 'url': url - }; - } - - VeilidConfigHTTP.fromJson(dynamic json) - : enabled = json['enabled'], - listenAddress = json['listen_address'], - path = json['path'], - url = json['url']; + factory VeilidConfigHTTP.fromJson(Map json) => + _$VeilidConfigHTTPFromJson(json); } //////////// -class VeilidConfigApplication { - VeilidConfigHTTPS https; - VeilidConfigHTTP http; +@freezed +class VeilidConfigApplication with _$VeilidConfigApplication { + const factory VeilidConfigApplication({ + required VeilidConfigHTTPS https, + required VeilidConfigHTTP http, + }) = _VeilidConfigApplication; - VeilidConfigApplication({ - required this.https, - required this.http, - }); + factory VeilidConfigApplication.fromJson(Map json) => + _$VeilidConfigApplicationFromJson(json); +} - Map toJson() { - return { - 'https': https.toJson(), - 'http': http.toJson(), - }; - } +//////////// +@freezed +class VeilidConfigUDP with _$VeilidConfigUDP { + const factory VeilidConfigUDP( + {required bool enabled, + required int socketPoolSize, + required String listenAddress, + String? publicAddress}) = _VeilidConfigUDP; - VeilidConfigApplication.fromJson(dynamic json) - : https = VeilidConfigHTTPS.fromJson(json['https']), - http = VeilidConfigHTTP.fromJson(json['http']); + factory VeilidConfigUDP.fromJson(Map json) => + _$VeilidConfigUDPFromJson(json); +} + +//////////// +@freezed +class VeilidConfigTCP with _$VeilidConfigTCP { + const factory VeilidConfigTCP( + {required bool connect, + required bool listen, + required int maxConnections, + required String listenAddress, + String? publicAddress}) = _VeilidConfigTCP; + + factory VeilidConfigTCP.fromJson(Map json) => + _$VeilidConfigTCPFromJson(json); +} + +//////////// +@freezed +class VeilidConfigWS with _$VeilidConfigWS { + const factory VeilidConfigWS( + {required bool connect, + required bool listen, + required int maxConnections, + required String listenAddress, + required String path, + String? url}) = _VeilidConfigWS; + + factory VeilidConfigWS.fromJson(Map json) => + _$VeilidConfigWSFromJson(json); +} + +//////////// +@freezed +class VeilidConfigWSS with _$VeilidConfigWSS { + const factory VeilidConfigWSS( + {required bool connect, + required bool listen, + required int maxConnections, + required String listenAddress, + required String path, + String? url}) = _VeilidConfigWSS; + + factory VeilidConfigWSS.fromJson(Map json) => + _$VeilidConfigWSSFromJson(json); } //////////// -class VeilidConfigUDP { - bool enabled; - int socketPoolSize; - String listenAddress; - String? publicAddress; +@freezed +class VeilidConfigProtocol with _$VeilidConfigProtocol { + const factory VeilidConfigProtocol({ + required VeilidConfigUDP udp, + required VeilidConfigTCP tcp, + required VeilidConfigWS ws, + required VeilidConfigWSS wss, + }) = _VeilidConfigProtocol; - VeilidConfigUDP( - {required this.enabled, - required this.socketPoolSize, - required this.listenAddress, - this.publicAddress}); - - Map toJson() { - return { - 'enabled': enabled, - 'socket_pool_size': socketPoolSize, - 'listen_address': listenAddress, - 'public_address': publicAddress, - }; - } - - VeilidConfigUDP.fromJson(dynamic json) - : enabled = json['enabled'], - socketPoolSize = json['socket_pool_size'], - listenAddress = json['listen_address'], - publicAddress = json['publicAddress']; + factory VeilidConfigProtocol.fromJson(Map json) => + _$VeilidConfigProtocolFromJson(json); } //////////// -class VeilidConfigTCP { - bool connect; - bool listen; - int maxConnections; - String listenAddress; - String? publicAddress; +@freezed +class VeilidConfigTLS with _$VeilidConfigTLS { + const factory VeilidConfigTLS({ + required String certificatePath, + required String privateKeyPath, + required int connectionInitialTimeoutMs, + }) = _VeilidConfigTLS; - VeilidConfigTCP( - {required this.connect, - required this.listen, - required this.maxConnections, - required this.listenAddress, - this.publicAddress}); + factory VeilidConfigTLS.fromJson(Map json) => + _$VeilidConfigTLSFromJson(json); +} - Map toJson() { - return { - 'connect': connect, - 'listen': listen, - 'max_connections': maxConnections, - 'listen_address': listenAddress, - 'public_address': publicAddress, - }; - } +//////////// +@freezed +class VeilidConfigDHT with _$VeilidConfigDHT { + const factory VeilidConfigDHT( + {required int resolveNodeTimeoutMs, + required int resolveNodeCount, + required int resolveNodeFanout, + required int maxFindNodeCount, + required int getValueTimeoutMs, + required int getValueCount, + required int getValueFanout, + required int setValueTimeoutMs, + required int setValueCount, + required int setValueFanout, + required int minPeerCount, + required int minPeerRefreshTimeMs, + required int validateDialInfoReceiptTimeMs, + required int localSubkeyCacheSize, + required int localMaxSubkeyCacheMemoryMb, + required int remoteSubkeyCacheSize, + required int remoteMaxRecords, + required int remoteMaxSubkeyCacheMemoryMb, + required int remoteMaxStorageSpaceMb}) = _VeilidConfigDHT; - VeilidConfigTCP.fromJson(dynamic json) - : connect = json['connect'], - listen = json['listen'], - maxConnections = json['max_connections'], - listenAddress = json['listen_address'], - publicAddress = json['publicAddress']; + factory VeilidConfigDHT.fromJson(Map json) => + _$VeilidConfigDHTFromJson(json); } //////////// -class VeilidConfigWS { - bool connect; - bool listen; - int maxConnections; - String listenAddress; - String path; - String? url; +@freezed +class VeilidConfigRPC with _$VeilidConfigRPC { + const factory VeilidConfigRPC( + {required int concurrency, + required int queueSize, + int? maxTimestampBehindMs, + int? maxTimestampAheadMs, + required int timeoutMs, + required int maxRouteHopCount, + required int defaultRouteHopCount}) = _VeilidConfigRPC; - VeilidConfigWS( - {required this.connect, - required this.listen, - required this.maxConnections, - required this.listenAddress, - required this.path, - this.url}); - - Map toJson() { - return { - 'connect': connect, - 'listen': listen, - 'max_connections': maxConnections, - 'listen_address': listenAddress, - 'path': path, - 'url': url, - }; - } - - VeilidConfigWS.fromJson(dynamic json) - : connect = json['connect'], - listen = json['listen'], - maxConnections = json['max_connections'], - listenAddress = json['listen_address'], - path = json['path'], - url = json['url']; + factory VeilidConfigRPC.fromJson(Map json) => + _$VeilidConfigRPCFromJson(json); } //////////// -class VeilidConfigWSS { - bool connect; - bool listen; - int maxConnections; - String listenAddress; - String path; - String? url; +@freezed +class VeilidConfigRoutingTable with _$VeilidConfigRoutingTable { + const factory VeilidConfigRoutingTable({ + required List nodeId, + required List nodeIdSecret, + required List bootstrap, + required int limitOverAttached, + required int limitFullyAttached, + required int limitAttachedStrong, + required int limitAttachedGood, + required int limitAttachedWeak, + }) = _VeilidConfigRoutingTable; - VeilidConfigWSS( - {required this.connect, - required this.listen, - required this.maxConnections, - required this.listenAddress, - required this.path, - this.url}); - - Map toJson() { - return { - 'connect': connect, - 'listen': listen, - 'max_connections': maxConnections, - 'listen_address': listenAddress, - 'path': path, - 'url': url, - }; - } - - VeilidConfigWSS.fromJson(dynamic json) - : connect = json['connect'], - listen = json['listen'], - maxConnections = json['max_connections'], - listenAddress = json['listen_address'], - path = json['path'], - url = json['url']; + factory VeilidConfigRoutingTable.fromJson(Map json) => + _$VeilidConfigRoutingTableFromJson(json); } //////////// -class VeilidConfigProtocol { - VeilidConfigUDP udp; - VeilidConfigTCP tcp; - VeilidConfigWS ws; - VeilidConfigWSS wss; +@freezed +class VeilidConfigNetwork with _$VeilidConfigNetwork { + const factory VeilidConfigNetwork({ + required int connectionInitialTimeoutMs, + required int connectionInactivityTimeoutMs, + required int maxConnectionsPerIp4, + required int maxConnectionsPerIp6Prefix, + required int maxConnectionsPerIp6PrefixSize, + required int maxConnectionFrequencyPerMin, + required int clientWhitelistTimeoutMs, + required int reverseConnectionReceiptTimeMs, + required int holePunchReceiptTimeMs, + String? networkKeyPassword, + required VeilidConfigRoutingTable routingTable, + required VeilidConfigRPC rpc, + required VeilidConfigDHT dht, + required bool upnp, + required bool detectAddressChanges, + required int restrictedNatRetries, + required VeilidConfigTLS tls, + required VeilidConfigApplication application, + required VeilidConfigProtocol protocol, + }) = _VeilidConfigNetwork; - VeilidConfigProtocol({ - required this.udp, - required this.tcp, - required this.ws, - required this.wss, - }); - - Map toJson() { - return { - 'udp': udp.toJson(), - 'tcp': tcp.toJson(), - 'ws': ws.toJson(), - 'wss': wss.toJson(), - }; - } - - VeilidConfigProtocol.fromJson(dynamic json) - : udp = VeilidConfigUDP.fromJson(json['udp']), - tcp = VeilidConfigTCP.fromJson(json['tcp']), - ws = VeilidConfigWS.fromJson(json['ws']), - wss = VeilidConfigWSS.fromJson(json['wss']); + factory VeilidConfigNetwork.fromJson(Map json) => + _$VeilidConfigNetworkFromJson(json); } //////////// -class VeilidConfigTLS { - String certificatePath; - String privateKeyPath; - int connectionInitialTimeoutMs; +@freezed +class VeilidConfigTableStore with _$VeilidConfigTableStore { + const factory VeilidConfigTableStore({ + required String directory, + required bool delete, + }) = _VeilidConfigTableStore; - VeilidConfigTLS({ - required this.certificatePath, - required this.privateKeyPath, - required this.connectionInitialTimeoutMs, - }); - - Map toJson() { - return { - 'certificate_path': certificatePath, - 'private_key_path': privateKeyPath, - 'connection_initial_timeout_ms': connectionInitialTimeoutMs, - }; - } - - VeilidConfigTLS.fromJson(dynamic json) - : certificatePath = json['certificate_path'], - privateKeyPath = json['private_key_path'], - connectionInitialTimeoutMs = json['connection_initial_timeout_ms']; + factory VeilidConfigTableStore.fromJson(Map json) => + _$VeilidConfigTableStoreFromJson(json); } //////////// -class VeilidConfigDHT { - int resolveNodeTimeoutMs; - int resolveNodeCount; - int resolveNodeFanout; - int maxFindNodeCount; - int getValueTimeoutMs; - int getValueCount; - int getValueFanout; - int setValueTimeoutMs; - int setValueCount; - int setValueFanout; - int minPeerCount; - int minPeerRefreshTimeMs; - int validateDialInfoReceiptTimeMs; - int localSubkeyCacheSize; - int localMaxSubkeyCacheMemoryMb; - int remoteSubkeyCacheSize; - int remoteMaxRecords; - int remoteMaxSubkeyCacheMemoryMb; - int remoteMaxStorageSpaceMb; +@freezed +class VeilidConfigBlockStore with _$VeilidConfigBlockStore { + const factory VeilidConfigBlockStore({ + required String directory, + required bool delete, + }) = _VeilidConfigBlockStore; - VeilidConfigDHT( - {required this.resolveNodeTimeoutMs, - required this.resolveNodeCount, - required this.resolveNodeFanout, - required this.maxFindNodeCount, - required this.getValueTimeoutMs, - required this.getValueCount, - required this.getValueFanout, - required this.setValueTimeoutMs, - required this.setValueCount, - required this.setValueFanout, - required this.minPeerCount, - required this.minPeerRefreshTimeMs, - required this.validateDialInfoReceiptTimeMs, - required this.localSubkeyCacheSize, - required this.localMaxSubkeyCacheMemoryMb, - required this.remoteSubkeyCacheSize, - required this.remoteMaxRecords, - required this.remoteMaxSubkeyCacheMemoryMb, - required this.remoteMaxStorageSpaceMb}); - - Map toJson() { - return { - 'max_find_node_count': maxFindNodeCount, - 'resolve_node_timeout_ms': resolveNodeTimeoutMs, - 'resolve_node_count': resolveNodeCount, - 'resolve_node_fanout': resolveNodeFanout, - 'get_value_timeout_ms': getValueTimeoutMs, - 'get_value_count': getValueCount, - 'get_value_fanout': getValueFanout, - 'set_value_timeout_ms': setValueTimeoutMs, - 'set_value_count': setValueCount, - 'set_value_fanout': setValueFanout, - 'min_peer_count': minPeerCount, - 'min_peer_refresh_time_ms': minPeerRefreshTimeMs, - 'validate_dial_info_receipt_time_ms': validateDialInfoReceiptTimeMs, - 'local_subkey_cache_size': localSubkeyCacheSize, - 'local_max_subkey_cache_memory_mb': localMaxSubkeyCacheMemoryMb, - 'remote_subkey_cache_size': remoteSubkeyCacheSize, - 'remote_max_records': remoteMaxRecords, - 'remote_max_subkey_cache_memory_mb': remoteMaxSubkeyCacheMemoryMb, - 'remote_max_storage_space_mb': remoteMaxStorageSpaceMb, - }; - } - - VeilidConfigDHT.fromJson(dynamic json) - : resolveNodeTimeoutMs = json['resolve_node_timeout_ms'], - resolveNodeCount = json['resolve_node_count'], - resolveNodeFanout = json['resolve_node_fanout'], - maxFindNodeCount = json['max_find_node_count'], - getValueTimeoutMs = json['get_value_timeout_ms'], - getValueCount = json['get_value_count'], - getValueFanout = json['get_value_fanout'], - setValueTimeoutMs = json['set_value_timeout_ms'], - setValueCount = json['set_value_count'], - setValueFanout = json['set_value_fanout'], - minPeerCount = json['min_peer_count'], - minPeerRefreshTimeMs = json['min_peer_refresh_time_ms'], - validateDialInfoReceiptTimeMs = - json['validate_dial_info_receipt_time_ms'], - localSubkeyCacheSize = json['local_subkey_cache_size'], - localMaxSubkeyCacheMemoryMb = json['local_max_subkey_cache_memory_mb'], - remoteSubkeyCacheSize = json['remote_subkey_cache_size'], - remoteMaxRecords = json['remote_max_records'], - remoteMaxSubkeyCacheMemoryMb = - json['remote_max_subkey_cache_memory_mb'], - remoteMaxStorageSpaceMb = json['remote_max_storage_space_mb']; + factory VeilidConfigBlockStore.fromJson(Map json) => + _$VeilidConfigBlockStoreFromJson(json); } //////////// -class VeilidConfigRPC { - int concurrency; - int queueSize; - int? maxTimestampBehindMs; - int? maxTimestampAheadMs; - int timeoutMs; - int maxRouteHopCount; - int defaultRouteHopCount; +@freezed +class VeilidConfigProtectedStore with _$VeilidConfigProtectedStore { + const factory VeilidConfigProtectedStore( + {required bool allowInsecureFallback, + required bool alwaysUseInsecureStorage, + required String directory, + required bool delete, + required String deviceEncryptionKeyPassword, + String? newDeviceEncryptionKeyPassword}) = _VeilidConfigProtectedStore; - VeilidConfigRPC( - {required this.concurrency, - required this.queueSize, - this.maxTimestampBehindMs, - this.maxTimestampAheadMs, - required this.timeoutMs, - required this.maxRouteHopCount, - required this.defaultRouteHopCount}); - - Map toJson() { - return { - 'concurrency': concurrency, - 'queue_size': queueSize, - 'max_timestamp_behind_ms': maxTimestampBehindMs, - 'max_timestamp_ahead_ms': maxTimestampAheadMs, - 'timeout_ms': timeoutMs, - 'max_route_hop_count': maxRouteHopCount, - 'default_route_hop_count': defaultRouteHopCount, - }; - } - - VeilidConfigRPC.fromJson(dynamic json) - : concurrency = json['concurrency'], - queueSize = json['queue_size'], - maxTimestampBehindMs = json['max_timestamp_behind_ms'], - maxTimestampAheadMs = json['max_timestamp_ahead_ms'], - timeoutMs = json['timeout_ms'], - maxRouteHopCount = json['max_route_hop_count'], - defaultRouteHopCount = json['default_route_hop_count']; + factory VeilidConfigProtectedStore.fromJson(Map json) => + _$VeilidConfigProtectedStoreFromJson(json); } //////////// -class VeilidConfigRoutingTable { - List nodeId; - List nodeIdSecret; - List bootstrap; - int limitOverAttached; - int limitFullyAttached; - int limitAttachedStrong; - int limitAttachedGood; - int limitAttachedWeak; +@freezed +class VeilidConfigCapabilities with _$VeilidConfigCapabilities { + const factory VeilidConfigCapabilities({ + required List disable, + }) = _VeilidConfigCapabilities; - VeilidConfigRoutingTable({ - required this.nodeId, - required this.nodeIdSecret, - required this.bootstrap, - required this.limitOverAttached, - required this.limitFullyAttached, - required this.limitAttachedStrong, - required this.limitAttachedGood, - required this.limitAttachedWeak, - }); - - Map toJson() { - return { - 'node_id': nodeId.map((p) => p.toJson()).toList(), - 'node_id_secret': nodeIdSecret.map((p) => p.toJson()).toList(), - 'bootstrap': bootstrap.map((p) => p).toList(), - 'limit_over_attached': limitOverAttached, - 'limit_fully_attached': limitFullyAttached, - 'limit_attached_strong': limitAttachedStrong, - 'limit_attached_good': limitAttachedGood, - 'limit_attached_weak': limitAttachedWeak, - }; - } - - VeilidConfigRoutingTable.fromJson(dynamic json) - : nodeId = List.from( - json['node_id'].map((j) => TypedKey.fromJson(j))), - nodeIdSecret = List.from( - json['node_id_secret'].map((j) => TypedSecret.fromJson(j))), - bootstrap = List.from(json['bootstrap'].map((j) => j)), - limitOverAttached = json['limit_over_attached'], - limitFullyAttached = json['limit_fully_attached'], - limitAttachedStrong = json['limit_attached_strong'], - limitAttachedGood = json['limit_attached_good'], - limitAttachedWeak = json['limit_attached_weak']; + factory VeilidConfigCapabilities.fromJson(Map json) => + _$VeilidConfigCapabilitiesFromJson(json); } //////////// -class VeilidConfigNetwork { - int connectionInitialTimeoutMs; - int connectionInactivityTimeoutMs; - int maxConnectionsPerIp4; - int maxConnectionsPerIp6Prefix; - int maxConnectionsPerIp6PrefixSize; - int maxConnectionFrequencyPerMin; - int clientWhitelistTimeoutMs; - int reverseConnectionReceiptTimeMs; - int holePunchReceiptTimeMs; - String? networkKeyPassword; - VeilidConfigRoutingTable routingTable; - VeilidConfigRPC rpc; - VeilidConfigDHT dht; - bool upnp; - bool detectAddressChanges; - int restrictedNatRetries; - VeilidConfigTLS tls; - VeilidConfigApplication application; - VeilidConfigProtocol protocol; +@freezed +class VeilidConfig with _$VeilidConfig { + const factory VeilidConfig({ + required String programName, + required String namespace, + required VeilidConfigCapabilities capabilities, + required VeilidConfigProtectedStore protectedStore, + required VeilidConfigTableStore tableStore, + required VeilidConfigBlockStore blockStore, + required VeilidConfigNetwork network, + }) = _VeilidConfig; - VeilidConfigNetwork({ - required this.connectionInitialTimeoutMs, - required this.connectionInactivityTimeoutMs, - required this.maxConnectionsPerIp4, - required this.maxConnectionsPerIp6Prefix, - required this.maxConnectionsPerIp6PrefixSize, - required this.maxConnectionFrequencyPerMin, - required this.clientWhitelistTimeoutMs, - required this.reverseConnectionReceiptTimeMs, - required this.holePunchReceiptTimeMs, - this.networkKeyPassword, - required this.routingTable, - required this.rpc, - required this.dht, - required this.upnp, - required this.detectAddressChanges, - required this.restrictedNatRetries, - required this.tls, - required this.application, - required this.protocol, - }); - - Map toJson() { - return { - 'connection_initial_timeout_ms': connectionInitialTimeoutMs, - 'connection_inactivity_timeout_ms': connectionInactivityTimeoutMs, - 'max_connections_per_ip4': maxConnectionsPerIp4, - 'max_connections_per_ip6_prefix': maxConnectionsPerIp6Prefix, - 'max_connections_per_ip6_prefix_size': maxConnectionsPerIp6PrefixSize, - 'max_connection_frequency_per_min': maxConnectionFrequencyPerMin, - 'client_whitelist_timeout_ms': clientWhitelistTimeoutMs, - 'reverse_connection_receipt_time_ms': reverseConnectionReceiptTimeMs, - 'hole_punch_receipt_time_ms': holePunchReceiptTimeMs, - 'network_key_password': networkKeyPassword, - 'routing_table': routingTable.toJson(), - 'rpc': rpc.toJson(), - 'dht': dht.toJson(), - 'upnp': upnp, - 'detect_address_changes': detectAddressChanges, - 'restricted_nat_retries': restrictedNatRetries, - 'tls': tls.toJson(), - 'application': application.toJson(), - 'protocol': protocol.toJson(), - }; - } - - VeilidConfigNetwork.fromJson(dynamic json) - : connectionInitialTimeoutMs = json['connection_initial_timeout_ms'], - connectionInactivityTimeoutMs = - json['connection_inactivity_timeout_ms'], - maxConnectionsPerIp4 = json['max_connections_per_ip4'], - maxConnectionsPerIp6Prefix = json['max_connections_per_ip6_prefix'], - maxConnectionsPerIp6PrefixSize = - json['max_connections_per_ip6_prefix_size'], - maxConnectionFrequencyPerMin = json['max_connection_frequency_per_min'], - clientWhitelistTimeoutMs = json['client_whitelist_timeout_ms'], - reverseConnectionReceiptTimeMs = - json['reverse_connection_receipt_time_ms'], - holePunchReceiptTimeMs = json['hole_punch_receipt_time_ms'], - networkKeyPassword = json['network_key_password'], - routingTable = VeilidConfigRoutingTable.fromJson(json['routing_table']), - rpc = VeilidConfigRPC.fromJson(json['rpc']), - dht = VeilidConfigDHT.fromJson(json['dht']), - upnp = json['upnp'], - detectAddressChanges = json['detect_address_changes'], - restrictedNatRetries = json['restricted_nat_retries'], - tls = VeilidConfigTLS.fromJson(json['tls']), - application = VeilidConfigApplication.fromJson(json['application']), - protocol = VeilidConfigProtocol.fromJson(json['protocol']); -} - -//////////// - -class VeilidConfigTableStore { - String directory; - bool delete; - - VeilidConfigTableStore({ - required this.directory, - required this.delete, - }); - - Map toJson() { - return {'directory': directory, 'delete': delete}; - } - - VeilidConfigTableStore.fromJson(dynamic json) - : directory = json['directory'], - delete = json['delete']; -} - -//////////// - -class VeilidConfigBlockStore { - String directory; - bool delete; - - VeilidConfigBlockStore({ - required this.directory, - required this.delete, - }); - - Map toJson() { - return {'directory': directory, 'delete': delete}; - } - - VeilidConfigBlockStore.fromJson(dynamic json) - : directory = json['directory'], - delete = json['delete']; -} - -//////////// - -class VeilidConfigProtectedStore { - bool allowInsecureFallback; - bool alwaysUseInsecureStorage; - String directory; - bool delete; - String deviceEncryptionKeyPassword; - String? newDeviceEncryptionKeyPassword; - - VeilidConfigProtectedStore( - {required this.allowInsecureFallback, - required this.alwaysUseInsecureStorage, - required this.directory, - required this.delete, - required this.deviceEncryptionKeyPassword, - String? newDeviceEncryptionKeyPassword}); - - Map toJson() { - return { - 'allow_insecure_fallback': allowInsecureFallback, - 'always_use_insecure_storage': alwaysUseInsecureStorage, - 'directory': directory, - 'delete': delete, - 'device_encryption_key_password': deviceEncryptionKeyPassword, - 'new_device_encryption_key': newDeviceEncryptionKeyPassword, - }; - } - - VeilidConfigProtectedStore.fromJson(dynamic json) - : allowInsecureFallback = json['allow_insecure_fallback'], - alwaysUseInsecureStorage = json['always_use_insecure_storage'], - directory = json['directory'], - delete = json['delete'], - deviceEncryptionKeyPassword = json['device_encryption_key_password'], - newDeviceEncryptionKeyPassword = - json['new_device_encryption_key_password']; -} - -//////////// - -class VeilidConfigCapabilities { - List disable; - - VeilidConfigCapabilities({ - required this.disable, - }); - - Map toJson() { - return { - 'disable': disable.map((p) => p).toList(), - }; - } - - VeilidConfigCapabilities.fromJson(dynamic json) - : disable = List.from(json['disable'].map((j) => j)); -} - -//////////// - -class VeilidConfig { - String programName; - String namespace; - VeilidConfigCapabilities capabilities; - VeilidConfigProtectedStore protectedStore; - VeilidConfigTableStore tableStore; - VeilidConfigBlockStore blockStore; - VeilidConfigNetwork network; - - VeilidConfig({ - required this.programName, - required this.namespace, - required this.capabilities, - required this.protectedStore, - required this.tableStore, - required this.blockStore, - required this.network, - }); - - Map toJson() { - return { - 'program_name': programName, - 'namespace': namespace, - 'capabilities': capabilities.toJson(), - 'protected_store': protectedStore.toJson(), - 'table_store': tableStore.toJson(), - 'block_store': blockStore.toJson(), - 'network': network.toJson() - }; - } - - VeilidConfig.fromJson(dynamic json) - : programName = json['program_name'], - namespace = json['namespace'], - capabilities = VeilidConfigCapabilities.fromJson(json['capabilities']), - protectedStore = - VeilidConfigProtectedStore.fromJson(json['protected_store']), - tableStore = VeilidConfigTableStore.fromJson(json['table_store']), - blockStore = VeilidConfigBlockStore.fromJson(json['block_store']), - network = VeilidConfigNetwork.fromJson(json['network']); + factory VeilidConfig.fromJson(Map json) => + _$VeilidConfigFromJson(json); } diff --git a/veilid-flutter/lib/veilid_config.freezed.dart b/veilid-flutter/lib/veilid_config.freezed.dart new file mode 100644 index 00000000..26554b99 --- /dev/null +++ b/veilid-flutter/lib/veilid_config.freezed.dart @@ -0,0 +1,6780 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'veilid_config.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + +VeilidFFIConfigLoggingTerminal _$VeilidFFIConfigLoggingTerminalFromJson( + Map json) { + return _VeilidFFIConfigLoggingTerminal.fromJson(json); +} + +/// @nodoc +mixin _$VeilidFFIConfigLoggingTerminal { + bool get enabled => throw _privateConstructorUsedError; + VeilidConfigLogLevel get level => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidFFIConfigLoggingTerminalCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidFFIConfigLoggingTerminalCopyWith<$Res> { + factory $VeilidFFIConfigLoggingTerminalCopyWith( + VeilidFFIConfigLoggingTerminal value, + $Res Function(VeilidFFIConfigLoggingTerminal) then) = + _$VeilidFFIConfigLoggingTerminalCopyWithImpl<$Res, + VeilidFFIConfigLoggingTerminal>; + @useResult + $Res call({bool enabled, VeilidConfigLogLevel level}); +} + +/// @nodoc +class _$VeilidFFIConfigLoggingTerminalCopyWithImpl<$Res, + $Val extends VeilidFFIConfigLoggingTerminal> + implements $VeilidFFIConfigLoggingTerminalCopyWith<$Res> { + _$VeilidFFIConfigLoggingTerminalCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? level = null, + }) { + return _then(_value.copyWith( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + level: null == level + ? _value.level + : level // ignore: cast_nullable_to_non_nullable + as VeilidConfigLogLevel, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidFFIConfigLoggingTerminalCopyWith<$Res> + implements $VeilidFFIConfigLoggingTerminalCopyWith<$Res> { + factory _$$_VeilidFFIConfigLoggingTerminalCopyWith( + _$_VeilidFFIConfigLoggingTerminal value, + $Res Function(_$_VeilidFFIConfigLoggingTerminal) then) = + __$$_VeilidFFIConfigLoggingTerminalCopyWithImpl<$Res>; + @override + @useResult + $Res call({bool enabled, VeilidConfigLogLevel level}); +} + +/// @nodoc +class __$$_VeilidFFIConfigLoggingTerminalCopyWithImpl<$Res> + extends _$VeilidFFIConfigLoggingTerminalCopyWithImpl<$Res, + _$_VeilidFFIConfigLoggingTerminal> + implements _$$_VeilidFFIConfigLoggingTerminalCopyWith<$Res> { + __$$_VeilidFFIConfigLoggingTerminalCopyWithImpl( + _$_VeilidFFIConfigLoggingTerminal _value, + $Res Function(_$_VeilidFFIConfigLoggingTerminal) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? level = null, + }) { + return _then(_$_VeilidFFIConfigLoggingTerminal( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + level: null == level + ? _value.level + : level // ignore: cast_nullable_to_non_nullable + as VeilidConfigLogLevel, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidFFIConfigLoggingTerminal + with DiagnosticableTreeMixin + implements _VeilidFFIConfigLoggingTerminal { + const _$_VeilidFFIConfigLoggingTerminal( + {required this.enabled, required this.level}); + + factory _$_VeilidFFIConfigLoggingTerminal.fromJson( + Map json) => + _$$_VeilidFFIConfigLoggingTerminalFromJson(json); + + @override + final bool enabled; + @override + final VeilidConfigLogLevel level; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfigLoggingTerminal(enabled: $enabled, level: $level)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidFFIConfigLoggingTerminal')) + ..add(DiagnosticsProperty('enabled', enabled)) + ..add(DiagnosticsProperty('level', level)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidFFIConfigLoggingTerminal && + (identical(other.enabled, enabled) || other.enabled == enabled) && + (identical(other.level, level) || other.level == level)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, enabled, level); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidFFIConfigLoggingTerminalCopyWith<_$_VeilidFFIConfigLoggingTerminal> + get copyWith => __$$_VeilidFFIConfigLoggingTerminalCopyWithImpl< + _$_VeilidFFIConfigLoggingTerminal>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidFFIConfigLoggingTerminalToJson( + this, + ); + } +} + +abstract class _VeilidFFIConfigLoggingTerminal + implements VeilidFFIConfigLoggingTerminal { + const factory _VeilidFFIConfigLoggingTerminal( + {required final bool enabled, + required final VeilidConfigLogLevel level}) = + _$_VeilidFFIConfigLoggingTerminal; + + factory _VeilidFFIConfigLoggingTerminal.fromJson(Map json) = + _$_VeilidFFIConfigLoggingTerminal.fromJson; + + @override + bool get enabled; + @override + VeilidConfigLogLevel get level; + @override + @JsonKey(ignore: true) + _$$_VeilidFFIConfigLoggingTerminalCopyWith<_$_VeilidFFIConfigLoggingTerminal> + get copyWith => throw _privateConstructorUsedError; +} + +VeilidFFIConfigLoggingOtlp _$VeilidFFIConfigLoggingOtlpFromJson( + Map json) { + return _VeilidFFIConfigLoggingOtlp.fromJson(json); +} + +/// @nodoc +mixin _$VeilidFFIConfigLoggingOtlp { + bool get enabled => throw _privateConstructorUsedError; + VeilidConfigLogLevel get level => throw _privateConstructorUsedError; + String get grpcEndpoint => throw _privateConstructorUsedError; + String get serviceName => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidFFIConfigLoggingOtlpCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidFFIConfigLoggingOtlpCopyWith<$Res> { + factory $VeilidFFIConfigLoggingOtlpCopyWith(VeilidFFIConfigLoggingOtlp value, + $Res Function(VeilidFFIConfigLoggingOtlp) then) = + _$VeilidFFIConfigLoggingOtlpCopyWithImpl<$Res, + VeilidFFIConfigLoggingOtlp>; + @useResult + $Res call( + {bool enabled, + VeilidConfigLogLevel level, + String grpcEndpoint, + String serviceName}); +} + +/// @nodoc +class _$VeilidFFIConfigLoggingOtlpCopyWithImpl<$Res, + $Val extends VeilidFFIConfigLoggingOtlp> + implements $VeilidFFIConfigLoggingOtlpCopyWith<$Res> { + _$VeilidFFIConfigLoggingOtlpCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? level = null, + Object? grpcEndpoint = null, + Object? serviceName = null, + }) { + return _then(_value.copyWith( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + level: null == level + ? _value.level + : level // ignore: cast_nullable_to_non_nullable + as VeilidConfigLogLevel, + grpcEndpoint: null == grpcEndpoint + ? _value.grpcEndpoint + : grpcEndpoint // ignore: cast_nullable_to_non_nullable + as String, + serviceName: null == serviceName + ? _value.serviceName + : serviceName // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidFFIConfigLoggingOtlpCopyWith<$Res> + implements $VeilidFFIConfigLoggingOtlpCopyWith<$Res> { + factory _$$_VeilidFFIConfigLoggingOtlpCopyWith( + _$_VeilidFFIConfigLoggingOtlp value, + $Res Function(_$_VeilidFFIConfigLoggingOtlp) then) = + __$$_VeilidFFIConfigLoggingOtlpCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {bool enabled, + VeilidConfigLogLevel level, + String grpcEndpoint, + String serviceName}); +} + +/// @nodoc +class __$$_VeilidFFIConfigLoggingOtlpCopyWithImpl<$Res> + extends _$VeilidFFIConfigLoggingOtlpCopyWithImpl<$Res, + _$_VeilidFFIConfigLoggingOtlp> + implements _$$_VeilidFFIConfigLoggingOtlpCopyWith<$Res> { + __$$_VeilidFFIConfigLoggingOtlpCopyWithImpl( + _$_VeilidFFIConfigLoggingOtlp _value, + $Res Function(_$_VeilidFFIConfigLoggingOtlp) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? level = null, + Object? grpcEndpoint = null, + Object? serviceName = null, + }) { + return _then(_$_VeilidFFIConfigLoggingOtlp( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + level: null == level + ? _value.level + : level // ignore: cast_nullable_to_non_nullable + as VeilidConfigLogLevel, + grpcEndpoint: null == grpcEndpoint + ? _value.grpcEndpoint + : grpcEndpoint // ignore: cast_nullable_to_non_nullable + as String, + serviceName: null == serviceName + ? _value.serviceName + : serviceName // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidFFIConfigLoggingOtlp + with DiagnosticableTreeMixin + implements _VeilidFFIConfigLoggingOtlp { + const _$_VeilidFFIConfigLoggingOtlp( + {required this.enabled, + required this.level, + required this.grpcEndpoint, + required this.serviceName}); + + factory _$_VeilidFFIConfigLoggingOtlp.fromJson(Map json) => + _$$_VeilidFFIConfigLoggingOtlpFromJson(json); + + @override + final bool enabled; + @override + final VeilidConfigLogLevel level; + @override + final String grpcEndpoint; + @override + final String serviceName; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfigLoggingOtlp(enabled: $enabled, level: $level, grpcEndpoint: $grpcEndpoint, serviceName: $serviceName)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidFFIConfigLoggingOtlp')) + ..add(DiagnosticsProperty('enabled', enabled)) + ..add(DiagnosticsProperty('level', level)) + ..add(DiagnosticsProperty('grpcEndpoint', grpcEndpoint)) + ..add(DiagnosticsProperty('serviceName', serviceName)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidFFIConfigLoggingOtlp && + (identical(other.enabled, enabled) || other.enabled == enabled) && + (identical(other.level, level) || other.level == level) && + (identical(other.grpcEndpoint, grpcEndpoint) || + other.grpcEndpoint == grpcEndpoint) && + (identical(other.serviceName, serviceName) || + other.serviceName == serviceName)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => + Object.hash(runtimeType, enabled, level, grpcEndpoint, serviceName); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidFFIConfigLoggingOtlpCopyWith<_$_VeilidFFIConfigLoggingOtlp> + get copyWith => __$$_VeilidFFIConfigLoggingOtlpCopyWithImpl< + _$_VeilidFFIConfigLoggingOtlp>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidFFIConfigLoggingOtlpToJson( + this, + ); + } +} + +abstract class _VeilidFFIConfigLoggingOtlp + implements VeilidFFIConfigLoggingOtlp { + const factory _VeilidFFIConfigLoggingOtlp( + {required final bool enabled, + required final VeilidConfigLogLevel level, + required final String grpcEndpoint, + required final String serviceName}) = _$_VeilidFFIConfigLoggingOtlp; + + factory _VeilidFFIConfigLoggingOtlp.fromJson(Map json) = + _$_VeilidFFIConfigLoggingOtlp.fromJson; + + @override + bool get enabled; + @override + VeilidConfigLogLevel get level; + @override + String get grpcEndpoint; + @override + String get serviceName; + @override + @JsonKey(ignore: true) + _$$_VeilidFFIConfigLoggingOtlpCopyWith<_$_VeilidFFIConfigLoggingOtlp> + get copyWith => throw _privateConstructorUsedError; +} + +VeilidFFIConfigLoggingApi _$VeilidFFIConfigLoggingApiFromJson( + Map json) { + return _VeilidFFIConfigLoggingApi.fromJson(json); +} + +/// @nodoc +mixin _$VeilidFFIConfigLoggingApi { + bool get enabled => throw _privateConstructorUsedError; + VeilidConfigLogLevel get level => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidFFIConfigLoggingApiCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidFFIConfigLoggingApiCopyWith<$Res> { + factory $VeilidFFIConfigLoggingApiCopyWith(VeilidFFIConfigLoggingApi value, + $Res Function(VeilidFFIConfigLoggingApi) then) = + _$VeilidFFIConfigLoggingApiCopyWithImpl<$Res, VeilidFFIConfigLoggingApi>; + @useResult + $Res call({bool enabled, VeilidConfigLogLevel level}); +} + +/// @nodoc +class _$VeilidFFIConfigLoggingApiCopyWithImpl<$Res, + $Val extends VeilidFFIConfigLoggingApi> + implements $VeilidFFIConfigLoggingApiCopyWith<$Res> { + _$VeilidFFIConfigLoggingApiCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? level = null, + }) { + return _then(_value.copyWith( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + level: null == level + ? _value.level + : level // ignore: cast_nullable_to_non_nullable + as VeilidConfigLogLevel, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidFFIConfigLoggingApiCopyWith<$Res> + implements $VeilidFFIConfigLoggingApiCopyWith<$Res> { + factory _$$_VeilidFFIConfigLoggingApiCopyWith( + _$_VeilidFFIConfigLoggingApi value, + $Res Function(_$_VeilidFFIConfigLoggingApi) then) = + __$$_VeilidFFIConfigLoggingApiCopyWithImpl<$Res>; + @override + @useResult + $Res call({bool enabled, VeilidConfigLogLevel level}); +} + +/// @nodoc +class __$$_VeilidFFIConfigLoggingApiCopyWithImpl<$Res> + extends _$VeilidFFIConfigLoggingApiCopyWithImpl<$Res, + _$_VeilidFFIConfigLoggingApi> + implements _$$_VeilidFFIConfigLoggingApiCopyWith<$Res> { + __$$_VeilidFFIConfigLoggingApiCopyWithImpl( + _$_VeilidFFIConfigLoggingApi _value, + $Res Function(_$_VeilidFFIConfigLoggingApi) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? level = null, + }) { + return _then(_$_VeilidFFIConfigLoggingApi( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + level: null == level + ? _value.level + : level // ignore: cast_nullable_to_non_nullable + as VeilidConfigLogLevel, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidFFIConfigLoggingApi + with DiagnosticableTreeMixin + implements _VeilidFFIConfigLoggingApi { + const _$_VeilidFFIConfigLoggingApi( + {required this.enabled, required this.level}); + + factory _$_VeilidFFIConfigLoggingApi.fromJson(Map json) => + _$$_VeilidFFIConfigLoggingApiFromJson(json); + + @override + final bool enabled; + @override + final VeilidConfigLogLevel level; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfigLoggingApi(enabled: $enabled, level: $level)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidFFIConfigLoggingApi')) + ..add(DiagnosticsProperty('enabled', enabled)) + ..add(DiagnosticsProperty('level', level)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidFFIConfigLoggingApi && + (identical(other.enabled, enabled) || other.enabled == enabled) && + (identical(other.level, level) || other.level == level)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, enabled, level); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidFFIConfigLoggingApiCopyWith<_$_VeilidFFIConfigLoggingApi> + get copyWith => __$$_VeilidFFIConfigLoggingApiCopyWithImpl< + _$_VeilidFFIConfigLoggingApi>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidFFIConfigLoggingApiToJson( + this, + ); + } +} + +abstract class _VeilidFFIConfigLoggingApi implements VeilidFFIConfigLoggingApi { + const factory _VeilidFFIConfigLoggingApi( + {required final bool enabled, + required final VeilidConfigLogLevel level}) = + _$_VeilidFFIConfigLoggingApi; + + factory _VeilidFFIConfigLoggingApi.fromJson(Map json) = + _$_VeilidFFIConfigLoggingApi.fromJson; + + @override + bool get enabled; + @override + VeilidConfigLogLevel get level; + @override + @JsonKey(ignore: true) + _$$_VeilidFFIConfigLoggingApiCopyWith<_$_VeilidFFIConfigLoggingApi> + get copyWith => throw _privateConstructorUsedError; +} + +VeilidFFIConfigLogging _$VeilidFFIConfigLoggingFromJson( + Map json) { + return _VeilidFFIConfigLogging.fromJson(json); +} + +/// @nodoc +mixin _$VeilidFFIConfigLogging { + VeilidFFIConfigLoggingTerminal get terminal => + throw _privateConstructorUsedError; + VeilidFFIConfigLoggingOtlp get otlp => throw _privateConstructorUsedError; + VeilidFFIConfigLoggingApi get api => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidFFIConfigLoggingCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidFFIConfigLoggingCopyWith<$Res> { + factory $VeilidFFIConfigLoggingCopyWith(VeilidFFIConfigLogging value, + $Res Function(VeilidFFIConfigLogging) then) = + _$VeilidFFIConfigLoggingCopyWithImpl<$Res, VeilidFFIConfigLogging>; + @useResult + $Res call( + {VeilidFFIConfigLoggingTerminal terminal, + VeilidFFIConfigLoggingOtlp otlp, + VeilidFFIConfigLoggingApi api}); + + $VeilidFFIConfigLoggingTerminalCopyWith<$Res> get terminal; + $VeilidFFIConfigLoggingOtlpCopyWith<$Res> get otlp; + $VeilidFFIConfigLoggingApiCopyWith<$Res> get api; +} + +/// @nodoc +class _$VeilidFFIConfigLoggingCopyWithImpl<$Res, + $Val extends VeilidFFIConfigLogging> + implements $VeilidFFIConfigLoggingCopyWith<$Res> { + _$VeilidFFIConfigLoggingCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? terminal = null, + Object? otlp = null, + Object? api = null, + }) { + return _then(_value.copyWith( + terminal: null == terminal + ? _value.terminal + : terminal // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLoggingTerminal, + otlp: null == otlp + ? _value.otlp + : otlp // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLoggingOtlp, + api: null == api + ? _value.api + : api // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLoggingApi, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingTerminalCopyWith<$Res> get terminal { + return $VeilidFFIConfigLoggingTerminalCopyWith<$Res>(_value.terminal, + (value) { + return _then(_value.copyWith(terminal: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingOtlpCopyWith<$Res> get otlp { + return $VeilidFFIConfigLoggingOtlpCopyWith<$Res>(_value.otlp, (value) { + return _then(_value.copyWith(otlp: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingApiCopyWith<$Res> get api { + return $VeilidFFIConfigLoggingApiCopyWith<$Res>(_value.api, (value) { + return _then(_value.copyWith(api: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$_VeilidFFIConfigLoggingCopyWith<$Res> + implements $VeilidFFIConfigLoggingCopyWith<$Res> { + factory _$$_VeilidFFIConfigLoggingCopyWith(_$_VeilidFFIConfigLogging value, + $Res Function(_$_VeilidFFIConfigLogging) then) = + __$$_VeilidFFIConfigLoggingCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {VeilidFFIConfigLoggingTerminal terminal, + VeilidFFIConfigLoggingOtlp otlp, + VeilidFFIConfigLoggingApi api}); + + @override + $VeilidFFIConfigLoggingTerminalCopyWith<$Res> get terminal; + @override + $VeilidFFIConfigLoggingOtlpCopyWith<$Res> get otlp; + @override + $VeilidFFIConfigLoggingApiCopyWith<$Res> get api; +} + +/// @nodoc +class __$$_VeilidFFIConfigLoggingCopyWithImpl<$Res> + extends _$VeilidFFIConfigLoggingCopyWithImpl<$Res, + _$_VeilidFFIConfigLogging> + implements _$$_VeilidFFIConfigLoggingCopyWith<$Res> { + __$$_VeilidFFIConfigLoggingCopyWithImpl(_$_VeilidFFIConfigLogging _value, + $Res Function(_$_VeilidFFIConfigLogging) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? terminal = null, + Object? otlp = null, + Object? api = null, + }) { + return _then(_$_VeilidFFIConfigLogging( + terminal: null == terminal + ? _value.terminal + : terminal // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLoggingTerminal, + otlp: null == otlp + ? _value.otlp + : otlp // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLoggingOtlp, + api: null == api + ? _value.api + : api // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLoggingApi, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidFFIConfigLogging + with DiagnosticableTreeMixin + implements _VeilidFFIConfigLogging { + const _$_VeilidFFIConfigLogging( + {required this.terminal, required this.otlp, required this.api}); + + factory _$_VeilidFFIConfigLogging.fromJson(Map json) => + _$$_VeilidFFIConfigLoggingFromJson(json); + + @override + final VeilidFFIConfigLoggingTerminal terminal; + @override + final VeilidFFIConfigLoggingOtlp otlp; + @override + final VeilidFFIConfigLoggingApi api; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfigLogging(terminal: $terminal, otlp: $otlp, api: $api)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidFFIConfigLogging')) + ..add(DiagnosticsProperty('terminal', terminal)) + ..add(DiagnosticsProperty('otlp', otlp)) + ..add(DiagnosticsProperty('api', api)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidFFIConfigLogging && + (identical(other.terminal, terminal) || + other.terminal == terminal) && + (identical(other.otlp, otlp) || other.otlp == otlp) && + (identical(other.api, api) || other.api == api)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, terminal, otlp, api); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidFFIConfigLoggingCopyWith<_$_VeilidFFIConfigLogging> get copyWith => + __$$_VeilidFFIConfigLoggingCopyWithImpl<_$_VeilidFFIConfigLogging>( + this, _$identity); + + @override + Map toJson() { + return _$$_VeilidFFIConfigLoggingToJson( + this, + ); + } +} + +abstract class _VeilidFFIConfigLogging implements VeilidFFIConfigLogging { + const factory _VeilidFFIConfigLogging( + {required final VeilidFFIConfigLoggingTerminal terminal, + required final VeilidFFIConfigLoggingOtlp otlp, + required final VeilidFFIConfigLoggingApi api}) = + _$_VeilidFFIConfigLogging; + + factory _VeilidFFIConfigLogging.fromJson(Map json) = + _$_VeilidFFIConfigLogging.fromJson; + + @override + VeilidFFIConfigLoggingTerminal get terminal; + @override + VeilidFFIConfigLoggingOtlp get otlp; + @override + VeilidFFIConfigLoggingApi get api; + @override + @JsonKey(ignore: true) + _$$_VeilidFFIConfigLoggingCopyWith<_$_VeilidFFIConfigLogging> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidFFIConfig _$VeilidFFIConfigFromJson(Map json) { + return _VeilidFFIConfig.fromJson(json); +} + +/// @nodoc +mixin _$VeilidFFIConfig { + VeilidFFIConfigLogging get logging => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidFFIConfigCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidFFIConfigCopyWith<$Res> { + factory $VeilidFFIConfigCopyWith( + VeilidFFIConfig value, $Res Function(VeilidFFIConfig) then) = + _$VeilidFFIConfigCopyWithImpl<$Res, VeilidFFIConfig>; + @useResult + $Res call({VeilidFFIConfigLogging logging}); + + $VeilidFFIConfigLoggingCopyWith<$Res> get logging; +} + +/// @nodoc +class _$VeilidFFIConfigCopyWithImpl<$Res, $Val extends VeilidFFIConfig> + implements $VeilidFFIConfigCopyWith<$Res> { + _$VeilidFFIConfigCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? logging = null, + }) { + return _then(_value.copyWith( + logging: null == logging + ? _value.logging + : logging // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLogging, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingCopyWith<$Res> get logging { + return $VeilidFFIConfigLoggingCopyWith<$Res>(_value.logging, (value) { + return _then(_value.copyWith(logging: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$_VeilidFFIConfigCopyWith<$Res> + implements $VeilidFFIConfigCopyWith<$Res> { + factory _$$_VeilidFFIConfigCopyWith( + _$_VeilidFFIConfig value, $Res Function(_$_VeilidFFIConfig) then) = + __$$_VeilidFFIConfigCopyWithImpl<$Res>; + @override + @useResult + $Res call({VeilidFFIConfigLogging logging}); + + @override + $VeilidFFIConfigLoggingCopyWith<$Res> get logging; +} + +/// @nodoc +class __$$_VeilidFFIConfigCopyWithImpl<$Res> + extends _$VeilidFFIConfigCopyWithImpl<$Res, _$_VeilidFFIConfig> + implements _$$_VeilidFFIConfigCopyWith<$Res> { + __$$_VeilidFFIConfigCopyWithImpl( + _$_VeilidFFIConfig _value, $Res Function(_$_VeilidFFIConfig) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? logging = null, + }) { + return _then(_$_VeilidFFIConfig( + logging: null == logging + ? _value.logging + : logging // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLogging, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidFFIConfig + with DiagnosticableTreeMixin + implements _VeilidFFIConfig { + const _$_VeilidFFIConfig({required this.logging}); + + factory _$_VeilidFFIConfig.fromJson(Map json) => + _$$_VeilidFFIConfigFromJson(json); + + @override + final VeilidFFIConfigLogging logging; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfig(logging: $logging)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidFFIConfig')) + ..add(DiagnosticsProperty('logging', logging)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidFFIConfig && + (identical(other.logging, logging) || other.logging == logging)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, logging); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidFFIConfigCopyWith<_$_VeilidFFIConfig> get copyWith => + __$$_VeilidFFIConfigCopyWithImpl<_$_VeilidFFIConfig>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidFFIConfigToJson( + this, + ); + } +} + +abstract class _VeilidFFIConfig implements VeilidFFIConfig { + const factory _VeilidFFIConfig( + {required final VeilidFFIConfigLogging logging}) = _$_VeilidFFIConfig; + + factory _VeilidFFIConfig.fromJson(Map json) = + _$_VeilidFFIConfig.fromJson; + + @override + VeilidFFIConfigLogging get logging; + @override + @JsonKey(ignore: true) + _$$_VeilidFFIConfigCopyWith<_$_VeilidFFIConfig> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidWASMConfigLoggingPerformance _$VeilidWASMConfigLoggingPerformanceFromJson( + Map json) { + return _VeilidWASMConfigLoggingPerformance.fromJson(json); +} + +/// @nodoc +mixin _$VeilidWASMConfigLoggingPerformance { + bool get enabled => throw _privateConstructorUsedError; + VeilidConfigLogLevel get level => throw _privateConstructorUsedError; + bool get logsInTimings => throw _privateConstructorUsedError; + bool get logsInConsole => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidWASMConfigLoggingPerformanceCopyWith< + VeilidWASMConfigLoggingPerformance> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> { + factory $VeilidWASMConfigLoggingPerformanceCopyWith( + VeilidWASMConfigLoggingPerformance value, + $Res Function(VeilidWASMConfigLoggingPerformance) then) = + _$VeilidWASMConfigLoggingPerformanceCopyWithImpl<$Res, + VeilidWASMConfigLoggingPerformance>; + @useResult + $Res call( + {bool enabled, + VeilidConfigLogLevel level, + bool logsInTimings, + bool logsInConsole}); +} + +/// @nodoc +class _$VeilidWASMConfigLoggingPerformanceCopyWithImpl<$Res, + $Val extends VeilidWASMConfigLoggingPerformance> + implements $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> { + _$VeilidWASMConfigLoggingPerformanceCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? level = null, + Object? logsInTimings = null, + Object? logsInConsole = null, + }) { + return _then(_value.copyWith( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + level: null == level + ? _value.level + : level // ignore: cast_nullable_to_non_nullable + as VeilidConfigLogLevel, + logsInTimings: null == logsInTimings + ? _value.logsInTimings + : logsInTimings // ignore: cast_nullable_to_non_nullable + as bool, + logsInConsole: null == logsInConsole + ? _value.logsInConsole + : logsInConsole // ignore: cast_nullable_to_non_nullable + as bool, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidWASMConfigLoggingPerformanceCopyWith<$Res> + implements $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> { + factory _$$_VeilidWASMConfigLoggingPerformanceCopyWith( + _$_VeilidWASMConfigLoggingPerformance value, + $Res Function(_$_VeilidWASMConfigLoggingPerformance) then) = + __$$_VeilidWASMConfigLoggingPerformanceCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {bool enabled, + VeilidConfigLogLevel level, + bool logsInTimings, + bool logsInConsole}); +} + +/// @nodoc +class __$$_VeilidWASMConfigLoggingPerformanceCopyWithImpl<$Res> + extends _$VeilidWASMConfigLoggingPerformanceCopyWithImpl<$Res, + _$_VeilidWASMConfigLoggingPerformance> + implements _$$_VeilidWASMConfigLoggingPerformanceCopyWith<$Res> { + __$$_VeilidWASMConfigLoggingPerformanceCopyWithImpl( + _$_VeilidWASMConfigLoggingPerformance _value, + $Res Function(_$_VeilidWASMConfigLoggingPerformance) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? level = null, + Object? logsInTimings = null, + Object? logsInConsole = null, + }) { + return _then(_$_VeilidWASMConfigLoggingPerformance( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + level: null == level + ? _value.level + : level // ignore: cast_nullable_to_non_nullable + as VeilidConfigLogLevel, + logsInTimings: null == logsInTimings + ? _value.logsInTimings + : logsInTimings // ignore: cast_nullable_to_non_nullable + as bool, + logsInConsole: null == logsInConsole + ? _value.logsInConsole + : logsInConsole // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidWASMConfigLoggingPerformance + with DiagnosticableTreeMixin + implements _VeilidWASMConfigLoggingPerformance { + const _$_VeilidWASMConfigLoggingPerformance( + {required this.enabled, + required this.level, + required this.logsInTimings, + required this.logsInConsole}); + + factory _$_VeilidWASMConfigLoggingPerformance.fromJson( + Map json) => + _$$_VeilidWASMConfigLoggingPerformanceFromJson(json); + + @override + final bool enabled; + @override + final VeilidConfigLogLevel level; + @override + final bool logsInTimings; + @override + final bool logsInConsole; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidWASMConfigLoggingPerformance(enabled: $enabled, level: $level, logsInTimings: $logsInTimings, logsInConsole: $logsInConsole)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidWASMConfigLoggingPerformance')) + ..add(DiagnosticsProperty('enabled', enabled)) + ..add(DiagnosticsProperty('level', level)) + ..add(DiagnosticsProperty('logsInTimings', logsInTimings)) + ..add(DiagnosticsProperty('logsInConsole', logsInConsole)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidWASMConfigLoggingPerformance && + (identical(other.enabled, enabled) || other.enabled == enabled) && + (identical(other.level, level) || other.level == level) && + (identical(other.logsInTimings, logsInTimings) || + other.logsInTimings == logsInTimings) && + (identical(other.logsInConsole, logsInConsole) || + other.logsInConsole == logsInConsole)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => + Object.hash(runtimeType, enabled, level, logsInTimings, logsInConsole); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidWASMConfigLoggingPerformanceCopyWith< + _$_VeilidWASMConfigLoggingPerformance> + get copyWith => __$$_VeilidWASMConfigLoggingPerformanceCopyWithImpl< + _$_VeilidWASMConfigLoggingPerformance>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidWASMConfigLoggingPerformanceToJson( + this, + ); + } +} + +abstract class _VeilidWASMConfigLoggingPerformance + implements VeilidWASMConfigLoggingPerformance { + const factory _VeilidWASMConfigLoggingPerformance( + {required final bool enabled, + required final VeilidConfigLogLevel level, + required final bool logsInTimings, + required final bool logsInConsole}) = + _$_VeilidWASMConfigLoggingPerformance; + + factory _VeilidWASMConfigLoggingPerformance.fromJson( + Map json) = + _$_VeilidWASMConfigLoggingPerformance.fromJson; + + @override + bool get enabled; + @override + VeilidConfigLogLevel get level; + @override + bool get logsInTimings; + @override + bool get logsInConsole; + @override + @JsonKey(ignore: true) + _$$_VeilidWASMConfigLoggingPerformanceCopyWith< + _$_VeilidWASMConfigLoggingPerformance> + get copyWith => throw _privateConstructorUsedError; +} + +VeilidWASMConfigLoggingApi _$VeilidWASMConfigLoggingApiFromJson( + Map json) { + return _VeilidWASMConfigLoggingApi.fromJson(json); +} + +/// @nodoc +mixin _$VeilidWASMConfigLoggingApi { + bool get enabled => throw _privateConstructorUsedError; + VeilidConfigLogLevel get level => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidWASMConfigLoggingApiCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidWASMConfigLoggingApiCopyWith<$Res> { + factory $VeilidWASMConfigLoggingApiCopyWith(VeilidWASMConfigLoggingApi value, + $Res Function(VeilidWASMConfigLoggingApi) then) = + _$VeilidWASMConfigLoggingApiCopyWithImpl<$Res, + VeilidWASMConfigLoggingApi>; + @useResult + $Res call({bool enabled, VeilidConfigLogLevel level}); +} + +/// @nodoc +class _$VeilidWASMConfigLoggingApiCopyWithImpl<$Res, + $Val extends VeilidWASMConfigLoggingApi> + implements $VeilidWASMConfigLoggingApiCopyWith<$Res> { + _$VeilidWASMConfigLoggingApiCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? level = null, + }) { + return _then(_value.copyWith( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + level: null == level + ? _value.level + : level // ignore: cast_nullable_to_non_nullable + as VeilidConfigLogLevel, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidWASMConfigLoggingApiCopyWith<$Res> + implements $VeilidWASMConfigLoggingApiCopyWith<$Res> { + factory _$$_VeilidWASMConfigLoggingApiCopyWith( + _$_VeilidWASMConfigLoggingApi value, + $Res Function(_$_VeilidWASMConfigLoggingApi) then) = + __$$_VeilidWASMConfigLoggingApiCopyWithImpl<$Res>; + @override + @useResult + $Res call({bool enabled, VeilidConfigLogLevel level}); +} + +/// @nodoc +class __$$_VeilidWASMConfigLoggingApiCopyWithImpl<$Res> + extends _$VeilidWASMConfigLoggingApiCopyWithImpl<$Res, + _$_VeilidWASMConfigLoggingApi> + implements _$$_VeilidWASMConfigLoggingApiCopyWith<$Res> { + __$$_VeilidWASMConfigLoggingApiCopyWithImpl( + _$_VeilidWASMConfigLoggingApi _value, + $Res Function(_$_VeilidWASMConfigLoggingApi) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? level = null, + }) { + return _then(_$_VeilidWASMConfigLoggingApi( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + level: null == level + ? _value.level + : level // ignore: cast_nullable_to_non_nullable + as VeilidConfigLogLevel, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidWASMConfigLoggingApi + with DiagnosticableTreeMixin + implements _VeilidWASMConfigLoggingApi { + const _$_VeilidWASMConfigLoggingApi( + {required this.enabled, required this.level}); + + factory _$_VeilidWASMConfigLoggingApi.fromJson(Map json) => + _$$_VeilidWASMConfigLoggingApiFromJson(json); + + @override + final bool enabled; + @override + final VeilidConfigLogLevel level; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidWASMConfigLoggingApi(enabled: $enabled, level: $level)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidWASMConfigLoggingApi')) + ..add(DiagnosticsProperty('enabled', enabled)) + ..add(DiagnosticsProperty('level', level)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidWASMConfigLoggingApi && + (identical(other.enabled, enabled) || other.enabled == enabled) && + (identical(other.level, level) || other.level == level)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, enabled, level); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidWASMConfigLoggingApiCopyWith<_$_VeilidWASMConfigLoggingApi> + get copyWith => __$$_VeilidWASMConfigLoggingApiCopyWithImpl< + _$_VeilidWASMConfigLoggingApi>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidWASMConfigLoggingApiToJson( + this, + ); + } +} + +abstract class _VeilidWASMConfigLoggingApi + implements VeilidWASMConfigLoggingApi { + const factory _VeilidWASMConfigLoggingApi( + {required final bool enabled, + required final VeilidConfigLogLevel level}) = + _$_VeilidWASMConfigLoggingApi; + + factory _VeilidWASMConfigLoggingApi.fromJson(Map json) = + _$_VeilidWASMConfigLoggingApi.fromJson; + + @override + bool get enabled; + @override + VeilidConfigLogLevel get level; + @override + @JsonKey(ignore: true) + _$$_VeilidWASMConfigLoggingApiCopyWith<_$_VeilidWASMConfigLoggingApi> + get copyWith => throw _privateConstructorUsedError; +} + +VeilidWASMConfigLogging _$VeilidWASMConfigLoggingFromJson( + Map json) { + return _VeilidWASMConfigLogging.fromJson(json); +} + +/// @nodoc +mixin _$VeilidWASMConfigLogging { + VeilidWASMConfigLoggingPerformance get performance => + throw _privateConstructorUsedError; + VeilidWASMConfigLoggingApi get api => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidWASMConfigLoggingCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidWASMConfigLoggingCopyWith<$Res> { + factory $VeilidWASMConfigLoggingCopyWith(VeilidWASMConfigLogging value, + $Res Function(VeilidWASMConfigLogging) then) = + _$VeilidWASMConfigLoggingCopyWithImpl<$Res, VeilidWASMConfigLogging>; + @useResult + $Res call( + {VeilidWASMConfigLoggingPerformance performance, + VeilidWASMConfigLoggingApi api}); + + $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> get performance; + $VeilidWASMConfigLoggingApiCopyWith<$Res> get api; +} + +/// @nodoc +class _$VeilidWASMConfigLoggingCopyWithImpl<$Res, + $Val extends VeilidWASMConfigLogging> + implements $VeilidWASMConfigLoggingCopyWith<$Res> { + _$VeilidWASMConfigLoggingCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? performance = null, + Object? api = null, + }) { + return _then(_value.copyWith( + performance: null == performance + ? _value.performance + : performance // ignore: cast_nullable_to_non_nullable + as VeilidWASMConfigLoggingPerformance, + api: null == api + ? _value.api + : api // ignore: cast_nullable_to_non_nullable + as VeilidWASMConfigLoggingApi, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> get performance { + return $VeilidWASMConfigLoggingPerformanceCopyWith<$Res>(_value.performance, + (value) { + return _then(_value.copyWith(performance: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidWASMConfigLoggingApiCopyWith<$Res> get api { + return $VeilidWASMConfigLoggingApiCopyWith<$Res>(_value.api, (value) { + return _then(_value.copyWith(api: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$_VeilidWASMConfigLoggingCopyWith<$Res> + implements $VeilidWASMConfigLoggingCopyWith<$Res> { + factory _$$_VeilidWASMConfigLoggingCopyWith(_$_VeilidWASMConfigLogging value, + $Res Function(_$_VeilidWASMConfigLogging) then) = + __$$_VeilidWASMConfigLoggingCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {VeilidWASMConfigLoggingPerformance performance, + VeilidWASMConfigLoggingApi api}); + + @override + $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> get performance; + @override + $VeilidWASMConfigLoggingApiCopyWith<$Res> get api; +} + +/// @nodoc +class __$$_VeilidWASMConfigLoggingCopyWithImpl<$Res> + extends _$VeilidWASMConfigLoggingCopyWithImpl<$Res, + _$_VeilidWASMConfigLogging> + implements _$$_VeilidWASMConfigLoggingCopyWith<$Res> { + __$$_VeilidWASMConfigLoggingCopyWithImpl(_$_VeilidWASMConfigLogging _value, + $Res Function(_$_VeilidWASMConfigLogging) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? performance = null, + Object? api = null, + }) { + return _then(_$_VeilidWASMConfigLogging( + performance: null == performance + ? _value.performance + : performance // ignore: cast_nullable_to_non_nullable + as VeilidWASMConfigLoggingPerformance, + api: null == api + ? _value.api + : api // ignore: cast_nullable_to_non_nullable + as VeilidWASMConfigLoggingApi, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidWASMConfigLogging + with DiagnosticableTreeMixin + implements _VeilidWASMConfigLogging { + const _$_VeilidWASMConfigLogging( + {required this.performance, required this.api}); + + factory _$_VeilidWASMConfigLogging.fromJson(Map json) => + _$$_VeilidWASMConfigLoggingFromJson(json); + + @override + final VeilidWASMConfigLoggingPerformance performance; + @override + final VeilidWASMConfigLoggingApi api; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidWASMConfigLogging(performance: $performance, api: $api)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidWASMConfigLogging')) + ..add(DiagnosticsProperty('performance', performance)) + ..add(DiagnosticsProperty('api', api)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidWASMConfigLogging && + (identical(other.performance, performance) || + other.performance == performance) && + (identical(other.api, api) || other.api == api)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, performance, api); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidWASMConfigLoggingCopyWith<_$_VeilidWASMConfigLogging> + get copyWith => + __$$_VeilidWASMConfigLoggingCopyWithImpl<_$_VeilidWASMConfigLogging>( + this, _$identity); + + @override + Map toJson() { + return _$$_VeilidWASMConfigLoggingToJson( + this, + ); + } +} + +abstract class _VeilidWASMConfigLogging implements VeilidWASMConfigLogging { + const factory _VeilidWASMConfigLogging( + {required final VeilidWASMConfigLoggingPerformance performance, + required final VeilidWASMConfigLoggingApi api}) = + _$_VeilidWASMConfigLogging; + + factory _VeilidWASMConfigLogging.fromJson(Map json) = + _$_VeilidWASMConfigLogging.fromJson; + + @override + VeilidWASMConfigLoggingPerformance get performance; + @override + VeilidWASMConfigLoggingApi get api; + @override + @JsonKey(ignore: true) + _$$_VeilidWASMConfigLoggingCopyWith<_$_VeilidWASMConfigLogging> + get copyWith => throw _privateConstructorUsedError; +} + +VeilidWASMConfig _$VeilidWASMConfigFromJson(Map json) { + return _VeilidWASMConfig.fromJson(json); +} + +/// @nodoc +mixin _$VeilidWASMConfig { + VeilidWASMConfigLogging get logging => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidWASMConfigCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidWASMConfigCopyWith<$Res> { + factory $VeilidWASMConfigCopyWith( + VeilidWASMConfig value, $Res Function(VeilidWASMConfig) then) = + _$VeilidWASMConfigCopyWithImpl<$Res, VeilidWASMConfig>; + @useResult + $Res call({VeilidWASMConfigLogging logging}); + + $VeilidWASMConfigLoggingCopyWith<$Res> get logging; +} + +/// @nodoc +class _$VeilidWASMConfigCopyWithImpl<$Res, $Val extends VeilidWASMConfig> + implements $VeilidWASMConfigCopyWith<$Res> { + _$VeilidWASMConfigCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? logging = null, + }) { + return _then(_value.copyWith( + logging: null == logging + ? _value.logging + : logging // ignore: cast_nullable_to_non_nullable + as VeilidWASMConfigLogging, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $VeilidWASMConfigLoggingCopyWith<$Res> get logging { + return $VeilidWASMConfigLoggingCopyWith<$Res>(_value.logging, (value) { + return _then(_value.copyWith(logging: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$_VeilidWASMConfigCopyWith<$Res> + implements $VeilidWASMConfigCopyWith<$Res> { + factory _$$_VeilidWASMConfigCopyWith( + _$_VeilidWASMConfig value, $Res Function(_$_VeilidWASMConfig) then) = + __$$_VeilidWASMConfigCopyWithImpl<$Res>; + @override + @useResult + $Res call({VeilidWASMConfigLogging logging}); + + @override + $VeilidWASMConfigLoggingCopyWith<$Res> get logging; +} + +/// @nodoc +class __$$_VeilidWASMConfigCopyWithImpl<$Res> + extends _$VeilidWASMConfigCopyWithImpl<$Res, _$_VeilidWASMConfig> + implements _$$_VeilidWASMConfigCopyWith<$Res> { + __$$_VeilidWASMConfigCopyWithImpl( + _$_VeilidWASMConfig _value, $Res Function(_$_VeilidWASMConfig) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? logging = null, + }) { + return _then(_$_VeilidWASMConfig( + logging: null == logging + ? _value.logging + : logging // ignore: cast_nullable_to_non_nullable + as VeilidWASMConfigLogging, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidWASMConfig + with DiagnosticableTreeMixin + implements _VeilidWASMConfig { + const _$_VeilidWASMConfig({required this.logging}); + + factory _$_VeilidWASMConfig.fromJson(Map json) => + _$$_VeilidWASMConfigFromJson(json); + + @override + final VeilidWASMConfigLogging logging; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidWASMConfig(logging: $logging)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidWASMConfig')) + ..add(DiagnosticsProperty('logging', logging)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidWASMConfig && + (identical(other.logging, logging) || other.logging == logging)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, logging); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidWASMConfigCopyWith<_$_VeilidWASMConfig> get copyWith => + __$$_VeilidWASMConfigCopyWithImpl<_$_VeilidWASMConfig>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidWASMConfigToJson( + this, + ); + } +} + +abstract class _VeilidWASMConfig implements VeilidWASMConfig { + const factory _VeilidWASMConfig( + {required final VeilidWASMConfigLogging logging}) = _$_VeilidWASMConfig; + + factory _VeilidWASMConfig.fromJson(Map json) = + _$_VeilidWASMConfig.fromJson; + + @override + VeilidWASMConfigLogging get logging; + @override + @JsonKey(ignore: true) + _$$_VeilidWASMConfigCopyWith<_$_VeilidWASMConfig> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidConfigHTTPS _$VeilidConfigHTTPSFromJson(Map json) { + return _VeilidConfigHTTPS.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigHTTPS { + bool get enabled => throw _privateConstructorUsedError; + String get listenAddress => throw _privateConstructorUsedError; + String get path => throw _privateConstructorUsedError; + String? get url => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigHTTPSCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigHTTPSCopyWith<$Res> { + factory $VeilidConfigHTTPSCopyWith( + VeilidConfigHTTPS value, $Res Function(VeilidConfigHTTPS) then) = + _$VeilidConfigHTTPSCopyWithImpl<$Res, VeilidConfigHTTPS>; + @useResult + $Res call({bool enabled, String listenAddress, String path, String? url}); +} + +/// @nodoc +class _$VeilidConfigHTTPSCopyWithImpl<$Res, $Val extends VeilidConfigHTTPS> + implements $VeilidConfigHTTPSCopyWith<$Res> { + _$VeilidConfigHTTPSCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? listenAddress = null, + Object? path = null, + Object? url = freezed, + }) { + return _then(_value.copyWith( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + listenAddress: null == listenAddress + ? _value.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + path: null == path + ? _value.path + : path // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigHTTPSCopyWith<$Res> + implements $VeilidConfigHTTPSCopyWith<$Res> { + factory _$$_VeilidConfigHTTPSCopyWith(_$_VeilidConfigHTTPS value, + $Res Function(_$_VeilidConfigHTTPS) then) = + __$$_VeilidConfigHTTPSCopyWithImpl<$Res>; + @override + @useResult + $Res call({bool enabled, String listenAddress, String path, String? url}); +} + +/// @nodoc +class __$$_VeilidConfigHTTPSCopyWithImpl<$Res> + extends _$VeilidConfigHTTPSCopyWithImpl<$Res, _$_VeilidConfigHTTPS> + implements _$$_VeilidConfigHTTPSCopyWith<$Res> { + __$$_VeilidConfigHTTPSCopyWithImpl( + _$_VeilidConfigHTTPS _value, $Res Function(_$_VeilidConfigHTTPS) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? listenAddress = null, + Object? path = null, + Object? url = freezed, + }) { + return _then(_$_VeilidConfigHTTPS( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + listenAddress: null == listenAddress + ? _value.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + path: null == path + ? _value.path + : path // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigHTTPS + with DiagnosticableTreeMixin + implements _VeilidConfigHTTPS { + const _$_VeilidConfigHTTPS( + {required this.enabled, + required this.listenAddress, + required this.path, + this.url}); + + factory _$_VeilidConfigHTTPS.fromJson(Map json) => + _$$_VeilidConfigHTTPSFromJson(json); + + @override + final bool enabled; + @override + final String listenAddress; + @override + final String path; + @override + final String? url; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigHTTPS(enabled: $enabled, listenAddress: $listenAddress, path: $path, url: $url)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigHTTPS')) + ..add(DiagnosticsProperty('enabled', enabled)) + ..add(DiagnosticsProperty('listenAddress', listenAddress)) + ..add(DiagnosticsProperty('path', path)) + ..add(DiagnosticsProperty('url', url)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigHTTPS && + (identical(other.enabled, enabled) || other.enabled == enabled) && + (identical(other.listenAddress, listenAddress) || + other.listenAddress == listenAddress) && + (identical(other.path, path) || other.path == path) && + (identical(other.url, url) || other.url == url)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => + Object.hash(runtimeType, enabled, listenAddress, path, url); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigHTTPSCopyWith<_$_VeilidConfigHTTPS> get copyWith => + __$$_VeilidConfigHTTPSCopyWithImpl<_$_VeilidConfigHTTPS>( + this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigHTTPSToJson( + this, + ); + } +} + +abstract class _VeilidConfigHTTPS implements VeilidConfigHTTPS { + const factory _VeilidConfigHTTPS( + {required final bool enabled, + required final String listenAddress, + required final String path, + final String? url}) = _$_VeilidConfigHTTPS; + + factory _VeilidConfigHTTPS.fromJson(Map json) = + _$_VeilidConfigHTTPS.fromJson; + + @override + bool get enabled; + @override + String get listenAddress; + @override + String get path; + @override + String? get url; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigHTTPSCopyWith<_$_VeilidConfigHTTPS> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidConfigHTTP _$VeilidConfigHTTPFromJson(Map json) { + return _VeilidConfigHTTP.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigHTTP { + bool get enabled => throw _privateConstructorUsedError; + String get listenAddress => throw _privateConstructorUsedError; + String get path => throw _privateConstructorUsedError; + String? get url => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigHTTPCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigHTTPCopyWith<$Res> { + factory $VeilidConfigHTTPCopyWith( + VeilidConfigHTTP value, $Res Function(VeilidConfigHTTP) then) = + _$VeilidConfigHTTPCopyWithImpl<$Res, VeilidConfigHTTP>; + @useResult + $Res call({bool enabled, String listenAddress, String path, String? url}); +} + +/// @nodoc +class _$VeilidConfigHTTPCopyWithImpl<$Res, $Val extends VeilidConfigHTTP> + implements $VeilidConfigHTTPCopyWith<$Res> { + _$VeilidConfigHTTPCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? listenAddress = null, + Object? path = null, + Object? url = freezed, + }) { + return _then(_value.copyWith( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + listenAddress: null == listenAddress + ? _value.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + path: null == path + ? _value.path + : path // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigHTTPCopyWith<$Res> + implements $VeilidConfigHTTPCopyWith<$Res> { + factory _$$_VeilidConfigHTTPCopyWith( + _$_VeilidConfigHTTP value, $Res Function(_$_VeilidConfigHTTP) then) = + __$$_VeilidConfigHTTPCopyWithImpl<$Res>; + @override + @useResult + $Res call({bool enabled, String listenAddress, String path, String? url}); +} + +/// @nodoc +class __$$_VeilidConfigHTTPCopyWithImpl<$Res> + extends _$VeilidConfigHTTPCopyWithImpl<$Res, _$_VeilidConfigHTTP> + implements _$$_VeilidConfigHTTPCopyWith<$Res> { + __$$_VeilidConfigHTTPCopyWithImpl( + _$_VeilidConfigHTTP _value, $Res Function(_$_VeilidConfigHTTP) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? listenAddress = null, + Object? path = null, + Object? url = freezed, + }) { + return _then(_$_VeilidConfigHTTP( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + listenAddress: null == listenAddress + ? _value.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + path: null == path + ? _value.path + : path // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigHTTP + with DiagnosticableTreeMixin + implements _VeilidConfigHTTP { + const _$_VeilidConfigHTTP( + {required this.enabled, + required this.listenAddress, + required this.path, + this.url}); + + factory _$_VeilidConfigHTTP.fromJson(Map json) => + _$$_VeilidConfigHTTPFromJson(json); + + @override + final bool enabled; + @override + final String listenAddress; + @override + final String path; + @override + final String? url; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigHTTP(enabled: $enabled, listenAddress: $listenAddress, path: $path, url: $url)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigHTTP')) + ..add(DiagnosticsProperty('enabled', enabled)) + ..add(DiagnosticsProperty('listenAddress', listenAddress)) + ..add(DiagnosticsProperty('path', path)) + ..add(DiagnosticsProperty('url', url)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigHTTP && + (identical(other.enabled, enabled) || other.enabled == enabled) && + (identical(other.listenAddress, listenAddress) || + other.listenAddress == listenAddress) && + (identical(other.path, path) || other.path == path) && + (identical(other.url, url) || other.url == url)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => + Object.hash(runtimeType, enabled, listenAddress, path, url); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigHTTPCopyWith<_$_VeilidConfigHTTP> get copyWith => + __$$_VeilidConfigHTTPCopyWithImpl<_$_VeilidConfigHTTP>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigHTTPToJson( + this, + ); + } +} + +abstract class _VeilidConfigHTTP implements VeilidConfigHTTP { + const factory _VeilidConfigHTTP( + {required final bool enabled, + required final String listenAddress, + required final String path, + final String? url}) = _$_VeilidConfigHTTP; + + factory _VeilidConfigHTTP.fromJson(Map json) = + _$_VeilidConfigHTTP.fromJson; + + @override + bool get enabled; + @override + String get listenAddress; + @override + String get path; + @override + String? get url; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigHTTPCopyWith<_$_VeilidConfigHTTP> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidConfigApplication _$VeilidConfigApplicationFromJson( + Map json) { + return _VeilidConfigApplication.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigApplication { + VeilidConfigHTTPS get https => throw _privateConstructorUsedError; + VeilidConfigHTTP get http => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigApplicationCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigApplicationCopyWith<$Res> { + factory $VeilidConfigApplicationCopyWith(VeilidConfigApplication value, + $Res Function(VeilidConfigApplication) then) = + _$VeilidConfigApplicationCopyWithImpl<$Res, VeilidConfigApplication>; + @useResult + $Res call({VeilidConfigHTTPS https, VeilidConfigHTTP http}); + + $VeilidConfigHTTPSCopyWith<$Res> get https; + $VeilidConfigHTTPCopyWith<$Res> get http; +} + +/// @nodoc +class _$VeilidConfigApplicationCopyWithImpl<$Res, + $Val extends VeilidConfigApplication> + implements $VeilidConfigApplicationCopyWith<$Res> { + _$VeilidConfigApplicationCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? https = null, + Object? http = null, + }) { + return _then(_value.copyWith( + https: null == https + ? _value.https + : https // ignore: cast_nullable_to_non_nullable + as VeilidConfigHTTPS, + http: null == http + ? _value.http + : http // ignore: cast_nullable_to_non_nullable + as VeilidConfigHTTP, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigHTTPSCopyWith<$Res> get https { + return $VeilidConfigHTTPSCopyWith<$Res>(_value.https, (value) { + return _then(_value.copyWith(https: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigHTTPCopyWith<$Res> get http { + return $VeilidConfigHTTPCopyWith<$Res>(_value.http, (value) { + return _then(_value.copyWith(http: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigApplicationCopyWith<$Res> + implements $VeilidConfigApplicationCopyWith<$Res> { + factory _$$_VeilidConfigApplicationCopyWith(_$_VeilidConfigApplication value, + $Res Function(_$_VeilidConfigApplication) then) = + __$$_VeilidConfigApplicationCopyWithImpl<$Res>; + @override + @useResult + $Res call({VeilidConfigHTTPS https, VeilidConfigHTTP http}); + + @override + $VeilidConfigHTTPSCopyWith<$Res> get https; + @override + $VeilidConfigHTTPCopyWith<$Res> get http; +} + +/// @nodoc +class __$$_VeilidConfigApplicationCopyWithImpl<$Res> + extends _$VeilidConfigApplicationCopyWithImpl<$Res, + _$_VeilidConfigApplication> + implements _$$_VeilidConfigApplicationCopyWith<$Res> { + __$$_VeilidConfigApplicationCopyWithImpl(_$_VeilidConfigApplication _value, + $Res Function(_$_VeilidConfigApplication) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? https = null, + Object? http = null, + }) { + return _then(_$_VeilidConfigApplication( + https: null == https + ? _value.https + : https // ignore: cast_nullable_to_non_nullable + as VeilidConfigHTTPS, + http: null == http + ? _value.http + : http // ignore: cast_nullable_to_non_nullable + as VeilidConfigHTTP, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigApplication + with DiagnosticableTreeMixin + implements _VeilidConfigApplication { + const _$_VeilidConfigApplication({required this.https, required this.http}); + + factory _$_VeilidConfigApplication.fromJson(Map json) => + _$$_VeilidConfigApplicationFromJson(json); + + @override + final VeilidConfigHTTPS https; + @override + final VeilidConfigHTTP http; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigApplication(https: $https, http: $http)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigApplication')) + ..add(DiagnosticsProperty('https', https)) + ..add(DiagnosticsProperty('http', http)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigApplication && + (identical(other.https, https) || other.https == https) && + (identical(other.http, http) || other.http == http)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, https, http); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigApplicationCopyWith<_$_VeilidConfigApplication> + get copyWith => + __$$_VeilidConfigApplicationCopyWithImpl<_$_VeilidConfigApplication>( + this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigApplicationToJson( + this, + ); + } +} + +abstract class _VeilidConfigApplication implements VeilidConfigApplication { + const factory _VeilidConfigApplication( + {required final VeilidConfigHTTPS https, + required final VeilidConfigHTTP http}) = _$_VeilidConfigApplication; + + factory _VeilidConfigApplication.fromJson(Map json) = + _$_VeilidConfigApplication.fromJson; + + @override + VeilidConfigHTTPS get https; + @override + VeilidConfigHTTP get http; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigApplicationCopyWith<_$_VeilidConfigApplication> + get copyWith => throw _privateConstructorUsedError; +} + +VeilidConfigUDP _$VeilidConfigUDPFromJson(Map json) { + return _VeilidConfigUDP.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigUDP { + bool get enabled => throw _privateConstructorUsedError; + int get socketPoolSize => throw _privateConstructorUsedError; + String get listenAddress => throw _privateConstructorUsedError; + String? get publicAddress => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigUDPCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigUDPCopyWith<$Res> { + factory $VeilidConfigUDPCopyWith( + VeilidConfigUDP value, $Res Function(VeilidConfigUDP) then) = + _$VeilidConfigUDPCopyWithImpl<$Res, VeilidConfigUDP>; + @useResult + $Res call( + {bool enabled, + int socketPoolSize, + String listenAddress, + String? publicAddress}); +} + +/// @nodoc +class _$VeilidConfigUDPCopyWithImpl<$Res, $Val extends VeilidConfigUDP> + implements $VeilidConfigUDPCopyWith<$Res> { + _$VeilidConfigUDPCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? socketPoolSize = null, + Object? listenAddress = null, + Object? publicAddress = freezed, + }) { + return _then(_value.copyWith( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + socketPoolSize: null == socketPoolSize + ? _value.socketPoolSize + : socketPoolSize // ignore: cast_nullable_to_non_nullable + as int, + listenAddress: null == listenAddress + ? _value.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + publicAddress: freezed == publicAddress + ? _value.publicAddress + : publicAddress // ignore: cast_nullable_to_non_nullable + as String?, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigUDPCopyWith<$Res> + implements $VeilidConfigUDPCopyWith<$Res> { + factory _$$_VeilidConfigUDPCopyWith( + _$_VeilidConfigUDP value, $Res Function(_$_VeilidConfigUDP) then) = + __$$_VeilidConfigUDPCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {bool enabled, + int socketPoolSize, + String listenAddress, + String? publicAddress}); +} + +/// @nodoc +class __$$_VeilidConfigUDPCopyWithImpl<$Res> + extends _$VeilidConfigUDPCopyWithImpl<$Res, _$_VeilidConfigUDP> + implements _$$_VeilidConfigUDPCopyWith<$Res> { + __$$_VeilidConfigUDPCopyWithImpl( + _$_VeilidConfigUDP _value, $Res Function(_$_VeilidConfigUDP) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? enabled = null, + Object? socketPoolSize = null, + Object? listenAddress = null, + Object? publicAddress = freezed, + }) { + return _then(_$_VeilidConfigUDP( + enabled: null == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + socketPoolSize: null == socketPoolSize + ? _value.socketPoolSize + : socketPoolSize // ignore: cast_nullable_to_non_nullable + as int, + listenAddress: null == listenAddress + ? _value.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + publicAddress: freezed == publicAddress + ? _value.publicAddress + : publicAddress // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigUDP + with DiagnosticableTreeMixin + implements _VeilidConfigUDP { + const _$_VeilidConfigUDP( + {required this.enabled, + required this.socketPoolSize, + required this.listenAddress, + this.publicAddress}); + + factory _$_VeilidConfigUDP.fromJson(Map json) => + _$$_VeilidConfigUDPFromJson(json); + + @override + final bool enabled; + @override + final int socketPoolSize; + @override + final String listenAddress; + @override + final String? publicAddress; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigUDP(enabled: $enabled, socketPoolSize: $socketPoolSize, listenAddress: $listenAddress, publicAddress: $publicAddress)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigUDP')) + ..add(DiagnosticsProperty('enabled', enabled)) + ..add(DiagnosticsProperty('socketPoolSize', socketPoolSize)) + ..add(DiagnosticsProperty('listenAddress', listenAddress)) + ..add(DiagnosticsProperty('publicAddress', publicAddress)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigUDP && + (identical(other.enabled, enabled) || other.enabled == enabled) && + (identical(other.socketPoolSize, socketPoolSize) || + other.socketPoolSize == socketPoolSize) && + (identical(other.listenAddress, listenAddress) || + other.listenAddress == listenAddress) && + (identical(other.publicAddress, publicAddress) || + other.publicAddress == publicAddress)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash( + runtimeType, enabled, socketPoolSize, listenAddress, publicAddress); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigUDPCopyWith<_$_VeilidConfigUDP> get copyWith => + __$$_VeilidConfigUDPCopyWithImpl<_$_VeilidConfigUDP>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigUDPToJson( + this, + ); + } +} + +abstract class _VeilidConfigUDP implements VeilidConfigUDP { + const factory _VeilidConfigUDP( + {required final bool enabled, + required final int socketPoolSize, + required final String listenAddress, + final String? publicAddress}) = _$_VeilidConfigUDP; + + factory _VeilidConfigUDP.fromJson(Map json) = + _$_VeilidConfigUDP.fromJson; + + @override + bool get enabled; + @override + int get socketPoolSize; + @override + String get listenAddress; + @override + String? get publicAddress; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigUDPCopyWith<_$_VeilidConfigUDP> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidConfigTCP _$VeilidConfigTCPFromJson(Map json) { + return _VeilidConfigTCP.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigTCP { + bool get connect => throw _privateConstructorUsedError; + bool get listen => throw _privateConstructorUsedError; + int get maxConnections => throw _privateConstructorUsedError; + String get listenAddress => throw _privateConstructorUsedError; + String? get publicAddress => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigTCPCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigTCPCopyWith<$Res> { + factory $VeilidConfigTCPCopyWith( + VeilidConfigTCP value, $Res Function(VeilidConfigTCP) then) = + _$VeilidConfigTCPCopyWithImpl<$Res, VeilidConfigTCP>; + @useResult + $Res call( + {bool connect, + bool listen, + int maxConnections, + String listenAddress, + String? publicAddress}); +} + +/// @nodoc +class _$VeilidConfigTCPCopyWithImpl<$Res, $Val extends VeilidConfigTCP> + implements $VeilidConfigTCPCopyWith<$Res> { + _$VeilidConfigTCPCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? connect = null, + Object? listen = null, + Object? maxConnections = null, + Object? listenAddress = null, + Object? publicAddress = freezed, + }) { + return _then(_value.copyWith( + connect: null == connect + ? _value.connect + : connect // ignore: cast_nullable_to_non_nullable + as bool, + listen: null == listen + ? _value.listen + : listen // ignore: cast_nullable_to_non_nullable + as bool, + maxConnections: null == maxConnections + ? _value.maxConnections + : maxConnections // ignore: cast_nullable_to_non_nullable + as int, + listenAddress: null == listenAddress + ? _value.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + publicAddress: freezed == publicAddress + ? _value.publicAddress + : publicAddress // ignore: cast_nullable_to_non_nullable + as String?, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigTCPCopyWith<$Res> + implements $VeilidConfigTCPCopyWith<$Res> { + factory _$$_VeilidConfigTCPCopyWith( + _$_VeilidConfigTCP value, $Res Function(_$_VeilidConfigTCP) then) = + __$$_VeilidConfigTCPCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {bool connect, + bool listen, + int maxConnections, + String listenAddress, + String? publicAddress}); +} + +/// @nodoc +class __$$_VeilidConfigTCPCopyWithImpl<$Res> + extends _$VeilidConfigTCPCopyWithImpl<$Res, _$_VeilidConfigTCP> + implements _$$_VeilidConfigTCPCopyWith<$Res> { + __$$_VeilidConfigTCPCopyWithImpl( + _$_VeilidConfigTCP _value, $Res Function(_$_VeilidConfigTCP) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? connect = null, + Object? listen = null, + Object? maxConnections = null, + Object? listenAddress = null, + Object? publicAddress = freezed, + }) { + return _then(_$_VeilidConfigTCP( + connect: null == connect + ? _value.connect + : connect // ignore: cast_nullable_to_non_nullable + as bool, + listen: null == listen + ? _value.listen + : listen // ignore: cast_nullable_to_non_nullable + as bool, + maxConnections: null == maxConnections + ? _value.maxConnections + : maxConnections // ignore: cast_nullable_to_non_nullable + as int, + listenAddress: null == listenAddress + ? _value.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + publicAddress: freezed == publicAddress + ? _value.publicAddress + : publicAddress // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigTCP + with DiagnosticableTreeMixin + implements _VeilidConfigTCP { + const _$_VeilidConfigTCP( + {required this.connect, + required this.listen, + required this.maxConnections, + required this.listenAddress, + this.publicAddress}); + + factory _$_VeilidConfigTCP.fromJson(Map json) => + _$$_VeilidConfigTCPFromJson(json); + + @override + final bool connect; + @override + final bool listen; + @override + final int maxConnections; + @override + final String listenAddress; + @override + final String? publicAddress; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigTCP(connect: $connect, listen: $listen, maxConnections: $maxConnections, listenAddress: $listenAddress, publicAddress: $publicAddress)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigTCP')) + ..add(DiagnosticsProperty('connect', connect)) + ..add(DiagnosticsProperty('listen', listen)) + ..add(DiagnosticsProperty('maxConnections', maxConnections)) + ..add(DiagnosticsProperty('listenAddress', listenAddress)) + ..add(DiagnosticsProperty('publicAddress', publicAddress)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigTCP && + (identical(other.connect, connect) || other.connect == connect) && + (identical(other.listen, listen) || other.listen == listen) && + (identical(other.maxConnections, maxConnections) || + other.maxConnections == maxConnections) && + (identical(other.listenAddress, listenAddress) || + other.listenAddress == listenAddress) && + (identical(other.publicAddress, publicAddress) || + other.publicAddress == publicAddress)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, connect, listen, maxConnections, + listenAddress, publicAddress); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigTCPCopyWith<_$_VeilidConfigTCP> get copyWith => + __$$_VeilidConfigTCPCopyWithImpl<_$_VeilidConfigTCP>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigTCPToJson( + this, + ); + } +} + +abstract class _VeilidConfigTCP implements VeilidConfigTCP { + const factory _VeilidConfigTCP( + {required final bool connect, + required final bool listen, + required final int maxConnections, + required final String listenAddress, + final String? publicAddress}) = _$_VeilidConfigTCP; + + factory _VeilidConfigTCP.fromJson(Map json) = + _$_VeilidConfigTCP.fromJson; + + @override + bool get connect; + @override + bool get listen; + @override + int get maxConnections; + @override + String get listenAddress; + @override + String? get publicAddress; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigTCPCopyWith<_$_VeilidConfigTCP> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidConfigWS _$VeilidConfigWSFromJson(Map json) { + return _VeilidConfigWS.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigWS { + bool get connect => throw _privateConstructorUsedError; + bool get listen => throw _privateConstructorUsedError; + int get maxConnections => throw _privateConstructorUsedError; + String get listenAddress => throw _privateConstructorUsedError; + String get path => throw _privateConstructorUsedError; + String? get url => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigWSCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigWSCopyWith<$Res> { + factory $VeilidConfigWSCopyWith( + VeilidConfigWS value, $Res Function(VeilidConfigWS) then) = + _$VeilidConfigWSCopyWithImpl<$Res, VeilidConfigWS>; + @useResult + $Res call( + {bool connect, + bool listen, + int maxConnections, + String listenAddress, + String path, + String? url}); +} + +/// @nodoc +class _$VeilidConfigWSCopyWithImpl<$Res, $Val extends VeilidConfigWS> + implements $VeilidConfigWSCopyWith<$Res> { + _$VeilidConfigWSCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? connect = null, + Object? listen = null, + Object? maxConnections = null, + Object? listenAddress = null, + Object? path = null, + Object? url = freezed, + }) { + return _then(_value.copyWith( + connect: null == connect + ? _value.connect + : connect // ignore: cast_nullable_to_non_nullable + as bool, + listen: null == listen + ? _value.listen + : listen // ignore: cast_nullable_to_non_nullable + as bool, + maxConnections: null == maxConnections + ? _value.maxConnections + : maxConnections // ignore: cast_nullable_to_non_nullable + as int, + listenAddress: null == listenAddress + ? _value.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + path: null == path + ? _value.path + : path // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigWSCopyWith<$Res> + implements $VeilidConfigWSCopyWith<$Res> { + factory _$$_VeilidConfigWSCopyWith( + _$_VeilidConfigWS value, $Res Function(_$_VeilidConfigWS) then) = + __$$_VeilidConfigWSCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {bool connect, + bool listen, + int maxConnections, + String listenAddress, + String path, + String? url}); +} + +/// @nodoc +class __$$_VeilidConfigWSCopyWithImpl<$Res> + extends _$VeilidConfigWSCopyWithImpl<$Res, _$_VeilidConfigWS> + implements _$$_VeilidConfigWSCopyWith<$Res> { + __$$_VeilidConfigWSCopyWithImpl( + _$_VeilidConfigWS _value, $Res Function(_$_VeilidConfigWS) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? connect = null, + Object? listen = null, + Object? maxConnections = null, + Object? listenAddress = null, + Object? path = null, + Object? url = freezed, + }) { + return _then(_$_VeilidConfigWS( + connect: null == connect + ? _value.connect + : connect // ignore: cast_nullable_to_non_nullable + as bool, + listen: null == listen + ? _value.listen + : listen // ignore: cast_nullable_to_non_nullable + as bool, + maxConnections: null == maxConnections + ? _value.maxConnections + : maxConnections // ignore: cast_nullable_to_non_nullable + as int, + listenAddress: null == listenAddress + ? _value.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + path: null == path + ? _value.path + : path // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigWS + with DiagnosticableTreeMixin + implements _VeilidConfigWS { + const _$_VeilidConfigWS( + {required this.connect, + required this.listen, + required this.maxConnections, + required this.listenAddress, + required this.path, + this.url}); + + factory _$_VeilidConfigWS.fromJson(Map json) => + _$$_VeilidConfigWSFromJson(json); + + @override + final bool connect; + @override + final bool listen; + @override + final int maxConnections; + @override + final String listenAddress; + @override + final String path; + @override + final String? url; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigWS(connect: $connect, listen: $listen, maxConnections: $maxConnections, listenAddress: $listenAddress, path: $path, url: $url)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigWS')) + ..add(DiagnosticsProperty('connect', connect)) + ..add(DiagnosticsProperty('listen', listen)) + ..add(DiagnosticsProperty('maxConnections', maxConnections)) + ..add(DiagnosticsProperty('listenAddress', listenAddress)) + ..add(DiagnosticsProperty('path', path)) + ..add(DiagnosticsProperty('url', url)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigWS && + (identical(other.connect, connect) || other.connect == connect) && + (identical(other.listen, listen) || other.listen == listen) && + (identical(other.maxConnections, maxConnections) || + other.maxConnections == maxConnections) && + (identical(other.listenAddress, listenAddress) || + other.listenAddress == listenAddress) && + (identical(other.path, path) || other.path == path) && + (identical(other.url, url) || other.url == url)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash( + runtimeType, connect, listen, maxConnections, listenAddress, path, url); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigWSCopyWith<_$_VeilidConfigWS> get copyWith => + __$$_VeilidConfigWSCopyWithImpl<_$_VeilidConfigWS>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigWSToJson( + this, + ); + } +} + +abstract class _VeilidConfigWS implements VeilidConfigWS { + const factory _VeilidConfigWS( + {required final bool connect, + required final bool listen, + required final int maxConnections, + required final String listenAddress, + required final String path, + final String? url}) = _$_VeilidConfigWS; + + factory _VeilidConfigWS.fromJson(Map json) = + _$_VeilidConfigWS.fromJson; + + @override + bool get connect; + @override + bool get listen; + @override + int get maxConnections; + @override + String get listenAddress; + @override + String get path; + @override + String? get url; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigWSCopyWith<_$_VeilidConfigWS> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidConfigWSS _$VeilidConfigWSSFromJson(Map json) { + return _VeilidConfigWSS.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigWSS { + bool get connect => throw _privateConstructorUsedError; + bool get listen => throw _privateConstructorUsedError; + int get maxConnections => throw _privateConstructorUsedError; + String get listenAddress => throw _privateConstructorUsedError; + String get path => throw _privateConstructorUsedError; + String? get url => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigWSSCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigWSSCopyWith<$Res> { + factory $VeilidConfigWSSCopyWith( + VeilidConfigWSS value, $Res Function(VeilidConfigWSS) then) = + _$VeilidConfigWSSCopyWithImpl<$Res, VeilidConfigWSS>; + @useResult + $Res call( + {bool connect, + bool listen, + int maxConnections, + String listenAddress, + String path, + String? url}); +} + +/// @nodoc +class _$VeilidConfigWSSCopyWithImpl<$Res, $Val extends VeilidConfigWSS> + implements $VeilidConfigWSSCopyWith<$Res> { + _$VeilidConfigWSSCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? connect = null, + Object? listen = null, + Object? maxConnections = null, + Object? listenAddress = null, + Object? path = null, + Object? url = freezed, + }) { + return _then(_value.copyWith( + connect: null == connect + ? _value.connect + : connect // ignore: cast_nullable_to_non_nullable + as bool, + listen: null == listen + ? _value.listen + : listen // ignore: cast_nullable_to_non_nullable + as bool, + maxConnections: null == maxConnections + ? _value.maxConnections + : maxConnections // ignore: cast_nullable_to_non_nullable + as int, + listenAddress: null == listenAddress + ? _value.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + path: null == path + ? _value.path + : path // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigWSSCopyWith<$Res> + implements $VeilidConfigWSSCopyWith<$Res> { + factory _$$_VeilidConfigWSSCopyWith( + _$_VeilidConfigWSS value, $Res Function(_$_VeilidConfigWSS) then) = + __$$_VeilidConfigWSSCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {bool connect, + bool listen, + int maxConnections, + String listenAddress, + String path, + String? url}); +} + +/// @nodoc +class __$$_VeilidConfigWSSCopyWithImpl<$Res> + extends _$VeilidConfigWSSCopyWithImpl<$Res, _$_VeilidConfigWSS> + implements _$$_VeilidConfigWSSCopyWith<$Res> { + __$$_VeilidConfigWSSCopyWithImpl( + _$_VeilidConfigWSS _value, $Res Function(_$_VeilidConfigWSS) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? connect = null, + Object? listen = null, + Object? maxConnections = null, + Object? listenAddress = null, + Object? path = null, + Object? url = freezed, + }) { + return _then(_$_VeilidConfigWSS( + connect: null == connect + ? _value.connect + : connect // ignore: cast_nullable_to_non_nullable + as bool, + listen: null == listen + ? _value.listen + : listen // ignore: cast_nullable_to_non_nullable + as bool, + maxConnections: null == maxConnections + ? _value.maxConnections + : maxConnections // ignore: cast_nullable_to_non_nullable + as int, + listenAddress: null == listenAddress + ? _value.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + path: null == path + ? _value.path + : path // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigWSS + with DiagnosticableTreeMixin + implements _VeilidConfigWSS { + const _$_VeilidConfigWSS( + {required this.connect, + required this.listen, + required this.maxConnections, + required this.listenAddress, + required this.path, + this.url}); + + factory _$_VeilidConfigWSS.fromJson(Map json) => + _$$_VeilidConfigWSSFromJson(json); + + @override + final bool connect; + @override + final bool listen; + @override + final int maxConnections; + @override + final String listenAddress; + @override + final String path; + @override + final String? url; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigWSS(connect: $connect, listen: $listen, maxConnections: $maxConnections, listenAddress: $listenAddress, path: $path, url: $url)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigWSS')) + ..add(DiagnosticsProperty('connect', connect)) + ..add(DiagnosticsProperty('listen', listen)) + ..add(DiagnosticsProperty('maxConnections', maxConnections)) + ..add(DiagnosticsProperty('listenAddress', listenAddress)) + ..add(DiagnosticsProperty('path', path)) + ..add(DiagnosticsProperty('url', url)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigWSS && + (identical(other.connect, connect) || other.connect == connect) && + (identical(other.listen, listen) || other.listen == listen) && + (identical(other.maxConnections, maxConnections) || + other.maxConnections == maxConnections) && + (identical(other.listenAddress, listenAddress) || + other.listenAddress == listenAddress) && + (identical(other.path, path) || other.path == path) && + (identical(other.url, url) || other.url == url)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash( + runtimeType, connect, listen, maxConnections, listenAddress, path, url); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigWSSCopyWith<_$_VeilidConfigWSS> get copyWith => + __$$_VeilidConfigWSSCopyWithImpl<_$_VeilidConfigWSS>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigWSSToJson( + this, + ); + } +} + +abstract class _VeilidConfigWSS implements VeilidConfigWSS { + const factory _VeilidConfigWSS( + {required final bool connect, + required final bool listen, + required final int maxConnections, + required final String listenAddress, + required final String path, + final String? url}) = _$_VeilidConfigWSS; + + factory _VeilidConfigWSS.fromJson(Map json) = + _$_VeilidConfigWSS.fromJson; + + @override + bool get connect; + @override + bool get listen; + @override + int get maxConnections; + @override + String get listenAddress; + @override + String get path; + @override + String? get url; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigWSSCopyWith<_$_VeilidConfigWSS> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidConfigProtocol _$VeilidConfigProtocolFromJson(Map json) { + return _VeilidConfigProtocol.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigProtocol { + VeilidConfigUDP get udp => throw _privateConstructorUsedError; + VeilidConfigTCP get tcp => throw _privateConstructorUsedError; + VeilidConfigWS get ws => throw _privateConstructorUsedError; + VeilidConfigWSS get wss => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigProtocolCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigProtocolCopyWith<$Res> { + factory $VeilidConfigProtocolCopyWith(VeilidConfigProtocol value, + $Res Function(VeilidConfigProtocol) then) = + _$VeilidConfigProtocolCopyWithImpl<$Res, VeilidConfigProtocol>; + @useResult + $Res call( + {VeilidConfigUDP udp, + VeilidConfigTCP tcp, + VeilidConfigWS ws, + VeilidConfigWSS wss}); + + $VeilidConfigUDPCopyWith<$Res> get udp; + $VeilidConfigTCPCopyWith<$Res> get tcp; + $VeilidConfigWSCopyWith<$Res> get ws; + $VeilidConfigWSSCopyWith<$Res> get wss; +} + +/// @nodoc +class _$VeilidConfigProtocolCopyWithImpl<$Res, + $Val extends VeilidConfigProtocol> + implements $VeilidConfigProtocolCopyWith<$Res> { + _$VeilidConfigProtocolCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? udp = null, + Object? tcp = null, + Object? ws = null, + Object? wss = null, + }) { + return _then(_value.copyWith( + udp: null == udp + ? _value.udp + : udp // ignore: cast_nullable_to_non_nullable + as VeilidConfigUDP, + tcp: null == tcp + ? _value.tcp + : tcp // ignore: cast_nullable_to_non_nullable + as VeilidConfigTCP, + ws: null == ws + ? _value.ws + : ws // ignore: cast_nullable_to_non_nullable + as VeilidConfigWS, + wss: null == wss + ? _value.wss + : wss // ignore: cast_nullable_to_non_nullable + as VeilidConfigWSS, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigUDPCopyWith<$Res> get udp { + return $VeilidConfigUDPCopyWith<$Res>(_value.udp, (value) { + return _then(_value.copyWith(udp: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigTCPCopyWith<$Res> get tcp { + return $VeilidConfigTCPCopyWith<$Res>(_value.tcp, (value) { + return _then(_value.copyWith(tcp: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigWSCopyWith<$Res> get ws { + return $VeilidConfigWSCopyWith<$Res>(_value.ws, (value) { + return _then(_value.copyWith(ws: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigWSSCopyWith<$Res> get wss { + return $VeilidConfigWSSCopyWith<$Res>(_value.wss, (value) { + return _then(_value.copyWith(wss: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigProtocolCopyWith<$Res> + implements $VeilidConfigProtocolCopyWith<$Res> { + factory _$$_VeilidConfigProtocolCopyWith(_$_VeilidConfigProtocol value, + $Res Function(_$_VeilidConfigProtocol) then) = + __$$_VeilidConfigProtocolCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {VeilidConfigUDP udp, + VeilidConfigTCP tcp, + VeilidConfigWS ws, + VeilidConfigWSS wss}); + + @override + $VeilidConfigUDPCopyWith<$Res> get udp; + @override + $VeilidConfigTCPCopyWith<$Res> get tcp; + @override + $VeilidConfigWSCopyWith<$Res> get ws; + @override + $VeilidConfigWSSCopyWith<$Res> get wss; +} + +/// @nodoc +class __$$_VeilidConfigProtocolCopyWithImpl<$Res> + extends _$VeilidConfigProtocolCopyWithImpl<$Res, _$_VeilidConfigProtocol> + implements _$$_VeilidConfigProtocolCopyWith<$Res> { + __$$_VeilidConfigProtocolCopyWithImpl(_$_VeilidConfigProtocol _value, + $Res Function(_$_VeilidConfigProtocol) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? udp = null, + Object? tcp = null, + Object? ws = null, + Object? wss = null, + }) { + return _then(_$_VeilidConfigProtocol( + udp: null == udp + ? _value.udp + : udp // ignore: cast_nullable_to_non_nullable + as VeilidConfigUDP, + tcp: null == tcp + ? _value.tcp + : tcp // ignore: cast_nullable_to_non_nullable + as VeilidConfigTCP, + ws: null == ws + ? _value.ws + : ws // ignore: cast_nullable_to_non_nullable + as VeilidConfigWS, + wss: null == wss + ? _value.wss + : wss // ignore: cast_nullable_to_non_nullable + as VeilidConfigWSS, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigProtocol + with DiagnosticableTreeMixin + implements _VeilidConfigProtocol { + const _$_VeilidConfigProtocol( + {required this.udp, + required this.tcp, + required this.ws, + required this.wss}); + + factory _$_VeilidConfigProtocol.fromJson(Map json) => + _$$_VeilidConfigProtocolFromJson(json); + + @override + final VeilidConfigUDP udp; + @override + final VeilidConfigTCP tcp; + @override + final VeilidConfigWS ws; + @override + final VeilidConfigWSS wss; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigProtocol(udp: $udp, tcp: $tcp, ws: $ws, wss: $wss)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigProtocol')) + ..add(DiagnosticsProperty('udp', udp)) + ..add(DiagnosticsProperty('tcp', tcp)) + ..add(DiagnosticsProperty('ws', ws)) + ..add(DiagnosticsProperty('wss', wss)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigProtocol && + (identical(other.udp, udp) || other.udp == udp) && + (identical(other.tcp, tcp) || other.tcp == tcp) && + (identical(other.ws, ws) || other.ws == ws) && + (identical(other.wss, wss) || other.wss == wss)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, udp, tcp, ws, wss); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigProtocolCopyWith<_$_VeilidConfigProtocol> get copyWith => + __$$_VeilidConfigProtocolCopyWithImpl<_$_VeilidConfigProtocol>( + this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigProtocolToJson( + this, + ); + } +} + +abstract class _VeilidConfigProtocol implements VeilidConfigProtocol { + const factory _VeilidConfigProtocol( + {required final VeilidConfigUDP udp, + required final VeilidConfigTCP tcp, + required final VeilidConfigWS ws, + required final VeilidConfigWSS wss}) = _$_VeilidConfigProtocol; + + factory _VeilidConfigProtocol.fromJson(Map json) = + _$_VeilidConfigProtocol.fromJson; + + @override + VeilidConfigUDP get udp; + @override + VeilidConfigTCP get tcp; + @override + VeilidConfigWS get ws; + @override + VeilidConfigWSS get wss; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigProtocolCopyWith<_$_VeilidConfigProtocol> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidConfigTLS _$VeilidConfigTLSFromJson(Map json) { + return _VeilidConfigTLS.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigTLS { + String get certificatePath => throw _privateConstructorUsedError; + String get privateKeyPath => throw _privateConstructorUsedError; + int get connectionInitialTimeoutMs => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigTLSCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigTLSCopyWith<$Res> { + factory $VeilidConfigTLSCopyWith( + VeilidConfigTLS value, $Res Function(VeilidConfigTLS) then) = + _$VeilidConfigTLSCopyWithImpl<$Res, VeilidConfigTLS>; + @useResult + $Res call( + {String certificatePath, + String privateKeyPath, + int connectionInitialTimeoutMs}); +} + +/// @nodoc +class _$VeilidConfigTLSCopyWithImpl<$Res, $Val extends VeilidConfigTLS> + implements $VeilidConfigTLSCopyWith<$Res> { + _$VeilidConfigTLSCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? certificatePath = null, + Object? privateKeyPath = null, + Object? connectionInitialTimeoutMs = null, + }) { + return _then(_value.copyWith( + certificatePath: null == certificatePath + ? _value.certificatePath + : certificatePath // ignore: cast_nullable_to_non_nullable + as String, + privateKeyPath: null == privateKeyPath + ? _value.privateKeyPath + : privateKeyPath // ignore: cast_nullable_to_non_nullable + as String, + connectionInitialTimeoutMs: null == connectionInitialTimeoutMs + ? _value.connectionInitialTimeoutMs + : connectionInitialTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigTLSCopyWith<$Res> + implements $VeilidConfigTLSCopyWith<$Res> { + factory _$$_VeilidConfigTLSCopyWith( + _$_VeilidConfigTLS value, $Res Function(_$_VeilidConfigTLS) then) = + __$$_VeilidConfigTLSCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {String certificatePath, + String privateKeyPath, + int connectionInitialTimeoutMs}); +} + +/// @nodoc +class __$$_VeilidConfigTLSCopyWithImpl<$Res> + extends _$VeilidConfigTLSCopyWithImpl<$Res, _$_VeilidConfigTLS> + implements _$$_VeilidConfigTLSCopyWith<$Res> { + __$$_VeilidConfigTLSCopyWithImpl( + _$_VeilidConfigTLS _value, $Res Function(_$_VeilidConfigTLS) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? certificatePath = null, + Object? privateKeyPath = null, + Object? connectionInitialTimeoutMs = null, + }) { + return _then(_$_VeilidConfigTLS( + certificatePath: null == certificatePath + ? _value.certificatePath + : certificatePath // ignore: cast_nullable_to_non_nullable + as String, + privateKeyPath: null == privateKeyPath + ? _value.privateKeyPath + : privateKeyPath // ignore: cast_nullable_to_non_nullable + as String, + connectionInitialTimeoutMs: null == connectionInitialTimeoutMs + ? _value.connectionInitialTimeoutMs + : connectionInitialTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigTLS + with DiagnosticableTreeMixin + implements _VeilidConfigTLS { + const _$_VeilidConfigTLS( + {required this.certificatePath, + required this.privateKeyPath, + required this.connectionInitialTimeoutMs}); + + factory _$_VeilidConfigTLS.fromJson(Map json) => + _$$_VeilidConfigTLSFromJson(json); + + @override + final String certificatePath; + @override + final String privateKeyPath; + @override + final int connectionInitialTimeoutMs; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigTLS(certificatePath: $certificatePath, privateKeyPath: $privateKeyPath, connectionInitialTimeoutMs: $connectionInitialTimeoutMs)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigTLS')) + ..add(DiagnosticsProperty('certificatePath', certificatePath)) + ..add(DiagnosticsProperty('privateKeyPath', privateKeyPath)) + ..add(DiagnosticsProperty( + 'connectionInitialTimeoutMs', connectionInitialTimeoutMs)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigTLS && + (identical(other.certificatePath, certificatePath) || + other.certificatePath == certificatePath) && + (identical(other.privateKeyPath, privateKeyPath) || + other.privateKeyPath == privateKeyPath) && + (identical(other.connectionInitialTimeoutMs, + connectionInitialTimeoutMs) || + other.connectionInitialTimeoutMs == + connectionInitialTimeoutMs)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash( + runtimeType, certificatePath, privateKeyPath, connectionInitialTimeoutMs); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigTLSCopyWith<_$_VeilidConfigTLS> get copyWith => + __$$_VeilidConfigTLSCopyWithImpl<_$_VeilidConfigTLS>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigTLSToJson( + this, + ); + } +} + +abstract class _VeilidConfigTLS implements VeilidConfigTLS { + const factory _VeilidConfigTLS( + {required final String certificatePath, + required final String privateKeyPath, + required final int connectionInitialTimeoutMs}) = _$_VeilidConfigTLS; + + factory _VeilidConfigTLS.fromJson(Map json) = + _$_VeilidConfigTLS.fromJson; + + @override + String get certificatePath; + @override + String get privateKeyPath; + @override + int get connectionInitialTimeoutMs; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigTLSCopyWith<_$_VeilidConfigTLS> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidConfigDHT _$VeilidConfigDHTFromJson(Map json) { + return _VeilidConfigDHT.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigDHT { + int get resolveNodeTimeoutMs => throw _privateConstructorUsedError; + int get resolveNodeCount => throw _privateConstructorUsedError; + int get resolveNodeFanout => throw _privateConstructorUsedError; + int get maxFindNodeCount => throw _privateConstructorUsedError; + int get getValueTimeoutMs => throw _privateConstructorUsedError; + int get getValueCount => throw _privateConstructorUsedError; + int get getValueFanout => throw _privateConstructorUsedError; + int get setValueTimeoutMs => throw _privateConstructorUsedError; + int get setValueCount => throw _privateConstructorUsedError; + int get setValueFanout => throw _privateConstructorUsedError; + int get minPeerCount => throw _privateConstructorUsedError; + int get minPeerRefreshTimeMs => throw _privateConstructorUsedError; + int get validateDialInfoReceiptTimeMs => throw _privateConstructorUsedError; + int get localSubkeyCacheSize => throw _privateConstructorUsedError; + int get localMaxSubkeyCacheMemoryMb => throw _privateConstructorUsedError; + int get remoteSubkeyCacheSize => throw _privateConstructorUsedError; + int get remoteMaxRecords => throw _privateConstructorUsedError; + int get remoteMaxSubkeyCacheMemoryMb => throw _privateConstructorUsedError; + int get remoteMaxStorageSpaceMb => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigDHTCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigDHTCopyWith<$Res> { + factory $VeilidConfigDHTCopyWith( + VeilidConfigDHT value, $Res Function(VeilidConfigDHT) then) = + _$VeilidConfigDHTCopyWithImpl<$Res, VeilidConfigDHT>; + @useResult + $Res call( + {int resolveNodeTimeoutMs, + int resolveNodeCount, + int resolveNodeFanout, + int maxFindNodeCount, + int getValueTimeoutMs, + int getValueCount, + int getValueFanout, + int setValueTimeoutMs, + int setValueCount, + int setValueFanout, + int minPeerCount, + int minPeerRefreshTimeMs, + int validateDialInfoReceiptTimeMs, + int localSubkeyCacheSize, + int localMaxSubkeyCacheMemoryMb, + int remoteSubkeyCacheSize, + int remoteMaxRecords, + int remoteMaxSubkeyCacheMemoryMb, + int remoteMaxStorageSpaceMb}); +} + +/// @nodoc +class _$VeilidConfigDHTCopyWithImpl<$Res, $Val extends VeilidConfigDHT> + implements $VeilidConfigDHTCopyWith<$Res> { + _$VeilidConfigDHTCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? resolveNodeTimeoutMs = null, + Object? resolveNodeCount = null, + Object? resolveNodeFanout = null, + Object? maxFindNodeCount = null, + Object? getValueTimeoutMs = null, + Object? getValueCount = null, + Object? getValueFanout = null, + Object? setValueTimeoutMs = null, + Object? setValueCount = null, + Object? setValueFanout = null, + Object? minPeerCount = null, + Object? minPeerRefreshTimeMs = null, + Object? validateDialInfoReceiptTimeMs = null, + Object? localSubkeyCacheSize = null, + Object? localMaxSubkeyCacheMemoryMb = null, + Object? remoteSubkeyCacheSize = null, + Object? remoteMaxRecords = null, + Object? remoteMaxSubkeyCacheMemoryMb = null, + Object? remoteMaxStorageSpaceMb = null, + }) { + return _then(_value.copyWith( + resolveNodeTimeoutMs: null == resolveNodeTimeoutMs + ? _value.resolveNodeTimeoutMs + : resolveNodeTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + resolveNodeCount: null == resolveNodeCount + ? _value.resolveNodeCount + : resolveNodeCount // ignore: cast_nullable_to_non_nullable + as int, + resolveNodeFanout: null == resolveNodeFanout + ? _value.resolveNodeFanout + : resolveNodeFanout // ignore: cast_nullable_to_non_nullable + as int, + maxFindNodeCount: null == maxFindNodeCount + ? _value.maxFindNodeCount + : maxFindNodeCount // ignore: cast_nullable_to_non_nullable + as int, + getValueTimeoutMs: null == getValueTimeoutMs + ? _value.getValueTimeoutMs + : getValueTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + getValueCount: null == getValueCount + ? _value.getValueCount + : getValueCount // ignore: cast_nullable_to_non_nullable + as int, + getValueFanout: null == getValueFanout + ? _value.getValueFanout + : getValueFanout // ignore: cast_nullable_to_non_nullable + as int, + setValueTimeoutMs: null == setValueTimeoutMs + ? _value.setValueTimeoutMs + : setValueTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + setValueCount: null == setValueCount + ? _value.setValueCount + : setValueCount // ignore: cast_nullable_to_non_nullable + as int, + setValueFanout: null == setValueFanout + ? _value.setValueFanout + : setValueFanout // ignore: cast_nullable_to_non_nullable + as int, + minPeerCount: null == minPeerCount + ? _value.minPeerCount + : minPeerCount // ignore: cast_nullable_to_non_nullable + as int, + minPeerRefreshTimeMs: null == minPeerRefreshTimeMs + ? _value.minPeerRefreshTimeMs + : minPeerRefreshTimeMs // ignore: cast_nullable_to_non_nullable + as int, + validateDialInfoReceiptTimeMs: null == validateDialInfoReceiptTimeMs + ? _value.validateDialInfoReceiptTimeMs + : validateDialInfoReceiptTimeMs // ignore: cast_nullable_to_non_nullable + as int, + localSubkeyCacheSize: null == localSubkeyCacheSize + ? _value.localSubkeyCacheSize + : localSubkeyCacheSize // ignore: cast_nullable_to_non_nullable + as int, + localMaxSubkeyCacheMemoryMb: null == localMaxSubkeyCacheMemoryMb + ? _value.localMaxSubkeyCacheMemoryMb + : localMaxSubkeyCacheMemoryMb // ignore: cast_nullable_to_non_nullable + as int, + remoteSubkeyCacheSize: null == remoteSubkeyCacheSize + ? _value.remoteSubkeyCacheSize + : remoteSubkeyCacheSize // ignore: cast_nullable_to_non_nullable + as int, + remoteMaxRecords: null == remoteMaxRecords + ? _value.remoteMaxRecords + : remoteMaxRecords // ignore: cast_nullable_to_non_nullable + as int, + remoteMaxSubkeyCacheMemoryMb: null == remoteMaxSubkeyCacheMemoryMb + ? _value.remoteMaxSubkeyCacheMemoryMb + : remoteMaxSubkeyCacheMemoryMb // ignore: cast_nullable_to_non_nullable + as int, + remoteMaxStorageSpaceMb: null == remoteMaxStorageSpaceMb + ? _value.remoteMaxStorageSpaceMb + : remoteMaxStorageSpaceMb // ignore: cast_nullable_to_non_nullable + as int, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigDHTCopyWith<$Res> + implements $VeilidConfigDHTCopyWith<$Res> { + factory _$$_VeilidConfigDHTCopyWith( + _$_VeilidConfigDHT value, $Res Function(_$_VeilidConfigDHT) then) = + __$$_VeilidConfigDHTCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {int resolveNodeTimeoutMs, + int resolveNodeCount, + int resolveNodeFanout, + int maxFindNodeCount, + int getValueTimeoutMs, + int getValueCount, + int getValueFanout, + int setValueTimeoutMs, + int setValueCount, + int setValueFanout, + int minPeerCount, + int minPeerRefreshTimeMs, + int validateDialInfoReceiptTimeMs, + int localSubkeyCacheSize, + int localMaxSubkeyCacheMemoryMb, + int remoteSubkeyCacheSize, + int remoteMaxRecords, + int remoteMaxSubkeyCacheMemoryMb, + int remoteMaxStorageSpaceMb}); +} + +/// @nodoc +class __$$_VeilidConfigDHTCopyWithImpl<$Res> + extends _$VeilidConfigDHTCopyWithImpl<$Res, _$_VeilidConfigDHT> + implements _$$_VeilidConfigDHTCopyWith<$Res> { + __$$_VeilidConfigDHTCopyWithImpl( + _$_VeilidConfigDHT _value, $Res Function(_$_VeilidConfigDHT) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? resolveNodeTimeoutMs = null, + Object? resolveNodeCount = null, + Object? resolveNodeFanout = null, + Object? maxFindNodeCount = null, + Object? getValueTimeoutMs = null, + Object? getValueCount = null, + Object? getValueFanout = null, + Object? setValueTimeoutMs = null, + Object? setValueCount = null, + Object? setValueFanout = null, + Object? minPeerCount = null, + Object? minPeerRefreshTimeMs = null, + Object? validateDialInfoReceiptTimeMs = null, + Object? localSubkeyCacheSize = null, + Object? localMaxSubkeyCacheMemoryMb = null, + Object? remoteSubkeyCacheSize = null, + Object? remoteMaxRecords = null, + Object? remoteMaxSubkeyCacheMemoryMb = null, + Object? remoteMaxStorageSpaceMb = null, + }) { + return _then(_$_VeilidConfigDHT( + resolveNodeTimeoutMs: null == resolveNodeTimeoutMs + ? _value.resolveNodeTimeoutMs + : resolveNodeTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + resolveNodeCount: null == resolveNodeCount + ? _value.resolveNodeCount + : resolveNodeCount // ignore: cast_nullable_to_non_nullable + as int, + resolveNodeFanout: null == resolveNodeFanout + ? _value.resolveNodeFanout + : resolveNodeFanout // ignore: cast_nullable_to_non_nullable + as int, + maxFindNodeCount: null == maxFindNodeCount + ? _value.maxFindNodeCount + : maxFindNodeCount // ignore: cast_nullable_to_non_nullable + as int, + getValueTimeoutMs: null == getValueTimeoutMs + ? _value.getValueTimeoutMs + : getValueTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + getValueCount: null == getValueCount + ? _value.getValueCount + : getValueCount // ignore: cast_nullable_to_non_nullable + as int, + getValueFanout: null == getValueFanout + ? _value.getValueFanout + : getValueFanout // ignore: cast_nullable_to_non_nullable + as int, + setValueTimeoutMs: null == setValueTimeoutMs + ? _value.setValueTimeoutMs + : setValueTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + setValueCount: null == setValueCount + ? _value.setValueCount + : setValueCount // ignore: cast_nullable_to_non_nullable + as int, + setValueFanout: null == setValueFanout + ? _value.setValueFanout + : setValueFanout // ignore: cast_nullable_to_non_nullable + as int, + minPeerCount: null == minPeerCount + ? _value.minPeerCount + : minPeerCount // ignore: cast_nullable_to_non_nullable + as int, + minPeerRefreshTimeMs: null == minPeerRefreshTimeMs + ? _value.minPeerRefreshTimeMs + : minPeerRefreshTimeMs // ignore: cast_nullable_to_non_nullable + as int, + validateDialInfoReceiptTimeMs: null == validateDialInfoReceiptTimeMs + ? _value.validateDialInfoReceiptTimeMs + : validateDialInfoReceiptTimeMs // ignore: cast_nullable_to_non_nullable + as int, + localSubkeyCacheSize: null == localSubkeyCacheSize + ? _value.localSubkeyCacheSize + : localSubkeyCacheSize // ignore: cast_nullable_to_non_nullable + as int, + localMaxSubkeyCacheMemoryMb: null == localMaxSubkeyCacheMemoryMb + ? _value.localMaxSubkeyCacheMemoryMb + : localMaxSubkeyCacheMemoryMb // ignore: cast_nullable_to_non_nullable + as int, + remoteSubkeyCacheSize: null == remoteSubkeyCacheSize + ? _value.remoteSubkeyCacheSize + : remoteSubkeyCacheSize // ignore: cast_nullable_to_non_nullable + as int, + remoteMaxRecords: null == remoteMaxRecords + ? _value.remoteMaxRecords + : remoteMaxRecords // ignore: cast_nullable_to_non_nullable + as int, + remoteMaxSubkeyCacheMemoryMb: null == remoteMaxSubkeyCacheMemoryMb + ? _value.remoteMaxSubkeyCacheMemoryMb + : remoteMaxSubkeyCacheMemoryMb // ignore: cast_nullable_to_non_nullable + as int, + remoteMaxStorageSpaceMb: null == remoteMaxStorageSpaceMb + ? _value.remoteMaxStorageSpaceMb + : remoteMaxStorageSpaceMb // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigDHT + with DiagnosticableTreeMixin + implements _VeilidConfigDHT { + const _$_VeilidConfigDHT( + {required this.resolveNodeTimeoutMs, + required this.resolveNodeCount, + required this.resolveNodeFanout, + required this.maxFindNodeCount, + required this.getValueTimeoutMs, + required this.getValueCount, + required this.getValueFanout, + required this.setValueTimeoutMs, + required this.setValueCount, + required this.setValueFanout, + required this.minPeerCount, + required this.minPeerRefreshTimeMs, + required this.validateDialInfoReceiptTimeMs, + required this.localSubkeyCacheSize, + required this.localMaxSubkeyCacheMemoryMb, + required this.remoteSubkeyCacheSize, + required this.remoteMaxRecords, + required this.remoteMaxSubkeyCacheMemoryMb, + required this.remoteMaxStorageSpaceMb}); + + factory _$_VeilidConfigDHT.fromJson(Map json) => + _$$_VeilidConfigDHTFromJson(json); + + @override + final int resolveNodeTimeoutMs; + @override + final int resolveNodeCount; + @override + final int resolveNodeFanout; + @override + final int maxFindNodeCount; + @override + final int getValueTimeoutMs; + @override + final int getValueCount; + @override + final int getValueFanout; + @override + final int setValueTimeoutMs; + @override + final int setValueCount; + @override + final int setValueFanout; + @override + final int minPeerCount; + @override + final int minPeerRefreshTimeMs; + @override + final int validateDialInfoReceiptTimeMs; + @override + final int localSubkeyCacheSize; + @override + final int localMaxSubkeyCacheMemoryMb; + @override + final int remoteSubkeyCacheSize; + @override + final int remoteMaxRecords; + @override + final int remoteMaxSubkeyCacheMemoryMb; + @override + final int remoteMaxStorageSpaceMb; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigDHT(resolveNodeTimeoutMs: $resolveNodeTimeoutMs, resolveNodeCount: $resolveNodeCount, resolveNodeFanout: $resolveNodeFanout, maxFindNodeCount: $maxFindNodeCount, getValueTimeoutMs: $getValueTimeoutMs, getValueCount: $getValueCount, getValueFanout: $getValueFanout, setValueTimeoutMs: $setValueTimeoutMs, setValueCount: $setValueCount, setValueFanout: $setValueFanout, minPeerCount: $minPeerCount, minPeerRefreshTimeMs: $minPeerRefreshTimeMs, validateDialInfoReceiptTimeMs: $validateDialInfoReceiptTimeMs, localSubkeyCacheSize: $localSubkeyCacheSize, localMaxSubkeyCacheMemoryMb: $localMaxSubkeyCacheMemoryMb, remoteSubkeyCacheSize: $remoteSubkeyCacheSize, remoteMaxRecords: $remoteMaxRecords, remoteMaxSubkeyCacheMemoryMb: $remoteMaxSubkeyCacheMemoryMb, remoteMaxStorageSpaceMb: $remoteMaxStorageSpaceMb)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigDHT')) + ..add(DiagnosticsProperty('resolveNodeTimeoutMs', resolveNodeTimeoutMs)) + ..add(DiagnosticsProperty('resolveNodeCount', resolveNodeCount)) + ..add(DiagnosticsProperty('resolveNodeFanout', resolveNodeFanout)) + ..add(DiagnosticsProperty('maxFindNodeCount', maxFindNodeCount)) + ..add(DiagnosticsProperty('getValueTimeoutMs', getValueTimeoutMs)) + ..add(DiagnosticsProperty('getValueCount', getValueCount)) + ..add(DiagnosticsProperty('getValueFanout', getValueFanout)) + ..add(DiagnosticsProperty('setValueTimeoutMs', setValueTimeoutMs)) + ..add(DiagnosticsProperty('setValueCount', setValueCount)) + ..add(DiagnosticsProperty('setValueFanout', setValueFanout)) + ..add(DiagnosticsProperty('minPeerCount', minPeerCount)) + ..add(DiagnosticsProperty('minPeerRefreshTimeMs', minPeerRefreshTimeMs)) + ..add(DiagnosticsProperty( + 'validateDialInfoReceiptTimeMs', validateDialInfoReceiptTimeMs)) + ..add(DiagnosticsProperty('localSubkeyCacheSize', localSubkeyCacheSize)) + ..add(DiagnosticsProperty( + 'localMaxSubkeyCacheMemoryMb', localMaxSubkeyCacheMemoryMb)) + ..add(DiagnosticsProperty('remoteSubkeyCacheSize', remoteSubkeyCacheSize)) + ..add(DiagnosticsProperty('remoteMaxRecords', remoteMaxRecords)) + ..add(DiagnosticsProperty( + 'remoteMaxSubkeyCacheMemoryMb', remoteMaxSubkeyCacheMemoryMb)) + ..add(DiagnosticsProperty( + 'remoteMaxStorageSpaceMb', remoteMaxStorageSpaceMb)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigDHT && + (identical(other.resolveNodeTimeoutMs, resolveNodeTimeoutMs) || + other.resolveNodeTimeoutMs == resolveNodeTimeoutMs) && + (identical(other.resolveNodeCount, resolveNodeCount) || + other.resolveNodeCount == resolveNodeCount) && + (identical(other.resolveNodeFanout, resolveNodeFanout) || + other.resolveNodeFanout == resolveNodeFanout) && + (identical(other.maxFindNodeCount, maxFindNodeCount) || + other.maxFindNodeCount == maxFindNodeCount) && + (identical(other.getValueTimeoutMs, getValueTimeoutMs) || + other.getValueTimeoutMs == getValueTimeoutMs) && + (identical(other.getValueCount, getValueCount) || + other.getValueCount == getValueCount) && + (identical(other.getValueFanout, getValueFanout) || + other.getValueFanout == getValueFanout) && + (identical(other.setValueTimeoutMs, setValueTimeoutMs) || + other.setValueTimeoutMs == setValueTimeoutMs) && + (identical(other.setValueCount, setValueCount) || + other.setValueCount == setValueCount) && + (identical(other.setValueFanout, setValueFanout) || + other.setValueFanout == setValueFanout) && + (identical(other.minPeerCount, minPeerCount) || + other.minPeerCount == minPeerCount) && + (identical(other.minPeerRefreshTimeMs, minPeerRefreshTimeMs) || + other.minPeerRefreshTimeMs == minPeerRefreshTimeMs) && + (identical(other.validateDialInfoReceiptTimeMs, + validateDialInfoReceiptTimeMs) || + other.validateDialInfoReceiptTimeMs == + validateDialInfoReceiptTimeMs) && + (identical(other.localSubkeyCacheSize, localSubkeyCacheSize) || + other.localSubkeyCacheSize == localSubkeyCacheSize) && + (identical(other.localMaxSubkeyCacheMemoryMb, + localMaxSubkeyCacheMemoryMb) || + other.localMaxSubkeyCacheMemoryMb == + localMaxSubkeyCacheMemoryMb) && + (identical(other.remoteSubkeyCacheSize, remoteSubkeyCacheSize) || + other.remoteSubkeyCacheSize == remoteSubkeyCacheSize) && + (identical(other.remoteMaxRecords, remoteMaxRecords) || + other.remoteMaxRecords == remoteMaxRecords) && + (identical(other.remoteMaxSubkeyCacheMemoryMb, + remoteMaxSubkeyCacheMemoryMb) || + other.remoteMaxSubkeyCacheMemoryMb == + remoteMaxSubkeyCacheMemoryMb) && + (identical( + other.remoteMaxStorageSpaceMb, remoteMaxStorageSpaceMb) || + other.remoteMaxStorageSpaceMb == remoteMaxStorageSpaceMb)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hashAll([ + runtimeType, + resolveNodeTimeoutMs, + resolveNodeCount, + resolveNodeFanout, + maxFindNodeCount, + getValueTimeoutMs, + getValueCount, + getValueFanout, + setValueTimeoutMs, + setValueCount, + setValueFanout, + minPeerCount, + minPeerRefreshTimeMs, + validateDialInfoReceiptTimeMs, + localSubkeyCacheSize, + localMaxSubkeyCacheMemoryMb, + remoteSubkeyCacheSize, + remoteMaxRecords, + remoteMaxSubkeyCacheMemoryMb, + remoteMaxStorageSpaceMb + ]); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigDHTCopyWith<_$_VeilidConfigDHT> get copyWith => + __$$_VeilidConfigDHTCopyWithImpl<_$_VeilidConfigDHT>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigDHTToJson( + this, + ); + } +} + +abstract class _VeilidConfigDHT implements VeilidConfigDHT { + const factory _VeilidConfigDHT( + {required final int resolveNodeTimeoutMs, + required final int resolveNodeCount, + required final int resolveNodeFanout, + required final int maxFindNodeCount, + required final int getValueTimeoutMs, + required final int getValueCount, + required final int getValueFanout, + required final int setValueTimeoutMs, + required final int setValueCount, + required final int setValueFanout, + required final int minPeerCount, + required final int minPeerRefreshTimeMs, + required final int validateDialInfoReceiptTimeMs, + required final int localSubkeyCacheSize, + required final int localMaxSubkeyCacheMemoryMb, + required final int remoteSubkeyCacheSize, + required final int remoteMaxRecords, + required final int remoteMaxSubkeyCacheMemoryMb, + required final int remoteMaxStorageSpaceMb}) = _$_VeilidConfigDHT; + + factory _VeilidConfigDHT.fromJson(Map json) = + _$_VeilidConfigDHT.fromJson; + + @override + int get resolveNodeTimeoutMs; + @override + int get resolveNodeCount; + @override + int get resolveNodeFanout; + @override + int get maxFindNodeCount; + @override + int get getValueTimeoutMs; + @override + int get getValueCount; + @override + int get getValueFanout; + @override + int get setValueTimeoutMs; + @override + int get setValueCount; + @override + int get setValueFanout; + @override + int get minPeerCount; + @override + int get minPeerRefreshTimeMs; + @override + int get validateDialInfoReceiptTimeMs; + @override + int get localSubkeyCacheSize; + @override + int get localMaxSubkeyCacheMemoryMb; + @override + int get remoteSubkeyCacheSize; + @override + int get remoteMaxRecords; + @override + int get remoteMaxSubkeyCacheMemoryMb; + @override + int get remoteMaxStorageSpaceMb; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigDHTCopyWith<_$_VeilidConfigDHT> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidConfigRPC _$VeilidConfigRPCFromJson(Map json) { + return _VeilidConfigRPC.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigRPC { + int get concurrency => throw _privateConstructorUsedError; + int get queueSize => throw _privateConstructorUsedError; + int? get maxTimestampBehindMs => throw _privateConstructorUsedError; + int? get maxTimestampAheadMs => throw _privateConstructorUsedError; + int get timeoutMs => throw _privateConstructorUsedError; + int get maxRouteHopCount => throw _privateConstructorUsedError; + int get defaultRouteHopCount => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigRPCCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigRPCCopyWith<$Res> { + factory $VeilidConfigRPCCopyWith( + VeilidConfigRPC value, $Res Function(VeilidConfigRPC) then) = + _$VeilidConfigRPCCopyWithImpl<$Res, VeilidConfigRPC>; + @useResult + $Res call( + {int concurrency, + int queueSize, + int? maxTimestampBehindMs, + int? maxTimestampAheadMs, + int timeoutMs, + int maxRouteHopCount, + int defaultRouteHopCount}); +} + +/// @nodoc +class _$VeilidConfigRPCCopyWithImpl<$Res, $Val extends VeilidConfigRPC> + implements $VeilidConfigRPCCopyWith<$Res> { + _$VeilidConfigRPCCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? concurrency = null, + Object? queueSize = null, + Object? maxTimestampBehindMs = freezed, + Object? maxTimestampAheadMs = freezed, + Object? timeoutMs = null, + Object? maxRouteHopCount = null, + Object? defaultRouteHopCount = null, + }) { + return _then(_value.copyWith( + concurrency: null == concurrency + ? _value.concurrency + : concurrency // ignore: cast_nullable_to_non_nullable + as int, + queueSize: null == queueSize + ? _value.queueSize + : queueSize // ignore: cast_nullable_to_non_nullable + as int, + maxTimestampBehindMs: freezed == maxTimestampBehindMs + ? _value.maxTimestampBehindMs + : maxTimestampBehindMs // ignore: cast_nullable_to_non_nullable + as int?, + maxTimestampAheadMs: freezed == maxTimestampAheadMs + ? _value.maxTimestampAheadMs + : maxTimestampAheadMs // ignore: cast_nullable_to_non_nullable + as int?, + timeoutMs: null == timeoutMs + ? _value.timeoutMs + : timeoutMs // ignore: cast_nullable_to_non_nullable + as int, + maxRouteHopCount: null == maxRouteHopCount + ? _value.maxRouteHopCount + : maxRouteHopCount // ignore: cast_nullable_to_non_nullable + as int, + defaultRouteHopCount: null == defaultRouteHopCount + ? _value.defaultRouteHopCount + : defaultRouteHopCount // ignore: cast_nullable_to_non_nullable + as int, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigRPCCopyWith<$Res> + implements $VeilidConfigRPCCopyWith<$Res> { + factory _$$_VeilidConfigRPCCopyWith( + _$_VeilidConfigRPC value, $Res Function(_$_VeilidConfigRPC) then) = + __$$_VeilidConfigRPCCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {int concurrency, + int queueSize, + int? maxTimestampBehindMs, + int? maxTimestampAheadMs, + int timeoutMs, + int maxRouteHopCount, + int defaultRouteHopCount}); +} + +/// @nodoc +class __$$_VeilidConfigRPCCopyWithImpl<$Res> + extends _$VeilidConfigRPCCopyWithImpl<$Res, _$_VeilidConfigRPC> + implements _$$_VeilidConfigRPCCopyWith<$Res> { + __$$_VeilidConfigRPCCopyWithImpl( + _$_VeilidConfigRPC _value, $Res Function(_$_VeilidConfigRPC) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? concurrency = null, + Object? queueSize = null, + Object? maxTimestampBehindMs = freezed, + Object? maxTimestampAheadMs = freezed, + Object? timeoutMs = null, + Object? maxRouteHopCount = null, + Object? defaultRouteHopCount = null, + }) { + return _then(_$_VeilidConfigRPC( + concurrency: null == concurrency + ? _value.concurrency + : concurrency // ignore: cast_nullable_to_non_nullable + as int, + queueSize: null == queueSize + ? _value.queueSize + : queueSize // ignore: cast_nullable_to_non_nullable + as int, + maxTimestampBehindMs: freezed == maxTimestampBehindMs + ? _value.maxTimestampBehindMs + : maxTimestampBehindMs // ignore: cast_nullable_to_non_nullable + as int?, + maxTimestampAheadMs: freezed == maxTimestampAheadMs + ? _value.maxTimestampAheadMs + : maxTimestampAheadMs // ignore: cast_nullable_to_non_nullable + as int?, + timeoutMs: null == timeoutMs + ? _value.timeoutMs + : timeoutMs // ignore: cast_nullable_to_non_nullable + as int, + maxRouteHopCount: null == maxRouteHopCount + ? _value.maxRouteHopCount + : maxRouteHopCount // ignore: cast_nullable_to_non_nullable + as int, + defaultRouteHopCount: null == defaultRouteHopCount + ? _value.defaultRouteHopCount + : defaultRouteHopCount // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigRPC + with DiagnosticableTreeMixin + implements _VeilidConfigRPC { + const _$_VeilidConfigRPC( + {required this.concurrency, + required this.queueSize, + this.maxTimestampBehindMs, + this.maxTimestampAheadMs, + required this.timeoutMs, + required this.maxRouteHopCount, + required this.defaultRouteHopCount}); + + factory _$_VeilidConfigRPC.fromJson(Map json) => + _$$_VeilidConfigRPCFromJson(json); + + @override + final int concurrency; + @override + final int queueSize; + @override + final int? maxTimestampBehindMs; + @override + final int? maxTimestampAheadMs; + @override + final int timeoutMs; + @override + final int maxRouteHopCount; + @override + final int defaultRouteHopCount; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigRPC(concurrency: $concurrency, queueSize: $queueSize, maxTimestampBehindMs: $maxTimestampBehindMs, maxTimestampAheadMs: $maxTimestampAheadMs, timeoutMs: $timeoutMs, maxRouteHopCount: $maxRouteHopCount, defaultRouteHopCount: $defaultRouteHopCount)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigRPC')) + ..add(DiagnosticsProperty('concurrency', concurrency)) + ..add(DiagnosticsProperty('queueSize', queueSize)) + ..add(DiagnosticsProperty('maxTimestampBehindMs', maxTimestampBehindMs)) + ..add(DiagnosticsProperty('maxTimestampAheadMs', maxTimestampAheadMs)) + ..add(DiagnosticsProperty('timeoutMs', timeoutMs)) + ..add(DiagnosticsProperty('maxRouteHopCount', maxRouteHopCount)) + ..add(DiagnosticsProperty('defaultRouteHopCount', defaultRouteHopCount)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigRPC && + (identical(other.concurrency, concurrency) || + other.concurrency == concurrency) && + (identical(other.queueSize, queueSize) || + other.queueSize == queueSize) && + (identical(other.maxTimestampBehindMs, maxTimestampBehindMs) || + other.maxTimestampBehindMs == maxTimestampBehindMs) && + (identical(other.maxTimestampAheadMs, maxTimestampAheadMs) || + other.maxTimestampAheadMs == maxTimestampAheadMs) && + (identical(other.timeoutMs, timeoutMs) || + other.timeoutMs == timeoutMs) && + (identical(other.maxRouteHopCount, maxRouteHopCount) || + other.maxRouteHopCount == maxRouteHopCount) && + (identical(other.defaultRouteHopCount, defaultRouteHopCount) || + other.defaultRouteHopCount == defaultRouteHopCount)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash( + runtimeType, + concurrency, + queueSize, + maxTimestampBehindMs, + maxTimestampAheadMs, + timeoutMs, + maxRouteHopCount, + defaultRouteHopCount); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigRPCCopyWith<_$_VeilidConfigRPC> get copyWith => + __$$_VeilidConfigRPCCopyWithImpl<_$_VeilidConfigRPC>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigRPCToJson( + this, + ); + } +} + +abstract class _VeilidConfigRPC implements VeilidConfigRPC { + const factory _VeilidConfigRPC( + {required final int concurrency, + required final int queueSize, + final int? maxTimestampBehindMs, + final int? maxTimestampAheadMs, + required final int timeoutMs, + required final int maxRouteHopCount, + required final int defaultRouteHopCount}) = _$_VeilidConfigRPC; + + factory _VeilidConfigRPC.fromJson(Map json) = + _$_VeilidConfigRPC.fromJson; + + @override + int get concurrency; + @override + int get queueSize; + @override + int? get maxTimestampBehindMs; + @override + int? get maxTimestampAheadMs; + @override + int get timeoutMs; + @override + int get maxRouteHopCount; + @override + int get defaultRouteHopCount; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigRPCCopyWith<_$_VeilidConfigRPC> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidConfigRoutingTable _$VeilidConfigRoutingTableFromJson( + Map json) { + return _VeilidConfigRoutingTable.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigRoutingTable { + List> get nodeId => + throw _privateConstructorUsedError; + List> get nodeIdSecret => + throw _privateConstructorUsedError; + List get bootstrap => throw _privateConstructorUsedError; + int get limitOverAttached => throw _privateConstructorUsedError; + int get limitFullyAttached => throw _privateConstructorUsedError; + int get limitAttachedStrong => throw _privateConstructorUsedError; + int get limitAttachedGood => throw _privateConstructorUsedError; + int get limitAttachedWeak => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigRoutingTableCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigRoutingTableCopyWith<$Res> { + factory $VeilidConfigRoutingTableCopyWith(VeilidConfigRoutingTable value, + $Res Function(VeilidConfigRoutingTable) then) = + _$VeilidConfigRoutingTableCopyWithImpl<$Res, VeilidConfigRoutingTable>; + @useResult + $Res call( + {List> nodeId, + List> nodeIdSecret, + List bootstrap, + int limitOverAttached, + int limitFullyAttached, + int limitAttachedStrong, + int limitAttachedGood, + int limitAttachedWeak}); +} + +/// @nodoc +class _$VeilidConfigRoutingTableCopyWithImpl<$Res, + $Val extends VeilidConfigRoutingTable> + implements $VeilidConfigRoutingTableCopyWith<$Res> { + _$VeilidConfigRoutingTableCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? nodeId = null, + Object? nodeIdSecret = null, + Object? bootstrap = null, + Object? limitOverAttached = null, + Object? limitFullyAttached = null, + Object? limitAttachedStrong = null, + Object? limitAttachedGood = null, + Object? limitAttachedWeak = null, + }) { + return _then(_value.copyWith( + nodeId: null == nodeId + ? _value.nodeId + : nodeId // ignore: cast_nullable_to_non_nullable + as List>, + nodeIdSecret: null == nodeIdSecret + ? _value.nodeIdSecret + : nodeIdSecret // ignore: cast_nullable_to_non_nullable + as List>, + bootstrap: null == bootstrap + ? _value.bootstrap + : bootstrap // ignore: cast_nullable_to_non_nullable + as List, + limitOverAttached: null == limitOverAttached + ? _value.limitOverAttached + : limitOverAttached // ignore: cast_nullable_to_non_nullable + as int, + limitFullyAttached: null == limitFullyAttached + ? _value.limitFullyAttached + : limitFullyAttached // ignore: cast_nullable_to_non_nullable + as int, + limitAttachedStrong: null == limitAttachedStrong + ? _value.limitAttachedStrong + : limitAttachedStrong // ignore: cast_nullable_to_non_nullable + as int, + limitAttachedGood: null == limitAttachedGood + ? _value.limitAttachedGood + : limitAttachedGood // ignore: cast_nullable_to_non_nullable + as int, + limitAttachedWeak: null == limitAttachedWeak + ? _value.limitAttachedWeak + : limitAttachedWeak // ignore: cast_nullable_to_non_nullable + as int, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigRoutingTableCopyWith<$Res> + implements $VeilidConfigRoutingTableCopyWith<$Res> { + factory _$$_VeilidConfigRoutingTableCopyWith( + _$_VeilidConfigRoutingTable value, + $Res Function(_$_VeilidConfigRoutingTable) then) = + __$$_VeilidConfigRoutingTableCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {List> nodeId, + List> nodeIdSecret, + List bootstrap, + int limitOverAttached, + int limitFullyAttached, + int limitAttachedStrong, + int limitAttachedGood, + int limitAttachedWeak}); +} + +/// @nodoc +class __$$_VeilidConfigRoutingTableCopyWithImpl<$Res> + extends _$VeilidConfigRoutingTableCopyWithImpl<$Res, + _$_VeilidConfigRoutingTable> + implements _$$_VeilidConfigRoutingTableCopyWith<$Res> { + __$$_VeilidConfigRoutingTableCopyWithImpl(_$_VeilidConfigRoutingTable _value, + $Res Function(_$_VeilidConfigRoutingTable) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? nodeId = null, + Object? nodeIdSecret = null, + Object? bootstrap = null, + Object? limitOverAttached = null, + Object? limitFullyAttached = null, + Object? limitAttachedStrong = null, + Object? limitAttachedGood = null, + Object? limitAttachedWeak = null, + }) { + return _then(_$_VeilidConfigRoutingTable( + nodeId: null == nodeId + ? _value._nodeId + : nodeId // ignore: cast_nullable_to_non_nullable + as List>, + nodeIdSecret: null == nodeIdSecret + ? _value._nodeIdSecret + : nodeIdSecret // ignore: cast_nullable_to_non_nullable + as List>, + bootstrap: null == bootstrap + ? _value._bootstrap + : bootstrap // ignore: cast_nullable_to_non_nullable + as List, + limitOverAttached: null == limitOverAttached + ? _value.limitOverAttached + : limitOverAttached // ignore: cast_nullable_to_non_nullable + as int, + limitFullyAttached: null == limitFullyAttached + ? _value.limitFullyAttached + : limitFullyAttached // ignore: cast_nullable_to_non_nullable + as int, + limitAttachedStrong: null == limitAttachedStrong + ? _value.limitAttachedStrong + : limitAttachedStrong // ignore: cast_nullable_to_non_nullable + as int, + limitAttachedGood: null == limitAttachedGood + ? _value.limitAttachedGood + : limitAttachedGood // ignore: cast_nullable_to_non_nullable + as int, + limitAttachedWeak: null == limitAttachedWeak + ? _value.limitAttachedWeak + : limitAttachedWeak // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigRoutingTable + with DiagnosticableTreeMixin + implements _VeilidConfigRoutingTable { + const _$_VeilidConfigRoutingTable( + {required final List> nodeId, + required final List> nodeIdSecret, + required final List bootstrap, + required this.limitOverAttached, + required this.limitFullyAttached, + required this.limitAttachedStrong, + required this.limitAttachedGood, + required this.limitAttachedWeak}) + : _nodeId = nodeId, + _nodeIdSecret = nodeIdSecret, + _bootstrap = bootstrap; + + factory _$_VeilidConfigRoutingTable.fromJson(Map json) => + _$$_VeilidConfigRoutingTableFromJson(json); + + final List> _nodeId; + @override + List> get nodeId { + if (_nodeId is EqualUnmodifiableListView) return _nodeId; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_nodeId); + } + + final List> _nodeIdSecret; + @override + List> get nodeIdSecret { + if (_nodeIdSecret is EqualUnmodifiableListView) return _nodeIdSecret; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_nodeIdSecret); + } + + final List _bootstrap; + @override + List get bootstrap { + if (_bootstrap is EqualUnmodifiableListView) return _bootstrap; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_bootstrap); + } + + @override + final int limitOverAttached; + @override + final int limitFullyAttached; + @override + final int limitAttachedStrong; + @override + final int limitAttachedGood; + @override + final int limitAttachedWeak; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigRoutingTable(nodeId: $nodeId, nodeIdSecret: $nodeIdSecret, bootstrap: $bootstrap, limitOverAttached: $limitOverAttached, limitFullyAttached: $limitFullyAttached, limitAttachedStrong: $limitAttachedStrong, limitAttachedGood: $limitAttachedGood, limitAttachedWeak: $limitAttachedWeak)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigRoutingTable')) + ..add(DiagnosticsProperty('nodeId', nodeId)) + ..add(DiagnosticsProperty('nodeIdSecret', nodeIdSecret)) + ..add(DiagnosticsProperty('bootstrap', bootstrap)) + ..add(DiagnosticsProperty('limitOverAttached', limitOverAttached)) + ..add(DiagnosticsProperty('limitFullyAttached', limitFullyAttached)) + ..add(DiagnosticsProperty('limitAttachedStrong', limitAttachedStrong)) + ..add(DiagnosticsProperty('limitAttachedGood', limitAttachedGood)) + ..add(DiagnosticsProperty('limitAttachedWeak', limitAttachedWeak)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigRoutingTable && + const DeepCollectionEquality().equals(other._nodeId, _nodeId) && + const DeepCollectionEquality() + .equals(other._nodeIdSecret, _nodeIdSecret) && + const DeepCollectionEquality() + .equals(other._bootstrap, _bootstrap) && + (identical(other.limitOverAttached, limitOverAttached) || + other.limitOverAttached == limitOverAttached) && + (identical(other.limitFullyAttached, limitFullyAttached) || + other.limitFullyAttached == limitFullyAttached) && + (identical(other.limitAttachedStrong, limitAttachedStrong) || + other.limitAttachedStrong == limitAttachedStrong) && + (identical(other.limitAttachedGood, limitAttachedGood) || + other.limitAttachedGood == limitAttachedGood) && + (identical(other.limitAttachedWeak, limitAttachedWeak) || + other.limitAttachedWeak == limitAttachedWeak)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(_nodeId), + const DeepCollectionEquality().hash(_nodeIdSecret), + const DeepCollectionEquality().hash(_bootstrap), + limitOverAttached, + limitFullyAttached, + limitAttachedStrong, + limitAttachedGood, + limitAttachedWeak); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigRoutingTableCopyWith<_$_VeilidConfigRoutingTable> + get copyWith => __$$_VeilidConfigRoutingTableCopyWithImpl< + _$_VeilidConfigRoutingTable>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigRoutingTableToJson( + this, + ); + } +} + +abstract class _VeilidConfigRoutingTable implements VeilidConfigRoutingTable { + const factory _VeilidConfigRoutingTable( + {required final List> nodeId, + required final List> nodeIdSecret, + required final List bootstrap, + required final int limitOverAttached, + required final int limitFullyAttached, + required final int limitAttachedStrong, + required final int limitAttachedGood, + required final int limitAttachedWeak}) = _$_VeilidConfigRoutingTable; + + factory _VeilidConfigRoutingTable.fromJson(Map json) = + _$_VeilidConfigRoutingTable.fromJson; + + @override + List> get nodeId; + @override + List> get nodeIdSecret; + @override + List get bootstrap; + @override + int get limitOverAttached; + @override + int get limitFullyAttached; + @override + int get limitAttachedStrong; + @override + int get limitAttachedGood; + @override + int get limitAttachedWeak; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigRoutingTableCopyWith<_$_VeilidConfigRoutingTable> + get copyWith => throw _privateConstructorUsedError; +} + +VeilidConfigNetwork _$VeilidConfigNetworkFromJson(Map json) { + return _VeilidConfigNetwork.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigNetwork { + int get connectionInitialTimeoutMs => throw _privateConstructorUsedError; + int get connectionInactivityTimeoutMs => throw _privateConstructorUsedError; + int get maxConnectionsPerIp4 => throw _privateConstructorUsedError; + int get maxConnectionsPerIp6Prefix => throw _privateConstructorUsedError; + int get maxConnectionsPerIp6PrefixSize => throw _privateConstructorUsedError; + int get maxConnectionFrequencyPerMin => throw _privateConstructorUsedError; + int get clientWhitelistTimeoutMs => throw _privateConstructorUsedError; + int get reverseConnectionReceiptTimeMs => throw _privateConstructorUsedError; + int get holePunchReceiptTimeMs => throw _privateConstructorUsedError; + String? get networkKeyPassword => throw _privateConstructorUsedError; + VeilidConfigRoutingTable get routingTable => + throw _privateConstructorUsedError; + VeilidConfigRPC get rpc => throw _privateConstructorUsedError; + VeilidConfigDHT get dht => throw _privateConstructorUsedError; + bool get upnp => throw _privateConstructorUsedError; + bool get detectAddressChanges => throw _privateConstructorUsedError; + int get restrictedNatRetries => throw _privateConstructorUsedError; + VeilidConfigTLS get tls => throw _privateConstructorUsedError; + VeilidConfigApplication get application => throw _privateConstructorUsedError; + VeilidConfigProtocol get protocol => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigNetworkCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigNetworkCopyWith<$Res> { + factory $VeilidConfigNetworkCopyWith( + VeilidConfigNetwork value, $Res Function(VeilidConfigNetwork) then) = + _$VeilidConfigNetworkCopyWithImpl<$Res, VeilidConfigNetwork>; + @useResult + $Res call( + {int connectionInitialTimeoutMs, + int connectionInactivityTimeoutMs, + int maxConnectionsPerIp4, + int maxConnectionsPerIp6Prefix, + int maxConnectionsPerIp6PrefixSize, + int maxConnectionFrequencyPerMin, + int clientWhitelistTimeoutMs, + int reverseConnectionReceiptTimeMs, + int holePunchReceiptTimeMs, + String? networkKeyPassword, + VeilidConfigRoutingTable routingTable, + VeilidConfigRPC rpc, + VeilidConfigDHT dht, + bool upnp, + bool detectAddressChanges, + int restrictedNatRetries, + VeilidConfigTLS tls, + VeilidConfigApplication application, + VeilidConfigProtocol protocol}); + + $VeilidConfigRoutingTableCopyWith<$Res> get routingTable; + $VeilidConfigRPCCopyWith<$Res> get rpc; + $VeilidConfigDHTCopyWith<$Res> get dht; + $VeilidConfigTLSCopyWith<$Res> get tls; + $VeilidConfigApplicationCopyWith<$Res> get application; + $VeilidConfigProtocolCopyWith<$Res> get protocol; +} + +/// @nodoc +class _$VeilidConfigNetworkCopyWithImpl<$Res, $Val extends VeilidConfigNetwork> + implements $VeilidConfigNetworkCopyWith<$Res> { + _$VeilidConfigNetworkCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? connectionInitialTimeoutMs = null, + Object? connectionInactivityTimeoutMs = null, + Object? maxConnectionsPerIp4 = null, + Object? maxConnectionsPerIp6Prefix = null, + Object? maxConnectionsPerIp6PrefixSize = null, + Object? maxConnectionFrequencyPerMin = null, + Object? clientWhitelistTimeoutMs = null, + Object? reverseConnectionReceiptTimeMs = null, + Object? holePunchReceiptTimeMs = null, + Object? networkKeyPassword = freezed, + Object? routingTable = null, + Object? rpc = null, + Object? dht = null, + Object? upnp = null, + Object? detectAddressChanges = null, + Object? restrictedNatRetries = null, + Object? tls = null, + Object? application = null, + Object? protocol = null, + }) { + return _then(_value.copyWith( + connectionInitialTimeoutMs: null == connectionInitialTimeoutMs + ? _value.connectionInitialTimeoutMs + : connectionInitialTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + connectionInactivityTimeoutMs: null == connectionInactivityTimeoutMs + ? _value.connectionInactivityTimeoutMs + : connectionInactivityTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionsPerIp4: null == maxConnectionsPerIp4 + ? _value.maxConnectionsPerIp4 + : maxConnectionsPerIp4 // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionsPerIp6Prefix: null == maxConnectionsPerIp6Prefix + ? _value.maxConnectionsPerIp6Prefix + : maxConnectionsPerIp6Prefix // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionsPerIp6PrefixSize: null == maxConnectionsPerIp6PrefixSize + ? _value.maxConnectionsPerIp6PrefixSize + : maxConnectionsPerIp6PrefixSize // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionFrequencyPerMin: null == maxConnectionFrequencyPerMin + ? _value.maxConnectionFrequencyPerMin + : maxConnectionFrequencyPerMin // ignore: cast_nullable_to_non_nullable + as int, + clientWhitelistTimeoutMs: null == clientWhitelistTimeoutMs + ? _value.clientWhitelistTimeoutMs + : clientWhitelistTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + reverseConnectionReceiptTimeMs: null == reverseConnectionReceiptTimeMs + ? _value.reverseConnectionReceiptTimeMs + : reverseConnectionReceiptTimeMs // ignore: cast_nullable_to_non_nullable + as int, + holePunchReceiptTimeMs: null == holePunchReceiptTimeMs + ? _value.holePunchReceiptTimeMs + : holePunchReceiptTimeMs // ignore: cast_nullable_to_non_nullable + as int, + networkKeyPassword: freezed == networkKeyPassword + ? _value.networkKeyPassword + : networkKeyPassword // ignore: cast_nullable_to_non_nullable + as String?, + routingTable: null == routingTable + ? _value.routingTable + : routingTable // ignore: cast_nullable_to_non_nullable + as VeilidConfigRoutingTable, + rpc: null == rpc + ? _value.rpc + : rpc // ignore: cast_nullable_to_non_nullable + as VeilidConfigRPC, + dht: null == dht + ? _value.dht + : dht // ignore: cast_nullable_to_non_nullable + as VeilidConfigDHT, + upnp: null == upnp + ? _value.upnp + : upnp // ignore: cast_nullable_to_non_nullable + as bool, + detectAddressChanges: null == detectAddressChanges + ? _value.detectAddressChanges + : detectAddressChanges // ignore: cast_nullable_to_non_nullable + as bool, + restrictedNatRetries: null == restrictedNatRetries + ? _value.restrictedNatRetries + : restrictedNatRetries // ignore: cast_nullable_to_non_nullable + as int, + tls: null == tls + ? _value.tls + : tls // ignore: cast_nullable_to_non_nullable + as VeilidConfigTLS, + application: null == application + ? _value.application + : application // ignore: cast_nullable_to_non_nullable + as VeilidConfigApplication, + protocol: null == protocol + ? _value.protocol + : protocol // ignore: cast_nullable_to_non_nullable + as VeilidConfigProtocol, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigRoutingTableCopyWith<$Res> get routingTable { + return $VeilidConfigRoutingTableCopyWith<$Res>(_value.routingTable, + (value) { + return _then(_value.copyWith(routingTable: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigRPCCopyWith<$Res> get rpc { + return $VeilidConfigRPCCopyWith<$Res>(_value.rpc, (value) { + return _then(_value.copyWith(rpc: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigDHTCopyWith<$Res> get dht { + return $VeilidConfigDHTCopyWith<$Res>(_value.dht, (value) { + return _then(_value.copyWith(dht: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigTLSCopyWith<$Res> get tls { + return $VeilidConfigTLSCopyWith<$Res>(_value.tls, (value) { + return _then(_value.copyWith(tls: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigApplicationCopyWith<$Res> get application { + return $VeilidConfigApplicationCopyWith<$Res>(_value.application, (value) { + return _then(_value.copyWith(application: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigProtocolCopyWith<$Res> get protocol { + return $VeilidConfigProtocolCopyWith<$Res>(_value.protocol, (value) { + return _then(_value.copyWith(protocol: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigNetworkCopyWith<$Res> + implements $VeilidConfigNetworkCopyWith<$Res> { + factory _$$_VeilidConfigNetworkCopyWith(_$_VeilidConfigNetwork value, + $Res Function(_$_VeilidConfigNetwork) then) = + __$$_VeilidConfigNetworkCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {int connectionInitialTimeoutMs, + int connectionInactivityTimeoutMs, + int maxConnectionsPerIp4, + int maxConnectionsPerIp6Prefix, + int maxConnectionsPerIp6PrefixSize, + int maxConnectionFrequencyPerMin, + int clientWhitelistTimeoutMs, + int reverseConnectionReceiptTimeMs, + int holePunchReceiptTimeMs, + String? networkKeyPassword, + VeilidConfigRoutingTable routingTable, + VeilidConfigRPC rpc, + VeilidConfigDHT dht, + bool upnp, + bool detectAddressChanges, + int restrictedNatRetries, + VeilidConfigTLS tls, + VeilidConfigApplication application, + VeilidConfigProtocol protocol}); + + @override + $VeilidConfigRoutingTableCopyWith<$Res> get routingTable; + @override + $VeilidConfigRPCCopyWith<$Res> get rpc; + @override + $VeilidConfigDHTCopyWith<$Res> get dht; + @override + $VeilidConfigTLSCopyWith<$Res> get tls; + @override + $VeilidConfigApplicationCopyWith<$Res> get application; + @override + $VeilidConfigProtocolCopyWith<$Res> get protocol; +} + +/// @nodoc +class __$$_VeilidConfigNetworkCopyWithImpl<$Res> + extends _$VeilidConfigNetworkCopyWithImpl<$Res, _$_VeilidConfigNetwork> + implements _$$_VeilidConfigNetworkCopyWith<$Res> { + __$$_VeilidConfigNetworkCopyWithImpl(_$_VeilidConfigNetwork _value, + $Res Function(_$_VeilidConfigNetwork) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? connectionInitialTimeoutMs = null, + Object? connectionInactivityTimeoutMs = null, + Object? maxConnectionsPerIp4 = null, + Object? maxConnectionsPerIp6Prefix = null, + Object? maxConnectionsPerIp6PrefixSize = null, + Object? maxConnectionFrequencyPerMin = null, + Object? clientWhitelistTimeoutMs = null, + Object? reverseConnectionReceiptTimeMs = null, + Object? holePunchReceiptTimeMs = null, + Object? networkKeyPassword = freezed, + Object? routingTable = null, + Object? rpc = null, + Object? dht = null, + Object? upnp = null, + Object? detectAddressChanges = null, + Object? restrictedNatRetries = null, + Object? tls = null, + Object? application = null, + Object? protocol = null, + }) { + return _then(_$_VeilidConfigNetwork( + connectionInitialTimeoutMs: null == connectionInitialTimeoutMs + ? _value.connectionInitialTimeoutMs + : connectionInitialTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + connectionInactivityTimeoutMs: null == connectionInactivityTimeoutMs + ? _value.connectionInactivityTimeoutMs + : connectionInactivityTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionsPerIp4: null == maxConnectionsPerIp4 + ? _value.maxConnectionsPerIp4 + : maxConnectionsPerIp4 // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionsPerIp6Prefix: null == maxConnectionsPerIp6Prefix + ? _value.maxConnectionsPerIp6Prefix + : maxConnectionsPerIp6Prefix // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionsPerIp6PrefixSize: null == maxConnectionsPerIp6PrefixSize + ? _value.maxConnectionsPerIp6PrefixSize + : maxConnectionsPerIp6PrefixSize // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionFrequencyPerMin: null == maxConnectionFrequencyPerMin + ? _value.maxConnectionFrequencyPerMin + : maxConnectionFrequencyPerMin // ignore: cast_nullable_to_non_nullable + as int, + clientWhitelistTimeoutMs: null == clientWhitelistTimeoutMs + ? _value.clientWhitelistTimeoutMs + : clientWhitelistTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + reverseConnectionReceiptTimeMs: null == reverseConnectionReceiptTimeMs + ? _value.reverseConnectionReceiptTimeMs + : reverseConnectionReceiptTimeMs // ignore: cast_nullable_to_non_nullable + as int, + holePunchReceiptTimeMs: null == holePunchReceiptTimeMs + ? _value.holePunchReceiptTimeMs + : holePunchReceiptTimeMs // ignore: cast_nullable_to_non_nullable + as int, + networkKeyPassword: freezed == networkKeyPassword + ? _value.networkKeyPassword + : networkKeyPassword // ignore: cast_nullable_to_non_nullable + as String?, + routingTable: null == routingTable + ? _value.routingTable + : routingTable // ignore: cast_nullable_to_non_nullable + as VeilidConfigRoutingTable, + rpc: null == rpc + ? _value.rpc + : rpc // ignore: cast_nullable_to_non_nullable + as VeilidConfigRPC, + dht: null == dht + ? _value.dht + : dht // ignore: cast_nullable_to_non_nullable + as VeilidConfigDHT, + upnp: null == upnp + ? _value.upnp + : upnp // ignore: cast_nullable_to_non_nullable + as bool, + detectAddressChanges: null == detectAddressChanges + ? _value.detectAddressChanges + : detectAddressChanges // ignore: cast_nullable_to_non_nullable + as bool, + restrictedNatRetries: null == restrictedNatRetries + ? _value.restrictedNatRetries + : restrictedNatRetries // ignore: cast_nullable_to_non_nullable + as int, + tls: null == tls + ? _value.tls + : tls // ignore: cast_nullable_to_non_nullable + as VeilidConfigTLS, + application: null == application + ? _value.application + : application // ignore: cast_nullable_to_non_nullable + as VeilidConfigApplication, + protocol: null == protocol + ? _value.protocol + : protocol // ignore: cast_nullable_to_non_nullable + as VeilidConfigProtocol, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigNetwork + with DiagnosticableTreeMixin + implements _VeilidConfigNetwork { + const _$_VeilidConfigNetwork( + {required this.connectionInitialTimeoutMs, + required this.connectionInactivityTimeoutMs, + required this.maxConnectionsPerIp4, + required this.maxConnectionsPerIp6Prefix, + required this.maxConnectionsPerIp6PrefixSize, + required this.maxConnectionFrequencyPerMin, + required this.clientWhitelistTimeoutMs, + required this.reverseConnectionReceiptTimeMs, + required this.holePunchReceiptTimeMs, + this.networkKeyPassword, + required this.routingTable, + required this.rpc, + required this.dht, + required this.upnp, + required this.detectAddressChanges, + required this.restrictedNatRetries, + required this.tls, + required this.application, + required this.protocol}); + + factory _$_VeilidConfigNetwork.fromJson(Map json) => + _$$_VeilidConfigNetworkFromJson(json); + + @override + final int connectionInitialTimeoutMs; + @override + final int connectionInactivityTimeoutMs; + @override + final int maxConnectionsPerIp4; + @override + final int maxConnectionsPerIp6Prefix; + @override + final int maxConnectionsPerIp6PrefixSize; + @override + final int maxConnectionFrequencyPerMin; + @override + final int clientWhitelistTimeoutMs; + @override + final int reverseConnectionReceiptTimeMs; + @override + final int holePunchReceiptTimeMs; + @override + final String? networkKeyPassword; + @override + final VeilidConfigRoutingTable routingTable; + @override + final VeilidConfigRPC rpc; + @override + final VeilidConfigDHT dht; + @override + final bool upnp; + @override + final bool detectAddressChanges; + @override + final int restrictedNatRetries; + @override + final VeilidConfigTLS tls; + @override + final VeilidConfigApplication application; + @override + final VeilidConfigProtocol protocol; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigNetwork(connectionInitialTimeoutMs: $connectionInitialTimeoutMs, connectionInactivityTimeoutMs: $connectionInactivityTimeoutMs, maxConnectionsPerIp4: $maxConnectionsPerIp4, maxConnectionsPerIp6Prefix: $maxConnectionsPerIp6Prefix, maxConnectionsPerIp6PrefixSize: $maxConnectionsPerIp6PrefixSize, maxConnectionFrequencyPerMin: $maxConnectionFrequencyPerMin, clientWhitelistTimeoutMs: $clientWhitelistTimeoutMs, reverseConnectionReceiptTimeMs: $reverseConnectionReceiptTimeMs, holePunchReceiptTimeMs: $holePunchReceiptTimeMs, networkKeyPassword: $networkKeyPassword, routingTable: $routingTable, rpc: $rpc, dht: $dht, upnp: $upnp, detectAddressChanges: $detectAddressChanges, restrictedNatRetries: $restrictedNatRetries, tls: $tls, application: $application, protocol: $protocol)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigNetwork')) + ..add(DiagnosticsProperty( + 'connectionInitialTimeoutMs', connectionInitialTimeoutMs)) + ..add(DiagnosticsProperty( + 'connectionInactivityTimeoutMs', connectionInactivityTimeoutMs)) + ..add(DiagnosticsProperty('maxConnectionsPerIp4', maxConnectionsPerIp4)) + ..add(DiagnosticsProperty( + 'maxConnectionsPerIp6Prefix', maxConnectionsPerIp6Prefix)) + ..add(DiagnosticsProperty( + 'maxConnectionsPerIp6PrefixSize', maxConnectionsPerIp6PrefixSize)) + ..add(DiagnosticsProperty( + 'maxConnectionFrequencyPerMin', maxConnectionFrequencyPerMin)) + ..add(DiagnosticsProperty( + 'clientWhitelistTimeoutMs', clientWhitelistTimeoutMs)) + ..add(DiagnosticsProperty( + 'reverseConnectionReceiptTimeMs', reverseConnectionReceiptTimeMs)) + ..add( + DiagnosticsProperty('holePunchReceiptTimeMs', holePunchReceiptTimeMs)) + ..add(DiagnosticsProperty('networkKeyPassword', networkKeyPassword)) + ..add(DiagnosticsProperty('routingTable', routingTable)) + ..add(DiagnosticsProperty('rpc', rpc)) + ..add(DiagnosticsProperty('dht', dht)) + ..add(DiagnosticsProperty('upnp', upnp)) + ..add(DiagnosticsProperty('detectAddressChanges', detectAddressChanges)) + ..add(DiagnosticsProperty('restrictedNatRetries', restrictedNatRetries)) + ..add(DiagnosticsProperty('tls', tls)) + ..add(DiagnosticsProperty('application', application)) + ..add(DiagnosticsProperty('protocol', protocol)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigNetwork && + (identical(other.connectionInitialTimeoutMs, connectionInitialTimeoutMs) || + other.connectionInitialTimeoutMs == + connectionInitialTimeoutMs) && + (identical(other.connectionInactivityTimeoutMs, connectionInactivityTimeoutMs) || + other.connectionInactivityTimeoutMs == + connectionInactivityTimeoutMs) && + (identical(other.maxConnectionsPerIp4, maxConnectionsPerIp4) || + other.maxConnectionsPerIp4 == maxConnectionsPerIp4) && + (identical(other.maxConnectionsPerIp6Prefix, maxConnectionsPerIp6Prefix) || + other.maxConnectionsPerIp6Prefix == + maxConnectionsPerIp6Prefix) && + (identical(other.maxConnectionsPerIp6PrefixSize, maxConnectionsPerIp6PrefixSize) || + other.maxConnectionsPerIp6PrefixSize == + maxConnectionsPerIp6PrefixSize) && + (identical(other.maxConnectionFrequencyPerMin, maxConnectionFrequencyPerMin) || + other.maxConnectionFrequencyPerMin == + maxConnectionFrequencyPerMin) && + (identical(other.clientWhitelistTimeoutMs, clientWhitelistTimeoutMs) || + other.clientWhitelistTimeoutMs == clientWhitelistTimeoutMs) && + (identical(other.reverseConnectionReceiptTimeMs, + reverseConnectionReceiptTimeMs) || + other.reverseConnectionReceiptTimeMs == + reverseConnectionReceiptTimeMs) && + (identical(other.holePunchReceiptTimeMs, holePunchReceiptTimeMs) || + other.holePunchReceiptTimeMs == holePunchReceiptTimeMs) && + (identical(other.networkKeyPassword, networkKeyPassword) || + other.networkKeyPassword == networkKeyPassword) && + (identical(other.routingTable, routingTable) || + other.routingTable == routingTable) && + (identical(other.rpc, rpc) || other.rpc == rpc) && + (identical(other.dht, dht) || other.dht == dht) && + (identical(other.upnp, upnp) || other.upnp == upnp) && + (identical(other.detectAddressChanges, detectAddressChanges) || + other.detectAddressChanges == detectAddressChanges) && + (identical(other.restrictedNatRetries, restrictedNatRetries) || + other.restrictedNatRetries == restrictedNatRetries) && + (identical(other.tls, tls) || other.tls == tls) && + (identical(other.application, application) || + other.application == application) && + (identical(other.protocol, protocol) || + other.protocol == protocol)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hashAll([ + runtimeType, + connectionInitialTimeoutMs, + connectionInactivityTimeoutMs, + maxConnectionsPerIp4, + maxConnectionsPerIp6Prefix, + maxConnectionsPerIp6PrefixSize, + maxConnectionFrequencyPerMin, + clientWhitelistTimeoutMs, + reverseConnectionReceiptTimeMs, + holePunchReceiptTimeMs, + networkKeyPassword, + routingTable, + rpc, + dht, + upnp, + detectAddressChanges, + restrictedNatRetries, + tls, + application, + protocol + ]); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigNetworkCopyWith<_$_VeilidConfigNetwork> get copyWith => + __$$_VeilidConfigNetworkCopyWithImpl<_$_VeilidConfigNetwork>( + this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigNetworkToJson( + this, + ); + } +} + +abstract class _VeilidConfigNetwork implements VeilidConfigNetwork { + const factory _VeilidConfigNetwork( + {required final int connectionInitialTimeoutMs, + required final int connectionInactivityTimeoutMs, + required final int maxConnectionsPerIp4, + required final int maxConnectionsPerIp6Prefix, + required final int maxConnectionsPerIp6PrefixSize, + required final int maxConnectionFrequencyPerMin, + required final int clientWhitelistTimeoutMs, + required final int reverseConnectionReceiptTimeMs, + required final int holePunchReceiptTimeMs, + final String? networkKeyPassword, + required final VeilidConfigRoutingTable routingTable, + required final VeilidConfigRPC rpc, + required final VeilidConfigDHT dht, + required final bool upnp, + required final bool detectAddressChanges, + required final int restrictedNatRetries, + required final VeilidConfigTLS tls, + required final VeilidConfigApplication application, + required final VeilidConfigProtocol protocol}) = _$_VeilidConfigNetwork; + + factory _VeilidConfigNetwork.fromJson(Map json) = + _$_VeilidConfigNetwork.fromJson; + + @override + int get connectionInitialTimeoutMs; + @override + int get connectionInactivityTimeoutMs; + @override + int get maxConnectionsPerIp4; + @override + int get maxConnectionsPerIp6Prefix; + @override + int get maxConnectionsPerIp6PrefixSize; + @override + int get maxConnectionFrequencyPerMin; + @override + int get clientWhitelistTimeoutMs; + @override + int get reverseConnectionReceiptTimeMs; + @override + int get holePunchReceiptTimeMs; + @override + String? get networkKeyPassword; + @override + VeilidConfigRoutingTable get routingTable; + @override + VeilidConfigRPC get rpc; + @override + VeilidConfigDHT get dht; + @override + bool get upnp; + @override + bool get detectAddressChanges; + @override + int get restrictedNatRetries; + @override + VeilidConfigTLS get tls; + @override + VeilidConfigApplication get application; + @override + VeilidConfigProtocol get protocol; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigNetworkCopyWith<_$_VeilidConfigNetwork> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidConfigTableStore _$VeilidConfigTableStoreFromJson( + Map json) { + return _VeilidConfigTableStore.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigTableStore { + String get directory => throw _privateConstructorUsedError; + bool get delete => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigTableStoreCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigTableStoreCopyWith<$Res> { + factory $VeilidConfigTableStoreCopyWith(VeilidConfigTableStore value, + $Res Function(VeilidConfigTableStore) then) = + _$VeilidConfigTableStoreCopyWithImpl<$Res, VeilidConfigTableStore>; + @useResult + $Res call({String directory, bool delete}); +} + +/// @nodoc +class _$VeilidConfigTableStoreCopyWithImpl<$Res, + $Val extends VeilidConfigTableStore> + implements $VeilidConfigTableStoreCopyWith<$Res> { + _$VeilidConfigTableStoreCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? directory = null, + Object? delete = null, + }) { + return _then(_value.copyWith( + directory: null == directory + ? _value.directory + : directory // ignore: cast_nullable_to_non_nullable + as String, + delete: null == delete + ? _value.delete + : delete // ignore: cast_nullable_to_non_nullable + as bool, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigTableStoreCopyWith<$Res> + implements $VeilidConfigTableStoreCopyWith<$Res> { + factory _$$_VeilidConfigTableStoreCopyWith(_$_VeilidConfigTableStore value, + $Res Function(_$_VeilidConfigTableStore) then) = + __$$_VeilidConfigTableStoreCopyWithImpl<$Res>; + @override + @useResult + $Res call({String directory, bool delete}); +} + +/// @nodoc +class __$$_VeilidConfigTableStoreCopyWithImpl<$Res> + extends _$VeilidConfigTableStoreCopyWithImpl<$Res, + _$_VeilidConfigTableStore> + implements _$$_VeilidConfigTableStoreCopyWith<$Res> { + __$$_VeilidConfigTableStoreCopyWithImpl(_$_VeilidConfigTableStore _value, + $Res Function(_$_VeilidConfigTableStore) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? directory = null, + Object? delete = null, + }) { + return _then(_$_VeilidConfigTableStore( + directory: null == directory + ? _value.directory + : directory // ignore: cast_nullable_to_non_nullable + as String, + delete: null == delete + ? _value.delete + : delete // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigTableStore + with DiagnosticableTreeMixin + implements _VeilidConfigTableStore { + const _$_VeilidConfigTableStore( + {required this.directory, required this.delete}); + + factory _$_VeilidConfigTableStore.fromJson(Map json) => + _$$_VeilidConfigTableStoreFromJson(json); + + @override + final String directory; + @override + final bool delete; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigTableStore(directory: $directory, delete: $delete)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigTableStore')) + ..add(DiagnosticsProperty('directory', directory)) + ..add(DiagnosticsProperty('delete', delete)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigTableStore && + (identical(other.directory, directory) || + other.directory == directory) && + (identical(other.delete, delete) || other.delete == delete)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, directory, delete); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigTableStoreCopyWith<_$_VeilidConfigTableStore> get copyWith => + __$$_VeilidConfigTableStoreCopyWithImpl<_$_VeilidConfigTableStore>( + this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigTableStoreToJson( + this, + ); + } +} + +abstract class _VeilidConfigTableStore implements VeilidConfigTableStore { + const factory _VeilidConfigTableStore( + {required final String directory, + required final bool delete}) = _$_VeilidConfigTableStore; + + factory _VeilidConfigTableStore.fromJson(Map json) = + _$_VeilidConfigTableStore.fromJson; + + @override + String get directory; + @override + bool get delete; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigTableStoreCopyWith<_$_VeilidConfigTableStore> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidConfigBlockStore _$VeilidConfigBlockStoreFromJson( + Map json) { + return _VeilidConfigBlockStore.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigBlockStore { + String get directory => throw _privateConstructorUsedError; + bool get delete => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigBlockStoreCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigBlockStoreCopyWith<$Res> { + factory $VeilidConfigBlockStoreCopyWith(VeilidConfigBlockStore value, + $Res Function(VeilidConfigBlockStore) then) = + _$VeilidConfigBlockStoreCopyWithImpl<$Res, VeilidConfigBlockStore>; + @useResult + $Res call({String directory, bool delete}); +} + +/// @nodoc +class _$VeilidConfigBlockStoreCopyWithImpl<$Res, + $Val extends VeilidConfigBlockStore> + implements $VeilidConfigBlockStoreCopyWith<$Res> { + _$VeilidConfigBlockStoreCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? directory = null, + Object? delete = null, + }) { + return _then(_value.copyWith( + directory: null == directory + ? _value.directory + : directory // ignore: cast_nullable_to_non_nullable + as String, + delete: null == delete + ? _value.delete + : delete // ignore: cast_nullable_to_non_nullable + as bool, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigBlockStoreCopyWith<$Res> + implements $VeilidConfigBlockStoreCopyWith<$Res> { + factory _$$_VeilidConfigBlockStoreCopyWith(_$_VeilidConfigBlockStore value, + $Res Function(_$_VeilidConfigBlockStore) then) = + __$$_VeilidConfigBlockStoreCopyWithImpl<$Res>; + @override + @useResult + $Res call({String directory, bool delete}); +} + +/// @nodoc +class __$$_VeilidConfigBlockStoreCopyWithImpl<$Res> + extends _$VeilidConfigBlockStoreCopyWithImpl<$Res, + _$_VeilidConfigBlockStore> + implements _$$_VeilidConfigBlockStoreCopyWith<$Res> { + __$$_VeilidConfigBlockStoreCopyWithImpl(_$_VeilidConfigBlockStore _value, + $Res Function(_$_VeilidConfigBlockStore) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? directory = null, + Object? delete = null, + }) { + return _then(_$_VeilidConfigBlockStore( + directory: null == directory + ? _value.directory + : directory // ignore: cast_nullable_to_non_nullable + as String, + delete: null == delete + ? _value.delete + : delete // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigBlockStore + with DiagnosticableTreeMixin + implements _VeilidConfigBlockStore { + const _$_VeilidConfigBlockStore( + {required this.directory, required this.delete}); + + factory _$_VeilidConfigBlockStore.fromJson(Map json) => + _$$_VeilidConfigBlockStoreFromJson(json); + + @override + final String directory; + @override + final bool delete; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigBlockStore(directory: $directory, delete: $delete)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigBlockStore')) + ..add(DiagnosticsProperty('directory', directory)) + ..add(DiagnosticsProperty('delete', delete)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigBlockStore && + (identical(other.directory, directory) || + other.directory == directory) && + (identical(other.delete, delete) || other.delete == delete)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, directory, delete); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigBlockStoreCopyWith<_$_VeilidConfigBlockStore> get copyWith => + __$$_VeilidConfigBlockStoreCopyWithImpl<_$_VeilidConfigBlockStore>( + this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigBlockStoreToJson( + this, + ); + } +} + +abstract class _VeilidConfigBlockStore implements VeilidConfigBlockStore { + const factory _VeilidConfigBlockStore( + {required final String directory, + required final bool delete}) = _$_VeilidConfigBlockStore; + + factory _VeilidConfigBlockStore.fromJson(Map json) = + _$_VeilidConfigBlockStore.fromJson; + + @override + String get directory; + @override + bool get delete; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigBlockStoreCopyWith<_$_VeilidConfigBlockStore> get copyWith => + throw _privateConstructorUsedError; +} + +VeilidConfigProtectedStore _$VeilidConfigProtectedStoreFromJson( + Map json) { + return _VeilidConfigProtectedStore.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigProtectedStore { + bool get allowInsecureFallback => throw _privateConstructorUsedError; + bool get alwaysUseInsecureStorage => throw _privateConstructorUsedError; + String get directory => throw _privateConstructorUsedError; + bool get delete => throw _privateConstructorUsedError; + String get deviceEncryptionKeyPassword => throw _privateConstructorUsedError; + String? get newDeviceEncryptionKeyPassword => + throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigProtectedStoreCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigProtectedStoreCopyWith<$Res> { + factory $VeilidConfigProtectedStoreCopyWith(VeilidConfigProtectedStore value, + $Res Function(VeilidConfigProtectedStore) then) = + _$VeilidConfigProtectedStoreCopyWithImpl<$Res, + VeilidConfigProtectedStore>; + @useResult + $Res call( + {bool allowInsecureFallback, + bool alwaysUseInsecureStorage, + String directory, + bool delete, + String deviceEncryptionKeyPassword, + String? newDeviceEncryptionKeyPassword}); +} + +/// @nodoc +class _$VeilidConfigProtectedStoreCopyWithImpl<$Res, + $Val extends VeilidConfigProtectedStore> + implements $VeilidConfigProtectedStoreCopyWith<$Res> { + _$VeilidConfigProtectedStoreCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? allowInsecureFallback = null, + Object? alwaysUseInsecureStorage = null, + Object? directory = null, + Object? delete = null, + Object? deviceEncryptionKeyPassword = null, + Object? newDeviceEncryptionKeyPassword = freezed, + }) { + return _then(_value.copyWith( + allowInsecureFallback: null == allowInsecureFallback + ? _value.allowInsecureFallback + : allowInsecureFallback // ignore: cast_nullable_to_non_nullable + as bool, + alwaysUseInsecureStorage: null == alwaysUseInsecureStorage + ? _value.alwaysUseInsecureStorage + : alwaysUseInsecureStorage // ignore: cast_nullable_to_non_nullable + as bool, + directory: null == directory + ? _value.directory + : directory // ignore: cast_nullable_to_non_nullable + as String, + delete: null == delete + ? _value.delete + : delete // ignore: cast_nullable_to_non_nullable + as bool, + deviceEncryptionKeyPassword: null == deviceEncryptionKeyPassword + ? _value.deviceEncryptionKeyPassword + : deviceEncryptionKeyPassword // ignore: cast_nullable_to_non_nullable + as String, + newDeviceEncryptionKeyPassword: freezed == newDeviceEncryptionKeyPassword + ? _value.newDeviceEncryptionKeyPassword + : newDeviceEncryptionKeyPassword // ignore: cast_nullable_to_non_nullable + as String?, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigProtectedStoreCopyWith<$Res> + implements $VeilidConfigProtectedStoreCopyWith<$Res> { + factory _$$_VeilidConfigProtectedStoreCopyWith( + _$_VeilidConfigProtectedStore value, + $Res Function(_$_VeilidConfigProtectedStore) then) = + __$$_VeilidConfigProtectedStoreCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {bool allowInsecureFallback, + bool alwaysUseInsecureStorage, + String directory, + bool delete, + String deviceEncryptionKeyPassword, + String? newDeviceEncryptionKeyPassword}); +} + +/// @nodoc +class __$$_VeilidConfigProtectedStoreCopyWithImpl<$Res> + extends _$VeilidConfigProtectedStoreCopyWithImpl<$Res, + _$_VeilidConfigProtectedStore> + implements _$$_VeilidConfigProtectedStoreCopyWith<$Res> { + __$$_VeilidConfigProtectedStoreCopyWithImpl( + _$_VeilidConfigProtectedStore _value, + $Res Function(_$_VeilidConfigProtectedStore) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? allowInsecureFallback = null, + Object? alwaysUseInsecureStorage = null, + Object? directory = null, + Object? delete = null, + Object? deviceEncryptionKeyPassword = null, + Object? newDeviceEncryptionKeyPassword = freezed, + }) { + return _then(_$_VeilidConfigProtectedStore( + allowInsecureFallback: null == allowInsecureFallback + ? _value.allowInsecureFallback + : allowInsecureFallback // ignore: cast_nullable_to_non_nullable + as bool, + alwaysUseInsecureStorage: null == alwaysUseInsecureStorage + ? _value.alwaysUseInsecureStorage + : alwaysUseInsecureStorage // ignore: cast_nullable_to_non_nullable + as bool, + directory: null == directory + ? _value.directory + : directory // ignore: cast_nullable_to_non_nullable + as String, + delete: null == delete + ? _value.delete + : delete // ignore: cast_nullable_to_non_nullable + as bool, + deviceEncryptionKeyPassword: null == deviceEncryptionKeyPassword + ? _value.deviceEncryptionKeyPassword + : deviceEncryptionKeyPassword // ignore: cast_nullable_to_non_nullable + as String, + newDeviceEncryptionKeyPassword: freezed == newDeviceEncryptionKeyPassword + ? _value.newDeviceEncryptionKeyPassword + : newDeviceEncryptionKeyPassword // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigProtectedStore + with DiagnosticableTreeMixin + implements _VeilidConfigProtectedStore { + const _$_VeilidConfigProtectedStore( + {required this.allowInsecureFallback, + required this.alwaysUseInsecureStorage, + required this.directory, + required this.delete, + required this.deviceEncryptionKeyPassword, + this.newDeviceEncryptionKeyPassword}); + + factory _$_VeilidConfigProtectedStore.fromJson(Map json) => + _$$_VeilidConfigProtectedStoreFromJson(json); + + @override + final bool allowInsecureFallback; + @override + final bool alwaysUseInsecureStorage; + @override + final String directory; + @override + final bool delete; + @override + final String deviceEncryptionKeyPassword; + @override + final String? newDeviceEncryptionKeyPassword; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigProtectedStore(allowInsecureFallback: $allowInsecureFallback, alwaysUseInsecureStorage: $alwaysUseInsecureStorage, directory: $directory, delete: $delete, deviceEncryptionKeyPassword: $deviceEncryptionKeyPassword, newDeviceEncryptionKeyPassword: $newDeviceEncryptionKeyPassword)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigProtectedStore')) + ..add(DiagnosticsProperty('allowInsecureFallback', allowInsecureFallback)) + ..add(DiagnosticsProperty( + 'alwaysUseInsecureStorage', alwaysUseInsecureStorage)) + ..add(DiagnosticsProperty('directory', directory)) + ..add(DiagnosticsProperty('delete', delete)) + ..add(DiagnosticsProperty( + 'deviceEncryptionKeyPassword', deviceEncryptionKeyPassword)) + ..add(DiagnosticsProperty( + 'newDeviceEncryptionKeyPassword', newDeviceEncryptionKeyPassword)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigProtectedStore && + (identical(other.allowInsecureFallback, allowInsecureFallback) || + other.allowInsecureFallback == allowInsecureFallback) && + (identical( + other.alwaysUseInsecureStorage, alwaysUseInsecureStorage) || + other.alwaysUseInsecureStorage == alwaysUseInsecureStorage) && + (identical(other.directory, directory) || + other.directory == directory) && + (identical(other.delete, delete) || other.delete == delete) && + (identical(other.deviceEncryptionKeyPassword, + deviceEncryptionKeyPassword) || + other.deviceEncryptionKeyPassword == + deviceEncryptionKeyPassword) && + (identical(other.newDeviceEncryptionKeyPassword, + newDeviceEncryptionKeyPassword) || + other.newDeviceEncryptionKeyPassword == + newDeviceEncryptionKeyPassword)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash( + runtimeType, + allowInsecureFallback, + alwaysUseInsecureStorage, + directory, + delete, + deviceEncryptionKeyPassword, + newDeviceEncryptionKeyPassword); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigProtectedStoreCopyWith<_$_VeilidConfigProtectedStore> + get copyWith => __$$_VeilidConfigProtectedStoreCopyWithImpl< + _$_VeilidConfigProtectedStore>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigProtectedStoreToJson( + this, + ); + } +} + +abstract class _VeilidConfigProtectedStore + implements VeilidConfigProtectedStore { + const factory _VeilidConfigProtectedStore( + {required final bool allowInsecureFallback, + required final bool alwaysUseInsecureStorage, + required final String directory, + required final bool delete, + required final String deviceEncryptionKeyPassword, + final String? newDeviceEncryptionKeyPassword}) = + _$_VeilidConfigProtectedStore; + + factory _VeilidConfigProtectedStore.fromJson(Map json) = + _$_VeilidConfigProtectedStore.fromJson; + + @override + bool get allowInsecureFallback; + @override + bool get alwaysUseInsecureStorage; + @override + String get directory; + @override + bool get delete; + @override + String get deviceEncryptionKeyPassword; + @override + String? get newDeviceEncryptionKeyPassword; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigProtectedStoreCopyWith<_$_VeilidConfigProtectedStore> + get copyWith => throw _privateConstructorUsedError; +} + +VeilidConfigCapabilities _$VeilidConfigCapabilitiesFromJson( + Map json) { + return _VeilidConfigCapabilities.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfigCapabilities { + List get disable => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigCapabilitiesCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigCapabilitiesCopyWith<$Res> { + factory $VeilidConfigCapabilitiesCopyWith(VeilidConfigCapabilities value, + $Res Function(VeilidConfigCapabilities) then) = + _$VeilidConfigCapabilitiesCopyWithImpl<$Res, VeilidConfigCapabilities>; + @useResult + $Res call({List disable}); +} + +/// @nodoc +class _$VeilidConfigCapabilitiesCopyWithImpl<$Res, + $Val extends VeilidConfigCapabilities> + implements $VeilidConfigCapabilitiesCopyWith<$Res> { + _$VeilidConfigCapabilitiesCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? disable = null, + }) { + return _then(_value.copyWith( + disable: null == disable + ? _value.disable + : disable // ignore: cast_nullable_to_non_nullable + as List, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigCapabilitiesCopyWith<$Res> + implements $VeilidConfigCapabilitiesCopyWith<$Res> { + factory _$$_VeilidConfigCapabilitiesCopyWith( + _$_VeilidConfigCapabilities value, + $Res Function(_$_VeilidConfigCapabilities) then) = + __$$_VeilidConfigCapabilitiesCopyWithImpl<$Res>; + @override + @useResult + $Res call({List disable}); +} + +/// @nodoc +class __$$_VeilidConfigCapabilitiesCopyWithImpl<$Res> + extends _$VeilidConfigCapabilitiesCopyWithImpl<$Res, + _$_VeilidConfigCapabilities> + implements _$$_VeilidConfigCapabilitiesCopyWith<$Res> { + __$$_VeilidConfigCapabilitiesCopyWithImpl(_$_VeilidConfigCapabilities _value, + $Res Function(_$_VeilidConfigCapabilities) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? disable = null, + }) { + return _then(_$_VeilidConfigCapabilities( + disable: null == disable + ? _value._disable + : disable // ignore: cast_nullable_to_non_nullable + as List, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfigCapabilities + with DiagnosticableTreeMixin + implements _VeilidConfigCapabilities { + const _$_VeilidConfigCapabilities({required final List disable}) + : _disable = disable; + + factory _$_VeilidConfigCapabilities.fromJson(Map json) => + _$$_VeilidConfigCapabilitiesFromJson(json); + + final List _disable; + @override + List get disable { + if (_disable is EqualUnmodifiableListView) return _disable; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_disable); + } + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigCapabilities(disable: $disable)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigCapabilities')) + ..add(DiagnosticsProperty('disable', disable)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfigCapabilities && + const DeepCollectionEquality().equals(other._disable, _disable)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => + Object.hash(runtimeType, const DeepCollectionEquality().hash(_disable)); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigCapabilitiesCopyWith<_$_VeilidConfigCapabilities> + get copyWith => __$$_VeilidConfigCapabilitiesCopyWithImpl< + _$_VeilidConfigCapabilities>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigCapabilitiesToJson( + this, + ); + } +} + +abstract class _VeilidConfigCapabilities implements VeilidConfigCapabilities { + const factory _VeilidConfigCapabilities( + {required final List disable}) = _$_VeilidConfigCapabilities; + + factory _VeilidConfigCapabilities.fromJson(Map json) = + _$_VeilidConfigCapabilities.fromJson; + + @override + List get disable; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigCapabilitiesCopyWith<_$_VeilidConfigCapabilities> + get copyWith => throw _privateConstructorUsedError; +} + +VeilidConfig _$VeilidConfigFromJson(Map json) { + return _VeilidConfig.fromJson(json); +} + +/// @nodoc +mixin _$VeilidConfig { + String get programName => throw _privateConstructorUsedError; + String get namespace => throw _privateConstructorUsedError; + VeilidConfigCapabilities get capabilities => + throw _privateConstructorUsedError; + VeilidConfigProtectedStore get protectedStore => + throw _privateConstructorUsedError; + VeilidConfigTableStore get tableStore => throw _privateConstructorUsedError; + VeilidConfigBlockStore get blockStore => throw _privateConstructorUsedError; + VeilidConfigNetwork get network => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $VeilidConfigCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $VeilidConfigCopyWith<$Res> { + factory $VeilidConfigCopyWith( + VeilidConfig value, $Res Function(VeilidConfig) then) = + _$VeilidConfigCopyWithImpl<$Res, VeilidConfig>; + @useResult + $Res call( + {String programName, + String namespace, + VeilidConfigCapabilities capabilities, + VeilidConfigProtectedStore protectedStore, + VeilidConfigTableStore tableStore, + VeilidConfigBlockStore blockStore, + VeilidConfigNetwork network}); + + $VeilidConfigCapabilitiesCopyWith<$Res> get capabilities; + $VeilidConfigProtectedStoreCopyWith<$Res> get protectedStore; + $VeilidConfigTableStoreCopyWith<$Res> get tableStore; + $VeilidConfigBlockStoreCopyWith<$Res> get blockStore; + $VeilidConfigNetworkCopyWith<$Res> get network; +} + +/// @nodoc +class _$VeilidConfigCopyWithImpl<$Res, $Val extends VeilidConfig> + implements $VeilidConfigCopyWith<$Res> { + _$VeilidConfigCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? programName = null, + Object? namespace = null, + Object? capabilities = null, + Object? protectedStore = null, + Object? tableStore = null, + Object? blockStore = null, + Object? network = null, + }) { + return _then(_value.copyWith( + programName: null == programName + ? _value.programName + : programName // ignore: cast_nullable_to_non_nullable + as String, + namespace: null == namespace + ? _value.namespace + : namespace // ignore: cast_nullable_to_non_nullable + as String, + capabilities: null == capabilities + ? _value.capabilities + : capabilities // ignore: cast_nullable_to_non_nullable + as VeilidConfigCapabilities, + protectedStore: null == protectedStore + ? _value.protectedStore + : protectedStore // ignore: cast_nullable_to_non_nullable + as VeilidConfigProtectedStore, + tableStore: null == tableStore + ? _value.tableStore + : tableStore // ignore: cast_nullable_to_non_nullable + as VeilidConfigTableStore, + blockStore: null == blockStore + ? _value.blockStore + : blockStore // ignore: cast_nullable_to_non_nullable + as VeilidConfigBlockStore, + network: null == network + ? _value.network + : network // ignore: cast_nullable_to_non_nullable + as VeilidConfigNetwork, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigCapabilitiesCopyWith<$Res> get capabilities { + return $VeilidConfigCapabilitiesCopyWith<$Res>(_value.capabilities, + (value) { + return _then(_value.copyWith(capabilities: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigProtectedStoreCopyWith<$Res> get protectedStore { + return $VeilidConfigProtectedStoreCopyWith<$Res>(_value.protectedStore, + (value) { + return _then(_value.copyWith(protectedStore: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigTableStoreCopyWith<$Res> get tableStore { + return $VeilidConfigTableStoreCopyWith<$Res>(_value.tableStore, (value) { + return _then(_value.copyWith(tableStore: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigBlockStoreCopyWith<$Res> get blockStore { + return $VeilidConfigBlockStoreCopyWith<$Res>(_value.blockStore, (value) { + return _then(_value.copyWith(blockStore: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $VeilidConfigNetworkCopyWith<$Res> get network { + return $VeilidConfigNetworkCopyWith<$Res>(_value.network, (value) { + return _then(_value.copyWith(network: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$_VeilidConfigCopyWith<$Res> + implements $VeilidConfigCopyWith<$Res> { + factory _$$_VeilidConfigCopyWith( + _$_VeilidConfig value, $Res Function(_$_VeilidConfig) then) = + __$$_VeilidConfigCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {String programName, + String namespace, + VeilidConfigCapabilities capabilities, + VeilidConfigProtectedStore protectedStore, + VeilidConfigTableStore tableStore, + VeilidConfigBlockStore blockStore, + VeilidConfigNetwork network}); + + @override + $VeilidConfigCapabilitiesCopyWith<$Res> get capabilities; + @override + $VeilidConfigProtectedStoreCopyWith<$Res> get protectedStore; + @override + $VeilidConfigTableStoreCopyWith<$Res> get tableStore; + @override + $VeilidConfigBlockStoreCopyWith<$Res> get blockStore; + @override + $VeilidConfigNetworkCopyWith<$Res> get network; +} + +/// @nodoc +class __$$_VeilidConfigCopyWithImpl<$Res> + extends _$VeilidConfigCopyWithImpl<$Res, _$_VeilidConfig> + implements _$$_VeilidConfigCopyWith<$Res> { + __$$_VeilidConfigCopyWithImpl( + _$_VeilidConfig _value, $Res Function(_$_VeilidConfig) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? programName = null, + Object? namespace = null, + Object? capabilities = null, + Object? protectedStore = null, + Object? tableStore = null, + Object? blockStore = null, + Object? network = null, + }) { + return _then(_$_VeilidConfig( + programName: null == programName + ? _value.programName + : programName // ignore: cast_nullable_to_non_nullable + as String, + namespace: null == namespace + ? _value.namespace + : namespace // ignore: cast_nullable_to_non_nullable + as String, + capabilities: null == capabilities + ? _value.capabilities + : capabilities // ignore: cast_nullable_to_non_nullable + as VeilidConfigCapabilities, + protectedStore: null == protectedStore + ? _value.protectedStore + : protectedStore // ignore: cast_nullable_to_non_nullable + as VeilidConfigProtectedStore, + tableStore: null == tableStore + ? _value.tableStore + : tableStore // ignore: cast_nullable_to_non_nullable + as VeilidConfigTableStore, + blockStore: null == blockStore + ? _value.blockStore + : blockStore // ignore: cast_nullable_to_non_nullable + as VeilidConfigBlockStore, + network: null == network + ? _value.network + : network // ignore: cast_nullable_to_non_nullable + as VeilidConfigNetwork, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_VeilidConfig with DiagnosticableTreeMixin implements _VeilidConfig { + const _$_VeilidConfig( + {required this.programName, + required this.namespace, + required this.capabilities, + required this.protectedStore, + required this.tableStore, + required this.blockStore, + required this.network}); + + factory _$_VeilidConfig.fromJson(Map json) => + _$$_VeilidConfigFromJson(json); + + @override + final String programName; + @override + final String namespace; + @override + final VeilidConfigCapabilities capabilities; + @override + final VeilidConfigProtectedStore protectedStore; + @override + final VeilidConfigTableStore tableStore; + @override + final VeilidConfigBlockStore blockStore; + @override + final VeilidConfigNetwork network; + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfig(programName: $programName, namespace: $namespace, capabilities: $capabilities, protectedStore: $protectedStore, tableStore: $tableStore, blockStore: $blockStore, network: $network)'; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfig')) + ..add(DiagnosticsProperty('programName', programName)) + ..add(DiagnosticsProperty('namespace', namespace)) + ..add(DiagnosticsProperty('capabilities', capabilities)) + ..add(DiagnosticsProperty('protectedStore', protectedStore)) + ..add(DiagnosticsProperty('tableStore', tableStore)) + ..add(DiagnosticsProperty('blockStore', blockStore)) + ..add(DiagnosticsProperty('network', network)); + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_VeilidConfig && + (identical(other.programName, programName) || + other.programName == programName) && + (identical(other.namespace, namespace) || + other.namespace == namespace) && + (identical(other.capabilities, capabilities) || + other.capabilities == capabilities) && + (identical(other.protectedStore, protectedStore) || + other.protectedStore == protectedStore) && + (identical(other.tableStore, tableStore) || + other.tableStore == tableStore) && + (identical(other.blockStore, blockStore) || + other.blockStore == blockStore) && + (identical(other.network, network) || other.network == network)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, programName, namespace, + capabilities, protectedStore, tableStore, blockStore, network); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_VeilidConfigCopyWith<_$_VeilidConfig> get copyWith => + __$$_VeilidConfigCopyWithImpl<_$_VeilidConfig>(this, _$identity); + + @override + Map toJson() { + return _$$_VeilidConfigToJson( + this, + ); + } +} + +abstract class _VeilidConfig implements VeilidConfig { + const factory _VeilidConfig( + {required final String programName, + required final String namespace, + required final VeilidConfigCapabilities capabilities, + required final VeilidConfigProtectedStore protectedStore, + required final VeilidConfigTableStore tableStore, + required final VeilidConfigBlockStore blockStore, + required final VeilidConfigNetwork network}) = _$_VeilidConfig; + + factory _VeilidConfig.fromJson(Map json) = + _$_VeilidConfig.fromJson; + + @override + String get programName; + @override + String get namespace; + @override + VeilidConfigCapabilities get capabilities; + @override + VeilidConfigProtectedStore get protectedStore; + @override + VeilidConfigTableStore get tableStore; + @override + VeilidConfigBlockStore get blockStore; + @override + VeilidConfigNetwork get network; + @override + @JsonKey(ignore: true) + _$$_VeilidConfigCopyWith<_$_VeilidConfig> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/veilid-flutter/lib/veilid_config.g.dart b/veilid-flutter/lib/veilid_config.g.dart new file mode 100644 index 00000000..fed9bae0 --- /dev/null +++ b/veilid-flutter/lib/veilid_config.g.dart @@ -0,0 +1,550 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'veilid_config.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$_VeilidFFIConfigLoggingTerminal _$$_VeilidFFIConfigLoggingTerminalFromJson( + Map json) => + _$_VeilidFFIConfigLoggingTerminal( + enabled: json['enabled'] as bool, + level: VeilidConfigLogLevel.fromJson(json['level']), + ); + +Map _$$_VeilidFFIConfigLoggingTerminalToJson( + _$_VeilidFFIConfigLoggingTerminal instance) => + { + 'enabled': instance.enabled, + 'level': instance.level.toJson(), + }; + +_$_VeilidFFIConfigLoggingOtlp _$$_VeilidFFIConfigLoggingOtlpFromJson( + Map json) => + _$_VeilidFFIConfigLoggingOtlp( + enabled: json['enabled'] as bool, + level: VeilidConfigLogLevel.fromJson(json['level']), + grpcEndpoint: json['grpc_endpoint'] as String, + serviceName: json['service_name'] as String, + ); + +Map _$$_VeilidFFIConfigLoggingOtlpToJson( + _$_VeilidFFIConfigLoggingOtlp instance) => + { + 'enabled': instance.enabled, + 'level': instance.level.toJson(), + 'grpc_endpoint': instance.grpcEndpoint, + 'service_name': instance.serviceName, + }; + +_$_VeilidFFIConfigLoggingApi _$$_VeilidFFIConfigLoggingApiFromJson( + Map json) => + _$_VeilidFFIConfigLoggingApi( + enabled: json['enabled'] as bool, + level: VeilidConfigLogLevel.fromJson(json['level']), + ); + +Map _$$_VeilidFFIConfigLoggingApiToJson( + _$_VeilidFFIConfigLoggingApi instance) => + { + 'enabled': instance.enabled, + 'level': instance.level.toJson(), + }; + +_$_VeilidFFIConfigLogging _$$_VeilidFFIConfigLoggingFromJson( + Map json) => + _$_VeilidFFIConfigLogging( + terminal: VeilidFFIConfigLoggingTerminal.fromJson( + json['terminal'] as Map), + otlp: VeilidFFIConfigLoggingOtlp.fromJson( + json['otlp'] as Map), + api: VeilidFFIConfigLoggingApi.fromJson( + json['api'] as Map), + ); + +Map _$$_VeilidFFIConfigLoggingToJson( + _$_VeilidFFIConfigLogging instance) => + { + 'terminal': instance.terminal.toJson(), + 'otlp': instance.otlp.toJson(), + 'api': instance.api.toJson(), + }; + +_$_VeilidFFIConfig _$$_VeilidFFIConfigFromJson(Map json) => + _$_VeilidFFIConfig( + logging: VeilidFFIConfigLogging.fromJson( + json['logging'] as Map), + ); + +Map _$$_VeilidFFIConfigToJson(_$_VeilidFFIConfig instance) => + { + 'logging': instance.logging.toJson(), + }; + +_$_VeilidWASMConfigLoggingPerformance + _$$_VeilidWASMConfigLoggingPerformanceFromJson(Map json) => + _$_VeilidWASMConfigLoggingPerformance( + enabled: json['enabled'] as bool, + level: VeilidConfigLogLevel.fromJson(json['level']), + logsInTimings: json['logs_in_timings'] as bool, + logsInConsole: json['logs_in_console'] as bool, + ); + +Map _$$_VeilidWASMConfigLoggingPerformanceToJson( + _$_VeilidWASMConfigLoggingPerformance instance) => + { + 'enabled': instance.enabled, + 'level': instance.level.toJson(), + 'logs_in_timings': instance.logsInTimings, + 'logs_in_console': instance.logsInConsole, + }; + +_$_VeilidWASMConfigLoggingApi _$$_VeilidWASMConfigLoggingApiFromJson( + Map json) => + _$_VeilidWASMConfigLoggingApi( + enabled: json['enabled'] as bool, + level: VeilidConfigLogLevel.fromJson(json['level']), + ); + +Map _$$_VeilidWASMConfigLoggingApiToJson( + _$_VeilidWASMConfigLoggingApi instance) => + { + 'enabled': instance.enabled, + 'level': instance.level.toJson(), + }; + +_$_VeilidWASMConfigLogging _$$_VeilidWASMConfigLoggingFromJson( + Map json) => + _$_VeilidWASMConfigLogging( + performance: VeilidWASMConfigLoggingPerformance.fromJson( + json['performance'] as Map), + api: VeilidWASMConfigLoggingApi.fromJson( + json['api'] as Map), + ); + +Map _$$_VeilidWASMConfigLoggingToJson( + _$_VeilidWASMConfigLogging instance) => + { + 'performance': instance.performance.toJson(), + 'api': instance.api.toJson(), + }; + +_$_VeilidWASMConfig _$$_VeilidWASMConfigFromJson(Map json) => + _$_VeilidWASMConfig( + logging: VeilidWASMConfigLogging.fromJson( + json['logging'] as Map), + ); + +Map _$$_VeilidWASMConfigToJson(_$_VeilidWASMConfig instance) => + { + 'logging': instance.logging.toJson(), + }; + +_$_VeilidConfigHTTPS _$$_VeilidConfigHTTPSFromJson(Map json) => + _$_VeilidConfigHTTPS( + enabled: json['enabled'] as bool, + listenAddress: json['listen_address'] as String, + path: json['path'] as String, + url: json['url'] as String?, + ); + +Map _$$_VeilidConfigHTTPSToJson( + _$_VeilidConfigHTTPS instance) => + { + 'enabled': instance.enabled, + 'listen_address': instance.listenAddress, + 'path': instance.path, + 'url': instance.url, + }; + +_$_VeilidConfigHTTP _$$_VeilidConfigHTTPFromJson(Map json) => + _$_VeilidConfigHTTP( + enabled: json['enabled'] as bool, + listenAddress: json['listen_address'] as String, + path: json['path'] as String, + url: json['url'] as String?, + ); + +Map _$$_VeilidConfigHTTPToJson(_$_VeilidConfigHTTP instance) => + { + 'enabled': instance.enabled, + 'listen_address': instance.listenAddress, + 'path': instance.path, + 'url': instance.url, + }; + +_$_VeilidConfigApplication _$$_VeilidConfigApplicationFromJson( + Map json) => + _$_VeilidConfigApplication( + https: VeilidConfigHTTPS.fromJson(json['https'] as Map), + http: VeilidConfigHTTP.fromJson(json['http'] as Map), + ); + +Map _$$_VeilidConfigApplicationToJson( + _$_VeilidConfigApplication instance) => + { + 'https': instance.https.toJson(), + 'http': instance.http.toJson(), + }; + +_$_VeilidConfigUDP _$$_VeilidConfigUDPFromJson(Map json) => + _$_VeilidConfigUDP( + enabled: json['enabled'] as bool, + socketPoolSize: json['socket_pool_size'] as int, + listenAddress: json['listen_address'] as String, + publicAddress: json['public_address'] as String?, + ); + +Map _$$_VeilidConfigUDPToJson(_$_VeilidConfigUDP instance) => + { + 'enabled': instance.enabled, + 'socket_pool_size': instance.socketPoolSize, + 'listen_address': instance.listenAddress, + 'public_address': instance.publicAddress, + }; + +_$_VeilidConfigTCP _$$_VeilidConfigTCPFromJson(Map json) => + _$_VeilidConfigTCP( + connect: json['connect'] as bool, + listen: json['listen'] as bool, + maxConnections: json['max_connections'] as int, + listenAddress: json['listen_address'] as String, + publicAddress: json['public_address'] as String?, + ); + +Map _$$_VeilidConfigTCPToJson(_$_VeilidConfigTCP instance) => + { + 'connect': instance.connect, + 'listen': instance.listen, + 'max_connections': instance.maxConnections, + 'listen_address': instance.listenAddress, + 'public_address': instance.publicAddress, + }; + +_$_VeilidConfigWS _$$_VeilidConfigWSFromJson(Map json) => + _$_VeilidConfigWS( + connect: json['connect'] as bool, + listen: json['listen'] as bool, + maxConnections: json['max_connections'] as int, + listenAddress: json['listen_address'] as String, + path: json['path'] as String, + url: json['url'] as String?, + ); + +Map _$$_VeilidConfigWSToJson(_$_VeilidConfigWS instance) => + { + 'connect': instance.connect, + 'listen': instance.listen, + 'max_connections': instance.maxConnections, + 'listen_address': instance.listenAddress, + 'path': instance.path, + 'url': instance.url, + }; + +_$_VeilidConfigWSS _$$_VeilidConfigWSSFromJson(Map json) => + _$_VeilidConfigWSS( + connect: json['connect'] as bool, + listen: json['listen'] as bool, + maxConnections: json['max_connections'] as int, + listenAddress: json['listen_address'] as String, + path: json['path'] as String, + url: json['url'] as String?, + ); + +Map _$$_VeilidConfigWSSToJson(_$_VeilidConfigWSS instance) => + { + 'connect': instance.connect, + 'listen': instance.listen, + 'max_connections': instance.maxConnections, + 'listen_address': instance.listenAddress, + 'path': instance.path, + 'url': instance.url, + }; + +_$_VeilidConfigProtocol _$$_VeilidConfigProtocolFromJson( + Map json) => + _$_VeilidConfigProtocol( + udp: VeilidConfigUDP.fromJson(json['udp'] as Map), + tcp: VeilidConfigTCP.fromJson(json['tcp'] as Map), + ws: VeilidConfigWS.fromJson(json['ws'] as Map), + wss: VeilidConfigWSS.fromJson(json['wss'] as Map), + ); + +Map _$$_VeilidConfigProtocolToJson( + _$_VeilidConfigProtocol instance) => + { + 'udp': instance.udp.toJson(), + 'tcp': instance.tcp.toJson(), + 'ws': instance.ws.toJson(), + 'wss': instance.wss.toJson(), + }; + +_$_VeilidConfigTLS _$$_VeilidConfigTLSFromJson(Map json) => + _$_VeilidConfigTLS( + certificatePath: json['certificate_path'] as String, + privateKeyPath: json['private_key_path'] as String, + connectionInitialTimeoutMs: json['connection_initial_timeout_ms'] as int, + ); + +Map _$$_VeilidConfigTLSToJson(_$_VeilidConfigTLS instance) => + { + 'certificate_path': instance.certificatePath, + 'private_key_path': instance.privateKeyPath, + 'connection_initial_timeout_ms': instance.connectionInitialTimeoutMs, + }; + +_$_VeilidConfigDHT _$$_VeilidConfigDHTFromJson(Map json) => + _$_VeilidConfigDHT( + resolveNodeTimeoutMs: json['resolve_node_timeout_ms'] as int, + resolveNodeCount: json['resolve_node_count'] as int, + resolveNodeFanout: json['resolve_node_fanout'] as int, + maxFindNodeCount: json['max_find_node_count'] as int, + getValueTimeoutMs: json['get_value_timeout_ms'] as int, + getValueCount: json['get_value_count'] as int, + getValueFanout: json['get_value_fanout'] as int, + setValueTimeoutMs: json['set_value_timeout_ms'] as int, + setValueCount: json['set_value_count'] as int, + setValueFanout: json['set_value_fanout'] as int, + minPeerCount: json['min_peer_count'] as int, + minPeerRefreshTimeMs: json['min_peer_refresh_time_ms'] as int, + validateDialInfoReceiptTimeMs: + json['validate_dial_info_receipt_time_ms'] as int, + localSubkeyCacheSize: json['local_subkey_cache_size'] as int, + localMaxSubkeyCacheMemoryMb: + json['local_max_subkey_cache_memory_mb'] as int, + remoteSubkeyCacheSize: json['remote_subkey_cache_size'] as int, + remoteMaxRecords: json['remote_max_records'] as int, + remoteMaxSubkeyCacheMemoryMb: + json['remote_max_subkey_cache_memory_mb'] as int, + remoteMaxStorageSpaceMb: json['remote_max_storage_space_mb'] as int, + ); + +Map _$$_VeilidConfigDHTToJson(_$_VeilidConfigDHT instance) => + { + 'resolve_node_timeout_ms': instance.resolveNodeTimeoutMs, + 'resolve_node_count': instance.resolveNodeCount, + 'resolve_node_fanout': instance.resolveNodeFanout, + 'max_find_node_count': instance.maxFindNodeCount, + 'get_value_timeout_ms': instance.getValueTimeoutMs, + 'get_value_count': instance.getValueCount, + 'get_value_fanout': instance.getValueFanout, + 'set_value_timeout_ms': instance.setValueTimeoutMs, + 'set_value_count': instance.setValueCount, + 'set_value_fanout': instance.setValueFanout, + 'min_peer_count': instance.minPeerCount, + 'min_peer_refresh_time_ms': instance.minPeerRefreshTimeMs, + 'validate_dial_info_receipt_time_ms': + instance.validateDialInfoReceiptTimeMs, + 'local_subkey_cache_size': instance.localSubkeyCacheSize, + 'local_max_subkey_cache_memory_mb': instance.localMaxSubkeyCacheMemoryMb, + 'remote_subkey_cache_size': instance.remoteSubkeyCacheSize, + 'remote_max_records': instance.remoteMaxRecords, + 'remote_max_subkey_cache_memory_mb': + instance.remoteMaxSubkeyCacheMemoryMb, + 'remote_max_storage_space_mb': instance.remoteMaxStorageSpaceMb, + }; + +_$_VeilidConfigRPC _$$_VeilidConfigRPCFromJson(Map json) => + _$_VeilidConfigRPC( + concurrency: json['concurrency'] as int, + queueSize: json['queue_size'] as int, + maxTimestampBehindMs: json['max_timestamp_behind_ms'] as int?, + maxTimestampAheadMs: json['max_timestamp_ahead_ms'] as int?, + timeoutMs: json['timeout_ms'] as int, + maxRouteHopCount: json['max_route_hop_count'] as int, + defaultRouteHopCount: json['default_route_hop_count'] as int, + ); + +Map _$$_VeilidConfigRPCToJson(_$_VeilidConfigRPC instance) => + { + 'concurrency': instance.concurrency, + 'queue_size': instance.queueSize, + 'max_timestamp_behind_ms': instance.maxTimestampBehindMs, + 'max_timestamp_ahead_ms': instance.maxTimestampAheadMs, + 'timeout_ms': instance.timeoutMs, + 'max_route_hop_count': instance.maxRouteHopCount, + 'default_route_hop_count': instance.defaultRouteHopCount, + }; + +_$_VeilidConfigRoutingTable _$$_VeilidConfigRoutingTableFromJson( + Map json) => + _$_VeilidConfigRoutingTable( + nodeId: (json['node_id'] as List) + .map(Typed.fromJson) + .toList(), + nodeIdSecret: (json['node_id_secret'] as List) + .map(Typed.fromJson) + .toList(), + bootstrap: + (json['bootstrap'] as List).map((e) => e as String).toList(), + limitOverAttached: json['limit_over_attached'] as int, + limitFullyAttached: json['limit_fully_attached'] as int, + limitAttachedStrong: json['limit_attached_strong'] as int, + limitAttachedGood: json['limit_attached_good'] as int, + limitAttachedWeak: json['limit_attached_weak'] as int, + ); + +Map _$$_VeilidConfigRoutingTableToJson( + _$_VeilidConfigRoutingTable instance) => + { + 'node_id': instance.nodeId.map((e) => e.toJson()).toList(), + 'node_id_secret': instance.nodeIdSecret.map((e) => e.toJson()).toList(), + 'bootstrap': instance.bootstrap, + 'limit_over_attached': instance.limitOverAttached, + 'limit_fully_attached': instance.limitFullyAttached, + 'limit_attached_strong': instance.limitAttachedStrong, + 'limit_attached_good': instance.limitAttachedGood, + 'limit_attached_weak': instance.limitAttachedWeak, + }; + +_$_VeilidConfigNetwork _$$_VeilidConfigNetworkFromJson( + Map json) => + _$_VeilidConfigNetwork( + connectionInitialTimeoutMs: json['connection_initial_timeout_ms'] as int, + connectionInactivityTimeoutMs: + json['connection_inactivity_timeout_ms'] as int, + maxConnectionsPerIp4: json['max_connections_per_ip4'] as int, + maxConnectionsPerIp6Prefix: json['max_connections_per_ip6_prefix'] as int, + maxConnectionsPerIp6PrefixSize: + json['max_connections_per_ip6_prefix_size'] as int, + maxConnectionFrequencyPerMin: + json['max_connection_frequency_per_min'] as int, + clientWhitelistTimeoutMs: json['client_whitelist_timeout_ms'] as int, + reverseConnectionReceiptTimeMs: + json['reverse_connection_receipt_time_ms'] as int, + holePunchReceiptTimeMs: json['hole_punch_receipt_time_ms'] as int, + networkKeyPassword: json['network_key_password'] as String?, + routingTable: VeilidConfigRoutingTable.fromJson( + json['routing_table'] as Map), + rpc: VeilidConfigRPC.fromJson(json['rpc'] as Map), + dht: VeilidConfigDHT.fromJson(json['dht'] as Map), + upnp: json['upnp'] as bool, + detectAddressChanges: json['detect_address_changes'] as bool, + restrictedNatRetries: json['restricted_nat_retries'] as int, + tls: VeilidConfigTLS.fromJson(json['tls'] as Map), + application: VeilidConfigApplication.fromJson( + json['application'] as Map), + protocol: VeilidConfigProtocol.fromJson( + json['protocol'] as Map), + ); + +Map _$$_VeilidConfigNetworkToJson( + _$_VeilidConfigNetwork instance) => + { + 'connection_initial_timeout_ms': instance.connectionInitialTimeoutMs, + 'connection_inactivity_timeout_ms': + instance.connectionInactivityTimeoutMs, + 'max_connections_per_ip4': instance.maxConnectionsPerIp4, + 'max_connections_per_ip6_prefix': instance.maxConnectionsPerIp6Prefix, + 'max_connections_per_ip6_prefix_size': + instance.maxConnectionsPerIp6PrefixSize, + 'max_connection_frequency_per_min': instance.maxConnectionFrequencyPerMin, + 'client_whitelist_timeout_ms': instance.clientWhitelistTimeoutMs, + 'reverse_connection_receipt_time_ms': + instance.reverseConnectionReceiptTimeMs, + 'hole_punch_receipt_time_ms': instance.holePunchReceiptTimeMs, + 'network_key_password': instance.networkKeyPassword, + 'routing_table': instance.routingTable.toJson(), + 'rpc': instance.rpc.toJson(), + 'dht': instance.dht.toJson(), + 'upnp': instance.upnp, + 'detect_address_changes': instance.detectAddressChanges, + 'restricted_nat_retries': instance.restrictedNatRetries, + 'tls': instance.tls.toJson(), + 'application': instance.application.toJson(), + 'protocol': instance.protocol.toJson(), + }; + +_$_VeilidConfigTableStore _$$_VeilidConfigTableStoreFromJson( + Map json) => + _$_VeilidConfigTableStore( + directory: json['directory'] as String, + delete: json['delete'] as bool, + ); + +Map _$$_VeilidConfigTableStoreToJson( + _$_VeilidConfigTableStore instance) => + { + 'directory': instance.directory, + 'delete': instance.delete, + }; + +_$_VeilidConfigBlockStore _$$_VeilidConfigBlockStoreFromJson( + Map json) => + _$_VeilidConfigBlockStore( + directory: json['directory'] as String, + delete: json['delete'] as bool, + ); + +Map _$$_VeilidConfigBlockStoreToJson( + _$_VeilidConfigBlockStore instance) => + { + 'directory': instance.directory, + 'delete': instance.delete, + }; + +_$_VeilidConfigProtectedStore _$$_VeilidConfigProtectedStoreFromJson( + Map json) => + _$_VeilidConfigProtectedStore( + allowInsecureFallback: json['allow_insecure_fallback'] as bool, + alwaysUseInsecureStorage: json['always_use_insecure_storage'] as bool, + directory: json['directory'] as String, + delete: json['delete'] as bool, + deviceEncryptionKeyPassword: + json['device_encryption_key_password'] as String, + newDeviceEncryptionKeyPassword: + json['new_device_encryption_key_password'] as String?, + ); + +Map _$$_VeilidConfigProtectedStoreToJson( + _$_VeilidConfigProtectedStore instance) => + { + 'allow_insecure_fallback': instance.allowInsecureFallback, + 'always_use_insecure_storage': instance.alwaysUseInsecureStorage, + 'directory': instance.directory, + 'delete': instance.delete, + 'device_encryption_key_password': instance.deviceEncryptionKeyPassword, + 'new_device_encryption_key_password': + instance.newDeviceEncryptionKeyPassword, + }; + +_$_VeilidConfigCapabilities _$$_VeilidConfigCapabilitiesFromJson( + Map json) => + _$_VeilidConfigCapabilities( + disable: + (json['disable'] as List).map((e) => e as String).toList(), + ); + +Map _$$_VeilidConfigCapabilitiesToJson( + _$_VeilidConfigCapabilities instance) => + { + 'disable': instance.disable, + }; + +_$_VeilidConfig _$$_VeilidConfigFromJson(Map json) => + _$_VeilidConfig( + programName: json['program_name'] as String, + namespace: json['namespace'] as String, + capabilities: VeilidConfigCapabilities.fromJson( + json['capabilities'] as Map), + protectedStore: VeilidConfigProtectedStore.fromJson( + json['protected_store'] as Map), + tableStore: VeilidConfigTableStore.fromJson( + json['table_store'] as Map), + blockStore: VeilidConfigBlockStore.fromJson( + json['block_store'] as Map), + network: + VeilidConfigNetwork.fromJson(json['network'] as Map), + ); + +Map _$$_VeilidConfigToJson(_$_VeilidConfig instance) => + { + 'program_name': instance.programName, + 'namespace': instance.namespace, + 'capabilities': instance.capabilities.toJson(), + 'protected_store': instance.protectedStore.toJson(), + 'table_store': instance.tableStore.toJson(), + 'block_store': instance.blockStore.toJson(), + 'network': instance.network.toJson(), + }; diff --git a/veilid-flutter/lib/veilid_crypto.dart b/veilid-flutter/lib/veilid_crypto.dart index 85ce5f80..d2a562e5 100644 --- a/veilid-flutter/lib/veilid_crypto.dart +++ b/veilid-flutter/lib/veilid_crypto.dart @@ -2,6 +2,8 @@ import 'dart:async'; import 'dart:typed_data'; import 'package:charcode/charcode.dart'; +import 'package:equatable/equatable.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; import 'veilid_encoding.dart'; import 'veilid.dart'; @@ -33,92 +35,96 @@ CryptoKind cryptoKindFromString(String s) { ////////////////////////////////////// /// Types -class Typed { - late CryptoKind kind; - late V value; - Typed({required this.kind, required this.value}); +@immutable +class Typed extends Equatable { + final CryptoKind kind; + final V value; + @override + List get props => [kind, value]; + + const Typed({required this.kind, required this.value}); @override String toString() { return "${cryptoKindToString(kind)}:$value"; } - Typed.fromString(String s) { - var parts = s.split(":"); + factory Typed.fromString(String s) { + final parts = s.split(":"); if (parts.length < 2 || parts[0].codeUnits.length != 4) { throw const FormatException("malformed string"); } - kind = parts[0].codeUnits[0] | - parts[0].codeUnits[1] << 8 | - parts[0].codeUnits[2] << 16 | - parts[0].codeUnits[3] << 24; - value = EncodedString.fromString(parts.sublist(1).join(":")); + final kind = cryptoKindFromString(parts[0]); + final value = EncodedString.fromString(parts.sublist(1).join(":")); + return Typed(kind: kind, value: value); } - String toJson() { - return toString(); - } - - Typed.fromJson(dynamic json) : this.fromString(json as String); + String toJson() => toString(); + factory Typed.fromJson(dynamic json) => Typed.fromString(json as String); } -class KeyPair { - late PublicKey key; - late PublicKey secret; - KeyPair({required this.key, required this.secret}); +@immutable +class KeyPair extends Equatable { + final PublicKey key; + final PublicKey secret; + @override + List get props => [key, secret]; + + const KeyPair({required this.key, required this.secret}); @override String toString() { return "${key.toString()}:${secret.toString()}"; } - KeyPair.fromString(String s) { - var parts = s.split(":"); + factory KeyPair.fromString(String s) { + final parts = s.split(":"); if (parts.length != 2 || parts[0].codeUnits.length != 43 || parts[1].codeUnits.length != 43) { throw const FormatException("malformed string"); } - key = PublicKey(parts[0]); - secret = PublicKey(parts[1]); + final key = PublicKey.fromString(parts[0]); + final secret = PublicKey.fromString(parts[1]); + return KeyPair(key: key, secret: secret); } - String toJson() { - return toString(); - } - - KeyPair.fromJson(dynamic json) : this.fromString(json as String); + String toJson() => toString(); + factory KeyPair.fromJson(dynamic json) => KeyPair.fromString(json as String); } -class TypedKeyPair { - late CryptoKind kind; - late PublicKey key; - late PublicKey secret; - TypedKeyPair({required this.kind, required this.key, required this.secret}); +@immutable +class TypedKeyPair extends Equatable { + final CryptoKind kind; + final PublicKey key; + final PublicKey secret; + @override + List get props => [kind, key, secret]; + + const TypedKeyPair( + {required this.kind, required this.key, required this.secret}); @override - String toString() { - return "${cryptoKindToString(kind)}:${key.toString()}:${secret.toString()}"; - } + String toString() => + "${cryptoKindToString(kind)}:${key.toString()}:${secret.toString()}"; - TypedKeyPair.fromString(String s) { - var parts = s.split(":"); + factory TypedKeyPair.fromString(String s) { + final parts = s.split(":"); if (parts.length != 3 || parts[0].codeUnits.length != 4 || parts[1].codeUnits.length != 43 || parts[2].codeUnits.length != 43) { throw VeilidAPIExceptionInvalidArgument("malformed string", "s", s); } - kind = cryptoKindFromString(parts[0]); - key = PublicKey(parts[1]); - secret = PublicKey(parts[2]); + final kind = cryptoKindFromString(parts[0]); + final key = PublicKey.fromString(parts[1]); + final secret = PublicKey.fromString(parts[2]); + return TypedKeyPair(kind: kind, key: key, secret: secret); } - String toJson() { - return toString(); - } - - TypedKeyPair.fromJson(dynamic json) : this.fromString(json as String); + String toJson() => toString(); + factory TypedKeyPair.fromJson(dynamic json) => + TypedKeyPair.fromString(json as String); } typedef CryptoKey = FixedEncodedString43; diff --git a/veilid-flutter/lib/veilid_encoding.dart b/veilid-flutter/lib/veilid_encoding.dart index 9ef54f14..3e265e0a 100644 --- a/veilid-flutter/lib/veilid_encoding.dart +++ b/veilid-flutter/lib/veilid_encoding.dart @@ -1,6 +1,9 @@ import 'dart:convert'; import 'dart:typed_data'; +import 'package:equatable/equatable.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; + String base64UrlNoPadEncode(List bytes) { var x = base64Url.encode(bytes); while (x.endsWith('=')) { @@ -20,97 +23,91 @@ Uint8List base64UrlNoPadDecodeDynamic(dynamic source) { return base64.decode(source); } -abstract class EncodedString { - late String contents; - EncodedString(String s) { - validate(s); - contents = s; - } - EncodedString.encode(List b) { - var s = base64UrlNoPadEncode(b); - validate(s); - contents = s; - } +@immutable +abstract class EncodedString extends Equatable { + final String contents; + @override + List get props => [contents]; - int encodedLength(); - int decodedLength(); - void validate(String s) { - var d = base64UrlNoPadDecode(s); - if (d.length != decodedLength()) { - throw Exception("length ${s.length} should be ${encodedLength()}"); - } - } + const EncodedString(String s) : contents = s; Uint8List decode() { return base64UrlNoPadDecode(contents); } @override - String toString() { - return contents; - } + String toString() => contents; static T fromString(String s) { switch (T) { case FixedEncodedString32: - return FixedEncodedString32(s) as T; + return FixedEncodedString32.fromString(s) as T; case FixedEncodedString43: - return FixedEncodedString43(s) as T; + return FixedEncodedString43.fromString(s) as T; case FixedEncodedString86: - return FixedEncodedString86(s) as T; + return FixedEncodedString86.fromString(s) as T; default: throw UnimplementedError(); } } } +@immutable class FixedEncodedString32 extends EncodedString { - FixedEncodedString32(String s) : super(s); - @override - int encodedLength() { + const FixedEncodedString32._(String s) : super(s); + static int encodedLength() { return 32; } - @override - int decodedLength() { + static int decodedLength() { return 24; } - String toJson() { - return toString(); + factory FixedEncodedString32.fromString(String s) { + var d = base64UrlNoPadDecode(s); + if (d.length != decodedLength()) { + throw Exception("length ${s.length} should be ${encodedLength()}"); + } + return FixedEncodedString32._(s); } - FixedEncodedString32.fromJson(dynamic json) : this(json as String); + String toJson() => toString(); + factory FixedEncodedString32.fromJson(dynamic json) => + FixedEncodedString32.fromString(json as String); } +@immutable class FixedEncodedString43 extends EncodedString { - FixedEncodedString43(String s) : super(s); - @override - int encodedLength() { + const FixedEncodedString43._(String s) : super(s); + static int encodedLength() { return 43; } - @override - int decodedLength() { + static int decodedLength() { return 32; } - String toJson() { - return toString(); + factory FixedEncodedString43.fromString(String s) { + var d = base64UrlNoPadDecode(s); + if (d.length != decodedLength()) { + throw Exception("length ${s.length} should be ${encodedLength()}"); + } + return FixedEncodedString43._(s); } - FixedEncodedString43.fromJson(dynamic json) : this(json as String); + String toJson() => toString(); + factory FixedEncodedString43.fromJson(dynamic json) => + FixedEncodedString43.fromString(json as String); } +@immutable class FixedEncodedString86 extends EncodedString { - FixedEncodedString86(String s) : super(s); - @override - int encodedLength() { + const FixedEncodedString86._(String s) : super(s); + static int encodedLength() { return 86; } - @override - int decodedLength() { + static int decodedLength() { return 64; } @@ -118,5 +115,14 @@ class FixedEncodedString86 extends EncodedString { return toString(); } - FixedEncodedString86.fromJson(dynamic json) : this(json as String); + factory FixedEncodedString86.fromString(String s) { + var d = base64UrlNoPadDecode(s); + if (d.length != decodedLength()) { + throw Exception("length ${s.length} should be ${encodedLength()}"); + } + return FixedEncodedString86._(s); + } + + factory FixedEncodedString86.fromJson(dynamic json) => + FixedEncodedString86.fromString(json as String); } diff --git a/veilid-flutter/lib/veilid_state.dart b/veilid-flutter/lib/veilid_state.dart index 8d90dbff..b992ca39 100644 --- a/veilid-flutter/lib/veilid_state.dart +++ b/veilid-flutter/lib/veilid_state.dart @@ -1,10 +1,14 @@ import 'dart:typed_data'; import 'package:change_case/change_case.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; import 'veilid_encoding.dart'; import 'veilid.dart'; +part 'veilid_state.freezed.dart'; +part 'veilid_state.g.dart'; + ////////////////////////////////////// /// AttachmentState @@ -18,13 +22,9 @@ enum AttachmentState { overAttached, detaching; - String toJson() { - return name.toPascalCase(); - } - - factory AttachmentState.fromJson(String j) { - return AttachmentState.values.byName(j.toCamelCase()); - } + String toJson() => name.toPascalCase(); + factory AttachmentState.fromJson(String j) => + AttachmentState.values.byName(j.toCamelCase()); } ////////////////////////////////////// @@ -37,208 +37,99 @@ enum VeilidLogLevel { debug, trace; - String toJson() { - return name.toPascalCase(); - } - - factory VeilidLogLevel.fromJson(String j) { - return VeilidLogLevel.values.byName(j.toCamelCase()); - } + String toJson() => name.toPascalCase(); + factory VeilidLogLevel.fromJson(String j) => + VeilidLogLevel.values.byName(j.toCamelCase()); } //////////// -class LatencyStats { - TimestampDuration fastest; - TimestampDuration average; - TimestampDuration slowest; +@freezed +class LatencyStats with _$LatencyStats { + const factory LatencyStats({ + required TimestampDuration fastest, + required TimestampDuration average, + required TimestampDuration slowest, + }) = _LatencyStats; - LatencyStats({ - required this.fastest, - required this.average, - required this.slowest, - }); - - Map toJson() { - return { - 'fastest': fastest.toJson(), - 'average': average.toJson(), - 'slowest': slowest.toJson(), - }; - } - - LatencyStats.fromJson(dynamic json) - : fastest = TimestampDuration.fromJson(json['fastest']), - average = TimestampDuration.fromJson(json['average']), - slowest = TimestampDuration.fromJson(json['slowest']); + factory LatencyStats.fromJson(Map json) => + _$LatencyStatsFromJson(json); } //////////// -class TransferStats { - BigInt total; - BigInt maximum; - BigInt average; - BigInt minimum; +@freezed +class TransferStats with _$TransferStats { + const factory TransferStats({ + required BigInt total, + required BigInt maximum, + required BigInt average, + required BigInt minimum, + }) = _TransferStats; - TransferStats({ - required this.total, - required this.maximum, - required this.average, - required this.minimum, - }); - - Map toJson() { - return { - 'total': total.toString(), - 'maximum': maximum.toString(), - 'average': average.toString(), - 'minimum': minimum.toString(), - }; - } - - TransferStats.fromJson(dynamic json) - : total = BigInt.parse(json['total']), - maximum = BigInt.parse(json['maximum']), - average = BigInt.parse(json['average']), - minimum = BigInt.parse(json['minimum']); + factory TransferStats.fromJson(Map json) => + _$TransferStatsFromJson(json); } //////////// -class TransferStatsDownUp { - TransferStats down; - TransferStats up; +@freezed +class TransferStatsDownUp with _$TransferStatsDownUp { + const factory TransferStatsDownUp({ + required TransferStats down, + required TransferStats up, + }) = _TransferStatsDownUp; - TransferStatsDownUp({ - required this.down, - required this.up, - }); - - Map toJson() { - return { - 'down': down.toJson(), - 'up': up.toJson(), - }; - } - - TransferStatsDownUp.fromJson(dynamic json) - : down = TransferStats.fromJson(json['down']), - up = TransferStats.fromJson(json['up']); + factory TransferStatsDownUp.fromJson(Map json) => + _$TransferStatsDownUpFromJson(json); } //////////// -class RPCStats { - int messagesSent; - int messagesRcvd; - int questionsInFlight; - Timestamp? lastQuestion; - Timestamp? lastSeenTs; - Timestamp? firstConsecutiveSeenTs; - int recentLostAnswers; - int failedToSend; +@freezed +class RPCStats with _$RPCStats { + const factory RPCStats({ + required int messagesSent, + required int messagesRcvd, + required int questionsInFlight, + required Timestamp? lastQuestion, + required Timestamp? lastSeenTs, + required Timestamp? firstConsecutiveSeenTs, + required int recentLostAnswers, + required int failedToSend, + }) = _RPCStats; - RPCStats({ - required this.messagesSent, - required this.messagesRcvd, - required this.questionsInFlight, - required this.lastQuestion, - required this.lastSeenTs, - required this.firstConsecutiveSeenTs, - required this.recentLostAnswers, - required this.failedToSend, - }); - - Map toJson() { - return { - 'messages_sent': messagesSent, - 'messages_rcvd': messagesRcvd, - 'questions_in_flight': questionsInFlight, - 'last_question': lastQuestion?.toJson(), - 'last_seen_ts': lastSeenTs?.toJson(), - 'first_consecutive_seen_ts': firstConsecutiveSeenTs?.toJson(), - 'recent_lost_answers': recentLostAnswers, - 'failed_to_send': failedToSend, - }; - } - - RPCStats.fromJson(dynamic json) - : messagesSent = json['messages_sent'], - messagesRcvd = json['messages_rcvd'], - questionsInFlight = json['questions_in_flight'], - lastQuestion = json['last_question'] != null - ? Timestamp.fromJson(json['last_question']) - : null, - lastSeenTs = json['last_seen_ts'] != null - ? Timestamp.fromJson(json['last_seen_ts']) - : null, - firstConsecutiveSeenTs = json['first_consecutive_seen_ts'] != null - ? Timestamp.fromJson(json['first_consecutive_seen_ts']) - : null, - recentLostAnswers = json['recent_lost_answers'], - failedToSend = json['failed_to_send']; + factory RPCStats.fromJson(Map json) => + _$RPCStatsFromJson(json); } //////////// -class PeerStats { - Timestamp timeAdded; - RPCStats rpcStats; - LatencyStats? latency; - TransferStatsDownUp transfer; +@freezed +class PeerStats with _$PeerStats { + const factory PeerStats({ + required Timestamp timeAdded, + required RPCStats rpcStats, + LatencyStats? latency, + required TransferStatsDownUp transfer, + }) = _PeerStats; - PeerStats({ - required this.timeAdded, - required this.rpcStats, - required this.latency, - required this.transfer, - }); - - Map toJson() { - return { - 'time_added': timeAdded.toJson(), - 'rpc_stats': rpcStats.toJson(), - 'latency': latency?.toJson(), - 'transfer': transfer.toJson(), - }; - } - - PeerStats.fromJson(dynamic json) - : timeAdded = Timestamp.fromJson(json['time_added']), - rpcStats = RPCStats.fromJson(json['rpc_stats']), - latency = json['latency'] != null - ? LatencyStats.fromJson(json['latency']) - : null, - transfer = TransferStatsDownUp.fromJson(json['transfer']); + factory PeerStats.fromJson(Map json) => + _$PeerStatsFromJson(json); } //////////// -class PeerTableData { - List nodeIds; - String peerAddress; - PeerStats peerStats; +@freezed +class PeerTableData with _$PeerTableData { + const factory PeerTableData({ + required List nodeIds, + required String peerAddress, + required PeerStats peerStats, + }) = _PeerTableData; - PeerTableData({ - required this.nodeIds, - required this.peerAddress, - required this.peerStats, - }); - - Map toJson() { - return { - 'node_ids': nodeIds.map((p) => p.toJson()).toList(), - 'peer_address': peerAddress, - 'peer_stats': peerStats.toJson(), - }; - } - - PeerTableData.fromJson(dynamic json) - : nodeIds = List.from( - json['node_ids'].map((j) => TypedKey.fromJson(j))), - peerAddress = json['peer_address'], - peerStats = PeerStats.fromJson(json['peer_stats']); + factory PeerTableData.fromJson(Map json) => + _$PeerTableDataFromJson(json); } ////////////////////////////////////// diff --git a/veilid-flutter/lib/veilid_state.freezed.dart b/veilid-flutter/lib/veilid_state.freezed.dart new file mode 100644 index 00000000..db66078c --- /dev/null +++ b/veilid-flutter/lib/veilid_state.freezed.dart @@ -0,0 +1,1304 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'veilid_state.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + +LatencyStats _$LatencyStatsFromJson(Map json) { + return _LatencyStats.fromJson(json); +} + +/// @nodoc +mixin _$LatencyStats { + TimestampDuration get fastest => throw _privateConstructorUsedError; + TimestampDuration get average => throw _privateConstructorUsedError; + TimestampDuration get slowest => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $LatencyStatsCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $LatencyStatsCopyWith<$Res> { + factory $LatencyStatsCopyWith( + LatencyStats value, $Res Function(LatencyStats) then) = + _$LatencyStatsCopyWithImpl<$Res, LatencyStats>; + @useResult + $Res call( + {TimestampDuration fastest, + TimestampDuration average, + TimestampDuration slowest}); +} + +/// @nodoc +class _$LatencyStatsCopyWithImpl<$Res, $Val extends LatencyStats> + implements $LatencyStatsCopyWith<$Res> { + _$LatencyStatsCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? fastest = null, + Object? average = null, + Object? slowest = null, + }) { + return _then(_value.copyWith( + fastest: null == fastest + ? _value.fastest + : fastest // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + average: null == average + ? _value.average + : average // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + slowest: null == slowest + ? _value.slowest + : slowest // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_LatencyStatsCopyWith<$Res> + implements $LatencyStatsCopyWith<$Res> { + factory _$$_LatencyStatsCopyWith( + _$_LatencyStats value, $Res Function(_$_LatencyStats) then) = + __$$_LatencyStatsCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {TimestampDuration fastest, + TimestampDuration average, + TimestampDuration slowest}); +} + +/// @nodoc +class __$$_LatencyStatsCopyWithImpl<$Res> + extends _$LatencyStatsCopyWithImpl<$Res, _$_LatencyStats> + implements _$$_LatencyStatsCopyWith<$Res> { + __$$_LatencyStatsCopyWithImpl( + _$_LatencyStats _value, $Res Function(_$_LatencyStats) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? fastest = null, + Object? average = null, + Object? slowest = null, + }) { + return _then(_$_LatencyStats( + fastest: null == fastest + ? _value.fastest + : fastest // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + average: null == average + ? _value.average + : average // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + slowest: null == slowest + ? _value.slowest + : slowest // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_LatencyStats implements _LatencyStats { + const _$_LatencyStats( + {required this.fastest, required this.average, required this.slowest}); + + factory _$_LatencyStats.fromJson(Map json) => + _$$_LatencyStatsFromJson(json); + + @override + final TimestampDuration fastest; + @override + final TimestampDuration average; + @override + final TimestampDuration slowest; + + @override + String toString() { + return 'LatencyStats(fastest: $fastest, average: $average, slowest: $slowest)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_LatencyStats && + (identical(other.fastest, fastest) || other.fastest == fastest) && + (identical(other.average, average) || other.average == average) && + (identical(other.slowest, slowest) || other.slowest == slowest)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, fastest, average, slowest); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_LatencyStatsCopyWith<_$_LatencyStats> get copyWith => + __$$_LatencyStatsCopyWithImpl<_$_LatencyStats>(this, _$identity); + + @override + Map toJson() { + return _$$_LatencyStatsToJson( + this, + ); + } +} + +abstract class _LatencyStats implements LatencyStats { + const factory _LatencyStats( + {required final TimestampDuration fastest, + required final TimestampDuration average, + required final TimestampDuration slowest}) = _$_LatencyStats; + + factory _LatencyStats.fromJson(Map json) = + _$_LatencyStats.fromJson; + + @override + TimestampDuration get fastest; + @override + TimestampDuration get average; + @override + TimestampDuration get slowest; + @override + @JsonKey(ignore: true) + _$$_LatencyStatsCopyWith<_$_LatencyStats> get copyWith => + throw _privateConstructorUsedError; +} + +TransferStats _$TransferStatsFromJson(Map json) { + return _TransferStats.fromJson(json); +} + +/// @nodoc +mixin _$TransferStats { + BigInt get total => throw _privateConstructorUsedError; + BigInt get maximum => throw _privateConstructorUsedError; + BigInt get average => throw _privateConstructorUsedError; + BigInt get minimum => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $TransferStatsCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $TransferStatsCopyWith<$Res> { + factory $TransferStatsCopyWith( + TransferStats value, $Res Function(TransferStats) then) = + _$TransferStatsCopyWithImpl<$Res, TransferStats>; + @useResult + $Res call({BigInt total, BigInt maximum, BigInt average, BigInt minimum}); +} + +/// @nodoc +class _$TransferStatsCopyWithImpl<$Res, $Val extends TransferStats> + implements $TransferStatsCopyWith<$Res> { + _$TransferStatsCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? total = null, + Object? maximum = null, + Object? average = null, + Object? minimum = null, + }) { + return _then(_value.copyWith( + total: null == total + ? _value.total + : total // ignore: cast_nullable_to_non_nullable + as BigInt, + maximum: null == maximum + ? _value.maximum + : maximum // ignore: cast_nullable_to_non_nullable + as BigInt, + average: null == average + ? _value.average + : average // ignore: cast_nullable_to_non_nullable + as BigInt, + minimum: null == minimum + ? _value.minimum + : minimum // ignore: cast_nullable_to_non_nullable + as BigInt, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_TransferStatsCopyWith<$Res> + implements $TransferStatsCopyWith<$Res> { + factory _$$_TransferStatsCopyWith( + _$_TransferStats value, $Res Function(_$_TransferStats) then) = + __$$_TransferStatsCopyWithImpl<$Res>; + @override + @useResult + $Res call({BigInt total, BigInt maximum, BigInt average, BigInt minimum}); +} + +/// @nodoc +class __$$_TransferStatsCopyWithImpl<$Res> + extends _$TransferStatsCopyWithImpl<$Res, _$_TransferStats> + implements _$$_TransferStatsCopyWith<$Res> { + __$$_TransferStatsCopyWithImpl( + _$_TransferStats _value, $Res Function(_$_TransferStats) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? total = null, + Object? maximum = null, + Object? average = null, + Object? minimum = null, + }) { + return _then(_$_TransferStats( + total: null == total + ? _value.total + : total // ignore: cast_nullable_to_non_nullable + as BigInt, + maximum: null == maximum + ? _value.maximum + : maximum // ignore: cast_nullable_to_non_nullable + as BigInt, + average: null == average + ? _value.average + : average // ignore: cast_nullable_to_non_nullable + as BigInt, + minimum: null == minimum + ? _value.minimum + : minimum // ignore: cast_nullable_to_non_nullable + as BigInt, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_TransferStats implements _TransferStats { + const _$_TransferStats( + {required this.total, + required this.maximum, + required this.average, + required this.minimum}); + + factory _$_TransferStats.fromJson(Map json) => + _$$_TransferStatsFromJson(json); + + @override + final BigInt total; + @override + final BigInt maximum; + @override + final BigInt average; + @override + final BigInt minimum; + + @override + String toString() { + return 'TransferStats(total: $total, maximum: $maximum, average: $average, minimum: $minimum)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_TransferStats && + (identical(other.total, total) || other.total == total) && + (identical(other.maximum, maximum) || other.maximum == maximum) && + (identical(other.average, average) || other.average == average) && + (identical(other.minimum, minimum) || other.minimum == minimum)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => + Object.hash(runtimeType, total, maximum, average, minimum); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_TransferStatsCopyWith<_$_TransferStats> get copyWith => + __$$_TransferStatsCopyWithImpl<_$_TransferStats>(this, _$identity); + + @override + Map toJson() { + return _$$_TransferStatsToJson( + this, + ); + } +} + +abstract class _TransferStats implements TransferStats { + const factory _TransferStats( + {required final BigInt total, + required final BigInt maximum, + required final BigInt average, + required final BigInt minimum}) = _$_TransferStats; + + factory _TransferStats.fromJson(Map json) = + _$_TransferStats.fromJson; + + @override + BigInt get total; + @override + BigInt get maximum; + @override + BigInt get average; + @override + BigInt get minimum; + @override + @JsonKey(ignore: true) + _$$_TransferStatsCopyWith<_$_TransferStats> get copyWith => + throw _privateConstructorUsedError; +} + +TransferStatsDownUp _$TransferStatsDownUpFromJson(Map json) { + return _TransferStatsDownUp.fromJson(json); +} + +/// @nodoc +mixin _$TransferStatsDownUp { + TransferStats get down => throw _privateConstructorUsedError; + TransferStats get up => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $TransferStatsDownUpCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $TransferStatsDownUpCopyWith<$Res> { + factory $TransferStatsDownUpCopyWith( + TransferStatsDownUp value, $Res Function(TransferStatsDownUp) then) = + _$TransferStatsDownUpCopyWithImpl<$Res, TransferStatsDownUp>; + @useResult + $Res call({TransferStats down, TransferStats up}); + + $TransferStatsCopyWith<$Res> get down; + $TransferStatsCopyWith<$Res> get up; +} + +/// @nodoc +class _$TransferStatsDownUpCopyWithImpl<$Res, $Val extends TransferStatsDownUp> + implements $TransferStatsDownUpCopyWith<$Res> { + _$TransferStatsDownUpCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? down = null, + Object? up = null, + }) { + return _then(_value.copyWith( + down: null == down + ? _value.down + : down // ignore: cast_nullable_to_non_nullable + as TransferStats, + up: null == up + ? _value.up + : up // ignore: cast_nullable_to_non_nullable + as TransferStats, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $TransferStatsCopyWith<$Res> get down { + return $TransferStatsCopyWith<$Res>(_value.down, (value) { + return _then(_value.copyWith(down: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $TransferStatsCopyWith<$Res> get up { + return $TransferStatsCopyWith<$Res>(_value.up, (value) { + return _then(_value.copyWith(up: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$_TransferStatsDownUpCopyWith<$Res> + implements $TransferStatsDownUpCopyWith<$Res> { + factory _$$_TransferStatsDownUpCopyWith(_$_TransferStatsDownUp value, + $Res Function(_$_TransferStatsDownUp) then) = + __$$_TransferStatsDownUpCopyWithImpl<$Res>; + @override + @useResult + $Res call({TransferStats down, TransferStats up}); + + @override + $TransferStatsCopyWith<$Res> get down; + @override + $TransferStatsCopyWith<$Res> get up; +} + +/// @nodoc +class __$$_TransferStatsDownUpCopyWithImpl<$Res> + extends _$TransferStatsDownUpCopyWithImpl<$Res, _$_TransferStatsDownUp> + implements _$$_TransferStatsDownUpCopyWith<$Res> { + __$$_TransferStatsDownUpCopyWithImpl(_$_TransferStatsDownUp _value, + $Res Function(_$_TransferStatsDownUp) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? down = null, + Object? up = null, + }) { + return _then(_$_TransferStatsDownUp( + down: null == down + ? _value.down + : down // ignore: cast_nullable_to_non_nullable + as TransferStats, + up: null == up + ? _value.up + : up // ignore: cast_nullable_to_non_nullable + as TransferStats, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_TransferStatsDownUp implements _TransferStatsDownUp { + const _$_TransferStatsDownUp({required this.down, required this.up}); + + factory _$_TransferStatsDownUp.fromJson(Map json) => + _$$_TransferStatsDownUpFromJson(json); + + @override + final TransferStats down; + @override + final TransferStats up; + + @override + String toString() { + return 'TransferStatsDownUp(down: $down, up: $up)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_TransferStatsDownUp && + (identical(other.down, down) || other.down == down) && + (identical(other.up, up) || other.up == up)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, down, up); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_TransferStatsDownUpCopyWith<_$_TransferStatsDownUp> get copyWith => + __$$_TransferStatsDownUpCopyWithImpl<_$_TransferStatsDownUp>( + this, _$identity); + + @override + Map toJson() { + return _$$_TransferStatsDownUpToJson( + this, + ); + } +} + +abstract class _TransferStatsDownUp implements TransferStatsDownUp { + const factory _TransferStatsDownUp( + {required final TransferStats down, + required final TransferStats up}) = _$_TransferStatsDownUp; + + factory _TransferStatsDownUp.fromJson(Map json) = + _$_TransferStatsDownUp.fromJson; + + @override + TransferStats get down; + @override + TransferStats get up; + @override + @JsonKey(ignore: true) + _$$_TransferStatsDownUpCopyWith<_$_TransferStatsDownUp> get copyWith => + throw _privateConstructorUsedError; +} + +RPCStats _$RPCStatsFromJson(Map json) { + return _RPCStats.fromJson(json); +} + +/// @nodoc +mixin _$RPCStats { + int get messagesSent => throw _privateConstructorUsedError; + int get messagesRcvd => throw _privateConstructorUsedError; + int get questionsInFlight => throw _privateConstructorUsedError; + Timestamp? get lastQuestion => throw _privateConstructorUsedError; + Timestamp? get lastSeenTs => throw _privateConstructorUsedError; + Timestamp? get firstConsecutiveSeenTs => throw _privateConstructorUsedError; + int get recentLostAnswers => throw _privateConstructorUsedError; + int get failedToSend => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $RPCStatsCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $RPCStatsCopyWith<$Res> { + factory $RPCStatsCopyWith(RPCStats value, $Res Function(RPCStats) then) = + _$RPCStatsCopyWithImpl<$Res, RPCStats>; + @useResult + $Res call( + {int messagesSent, + int messagesRcvd, + int questionsInFlight, + Timestamp? lastQuestion, + Timestamp? lastSeenTs, + Timestamp? firstConsecutiveSeenTs, + int recentLostAnswers, + int failedToSend}); +} + +/// @nodoc +class _$RPCStatsCopyWithImpl<$Res, $Val extends RPCStats> + implements $RPCStatsCopyWith<$Res> { + _$RPCStatsCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? messagesSent = null, + Object? messagesRcvd = null, + Object? questionsInFlight = null, + Object? lastQuestion = freezed, + Object? lastSeenTs = freezed, + Object? firstConsecutiveSeenTs = freezed, + Object? recentLostAnswers = null, + Object? failedToSend = null, + }) { + return _then(_value.copyWith( + messagesSent: null == messagesSent + ? _value.messagesSent + : messagesSent // ignore: cast_nullable_to_non_nullable + as int, + messagesRcvd: null == messagesRcvd + ? _value.messagesRcvd + : messagesRcvd // ignore: cast_nullable_to_non_nullable + as int, + questionsInFlight: null == questionsInFlight + ? _value.questionsInFlight + : questionsInFlight // ignore: cast_nullable_to_non_nullable + as int, + lastQuestion: freezed == lastQuestion + ? _value.lastQuestion + : lastQuestion // ignore: cast_nullable_to_non_nullable + as Timestamp?, + lastSeenTs: freezed == lastSeenTs + ? _value.lastSeenTs + : lastSeenTs // ignore: cast_nullable_to_non_nullable + as Timestamp?, + firstConsecutiveSeenTs: freezed == firstConsecutiveSeenTs + ? _value.firstConsecutiveSeenTs + : firstConsecutiveSeenTs // ignore: cast_nullable_to_non_nullable + as Timestamp?, + recentLostAnswers: null == recentLostAnswers + ? _value.recentLostAnswers + : recentLostAnswers // ignore: cast_nullable_to_non_nullable + as int, + failedToSend: null == failedToSend + ? _value.failedToSend + : failedToSend // ignore: cast_nullable_to_non_nullable + as int, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_RPCStatsCopyWith<$Res> implements $RPCStatsCopyWith<$Res> { + factory _$$_RPCStatsCopyWith( + _$_RPCStats value, $Res Function(_$_RPCStats) then) = + __$$_RPCStatsCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {int messagesSent, + int messagesRcvd, + int questionsInFlight, + Timestamp? lastQuestion, + Timestamp? lastSeenTs, + Timestamp? firstConsecutiveSeenTs, + int recentLostAnswers, + int failedToSend}); +} + +/// @nodoc +class __$$_RPCStatsCopyWithImpl<$Res> + extends _$RPCStatsCopyWithImpl<$Res, _$_RPCStats> + implements _$$_RPCStatsCopyWith<$Res> { + __$$_RPCStatsCopyWithImpl( + _$_RPCStats _value, $Res Function(_$_RPCStats) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? messagesSent = null, + Object? messagesRcvd = null, + Object? questionsInFlight = null, + Object? lastQuestion = freezed, + Object? lastSeenTs = freezed, + Object? firstConsecutiveSeenTs = freezed, + Object? recentLostAnswers = null, + Object? failedToSend = null, + }) { + return _then(_$_RPCStats( + messagesSent: null == messagesSent + ? _value.messagesSent + : messagesSent // ignore: cast_nullable_to_non_nullable + as int, + messagesRcvd: null == messagesRcvd + ? _value.messagesRcvd + : messagesRcvd // ignore: cast_nullable_to_non_nullable + as int, + questionsInFlight: null == questionsInFlight + ? _value.questionsInFlight + : questionsInFlight // ignore: cast_nullable_to_non_nullable + as int, + lastQuestion: freezed == lastQuestion + ? _value.lastQuestion + : lastQuestion // ignore: cast_nullable_to_non_nullable + as Timestamp?, + lastSeenTs: freezed == lastSeenTs + ? _value.lastSeenTs + : lastSeenTs // ignore: cast_nullable_to_non_nullable + as Timestamp?, + firstConsecutiveSeenTs: freezed == firstConsecutiveSeenTs + ? _value.firstConsecutiveSeenTs + : firstConsecutiveSeenTs // ignore: cast_nullable_to_non_nullable + as Timestamp?, + recentLostAnswers: null == recentLostAnswers + ? _value.recentLostAnswers + : recentLostAnswers // ignore: cast_nullable_to_non_nullable + as int, + failedToSend: null == failedToSend + ? _value.failedToSend + : failedToSend // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_RPCStats implements _RPCStats { + const _$_RPCStats( + {required this.messagesSent, + required this.messagesRcvd, + required this.questionsInFlight, + required this.lastQuestion, + required this.lastSeenTs, + required this.firstConsecutiveSeenTs, + required this.recentLostAnswers, + required this.failedToSend}); + + factory _$_RPCStats.fromJson(Map json) => + _$$_RPCStatsFromJson(json); + + @override + final int messagesSent; + @override + final int messagesRcvd; + @override + final int questionsInFlight; + @override + final Timestamp? lastQuestion; + @override + final Timestamp? lastSeenTs; + @override + final Timestamp? firstConsecutiveSeenTs; + @override + final int recentLostAnswers; + @override + final int failedToSend; + + @override + String toString() { + return 'RPCStats(messagesSent: $messagesSent, messagesRcvd: $messagesRcvd, questionsInFlight: $questionsInFlight, lastQuestion: $lastQuestion, lastSeenTs: $lastSeenTs, firstConsecutiveSeenTs: $firstConsecutiveSeenTs, recentLostAnswers: $recentLostAnswers, failedToSend: $failedToSend)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_RPCStats && + (identical(other.messagesSent, messagesSent) || + other.messagesSent == messagesSent) && + (identical(other.messagesRcvd, messagesRcvd) || + other.messagesRcvd == messagesRcvd) && + (identical(other.questionsInFlight, questionsInFlight) || + other.questionsInFlight == questionsInFlight) && + (identical(other.lastQuestion, lastQuestion) || + other.lastQuestion == lastQuestion) && + (identical(other.lastSeenTs, lastSeenTs) || + other.lastSeenTs == lastSeenTs) && + (identical(other.firstConsecutiveSeenTs, firstConsecutiveSeenTs) || + other.firstConsecutiveSeenTs == firstConsecutiveSeenTs) && + (identical(other.recentLostAnswers, recentLostAnswers) || + other.recentLostAnswers == recentLostAnswers) && + (identical(other.failedToSend, failedToSend) || + other.failedToSend == failedToSend)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash( + runtimeType, + messagesSent, + messagesRcvd, + questionsInFlight, + lastQuestion, + lastSeenTs, + firstConsecutiveSeenTs, + recentLostAnswers, + failedToSend); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_RPCStatsCopyWith<_$_RPCStats> get copyWith => + __$$_RPCStatsCopyWithImpl<_$_RPCStats>(this, _$identity); + + @override + Map toJson() { + return _$$_RPCStatsToJson( + this, + ); + } +} + +abstract class _RPCStats implements RPCStats { + const factory _RPCStats( + {required final int messagesSent, + required final int messagesRcvd, + required final int questionsInFlight, + required final Timestamp? lastQuestion, + required final Timestamp? lastSeenTs, + required final Timestamp? firstConsecutiveSeenTs, + required final int recentLostAnswers, + required final int failedToSend}) = _$_RPCStats; + + factory _RPCStats.fromJson(Map json) = _$_RPCStats.fromJson; + + @override + int get messagesSent; + @override + int get messagesRcvd; + @override + int get questionsInFlight; + @override + Timestamp? get lastQuestion; + @override + Timestamp? get lastSeenTs; + @override + Timestamp? get firstConsecutiveSeenTs; + @override + int get recentLostAnswers; + @override + int get failedToSend; + @override + @JsonKey(ignore: true) + _$$_RPCStatsCopyWith<_$_RPCStats> get copyWith => + throw _privateConstructorUsedError; +} + +PeerStats _$PeerStatsFromJson(Map json) { + return _PeerStats.fromJson(json); +} + +/// @nodoc +mixin _$PeerStats { + Timestamp get timeAdded => throw _privateConstructorUsedError; + RPCStats get rpcStats => throw _privateConstructorUsedError; + LatencyStats? get latency => throw _privateConstructorUsedError; + TransferStatsDownUp get transfer => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $PeerStatsCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $PeerStatsCopyWith<$Res> { + factory $PeerStatsCopyWith(PeerStats value, $Res Function(PeerStats) then) = + _$PeerStatsCopyWithImpl<$Res, PeerStats>; + @useResult + $Res call( + {Timestamp timeAdded, + RPCStats rpcStats, + LatencyStats? latency, + TransferStatsDownUp transfer}); + + $RPCStatsCopyWith<$Res> get rpcStats; + $LatencyStatsCopyWith<$Res>? get latency; + $TransferStatsDownUpCopyWith<$Res> get transfer; +} + +/// @nodoc +class _$PeerStatsCopyWithImpl<$Res, $Val extends PeerStats> + implements $PeerStatsCopyWith<$Res> { + _$PeerStatsCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? timeAdded = null, + Object? rpcStats = null, + Object? latency = freezed, + Object? transfer = null, + }) { + return _then(_value.copyWith( + timeAdded: null == timeAdded + ? _value.timeAdded + : timeAdded // ignore: cast_nullable_to_non_nullable + as Timestamp, + rpcStats: null == rpcStats + ? _value.rpcStats + : rpcStats // ignore: cast_nullable_to_non_nullable + as RPCStats, + latency: freezed == latency + ? _value.latency + : latency // ignore: cast_nullable_to_non_nullable + as LatencyStats?, + transfer: null == transfer + ? _value.transfer + : transfer // ignore: cast_nullable_to_non_nullable + as TransferStatsDownUp, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $RPCStatsCopyWith<$Res> get rpcStats { + return $RPCStatsCopyWith<$Res>(_value.rpcStats, (value) { + return _then(_value.copyWith(rpcStats: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $LatencyStatsCopyWith<$Res>? get latency { + if (_value.latency == null) { + return null; + } + + return $LatencyStatsCopyWith<$Res>(_value.latency!, (value) { + return _then(_value.copyWith(latency: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $TransferStatsDownUpCopyWith<$Res> get transfer { + return $TransferStatsDownUpCopyWith<$Res>(_value.transfer, (value) { + return _then(_value.copyWith(transfer: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$_PeerStatsCopyWith<$Res> implements $PeerStatsCopyWith<$Res> { + factory _$$_PeerStatsCopyWith( + _$_PeerStats value, $Res Function(_$_PeerStats) then) = + __$$_PeerStatsCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {Timestamp timeAdded, + RPCStats rpcStats, + LatencyStats? latency, + TransferStatsDownUp transfer}); + + @override + $RPCStatsCopyWith<$Res> get rpcStats; + @override + $LatencyStatsCopyWith<$Res>? get latency; + @override + $TransferStatsDownUpCopyWith<$Res> get transfer; +} + +/// @nodoc +class __$$_PeerStatsCopyWithImpl<$Res> + extends _$PeerStatsCopyWithImpl<$Res, _$_PeerStats> + implements _$$_PeerStatsCopyWith<$Res> { + __$$_PeerStatsCopyWithImpl( + _$_PeerStats _value, $Res Function(_$_PeerStats) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? timeAdded = null, + Object? rpcStats = null, + Object? latency = freezed, + Object? transfer = null, + }) { + return _then(_$_PeerStats( + timeAdded: null == timeAdded + ? _value.timeAdded + : timeAdded // ignore: cast_nullable_to_non_nullable + as Timestamp, + rpcStats: null == rpcStats + ? _value.rpcStats + : rpcStats // ignore: cast_nullable_to_non_nullable + as RPCStats, + latency: freezed == latency + ? _value.latency + : latency // ignore: cast_nullable_to_non_nullable + as LatencyStats?, + transfer: null == transfer + ? _value.transfer + : transfer // ignore: cast_nullable_to_non_nullable + as TransferStatsDownUp, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_PeerStats implements _PeerStats { + const _$_PeerStats( + {required this.timeAdded, + required this.rpcStats, + this.latency, + required this.transfer}); + + factory _$_PeerStats.fromJson(Map json) => + _$$_PeerStatsFromJson(json); + + @override + final Timestamp timeAdded; + @override + final RPCStats rpcStats; + @override + final LatencyStats? latency; + @override + final TransferStatsDownUp transfer; + + @override + String toString() { + return 'PeerStats(timeAdded: $timeAdded, rpcStats: $rpcStats, latency: $latency, transfer: $transfer)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_PeerStats && + (identical(other.timeAdded, timeAdded) || + other.timeAdded == timeAdded) && + (identical(other.rpcStats, rpcStats) || + other.rpcStats == rpcStats) && + (identical(other.latency, latency) || other.latency == latency) && + (identical(other.transfer, transfer) || + other.transfer == transfer)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => + Object.hash(runtimeType, timeAdded, rpcStats, latency, transfer); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_PeerStatsCopyWith<_$_PeerStats> get copyWith => + __$$_PeerStatsCopyWithImpl<_$_PeerStats>(this, _$identity); + + @override + Map toJson() { + return _$$_PeerStatsToJson( + this, + ); + } +} + +abstract class _PeerStats implements PeerStats { + const factory _PeerStats( + {required final Timestamp timeAdded, + required final RPCStats rpcStats, + final LatencyStats? latency, + required final TransferStatsDownUp transfer}) = _$_PeerStats; + + factory _PeerStats.fromJson(Map json) = + _$_PeerStats.fromJson; + + @override + Timestamp get timeAdded; + @override + RPCStats get rpcStats; + @override + LatencyStats? get latency; + @override + TransferStatsDownUp get transfer; + @override + @JsonKey(ignore: true) + _$$_PeerStatsCopyWith<_$_PeerStats> get copyWith => + throw _privateConstructorUsedError; +} + +PeerTableData _$PeerTableDataFromJson(Map json) { + return _PeerTableData.fromJson(json); +} + +/// @nodoc +mixin _$PeerTableData { + List> get nodeIds => + throw _privateConstructorUsedError; + String get peerAddress => throw _privateConstructorUsedError; + PeerStats get peerStats => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $PeerTableDataCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $PeerTableDataCopyWith<$Res> { + factory $PeerTableDataCopyWith( + PeerTableData value, $Res Function(PeerTableData) then) = + _$PeerTableDataCopyWithImpl<$Res, PeerTableData>; + @useResult + $Res call( + {List> nodeIds, + String peerAddress, + PeerStats peerStats}); + + $PeerStatsCopyWith<$Res> get peerStats; +} + +/// @nodoc +class _$PeerTableDataCopyWithImpl<$Res, $Val extends PeerTableData> + implements $PeerTableDataCopyWith<$Res> { + _$PeerTableDataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? nodeIds = null, + Object? peerAddress = null, + Object? peerStats = null, + }) { + return _then(_value.copyWith( + nodeIds: null == nodeIds + ? _value.nodeIds + : nodeIds // ignore: cast_nullable_to_non_nullable + as List>, + peerAddress: null == peerAddress + ? _value.peerAddress + : peerAddress // ignore: cast_nullable_to_non_nullable + as String, + peerStats: null == peerStats + ? _value.peerStats + : peerStats // ignore: cast_nullable_to_non_nullable + as PeerStats, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $PeerStatsCopyWith<$Res> get peerStats { + return $PeerStatsCopyWith<$Res>(_value.peerStats, (value) { + return _then(_value.copyWith(peerStats: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$_PeerTableDataCopyWith<$Res> + implements $PeerTableDataCopyWith<$Res> { + factory _$$_PeerTableDataCopyWith( + _$_PeerTableData value, $Res Function(_$_PeerTableData) then) = + __$$_PeerTableDataCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {List> nodeIds, + String peerAddress, + PeerStats peerStats}); + + @override + $PeerStatsCopyWith<$Res> get peerStats; +} + +/// @nodoc +class __$$_PeerTableDataCopyWithImpl<$Res> + extends _$PeerTableDataCopyWithImpl<$Res, _$_PeerTableData> + implements _$$_PeerTableDataCopyWith<$Res> { + __$$_PeerTableDataCopyWithImpl( + _$_PeerTableData _value, $Res Function(_$_PeerTableData) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? nodeIds = null, + Object? peerAddress = null, + Object? peerStats = null, + }) { + return _then(_$_PeerTableData( + nodeIds: null == nodeIds + ? _value._nodeIds + : nodeIds // ignore: cast_nullable_to_non_nullable + as List>, + peerAddress: null == peerAddress + ? _value.peerAddress + : peerAddress // ignore: cast_nullable_to_non_nullable + as String, + peerStats: null == peerStats + ? _value.peerStats + : peerStats // ignore: cast_nullable_to_non_nullable + as PeerStats, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_PeerTableData implements _PeerTableData { + const _$_PeerTableData( + {required final List> nodeIds, + required this.peerAddress, + required this.peerStats}) + : _nodeIds = nodeIds; + + factory _$_PeerTableData.fromJson(Map json) => + _$$_PeerTableDataFromJson(json); + + final List> _nodeIds; + @override + List> get nodeIds { + if (_nodeIds is EqualUnmodifiableListView) return _nodeIds; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_nodeIds); + } + + @override + final String peerAddress; + @override + final PeerStats peerStats; + + @override + String toString() { + return 'PeerTableData(nodeIds: $nodeIds, peerAddress: $peerAddress, peerStats: $peerStats)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_PeerTableData && + const DeepCollectionEquality().equals(other._nodeIds, _nodeIds) && + (identical(other.peerAddress, peerAddress) || + other.peerAddress == peerAddress) && + (identical(other.peerStats, peerStats) || + other.peerStats == peerStats)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, + const DeepCollectionEquality().hash(_nodeIds), peerAddress, peerStats); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_PeerTableDataCopyWith<_$_PeerTableData> get copyWith => + __$$_PeerTableDataCopyWithImpl<_$_PeerTableData>(this, _$identity); + + @override + Map toJson() { + return _$$_PeerTableDataToJson( + this, + ); + } +} + +abstract class _PeerTableData implements PeerTableData { + const factory _PeerTableData( + {required final List> nodeIds, + required final String peerAddress, + required final PeerStats peerStats}) = _$_PeerTableData; + + factory _PeerTableData.fromJson(Map json) = + _$_PeerTableData.fromJson; + + @override + List> get nodeIds; + @override + String get peerAddress; + @override + PeerStats get peerStats; + @override + @JsonKey(ignore: true) + _$$_PeerTableDataCopyWith<_$_PeerTableData> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/veilid-flutter/lib/veilid_state.g.dart b/veilid-flutter/lib/veilid_state.g.dart new file mode 100644 index 00000000..47bcf611 --- /dev/null +++ b/veilid-flutter/lib/veilid_state.g.dart @@ -0,0 +1,114 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'veilid_state.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$_LatencyStats _$$_LatencyStatsFromJson(Map json) => + _$_LatencyStats( + fastest: TimestampDuration.fromJson(json['fastest']), + average: TimestampDuration.fromJson(json['average']), + slowest: TimestampDuration.fromJson(json['slowest']), + ); + +Map _$$_LatencyStatsToJson(_$_LatencyStats instance) => + { + 'fastest': instance.fastest.toJson(), + 'average': instance.average.toJson(), + 'slowest': instance.slowest.toJson(), + }; + +_$_TransferStats _$$_TransferStatsFromJson(Map json) => + _$_TransferStats( + total: BigInt.parse(json['total'] as String), + maximum: BigInt.parse(json['maximum'] as String), + average: BigInt.parse(json['average'] as String), + minimum: BigInt.parse(json['minimum'] as String), + ); + +Map _$$_TransferStatsToJson(_$_TransferStats instance) => + { + 'total': instance.total.toString(), + 'maximum': instance.maximum.toString(), + 'average': instance.average.toString(), + 'minimum': instance.minimum.toString(), + }; + +_$_TransferStatsDownUp _$$_TransferStatsDownUpFromJson( + Map json) => + _$_TransferStatsDownUp( + down: TransferStats.fromJson(json['down'] as Map), + up: TransferStats.fromJson(json['up'] as Map), + ); + +Map _$$_TransferStatsDownUpToJson( + _$_TransferStatsDownUp instance) => + { + 'down': instance.down.toJson(), + 'up': instance.up.toJson(), + }; + +_$_RPCStats _$$_RPCStatsFromJson(Map json) => _$_RPCStats( + messagesSent: json['messages_sent'] as int, + messagesRcvd: json['messages_rcvd'] as int, + questionsInFlight: json['questions_in_flight'] as int, + lastQuestion: json['last_question'] == null + ? null + : Timestamp.fromJson(json['last_question']), + lastSeenTs: json['last_seen_ts'] == null + ? null + : Timestamp.fromJson(json['last_seen_ts']), + firstConsecutiveSeenTs: json['first_consecutive_seen_ts'] == null + ? null + : Timestamp.fromJson(json['first_consecutive_seen_ts']), + recentLostAnswers: json['recent_lost_answers'] as int, + failedToSend: json['failed_to_send'] as int, + ); + +Map _$$_RPCStatsToJson(_$_RPCStats instance) => + { + 'messages_sent': instance.messagesSent, + 'messages_rcvd': instance.messagesRcvd, + 'questions_in_flight': instance.questionsInFlight, + 'last_question': instance.lastQuestion?.toJson(), + 'last_seen_ts': instance.lastSeenTs?.toJson(), + 'first_consecutive_seen_ts': instance.firstConsecutiveSeenTs?.toJson(), + 'recent_lost_answers': instance.recentLostAnswers, + 'failed_to_send': instance.failedToSend, + }; + +_$_PeerStats _$$_PeerStatsFromJson(Map json) => _$_PeerStats( + timeAdded: Timestamp.fromJson(json['time_added']), + rpcStats: RPCStats.fromJson(json['rpc_stats'] as Map), + latency: json['latency'] == null + ? null + : LatencyStats.fromJson(json['latency'] as Map), + transfer: TransferStatsDownUp.fromJson( + json['transfer'] as Map), + ); + +Map _$$_PeerStatsToJson(_$_PeerStats instance) => + { + 'time_added': instance.timeAdded.toJson(), + 'rpc_stats': instance.rpcStats.toJson(), + 'latency': instance.latency?.toJson(), + 'transfer': instance.transfer.toJson(), + }; + +_$_PeerTableData _$$_PeerTableDataFromJson(Map json) => + _$_PeerTableData( + nodeIds: (json['node_ids'] as List) + .map(Typed.fromJson) + .toList(), + peerAddress: json['peer_address'] as String, + peerStats: PeerStats.fromJson(json['peer_stats'] as Map), + ); + +Map _$$_PeerTableDataToJson(_$_PeerTableData instance) => + { + 'node_ids': instance.nodeIds.map((e) => e.toJson()).toList(), + 'peer_address': instance.peerAddress, + 'peer_stats': instance.peerStats.toJson(), + }; diff --git a/veilid-flutter/pubspec.yaml b/veilid-flutter/pubspec.yaml index 04dbdad0..37467142 100644 --- a/veilid-flutter/pubspec.yaml +++ b/veilid-flutter/pubspec.yaml @@ -18,11 +18,19 @@ dependencies: path: ^1.8.0 system_info2: ^3.0.2 charcode: ^1.3.1 + freezed_annotation: ^2.2.0 + json_annotation: ^4.8.1 + equatable: ^2.0.5 dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^2.0.1 + build_runner: ^2.4.6 + freezed: ^2.3.5 + json_serializable: ^6.7.1 + mockito: ^5.4.2 + pigeon: ^10.1.1 # The following section is specific to Flutter. flutter: