From c194f616440b27a928df8287be1e5051a862a6e8 Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Fri, 25 Apr 2025 17:18:39 -0400 Subject: [PATCH] Local Rehydration --- .../src/network_manager/direct_boot.rs | 4 + veilid-core/src/routing_table/mod.rs | 69 +- .../operations/operation_inspect_value.rs | 27 +- .../src/rpc_processor/rpc_inspect_value.rs | 16 +- veilid-core/src/storage_manager/debug.rs | 18 +- veilid-core/src/storage_manager/get_value.rs | 8 +- .../src/storage_manager/inspect_value.rs | 86 +- veilid-core/src/storage_manager/mod.rs | 489 +- .../outbound_watch_manager/mod.rs | 2 +- .../outbound_watch_manager/outbound_watch.rs | 39 +- .../record_store/inspect_cache.rs | 4 +- .../src/storage_manager/record_store/mod.rs | 114 +- veilid-core/src/storage_manager/rehydrate.rs | 271 + veilid-core/src/storage_manager/set_value.rs | 8 +- veilid-core/src/storage_manager/tasks/mod.rs | 19 + .../tasks/rehydrate_records.rs | 50 + .../src/storage_manager/watch_value.rs | 59 +- veilid-core/src/veilid_api/debug.rs | 61 +- .../types/dht/dht_record_descriptor.rs | 2 +- .../veilid_api/types/dht/dht_record_report.rs | 63 +- veilid-core/src/veilid_api/types/dht/mod.rs | 8 +- .../types/dht/value_subkey_range_set.rs | 18 + veilid-flutter/analysis_options.yaml | 3 +- .../example/integration_test/test_dht.dart | 27 +- .../test_routing_context.dart | 4 + veilid-flutter/lib/routing_context.dart | 16 +- .../lib/routing_context.freezed.dart | 2331 ++-- veilid-flutter/lib/routing_context.g.dart | 56 +- veilid-flutter/lib/veilid_config.dart | 57 +- veilid-flutter/lib/veilid_config.freezed.dart | 10826 ++++++++-------- veilid-flutter/lib/veilid_config.g.dart | 241 +- veilid-flutter/lib/veilid_state.dart | 26 +- veilid-flutter/lib/veilid_state.freezed.dart | 7552 +++++------ veilid-flutter/lib/veilid_state.g.dart | 146 +- veilid-flutter/linux/rust.cmake | 2 +- .../{build.bat => update_generated_files.bat} | 0 .../{build.sh => update_generated_files.sh} | 0 veilid-flutter/windows/rust.cmake | 3 +- veilid-python/tests/test_dht.py | 42 +- veilid-python/veilid/schema/RecvMessage.json | 10 +- veilid-python/veilid/types.py | 15 +- veilid-server/src/main.rs | 4 +- veilid-wasm/src/veilid_client_js.rs | 2 + veilid-wasm/tests/package.json | 2 +- .../tests/src/VeilidRoutingContext.test.ts | 14 +- veilid-wasm/tests/src/utils/veilid-config.ts | 4 + veilid-wasm/tests/src/veilidClient.test.ts | 9 +- veilid-wasm/wasm_test.sh | 2 +- 48 files changed, 10889 insertions(+), 11940 deletions(-) create mode 100644 veilid-core/src/storage_manager/rehydrate.rs create mode 100644 veilid-core/src/storage_manager/tasks/rehydrate_records.rs rename veilid-flutter/{build.bat => update_generated_files.bat} (100%) rename veilid-flutter/{build.sh => update_generated_files.sh} (100%) diff --git a/veilid-core/src/network_manager/direct_boot.rs b/veilid-core/src/network_manager/direct_boot.rs index e6c4aa9f..d111ef87 100644 --- a/veilid-core/src/network_manager/direct_boot.rs +++ b/veilid-core/src/network_manager/direct_boot.rs @@ -1,5 +1,7 @@ use super::*; +impl_veilid_log_facility!("net"); + impl NetworkManager { // Direct bootstrap request handler (separate fallback mechanism from cheaper TXT bootstrap mechanism) #[instrument(level = "trace", target = "net", skip(self), ret, err)] @@ -16,6 +18,8 @@ impl NetworkManager { .collect(); let json_bytes = serialize_json(bootstrap_peerinfo).as_bytes().to_vec(); + veilid_log!(self trace "BOOT reponse: {}", String::from_utf8_lossy(&json_bytes)); + // Reply with a chunk of signed routing table let net = self.net(); match pin_future_closure!(net.send_data_to_existing_flow(flow, json_bytes)).await? { diff --git a/veilid-core/src/routing_table/mod.rs b/veilid-core/src/routing_table/mod.rs index 92ea734c..ef43c51f 100644 --- a/veilid-core/src/routing_table/mod.rs +++ b/veilid-core/src/routing_table/mod.rs @@ -899,44 +899,49 @@ impl RoutingTable { return false; } - // does it have some dial info we need? - let filter = |n: &NodeInfo| { - let mut keep = false; - // Bootstraps must have -only- inbound capable network class - if !matches!(n.network_class(), NetworkClass::InboundCapable) { + // Only nodes with direct publicinternet node info + let Some(signed_node_info) = e.signed_node_info(RoutingDomain::PublicInternet) + else { + return false; + }; + let SignedNodeInfo::Direct(signed_direct_node_info) = signed_node_info else { + return false; + }; + let node_info = signed_direct_node_info.node_info(); + + // Bootstraps must have -only- inbound capable network class + if !matches!(node_info.network_class(), NetworkClass::InboundCapable) { + return false; + } + + // Check for direct dialinfo and a good mix of protocol and address types + let mut keep = false; + for did in node_info.dial_info_detail_list() { + // Bootstraps must have -only- direct dial info + if !matches!(did.class, DialInfoClass::Direct) { return false; } - for did in n.dial_info_detail_list() { - // Bootstraps must have -only- direct dial info - if !matches!(did.class, DialInfoClass::Direct) { - return false; - } - if matches!(did.dial_info.address_type(), AddressType::IPV4) { - for (n, protocol_type) in protocol_types.iter().enumerate() { - if nodes_proto_v4[n] < max_per_type - && did.dial_info.protocol_type() == *protocol_type - { - nodes_proto_v4[n] += 1; - keep = true; - } + if matches!(did.dial_info.address_type(), AddressType::IPV4) { + for (n, protocol_type) in protocol_types.iter().enumerate() { + if nodes_proto_v4[n] < max_per_type + && did.dial_info.protocol_type() == *protocol_type + { + nodes_proto_v4[n] += 1; + keep = true; } - } else if matches!(did.dial_info.address_type(), AddressType::IPV6) { - for (n, protocol_type) in protocol_types.iter().enumerate() { - if nodes_proto_v6[n] < max_per_type - && did.dial_info.protocol_type() == *protocol_type - { - nodes_proto_v6[n] += 1; - keep = true; - } + } + } else if matches!(did.dial_info.address_type(), AddressType::IPV6) { + for (n, protocol_type) in protocol_types.iter().enumerate() { + if nodes_proto_v6[n] < max_per_type + && did.dial_info.protocol_type() == *protocol_type + { + nodes_proto_v6[n] += 1; + keep = true; } } } - keep - }; - - e.node_info(RoutingDomain::PublicInternet) - .map(filter) - .unwrap_or(false) + } + keep }) }, ) as RoutingTableEntryFilter; diff --git a/veilid-core/src/rpc_processor/coders/operations/operation_inspect_value.rs b/veilid-core/src/rpc_processor/coders/operations/operation_inspect_value.rs index a730ec8a..cf38133b 100644 --- a/veilid-core/src/rpc_processor/coders/operations/operation_inspect_value.rs +++ b/veilid-core/src/rpc_processor/coders/operations/operation_inspect_value.rs @@ -5,22 +5,13 @@ const MAX_INSPECT_VALUE_Q_SUBKEY_RANGES_LEN: usize = 512; pub const MAX_INSPECT_VALUE_A_SEQS_LEN: usize = 512; const MAX_INSPECT_VALUE_A_PEERS_LEN: usize = 20; -#[derive(Clone)] +#[derive(Debug, Clone)] pub(in crate::rpc_processor) struct ValidateInspectValueContext { pub last_descriptor: Option, pub subkeys: ValueSubkeyRangeSet, pub crypto_kind: CryptoKind, } -impl fmt::Debug for ValidateInspectValueContext { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("ValidateInspectValueContext") - .field("last_descriptor", &self.last_descriptor) - .field("crypto_kind", &self.crypto_kind) - .finish() - } -} - #[derive(Debug, Clone)] pub(in crate::rpc_processor) struct RPCOperationInspectValueQ { key: TypedKey, @@ -161,12 +152,20 @@ impl RPCOperationInspectValueA { }; // Ensure seqs returned does not exceeed subkeys requested - #[allow(clippy::unnecessary_cast)] - if self.seqs.len() as u64 > inspect_value_context.subkeys.len() as u64 { + let subkey_count = if inspect_value_context.subkeys.is_empty() + || inspect_value_context.subkeys.is_full() + || inspect_value_context.subkeys.len() > MAX_INSPECT_VALUE_A_SEQS_LEN as u64 + { + MAX_INSPECT_VALUE_A_SEQS_LEN as u64 + } else { + inspect_value_context.subkeys.len() + }; + if self.seqs.len() as u64 > subkey_count { return Err(RPCError::protocol(format!( - "InspectValue seqs length is greater than subkeys requested: {} > {}", + "InspectValue seqs length is greater than subkeys requested: {} > {}: {:#?}", self.seqs.len(), - inspect_value_context.subkeys.len() + subkey_count, + inspect_value_context ))); } diff --git a/veilid-core/src/rpc_processor/rpc_inspect_value.rs b/veilid-core/src/rpc_processor/rpc_inspect_value.rs index 2fbe0a98..4dcfb158 100644 --- a/veilid-core/src/rpc_processor/rpc_inspect_value.rs +++ b/veilid-core/src/rpc_processor/rpc_inspect_value.rs @@ -5,7 +5,7 @@ impl_veilid_log_facility!("rpc"); #[derive(Clone, Debug)] pub struct InspectValueAnswer { - pub seqs: Vec, + pub seqs: Vec>, pub peers: Vec>, pub descriptor: Option, } @@ -110,6 +110,11 @@ impl RPCProcessor { }; let (seqs, peers, descriptor) = inspect_value_a.destructure(); + let seqs = seqs + .into_iter() + .map(|x| if x == ValueSeqNum::MAX { None } else { Some(x) }) + .collect::>(); + if debug_target_enabled!("dht") { let debug_string_answer = format!( "OUT <== InspectValueA({} {} peers={}) <= {} seqs:\n{}", @@ -232,8 +237,15 @@ impl RPCProcessor { .inbound_inspect_value(key, subkeys, want_descriptor) .await .map_err(RPCError::internal)?); - (inspect_result.seqs, inspect_result.opt_descriptor) + ( + inspect_result.seqs().to_vec(), + inspect_result.opt_descriptor(), + ) }; + let inspect_result_seqs = inspect_result_seqs + .into_iter() + .map(|x| if let Some(s) = x { s } else { ValueSubkey::MAX }) + .collect::>(); if debug_target_enabled!("dht") { let debug_string_answer = format!( diff --git a/veilid-core/src/storage_manager/debug.rs b/veilid-core/src/storage_manager/debug.rs index d1f31e94..e3254f2f 100644 --- a/veilid-core/src/storage_manager/debug.rs +++ b/veilid-core/src/storage_manager/debug.rs @@ -79,7 +79,7 @@ impl StorageManager { pub async fn debug_local_record_subkey_info( &self, - key: TypedKey, + record_key: TypedKey, subkey: ValueSubkey, ) -> String { let inner = self.inner.lock().await; @@ -87,12 +87,12 @@ impl StorageManager { return "not initialized".to_owned(); }; local_record_store - .debug_record_subkey_info(key, subkey) + .debug_record_subkey_info(record_key, subkey) .await } pub async fn debug_remote_record_subkey_info( &self, - key: TypedKey, + record_key: TypedKey, subkey: ValueSubkey, ) -> String { let inner = self.inner.lock().await; @@ -100,17 +100,17 @@ impl StorageManager { return "not initialized".to_owned(); }; remote_record_store - .debug_record_subkey_info(key, subkey) + .debug_record_subkey_info(record_key, subkey) .await } - pub async fn debug_local_record_info(&self, key: TypedKey) -> String { + pub async fn debug_local_record_info(&self, record_key: TypedKey) -> String { let inner = self.inner.lock().await; let Some(local_record_store) = &inner.local_record_store else { return "not initialized".to_owned(); }; - let local_debug = local_record_store.debug_record_info(key); + let local_debug = local_record_store.debug_record_info(record_key); - let opened_debug = if let Some(o) = inner.opened_records.get(&key) { + let opened_debug = if let Some(o) = inner.opened_records.get(&record_key) { format!("Opened Record: {:#?}\n", o) } else { "".to_owned() @@ -119,11 +119,11 @@ impl StorageManager { format!("{}\n{}", local_debug, opened_debug) } - pub async fn debug_remote_record_info(&self, key: TypedKey) -> String { + pub async fn debug_remote_record_info(&self, record_key: TypedKey) -> String { let inner = self.inner.lock().await; let Some(remote_record_store) = &inner.remote_record_store else { return "not initialized".to_owned(); }; - remote_record_store.debug_record_info(key) + remote_record_store.debug_record_info(record_key) } } diff --git a/veilid-core/src/storage_manager/get_value.rs b/veilid-core/src/storage_manager/get_value.rs index d6900bc8..a9ee6802 100644 --- a/veilid-core/src/storage_manager/get_value.rs +++ b/veilid-core/src/storage_manager/get_value.rs @@ -28,7 +28,7 @@ impl StorageManager { #[instrument(level = "trace", target = "dht", skip_all, err)] pub(super) async fn outbound_get_value( &self, - key: TypedKey, + record_key: TypedKey, subkey: ValueSubkey, safety_selection: SafetySelection, last_get_result: GetResult, @@ -47,7 +47,7 @@ impl StorageManager { // Get the nodes we know are caching this value to seed the fanout let init_fanout_queue = { - self.get_value_nodes(key) + self.get_value_nodes(record_key) .await? .unwrap_or_default() .into_iter() @@ -93,7 +93,7 @@ impl StorageManager { .rpc_call_get_value( Destination::direct(next_node.routing_domain_filtered(routing_domain)) .with_safety(safety_selection), - key, + record_key, subkey, last_descriptor.map(|x| (*x).clone()), ) @@ -255,7 +255,7 @@ impl StorageManager { let routing_table = registry.routing_table(); let fanout_call = FanoutCall::new( &routing_table, - key, + record_key, key_count, fanout, consensus_count, diff --git a/veilid-core/src/storage_manager/inspect_value.rs b/veilid-core/src/storage_manager/inspect_value.rs index ce19aa8c..f69c9537 100644 --- a/veilid-core/src/storage_manager/inspect_value.rs +++ b/veilid-core/src/storage_manager/inspect_value.rs @@ -28,7 +28,7 @@ impl DescriptorInfo { /// Info tracked per subkey struct SubkeySeqCount { /// The newest sequence number found for a subkey - pub seq: ValueSeqNum, + pub seq: Option, /// The set of nodes that had the most recent value for this subkey pub consensus_nodes: Vec, /// The set of nodes that had any value for this subkey @@ -44,6 +44,7 @@ struct OutboundInspectValueContext { } /// The result of the outbound_get_value operation +#[derive(Debug, Clone)] pub(super) struct OutboundInspectValueResult { /// Fanout results for each subkey pub subkey_fanout_results: Vec, @@ -56,13 +57,14 @@ impl StorageManager { #[instrument(level = "trace", target = "dht", skip_all, err)] pub(super) async fn outbound_inspect_value( &self, - key: TypedKey, + record_key: TypedKey, subkeys: ValueSubkeyRangeSet, safety_selection: SafetySelection, local_inspect_result: InspectResult, use_set_scope: bool, ) -> VeilidAPIResult { let routing_domain = RoutingDomain::PublicInternet; + let requested_subkeys = subkeys.clone(); // Get the DHT parameters for 'InspectValue' // Can use either 'get scope' or 'set scope' depending on the purpose of the inspection @@ -86,7 +88,7 @@ impl StorageManager { // Get the nodes we know are caching this value to seed the fanout let init_fanout_queue = { - self.get_value_nodes(key) + self.get_value_nodes(record_key) .await? .unwrap_or_default() .into_iter() @@ -99,16 +101,16 @@ impl StorageManager { }; // Make do-inspect-value answer context - let opt_descriptor_info = if let Some(descriptor) = &local_inspect_result.opt_descriptor { + let opt_descriptor_info = if let Some(descriptor) = local_inspect_result.opt_descriptor() { // Get the descriptor info. This also truncates the subkeys list to what can be returned from the network. - Some(DescriptorInfo::new(descriptor.clone(), &subkeys)?) + Some(DescriptorInfo::new(descriptor, &subkeys)?) } else { None }; let context = Arc::new(Mutex::new(OutboundInspectValueContext { seqcounts: local_inspect_result - .seqs + .seqs() .iter() .map(|s| SubkeySeqCount { seq: *s, @@ -127,7 +129,7 @@ impl StorageManager { move |next_node: NodeRef| -> PinBoxFutureStatic { let context = context.clone(); let registry = registry.clone(); - let opt_descriptor = local_inspect_result.opt_descriptor.clone(); + let opt_descriptor = local_inspect_result.opt_descriptor(); let subkeys = subkeys.clone(); Box::pin(async move { let rpc_processor = registry.rpc_processor(); @@ -136,7 +138,7 @@ impl StorageManager { rpc_processor .rpc_call_inspect_value( Destination::direct(next_node.routing_domain_filtered(routing_domain)).with_safety(safety_selection), - key, + record_key, subkeys.clone(), opt_descriptor.map(|x| (*x).clone()), ) @@ -237,13 +239,13 @@ impl StorageManager { // Then take that sequence number and note that we have gotten newer sequence numbers so we keep // looking for consensus // If the sequence number matches the old sequence number, then we keep the value node for reference later - if answer_seq != ValueSeqNum::MAX { - if ctx_seqcnt.seq == ValueSeqNum::MAX || answer_seq > ctx_seqcnt.seq + if let Some(answer_seq) = answer_seq { + if ctx_seqcnt.seq.is_none() || answer_seq > ctx_seqcnt.seq.unwrap() { // One node has shown us the latest sequence numbers so far - ctx_seqcnt.seq = answer_seq; + ctx_seqcnt.seq = Some(answer_seq); ctx_seqcnt.consensus_nodes = vec![next_node.clone()]; - } else if answer_seq == ctx_seqcnt.seq { + } else if answer_seq == ctx_seqcnt.seq.unwrap() { // Keep the nodes that showed us the latest values ctx_seqcnt.consensus_nodes.push(next_node.clone()); } @@ -288,7 +290,7 @@ impl StorageManager { let routing_table = self.routing_table(); let fanout_call = FanoutCall::new( &routing_table, - key, + record_key, key_count, fanout, consensus_count, @@ -322,28 +324,41 @@ impl StorageManager { veilid_log!(self debug "InspectValue Fanout: {:#}:\n{}", fanout_result, debug_fanout_results(&subkey_fanout_results)); } - Ok(OutboundInspectValueResult { + let result = OutboundInspectValueResult { subkey_fanout_results, - inspect_result: InspectResult { - subkeys: ctx - .opt_descriptor_info + inspect_result: InspectResult::new( + self, + requested_subkeys, + "outbound_inspect_value", + ctx.opt_descriptor_info .as_ref() .map(|d| d.subkeys.clone()) .unwrap_or_default(), - seqs: ctx.seqcounts.iter().map(|cs| cs.seq).collect(), - opt_descriptor: ctx - .opt_descriptor_info + ctx.seqcounts.iter().map(|cs| cs.seq).collect(), + ctx.opt_descriptor_info .as_ref() .map(|d| d.descriptor.clone()), - }, - }) + )?, + }; + + #[allow(clippy::unnecessary_cast)] + { + if result.inspect_result.subkeys().len() as u64 + != result.subkey_fanout_results.len() as u64 + { + veilid_log!(self error "mismatch between subkeys returned and fanout results returned: {}!={}", result.inspect_result.subkeys().len(), result.subkey_fanout_results.len()); + apibail_internal!("subkey and fanout list length mismatched"); + } + } + + Ok(result) } /// Handle a received 'Inspect Value' query #[instrument(level = "trace", target = "dht", skip_all)] pub async fn inbound_inspect_value( &self, - key: TypedKey, + record_key: TypedKey, subkeys: ValueSubkeyRangeSet, want_descriptor: bool, ) -> VeilidAPIResult> { @@ -352,24 +367,25 @@ impl StorageManager { // See if this is a remote or local value let (_is_local, inspect_result) = { // See if the subkey we are getting has a last known local value - let mut local_inspect_result = - Self::handle_inspect_local_value_inner(&mut inner, key, subkeys.clone(), true) - .await?; + let mut local_inspect_result = self + .handle_inspect_local_value_inner(&mut inner, record_key, subkeys.clone(), true) + .await?; // If this is local, it must have a descriptor already - if local_inspect_result.opt_descriptor.is_some() { + if local_inspect_result.opt_descriptor().is_some() { if !want_descriptor { - local_inspect_result.opt_descriptor = None; + local_inspect_result.drop_descriptor(); } (true, local_inspect_result) } else { // See if the subkey we are getting has a last known remote value - let remote_inspect_result = Self::handle_inspect_remote_value_inner( - &mut inner, - key, - subkeys, - want_descriptor, - ) - .await?; + let remote_inspect_result = self + .handle_inspect_remote_value_inner( + &mut inner, + record_key, + subkeys, + want_descriptor, + ) + .await?; (false, remote_inspect_result) } }; diff --git a/veilid-core/src/storage_manager/mod.rs b/veilid-core/src/storage_manager/mod.rs index 4a2507e6..4d3066c9 100644 --- a/veilid-core/src/storage_manager/mod.rs +++ b/veilid-core/src/storage_manager/mod.rs @@ -3,14 +3,17 @@ mod get_value; mod inspect_value; mod outbound_watch_manager; mod record_store; +mod rehydrate; mod set_value; mod tasks; mod types; mod watch_value; use super::*; + use outbound_watch_manager::*; use record_store::*; +use rehydrate::*; use routing_table::*; use rpc_processor::*; @@ -40,18 +43,24 @@ const RECONCILE_OUTBOUND_WATCHES_INTERVAL_SECS: u32 = 300; const RENEW_OUTBOUND_WATCHES_DURATION_SECS: u32 = 30; /// Frequency to check for expired server-side watched records const CHECK_WATCHED_RECORDS_INTERVAL_SECS: u32 = 1; +/// Frequency to process record rehydration requests +const REHYDRATE_RECORDS_INTERVAL_SECS: u32 = 1; +/// Number of rehydration requests to process in parallel +const REHYDRATE_BATCH_SIZE: usize = 4; /// Table store table for storage manager metadata const STORAGE_MANAGER_METADATA: &str = "storage_manager_metadata"; /// Storage manager metadata key name for offline subkey write persistence const OFFLINE_SUBKEY_WRITES: &[u8] = b"offline_subkey_writes"; /// Outbound watch manager metadata key name for watch persistence const OUTBOUND_WATCH_MANAGER: &[u8] = b"outbound_watch_manager"; +/// Rehydration requests metadata key name for watch persistence +const REHYDRATION_REQUESTS: &[u8] = b"rehydration_requests"; #[derive(Debug, Clone)] /// A single 'value changed' message to send struct ValueChangedInfo { target: Target, - key: TypedKey, + record_key: TypedKey, subkeys: ValueSubkeyRangeSet, count: u32, watch_id: u64, @@ -71,6 +80,8 @@ struct StorageManagerInner { pub offline_subkey_writes: HashMap, /// Record subkeys that are currently being written to in the foreground pub active_subkey_writes: HashMap, + /// Records that have rehydration requests + pub rehydration_requests: HashMap, /// State management for outbound watches pub outbound_watch_manager: OutboundWatchManager, /// Storage manager metadata that is persistent, including copy of offline subkey writes @@ -88,6 +99,7 @@ impl fmt::Debug for StorageManagerInner { .field("remote_record_store", &self.remote_record_store) .field("offline_subkey_writes", &self.offline_subkey_writes) .field("active_subkey_writes", &self.active_subkey_writes) + .field("rehydration_requests", &self.rehydration_requests) .field("outbound_watch_manager", &self.outbound_watch_manager) //.field("metadata_db", &self.metadata_db) //.field("tick_future", &self.tick_future) @@ -106,6 +118,7 @@ pub(crate) struct StorageManager { send_value_changes_task: TickTask, check_outbound_watches_task: TickTask, check_inbound_watches_task: TickTask, + rehydrate_records_task: TickTask, // Anonymous watch keys anonymous_watch_keys: TypedKeyPairGroup, @@ -190,6 +203,10 @@ impl StorageManager { "check_watched_records_task", CHECK_WATCHED_RECORDS_INTERVAL_SECS, ), + rehydrate_records_task: TickTask::new( + "rehydrate_records_task", + REHYDRATE_RECORDS_INTERVAL_SECS, + ), outbound_watch_lock_table: AsyncTagLockTable::new(), anonymous_watch_keys, background_operation_processor: DeferredStreamProcessor::new(), @@ -349,6 +366,7 @@ impl StorageManager { let tx = metadata_db.transact(); tx.store_json(0, OFFLINE_SUBKEY_WRITES, &inner.offline_subkey_writes)?; tx.store_json(0, OUTBOUND_WATCH_MANAGER, &inner.outbound_watch_manager)?; + tx.store_json(0, REHYDRATION_REQUESTS, &inner.rehydration_requests)?; tx.commit().await.wrap_err("failed to commit")? } Ok(()) @@ -380,6 +398,16 @@ impl StorageManager { Default::default() } }; + inner.rehydration_requests = match metadata_db.load_json(0, REHYDRATION_REQUESTS).await + { + Ok(v) => v.unwrap_or_default(), + Err(_) => { + if let Err(e) = metadata_db.delete(0, REHYDRATION_REQUESTS).await { + veilid_log!(self debug "rehydration_requests format changed, clearing: {}", e); + } + Default::default() + } + }; } Ok(()) } @@ -388,6 +416,10 @@ impl StorageManager { !self.inner.lock().await.offline_subkey_writes.is_empty() } + pub(super) async fn has_rehydration_requests(&self) -> bool { + !self.inner.lock().await.rehydration_requests.is_empty() + } + pub(super) fn dht_is_online(&self) -> bool { // Check if we have published peer info // Note, this is a best-effort check, subject to race conditions on the network's state @@ -489,7 +521,7 @@ impl StorageManager { #[instrument(level = "trace", target = "stor", skip_all)] pub async fn open_record( &self, - key: TypedKey, + record_key: TypedKey, writer: Option, safety_selection: SafetySelection, ) -> VeilidAPIResult { @@ -497,9 +529,22 @@ impl StorageManager { // See if we have a local record already or not if let Some(res) = self - .open_existing_record_inner(&mut inner, key, writer, safety_selection) + .open_existing_record_inner(&mut inner, record_key, writer, safety_selection) .await? { + drop(inner); + + // We had an existing record, so check the network to see if we should + // update it with what we have here + let get_consensus = self + .config() + .with(|c| c.network.dht.get_value_count as usize); + if let Err(e) = self + .rehydrate_record(record_key, ValueSubkeyRangeSet::full(), get_consensus) + .await + { + veilid_log!(self debug "rehydration failed: {}", e); + } return Ok(res); } @@ -513,68 +558,54 @@ impl StorageManager { // No last descriptor, no last value // Use the safety selection we opened the record with - let subkey: ValueSubkey = 0; - let res_rx = self - .outbound_get_value(key, subkey, safety_selection, GetResult::default()) + let result = self + .outbound_inspect_value( + record_key, + ValueSubkeyRangeSet::full(), + safety_selection, + InspectResult::default(), + false, + ) .await?; - // Wait for the first result - let Ok(result) = res_rx.recv_async().await else { - apibail_internal!("failed to receive results"); - }; - let result = result?; // If we got nothing back, the key wasn't found - if result.get_result.opt_value.is_none() && result.get_result.opt_descriptor.is_none() { + if result.inspect_result.opt_descriptor().is_none() { // No result - apibail_key_not_found!(key); - }; - let opt_last_seq = result - .get_result - .opt_value - .as_ref() - .map(|s| s.value_data().seq()); - - // Reopen inner to store value we just got - let out = { - let mut inner = self.inner.lock().await; - - // Check again to see if we have a local record already or not - // because waiting for the outbound_get_value action could result in the key being opened - // via some parallel process - - if let Some(res) = self - .open_existing_record_inner(&mut inner, key, writer, safety_selection) - .await? - { - return Ok(res); - } - - // Open the new record - self.open_new_record_inner( - &mut inner, - key, - writer, - subkey, - result.get_result, - safety_selection, - ) - .await + apibail_key_not_found!(record_key); }; - if out.is_ok() { - if let Some(last_seq) = opt_last_seq { - self.process_deferred_outbound_get_value_result(res_rx, key, subkey, last_seq); - } + // Check again to see if we have a local record already or not + // because waiting for the outbound_inspect_value action could result in the key being opened + // via some parallel process + let mut inner = self.inner.lock().await; + + if let Some(res) = self + .open_existing_record_inner(&mut inner, record_key, writer, safety_selection) + .await? + { + // Don't bother to rehydrate in this edge case + // We already checked above and won't have anything better than what + // is on the network in this case + return Ok(res); } - out + + // Open the new record + self.open_new_record_inner( + &mut inner, + record_key, + writer, + result.inspect_result, + safety_selection, + ) + .await } /// Close an opened local record #[instrument(level = "trace", target = "stor", skip_all)] - pub async fn close_record(&self, key: TypedKey) -> VeilidAPIResult<()> { + pub async fn close_record(&self, record_key: TypedKey) -> VeilidAPIResult<()> { // Attempt to close the record, returning the opened record if it wasn't already closed let mut inner = self.inner.lock().await; - Self::close_record_inner(&mut inner, key)?; + Self::close_record_inner(&mut inner, record_key)?; Ok(()) } @@ -593,10 +624,10 @@ impl StorageManager { /// Delete a local record #[instrument(level = "trace", target = "stor", skip_all)] - pub async fn delete_record(&self, key: TypedKey) -> VeilidAPIResult<()> { + pub async fn delete_record(&self, record_key: TypedKey) -> VeilidAPIResult<()> { // Ensure the record is closed let mut inner = self.inner.lock().await; - Self::close_record_inner(&mut inner, key)?; + Self::close_record_inner(&mut inner, record_key)?; // Get record from the local store let Some(local_record_store) = inner.local_record_store.as_mut() else { @@ -604,20 +635,20 @@ impl StorageManager { }; // Remove the record from the local store - local_record_store.delete_record(key).await + local_record_store.delete_record(record_key).await } /// Get the value of a subkey from an opened local record #[instrument(level = "trace", target = "stor", skip_all)] pub async fn get_value( &self, - key: TypedKey, + record_key: TypedKey, subkey: ValueSubkey, force_refresh: bool, ) -> VeilidAPIResult> { let mut inner = self.inner.lock().await; let safety_selection = { - let Some(opened_record) = inner.opened_records.get(&key) else { + let Some(opened_record) = inner.opened_records.get(&record_key) else { apibail_generic!("record not open"); }; opened_record.safety_selection() @@ -625,7 +656,7 @@ impl StorageManager { // See if the requested subkey is our local record store let last_get_result = - Self::handle_get_local_value_inner(&mut inner, key, subkey, true).await?; + Self::handle_get_local_value_inner(&mut inner, record_key, subkey, true).await?; // Return the existing value if we have one unless we are forcing a refresh if !force_refresh { @@ -653,7 +684,7 @@ impl StorageManager { .as_ref() .map(|v| v.value_data().seq()); let res_rx = self - .outbound_get_value(key, subkey, safety_selection, last_get_result) + .outbound_get_value(record_key, subkey, safety_selection, last_get_result) .await?; // Wait for the first result @@ -665,13 +696,18 @@ impl StorageManager { // Process the returned result let out = self - .process_outbound_get_value_result(key, subkey, opt_last_seq, result) + .process_outbound_get_value_result(record_key, subkey, opt_last_seq, result) .await?; if let Some(out) = &out { // If there's more to process, do it in the background if partial { - self.process_deferred_outbound_get_value_result(res_rx, key, subkey, out.seq()); + self.process_deferred_outbound_get_value_result( + res_rx, + record_key, + subkey, + out.seq(), + ); } } @@ -682,7 +718,7 @@ impl StorageManager { #[instrument(level = "trace", target = "stor", skip_all)] pub async fn set_value( &self, - key: TypedKey, + record_key: TypedKey, subkey: ValueSubkey, data: Vec, writer: Option, @@ -691,12 +727,12 @@ impl StorageManager { // Get cryptosystem let crypto = self.crypto(); - let Some(vcrypto) = crypto.get(key.kind) else { + let Some(vcrypto) = crypto.get(record_key.kind) else { apibail_generic!("unsupported cryptosystem"); }; let (safety_selection, opt_writer) = { - let Some(opened_record) = inner.opened_records.get(&key) else { + let Some(opened_record) = inner.opened_records.get(&record_key) else { apibail_generic!("record not open"); }; ( @@ -715,7 +751,7 @@ impl StorageManager { // See if the subkey we are modifying has a last known local value let last_get_result = - Self::handle_get_local_value_inner(&mut inner, key, subkey, true).await?; + Self::handle_get_local_value_inner(&mut inner, record_key, subkey, true).await?; // Get the descriptor and schema for the key let Some(descriptor) = last_get_result.opt_descriptor else { @@ -754,10 +790,10 @@ impl StorageManager { )?); // Write the value locally first - veilid_log!(self debug "Writing subkey locally: {}:{} len={}", key, subkey, signed_value_data.value_data().data().len() ); + veilid_log!(self debug "Writing subkey locally: {}:{} len={}", record_key, subkey, signed_value_data.value_data().data().len() ); Self::handle_set_local_value_inner( &mut inner, - key, + record_key, subkey, signed_value_data.clone(), InboundWatchUpdateMode::NoUpdate, @@ -767,9 +803,9 @@ impl StorageManager { // Note that we are writing this subkey actively // If it appears we are already doing this, then put it to the offline queue let already_writing = { - let asw = inner.active_subkey_writes.entry(key).or_default(); + let asw = inner.active_subkey_writes.entry(record_key).or_default(); if asw.contains(subkey) { - veilid_log!(self debug "Already writing to this subkey: {}:{}", key, subkey); + veilid_log!(self debug "Already writing to this subkey: {}:{}", record_key, subkey); true } else { // Add to our list of active subkey writes @@ -779,21 +815,21 @@ impl StorageManager { }; if already_writing || !self.dht_is_online() { - veilid_log!(self debug "Writing subkey offline: {}:{} len={}", key, subkey, signed_value_data.value_data().data().len() ); + veilid_log!(self debug "Writing subkey offline: {}:{} len={}", record_key, subkey, signed_value_data.value_data().data().len() ); // Add to offline writes to flush - Self::add_offline_subkey_write_inner(&mut inner, key, subkey, safety_selection); + Self::add_offline_subkey_write_inner(&mut inner, record_key, subkey, safety_selection); return Ok(None); }; // Drop the lock for network access drop(inner); - veilid_log!(self debug "Writing subkey to the network: {}:{} len={}", key, subkey, signed_value_data.value_data().data().len() ); + veilid_log!(self debug "Writing subkey to the network: {}:{} len={}", record_key, subkey, signed_value_data.value_data().data().len() ); // Use the safety selection we opened the record with let res_rx = match self .outbound_set_value( - key, + record_key, subkey, safety_selection, signed_value_data.clone(), @@ -805,15 +841,20 @@ impl StorageManager { Err(e) => { // Failed to write, try again later let mut inner = self.inner.lock().await; - Self::add_offline_subkey_write_inner(&mut inner, key, subkey, safety_selection); + Self::add_offline_subkey_write_inner( + &mut inner, + record_key, + subkey, + safety_selection, + ); // Remove from active subkey writes - let asw = inner.active_subkey_writes.get_mut(&key).unwrap(); + let asw = inner.active_subkey_writes.get_mut(&record_key).unwrap(); if !asw.remove(subkey) { - panic!("missing active subkey write: {}:{}", key, subkey); + panic!("missing active subkey write: {}:{}", record_key, subkey); } if asw.is_empty() { - inner.active_subkey_writes.remove(&key); + inner.active_subkey_writes.remove(&record_key); } return Err(e); } @@ -830,7 +871,7 @@ impl StorageManager { // Process the returned result let out = self .process_outbound_set_value_result( - key, + record_key, subkey, signed_value_data.value_data().clone(), safety_selection, @@ -842,7 +883,7 @@ impl StorageManager { if partial { self.process_deferred_outbound_set_value_result( res_rx, - key, + record_key, subkey, out.clone() .unwrap_or_else(|| signed_value_data.value_data().clone()), @@ -859,12 +900,12 @@ impl StorageManager { let mut inner = self.inner.lock().await; // Remove from active subkey writes - let asw = inner.active_subkey_writes.get_mut(&key).unwrap(); + let asw = inner.active_subkey_writes.get_mut(&record_key).unwrap(); if !asw.remove(subkey) { - panic!("missing active subkey write: {}:{}", key, subkey); + panic!("missing active subkey write: {}:{}", record_key, subkey); } if asw.is_empty() { - inner.active_subkey_writes.remove(&key); + inner.active_subkey_writes.remove(&record_key); } out @@ -874,14 +915,14 @@ impl StorageManager { #[instrument(level = "trace", target = "stor", skip_all)] pub async fn watch_values( &self, - key: TypedKey, + record_key: TypedKey, subkeys: ValueSubkeyRangeSet, expiration: Timestamp, count: u32, ) -> VeilidAPIResult { // Obtain the watch change lock // (may need to wait for background operations to complete on the watch) - let watch_lock = self.outbound_watch_lock_table.lock_tag(key).await; + let watch_lock = self.outbound_watch_lock_table.lock_tag(record_key).await; self.watch_values_inner(watch_lock, subkeys, expiration, count) .await @@ -996,22 +1037,25 @@ impl StorageManager { #[instrument(level = "trace", target = "stor", skip_all)] pub async fn cancel_watch_values( &self, - key: TypedKey, + record_key: TypedKey, subkeys: ValueSubkeyRangeSet, ) -> VeilidAPIResult { // Obtain the watch change lock // (may need to wait for background operations to complete on the watch) - let watch_lock = self.outbound_watch_lock_table.lock_tag(key).await; + let watch_lock = self.outbound_watch_lock_table.lock_tag(record_key).await; // Calculate change to existing watch let (subkeys, count, expiration_ts) = { let inner = self.inner.lock().await; - let Some(_opened_record) = inner.opened_records.get(&key) else { + let Some(_opened_record) = inner.opened_records.get(&record_key) else { apibail_generic!("record not open"); }; // See what watch we have currently if any - let Some(outbound_watch) = inner.outbound_watch_manager.outbound_watches.get(&key) + let Some(outbound_watch) = inner + .outbound_watch_manager + .outbound_watches + .get(&record_key) else { // If we didn't have an active watch, then we can just return false because there's nothing to do here return Ok(false); @@ -1061,7 +1105,7 @@ impl StorageManager { #[instrument(level = "trace", target = "stor", skip_all)] pub async fn inspect_record( &self, - key: TypedKey, + record_key: TypedKey, subkeys: ValueSubkeyRangeSet, scope: DHTReportScope, ) -> VeilidAPIResult { @@ -1073,44 +1117,33 @@ impl StorageManager { // Get cryptosystem let crypto = self.crypto(); - let Some(vcrypto) = crypto.get(key.kind) else { + let Some(vcrypto) = crypto.get(record_key.kind) else { apibail_generic!("unsupported cryptosystem"); }; let mut inner = self.inner.lock().await; let safety_selection = { - let Some(opened_record) = inner.opened_records.get(&key) else { + let Some(opened_record) = inner.opened_records.get(&record_key) else { apibail_generic!("record not open"); }; opened_record.safety_selection() }; // See if the requested record is our local record store - let mut local_inspect_result = - Self::handle_inspect_local_value_inner(&mut inner, key, subkeys.clone(), true).await?; - - #[allow(clippy::unnecessary_cast)] - { - assert!( - local_inspect_result.subkeys.len() as u64 == local_inspect_result.seqs.len() as u64, - "mismatch between local subkeys returned and sequence number list returned" - ); - } - assert!( - local_inspect_result.subkeys.is_subset(&subkeys), - "more subkeys returned locally than requested" - ); + let mut local_inspect_result = self + .handle_inspect_local_value_inner(&mut inner, record_key, subkeys.clone(), true) + .await?; // Get the offline subkeys for this record still only returning the ones we're inspecting // Merge in the currently offline in-flight records and the actively written records as well let active_subkey_writes = inner .active_subkey_writes - .get(&key) + .get(&record_key) .cloned() .unwrap_or_default(); let offline_subkey_writes = inner .offline_subkey_writes - .get(&key) + .get(&record_key) .map(|o| o.subkeys.union(&o.subkeys_in_flight)) .unwrap_or_default() .union(&active_subkey_writes) @@ -1118,12 +1151,15 @@ impl StorageManager { // If this is the maximum scope we're interested in, return the report if matches!(scope, DHTReportScope::Local) { - return Ok(DHTRecordReport::new( - local_inspect_result.subkeys, + return DHTRecordReport::new( + local_inspect_result.subkeys().clone(), offline_subkey_writes, - local_inspect_result.seqs, - vec![], - )); + local_inspect_result.seqs().to_vec(), + vec![None; local_inspect_result.seqs().len()], + ) + .inspect_err(|e| { + veilid_log!(self error "invalid record report generated: {}", e); + }); } // Get rpc processor and drop mutex so we don't block while getting the value from the network @@ -1136,15 +1172,24 @@ impl StorageManager { // If we're simulating a set, increase the previous sequence number we have by 1 if matches!(scope, DHTReportScope::UpdateSet) { - for seq in &mut local_inspect_result.seqs { - *seq = seq.overflowing_add(1).0; + for seq in local_inspect_result.seqs_mut() { + *seq = if let Some(s) = seq { + let (v, ov) = s.overflowing_add(1); + if ov || v == ValueSubkey::MAX { + None + } else { + Some(v) + } + } else { + Some(0) + }; } } // Get the inspect record report from the network let result = self .outbound_inspect_value( - key, + record_key, subkeys, safety_selection, if matches!(scope, DHTReportScope::SyncGet | DHTReportScope::SyncSet) { @@ -1156,28 +1201,11 @@ impl StorageManager { ) .await?; - // Sanity check before zip - #[allow(clippy::unnecessary_cast)] - { - assert_eq!( - result.inspect_result.subkeys.len() as u64, - result.subkey_fanout_results.len() as u64, - "mismatch between subkeys returned and fanout results returned" - ); - } - if !local_inspect_result.subkeys.is_empty() && !result.inspect_result.subkeys.is_empty() { - assert_eq!( - result.inspect_result.subkeys.len(), - local_inspect_result.subkeys.len(), - "mismatch between local subkeys returned and network results returned" - ); - } - // Keep the list of nodes that returned a value for later reference let mut inner = self.inner.lock().await; let results_iter = result .inspect_result - .subkeys + .subkeys() .iter() .map(ValueSubkeyRangeSet::single) .zip(result.subkey_fanout_results.into_iter()); @@ -1185,19 +1213,28 @@ impl StorageManager { Self::process_fanout_results_inner( &mut inner, &vcrypto, - key, + record_key, results_iter, false, self.config() .with(|c| c.network.dht.set_value_count as usize), ); - Ok(DHTRecordReport::new( - result.inspect_result.subkeys, - offline_subkey_writes, - local_inspect_result.seqs, - result.inspect_result.seqs, - )) + if result.inspect_result.subkeys().is_empty() { + DHTRecordReport::new( + local_inspect_result.subkeys().clone(), + offline_subkey_writes, + local_inspect_result.seqs().to_vec(), + vec![None; local_inspect_result.seqs().len()], + ) + } else { + DHTRecordReport::new( + result.inspect_result.subkeys().clone(), + offline_subkey_writes, + local_inspect_result.seqs().to_vec(), + result.inspect_result.seqs().to_vec(), + ) + } } // Send single value change out to the network @@ -1218,7 +1255,7 @@ impl StorageManager { .map_err(VeilidAPIError::from)?; network_result_value_or_log!(self rpc_processor - .rpc_call_value_changed(dest, vc.key, vc.subkeys.clone(), vc.count, vc.watch_id, vc.value.map(|v| (*v).clone()) ) + .rpc_call_value_changed(dest, vc.record_key, vc.subkeys.clone(), vc.count, vc.watch_id, vc.value.map(|v| (*v).clone()) ) .await .map_err(VeilidAPIError::from)? => [format!(": dest={:?} vc={:?}", dest, vc)] {}); @@ -1229,14 +1266,14 @@ impl StorageManager { #[instrument(level = "trace", target = "stor", skip(self, value))] fn update_callback_value_change( &self, - key: TypedKey, + record_key: TypedKey, subkeys: ValueSubkeyRangeSet, count: u32, value: Option, ) { let update_callback = self.update_callback(); update_callback(VeilidUpdate::ValueChange(Box::new(VeilidValueChange { - key, + key: record_key, subkeys, count, value, @@ -1246,7 +1283,7 @@ impl StorageManager { #[instrument(level = "trace", target = "stor", skip_all)] fn check_fanout_set_offline( &self, - key: TypedKey, + record_key: TypedKey, subkey: ValueSubkey, fanout_result: &FanoutResult, ) -> bool { @@ -1260,12 +1297,12 @@ impl StorageManager { if value_node_count < get_consensus { veilid_log!(self debug "timeout with insufficient consensus ({}<{}), adding offline subkey: {}:{}", value_node_count, get_consensus, - key, subkey); + record_key, subkey); true } else { veilid_log!(self debug "timeout with sufficient consensus ({}>={}): set_value {}:{}", value_node_count, get_consensus, - key, subkey); + record_key, subkey); false } } @@ -1277,12 +1314,12 @@ impl StorageManager { if value_node_count < get_consensus { veilid_log!(self debug "exhausted with insufficient consensus ({}<{}), adding offline subkey: {}:{}", value_node_count, get_consensus, - key, subkey); + record_key, subkey); true } else { veilid_log!(self debug "exhausted with sufficient consensus ({}>={}): set_value {}:{}", value_node_count, get_consensus, - key, subkey); + record_key, subkey); false } } @@ -1358,7 +1395,7 @@ impl StorageManager { async fn move_remote_record_to_local_inner( &self, inner: &mut StorageManagerInner, - key: TypedKey, + record_key: TypedKey, safety_selection: SafetySelection, ) -> VeilidAPIResult> { // Get local record store @@ -1375,7 +1412,7 @@ impl StorageManager { // Return record details r.clone() }; - let Some(remote_record) = remote_record_store.with_record(key, rcb) else { + let Some(remote_record) = remote_record_store.with_record(record_key, rcb) else { // No local or remote record found, return None return Ok(None); }; @@ -1387,30 +1424,43 @@ impl StorageManager { remote_record.descriptor().clone(), LocalRecordDetail::new(safety_selection), )?; - local_record_store.new_record(key, local_record).await?; + local_record_store + .new_record(record_key, local_record) + .await?; // Move copy subkey data from remote to local store for subkey in remote_record.stored_subkeys().iter() { - let Some(get_result) = remote_record_store.get_subkey(key, subkey, false).await? else { + let Some(get_result) = remote_record_store + .get_subkey(record_key, subkey, false) + .await? + else { // Subkey was missing - veilid_log!(self warn "Subkey was missing: {} #{}", key, subkey); + veilid_log!(self warn "Subkey was missing: {} #{}", record_key, subkey); continue; }; let Some(subkey_data) = get_result.opt_value else { // Subkey was missing - veilid_log!(self warn "Subkey data was missing: {} #{}", key, subkey); + veilid_log!(self warn "Subkey data was missing: {} #{}", record_key, subkey); continue; }; local_record_store - .set_subkey(key, subkey, subkey_data, InboundWatchUpdateMode::NoUpdate) + .set_subkey( + record_key, + subkey, + subkey_data, + InboundWatchUpdateMode::NoUpdate, + ) .await?; } // Move watches - local_record_store.move_watches(key, remote_record_store.move_watches(key, None)); + local_record_store.move_watches( + record_key, + remote_record_store.move_watches(record_key, None), + ); // Delete remote record from store - remote_record_store.delete_record(key).await?; + remote_record_store.delete_record(record_key).await?; // Return record information as transferred to local record Ok(Some((*remote_record.owner(), remote_record.schema()))) @@ -1420,7 +1470,7 @@ impl StorageManager { pub async fn open_existing_record_inner( &self, inner: &mut StorageManagerInner, - key: TypedKey, + record_key: TypedKey, writer: Option, safety_selection: SafetySelection, ) -> VeilidAPIResult> { @@ -1439,13 +1489,13 @@ impl StorageManager { // Return record details (*r.owner(), r.schema()) }; - let (owner, schema) = match local_record_store.with_record_mut(key, cb) { + let (owner, schema) = match local_record_store.with_record_mut(record_key, cb) { Some(v) => v, None => { // If we don't have a local record yet, check to see if we have a remote record // if so, migrate it to a local record let Some(v) = self - .move_remote_record_to_local_inner(&mut *inner, key, safety_selection) + .move_remote_record_to_local_inner(&mut *inner, record_key, safety_selection) .await? else { // No remote record either @@ -1471,7 +1521,7 @@ impl StorageManager { // Write open record inner .opened_records - .entry(key) + .entry(record_key) .and_modify(|e| { e.set_writer(writer); e.set_safety_selection(safety_selection); @@ -1479,7 +1529,7 @@ impl StorageManager { .or_insert_with(|| OpenedRecord::new(writer, safety_selection)); // Make DHT Record Descriptor to return - let descriptor = DHTRecordDescriptor::new(key, owner, owner_secret, schema); + let descriptor = DHTRecordDescriptor::new(record_key, owner, owner_secret, schema); Ok(Some(descriptor)) } @@ -1487,19 +1537,18 @@ impl StorageManager { pub async fn open_new_record_inner( &self, inner: &mut StorageManagerInner, - key: TypedKey, + record_key: TypedKey, writer: Option, - subkey: ValueSubkey, - get_result: GetResult, + inspect_result: InspectResult, safety_selection: SafetySelection, ) -> VeilidAPIResult { // Ensure the record is closed - if inner.opened_records.contains_key(&key) { + if inner.opened_records.contains_key(&record_key) { panic!("new record should never be opened at this point"); } // Must have descriptor - let Some(signed_value_descriptor) = get_result.opt_descriptor else { + let Some(signed_value_descriptor) = inspect_result.opt_descriptor() else { // No descriptor for new record, can't store this apibail_generic!("no descriptor"); }; @@ -1530,33 +1579,23 @@ impl StorageManager { signed_value_descriptor, LocalRecordDetail::new(safety_selection), )?; - local_record_store.new_record(key, record).await?; - - // If we got a subkey with the getvalue, it has already been validated against the schema, so store it - if let Some(signed_value_data) = get_result.opt_value { - // Write subkey to local store - local_record_store - .set_subkey( - key, - subkey, - signed_value_data, - InboundWatchUpdateMode::NoUpdate, - ) - .await?; - } + local_record_store.new_record(record_key, record).await?; // Write open record inner .opened_records - .insert(key, OpenedRecord::new(writer, safety_selection)); + .insert(record_key, OpenedRecord::new(writer, safety_selection)); // Make DHT Record Descriptor to return - let descriptor = DHTRecordDescriptor::new(key, owner, owner_secret, schema); + let descriptor = DHTRecordDescriptor::new(record_key, owner, owner_secret, schema); Ok(descriptor) } #[instrument(level = "trace", target = "stor", skip_all, err)] - pub async fn get_value_nodes(&self, key: TypedKey) -> VeilidAPIResult>> { + pub async fn get_value_nodes( + &self, + record_key: TypedKey, + ) -> VeilidAPIResult>> { let inner = self.inner.lock().await; // Get local record store let Some(local_record_store) = inner.local_record_store.as_ref() else { @@ -1566,14 +1605,14 @@ impl StorageManager { // Get routing table to see if we still know about these nodes let routing_table = self.routing_table(); - let opt_value_nodes = local_record_store.peek_record(key, |r| { + let opt_value_nodes = local_record_store.peek_record(record_key, |r| { let d = r.detail(); d.nodes .keys() .copied() .filter_map(|x| { routing_table - .lookup_node_ref(TypedKey::new(key.kind, x)) + .lookup_node_ref(TypedKey::new(record_key.kind, x)) .ok() .flatten() }) @@ -1640,18 +1679,23 @@ impl StorageManager { }); } - fn close_record_inner(inner: &mut StorageManagerInner, key: TypedKey) -> VeilidAPIResult<()> { + fn close_record_inner( + inner: &mut StorageManagerInner, + record_key: TypedKey, + ) -> VeilidAPIResult<()> { let Some(local_record_store) = inner.local_record_store.as_mut() else { apibail_not_initialized!(); }; - if local_record_store.peek_record(key, |_| {}).is_none() { - apibail_key_not_found!(key); + if local_record_store.peek_record(record_key, |_| {}).is_none() { + apibail_key_not_found!(record_key); } - if inner.opened_records.remove(&key).is_some() { + if inner.opened_records.remove(&record_key).is_some() { // Set the watch to cancelled if we have one // Will process cancellation in the background - inner.outbound_watch_manager.set_desired_watch(key, None); + inner + .outbound_watch_manager + .set_desired_watch(record_key, None); } Ok(()) @@ -1660,7 +1704,7 @@ impl StorageManager { #[instrument(level = "trace", target = "stor", skip_all, err)] async fn handle_get_local_value_inner( inner: &mut StorageManagerInner, - key: TypedKey, + record_key: TypedKey, subkey: ValueSubkey, want_descriptor: bool, ) -> VeilidAPIResult { @@ -1669,7 +1713,7 @@ impl StorageManager { apibail_not_initialized!(); }; if let Some(get_result) = local_record_store - .get_subkey(key, subkey, want_descriptor) + .get_subkey(record_key, subkey, want_descriptor) .await? { return Ok(get_result); @@ -1684,7 +1728,7 @@ impl StorageManager { #[instrument(level = "trace", target = "stor", skip_all, err)] pub(super) async fn handle_set_local_value_inner( inner: &mut StorageManagerInner, - key: TypedKey, + record_key: TypedKey, subkey: ValueSubkey, signed_value_data: Arc, watch_update_mode: InboundWatchUpdateMode, @@ -1696,7 +1740,7 @@ impl StorageManager { // Write subkey to local store local_record_store - .set_subkey(key, subkey, signed_value_data, watch_update_mode) + .set_subkey(record_key, subkey, signed_value_data, watch_update_mode) .await?; Ok(()) @@ -1704,8 +1748,9 @@ impl StorageManager { #[instrument(level = "trace", target = "stor", skip_all, err)] pub(super) async fn handle_inspect_local_value_inner( + &self, inner: &mut StorageManagerInner, - key: TypedKey, + record_key: TypedKey, subkeys: ValueSubkeyRangeSet, want_descriptor: bool, ) -> VeilidAPIResult { @@ -1714,23 +1759,26 @@ impl StorageManager { apibail_not_initialized!(); }; if let Some(inspect_result) = local_record_store - .inspect_record(key, subkeys, want_descriptor) + .inspect_record(record_key, &subkeys, want_descriptor) .await? { return Ok(inspect_result); } - Ok(InspectResult { - subkeys: ValueSubkeyRangeSet::new(), - seqs: vec![], - opt_descriptor: None, - }) + InspectResult::new( + self, + subkeys, + "handle_inspect_local_value_inner", + ValueSubkeyRangeSet::new(), + vec![], + None, + ) } #[instrument(level = "trace", target = "stor", skip_all, err)] pub(super) async fn handle_get_remote_value_inner( inner: &mut StorageManagerInner, - key: TypedKey, + record_key: TypedKey, subkey: ValueSubkey, want_descriptor: bool, ) -> VeilidAPIResult { @@ -1739,7 +1787,7 @@ impl StorageManager { apibail_not_initialized!(); }; if let Some(get_result) = remote_record_store - .get_subkey(key, subkey, want_descriptor) + .get_subkey(record_key, subkey, want_descriptor) .await? { return Ok(get_result); @@ -1754,7 +1802,7 @@ impl StorageManager { #[instrument(level = "trace", target = "stor", skip_all, err)] pub(super) async fn handle_set_remote_value_inner( inner: &mut StorageManagerInner, - key: TypedKey, + record_key: TypedKey, subkey: ValueSubkey, signed_value_data: Arc, signed_value_descriptor: Arc, @@ -1766,7 +1814,10 @@ impl StorageManager { }; // See if we have a remote record already or not - if remote_record_store.with_record(key, |_| {}).is_none() { + if remote_record_store + .with_record(record_key, |_| {}) + .is_none() + { // record didn't exist, make it let cur_ts = Timestamp::now(); let remote_record_detail = RemoteRecordDetail {}; @@ -1775,12 +1826,12 @@ impl StorageManager { signed_value_descriptor, remote_record_detail, )?; - remote_record_store.new_record(key, record).await? + remote_record_store.new_record(record_key, record).await? }; // Write subkey to remote store remote_record_store - .set_subkey(key, subkey, signed_value_data, watch_update_mode) + .set_subkey(record_key, subkey, signed_value_data, watch_update_mode) .await?; Ok(()) @@ -1788,8 +1839,9 @@ impl StorageManager { #[instrument(level = "trace", target = "stor", skip_all, err)] pub(super) async fn handle_inspect_remote_value_inner( + &self, inner: &mut StorageManagerInner, - key: TypedKey, + record_key: TypedKey, subkeys: ValueSubkeyRangeSet, want_descriptor: bool, ) -> VeilidAPIResult { @@ -1798,17 +1850,20 @@ impl StorageManager { apibail_not_initialized!(); }; if let Some(inspect_result) = remote_record_store - .inspect_record(key, subkeys, want_descriptor) + .inspect_record(record_key, &subkeys, want_descriptor) .await? { return Ok(inspect_result); } - Ok(InspectResult { - subkeys: ValueSubkeyRangeSet::new(), - seqs: vec![], - opt_descriptor: None, - }) + InspectResult::new( + self, + subkeys, + "handle_inspect_remote_value_inner", + ValueSubkeyRangeSet::new(), + vec![], + None, + ) } fn get_key( @@ -1827,13 +1882,13 @@ impl StorageManager { #[instrument(level = "trace", target = "stor", skip_all)] pub(super) fn add_offline_subkey_write_inner( inner: &mut StorageManagerInner, - key: TypedKey, + record_key: TypedKey, subkey: ValueSubkey, safety_selection: SafetySelection, ) { inner .offline_subkey_writes - .entry(key) + .entry(record_key) .and_modify(|x| { x.subkeys.insert(subkey); }) diff --git a/veilid-core/src/storage_manager/outbound_watch_manager/mod.rs b/veilid-core/src/storage_manager/outbound_watch_manager/mod.rs index 9d551a88..7b691739 100644 --- a/veilid-core/src/storage_manager/outbound_watch_manager/mod.rs +++ b/veilid-core/src/storage_manager/outbound_watch_manager/mod.rs @@ -133,7 +133,7 @@ impl OutboundWatchManager { // Watch does not exist, add one if that's what is desired if let Some(desired) = desired_watch { self.outbound_watches - .insert(record_key, OutboundWatch::new(desired)); + .insert(record_key, OutboundWatch::new(record_key, desired)); } } } diff --git a/veilid-core/src/storage_manager/outbound_watch_manager/outbound_watch.rs b/veilid-core/src/storage_manager/outbound_watch_manager/outbound_watch.rs index 6ee5002d..1a4bcf77 100644 --- a/veilid-core/src/storage_manager/outbound_watch_manager/outbound_watch.rs +++ b/veilid-core/src/storage_manager/outbound_watch_manager/outbound_watch.rs @@ -4,6 +4,9 @@ impl_veilid_log_facility!("stor"); #[derive(Clone, Debug, Serialize, Deserialize)] pub(in crate::storage_manager) struct OutboundWatch { + /// Record key being watched + record_key: TypedKey, + /// Current state /// None means inactive/cancelled state: Option, @@ -34,12 +37,14 @@ impl fmt::Display for OutboundWatch { impl OutboundWatch { /// Create new outbound watch with desired parameters - pub fn new(desired: OutboundWatchParameters) -> Self { + pub fn new(record_key: TypedKey, desired: OutboundWatchParameters) -> Self { Self { + record_key, state: None, desired: Some(desired), } } + /// Get current watch state if it exists pub fn state(&self) -> Option<&OutboundWatchState> { self.state.as_ref() @@ -107,7 +112,7 @@ impl OutboundWatch { /// Returns true if this outbound watch needs to be cancelled pub fn needs_cancel(&self, registry: &VeilidComponentRegistry) -> bool { if self.is_dead() { - veilid_log!(registry warn "should have checked for is_dead first"); + veilid_log!(registry warn "Should have checked for is_dead first"); return false; } @@ -118,6 +123,7 @@ impl OutboundWatch { // If the desired parameters is None then cancel let Some(_desired) = self.desired.as_ref() else { + veilid_log!(registry debug target: "dht", "OutboundWatch({}): needs_cancel because desired is None", self.record_key); return true; }; @@ -132,7 +138,7 @@ impl OutboundWatch { cur_ts: Timestamp, ) -> bool { if self.is_dead() || self.needs_cancel(registry) { - veilid_log!(registry warn "should have checked for is_dead and needs_cancel first"); + veilid_log!(registry warn "Should have checked for is_dead and needs_cancel first"); return false; } @@ -156,11 +162,17 @@ impl OutboundWatch { // If we have a consensus but need to renew because some per-node watches // either expired or had their routes die, do it if self.wants_per_node_watch_update(registry, state, cur_ts) { + veilid_log!(registry debug target: "dht", "OutboundWatch({}): needs_renew because per_node_watch wants update", self.record_key); return true; } // If the desired parameters have changed, then we should renew with them - state.params() != desired + if state.params() != desired { + veilid_log!(registry debug target: "dht", "OutboundWatch({}): needs_renew because desired params have changed: {} != {}", self.record_key, state.params(), desired); + return true; + } + + false } /// Returns true if there is work to be done on getting the outbound @@ -175,7 +187,7 @@ impl OutboundWatch { || self.needs_cancel(registry) || self.needs_renew(registry, consensus_count, cur_ts) { - veilid_log!(registry warn "should have checked for is_dead, needs_cancel, needs_renew first"); + veilid_log!(registry warn "Should have checked for is_dead, needs_cancel, needs_renew first"); return false; } @@ -187,6 +199,7 @@ impl OutboundWatch { // If there is a desired watch but no current state, then reconcile let Some(state) = self.state() else { + veilid_log!(registry debug target: "dht", "OutboundWatch({}): needs_reconcile because state is empty", self.record_key); return true; }; @@ -195,13 +208,17 @@ impl OutboundWatch { if state.nodes().len() < consensus_count && cur_ts >= state.next_reconcile_ts().unwrap_or_default() { + veilid_log!(registry debug target: "dht", "OutboundWatch({}): needs_reconcile because consensus count is too low {} < {}", self.record_key, state.nodes().len(), consensus_count); return true; } // Try to reconcile if our number of nodes currently is less than what we got from // the previous reconciliation attempt if let Some(last_consensus_node_count) = state.last_consensus_node_count() { - if state.nodes().len() < last_consensus_node_count { + if state.nodes().len() < last_consensus_node_count + && state.nodes().len() < consensus_count + { + veilid_log!(registry debug target: "dht", "OutboundWatch({}): needs_reconcile because node count is less than last consensus {} < {}", self.record_key, state.nodes().len(), last_consensus_node_count); return true; } } @@ -209,11 +226,17 @@ impl OutboundWatch { // If we have a consensus, or are not attempting consensus at this time, // but need to reconcile because some per-node watches either expired or had their routes die, do it if self.wants_per_node_watch_update(registry, state, cur_ts) { + veilid_log!(registry debug target: "dht", "OutboundWatch({}): needs_reconcile because per_node_watch wants update", self.record_key); return true; } // If the desired parameters have changed, then we should reconcile with them - state.params() != desired + if state.params() != desired { + veilid_log!(registry debug target: "dht", "OutboundWatch({}): needs_reconcile because desired params have changed: {} != {}", self.record_key, state.params(), desired); + return true; + } + + false } /// Returns true if we need to update our per-node watches due to expiration, @@ -233,6 +256,7 @@ impl OutboundWatch { && (state.params().expiration_ts.as_u64() == 0 || renew_ts < state.params().expiration_ts) { + veilid_log!(registry debug target: "dht", "OutboundWatch({}): wants_per_node_watch_update because cur_ts is in expiration renew window", self.record_key); return true; } @@ -244,6 +268,7 @@ impl OutboundWatch { for vcr in state.value_changed_routes() { if rss.get_route_id_for_key(vcr).is_none() { // Route we would receive value changes on is dead + veilid_log!(registry debug target: "dht", "OutboundWatch({}): wants_per_node_watch_update because route is dead: {}", self.record_key, vcr); return true; } } diff --git a/veilid-core/src/storage_manager/record_store/inspect_cache.rs b/veilid-core/src/storage_manager/record_store/inspect_cache.rs index 01e28f5f..469dafef 100644 --- a/veilid-core/src/storage_manager/record_store/inspect_cache.rs +++ b/veilid-core/src/storage_manager/record_store/inspect_cache.rs @@ -4,7 +4,7 @@ const L2_CACHE_DEPTH: usize = 4; // XXX: i just picked this. we could probably d #[derive(Debug, Clone, Eq, PartialEq)] pub struct InspectCacheL2Value { - pub seqs: Vec, + pub seqs: Vec>, } #[derive(Debug, Clone, Eq, PartialEq)] @@ -67,7 +67,7 @@ impl InspectCache { continue; }; if idx < entry.1.seqs.len() { - entry.1.seqs[idx] = seq; + entry.1.seqs[idx] = Some(seq); } else { panic!( "representational error in l2 inspect cache: {} >= {}", diff --git a/veilid-core/src/storage_manager/record_store/mod.rs b/veilid-core/src/storage_manager/record_store/mod.rs index c2dd3503..3e8659b2 100644 --- a/veilid-core/src/storage_manager/record_store/mod.rs +++ b/veilid-core/src/storage_manager/record_store/mod.rs @@ -128,11 +128,55 @@ pub struct GetResult { #[derive(Default, Clone, Debug)] pub struct InspectResult { /// The actual in-schema subkey range being reported on - pub subkeys: ValueSubkeyRangeSet, + subkeys: ValueSubkeyRangeSet, /// The sequence map - pub seqs: Vec, + seqs: Vec>, /// The descriptor if we got a fresh one or empty if no descriptor was needed - pub opt_descriptor: Option>, + opt_descriptor: Option>, +} + +impl InspectResult { + pub fn new( + registry_accessor: &impl VeilidComponentRegistryAccessor, + requested_subkeys: ValueSubkeyRangeSet, + log_context: &str, + subkeys: ValueSubkeyRangeSet, + seqs: Vec>, + opt_descriptor: Option>, + ) -> VeilidAPIResult { + #[allow(clippy::unnecessary_cast)] + { + if subkeys.len() as u64 != seqs.len() as u64 { + veilid_log!(registry_accessor error "{}: mismatch between subkeys returned and sequence number list returned: {}!={}", log_context, subkeys.len(), seqs.len()); + apibail_internal!("list length mismatch"); + } + } + if !subkeys.is_subset(&requested_subkeys) { + veilid_log!(registry_accessor error "{}: more subkeys returned than requested: {} not a subset of {}", log_context, subkeys, requested_subkeys); + apibail_internal!("invalid subkeys returned"); + } + Ok(InspectResult { + subkeys, + seqs, + opt_descriptor, + }) + } + + pub fn subkeys(&self) -> &ValueSubkeyRangeSet { + &self.subkeys + } + pub fn seqs(&self) -> &[Option] { + &self.seqs + } + pub fn seqs_mut(&mut self) -> &mut [Option] { + &mut self.seqs + } + pub fn opt_descriptor(&self) -> Option> { + self.opt_descriptor.clone() + } + pub fn drop_descriptor(&mut self) { + self.opt_descriptor = None; + } } impl RecordStore @@ -822,18 +866,18 @@ where pub async fn inspect_record( &mut self, key: TypedKey, - subkeys: ValueSubkeyRangeSet, + subkeys: &ValueSubkeyRangeSet, want_descriptor: bool, ) -> VeilidAPIResult> { // Get record from index - let Some((subkeys, opt_descriptor)) = self.with_record(key, |record| { + let Some((schema_subkeys, opt_descriptor)) = self.with_record(key, |record| { // Get number of subkeys from schema and ensure we are getting the // right number of sequence numbers betwen that and what we asked for - let truncated_subkeys = record + let schema_subkeys = record .schema() - .truncate_subkeys(&subkeys, Some(MAX_INSPECT_VALUE_A_SEQS_LEN)); + .truncate_subkeys(subkeys, Some(MAX_INSPECT_VALUE_A_SEQS_LEN)); ( - truncated_subkeys, + schema_subkeys, if want_descriptor { Some(record.descriptor().clone()) } else { @@ -846,56 +890,60 @@ where }; // Check if we can return some subkeys - if subkeys.is_empty() { - apibail_invalid_argument!("subkeys set does not overlap schema", "subkeys", subkeys); + if schema_subkeys.is_empty() { + apibail_invalid_argument!( + "subkeys set does not overlap schema", + "subkeys", + schema_subkeys + ); } // See if we have this inspection cached - if let Some(icv) = self.inspect_cache.get(&key, &subkeys) { - return Ok(Some(InspectResult { - subkeys, - seqs: icv.seqs, + if let Some(icv) = self.inspect_cache.get(&key, &schema_subkeys) { + return Ok(Some(InspectResult::new( + self, + subkeys.clone(), + "inspect_record", + schema_subkeys.clone(), + icv.seqs, opt_descriptor, - })); + )?)); } // Build sequence number list to return #[allow(clippy::unnecessary_cast)] - let mut seqs = Vec::with_capacity(subkeys.len() as usize); - for subkey in subkeys.iter() { + let mut seqs = Vec::with_capacity(schema_subkeys.len() as usize); + for subkey in schema_subkeys.iter() { let stk = SubkeyTableKey { key, subkey }; - let seq = if let Some(record_data) = self.subkey_cache.peek(&stk) { - record_data.signed_value_data().value_data().seq() + let opt_seq = if let Some(record_data) = self.subkey_cache.peek(&stk) { + Some(record_data.signed_value_data().value_data().seq()) } else { // If not in cache, try to pull from table store if it is in our stored subkey set // XXX: This would be better if it didn't have to pull the whole record data to get the seq. - if let Some(record_data) = self - .subkey_table + self.subkey_table .load_json::(0, &stk.bytes()) .await .map_err(VeilidAPIError::internal)? - { - record_data.signed_value_data().value_data().seq() - } else { - // Subkey not written to - ValueSubkey::MAX - } + .map(|record_data| record_data.signed_value_data().value_data().seq()) }; - seqs.push(seq) + seqs.push(opt_seq) } // Save seqs cache self.inspect_cache.put( key, - subkeys.clone(), + schema_subkeys.clone(), InspectCacheL2Value { seqs: seqs.clone() }, ); - Ok(Some(InspectResult { - subkeys, + Ok(Some(InspectResult::new( + self, + subkeys.clone(), + "inspect_record", + schema_subkeys, seqs, opt_descriptor, - })) + )?)) } #[instrument(level = "trace", target = "stor", skip_all, err)] @@ -1242,7 +1290,7 @@ where changes.push(ValueChangedInfo { target: evci.target, - key: evci.key, + record_key: evci.key, subkeys: evci.subkeys, count: evci.count, watch_id: evci.watch_id, diff --git a/veilid-core/src/storage_manager/rehydrate.rs b/veilid-core/src/storage_manager/rehydrate.rs new file mode 100644 index 00000000..bf82d40d --- /dev/null +++ b/veilid-core/src/storage_manager/rehydrate.rs @@ -0,0 +1,271 @@ +use super::{inspect_value::OutboundInspectValueResult, *}; + +#[allow(dead_code)] +#[derive(Debug, Clone)] +pub struct RehydrateReport { + /// The record key rehydrated + record_key: TypedKey, + /// The requested range of subkeys to rehydrate if necessary + subkeys: ValueSubkeyRangeSet, + /// The requested consensus count, + consensus_count: usize, + /// The range of subkeys that wanted rehydration + wanted: ValueSubkeyRangeSet, + /// The range of subkeys that actually could be rehydrated + rehydrated: ValueSubkeyRangeSet, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub(super) struct RehydrationRequest { + pub subkeys: ValueSubkeyRangeSet, + pub consensus_count: usize, +} + +impl StorageManager { + /// Add a background rehydration request + #[instrument(level = "trace", target = "stor", skip_all)] + pub async fn add_rehydration_request( + &self, + record_key: TypedKey, + subkeys: ValueSubkeyRangeSet, + consensus_count: usize, + ) { + let req = RehydrationRequest { + subkeys, + consensus_count, + }; + veilid_log!(self debug "Adding rehydration request: {} {:?}", record_key, req); + let mut inner = self.inner.lock().await; + inner + .rehydration_requests + .entry(record_key) + .and_modify(|r| { + r.subkeys = r.subkeys.union(&req.subkeys); + r.consensus_count.max_assign(req.consensus_count); + }) + .or_insert(req); + } + + /// Sends the local copies of all of a record's subkeys back to the network + /// Triggers a subkey update if the consensus on the subkey is less than + /// the specified 'consensus_count'. + /// The subkey updates are performed in the background if rehydration was + /// determined to be necessary. + /// If a newer copy of a subkey's data is available online, the background + /// write will pick up the newest subkey data as it does the SetValue fanout + /// and will drive the newest values to consensus. + #[instrument(level = "trace", target = "stor", skip(self), ret, err)] + pub(super) async fn rehydrate_record( + &self, + record_key: TypedKey, + subkeys: ValueSubkeyRangeSet, + consensus_count: usize, + ) -> VeilidAPIResult { + veilid_log!(self debug "Checking for record rehydration: {} {} @ consensus {}", record_key, subkeys, consensus_count); + // Get subkey range for consideration + let subkeys = if subkeys.is_empty() { + ValueSubkeyRangeSet::full() + } else { + subkeys + }; + + // Get safety selection + let mut inner = self.inner.lock().await; + let safety_selection = { + if let Some(opened_record) = inner.opened_records.get(&record_key) { + opened_record.safety_selection() + } else { + // See if it's in the local record store + let Some(local_record_store) = inner.local_record_store.as_mut() else { + apibail_not_initialized!(); + }; + let Some(safety_selection) = + local_record_store.with_record(record_key, |rec| rec.detail().safety_selection) + else { + apibail_key_not_found!(record_key); + }; + safety_selection + } + }; + + // See if the requested record is our local record store + let local_inspect_result = self + .handle_inspect_local_value_inner(&mut inner, record_key, subkeys.clone(), true) + .await?; + + // Get rpc processor and drop mutex so we don't block while getting the value from the network + if !self.dht_is_online() { + apibail_try_again!("offline, try again later"); + }; + + // Drop the lock for network access + drop(inner); + + // Get the inspect record report from the network + let result = self + .outbound_inspect_value( + record_key, + subkeys.clone(), + safety_selection, + InspectResult::default(), + true, + ) + .await?; + + // If online result had no subkeys, then trigger writing the entire record in the background + if result.inspect_result.subkeys().is_empty() + || result.inspect_result.opt_descriptor().is_none() + { + return self + .rehydrate_all_subkeys( + record_key, + subkeys, + consensus_count, + safety_selection, + local_inspect_result, + ) + .await; + } + + return self + .rehydrate_required_subkeys( + record_key, + subkeys, + consensus_count, + safety_selection, + local_inspect_result, + result, + ) + .await; + } + + #[instrument(level = "trace", target = "stor", skip(self), ret, err)] + pub(super) async fn rehydrate_all_subkeys( + &self, + record_key: TypedKey, + subkeys: ValueSubkeyRangeSet, + consensus_count: usize, + safety_selection: SafetySelection, + local_inspect_result: InspectResult, + ) -> VeilidAPIResult { + let mut inner = self.inner.lock().await; + + veilid_log!(self debug "Rehydrating all subkeys: record={} subkeys={}", record_key, local_inspect_result.subkeys()); + + let mut rehydrated = ValueSubkeyRangeSet::new(); + for (n, subkey) in local_inspect_result.subkeys().iter().enumerate() { + if local_inspect_result.seqs()[n].is_some() { + // Add to offline writes to flush + veilid_log!(self debug "Rehydrating: record={} subkey={}", record_key, subkey); + rehydrated.insert(subkey); + Self::add_offline_subkey_write_inner( + &mut inner, + record_key, + subkey, + safety_selection, + ); + } + } + + if rehydrated.is_empty() { + veilid_log!(self debug "Record wanted full rehydrating, but no subkey data available: record={} subkeys={}", record_key, subkeys); + } else { + veilid_log!(self debug "Record full rehydrating: record={} subkeys={} rehydrated={}", record_key, subkeys, rehydrated); + } + + return Ok(RehydrateReport { + record_key, + subkeys, + consensus_count, + wanted: local_inspect_result.subkeys().clone(), + rehydrated, + }); + } + + #[instrument(level = "trace", target = "stor", skip(self), ret, err)] + pub(super) async fn rehydrate_required_subkeys( + &self, + record_key: TypedKey, + subkeys: ValueSubkeyRangeSet, + consensus_count: usize, + safety_selection: SafetySelection, + local_inspect_result: InspectResult, + outbound_inspect_result: OutboundInspectValueResult, + ) -> VeilidAPIResult { + let mut inner = self.inner.lock().await; + + // Get cryptosystem + let crypto = self.crypto(); + let Some(vcrypto) = crypto.get(record_key.kind) else { + apibail_generic!("unsupported cryptosystem"); + }; + + if local_inspect_result.subkeys().len() + != outbound_inspect_result.subkey_fanout_results.len() as u64 + { + veilid_log!(self debug "Subkey count mismatch when rehydrating required subkeys: record={} {} != {}", + record_key, local_inspect_result.subkeys().len(), outbound_inspect_result.subkey_fanout_results.len()); + apibail_internal!("subkey count mismatch"); + } + + // For each subkey, determine if we should rehydrate it + let mut wanted = ValueSubkeyRangeSet::new(); + let mut rehydrated = ValueSubkeyRangeSet::new(); + for (n, subkey) in local_inspect_result.subkeys().iter().enumerate() { + let sfr = outbound_inspect_result + .subkey_fanout_results + .get(n) + .unwrap(); + // Does the online subkey have enough consensus? + // If not, schedule it to be written in the background + if sfr.consensus_nodes.len() < consensus_count { + wanted.insert(subkey); + if local_inspect_result.seqs()[n].is_some() { + // Add to offline writes to flush + veilid_log!(self debug "Rehydrating: record={} subkey={}", record_key, subkey); + rehydrated.insert(subkey); + Self::add_offline_subkey_write_inner( + &mut inner, + record_key, + subkey, + safety_selection, + ); + } + } + } + + if wanted.is_empty() { + veilid_log!(self debug "Record did not need rehydrating: record={} local_subkeys={}", record_key, local_inspect_result.subkeys()); + } else if rehydrated.is_empty() { + veilid_log!(self debug "Record wanted rehydrating, but no subkey data available: record={} local_subkeys={} wanted={}", record_key, local_inspect_result.subkeys(), wanted); + } else { + veilid_log!(self debug "Record rehydrating: record={} local_subkeys={} wanted={} rehydrated={}", record_key, local_inspect_result.subkeys(), wanted, rehydrated); + } + + // Keep the list of nodes that returned a value for later reference + let results_iter = outbound_inspect_result + .inspect_result + .subkeys() + .iter() + .map(ValueSubkeyRangeSet::single) + .zip(outbound_inspect_result.subkey_fanout_results.into_iter()); + + Self::process_fanout_results_inner( + &mut inner, + &vcrypto, + record_key, + results_iter, + false, + self.config() + .with(|c| c.network.dht.set_value_count as usize), + ); + + Ok(RehydrateReport { + record_key, + subkeys, + consensus_count, + wanted, + rehydrated, + }) + } +} diff --git a/veilid-core/src/storage_manager/set_value.rs b/veilid-core/src/storage_manager/set_value.rs index a40c9ec9..6354d3e5 100644 --- a/veilid-core/src/storage_manager/set_value.rs +++ b/veilid-core/src/storage_manager/set_value.rs @@ -28,7 +28,7 @@ impl StorageManager { #[instrument(level = "trace", target = "dht", skip_all, err)] pub(super) async fn outbound_set_value( &self, - key: TypedKey, + record_key: TypedKey, subkey: ValueSubkey, safety_selection: SafetySelection, value: Arc, @@ -48,7 +48,7 @@ impl StorageManager { // Get the nodes we know are caching this value to seed the fanout let init_fanout_queue = { - self.get_value_nodes(key) + self.get_value_nodes(record_key) .await? .unwrap_or_default() .into_iter() @@ -99,7 +99,7 @@ impl StorageManager { .rpc_call_set_value( Destination::direct(next_node.routing_domain_filtered(routing_domain)) .with_safety(safety_selection), - key, + record_key, subkey, (*value).clone(), (*descriptor).clone(), @@ -228,7 +228,7 @@ impl StorageManager { let routing_table = registry.routing_table(); let fanout_call = FanoutCall::new( &routing_table, - key, + record_key, key_count, fanout, consensus_count, diff --git a/veilid-core/src/storage_manager/tasks/mod.rs b/veilid-core/src/storage_manager/tasks/mod.rs index 3c645cce..2ae16d67 100644 --- a/veilid-core/src/storage_manager/tasks/mod.rs +++ b/veilid-core/src/storage_manager/tasks/mod.rs @@ -2,6 +2,7 @@ pub mod check_inbound_watches; pub mod check_outbound_watches; pub mod flush_record_stores; pub mod offline_subkey_writes; +pub mod rehydrate_records; pub mod save_metadata; pub mod send_value_changes; @@ -55,6 +56,15 @@ impl StorageManager { check_inbound_watches_task, check_inbound_watches_task_routine ); + + // Set rehydrate records tick task + veilid_log!(self debug "starting rehydrate records task"); + impl_setup_task!( + self, + Self, + rehydrate_records_task, + rehydrate_records_task_routine + ); } #[instrument(parent = None, level = "trace", target = "stor", name = "StorageManager::tick", skip_all, err)] @@ -78,6 +88,11 @@ impl StorageManager { self.offline_subkey_writes_task.tick().await?; } + // Do requested rehydrations + if self.has_rehydration_requests().await { + self.rehydrate_records_task.tick().await?; + } + // Send value changed notifications self.send_value_changes_task.tick().await?; } @@ -106,5 +121,9 @@ impl StorageManager { if let Err(e) = self.offline_subkey_writes_task.stop().await { veilid_log!(self warn "offline_subkey_writes_task not stopped: {}", e); } + veilid_log!(self debug "stopping record rehydration task"); + if let Err(e) = self.rehydrate_records_task.stop().await { + veilid_log!(self warn "rehydrate_records_task not stopped: {}", e); + } } } diff --git a/veilid-core/src/storage_manager/tasks/rehydrate_records.rs b/veilid-core/src/storage_manager/tasks/rehydrate_records.rs new file mode 100644 index 00000000..309a55a1 --- /dev/null +++ b/veilid-core/src/storage_manager/tasks/rehydrate_records.rs @@ -0,0 +1,50 @@ +use super::*; + +impl_veilid_log_facility!("stor"); + +impl StorageManager { + /// Process background rehydration requests + #[instrument(level = "trace", target = "stor", skip_all, err)] + pub(super) async fn rehydrate_records_task_routine( + &self, + stop_token: StopToken, + _last_ts: Timestamp, + _cur_ts: Timestamp, + ) -> EyreResult<()> { + let reqs = { + let mut inner = self.inner.lock().await; + core::mem::take(&mut inner.rehydration_requests) + }; + + let mut futs = Vec::new(); + for req in reqs { + futs.push(async move { + let res = self + .rehydrate_record(req.0, req.1.subkeys.clone(), req.1.consensus_count) + .await; + (req, res) + }); + } + + process_batched_future_queue( + futs, + REHYDRATE_BATCH_SIZE, + stop_token, + |(req, res)| async move { + let _report = match res { + Ok(v) => v, + Err(e) => { + veilid_log!(self debug "Rehydration request failed: {}", e); + // Try again later + self.add_rehydration_request(req.0, req.1.subkeys, req.1.consensus_count) + .await; + return; + } + }; + }, + ) + .await; + + Ok(()) + } +} diff --git a/veilid-core/src/storage_manager/watch_value.rs b/veilid-core/src/storage_manager/watch_value.rs index ce08319f..62f9fb20 100644 --- a/veilid-core/src/storage_manager/watch_value.rs +++ b/veilid-core/src/storage_manager/watch_value.rs @@ -263,7 +263,7 @@ impl StorageManager { let disposition = if wva.answer.accepted { if wva.answer.expiration_ts.as_u64() > 0 { // If the expiration time is greater than zero this watch is active - veilid_log!(registry debug "WatchValue accepted for {}: id={} expiration_ts={} ({})", record_key, wva.answer.watch_id, display_ts(wva.answer.expiration_ts.as_u64()), next_node); + veilid_log!(registry debug target:"dht", "WatchValue accepted for {}: id={} expiration_ts={} ({})", record_key, wva.answer.watch_id, display_ts(wva.answer.expiration_ts.as_u64()), next_node); // Add to accepted watches let mut ctx = context.lock(); @@ -279,7 +279,7 @@ impl StorageManager { // If the returned expiration time is zero, this watch was cancelled // If the expiration time is greater than zero this watch is active - veilid_log!(registry debug "WatchValue rejected for {}: id={} expiration_ts={} ({})", record_key, wva.answer.watch_id, display_ts(wva.answer.expiration_ts.as_u64()), next_node); + veilid_log!(registry debug target:"dht", "WatchValue rejected for {}: id={} expiration_ts={} ({})", record_key, wva.answer.watch_id, display_ts(wva.answer.expiration_ts.as_u64()), next_node); // Add to rejected watches let mut ctx = context.lock(); @@ -344,10 +344,10 @@ impl StorageManager { let fanout_result = fanout_call.run(init_fanout_queue).await.inspect_err(|e| { // If we finished with an error, return that - veilid_log!(self debug "WatchValue fanout error: {}", e); + veilid_log!(self debug target:"dht", "WatchValue fanout error: {}", e); })?; - veilid_log!(self debug "WatchValue Fanout: {:#}", fanout_result); + veilid_log!(self debug target:"dht", "WatchValue Fanout: {:#}", fanout_result); // Get cryptosystem let crypto = self.crypto(); @@ -476,7 +476,7 @@ impl StorageManager { cancelled.push(pnk); } Err(e) => { - veilid_log!(self debug "outbound watch cancel error: {}", e); + veilid_log!(self debug "Outbound watch cancel error: {}", e); // xxx should do something different for network unreachable vs host unreachable // Leave in the 'per node states' for now because we couldn't contact the node @@ -604,7 +604,7 @@ impl StorageManager { }; } Err(e) => { - veilid_log!(self debug "outbound watch change error: {}", e); + veilid_log!(self debug "Outbound watch change error: {}", e); } } } @@ -718,7 +718,7 @@ impl StorageManager { }); } Err(e) => { - veilid_log!(self debug "outbound watch fanout error: {}", e); + veilid_log!(self debug "Outbound watch fanout error: {}", e); } } @@ -742,11 +742,11 @@ impl StorageManager { .outbound_watches .get_mut(&record_key) else { - veilid_log!(self warn "outbound watch should have still been in the table"); + veilid_log!(self warn "Outbound watch should have still been in the table"); return; }; let Some(desired) = outbound_watch.desired() else { - veilid_log!(self warn "watch with result should have desired params"); + veilid_log!(self warn "Watch with result should have desired params"); return; }; @@ -852,6 +852,10 @@ impl StorageManager { .config() .with(|c| c.network.dht.get_value_count as usize); + // Operate on this watch only if it isn't already being operated on + let watch_lock = + opt_watch_lock.or_else(|| self.outbound_watch_lock_table.try_lock_tag(key))?; + // Terminate the 'desired' params for watches // that have no remaining count or have expired outbound_watch.try_expire_desired_state(cur_ts); @@ -859,9 +863,6 @@ impl StorageManager { // Check states if outbound_watch.is_dead() { // Outbound watch is dead - let watch_lock = - opt_watch_lock.or_else(|| self.outbound_watch_lock_table.try_lock_tag(key))?; - let fut = { let registry = self.registry(); async move { @@ -874,9 +875,6 @@ impl StorageManager { return Some(pin_dyn_future!(fut)); } else if outbound_watch.needs_cancel(®istry) { // Outbound watch needs to be cancelled - let watch_lock = - opt_watch_lock.or_else(|| self.outbound_watch_lock_table.try_lock_tag(key))?; - let fut = { let registry = self.registry(); async move { @@ -889,9 +887,6 @@ impl StorageManager { return Some(pin_dyn_future!(fut)); } else if outbound_watch.needs_renew(®istry, consensus_count, cur_ts) { // Outbound watch expired but can be renewed - let watch_lock = - opt_watch_lock.or_else(|| self.outbound_watch_lock_table.try_lock_tag(key))?; - let fut = { let registry = self.registry(); async move { @@ -904,9 +899,6 @@ impl StorageManager { return Some(pin_dyn_future!(fut)); } else if outbound_watch.needs_reconcile(®istry, consensus_count, cur_ts) { // Outbound watch parameters have changed or it needs more nodes - let watch_lock = - opt_watch_lock.or_else(|| self.outbound_watch_lock_table.try_lock_tag(key))?; - let fut = { let registry = self.registry(); async move { @@ -944,12 +936,12 @@ impl StorageManager { return; } }; - let mut changed_subkeys = report.changed_subkeys(); + let mut newer_online_subkeys = report.newer_online_subkeys(); // Get changed first changed subkey until we find one to report let mut n = 0; - while !changed_subkeys.is_empty() { - let first_changed_subkey = changed_subkeys.first().unwrap(); + while !newer_online_subkeys.is_empty() { + let first_changed_subkey = newer_online_subkeys.first().unwrap(); let value = match this.get_value(record_key, first_changed_subkey, true).await { Ok(v) => v, @@ -960,7 +952,8 @@ impl StorageManager { }; if let Some(value) = value { - if value.seq() > report.local_seqs()[n] { + let opt_local_seq = report.local_seqs()[n]; + if opt_local_seq.is_none() || value.seq() > opt_local_seq.unwrap() { // Calculate the update let (changed_subkeys, remaining_count, value) = { let _watch_lock = @@ -991,7 +984,7 @@ impl StorageManager { }, ); - (changed_subkeys, remaining_count, value) + (newer_online_subkeys, remaining_count, value) }; // Send the update @@ -1008,7 +1001,7 @@ impl StorageManager { } // If we didn't send an update, remove the first changed subkey and try again - changed_subkeys.pop_first(); + newer_online_subkeys.pop_first(); n += 1; } } @@ -1111,14 +1104,14 @@ impl StorageManager { inner.outbound_watch_manager.per_node_states.get_mut(&pnk) else { // No per node state means no callback - veilid_log!(self warn "missing per node state in outbound watch: {:?}", pnk); + veilid_log!(self warn "Missing per node state in outbound watch: {:?}", pnk); return Ok(NetworkResult::value(())); }; // If watch id doesn't match it's for an older watch and should be ignored if per_node_state.watch_id != watch_id { // No per node state means no callback - veilid_log!(self warn "incorrect watch id for per node state in outbound watch: {:?} {} != {}", pnk, per_node_state.watch_id, watch_id); + veilid_log!(self warn "Incorrect watch id for per node state in outbound watch: {:?} {} != {}", pnk, per_node_state.watch_id, watch_id); return Ok(NetworkResult::value(())); } @@ -1127,7 +1120,7 @@ impl StorageManager { // If count is greater than our requested count then this is invalid, cancel the watch // XXX: Should this be a punishment? veilid_log!(self debug - "watch count went backward: {} @ {} id={}: {} > {}", + "Watch count went backward: {} @ {} id={}: {} > {}", record_key, inbound_node_id, watch_id, @@ -1143,7 +1136,7 @@ impl StorageManager { // Log this because watch counts should always be decrementing non a per-node basis. // XXX: Should this be a punishment? veilid_log!(self debug - "watch count duplicate: {} @ {} id={}: {} == {}", + "Watch count duplicate: {} @ {} id={}: {} == {}", record_key, inbound_node_id, watch_id, @@ -1153,7 +1146,7 @@ impl StorageManager { } else { // Reduce the per-node watch count veilid_log!(self debug - "watch count decremented: {} @ {} id={}: {} < {}", + "Watch count decremented: {} @ {} id={}: {} < {}", record_key, inbound_node_id, watch_id, @@ -1285,7 +1278,7 @@ impl StorageManager { remaining_count, Some(value), ); - } else if reportable_subkeys.len() > 0 { + } else if !reportable_subkeys.is_empty() { // We have subkeys that have be reported as possibly changed // but not a specific record reported, so we should defer reporting and // inspect the range to see what changed diff --git a/veilid-core/src/veilid_api/debug.rs b/veilid-core/src/veilid_api/debug.rs index c5049e77..bd15ff43 100644 --- a/veilid-core/src/veilid_api/debug.rs +++ b/veilid-core/src/veilid_api/debug.rs @@ -1902,7 +1902,7 @@ impl VeilidAPI { let (key, rc) = self.clone() - .get_opened_dht_record_context(&args, "debug_record_watch", "key", 1)?; + .get_opened_dht_record_context(&args, "debug_record_inspect", "key", 1)?; let mut rest_defaults = false; @@ -1947,6 +1947,62 @@ impl VeilidAPI { Ok(format!("Success: report={:?}", report)) } + async fn debug_record_rehydrate(&self, args: Vec) -> VeilidAPIResult { + let registry = self.core_context()?.registry(); + let storage_manager = registry.storage_manager(); + + let key = get_debug_argument_at( + &args, + 1, + "debug_record_rehydrate", + "key", + get_dht_key_no_safety, + )?; + + let mut rest_defaults = false; + + let subkeys = if rest_defaults { + None + } else { + get_debug_argument_at(&args, 2, "debug_record_rehydrate", "subkeys", get_subkeys) + .inspect_err(|_| { + rest_defaults = true; + }) + .ok() + }; + + let consensus_count = if rest_defaults { + None + } else { + get_debug_argument_at( + &args, + 3, + "debug_record_rehydrate", + "consensus_count", + get_number, + ) + .inspect_err(|_| { + rest_defaults = true; + }) + .ok() + }; + + // Do a record rehydrate + storage_manager + .add_rehydration_request( + key, + subkeys.unwrap_or_default(), + consensus_count.unwrap_or_else(|| { + registry + .config() + .with(|c| c.network.dht.get_value_count as usize) + }), + ) + .await; + + Ok("Request added".to_owned()) + } + async fn debug_record(&self, args: String) -> VeilidAPIResult { let args: Vec = shell_words::split(&args).map_err(|e| VeilidAPIError::parse_error(e, args))?; @@ -1977,6 +2033,8 @@ impl VeilidAPI { self.debug_record_cancel(args).await } else if command == "inspect" { self.debug_record_inspect(args).await + } else if command == "rehydrate" { + self.debug_record_rehydrate(args).await } else { Ok(">>> Unknown command\n".to_owned()) } @@ -2144,6 +2202,7 @@ DHT Operations: watch [] [ [ []]] - watch a record for changes cancel [] [] - cancel a dht record watch inspect [] [ []] - display a dht record's subkey status + rehydrate [] [] - send a dht record's expired local data back to the network TableDB Operations: table list - list the names of all the tables in the TableDB diff --git a/veilid-core/src/veilid_api/types/dht/dht_record_descriptor.rs b/veilid-core/src/veilid_api/types/dht/dht_record_descriptor.rs index 19ba0cf6..b19aa8f9 100644 --- a/veilid-core/src/veilid_api/types/dht/dht_record_descriptor.rs +++ b/veilid-core/src/veilid_api/types/dht/dht_record_descriptor.rs @@ -26,7 +26,7 @@ pub struct DHTRecordDescriptor { from_impl_to_jsvalue!(DHTRecordDescriptor); impl DHTRecordDescriptor { - pub fn new( + pub(crate) fn new( key: TypedKey, owner: PublicKey, owner_secret: Option, diff --git a/veilid-core/src/veilid_api/types/dht/dht_record_report.rs b/veilid-core/src/veilid_api/types/dht/dht_record_report.rs index 0e44ada4..78f27b6a 100644 --- a/veilid-core/src/veilid_api/types/dht/dht_record_report.rs +++ b/veilid-core/src/veilid_api/types/dht/dht_record_report.rs @@ -16,25 +16,56 @@ pub struct DHTRecordReport { /// The subkeys that have been writen offline that still need to be flushed offline_subkeys: ValueSubkeyRangeSet, /// The sequence numbers of each subkey requested from a locally stored DHT Record - local_seqs: Vec, + local_seqs: Vec>, /// The sequence numbers of each subkey requested from the DHT over the network - network_seqs: Vec, + network_seqs: Vec>, } from_impl_to_jsvalue!(DHTRecordReport); impl DHTRecordReport { - pub fn new( + pub(crate) fn new( subkeys: ValueSubkeyRangeSet, offline_subkeys: ValueSubkeyRangeSet, - local_seqs: Vec, - network_seqs: Vec, - ) -> Self { - Self { + local_seqs: Vec>, + network_seqs: Vec>, + ) -> VeilidAPIResult { + if subkeys.is_full() { + apibail_invalid_argument!("subkeys range should be exact", "subkeys", subkeys); + } + if subkeys.is_empty() { + apibail_invalid_argument!("subkeys range should not be empty", "subkeys", subkeys); + } + if subkeys.len() > MAX_INSPECT_VALUE_A_SEQS_LEN as u64 { + apibail_invalid_argument!("subkeys range is too large", "subkeys", subkeys); + } + if subkeys.len() != local_seqs.len() as u64 { + apibail_invalid_argument!( + "local seqs list does not match subkey length", + "local_seqs", + local_seqs.len() + ); + } + if subkeys.len() != network_seqs.len() as u64 { + apibail_invalid_argument!( + "network seqs list does not match subkey length", + "network_seqs", + network_seqs.len() + ); + } + if !offline_subkeys.is_subset(&subkeys) { + apibail_invalid_argument!( + "offline subkeys is not a subset of the whole subkey set", + "offline_subkeys", + offline_subkeys + ); + } + + Ok(Self { subkeys, offline_subkeys, local_seqs, network_seqs, - } + }) } pub fn subkeys(&self) -> &ValueSubkeyRangeSet { @@ -44,26 +75,28 @@ impl DHTRecordReport { &self.offline_subkeys } #[must_use] - pub fn local_seqs(&self) -> &[ValueSeqNum] { + pub fn local_seqs(&self) -> &[Option] { &self.local_seqs } #[must_use] - pub fn network_seqs(&self) -> &[ValueSeqNum] { + pub fn network_seqs(&self) -> &[Option] { &self.network_seqs } - pub fn changed_subkeys(&self) -> ValueSubkeyRangeSet { - let mut changed = ValueSubkeyRangeSet::new(); + pub fn newer_online_subkeys(&self) -> ValueSubkeyRangeSet { + let mut newer_online = ValueSubkeyRangeSet::new(); for ((sk, lseq), nseq) in self .subkeys .iter() .zip(self.local_seqs.iter()) .zip(self.network_seqs.iter()) { - if nseq > lseq { - changed.insert(sk); + if let Some(nseq) = nseq { + if lseq.is_none() || *nseq > lseq.unwrap() { + newer_online.insert(sk); + } } } - changed + newer_online } } diff --git a/veilid-core/src/veilid_api/types/dht/mod.rs b/veilid-core/src/veilid_api/types/dht/mod.rs index 8a55b0ac..b006a78c 100644 --- a/veilid-core/src/veilid_api/types/dht/mod.rs +++ b/veilid-core/src/veilid_api/types/dht/mod.rs @@ -19,7 +19,7 @@ pub type ValueSubkey = u32; #[cfg_attr(all(target_arch = "wasm32", target_os = "unknown"), declare)] pub type ValueSeqNum = u32; -pub(crate) fn debug_seqs(seqs: &[ValueSeqNum]) -> String { +pub(crate) fn debug_seqs(seqs: &[Option]) -> String { let mut col = 0; let mut out = String::new(); let mut left = seqs.len(); @@ -27,10 +27,10 @@ pub(crate) fn debug_seqs(seqs: &[ValueSeqNum]) -> String { if col == 0 { out += " "; } - let sc = if *s == ValueSeqNum::MAX { - "-".to_owned() - } else { + let sc = if let Some(s) = s { s.to_string() + } else { + "-".to_owned() }; out += ≻ out += ","; diff --git a/veilid-core/src/veilid_api/types/dht/value_subkey_range_set.rs b/veilid-core/src/veilid_api/types/dht/value_subkey_range_set.rs index 1e5192d9..d864c0cf 100644 --- a/veilid-core/src/veilid_api/types/dht/value_subkey_range_set.rs +++ b/veilid-core/src/veilid_api/types/dht/value_subkey_range_set.rs @@ -53,6 +53,24 @@ impl ValueSubkeyRangeSet { Self::new_with_data(&self.data | &other.data) } + #[must_use] + #[allow(clippy::unnecessary_cast)] + pub fn len(&self) -> u64 { + self.data.len() as u64 + } + + #[must_use] + pub fn is_empty(&self) -> bool { + self.data.is_empty() + } + + #[must_use] + pub fn is_full(&self) -> bool { + self.data.ranges_len() == 1 + && self.data.first().unwrap() == u32::MIN + && self.data.last().unwrap() == u32::MAX + } + #[must_use] pub fn data(&self) -> &RangeSetBlaze { &self.data diff --git a/veilid-flutter/analysis_options.yaml b/veilid-flutter/analysis_options.yaml index d262dc94..f1aa1f9b 100644 --- a/veilid-flutter/analysis_options.yaml +++ b/veilid-flutter/analysis_options.yaml @@ -2,10 +2,11 @@ include: package:lint_hard/all.yaml analyzer: errors: invalid_annotation_target: ignore + one_member_abstracts: ignore exclude: - '**/*.g.dart' - '**/*.freezed.dart' linter: rules: - avoid_positional_boolean_parameters: false \ No newline at end of file + avoid_positional_boolean_parameters: false diff --git a/veilid-flutter/example/integration_test/test_dht.dart b/veilid-flutter/example/integration_test/test_dht.dart index f4a011d2..bdc31648 100644 --- a/veilid-flutter/example/integration_test/test_dht.dart +++ b/veilid-flutter/example/integration_test/test_dht.dart @@ -241,10 +241,19 @@ Future testOpenWriterDHTValue() async { throwsA(isA())); // Verify subkey 0 can be set because override with the right writer - expect( - await rc.setDHTValue(key, 0, va, - writer: KeyPair(key: owner, secret: secret)), - isNull); + // Should have prior sequence number as its returned value because it + // exists online at seq 0 + vdtemp = await rc.setDHTValue(key, 0, va, + writer: KeyPair(key: owner, secret: secret)); + expect(vdtemp, isNotNull); + expect(vdtemp!.data, equals(vb)); + expect(vdtemp.seq, equals(0)); + expect(vdtemp.writer, equals(owner)); + + // Should update the second time to seq 1 + vdtemp = await rc.setDHTValue(key, 0, va, + writer: KeyPair(key: owner, secret: secret)); + expect(vdtemp, isNull); // Clean up await rc.closeDHTRecord(key); @@ -452,16 +461,18 @@ Future testInspectDHTRecord() async { expect(await rc.setDHTValue(rec.key, 0, utf8.encode('BLAH BLAH BLAH')), isNull); + await settle(rc, rec.key, 0); + final rr = await rc.inspectDHTRecord(rec.key); expect(rr.subkeys, equals([ValueSubkeyRange.make(0, 1)])); - expect(rr.localSeqs, equals([0, 0xFFFFFFFF])); - expect(rr.networkSeqs, equals([])); + expect(rr.localSeqs, equals([0, null])); + expect(rr.networkSeqs, equals([null, null])); final rr2 = await rc.inspectDHTRecord(rec.key, scope: DHTReportScope.syncGet); expect(rr2.subkeys, equals([ValueSubkeyRange.make(0, 1)])); - expect(rr2.localSeqs, equals([0, 0xFFFFFFFF])); - expect(rr2.networkSeqs, equals([0, 0xFFFFFFFF])); + expect(rr2.localSeqs, equals([0, null])); + expect(rr2.networkSeqs, equals([0, null])); await rc.closeDHTRecord(rec.key); await rc.deleteDHTRecord(rec.key); diff --git a/veilid-flutter/example/integration_test/test_routing_context.dart b/veilid-flutter/example/integration_test/test_routing_context.dart index 03e398c9..3ce19f15 100644 --- a/veilid-flutter/example/integration_test/test_routing_context.dart +++ b/veilid-flutter/example/integration_test/test_routing_context.dart @@ -14,6 +14,7 @@ Future testRoutingContexts() async { { final rc = await Veilid.instance.routingContext(); final rcp = rc.withDefaultSafety(); + // More debuggable this way // ignore: cascade_invocations rcp.close(); rc.close(); @@ -22,6 +23,7 @@ Future testRoutingContexts() async { { final rc = await Veilid.instance.routingContext(); final rcp = rc.withSequencing(Sequencing.ensureOrdered); + // More debuggable this way // ignore: cascade_invocations rcp.close(); rc.close(); @@ -34,6 +36,7 @@ Future testRoutingContexts() async { hopCount: 2, stability: Stability.lowLatency, sequencing: Sequencing.noPreference))); + // More debuggable this way // ignore: cascade_invocations rcp.close(); rc.close(); @@ -42,6 +45,7 @@ Future testRoutingContexts() async { final rc = await Veilid.instance.routingContext(); final rcp = rc.withSafety( const SafetySelectionUnsafe(sequencing: Sequencing.preferOrdered)); + // More debuggable this way // ignore: cascade_invocations rcp.close(); rc.close(); diff --git a/veilid-flutter/lib/routing_context.dart b/veilid-flutter/lib/routing_context.dart index 3438e5e2..c9eeed93 100644 --- a/veilid-flutter/lib/routing_context.dart +++ b/veilid-flutter/lib/routing_context.dart @@ -81,7 +81,7 @@ sealed class DHTSchema with _$DHTSchema { const DHTSchema defaultDHTSchema = DHTSchema.dflt(oCnt: 1); @freezed -class DHTSchemaMember with _$DHTSchemaMember { +sealed class DHTSchemaMember with _$DHTSchemaMember { @Assert('mCnt > 0 && mCnt <= 65535', 'value out of range') const factory DHTSchemaMember({ required PublicKey mKey, @@ -96,7 +96,7 @@ class DHTSchemaMember with _$DHTSchemaMember { /// DHTRecordDescriptor @freezed -class DHTRecordDescriptor with _$DHTRecordDescriptor { +sealed class DHTRecordDescriptor with _$DHTRecordDescriptor { const factory DHTRecordDescriptor({ required TypedKey key, required PublicKey owner, @@ -134,7 +134,7 @@ extension DHTRecordDescriptorExt on DHTRecordDescriptor { /// ValueData @freezed -class ValueData with _$ValueData { +sealed class ValueData with _$ValueData { @Assert('seq >= 0', 'seq out of range') const factory ValueData({ required int seq, @@ -224,7 +224,7 @@ class SafetySelectionSafe extends Equatable implements SafetySelection { /// Options for safety routes (sender privacy) @freezed -class SafetySpec with _$SafetySpec { +sealed class SafetySpec with _$SafetySpec { const factory SafetySpec({ required int hopCount, required Stability stability, @@ -239,7 +239,7 @@ class SafetySpec with _$SafetySpec { ////////////////////////////////////// /// RouteBlob @freezed -class RouteBlob with _$RouteBlob { +sealed class RouteBlob with _$RouteBlob { const factory RouteBlob( {required String routeId, @Uint8ListJsonConverter() required Uint8List blob}) = _RouteBlob; @@ -250,12 +250,12 @@ class RouteBlob with _$RouteBlob { ////////////////////////////////////// /// Inspect @freezed -class DHTRecordReport with _$DHTRecordReport { +sealed class DHTRecordReport with _$DHTRecordReport { const factory DHTRecordReport({ required List subkeys, required List offlineSubkeys, - required List localSeqs, - required List networkSeqs, + required List localSeqs, + required List networkSeqs, }) = _DHTRecordReport; factory DHTRecordReport.fromJson(dynamic json) => _$DHTRecordReportFromJson(json as Map); diff --git a/veilid-flutter/lib/routing_context.freezed.dart b/veilid-flutter/lib/routing_context.freezed.dart index b7df1089..8ade1b9a 100644 --- a/veilid-flutter/lib/routing_context.freezed.dart +++ b/veilid-flutter/lib/routing_context.freezed.dart @@ -1,3 +1,4 @@ +// dart format width=80 // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint @@ -9,11 +10,8 @@ part of 'routing_context.dart'; // FreezedGenerator // ************************************************************************** +// dart format off 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#adding-getters-and-methods-to-our-models'); - DHTSchema _$DHTSchemaFromJson(Map json) { switch (json['kind']) { case 'DFLT': @@ -29,150 +27,23 @@ DHTSchema _$DHTSchemaFromJson(Map json) { /// @nodoc mixin _$DHTSchema { - int get oCnt => throw _privateConstructorUsedError; - @optionalTypeArgs - TResult when({ - required TResult Function(int oCnt) dflt, - required TResult Function(int oCnt, List members) smpl, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(int oCnt)? dflt, - TResult? Function(int oCnt, List members)? smpl, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(int oCnt)? dflt, - TResult Function(int oCnt, List members)? smpl, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(DHTSchemaDFLT value) dflt, - required TResult Function(DHTSchemaSMPL value) smpl, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(DHTSchemaDFLT value)? dflt, - TResult? Function(DHTSchemaSMPL value)? smpl, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(DHTSchemaDFLT value)? dflt, - TResult Function(DHTSchemaSMPL value)? smpl, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - - /// Serializes this DHTSchema to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + int get oCnt; /// Create a copy of DHTSchema /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') $DHTSchemaCopyWith get copyWith => - throw _privateConstructorUsedError; -} + _$DHTSchemaCopyWithImpl(this as DHTSchema, _$identity); -/// @nodoc -abstract class $DHTSchemaCopyWith<$Res> { - factory $DHTSchemaCopyWith(DHTSchema value, $Res Function(DHTSchema) then) = - _$DHTSchemaCopyWithImpl<$Res, DHTSchema>; - @useResult - $Res call({int oCnt}); -} - -/// @nodoc -class _$DHTSchemaCopyWithImpl<$Res, $Val extends DHTSchema> - implements $DHTSchemaCopyWith<$Res> { - _$DHTSchemaCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of DHTSchema - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? oCnt = null, - }) { - return _then(_value.copyWith( - oCnt: null == oCnt - ? _value.oCnt - : oCnt // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$DHTSchemaDFLTImplCopyWith<$Res> - implements $DHTSchemaCopyWith<$Res> { - factory _$$DHTSchemaDFLTImplCopyWith( - _$DHTSchemaDFLTImpl value, $Res Function(_$DHTSchemaDFLTImpl) then) = - __$$DHTSchemaDFLTImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({int oCnt}); -} - -/// @nodoc -class __$$DHTSchemaDFLTImplCopyWithImpl<$Res> - extends _$DHTSchemaCopyWithImpl<$Res, _$DHTSchemaDFLTImpl> - implements _$$DHTSchemaDFLTImplCopyWith<$Res> { - __$$DHTSchemaDFLTImplCopyWithImpl( - _$DHTSchemaDFLTImpl _value, $Res Function(_$DHTSchemaDFLTImpl) _then) - : super(_value, _then); - - /// Create a copy of DHTSchema - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? oCnt = null, - }) { - return _then(_$DHTSchemaDFLTImpl( - oCnt: null == oCnt - ? _value.oCnt - : oCnt // ignore: cast_nullable_to_non_nullable - as int, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$DHTSchemaDFLTImpl implements DHTSchemaDFLT { - const _$DHTSchemaDFLTImpl({required this.oCnt, final String? $type}) - : $type = $type ?? 'DFLT'; - - factory _$DHTSchemaDFLTImpl.fromJson(Map json) => - _$$DHTSchemaDFLTImplFromJson(json); - - @override - final int oCnt; - - @JsonKey(name: 'kind') - final String $type; - - @override - String toString() { - return 'DHTSchema.dflt(oCnt: $oCnt)'; - } + /// Serializes this DHTSchema to a JSON map. + Map toJson(); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$DHTSchemaDFLTImpl && + other is DHTSchema && (identical(other.oCnt, oCnt) || other.oCnt == oCnt)); } @@ -180,119 +51,26 @@ class _$DHTSchemaDFLTImpl implements DHTSchemaDFLT { @override int get hashCode => Object.hash(runtimeType, oCnt); - /// Create a copy of DHTSchema - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$DHTSchemaDFLTImplCopyWith<_$DHTSchemaDFLTImpl> get copyWith => - __$$DHTSchemaDFLTImplCopyWithImpl<_$DHTSchemaDFLTImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(int oCnt) dflt, - required TResult Function(int oCnt, List members) smpl, - }) { - return dflt(oCnt); + String toString() { + return 'DHTSchema(oCnt: $oCnt)'; } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(int oCnt)? dflt, - TResult? Function(int oCnt, List members)? smpl, - }) { - return dflt?.call(oCnt); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(int oCnt)? dflt, - TResult Function(int oCnt, List members)? smpl, - required TResult orElse(), - }) { - if (dflt != null) { - return dflt(oCnt); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(DHTSchemaDFLT value) dflt, - required TResult Function(DHTSchemaSMPL value) smpl, - }) { - return dflt(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(DHTSchemaDFLT value)? dflt, - TResult? Function(DHTSchemaSMPL value)? smpl, - }) { - return dflt?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(DHTSchemaDFLT value)? dflt, - TResult Function(DHTSchemaSMPL value)? smpl, - required TResult orElse(), - }) { - if (dflt != null) { - return dflt(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$DHTSchemaDFLTImplToJson( - this, - ); - } -} - -abstract class DHTSchemaDFLT implements DHTSchema { - const factory DHTSchemaDFLT({required final int oCnt}) = _$DHTSchemaDFLTImpl; - - factory DHTSchemaDFLT.fromJson(Map json) = - _$DHTSchemaDFLTImpl.fromJson; - - @override - int get oCnt; - - /// Create a copy of DHTSchema - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$DHTSchemaDFLTImplCopyWith<_$DHTSchemaDFLTImpl> get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$DHTSchemaSMPLImplCopyWith<$Res> - implements $DHTSchemaCopyWith<$Res> { - factory _$$DHTSchemaSMPLImplCopyWith( - _$DHTSchemaSMPLImpl value, $Res Function(_$DHTSchemaSMPLImpl) then) = - __$$DHTSchemaSMPLImplCopyWithImpl<$Res>; - @override +abstract mixin class $DHTSchemaCopyWith<$Res> { + factory $DHTSchemaCopyWith(DHTSchema value, $Res Function(DHTSchema) _then) = + _$DHTSchemaCopyWithImpl; @useResult - $Res call({int oCnt, List members}); + $Res call({int oCnt}); } /// @nodoc -class __$$DHTSchemaSMPLImplCopyWithImpl<$Res> - extends _$DHTSchemaCopyWithImpl<$Res, _$DHTSchemaSMPLImpl> - implements _$$DHTSchemaSMPLImplCopyWith<$Res> { - __$$DHTSchemaSMPLImplCopyWithImpl( - _$DHTSchemaSMPLImpl _value, $Res Function(_$DHTSchemaSMPLImpl) _then) - : super(_value, _then); +class _$DHTSchemaCopyWithImpl<$Res> implements $DHTSchemaCopyWith<$Res> { + _$DHTSchemaCopyWithImpl(this._self, this._then); + + final DHTSchema _self; + final $Res Function(DHTSchema) _then; /// Create a copy of DHTSchema /// with the given fields replaced by the non-null parameter values. @@ -300,38 +78,113 @@ class __$$DHTSchemaSMPLImplCopyWithImpl<$Res> @override $Res call({ Object? oCnt = null, - Object? members = null, }) { - return _then(_$DHTSchemaSMPLImpl( + return _then(_self.copyWith( oCnt: null == oCnt - ? _value.oCnt + ? _self.oCnt : oCnt // ignore: cast_nullable_to_non_nullable as int, - members: null == members - ? _value._members - : members // ignore: cast_nullable_to_non_nullable - as List, )); } } /// @nodoc @JsonSerializable() -class _$DHTSchemaSMPLImpl implements DHTSchemaSMPL { - const _$DHTSchemaSMPLImpl( +class DHTSchemaDFLT implements DHTSchema { + const DHTSchemaDFLT({required this.oCnt, final String? $type}) + : $type = $type ?? 'DFLT'; + factory DHTSchemaDFLT.fromJson(Map json) => + _$DHTSchemaDFLTFromJson(json); + + @override + final int oCnt; + + @JsonKey(name: 'kind') + final String $type; + + /// Create a copy of DHTSchema + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $DHTSchemaDFLTCopyWith get copyWith => + _$DHTSchemaDFLTCopyWithImpl(this, _$identity); + + @override + Map toJson() { + return _$DHTSchemaDFLTToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is DHTSchemaDFLT && + (identical(other.oCnt, oCnt) || other.oCnt == oCnt)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, oCnt); + + @override + String toString() { + return 'DHTSchema.dflt(oCnt: $oCnt)'; + } +} + +/// @nodoc +abstract mixin class $DHTSchemaDFLTCopyWith<$Res> + implements $DHTSchemaCopyWith<$Res> { + factory $DHTSchemaDFLTCopyWith( + DHTSchemaDFLT value, $Res Function(DHTSchemaDFLT) _then) = + _$DHTSchemaDFLTCopyWithImpl; + @override + @useResult + $Res call({int oCnt}); +} + +/// @nodoc +class _$DHTSchemaDFLTCopyWithImpl<$Res> + implements $DHTSchemaDFLTCopyWith<$Res> { + _$DHTSchemaDFLTCopyWithImpl(this._self, this._then); + + final DHTSchemaDFLT _self; + final $Res Function(DHTSchemaDFLT) _then; + + /// Create a copy of DHTSchema + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? oCnt = null, + }) { + return _then(DHTSchemaDFLT( + oCnt: null == oCnt + ? _self.oCnt + : oCnt // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +@JsonSerializable() +class DHTSchemaSMPL implements DHTSchema { + const DHTSchemaSMPL( {required this.oCnt, required final List members, final String? $type}) : _members = members, $type = $type ?? 'SMPL'; - - factory _$DHTSchemaSMPLImpl.fromJson(Map json) => - _$$DHTSchemaSMPLImplFromJson(json); + factory DHTSchemaSMPL.fromJson(Map json) => + _$DHTSchemaSMPLFromJson(json); @override final int oCnt; final List _members; - @override List get members { if (_members is EqualUnmodifiableListView) return _members; // ignore: implicit_dynamic_type @@ -341,16 +194,26 @@ class _$DHTSchemaSMPLImpl implements DHTSchemaSMPL { @JsonKey(name: 'kind') final String $type; + /// Create a copy of DHTSchema + /// with the given fields replaced by the non-null parameter values. @override - String toString() { - return 'DHTSchema.smpl(oCnt: $oCnt, members: $members)'; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $DHTSchemaSMPLCopyWith get copyWith => + _$DHTSchemaSMPLCopyWithImpl(this, _$identity); + + @override + Map toJson() { + return _$DHTSchemaSMPLToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$DHTSchemaSMPLImpl && + other is DHTSchemaSMPL && (identical(other.oCnt, oCnt) || other.oCnt == oCnt) && const DeepCollectionEquality().equals(other._members, _members)); } @@ -360,227 +223,73 @@ class _$DHTSchemaSMPLImpl implements DHTSchemaSMPL { int get hashCode => Object.hash( runtimeType, oCnt, const DeepCollectionEquality().hash(_members)); - /// Create a copy of DHTSchema - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$DHTSchemaSMPLImplCopyWith<_$DHTSchemaSMPLImpl> get copyWith => - __$$DHTSchemaSMPLImplCopyWithImpl<_$DHTSchemaSMPLImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(int oCnt) dflt, - required TResult Function(int oCnt, List members) smpl, - }) { - return smpl(oCnt, members); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(int oCnt)? dflt, - TResult? Function(int oCnt, List members)? smpl, - }) { - return smpl?.call(oCnt, members); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(int oCnt)? dflt, - TResult Function(int oCnt, List members)? smpl, - required TResult orElse(), - }) { - if (smpl != null) { - return smpl(oCnt, members); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(DHTSchemaDFLT value) dflt, - required TResult Function(DHTSchemaSMPL value) smpl, - }) { - return smpl(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(DHTSchemaDFLT value)? dflt, - TResult? Function(DHTSchemaSMPL value)? smpl, - }) { - return smpl?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(DHTSchemaDFLT value)? dflt, - TResult Function(DHTSchemaSMPL value)? smpl, - required TResult orElse(), - }) { - if (smpl != null) { - return smpl(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$DHTSchemaSMPLImplToJson( - this, - ); + String toString() { + return 'DHTSchema.smpl(oCnt: $oCnt, members: $members)'; } } -abstract class DHTSchemaSMPL implements DHTSchema { - const factory DHTSchemaSMPL( - {required final int oCnt, - required final List members}) = _$DHTSchemaSMPLImpl; - - factory DHTSchemaSMPL.fromJson(Map json) = - _$DHTSchemaSMPLImpl.fromJson; - +/// @nodoc +abstract mixin class $DHTSchemaSMPLCopyWith<$Res> + implements $DHTSchemaCopyWith<$Res> { + factory $DHTSchemaSMPLCopyWith( + DHTSchemaSMPL value, $Res Function(DHTSchemaSMPL) _then) = + _$DHTSchemaSMPLCopyWithImpl; @override - int get oCnt; - List get members; + @useResult + $Res call({int oCnt, List members}); +} + +/// @nodoc +class _$DHTSchemaSMPLCopyWithImpl<$Res> + implements $DHTSchemaSMPLCopyWith<$Res> { + _$DHTSchemaSMPLCopyWithImpl(this._self, this._then); + + final DHTSchemaSMPL _self; + final $Res Function(DHTSchemaSMPL) _then; /// Create a copy of DHTSchema /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$DHTSchemaSMPLImplCopyWith<_$DHTSchemaSMPLImpl> get copyWith => - throw _privateConstructorUsedError; -} - -DHTSchemaMember _$DHTSchemaMemberFromJson(Map json) { - return _DHTSchemaMember.fromJson(json); -} - -/// @nodoc -mixin _$DHTSchemaMember { - FixedEncodedString43 get mKey => throw _privateConstructorUsedError; - int get mCnt => throw _privateConstructorUsedError; - - /// Serializes this DHTSchemaMember to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of DHTSchemaMember - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $DHTSchemaMemberCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $DHTSchemaMemberCopyWith<$Res> { - factory $DHTSchemaMemberCopyWith( - DHTSchemaMember value, $Res Function(DHTSchemaMember) then) = - _$DHTSchemaMemberCopyWithImpl<$Res, DHTSchemaMember>; - @useResult - $Res call({FixedEncodedString43 mKey, int mCnt}); -} - -/// @nodoc -class _$DHTSchemaMemberCopyWithImpl<$Res, $Val extends DHTSchemaMember> - implements $DHTSchemaMemberCopyWith<$Res> { - _$DHTSchemaMemberCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of DHTSchemaMember - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ - Object? mKey = null, - Object? mCnt = null, + Object? oCnt = null, + Object? members = null, }) { - return _then(_value.copyWith( - mKey: null == mKey - ? _value.mKey - : mKey // ignore: cast_nullable_to_non_nullable - as FixedEncodedString43, - mCnt: null == mCnt - ? _value.mCnt - : mCnt // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$DHTSchemaMemberImplCopyWith<$Res> - implements $DHTSchemaMemberCopyWith<$Res> { - factory _$$DHTSchemaMemberImplCopyWith(_$DHTSchemaMemberImpl value, - $Res Function(_$DHTSchemaMemberImpl) then) = - __$$DHTSchemaMemberImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({FixedEncodedString43 mKey, int mCnt}); -} - -/// @nodoc -class __$$DHTSchemaMemberImplCopyWithImpl<$Res> - extends _$DHTSchemaMemberCopyWithImpl<$Res, _$DHTSchemaMemberImpl> - implements _$$DHTSchemaMemberImplCopyWith<$Res> { - __$$DHTSchemaMemberImplCopyWithImpl( - _$DHTSchemaMemberImpl _value, $Res Function(_$DHTSchemaMemberImpl) _then) - : super(_value, _then); - - /// Create a copy of DHTSchemaMember - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? mKey = null, - Object? mCnt = null, - }) { - return _then(_$DHTSchemaMemberImpl( - mKey: null == mKey - ? _value.mKey - : mKey // ignore: cast_nullable_to_non_nullable - as FixedEncodedString43, - mCnt: null == mCnt - ? _value.mCnt - : mCnt // ignore: cast_nullable_to_non_nullable + return _then(DHTSchemaSMPL( + oCnt: null == oCnt + ? _self.oCnt + : oCnt // ignore: cast_nullable_to_non_nullable as int, + members: null == members + ? _self._members + : members // ignore: cast_nullable_to_non_nullable + as List, )); } } /// @nodoc -@JsonSerializable() -class _$DHTSchemaMemberImpl implements _DHTSchemaMember { - const _$DHTSchemaMemberImpl({required this.mKey, required this.mCnt}) - : assert(mCnt > 0 && mCnt <= 65535, 'value out of range'); +mixin _$DHTSchemaMember { + PublicKey get mKey; + int get mCnt; - factory _$DHTSchemaMemberImpl.fromJson(Map json) => - _$$DHTSchemaMemberImplFromJson(json); + /// Create a copy of DHTSchemaMember + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $DHTSchemaMemberCopyWith get copyWith => + _$DHTSchemaMemberCopyWithImpl( + this as DHTSchemaMember, _$identity); - @override - final FixedEncodedString43 mKey; - @override - final int mCnt; - - @override - String toString() { - return 'DHTSchemaMember(mKey: $mKey, mCnt: $mCnt)'; - } + /// Serializes this DHTSchemaMember to a JSON map. + Map toJson(); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$DHTSchemaMemberImpl && + other is DHTSchemaMember && (identical(other.mKey, mKey) || other.mKey == mKey) && (identical(other.mCnt, mCnt) || other.mCnt == mCnt)); } @@ -589,219 +298,160 @@ class _$DHTSchemaMemberImpl implements _DHTSchemaMember { @override int get hashCode => Object.hash(runtimeType, mKey, mCnt); - /// Create a copy of DHTSchemaMember - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$DHTSchemaMemberImplCopyWith<_$DHTSchemaMemberImpl> get copyWith => - __$$DHTSchemaMemberImplCopyWithImpl<_$DHTSchemaMemberImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$DHTSchemaMemberImplToJson( - this, - ); + String toString() { + return 'DHTSchemaMember(mKey: $mKey, mCnt: $mCnt)'; } } -abstract class _DHTSchemaMember implements DHTSchemaMember { - const factory _DHTSchemaMember( - {required final FixedEncodedString43 mKey, - required final int mCnt}) = _$DHTSchemaMemberImpl; +/// @nodoc +abstract mixin class $DHTSchemaMemberCopyWith<$Res> { + factory $DHTSchemaMemberCopyWith( + DHTSchemaMember value, $Res Function(DHTSchemaMember) _then) = + _$DHTSchemaMemberCopyWithImpl; + @useResult + $Res call({FixedEncodedString43 mKey, int mCnt}); +} - factory _DHTSchemaMember.fromJson(Map json) = - _$DHTSchemaMemberImpl.fromJson; +/// @nodoc +class _$DHTSchemaMemberCopyWithImpl<$Res> + implements $DHTSchemaMemberCopyWith<$Res> { + _$DHTSchemaMemberCopyWithImpl(this._self, this._then); - @override - FixedEncodedString43 get mKey; - @override - int get mCnt; + final DHTSchemaMember _self; + final $Res Function(DHTSchemaMember) _then; /// Create a copy of DHTSchemaMember /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$DHTSchemaMemberImplCopyWith<_$DHTSchemaMemberImpl> get copyWith => - throw _privateConstructorUsedError; -} - -DHTRecordDescriptor _$DHTRecordDescriptorFromJson(Map json) { - return _DHTRecordDescriptor.fromJson(json); -} - -/// @nodoc -mixin _$DHTRecordDescriptor { - Typed get key => throw _privateConstructorUsedError; - FixedEncodedString43 get owner => throw _privateConstructorUsedError; - DHTSchema get schema => throw _privateConstructorUsedError; - FixedEncodedString43? get ownerSecret => throw _privateConstructorUsedError; - - /// Serializes this DHTRecordDescriptor to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of DHTRecordDescriptor - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $DHTRecordDescriptorCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $DHTRecordDescriptorCopyWith<$Res> { - factory $DHTRecordDescriptorCopyWith( - DHTRecordDescriptor value, $Res Function(DHTRecordDescriptor) then) = - _$DHTRecordDescriptorCopyWithImpl<$Res, DHTRecordDescriptor>; - @useResult - $Res call( - {Typed key, - FixedEncodedString43 owner, - DHTSchema schema, - FixedEncodedString43? ownerSecret}); - - $DHTSchemaCopyWith<$Res> get schema; -} - -/// @nodoc -class _$DHTRecordDescriptorCopyWithImpl<$Res, $Val extends DHTRecordDescriptor> - implements $DHTRecordDescriptorCopyWith<$Res> { - _$DHTRecordDescriptorCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of DHTRecordDescriptor - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? key = null, - Object? owner = null, - Object? schema = null, - Object? ownerSecret = freezed, + Object? mKey = null, + Object? mCnt = null, }) { - return _then(_value.copyWith( - key: null == key - ? _value.key - : key // ignore: cast_nullable_to_non_nullable - as Typed, - owner: null == owner - ? _value.owner - : owner // ignore: cast_nullable_to_non_nullable + return _then(_self.copyWith( + mKey: null == mKey + ? _self.mKey! + : mKey // ignore: cast_nullable_to_non_nullable as FixedEncodedString43, - schema: null == schema - ? _value.schema - : schema // ignore: cast_nullable_to_non_nullable - as DHTSchema, - ownerSecret: freezed == ownerSecret - ? _value.ownerSecret - : ownerSecret // ignore: cast_nullable_to_non_nullable - as FixedEncodedString43?, - ) as $Val); - } - - /// Create a copy of DHTRecordDescriptor - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $DHTSchemaCopyWith<$Res> get schema { - return $DHTSchemaCopyWith<$Res>(_value.schema, (value) { - return _then(_value.copyWith(schema: value) as $Val); - }); - } -} - -/// @nodoc -abstract class _$$DHTRecordDescriptorImplCopyWith<$Res> - implements $DHTRecordDescriptorCopyWith<$Res> { - factory _$$DHTRecordDescriptorImplCopyWith(_$DHTRecordDescriptorImpl value, - $Res Function(_$DHTRecordDescriptorImpl) then) = - __$$DHTRecordDescriptorImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {Typed key, - FixedEncodedString43 owner, - DHTSchema schema, - FixedEncodedString43? ownerSecret}); - - @override - $DHTSchemaCopyWith<$Res> get schema; -} - -/// @nodoc -class __$$DHTRecordDescriptorImplCopyWithImpl<$Res> - extends _$DHTRecordDescriptorCopyWithImpl<$Res, _$DHTRecordDescriptorImpl> - implements _$$DHTRecordDescriptorImplCopyWith<$Res> { - __$$DHTRecordDescriptorImplCopyWithImpl(_$DHTRecordDescriptorImpl _value, - $Res Function(_$DHTRecordDescriptorImpl) _then) - : super(_value, _then); - - /// Create a copy of DHTRecordDescriptor - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? key = null, - Object? owner = null, - Object? schema = null, - Object? ownerSecret = freezed, - }) { - return _then(_$DHTRecordDescriptorImpl( - key: null == key - ? _value.key - : key // ignore: cast_nullable_to_non_nullable - as Typed, - owner: null == owner - ? _value.owner - : owner // ignore: cast_nullable_to_non_nullable - as FixedEncodedString43, - schema: null == schema - ? _value.schema - : schema // ignore: cast_nullable_to_non_nullable - as DHTSchema, - ownerSecret: freezed == ownerSecret - ? _value.ownerSecret - : ownerSecret // ignore: cast_nullable_to_non_nullable - as FixedEncodedString43?, + mCnt: null == mCnt + ? _self.mCnt + : mCnt // ignore: cast_nullable_to_non_nullable + as int, )); } } /// @nodoc @JsonSerializable() -class _$DHTRecordDescriptorImpl implements _DHTRecordDescriptor { - const _$DHTRecordDescriptorImpl( - {required this.key, - required this.owner, - required this.schema, - this.ownerSecret}); - - factory _$DHTRecordDescriptorImpl.fromJson(Map json) => - _$$DHTRecordDescriptorImplFromJson(json); +class _DHTSchemaMember implements DHTSchemaMember { + const _DHTSchemaMember({required this.mKey, required this.mCnt}) + : assert(mCnt > 0 && mCnt <= 65535, 'value out of range'); + factory _DHTSchemaMember.fromJson(Map json) => + _$DHTSchemaMemberFromJson(json); @override - final Typed key; + final FixedEncodedString43 mKey; @override - final FixedEncodedString43 owner; + final int mCnt; + + /// Create a copy of DHTSchemaMember + /// with the given fields replaced by the non-null parameter values. @override - final DHTSchema schema; - @override - final FixedEncodedString43? ownerSecret; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$DHTSchemaMemberCopyWith<_DHTSchemaMember> get copyWith => + __$DHTSchemaMemberCopyWithImpl<_DHTSchemaMember>(this, _$identity); @override - String toString() { - return 'DHTRecordDescriptor(key: $key, owner: $owner, schema: $schema, ownerSecret: $ownerSecret)'; + Map toJson() { + return _$DHTSchemaMemberToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$DHTRecordDescriptorImpl && + other is _DHTSchemaMember && + (identical(other.mKey, mKey) || other.mKey == mKey) && + (identical(other.mCnt, mCnt) || other.mCnt == mCnt)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, mKey, mCnt); + + @override + String toString() { + return 'DHTSchemaMember(mKey: $mKey, mCnt: $mCnt)'; + } +} + +/// @nodoc +abstract mixin class _$DHTSchemaMemberCopyWith<$Res> + implements $DHTSchemaMemberCopyWith<$Res> { + factory _$DHTSchemaMemberCopyWith( + _DHTSchemaMember value, $Res Function(_DHTSchemaMember) _then) = + __$DHTSchemaMemberCopyWithImpl; + @override + @useResult + $Res call({FixedEncodedString43 mKey, int mCnt}); +} + +/// @nodoc +class __$DHTSchemaMemberCopyWithImpl<$Res> + implements _$DHTSchemaMemberCopyWith<$Res> { + __$DHTSchemaMemberCopyWithImpl(this._self, this._then); + + final _DHTSchemaMember _self; + final $Res Function(_DHTSchemaMember) _then; + + /// Create a copy of DHTSchemaMember + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? mKey = null, + Object? mCnt = null, + }) { + return _then(_DHTSchemaMember( + mKey: null == mKey + ? _self.mKey + : mKey // ignore: cast_nullable_to_non_nullable + as FixedEncodedString43, + mCnt: null == mCnt + ? _self.mCnt + : mCnt // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +mixin _$DHTRecordDescriptor { + TypedKey get key; + PublicKey get owner; + DHTSchema get schema; + PublicKey? get ownerSecret; + + /// Create a copy of DHTRecordDescriptor + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $DHTRecordDescriptorCopyWith get copyWith => + _$DHTRecordDescriptorCopyWithImpl( + this as DHTRecordDescriptor, _$identity); + + /// Serializes this DHTRecordDescriptor to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is DHTRecordDescriptor && (identical(other.key, key) || other.key == key) && (identical(other.owner, owner) || other.owner == owner) && (identical(other.schema, schema) || other.schema == schema) && @@ -813,196 +463,223 @@ class _$DHTRecordDescriptorImpl implements _DHTRecordDescriptor { @override int get hashCode => Object.hash(runtimeType, key, owner, schema, ownerSecret); - /// Create a copy of DHTRecordDescriptor - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$DHTRecordDescriptorImplCopyWith<_$DHTRecordDescriptorImpl> get copyWith => - __$$DHTRecordDescriptorImplCopyWithImpl<_$DHTRecordDescriptorImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$DHTRecordDescriptorImplToJson( - this, - ); - } -} - -abstract class _DHTRecordDescriptor implements DHTRecordDescriptor { - const factory _DHTRecordDescriptor( - {required final Typed key, - required final FixedEncodedString43 owner, - required final DHTSchema schema, - final FixedEncodedString43? ownerSecret}) = _$DHTRecordDescriptorImpl; - - factory _DHTRecordDescriptor.fromJson(Map json) = - _$DHTRecordDescriptorImpl.fromJson; - - @override - Typed get key; - @override - FixedEncodedString43 get owner; - @override - DHTSchema get schema; - @override - FixedEncodedString43? get ownerSecret; - - /// Create a copy of DHTRecordDescriptor - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$DHTRecordDescriptorImplCopyWith<_$DHTRecordDescriptorImpl> get copyWith => - throw _privateConstructorUsedError; -} - -ValueData _$ValueDataFromJson(Map json) { - return _ValueData.fromJson(json); -} - -/// @nodoc -mixin _$ValueData { - int get seq => throw _privateConstructorUsedError; - @Uint8ListJsonConverter.jsIsArray() - Uint8List get data => throw _privateConstructorUsedError; - FixedEncodedString43 get writer => throw _privateConstructorUsedError; - - /// Serializes this ValueData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of ValueData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ValueDataCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $ValueDataCopyWith<$Res> { - factory $ValueDataCopyWith(ValueData value, $Res Function(ValueData) then) = - _$ValueDataCopyWithImpl<$Res, ValueData>; - @useResult - $Res call( - {int seq, - @Uint8ListJsonConverter.jsIsArray() Uint8List data, - FixedEncodedString43 writer}); -} - -/// @nodoc -class _$ValueDataCopyWithImpl<$Res, $Val extends ValueData> - implements $ValueDataCopyWith<$Res> { - _$ValueDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ValueData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? seq = null, - Object? data = null, - Object? writer = null, - }) { - return _then(_value.copyWith( - seq: null == seq - ? _value.seq - : seq // ignore: cast_nullable_to_non_nullable - as int, - data: null == data - ? _value.data - : data // ignore: cast_nullable_to_non_nullable - as Uint8List, - writer: null == writer - ? _value.writer - : writer // ignore: cast_nullable_to_non_nullable - as FixedEncodedString43, - ) as $Val); + String toString() { + return 'DHTRecordDescriptor(key: $key, owner: $owner, schema: $schema, ownerSecret: $ownerSecret)'; } } /// @nodoc -abstract class _$$ValueDataImplCopyWith<$Res> - implements $ValueDataCopyWith<$Res> { - factory _$$ValueDataImplCopyWith( - _$ValueDataImpl value, $Res Function(_$ValueDataImpl) then) = - __$$ValueDataImplCopyWithImpl<$Res>; - @override +abstract mixin class $DHTRecordDescriptorCopyWith<$Res> { + factory $DHTRecordDescriptorCopyWith( + DHTRecordDescriptor value, $Res Function(DHTRecordDescriptor) _then) = + _$DHTRecordDescriptorCopyWithImpl; @useResult $Res call( - {int seq, - @Uint8ListJsonConverter.jsIsArray() Uint8List data, - FixedEncodedString43 writer}); + {Typed key, + FixedEncodedString43 owner, + DHTSchema schema, + FixedEncodedString43? ownerSecret}); + + $DHTSchemaCopyWith<$Res> get schema; } /// @nodoc -class __$$ValueDataImplCopyWithImpl<$Res> - extends _$ValueDataCopyWithImpl<$Res, _$ValueDataImpl> - implements _$$ValueDataImplCopyWith<$Res> { - __$$ValueDataImplCopyWithImpl( - _$ValueDataImpl _value, $Res Function(_$ValueDataImpl) _then) - : super(_value, _then); +class _$DHTRecordDescriptorCopyWithImpl<$Res> + implements $DHTRecordDescriptorCopyWith<$Res> { + _$DHTRecordDescriptorCopyWithImpl(this._self, this._then); - /// Create a copy of ValueData + final DHTRecordDescriptor _self; + final $Res Function(DHTRecordDescriptor) _then; + + /// Create a copy of DHTRecordDescriptor /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? seq = null, - Object? data = null, - Object? writer = null, + Object? key = null, + Object? owner = null, + Object? schema = null, + Object? ownerSecret = freezed, }) { - return _then(_$ValueDataImpl( - seq: null == seq - ? _value.seq - : seq // ignore: cast_nullable_to_non_nullable - as int, - data: null == data - ? _value.data - : data // ignore: cast_nullable_to_non_nullable - as Uint8List, - writer: null == writer - ? _value.writer - : writer // ignore: cast_nullable_to_non_nullable + return _then(_self.copyWith( + key: null == key + ? _self.key! + : key // ignore: cast_nullable_to_non_nullable + as Typed, + owner: null == owner + ? _self.owner! + : owner // ignore: cast_nullable_to_non_nullable as FixedEncodedString43, + schema: null == schema + ? _self.schema + : schema // ignore: cast_nullable_to_non_nullable + as DHTSchema, + ownerSecret: freezed == ownerSecret + ? _self.ownerSecret! + : ownerSecret // ignore: cast_nullable_to_non_nullable + as FixedEncodedString43?, )); } + + /// Create a copy of DHTRecordDescriptor + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $DHTSchemaCopyWith<$Res> get schema { + return $DHTSchemaCopyWith<$Res>(_self.schema, (value) { + return _then(_self.copyWith(schema: value)); + }); + } } /// @nodoc @JsonSerializable() -class _$ValueDataImpl implements _ValueData { - const _$ValueDataImpl( - {required this.seq, - @Uint8ListJsonConverter.jsIsArray() required this.data, - required this.writer}) - : assert(seq >= 0, 'seq out of range'); - - factory _$ValueDataImpl.fromJson(Map json) => - _$$ValueDataImplFromJson(json); +class _DHTRecordDescriptor implements DHTRecordDescriptor { + const _DHTRecordDescriptor( + {required this.key, + required this.owner, + required this.schema, + this.ownerSecret}); + factory _DHTRecordDescriptor.fromJson(Map json) => + _$DHTRecordDescriptorFromJson(json); @override - final int seq; + final Typed key; @override - @Uint8ListJsonConverter.jsIsArray() - final Uint8List data; + final FixedEncodedString43 owner; @override - final FixedEncodedString43 writer; + final DHTSchema schema; + @override + final FixedEncodedString43? ownerSecret; + + /// Create a copy of DHTRecordDescriptor + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$DHTRecordDescriptorCopyWith<_DHTRecordDescriptor> get copyWith => + __$DHTRecordDescriptorCopyWithImpl<_DHTRecordDescriptor>( + this, _$identity); @override - String toString() { - return 'ValueData(seq: $seq, data: $data, writer: $writer)'; + Map toJson() { + return _$DHTRecordDescriptorToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$ValueDataImpl && + other is _DHTRecordDescriptor && + (identical(other.key, key) || other.key == key) && + (identical(other.owner, owner) || other.owner == owner) && + (identical(other.schema, schema) || other.schema == schema) && + (identical(other.ownerSecret, ownerSecret) || + other.ownerSecret == ownerSecret)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, key, owner, schema, ownerSecret); + + @override + String toString() { + return 'DHTRecordDescriptor(key: $key, owner: $owner, schema: $schema, ownerSecret: $ownerSecret)'; + } +} + +/// @nodoc +abstract mixin class _$DHTRecordDescriptorCopyWith<$Res> + implements $DHTRecordDescriptorCopyWith<$Res> { + factory _$DHTRecordDescriptorCopyWith(_DHTRecordDescriptor value, + $Res Function(_DHTRecordDescriptor) _then) = + __$DHTRecordDescriptorCopyWithImpl; + @override + @useResult + $Res call( + {Typed key, + FixedEncodedString43 owner, + DHTSchema schema, + FixedEncodedString43? ownerSecret}); + + @override + $DHTSchemaCopyWith<$Res> get schema; +} + +/// @nodoc +class __$DHTRecordDescriptorCopyWithImpl<$Res> + implements _$DHTRecordDescriptorCopyWith<$Res> { + __$DHTRecordDescriptorCopyWithImpl(this._self, this._then); + + final _DHTRecordDescriptor _self; + final $Res Function(_DHTRecordDescriptor) _then; + + /// Create a copy of DHTRecordDescriptor + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? key = null, + Object? owner = null, + Object? schema = null, + Object? ownerSecret = freezed, + }) { + return _then(_DHTRecordDescriptor( + key: null == key + ? _self.key + : key // ignore: cast_nullable_to_non_nullable + as Typed, + owner: null == owner + ? _self.owner + : owner // ignore: cast_nullable_to_non_nullable + as FixedEncodedString43, + schema: null == schema + ? _self.schema + : schema // ignore: cast_nullable_to_non_nullable + as DHTSchema, + ownerSecret: freezed == ownerSecret + ? _self.ownerSecret + : ownerSecret // ignore: cast_nullable_to_non_nullable + as FixedEncodedString43?, + )); + } + + /// Create a copy of DHTRecordDescriptor + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $DHTSchemaCopyWith<$Res> get schema { + return $DHTSchemaCopyWith<$Res>(_self.schema, (value) { + return _then(_self.copyWith(schema: value)); + }); + } +} + +/// @nodoc +mixin _$ValueData { + int get seq; + @Uint8ListJsonConverter.jsIsArray() + Uint8List get data; + PublicKey get writer; + + /// Create a copy of ValueData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $ValueDataCopyWith get copyWith => + _$ValueDataCopyWithImpl(this as ValueData, _$identity); + + /// Serializes this ValueData to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is ValueData && (identical(other.seq, seq) || other.seq == seq) && const DeepCollectionEquality().equals(other.data, data) && (identical(other.writer, writer) || other.writer == writer)); @@ -1013,207 +690,180 @@ class _$ValueDataImpl implements _ValueData { int get hashCode => Object.hash( runtimeType, seq, const DeepCollectionEquality().hash(data), writer); - /// Create a copy of ValueData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$ValueDataImplCopyWith<_$ValueDataImpl> get copyWith => - __$$ValueDataImplCopyWithImpl<_$ValueDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ValueDataImplToJson( - this, - ); - } -} - -abstract class _ValueData implements ValueData { - const factory _ValueData( - {required final int seq, - @Uint8ListJsonConverter.jsIsArray() required final Uint8List data, - required final FixedEncodedString43 writer}) = _$ValueDataImpl; - - factory _ValueData.fromJson(Map json) = - _$ValueDataImpl.fromJson; - - @override - int get seq; - @override - @Uint8ListJsonConverter.jsIsArray() - Uint8List get data; - @override - FixedEncodedString43 get writer; - - /// Create a copy of ValueData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ValueDataImplCopyWith<_$ValueDataImpl> get copyWith => - throw _privateConstructorUsedError; -} - -SafetySpec _$SafetySpecFromJson(Map json) { - return _SafetySpec.fromJson(json); -} - -/// @nodoc -mixin _$SafetySpec { - int get hopCount => throw _privateConstructorUsedError; - Stability get stability => throw _privateConstructorUsedError; - Sequencing get sequencing => throw _privateConstructorUsedError; - String? get preferredRoute => throw _privateConstructorUsedError; - - /// Serializes this SafetySpec to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of SafetySpec - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $SafetySpecCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $SafetySpecCopyWith<$Res> { - factory $SafetySpecCopyWith( - SafetySpec value, $Res Function(SafetySpec) then) = - _$SafetySpecCopyWithImpl<$Res, SafetySpec>; - @useResult - $Res call( - {int hopCount, - Stability stability, - Sequencing sequencing, - String? preferredRoute}); -} - -/// @nodoc -class _$SafetySpecCopyWithImpl<$Res, $Val extends SafetySpec> - implements $SafetySpecCopyWith<$Res> { - _$SafetySpecCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of SafetySpec - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? hopCount = null, - Object? stability = null, - Object? sequencing = null, - Object? preferredRoute = freezed, - }) { - return _then(_value.copyWith( - hopCount: null == hopCount - ? _value.hopCount - : hopCount // ignore: cast_nullable_to_non_nullable - as int, - stability: null == stability - ? _value.stability - : stability // ignore: cast_nullable_to_non_nullable - as Stability, - sequencing: null == sequencing - ? _value.sequencing - : sequencing // ignore: cast_nullable_to_non_nullable - as Sequencing, - preferredRoute: freezed == preferredRoute - ? _value.preferredRoute - : preferredRoute // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + String toString() { + return 'ValueData(seq: $seq, data: $data, writer: $writer)'; } } /// @nodoc -abstract class _$$SafetySpecImplCopyWith<$Res> - implements $SafetySpecCopyWith<$Res> { - factory _$$SafetySpecImplCopyWith( - _$SafetySpecImpl value, $Res Function(_$SafetySpecImpl) then) = - __$$SafetySpecImplCopyWithImpl<$Res>; - @override +abstract mixin class $ValueDataCopyWith<$Res> { + factory $ValueDataCopyWith(ValueData value, $Res Function(ValueData) _then) = + _$ValueDataCopyWithImpl; @useResult $Res call( - {int hopCount, - Stability stability, - Sequencing sequencing, - String? preferredRoute}); + {int seq, + @Uint8ListJsonConverter.jsIsArray() Uint8List data, + FixedEncodedString43 writer}); } /// @nodoc -class __$$SafetySpecImplCopyWithImpl<$Res> - extends _$SafetySpecCopyWithImpl<$Res, _$SafetySpecImpl> - implements _$$SafetySpecImplCopyWith<$Res> { - __$$SafetySpecImplCopyWithImpl( - _$SafetySpecImpl _value, $Res Function(_$SafetySpecImpl) _then) - : super(_value, _then); +class _$ValueDataCopyWithImpl<$Res> implements $ValueDataCopyWith<$Res> { + _$ValueDataCopyWithImpl(this._self, this._then); - /// Create a copy of SafetySpec + final ValueData _self; + final $Res Function(ValueData) _then; + + /// Create a copy of ValueData /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? hopCount = null, - Object? stability = null, - Object? sequencing = null, - Object? preferredRoute = freezed, + Object? seq = null, + Object? data = null, + Object? writer = null, }) { - return _then(_$SafetySpecImpl( - hopCount: null == hopCount - ? _value.hopCount - : hopCount // ignore: cast_nullable_to_non_nullable + return _then(_self.copyWith( + seq: null == seq + ? _self.seq + : seq // ignore: cast_nullable_to_non_nullable as int, - stability: null == stability - ? _value.stability - : stability // ignore: cast_nullable_to_non_nullable - as Stability, - sequencing: null == sequencing - ? _value.sequencing - : sequencing // ignore: cast_nullable_to_non_nullable - as Sequencing, - preferredRoute: freezed == preferredRoute - ? _value.preferredRoute - : preferredRoute // ignore: cast_nullable_to_non_nullable - as String?, + data: null == data + ? _self.data + : data // ignore: cast_nullable_to_non_nullable + as Uint8List, + writer: null == writer + ? _self.writer! + : writer // ignore: cast_nullable_to_non_nullable + as FixedEncodedString43, )); } } /// @nodoc @JsonSerializable() -class _$SafetySpecImpl implements _SafetySpec { - const _$SafetySpecImpl( - {required this.hopCount, - required this.stability, - required this.sequencing, - this.preferredRoute}); - - factory _$SafetySpecImpl.fromJson(Map json) => - _$$SafetySpecImplFromJson(json); +class _ValueData implements ValueData { + const _ValueData( + {required this.seq, + @Uint8ListJsonConverter.jsIsArray() required this.data, + required this.writer}) + : assert(seq >= 0, 'seq out of range'); + factory _ValueData.fromJson(Map json) => + _$ValueDataFromJson(json); @override - final int hopCount; + final int seq; @override - final Stability stability; + @Uint8ListJsonConverter.jsIsArray() + final Uint8List data; @override - final Sequencing sequencing; + final FixedEncodedString43 writer; + + /// Create a copy of ValueData + /// with the given fields replaced by the non-null parameter values. @override - final String? preferredRoute; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$ValueDataCopyWith<_ValueData> get copyWith => + __$ValueDataCopyWithImpl<_ValueData>(this, _$identity); @override - String toString() { - return 'SafetySpec(hopCount: $hopCount, stability: $stability, sequencing: $sequencing, preferredRoute: $preferredRoute)'; + Map toJson() { + return _$ValueDataToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$SafetySpecImpl && + other is _ValueData && + (identical(other.seq, seq) || other.seq == seq) && + const DeepCollectionEquality().equals(other.data, data) && + (identical(other.writer, writer) || other.writer == writer)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, seq, const DeepCollectionEquality().hash(data), writer); + + @override + String toString() { + return 'ValueData(seq: $seq, data: $data, writer: $writer)'; + } +} + +/// @nodoc +abstract mixin class _$ValueDataCopyWith<$Res> + implements $ValueDataCopyWith<$Res> { + factory _$ValueDataCopyWith( + _ValueData value, $Res Function(_ValueData) _then) = + __$ValueDataCopyWithImpl; + @override + @useResult + $Res call( + {int seq, + @Uint8ListJsonConverter.jsIsArray() Uint8List data, + FixedEncodedString43 writer}); +} + +/// @nodoc +class __$ValueDataCopyWithImpl<$Res> implements _$ValueDataCopyWith<$Res> { + __$ValueDataCopyWithImpl(this._self, this._then); + + final _ValueData _self; + final $Res Function(_ValueData) _then; + + /// Create a copy of ValueData + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? seq = null, + Object? data = null, + Object? writer = null, + }) { + return _then(_ValueData( + seq: null == seq + ? _self.seq + : seq // ignore: cast_nullable_to_non_nullable + as int, + data: null == data + ? _self.data + : data // ignore: cast_nullable_to_non_nullable + as Uint8List, + writer: null == writer + ? _self.writer + : writer // ignore: cast_nullable_to_non_nullable + as FixedEncodedString43, + )); + } +} + +/// @nodoc +mixin _$SafetySpec { + int get hopCount; + Stability get stability; + Sequencing get sequencing; + String? get preferredRoute; + + /// Create a copy of SafetySpec + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $SafetySpecCopyWith get copyWith => + _$SafetySpecCopyWithImpl(this as SafetySpec, _$identity); + + /// Serializes this SafetySpec to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is SafetySpec && (identical(other.hopCount, hopCount) || other.hopCount == hopCount) && (identical(other.stability, stability) || @@ -1229,173 +879,198 @@ class _$SafetySpecImpl implements _SafetySpec { int get hashCode => Object.hash(runtimeType, hopCount, stability, sequencing, preferredRoute); - /// Create a copy of SafetySpec - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$SafetySpecImplCopyWith<_$SafetySpecImpl> get copyWith => - __$$SafetySpecImplCopyWithImpl<_$SafetySpecImpl>(this, _$identity); - - @override - Map toJson() { - return _$$SafetySpecImplToJson( - this, - ); - } -} - -abstract class _SafetySpec implements SafetySpec { - const factory _SafetySpec( - {required final int hopCount, - required final Stability stability, - required final Sequencing sequencing, - final String? preferredRoute}) = _$SafetySpecImpl; - - factory _SafetySpec.fromJson(Map json) = - _$SafetySpecImpl.fromJson; - - @override - int get hopCount; - @override - Stability get stability; - @override - Sequencing get sequencing; - @override - String? get preferredRoute; - - /// Create a copy of SafetySpec - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$SafetySpecImplCopyWith<_$SafetySpecImpl> get copyWith => - throw _privateConstructorUsedError; -} - -RouteBlob _$RouteBlobFromJson(Map json) { - return _RouteBlob.fromJson(json); -} - -/// @nodoc -mixin _$RouteBlob { - String get routeId => throw _privateConstructorUsedError; - @Uint8ListJsonConverter() - Uint8List get blob => throw _privateConstructorUsedError; - - /// Serializes this RouteBlob to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of RouteBlob - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $RouteBlobCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $RouteBlobCopyWith<$Res> { - factory $RouteBlobCopyWith(RouteBlob value, $Res Function(RouteBlob) then) = - _$RouteBlobCopyWithImpl<$Res, RouteBlob>; - @useResult - $Res call({String routeId, @Uint8ListJsonConverter() Uint8List blob}); -} - -/// @nodoc -class _$RouteBlobCopyWithImpl<$Res, $Val extends RouteBlob> - implements $RouteBlobCopyWith<$Res> { - _$RouteBlobCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of RouteBlob - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? routeId = null, - Object? blob = null, - }) { - return _then(_value.copyWith( - routeId: null == routeId - ? _value.routeId - : routeId // ignore: cast_nullable_to_non_nullable - as String, - blob: null == blob - ? _value.blob - : blob // ignore: cast_nullable_to_non_nullable - as Uint8List, - ) as $Val); + String toString() { + return 'SafetySpec(hopCount: $hopCount, stability: $stability, sequencing: $sequencing, preferredRoute: $preferredRoute)'; } } /// @nodoc -abstract class _$$RouteBlobImplCopyWith<$Res> - implements $RouteBlobCopyWith<$Res> { - factory _$$RouteBlobImplCopyWith( - _$RouteBlobImpl value, $Res Function(_$RouteBlobImpl) then) = - __$$RouteBlobImplCopyWithImpl<$Res>; - @override +abstract mixin class $SafetySpecCopyWith<$Res> { + factory $SafetySpecCopyWith( + SafetySpec value, $Res Function(SafetySpec) _then) = + _$SafetySpecCopyWithImpl; @useResult - $Res call({String routeId, @Uint8ListJsonConverter() Uint8List blob}); + $Res call( + {int hopCount, + Stability stability, + Sequencing sequencing, + String? preferredRoute}); } /// @nodoc -class __$$RouteBlobImplCopyWithImpl<$Res> - extends _$RouteBlobCopyWithImpl<$Res, _$RouteBlobImpl> - implements _$$RouteBlobImplCopyWith<$Res> { - __$$RouteBlobImplCopyWithImpl( - _$RouteBlobImpl _value, $Res Function(_$RouteBlobImpl) _then) - : super(_value, _then); +class _$SafetySpecCopyWithImpl<$Res> implements $SafetySpecCopyWith<$Res> { + _$SafetySpecCopyWithImpl(this._self, this._then); - /// Create a copy of RouteBlob + final SafetySpec _self; + final $Res Function(SafetySpec) _then; + + /// Create a copy of SafetySpec /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? routeId = null, - Object? blob = null, + Object? hopCount = null, + Object? stability = null, + Object? sequencing = null, + Object? preferredRoute = freezed, }) { - return _then(_$RouteBlobImpl( - routeId: null == routeId - ? _value.routeId - : routeId // ignore: cast_nullable_to_non_nullable - as String, - blob: null == blob - ? _value.blob - : blob // ignore: cast_nullable_to_non_nullable - as Uint8List, + return _then(_self.copyWith( + hopCount: null == hopCount + ? _self.hopCount + : hopCount // ignore: cast_nullable_to_non_nullable + as int, + stability: null == stability + ? _self.stability + : stability // ignore: cast_nullable_to_non_nullable + as Stability, + sequencing: null == sequencing + ? _self.sequencing + : sequencing // ignore: cast_nullable_to_non_nullable + as Sequencing, + preferredRoute: freezed == preferredRoute + ? _self.preferredRoute + : preferredRoute // ignore: cast_nullable_to_non_nullable + as String?, )); } } /// @nodoc @JsonSerializable() -class _$RouteBlobImpl implements _RouteBlob { - const _$RouteBlobImpl( - {required this.routeId, @Uint8ListJsonConverter() required this.blob}); - - factory _$RouteBlobImpl.fromJson(Map json) => - _$$RouteBlobImplFromJson(json); +class _SafetySpec implements SafetySpec { + const _SafetySpec( + {required this.hopCount, + required this.stability, + required this.sequencing, + this.preferredRoute}); + factory _SafetySpec.fromJson(Map json) => + _$SafetySpecFromJson(json); @override - final String routeId; + final int hopCount; @override - @Uint8ListJsonConverter() - final Uint8List blob; + final Stability stability; + @override + final Sequencing sequencing; + @override + final String? preferredRoute; + + /// Create a copy of SafetySpec + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$SafetySpecCopyWith<_SafetySpec> get copyWith => + __$SafetySpecCopyWithImpl<_SafetySpec>(this, _$identity); @override - String toString() { - return 'RouteBlob(routeId: $routeId, blob: $blob)'; + Map toJson() { + return _$SafetySpecToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RouteBlobImpl && + other is _SafetySpec && + (identical(other.hopCount, hopCount) || + other.hopCount == hopCount) && + (identical(other.stability, stability) || + other.stability == stability) && + (identical(other.sequencing, sequencing) || + other.sequencing == sequencing) && + (identical(other.preferredRoute, preferredRoute) || + other.preferredRoute == preferredRoute)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, hopCount, stability, sequencing, preferredRoute); + + @override + String toString() { + return 'SafetySpec(hopCount: $hopCount, stability: $stability, sequencing: $sequencing, preferredRoute: $preferredRoute)'; + } +} + +/// @nodoc +abstract mixin class _$SafetySpecCopyWith<$Res> + implements $SafetySpecCopyWith<$Res> { + factory _$SafetySpecCopyWith( + _SafetySpec value, $Res Function(_SafetySpec) _then) = + __$SafetySpecCopyWithImpl; + @override + @useResult + $Res call( + {int hopCount, + Stability stability, + Sequencing sequencing, + String? preferredRoute}); +} + +/// @nodoc +class __$SafetySpecCopyWithImpl<$Res> implements _$SafetySpecCopyWith<$Res> { + __$SafetySpecCopyWithImpl(this._self, this._then); + + final _SafetySpec _self; + final $Res Function(_SafetySpec) _then; + + /// Create a copy of SafetySpec + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? hopCount = null, + Object? stability = null, + Object? sequencing = null, + Object? preferredRoute = freezed, + }) { + return _then(_SafetySpec( + hopCount: null == hopCount + ? _self.hopCount + : hopCount // ignore: cast_nullable_to_non_nullable + as int, + stability: null == stability + ? _self.stability + : stability // ignore: cast_nullable_to_non_nullable + as Stability, + sequencing: null == sequencing + ? _self.sequencing + : sequencing // ignore: cast_nullable_to_non_nullable + as Sequencing, + preferredRoute: freezed == preferredRoute + ? _self.preferredRoute + : preferredRoute // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +mixin _$RouteBlob { + String get routeId; + @Uint8ListJsonConverter() + Uint8List get blob; + + /// Create a copy of RouteBlob + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $RouteBlobCopyWith get copyWith => + _$RouteBlobCopyWithImpl(this as RouteBlob, _$identity); + + /// Serializes this RouteBlob to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is RouteBlob && (identical(other.routeId, routeId) || other.routeId == routeId) && const DeepCollectionEquality().equals(other.blob, blob)); } @@ -1405,190 +1080,248 @@ class _$RouteBlobImpl implements _RouteBlob { int get hashCode => Object.hash( runtimeType, routeId, const DeepCollectionEquality().hash(blob)); - /// Create a copy of RouteBlob - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$RouteBlobImplCopyWith<_$RouteBlobImpl> get copyWith => - __$$RouteBlobImplCopyWithImpl<_$RouteBlobImpl>(this, _$identity); - - @override - Map toJson() { - return _$$RouteBlobImplToJson( - this, - ); - } -} - -abstract class _RouteBlob implements RouteBlob { - const factory _RouteBlob( - {required final String routeId, - @Uint8ListJsonConverter() required final Uint8List blob}) = - _$RouteBlobImpl; - - factory _RouteBlob.fromJson(Map json) = - _$RouteBlobImpl.fromJson; - - @override - String get routeId; - @override - @Uint8ListJsonConverter() - Uint8List get blob; - - /// Create a copy of RouteBlob - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$RouteBlobImplCopyWith<_$RouteBlobImpl> get copyWith => - throw _privateConstructorUsedError; -} - -DHTRecordReport _$DHTRecordReportFromJson(Map json) { - return _DHTRecordReport.fromJson(json); -} - -/// @nodoc -mixin _$DHTRecordReport { - List get subkeys => throw _privateConstructorUsedError; - List get offlineSubkeys => - throw _privateConstructorUsedError; - List get localSeqs => throw _privateConstructorUsedError; - List get networkSeqs => throw _privateConstructorUsedError; - - /// Serializes this DHTRecordReport to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of DHTRecordReport - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $DHTRecordReportCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $DHTRecordReportCopyWith<$Res> { - factory $DHTRecordReportCopyWith( - DHTRecordReport value, $Res Function(DHTRecordReport) then) = - _$DHTRecordReportCopyWithImpl<$Res, DHTRecordReport>; - @useResult - $Res call( - {List subkeys, - List offlineSubkeys, - List localSeqs, - List networkSeqs}); -} - -/// @nodoc -class _$DHTRecordReportCopyWithImpl<$Res, $Val extends DHTRecordReport> - implements $DHTRecordReportCopyWith<$Res> { - _$DHTRecordReportCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of DHTRecordReport - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? subkeys = null, - Object? offlineSubkeys = null, - Object? localSeqs = null, - Object? networkSeqs = null, - }) { - return _then(_value.copyWith( - subkeys: null == subkeys - ? _value.subkeys - : subkeys // ignore: cast_nullable_to_non_nullable - as List, - offlineSubkeys: null == offlineSubkeys - ? _value.offlineSubkeys - : offlineSubkeys // ignore: cast_nullable_to_non_nullable - as List, - localSeqs: null == localSeqs - ? _value.localSeqs - : localSeqs // ignore: cast_nullable_to_non_nullable - as List, - networkSeqs: null == networkSeqs - ? _value.networkSeqs - : networkSeqs // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + String toString() { + return 'RouteBlob(routeId: $routeId, blob: $blob)'; } } /// @nodoc -abstract class _$$DHTRecordReportImplCopyWith<$Res> - implements $DHTRecordReportCopyWith<$Res> { - factory _$$DHTRecordReportImplCopyWith(_$DHTRecordReportImpl value, - $Res Function(_$DHTRecordReportImpl) then) = - __$$DHTRecordReportImplCopyWithImpl<$Res>; - @override +abstract mixin class $RouteBlobCopyWith<$Res> { + factory $RouteBlobCopyWith(RouteBlob value, $Res Function(RouteBlob) _then) = + _$RouteBlobCopyWithImpl; @useResult - $Res call( - {List subkeys, - List offlineSubkeys, - List localSeqs, - List networkSeqs}); + $Res call({String routeId, @Uint8ListJsonConverter() Uint8List blob}); } /// @nodoc -class __$$DHTRecordReportImplCopyWithImpl<$Res> - extends _$DHTRecordReportCopyWithImpl<$Res, _$DHTRecordReportImpl> - implements _$$DHTRecordReportImplCopyWith<$Res> { - __$$DHTRecordReportImplCopyWithImpl( - _$DHTRecordReportImpl _value, $Res Function(_$DHTRecordReportImpl) _then) - : super(_value, _then); +class _$RouteBlobCopyWithImpl<$Res> implements $RouteBlobCopyWith<$Res> { + _$RouteBlobCopyWithImpl(this._self, this._then); - /// Create a copy of DHTRecordReport + final RouteBlob _self; + final $Res Function(RouteBlob) _then; + + /// Create a copy of RouteBlob /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? subkeys = null, - Object? offlineSubkeys = null, - Object? localSeqs = null, - Object? networkSeqs = null, + Object? routeId = null, + Object? blob = null, }) { - return _then(_$DHTRecordReportImpl( - subkeys: null == subkeys - ? _value._subkeys - : subkeys // ignore: cast_nullable_to_non_nullable - as List, - offlineSubkeys: null == offlineSubkeys - ? _value._offlineSubkeys - : offlineSubkeys // ignore: cast_nullable_to_non_nullable - as List, - localSeqs: null == localSeqs - ? _value._localSeqs - : localSeqs // ignore: cast_nullable_to_non_nullable - as List, - networkSeqs: null == networkSeqs - ? _value._networkSeqs - : networkSeqs // ignore: cast_nullable_to_non_nullable - as List, + return _then(_self.copyWith( + routeId: null == routeId + ? _self.routeId + : routeId // ignore: cast_nullable_to_non_nullable + as String, + blob: null == blob + ? _self.blob + : blob // ignore: cast_nullable_to_non_nullable + as Uint8List, )); } } /// @nodoc @JsonSerializable() -class _$DHTRecordReportImpl implements _DHTRecordReport { - const _$DHTRecordReportImpl( +class _RouteBlob implements RouteBlob { + const _RouteBlob( + {required this.routeId, @Uint8ListJsonConverter() required this.blob}); + factory _RouteBlob.fromJson(Map json) => + _$RouteBlobFromJson(json); + + @override + final String routeId; + @override + @Uint8ListJsonConverter() + final Uint8List blob; + + /// Create a copy of RouteBlob + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$RouteBlobCopyWith<_RouteBlob> get copyWith => + __$RouteBlobCopyWithImpl<_RouteBlob>(this, _$identity); + + @override + Map toJson() { + return _$RouteBlobToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _RouteBlob && + (identical(other.routeId, routeId) || other.routeId == routeId) && + const DeepCollectionEquality().equals(other.blob, blob)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, routeId, const DeepCollectionEquality().hash(blob)); + + @override + String toString() { + return 'RouteBlob(routeId: $routeId, blob: $blob)'; + } +} + +/// @nodoc +abstract mixin class _$RouteBlobCopyWith<$Res> + implements $RouteBlobCopyWith<$Res> { + factory _$RouteBlobCopyWith( + _RouteBlob value, $Res Function(_RouteBlob) _then) = + __$RouteBlobCopyWithImpl; + @override + @useResult + $Res call({String routeId, @Uint8ListJsonConverter() Uint8List blob}); +} + +/// @nodoc +class __$RouteBlobCopyWithImpl<$Res> implements _$RouteBlobCopyWith<$Res> { + __$RouteBlobCopyWithImpl(this._self, this._then); + + final _RouteBlob _self; + final $Res Function(_RouteBlob) _then; + + /// Create a copy of RouteBlob + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? routeId = null, + Object? blob = null, + }) { + return _then(_RouteBlob( + routeId: null == routeId + ? _self.routeId + : routeId // ignore: cast_nullable_to_non_nullable + as String, + blob: null == blob + ? _self.blob + : blob // ignore: cast_nullable_to_non_nullable + as Uint8List, + )); + } +} + +/// @nodoc +mixin _$DHTRecordReport { + List get subkeys; + List get offlineSubkeys; + List get localSeqs; + List get networkSeqs; + + /// Create a copy of DHTRecordReport + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $DHTRecordReportCopyWith get copyWith => + _$DHTRecordReportCopyWithImpl( + this as DHTRecordReport, _$identity); + + /// Serializes this DHTRecordReport to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is DHTRecordReport && + const DeepCollectionEquality().equals(other.subkeys, subkeys) && + const DeepCollectionEquality() + .equals(other.offlineSubkeys, offlineSubkeys) && + const DeepCollectionEquality().equals(other.localSeqs, localSeqs) && + const DeepCollectionEquality() + .equals(other.networkSeqs, networkSeqs)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(subkeys), + const DeepCollectionEquality().hash(offlineSubkeys), + const DeepCollectionEquality().hash(localSeqs), + const DeepCollectionEquality().hash(networkSeqs)); + + @override + String toString() { + return 'DHTRecordReport(subkeys: $subkeys, offlineSubkeys: $offlineSubkeys, localSeqs: $localSeqs, networkSeqs: $networkSeqs)'; + } +} + +/// @nodoc +abstract mixin class $DHTRecordReportCopyWith<$Res> { + factory $DHTRecordReportCopyWith( + DHTRecordReport value, $Res Function(DHTRecordReport) _then) = + _$DHTRecordReportCopyWithImpl; + @useResult + $Res call( + {List subkeys, + List offlineSubkeys, + List localSeqs, + List networkSeqs}); +} + +/// @nodoc +class _$DHTRecordReportCopyWithImpl<$Res> + implements $DHTRecordReportCopyWith<$Res> { + _$DHTRecordReportCopyWithImpl(this._self, this._then); + + final DHTRecordReport _self; + final $Res Function(DHTRecordReport) _then; + + /// Create a copy of DHTRecordReport + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? subkeys = null, + Object? offlineSubkeys = null, + Object? localSeqs = null, + Object? networkSeqs = null, + }) { + return _then(_self.copyWith( + subkeys: null == subkeys + ? _self.subkeys + : subkeys // ignore: cast_nullable_to_non_nullable + as List, + offlineSubkeys: null == offlineSubkeys + ? _self.offlineSubkeys + : offlineSubkeys // ignore: cast_nullable_to_non_nullable + as List, + localSeqs: null == localSeqs + ? _self.localSeqs + : localSeqs // ignore: cast_nullable_to_non_nullable + as List, + networkSeqs: null == networkSeqs + ? _self.networkSeqs + : networkSeqs // ignore: cast_nullable_to_non_nullable + as List, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _DHTRecordReport implements DHTRecordReport { + const _DHTRecordReport( {required final List subkeys, required final List offlineSubkeys, - required final List localSeqs, - required final List networkSeqs}) + required final List localSeqs, + required final List networkSeqs}) : _subkeys = subkeys, _offlineSubkeys = offlineSubkeys, _localSeqs = localSeqs, _networkSeqs = networkSeqs; - - factory _$DHTRecordReportImpl.fromJson(Map json) => - _$$DHTRecordReportImplFromJson(json); + factory _DHTRecordReport.fromJson(Map json) => + _$DHTRecordReportFromJson(json); final List _subkeys; @override @@ -1606,32 +1339,42 @@ class _$DHTRecordReportImpl implements _DHTRecordReport { return EqualUnmodifiableListView(_offlineSubkeys); } - final List _localSeqs; + final List _localSeqs; @override - List get localSeqs { + List get localSeqs { if (_localSeqs is EqualUnmodifiableListView) return _localSeqs; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_localSeqs); } - final List _networkSeqs; + final List _networkSeqs; @override - List get networkSeqs { + List get networkSeqs { if (_networkSeqs is EqualUnmodifiableListView) return _networkSeqs; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_networkSeqs); } + /// Create a copy of DHTRecordReport + /// with the given fields replaced by the non-null parameter values. @override - String toString() { - return 'DHTRecordReport(subkeys: $subkeys, offlineSubkeys: $offlineSubkeys, localSeqs: $localSeqs, networkSeqs: $networkSeqs)'; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$DHTRecordReportCopyWith<_DHTRecordReport> get copyWith => + __$DHTRecordReportCopyWithImpl<_DHTRecordReport>(this, _$identity); + + @override + Map toJson() { + return _$DHTRecordReportToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$DHTRecordReportImpl && + other is _DHTRecordReport && const DeepCollectionEquality().equals(other._subkeys, _subkeys) && const DeepCollectionEquality() .equals(other._offlineSubkeys, _offlineSubkeys) && @@ -1650,46 +1393,64 @@ class _$DHTRecordReportImpl implements _DHTRecordReport { const DeepCollectionEquality().hash(_localSeqs), const DeepCollectionEquality().hash(_networkSeqs)); - /// Create a copy of DHTRecordReport - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$DHTRecordReportImplCopyWith<_$DHTRecordReportImpl> get copyWith => - __$$DHTRecordReportImplCopyWithImpl<_$DHTRecordReportImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$DHTRecordReportImplToJson( - this, - ); + String toString() { + return 'DHTRecordReport(subkeys: $subkeys, offlineSubkeys: $offlineSubkeys, localSeqs: $localSeqs, networkSeqs: $networkSeqs)'; } } -abstract class _DHTRecordReport implements DHTRecordReport { - const factory _DHTRecordReport( - {required final List subkeys, - required final List offlineSubkeys, - required final List localSeqs, - required final List networkSeqs}) = _$DHTRecordReportImpl; +/// @nodoc +abstract mixin class _$DHTRecordReportCopyWith<$Res> + implements $DHTRecordReportCopyWith<$Res> { + factory _$DHTRecordReportCopyWith( + _DHTRecordReport value, $Res Function(_DHTRecordReport) _then) = + __$DHTRecordReportCopyWithImpl; + @override + @useResult + $Res call( + {List subkeys, + List offlineSubkeys, + List localSeqs, + List networkSeqs}); +} - factory _DHTRecordReport.fromJson(Map json) = - _$DHTRecordReportImpl.fromJson; +/// @nodoc +class __$DHTRecordReportCopyWithImpl<$Res> + implements _$DHTRecordReportCopyWith<$Res> { + __$DHTRecordReportCopyWithImpl(this._self, this._then); - @override - List get subkeys; - @override - List get offlineSubkeys; - @override - List get localSeqs; - @override - List get networkSeqs; + final _DHTRecordReport _self; + final $Res Function(_DHTRecordReport) _then; /// Create a copy of DHTRecordReport /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$DHTRecordReportImplCopyWith<_$DHTRecordReportImpl> get copyWith => - throw _privateConstructorUsedError; + @pragma('vm:prefer-inline') + $Res call({ + Object? subkeys = null, + Object? offlineSubkeys = null, + Object? localSeqs = null, + Object? networkSeqs = null, + }) { + return _then(_DHTRecordReport( + subkeys: null == subkeys + ? _self._subkeys + : subkeys // ignore: cast_nullable_to_non_nullable + as List, + offlineSubkeys: null == offlineSubkeys + ? _self._offlineSubkeys + : offlineSubkeys // ignore: cast_nullable_to_non_nullable + as List, + localSeqs: null == localSeqs + ? _self._localSeqs + : localSeqs // ignore: cast_nullable_to_non_nullable + as List, + networkSeqs: null == networkSeqs + ? _self._networkSeqs + : networkSeqs // ignore: cast_nullable_to_non_nullable + as List, + )); + } } + +// dart format on diff --git a/veilid-flutter/lib/routing_context.g.dart b/veilid-flutter/lib/routing_context.g.dart index 1749f260..e9d081e8 100644 --- a/veilid-flutter/lib/routing_context.g.dart +++ b/veilid-flutter/lib/routing_context.g.dart @@ -6,20 +6,20 @@ part of 'routing_context.dart'; // JsonSerializableGenerator // ************************************************************************** -_$DHTSchemaDFLTImpl _$$DHTSchemaDFLTImplFromJson(Map json) => - _$DHTSchemaDFLTImpl( +DHTSchemaDFLT _$DHTSchemaDFLTFromJson(Map json) => + DHTSchemaDFLT( oCnt: (json['o_cnt'] as num).toInt(), $type: json['kind'] as String?, ); -Map _$$DHTSchemaDFLTImplToJson(_$DHTSchemaDFLTImpl instance) => +Map _$DHTSchemaDFLTToJson(DHTSchemaDFLT instance) => { 'o_cnt': instance.oCnt, 'kind': instance.$type, }; -_$DHTSchemaSMPLImpl _$$DHTSchemaSMPLImplFromJson(Map json) => - _$DHTSchemaSMPLImpl( +DHTSchemaSMPL _$DHTSchemaSMPLFromJson(Map json) => + DHTSchemaSMPL( oCnt: (json['o_cnt'] as num).toInt(), members: (json['members'] as List) .map(DHTSchemaMember.fromJson) @@ -27,30 +27,27 @@ _$DHTSchemaSMPLImpl _$$DHTSchemaSMPLImplFromJson(Map json) => $type: json['kind'] as String?, ); -Map _$$DHTSchemaSMPLImplToJson(_$DHTSchemaSMPLImpl instance) => +Map _$DHTSchemaSMPLToJson(DHTSchemaSMPL instance) => { 'o_cnt': instance.oCnt, 'members': instance.members.map((e) => e.toJson()).toList(), 'kind': instance.$type, }; -_$DHTSchemaMemberImpl _$$DHTSchemaMemberImplFromJson( - Map json) => - _$DHTSchemaMemberImpl( +_DHTSchemaMember _$DHTSchemaMemberFromJson(Map json) => + _DHTSchemaMember( mKey: FixedEncodedString43.fromJson(json['m_key']), mCnt: (json['m_cnt'] as num).toInt(), ); -Map _$$DHTSchemaMemberImplToJson( - _$DHTSchemaMemberImpl instance) => +Map _$DHTSchemaMemberToJson(_DHTSchemaMember instance) => { 'm_key': instance.mKey.toJson(), 'm_cnt': instance.mCnt, }; -_$DHTRecordDescriptorImpl _$$DHTRecordDescriptorImplFromJson( - Map json) => - _$DHTRecordDescriptorImpl( +_DHTRecordDescriptor _$DHTRecordDescriptorFromJson(Map json) => + _DHTRecordDescriptor( key: Typed.fromJson(json['key']), owner: FixedEncodedString43.fromJson(json['owner']), schema: DHTSchema.fromJson(json['schema']), @@ -59,8 +56,8 @@ _$DHTRecordDescriptorImpl _$$DHTRecordDescriptorImplFromJson( : FixedEncodedString43.fromJson(json['owner_secret']), ); -Map _$$DHTRecordDescriptorImplToJson( - _$DHTRecordDescriptorImpl instance) => +Map _$DHTRecordDescriptorToJson( + _DHTRecordDescriptor instance) => { 'key': instance.key.toJson(), 'owner': instance.owner.toJson(), @@ -68,29 +65,27 @@ Map _$$DHTRecordDescriptorImplToJson( 'owner_secret': instance.ownerSecret?.toJson(), }; -_$ValueDataImpl _$$ValueDataImplFromJson(Map json) => - _$ValueDataImpl( +_ValueData _$ValueDataFromJson(Map json) => _ValueData( seq: (json['seq'] as num).toInt(), data: const Uint8ListJsonConverter.jsIsArray().fromJson(json['data']), writer: FixedEncodedString43.fromJson(json['writer']), ); -Map _$$ValueDataImplToJson(_$ValueDataImpl instance) => +Map _$ValueDataToJson(_ValueData instance) => { 'seq': instance.seq, 'data': const Uint8ListJsonConverter.jsIsArray().toJson(instance.data), 'writer': instance.writer.toJson(), }; -_$SafetySpecImpl _$$SafetySpecImplFromJson(Map json) => - _$SafetySpecImpl( +_SafetySpec _$SafetySpecFromJson(Map json) => _SafetySpec( hopCount: (json['hop_count'] as num).toInt(), stability: Stability.fromJson(json['stability']), sequencing: Sequencing.fromJson(json['sequencing']), preferredRoute: json['preferred_route'] as String?, ); -Map _$$SafetySpecImplToJson(_$SafetySpecImpl instance) => +Map _$SafetySpecToJson(_SafetySpec instance) => { 'hop_count': instance.hopCount, 'stability': instance.stability.toJson(), @@ -98,21 +93,19 @@ Map _$$SafetySpecImplToJson(_$SafetySpecImpl instance) => 'preferred_route': instance.preferredRoute, }; -_$RouteBlobImpl _$$RouteBlobImplFromJson(Map json) => - _$RouteBlobImpl( +_RouteBlob _$RouteBlobFromJson(Map json) => _RouteBlob( routeId: json['route_id'] as String, blob: const Uint8ListJsonConverter().fromJson(json['blob']), ); -Map _$$RouteBlobImplToJson(_$RouteBlobImpl instance) => +Map _$RouteBlobToJson(_RouteBlob instance) => { 'route_id': instance.routeId, 'blob': const Uint8ListJsonConverter().toJson(instance.blob), }; -_$DHTRecordReportImpl _$$DHTRecordReportImplFromJson( - Map json) => - _$DHTRecordReportImpl( +_DHTRecordReport _$DHTRecordReportFromJson(Map json) => + _DHTRecordReport( subkeys: (json['subkeys'] as List) .map(ValueSubkeyRange.fromJson) .toList(), @@ -120,15 +113,14 @@ _$DHTRecordReportImpl _$$DHTRecordReportImplFromJson( .map(ValueSubkeyRange.fromJson) .toList(), localSeqs: (json['local_seqs'] as List) - .map((e) => (e as num).toInt()) + .map((e) => (e as num?)?.toInt()) .toList(), networkSeqs: (json['network_seqs'] as List) - .map((e) => (e as num).toInt()) + .map((e) => (e as num?)?.toInt()) .toList(), ); -Map _$$DHTRecordReportImplToJson( - _$DHTRecordReportImpl instance) => +Map _$DHTRecordReportToJson(_DHTRecordReport instance) => { 'subkeys': instance.subkeys.map((e) => e.toJson()).toList(), 'offline_subkeys': diff --git a/veilid-flutter/lib/veilid_config.dart b/veilid-flutter/lib/veilid_config.dart index addde72c..5c77824d 100644 --- a/veilid-flutter/lib/veilid_config.dart +++ b/veilid-flutter/lib/veilid_config.dart @@ -10,7 +10,8 @@ part 'veilid_config.g.dart'; ////////////////////////////////////////////////////////// // FFI Platform-specific config @freezed -class VeilidFFIConfigLoggingTerminal with _$VeilidFFIConfigLoggingTerminal { +sealed class VeilidFFIConfigLoggingTerminal + with _$VeilidFFIConfigLoggingTerminal { const factory VeilidFFIConfigLoggingTerminal({ required bool enabled, required VeilidConfigLogLevel level, @@ -22,7 +23,7 @@ class VeilidFFIConfigLoggingTerminal with _$VeilidFFIConfigLoggingTerminal { } @freezed -class VeilidFFIConfigLoggingOtlp with _$VeilidFFIConfigLoggingOtlp { +sealed class VeilidFFIConfigLoggingOtlp with _$VeilidFFIConfigLoggingOtlp { const factory VeilidFFIConfigLoggingOtlp({ required bool enabled, required VeilidConfigLogLevel level, @@ -36,7 +37,7 @@ class VeilidFFIConfigLoggingOtlp with _$VeilidFFIConfigLoggingOtlp { } @freezed -class VeilidFFIConfigLoggingApi with _$VeilidFFIConfigLoggingApi { +sealed class VeilidFFIConfigLoggingApi with _$VeilidFFIConfigLoggingApi { const factory VeilidFFIConfigLoggingApi({ required bool enabled, required VeilidConfigLogLevel level, @@ -48,7 +49,7 @@ class VeilidFFIConfigLoggingApi with _$VeilidFFIConfigLoggingApi { } @freezed -class VeilidFFIConfigLoggingFlame with _$VeilidFFIConfigLoggingFlame { +sealed class VeilidFFIConfigLoggingFlame with _$VeilidFFIConfigLoggingFlame { const factory VeilidFFIConfigLoggingFlame({ required bool enabled, required String path, @@ -59,7 +60,7 @@ class VeilidFFIConfigLoggingFlame with _$VeilidFFIConfigLoggingFlame { } @freezed -class VeilidFFIConfigLogging with _$VeilidFFIConfigLogging { +sealed class VeilidFFIConfigLogging with _$VeilidFFIConfigLogging { const factory VeilidFFIConfigLogging( {required VeilidFFIConfigLoggingTerminal terminal, required VeilidFFIConfigLoggingOtlp otlp, @@ -71,7 +72,7 @@ class VeilidFFIConfigLogging with _$VeilidFFIConfigLogging { } @freezed -class VeilidFFIConfig with _$VeilidFFIConfig { +sealed class VeilidFFIConfig with _$VeilidFFIConfig { const factory VeilidFFIConfig({ required VeilidFFIConfigLogging logging, }) = _VeilidFFIConfig; @@ -84,7 +85,7 @@ class VeilidFFIConfig with _$VeilidFFIConfig { // WASM Platform-specific config @freezed -class VeilidWASMConfigLoggingPerformance +sealed class VeilidWASMConfigLoggingPerformance with _$VeilidWASMConfigLoggingPerformance { const factory VeilidWASMConfigLoggingPerformance({ required bool enabled, @@ -100,7 +101,7 @@ class VeilidWASMConfigLoggingPerformance } @freezed -class VeilidWASMConfigLoggingApi with _$VeilidWASMConfigLoggingApi { +sealed class VeilidWASMConfigLoggingApi with _$VeilidWASMConfigLoggingApi { const factory VeilidWASMConfigLoggingApi({ required bool enabled, required VeilidConfigLogLevel level, @@ -112,7 +113,7 @@ class VeilidWASMConfigLoggingApi with _$VeilidWASMConfigLoggingApi { } @freezed -class VeilidWASMConfigLogging with _$VeilidWASMConfigLogging { +sealed class VeilidWASMConfigLogging with _$VeilidWASMConfigLogging { const factory VeilidWASMConfigLogging( {required VeilidWASMConfigLoggingPerformance performance, required VeilidWASMConfigLoggingApi api}) = _VeilidWASMConfigLogging; @@ -122,7 +123,7 @@ class VeilidWASMConfigLogging with _$VeilidWASMConfigLogging { } @freezed -class VeilidWASMConfig with _$VeilidWASMConfig { +sealed class VeilidWASMConfig with _$VeilidWASMConfig { const factory VeilidWASMConfig({ required VeilidWASMConfigLogging logging, }) = _VeilidWASMConfig; @@ -151,7 +152,7 @@ enum VeilidConfigLogLevel { /// VeilidConfig @freezed -class VeilidConfigHTTPS with _$VeilidConfigHTTPS { +sealed class VeilidConfigHTTPS with _$VeilidConfigHTTPS { const factory VeilidConfigHTTPS({ required bool enabled, required String listenAddress, @@ -166,7 +167,7 @@ class VeilidConfigHTTPS with _$VeilidConfigHTTPS { //////////// @freezed -class VeilidConfigHTTP with _$VeilidConfigHTTP { +sealed class VeilidConfigHTTP with _$VeilidConfigHTTP { const factory VeilidConfigHTTP({ required bool enabled, required String listenAddress, @@ -181,7 +182,7 @@ class VeilidConfigHTTP with _$VeilidConfigHTTP { //////////// @freezed -class VeilidConfigApplication with _$VeilidConfigApplication { +sealed class VeilidConfigApplication with _$VeilidConfigApplication { const factory VeilidConfigApplication({ required VeilidConfigHTTPS https, required VeilidConfigHTTP http, @@ -193,7 +194,7 @@ class VeilidConfigApplication with _$VeilidConfigApplication { //////////// @freezed -class VeilidConfigUDP with _$VeilidConfigUDP { +sealed class VeilidConfigUDP with _$VeilidConfigUDP { const factory VeilidConfigUDP( {required bool enabled, required int socketPoolSize, @@ -206,7 +207,7 @@ class VeilidConfigUDP with _$VeilidConfigUDP { //////////// @freezed -class VeilidConfigTCP with _$VeilidConfigTCP { +sealed class VeilidConfigTCP with _$VeilidConfigTCP { const factory VeilidConfigTCP( {required bool connect, required bool listen, @@ -220,7 +221,7 @@ class VeilidConfigTCP with _$VeilidConfigTCP { //////////// @freezed -class VeilidConfigWS with _$VeilidConfigWS { +sealed class VeilidConfigWS with _$VeilidConfigWS { const factory VeilidConfigWS( {required bool connect, required bool listen, @@ -235,7 +236,7 @@ class VeilidConfigWS with _$VeilidConfigWS { //////////// @freezed -class VeilidConfigWSS with _$VeilidConfigWSS { +sealed class VeilidConfigWSS with _$VeilidConfigWSS { const factory VeilidConfigWSS( {required bool connect, required bool listen, @@ -251,7 +252,7 @@ class VeilidConfigWSS with _$VeilidConfigWSS { //////////// @freezed -class VeilidConfigProtocol with _$VeilidConfigProtocol { +sealed class VeilidConfigProtocol with _$VeilidConfigProtocol { const factory VeilidConfigProtocol({ required VeilidConfigUDP udp, required VeilidConfigTCP tcp, @@ -266,7 +267,7 @@ class VeilidConfigProtocol with _$VeilidConfigProtocol { //////////// @freezed -class VeilidConfigTLS with _$VeilidConfigTLS { +sealed class VeilidConfigTLS with _$VeilidConfigTLS { const factory VeilidConfigTLS({ required String certificatePath, required String privateKeyPath, @@ -279,7 +280,7 @@ class VeilidConfigTLS with _$VeilidConfigTLS { //////////// @freezed -class VeilidConfigDHT with _$VeilidConfigDHT { +sealed class VeilidConfigDHT with _$VeilidConfigDHT { const factory VeilidConfigDHT({ required int resolveNodeTimeoutMs, required int resolveNodeCount, @@ -312,7 +313,7 @@ class VeilidConfigDHT with _$VeilidConfigDHT { //////////// @freezed -class VeilidConfigRPC with _$VeilidConfigRPC { +sealed class VeilidConfigRPC with _$VeilidConfigRPC { const factory VeilidConfigRPC( {required int concurrency, required int queueSize, @@ -329,7 +330,7 @@ class VeilidConfigRPC with _$VeilidConfigRPC { //////////// @freezed -class VeilidConfigRoutingTable with _$VeilidConfigRoutingTable { +sealed class VeilidConfigRoutingTable with _$VeilidConfigRoutingTable { const factory VeilidConfigRoutingTable({ required List nodeId, required List nodeIdSecret, @@ -348,7 +349,7 @@ class VeilidConfigRoutingTable with _$VeilidConfigRoutingTable { //////////// @freezed -class VeilidConfigNetwork with _$VeilidConfigNetwork { +sealed class VeilidConfigNetwork with _$VeilidConfigNetwork { const factory VeilidConfigNetwork({ required int connectionInitialTimeoutMs, required int connectionInactivityTimeoutMs, @@ -378,7 +379,7 @@ class VeilidConfigNetwork with _$VeilidConfigNetwork { //////////// @freezed -class VeilidConfigTableStore with _$VeilidConfigTableStore { +sealed class VeilidConfigTableStore with _$VeilidConfigTableStore { const factory VeilidConfigTableStore({ required String directory, required bool delete, @@ -391,7 +392,7 @@ class VeilidConfigTableStore with _$VeilidConfigTableStore { //////////// @freezed -class VeilidConfigBlockStore with _$VeilidConfigBlockStore { +sealed class VeilidConfigBlockStore with _$VeilidConfigBlockStore { const factory VeilidConfigBlockStore({ required String directory, required bool delete, @@ -404,7 +405,7 @@ class VeilidConfigBlockStore with _$VeilidConfigBlockStore { //////////// @freezed -class VeilidConfigProtectedStore with _$VeilidConfigProtectedStore { +sealed class VeilidConfigProtectedStore with _$VeilidConfigProtectedStore { const factory VeilidConfigProtectedStore( {required bool allowInsecureFallback, required bool alwaysUseInsecureStorage, @@ -420,7 +421,7 @@ class VeilidConfigProtectedStore with _$VeilidConfigProtectedStore { //////////// @freezed -class VeilidConfigCapabilities with _$VeilidConfigCapabilities { +sealed class VeilidConfigCapabilities with _$VeilidConfigCapabilities { const factory VeilidConfigCapabilities({ required List disable, }) = _VeilidConfigCapabilities; @@ -432,7 +433,7 @@ class VeilidConfigCapabilities with _$VeilidConfigCapabilities { //////////// @freezed -class VeilidConfig with _$VeilidConfig { +sealed class VeilidConfig with _$VeilidConfig { const factory VeilidConfig({ required String programName, required String namespace, diff --git a/veilid-flutter/lib/veilid_config.freezed.dart b/veilid-flutter/lib/veilid_config.freezed.dart index efab2499..5749eebf 100644 --- a/veilid-flutter/lib/veilid_config.freezed.dart +++ b/veilid-flutter/lib/veilid_config.freezed.dart @@ -1,3 +1,4 @@ +// dart format width=80 // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint @@ -9,91 +10,64 @@ part of 'veilid_config.dart'; // FreezedGenerator // ************************************************************************** +// dart format off 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#adding-getters-and-methods-to-our-models'); - -VeilidFFIConfigLoggingTerminal _$VeilidFFIConfigLoggingTerminalFromJson( - Map json) { - return _VeilidFFIConfigLoggingTerminal.fromJson(json); -} - /// @nodoc -mixin _$VeilidFFIConfigLoggingTerminal { - bool get enabled => throw _privateConstructorUsedError; - VeilidConfigLogLevel get level => throw _privateConstructorUsedError; - List get ignoreLogTargets => throw _privateConstructorUsedError; - - /// Serializes this VeilidFFIConfigLoggingTerminal to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +mixin _$VeilidFFIConfigLoggingTerminal implements DiagnosticableTreeMixin { + bool get enabled; + VeilidConfigLogLevel get level; + List get ignoreLogTargets; /// Create a copy of VeilidFFIConfigLoggingTerminal /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $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, - List ignoreLogTargets}); -} - -/// @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; - - /// Create a copy of VeilidFFIConfigLoggingTerminal - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingTerminalCopyWith + get copyWith => _$VeilidFFIConfigLoggingTerminalCopyWithImpl< + VeilidFFIConfigLoggingTerminal>( + this as VeilidFFIConfigLoggingTerminal, _$identity); + + /// Serializes this VeilidFFIConfigLoggingTerminal to a JSON map. + Map toJson(); + @override - $Res call({ - Object? enabled = null, - Object? level = null, - Object? ignoreLogTargets = 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, - ignoreLogTargets: null == ignoreLogTargets - ? _value.ignoreLogTargets - : ignoreLogTargets // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'VeilidFFIConfigLoggingTerminal')) + ..add(DiagnosticsProperty('enabled', enabled)) + ..add(DiagnosticsProperty('level', level)) + ..add(DiagnosticsProperty('ignoreLogTargets', ignoreLogTargets)); + } + + @override + bool operator ==(Object 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) && + const DeepCollectionEquality() + .equals(other.ignoreLogTargets, ignoreLogTargets)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, enabled, level, + const DeepCollectionEquality().hash(ignoreLogTargets)); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfigLoggingTerminal(enabled: $enabled, level: $level, ignoreLogTargets: $ignoreLogTargets)'; } } /// @nodoc -abstract class _$$VeilidFFIConfigLoggingTerminalImplCopyWith<$Res> - implements $VeilidFFIConfigLoggingTerminalCopyWith<$Res> { - factory _$$VeilidFFIConfigLoggingTerminalImplCopyWith( - _$VeilidFFIConfigLoggingTerminalImpl value, - $Res Function(_$VeilidFFIConfigLoggingTerminalImpl) then) = - __$$VeilidFFIConfigLoggingTerminalImplCopyWithImpl<$Res>; - @override +abstract mixin class $VeilidFFIConfigLoggingTerminalCopyWith<$Res> { + factory $VeilidFFIConfigLoggingTerminalCopyWith( + VeilidFFIConfigLoggingTerminal value, + $Res Function(VeilidFFIConfigLoggingTerminal) _then) = + _$VeilidFFIConfigLoggingTerminalCopyWithImpl; @useResult $Res call( {bool enabled, @@ -102,14 +76,12 @@ abstract class _$$VeilidFFIConfigLoggingTerminalImplCopyWith<$Res> } /// @nodoc -class __$$VeilidFFIConfigLoggingTerminalImplCopyWithImpl<$Res> - extends _$VeilidFFIConfigLoggingTerminalCopyWithImpl<$Res, - _$VeilidFFIConfigLoggingTerminalImpl> - implements _$$VeilidFFIConfigLoggingTerminalImplCopyWith<$Res> { - __$$VeilidFFIConfigLoggingTerminalImplCopyWithImpl( - _$VeilidFFIConfigLoggingTerminalImpl _value, - $Res Function(_$VeilidFFIConfigLoggingTerminalImpl) _then) - : super(_value, _then); +class _$VeilidFFIConfigLoggingTerminalCopyWithImpl<$Res> + implements $VeilidFFIConfigLoggingTerminalCopyWith<$Res> { + _$VeilidFFIConfigLoggingTerminalCopyWithImpl(this._self, this._then); + + final VeilidFFIConfigLoggingTerminal _self; + final $Res Function(VeilidFFIConfigLoggingTerminal) _then; /// Create a copy of VeilidFFIConfigLoggingTerminal /// with the given fields replaced by the non-null parameter values. @@ -120,17 +92,17 @@ class __$$VeilidFFIConfigLoggingTerminalImplCopyWithImpl<$Res> Object? level = null, Object? ignoreLogTargets = null, }) { - return _then(_$VeilidFFIConfigLoggingTerminalImpl( + return _then(_self.copyWith( enabled: null == enabled - ? _value.enabled + ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable as bool, level: null == level - ? _value.level + ? _self.level : level // ignore: cast_nullable_to_non_nullable as VeilidConfigLogLevel, ignoreLogTargets: null == ignoreLogTargets - ? _value._ignoreLogTargets + ? _self.ignoreLogTargets : ignoreLogTargets // ignore: cast_nullable_to_non_nullable as List, )); @@ -139,18 +111,16 @@ class __$$VeilidFFIConfigLoggingTerminalImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$VeilidFFIConfigLoggingTerminalImpl +class _VeilidFFIConfigLoggingTerminal with DiagnosticableTreeMixin - implements _VeilidFFIConfigLoggingTerminal { - const _$VeilidFFIConfigLoggingTerminalImpl( + implements VeilidFFIConfigLoggingTerminal { + const _VeilidFFIConfigLoggingTerminal( {required this.enabled, required this.level, final List ignoreLogTargets = const []}) : _ignoreLogTargets = ignoreLogTargets; - - factory _$VeilidFFIConfigLoggingTerminalImpl.fromJson( - Map json) => - _$$VeilidFFIConfigLoggingTerminalImplFromJson(json); + factory _VeilidFFIConfigLoggingTerminal.fromJson(Map json) => + _$VeilidFFIConfigLoggingTerminalFromJson(json); @override final bool enabled; @@ -166,14 +136,24 @@ class _$VeilidFFIConfigLoggingTerminalImpl return EqualUnmodifiableListView(_ignoreLogTargets); } + /// Create a copy of VeilidFFIConfigLoggingTerminal + /// with the given fields replaced by the non-null parameter values. @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidFFIConfigLoggingTerminal(enabled: $enabled, level: $level, ignoreLogTargets: $ignoreLogTargets)'; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidFFIConfigLoggingTerminalCopyWith<_VeilidFFIConfigLoggingTerminal> + get copyWith => __$VeilidFFIConfigLoggingTerminalCopyWithImpl< + _VeilidFFIConfigLoggingTerminal>(this, _$identity); + + @override + Map toJson() { + return _$VeilidFFIConfigLoggingTerminalToJson( + this, + ); } @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); properties ..add(DiagnosticsProperty('type', 'VeilidFFIConfigLoggingTerminal')) ..add(DiagnosticsProperty('enabled', enabled)) @@ -185,7 +165,7 @@ class _$VeilidFFIConfigLoggingTerminalImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidFFIConfigLoggingTerminalImpl && + other is _VeilidFFIConfigLoggingTerminal && (identical(other.enabled, enabled) || other.enabled == enabled) && (identical(other.level, level) || other.level == level) && const DeepCollectionEquality() @@ -197,144 +177,123 @@ class _$VeilidFFIConfigLoggingTerminalImpl int get hashCode => Object.hash(runtimeType, enabled, level, const DeepCollectionEquality().hash(_ignoreLogTargets)); - /// Create a copy of VeilidFFIConfigLoggingTerminal - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidFFIConfigLoggingTerminalImplCopyWith< - _$VeilidFFIConfigLoggingTerminalImpl> - get copyWith => __$$VeilidFFIConfigLoggingTerminalImplCopyWithImpl< - _$VeilidFFIConfigLoggingTerminalImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidFFIConfigLoggingTerminalImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfigLoggingTerminal(enabled: $enabled, level: $level, ignoreLogTargets: $ignoreLogTargets)'; } } -abstract class _VeilidFFIConfigLoggingTerminal - implements VeilidFFIConfigLoggingTerminal { - const factory _VeilidFFIConfigLoggingTerminal( - {required final bool enabled, - required final VeilidConfigLogLevel level, - final List ignoreLogTargets}) = - _$VeilidFFIConfigLoggingTerminalImpl; - - factory _VeilidFFIConfigLoggingTerminal.fromJson(Map json) = - _$VeilidFFIConfigLoggingTerminalImpl.fromJson; - - @override - bool get enabled; - @override - VeilidConfigLogLevel get level; - @override - List get ignoreLogTargets; - - /// Create a copy of VeilidFFIConfigLoggingTerminal - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidFFIConfigLoggingTerminalImplCopyWith< - _$VeilidFFIConfigLoggingTerminalImpl> - 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; - List get ignoreLogTargets => throw _privateConstructorUsedError; - - /// Serializes this VeilidFFIConfigLoggingOtlp to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidFFIConfigLoggingOtlp - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $VeilidFFIConfigLoggingOtlpCopyWith - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VeilidFFIConfigLoggingOtlpCopyWith<$Res> { - factory $VeilidFFIConfigLoggingOtlpCopyWith(VeilidFFIConfigLoggingOtlp value, - $Res Function(VeilidFFIConfigLoggingOtlp) then) = - _$VeilidFFIConfigLoggingOtlpCopyWithImpl<$Res, - VeilidFFIConfigLoggingOtlp>; +abstract mixin class _$VeilidFFIConfigLoggingTerminalCopyWith<$Res> + implements $VeilidFFIConfigLoggingTerminalCopyWith<$Res> { + factory _$VeilidFFIConfigLoggingTerminalCopyWith( + _VeilidFFIConfigLoggingTerminal value, + $Res Function(_VeilidFFIConfigLoggingTerminal) _then) = + __$VeilidFFIConfigLoggingTerminalCopyWithImpl; + @override @useResult $Res call( {bool enabled, VeilidConfigLogLevel level, - String grpcEndpoint, - String serviceName, List ignoreLogTargets}); } /// @nodoc -class _$VeilidFFIConfigLoggingOtlpCopyWithImpl<$Res, - $Val extends VeilidFFIConfigLoggingOtlp> - implements $VeilidFFIConfigLoggingOtlpCopyWith<$Res> { - _$VeilidFFIConfigLoggingOtlpCopyWithImpl(this._value, this._then); +class __$VeilidFFIConfigLoggingTerminalCopyWithImpl<$Res> + implements _$VeilidFFIConfigLoggingTerminalCopyWith<$Res> { + __$VeilidFFIConfigLoggingTerminalCopyWithImpl(this._self, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final _VeilidFFIConfigLoggingTerminal _self; + final $Res Function(_VeilidFFIConfigLoggingTerminal) _then; - /// Create a copy of VeilidFFIConfigLoggingOtlp + /// Create a copy of VeilidFFIConfigLoggingTerminal /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') @override + @pragma('vm:prefer-inline') $Res call({ Object? enabled = null, Object? level = null, - Object? grpcEndpoint = null, - Object? serviceName = null, Object? ignoreLogTargets = null, }) { - return _then(_value.copyWith( + return _then(_VeilidFFIConfigLoggingTerminal( enabled: null == enabled - ? _value.enabled + ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable as bool, level: null == level - ? _value.level + ? _self.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, ignoreLogTargets: null == ignoreLogTargets - ? _value.ignoreLogTargets + ? _self._ignoreLogTargets : ignoreLogTargets // ignore: cast_nullable_to_non_nullable as List, - ) as $Val); + )); } } /// @nodoc -abstract class _$$VeilidFFIConfigLoggingOtlpImplCopyWith<$Res> - implements $VeilidFFIConfigLoggingOtlpCopyWith<$Res> { - factory _$$VeilidFFIConfigLoggingOtlpImplCopyWith( - _$VeilidFFIConfigLoggingOtlpImpl value, - $Res Function(_$VeilidFFIConfigLoggingOtlpImpl) then) = - __$$VeilidFFIConfigLoggingOtlpImplCopyWithImpl<$Res>; +mixin _$VeilidFFIConfigLoggingOtlp implements DiagnosticableTreeMixin { + bool get enabled; + VeilidConfigLogLevel get level; + String get grpcEndpoint; + String get serviceName; + List get ignoreLogTargets; + + /// Create a copy of VeilidFFIConfigLoggingOtlp + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingOtlpCopyWith + get copyWith => + _$VeilidFFIConfigLoggingOtlpCopyWithImpl( + this as VeilidFFIConfigLoggingOtlp, _$identity); + + /// Serializes this VeilidFFIConfigLoggingOtlp to a JSON map. + Map toJson(); + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'VeilidFFIConfigLoggingOtlp')) + ..add(DiagnosticsProperty('enabled', enabled)) + ..add(DiagnosticsProperty('level', level)) + ..add(DiagnosticsProperty('grpcEndpoint', grpcEndpoint)) + ..add(DiagnosticsProperty('serviceName', serviceName)) + ..add(DiagnosticsProperty('ignoreLogTargets', ignoreLogTargets)); + } + + @override + bool operator ==(Object 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) && + const DeepCollectionEquality() + .equals(other.ignoreLogTargets, ignoreLogTargets)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, enabled, level, grpcEndpoint, + serviceName, const DeepCollectionEquality().hash(ignoreLogTargets)); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfigLoggingOtlp(enabled: $enabled, level: $level, grpcEndpoint: $grpcEndpoint, serviceName: $serviceName, ignoreLogTargets: $ignoreLogTargets)'; + } +} + +/// @nodoc +abstract mixin class $VeilidFFIConfigLoggingOtlpCopyWith<$Res> { + factory $VeilidFFIConfigLoggingOtlpCopyWith(VeilidFFIConfigLoggingOtlp value, + $Res Function(VeilidFFIConfigLoggingOtlp) _then) = + _$VeilidFFIConfigLoggingOtlpCopyWithImpl; @useResult $Res call( {bool enabled, @@ -345,14 +304,12 @@ abstract class _$$VeilidFFIConfigLoggingOtlpImplCopyWith<$Res> } /// @nodoc -class __$$VeilidFFIConfigLoggingOtlpImplCopyWithImpl<$Res> - extends _$VeilidFFIConfigLoggingOtlpCopyWithImpl<$Res, - _$VeilidFFIConfigLoggingOtlpImpl> - implements _$$VeilidFFIConfigLoggingOtlpImplCopyWith<$Res> { - __$$VeilidFFIConfigLoggingOtlpImplCopyWithImpl( - _$VeilidFFIConfigLoggingOtlpImpl _value, - $Res Function(_$VeilidFFIConfigLoggingOtlpImpl) _then) - : super(_value, _then); +class _$VeilidFFIConfigLoggingOtlpCopyWithImpl<$Res> + implements $VeilidFFIConfigLoggingOtlpCopyWith<$Res> { + _$VeilidFFIConfigLoggingOtlpCopyWithImpl(this._self, this._then); + + final VeilidFFIConfigLoggingOtlp _self; + final $Res Function(VeilidFFIConfigLoggingOtlp) _then; /// Create a copy of VeilidFFIConfigLoggingOtlp /// with the given fields replaced by the non-null parameter values. @@ -365,25 +322,25 @@ class __$$VeilidFFIConfigLoggingOtlpImplCopyWithImpl<$Res> Object? serviceName = null, Object? ignoreLogTargets = null, }) { - return _then(_$VeilidFFIConfigLoggingOtlpImpl( + return _then(_self.copyWith( enabled: null == enabled - ? _value.enabled + ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable as bool, level: null == level - ? _value.level + ? _self.level : level // ignore: cast_nullable_to_non_nullable as VeilidConfigLogLevel, grpcEndpoint: null == grpcEndpoint - ? _value.grpcEndpoint + ? _self.grpcEndpoint : grpcEndpoint // ignore: cast_nullable_to_non_nullable as String, serviceName: null == serviceName - ? _value.serviceName + ? _self.serviceName : serviceName // ignore: cast_nullable_to_non_nullable as String, ignoreLogTargets: null == ignoreLogTargets - ? _value._ignoreLogTargets + ? _self.ignoreLogTargets : ignoreLogTargets // ignore: cast_nullable_to_non_nullable as List, )); @@ -392,20 +349,18 @@ class __$$VeilidFFIConfigLoggingOtlpImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$VeilidFFIConfigLoggingOtlpImpl +class _VeilidFFIConfigLoggingOtlp with DiagnosticableTreeMixin - implements _VeilidFFIConfigLoggingOtlp { - const _$VeilidFFIConfigLoggingOtlpImpl( + implements VeilidFFIConfigLoggingOtlp { + const _VeilidFFIConfigLoggingOtlp( {required this.enabled, required this.level, required this.grpcEndpoint, required this.serviceName, final List ignoreLogTargets = const []}) : _ignoreLogTargets = ignoreLogTargets; - - factory _$VeilidFFIConfigLoggingOtlpImpl.fromJson( - Map json) => - _$$VeilidFFIConfigLoggingOtlpImplFromJson(json); + factory _VeilidFFIConfigLoggingOtlp.fromJson(Map json) => + _$VeilidFFIConfigLoggingOtlpFromJson(json); @override final bool enabled; @@ -425,14 +380,24 @@ class _$VeilidFFIConfigLoggingOtlpImpl return EqualUnmodifiableListView(_ignoreLogTargets); } + /// Create a copy of VeilidFFIConfigLoggingOtlp + /// with the given fields replaced by the non-null parameter values. @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidFFIConfigLoggingOtlp(enabled: $enabled, level: $level, grpcEndpoint: $grpcEndpoint, serviceName: $serviceName, ignoreLogTargets: $ignoreLogTargets)'; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidFFIConfigLoggingOtlpCopyWith<_VeilidFFIConfigLoggingOtlp> + get copyWith => __$VeilidFFIConfigLoggingOtlpCopyWithImpl< + _VeilidFFIConfigLoggingOtlp>(this, _$identity); + + @override + Map toJson() { + return _$VeilidFFIConfigLoggingOtlpToJson( + this, + ); } @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); properties ..add(DiagnosticsProperty('type', 'VeilidFFIConfigLoggingOtlp')) ..add(DiagnosticsProperty('enabled', enabled)) @@ -446,7 +411,7 @@ class _$VeilidFFIConfigLoggingOtlpImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidFFIConfigLoggingOtlpImpl && + other is _VeilidFFIConfigLoggingOtlp && (identical(other.enabled, enabled) || other.enabled == enabled) && (identical(other.level, level) || other.level == level) && (identical(other.grpcEndpoint, grpcEndpoint) || @@ -462,132 +427,126 @@ class _$VeilidFFIConfigLoggingOtlpImpl int get hashCode => Object.hash(runtimeType, enabled, level, grpcEndpoint, serviceName, const DeepCollectionEquality().hash(_ignoreLogTargets)); - /// Create a copy of VeilidFFIConfigLoggingOtlp - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidFFIConfigLoggingOtlpImplCopyWith<_$VeilidFFIConfigLoggingOtlpImpl> - get copyWith => __$$VeilidFFIConfigLoggingOtlpImplCopyWithImpl< - _$VeilidFFIConfigLoggingOtlpImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidFFIConfigLoggingOtlpImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfigLoggingOtlp(enabled: $enabled, level: $level, grpcEndpoint: $grpcEndpoint, serviceName: $serviceName, ignoreLogTargets: $ignoreLogTargets)'; } } -abstract class _VeilidFFIConfigLoggingOtlp - implements VeilidFFIConfigLoggingOtlp { - const factory _VeilidFFIConfigLoggingOtlp( - {required final bool enabled, - required final VeilidConfigLogLevel level, - required final String grpcEndpoint, - required final String serviceName, - final List ignoreLogTargets}) = _$VeilidFFIConfigLoggingOtlpImpl; - - factory _VeilidFFIConfigLoggingOtlp.fromJson(Map json) = - _$VeilidFFIConfigLoggingOtlpImpl.fromJson; - - @override - bool get enabled; - @override - VeilidConfigLogLevel get level; - @override - String get grpcEndpoint; - @override - String get serviceName; - @override - List get ignoreLogTargets; - - /// Create a copy of VeilidFFIConfigLoggingOtlp - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidFFIConfigLoggingOtlpImplCopyWith<_$VeilidFFIConfigLoggingOtlpImpl> - 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; - List get ignoreLogTargets => throw _privateConstructorUsedError; - - /// Serializes this VeilidFFIConfigLoggingApi to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidFFIConfigLoggingApi - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $VeilidFFIConfigLoggingApiCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VeilidFFIConfigLoggingApiCopyWith<$Res> { - factory $VeilidFFIConfigLoggingApiCopyWith(VeilidFFIConfigLoggingApi value, - $Res Function(VeilidFFIConfigLoggingApi) then) = - _$VeilidFFIConfigLoggingApiCopyWithImpl<$Res, VeilidFFIConfigLoggingApi>; +abstract mixin class _$VeilidFFIConfigLoggingOtlpCopyWith<$Res> + implements $VeilidFFIConfigLoggingOtlpCopyWith<$Res> { + factory _$VeilidFFIConfigLoggingOtlpCopyWith( + _VeilidFFIConfigLoggingOtlp value, + $Res Function(_VeilidFFIConfigLoggingOtlp) _then) = + __$VeilidFFIConfigLoggingOtlpCopyWithImpl; + @override @useResult $Res call( {bool enabled, VeilidConfigLogLevel level, + String grpcEndpoint, + String serviceName, List ignoreLogTargets}); } /// @nodoc -class _$VeilidFFIConfigLoggingApiCopyWithImpl<$Res, - $Val extends VeilidFFIConfigLoggingApi> - implements $VeilidFFIConfigLoggingApiCopyWith<$Res> { - _$VeilidFFIConfigLoggingApiCopyWithImpl(this._value, this._then); +class __$VeilidFFIConfigLoggingOtlpCopyWithImpl<$Res> + implements _$VeilidFFIConfigLoggingOtlpCopyWith<$Res> { + __$VeilidFFIConfigLoggingOtlpCopyWithImpl(this._self, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final _VeilidFFIConfigLoggingOtlp _self; + final $Res Function(_VeilidFFIConfigLoggingOtlp) _then; - /// Create a copy of VeilidFFIConfigLoggingApi + /// Create a copy of VeilidFFIConfigLoggingOtlp /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') @override + @pragma('vm:prefer-inline') $Res call({ Object? enabled = null, Object? level = null, + Object? grpcEndpoint = null, + Object? serviceName = null, Object? ignoreLogTargets = null, }) { - return _then(_value.copyWith( + return _then(_VeilidFFIConfigLoggingOtlp( enabled: null == enabled - ? _value.enabled + ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable as bool, level: null == level - ? _value.level + ? _self.level : level // ignore: cast_nullable_to_non_nullable as VeilidConfigLogLevel, + grpcEndpoint: null == grpcEndpoint + ? _self.grpcEndpoint + : grpcEndpoint // ignore: cast_nullable_to_non_nullable + as String, + serviceName: null == serviceName + ? _self.serviceName + : serviceName // ignore: cast_nullable_to_non_nullable + as String, ignoreLogTargets: null == ignoreLogTargets - ? _value.ignoreLogTargets + ? _self._ignoreLogTargets : ignoreLogTargets // ignore: cast_nullable_to_non_nullable as List, - ) as $Val); + )); } } /// @nodoc -abstract class _$$VeilidFFIConfigLoggingApiImplCopyWith<$Res> - implements $VeilidFFIConfigLoggingApiCopyWith<$Res> { - factory _$$VeilidFFIConfigLoggingApiImplCopyWith( - _$VeilidFFIConfigLoggingApiImpl value, - $Res Function(_$VeilidFFIConfigLoggingApiImpl) then) = - __$$VeilidFFIConfigLoggingApiImplCopyWithImpl<$Res>; +mixin _$VeilidFFIConfigLoggingApi implements DiagnosticableTreeMixin { + bool get enabled; + VeilidConfigLogLevel get level; + List get ignoreLogTargets; + + /// Create a copy of VeilidFFIConfigLoggingApi + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingApiCopyWith get copyWith => + _$VeilidFFIConfigLoggingApiCopyWithImpl( + this as VeilidFFIConfigLoggingApi, _$identity); + + /// Serializes this VeilidFFIConfigLoggingApi to a JSON map. + Map toJson(); + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'VeilidFFIConfigLoggingApi')) + ..add(DiagnosticsProperty('enabled', enabled)) + ..add(DiagnosticsProperty('level', level)) + ..add(DiagnosticsProperty('ignoreLogTargets', ignoreLogTargets)); + } + + @override + bool operator ==(Object 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) && + const DeepCollectionEquality() + .equals(other.ignoreLogTargets, ignoreLogTargets)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, enabled, level, + const DeepCollectionEquality().hash(ignoreLogTargets)); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfigLoggingApi(enabled: $enabled, level: $level, ignoreLogTargets: $ignoreLogTargets)'; + } +} + +/// @nodoc +abstract mixin class $VeilidFFIConfigLoggingApiCopyWith<$Res> { + factory $VeilidFFIConfigLoggingApiCopyWith(VeilidFFIConfigLoggingApi value, + $Res Function(VeilidFFIConfigLoggingApi) _then) = + _$VeilidFFIConfigLoggingApiCopyWithImpl; @useResult $Res call( {bool enabled, @@ -596,14 +555,12 @@ abstract class _$$VeilidFFIConfigLoggingApiImplCopyWith<$Res> } /// @nodoc -class __$$VeilidFFIConfigLoggingApiImplCopyWithImpl<$Res> - extends _$VeilidFFIConfigLoggingApiCopyWithImpl<$Res, - _$VeilidFFIConfigLoggingApiImpl> - implements _$$VeilidFFIConfigLoggingApiImplCopyWith<$Res> { - __$$VeilidFFIConfigLoggingApiImplCopyWithImpl( - _$VeilidFFIConfigLoggingApiImpl _value, - $Res Function(_$VeilidFFIConfigLoggingApiImpl) _then) - : super(_value, _then); +class _$VeilidFFIConfigLoggingApiCopyWithImpl<$Res> + implements $VeilidFFIConfigLoggingApiCopyWith<$Res> { + _$VeilidFFIConfigLoggingApiCopyWithImpl(this._self, this._then); + + final VeilidFFIConfigLoggingApi _self; + final $Res Function(VeilidFFIConfigLoggingApi) _then; /// Create a copy of VeilidFFIConfigLoggingApi /// with the given fields replaced by the non-null parameter values. @@ -614,17 +571,17 @@ class __$$VeilidFFIConfigLoggingApiImplCopyWithImpl<$Res> Object? level = null, Object? ignoreLogTargets = null, }) { - return _then(_$VeilidFFIConfigLoggingApiImpl( + return _then(_self.copyWith( enabled: null == enabled - ? _value.enabled + ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable as bool, level: null == level - ? _value.level + ? _self.level : level // ignore: cast_nullable_to_non_nullable as VeilidConfigLogLevel, ignoreLogTargets: null == ignoreLogTargets - ? _value._ignoreLogTargets + ? _self.ignoreLogTargets : ignoreLogTargets // ignore: cast_nullable_to_non_nullable as List, )); @@ -633,17 +590,16 @@ class __$$VeilidFFIConfigLoggingApiImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$VeilidFFIConfigLoggingApiImpl +class _VeilidFFIConfigLoggingApi with DiagnosticableTreeMixin - implements _VeilidFFIConfigLoggingApi { - const _$VeilidFFIConfigLoggingApiImpl( + implements VeilidFFIConfigLoggingApi { + const _VeilidFFIConfigLoggingApi( {required this.enabled, required this.level, final List ignoreLogTargets = const []}) : _ignoreLogTargets = ignoreLogTargets; - - factory _$VeilidFFIConfigLoggingApiImpl.fromJson(Map json) => - _$$VeilidFFIConfigLoggingApiImplFromJson(json); + factory _VeilidFFIConfigLoggingApi.fromJson(Map json) => + _$VeilidFFIConfigLoggingApiFromJson(json); @override final bool enabled; @@ -659,14 +615,25 @@ class _$VeilidFFIConfigLoggingApiImpl return EqualUnmodifiableListView(_ignoreLogTargets); } + /// Create a copy of VeilidFFIConfigLoggingApi + /// with the given fields replaced by the non-null parameter values. @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidFFIConfigLoggingApi(enabled: $enabled, level: $level, ignoreLogTargets: $ignoreLogTargets)'; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidFFIConfigLoggingApiCopyWith<_VeilidFFIConfigLoggingApi> + get copyWith => + __$VeilidFFIConfigLoggingApiCopyWithImpl<_VeilidFFIConfigLoggingApi>( + this, _$identity); + + @override + Map toJson() { + return _$VeilidFFIConfigLoggingApiToJson( + this, + ); } @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); properties ..add(DiagnosticsProperty('type', 'VeilidFFIConfigLoggingApi')) ..add(DiagnosticsProperty('enabled', enabled)) @@ -678,7 +645,7 @@ class _$VeilidFFIConfigLoggingApiImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidFFIConfigLoggingApiImpl && + other is _VeilidFFIConfigLoggingApi && (identical(other.enabled, enabled) || other.enabled == enabled) && (identical(other.level, level) || other.level == level) && const DeepCollectionEquality() @@ -690,178 +657,79 @@ class _$VeilidFFIConfigLoggingApiImpl int get hashCode => Object.hash(runtimeType, enabled, level, const DeepCollectionEquality().hash(_ignoreLogTargets)); - /// Create a copy of VeilidFFIConfigLoggingApi - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidFFIConfigLoggingApiImplCopyWith<_$VeilidFFIConfigLoggingApiImpl> - get copyWith => __$$VeilidFFIConfigLoggingApiImplCopyWithImpl< - _$VeilidFFIConfigLoggingApiImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidFFIConfigLoggingApiImplToJson( - this, - ); - } -} - -abstract class _VeilidFFIConfigLoggingApi implements VeilidFFIConfigLoggingApi { - const factory _VeilidFFIConfigLoggingApi( - {required final bool enabled, - required final VeilidConfigLogLevel level, - final List ignoreLogTargets}) = _$VeilidFFIConfigLoggingApiImpl; - - factory _VeilidFFIConfigLoggingApi.fromJson(Map json) = - _$VeilidFFIConfigLoggingApiImpl.fromJson; - - @override - bool get enabled; - @override - VeilidConfigLogLevel get level; - @override - List get ignoreLogTargets; - - /// Create a copy of VeilidFFIConfigLoggingApi - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidFFIConfigLoggingApiImplCopyWith<_$VeilidFFIConfigLoggingApiImpl> - get copyWith => throw _privateConstructorUsedError; -} - -VeilidFFIConfigLoggingFlame _$VeilidFFIConfigLoggingFlameFromJson( - Map json) { - return _VeilidFFIConfigLoggingFlame.fromJson(json); -} - -/// @nodoc -mixin _$VeilidFFIConfigLoggingFlame { - bool get enabled => throw _privateConstructorUsedError; - String get path => throw _privateConstructorUsedError; - - /// Serializes this VeilidFFIConfigLoggingFlame to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidFFIConfigLoggingFlame - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $VeilidFFIConfigLoggingFlameCopyWith - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VeilidFFIConfigLoggingFlameCopyWith<$Res> { - factory $VeilidFFIConfigLoggingFlameCopyWith( - VeilidFFIConfigLoggingFlame value, - $Res Function(VeilidFFIConfigLoggingFlame) then) = - _$VeilidFFIConfigLoggingFlameCopyWithImpl<$Res, - VeilidFFIConfigLoggingFlame>; - @useResult - $Res call({bool enabled, String path}); -} - -/// @nodoc -class _$VeilidFFIConfigLoggingFlameCopyWithImpl<$Res, - $Val extends VeilidFFIConfigLoggingFlame> - implements $VeilidFFIConfigLoggingFlameCopyWith<$Res> { - _$VeilidFFIConfigLoggingFlameCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of VeilidFFIConfigLoggingFlame - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? enabled = null, - Object? path = null, - }) { - return _then(_value.copyWith( - enabled: null == enabled - ? _value.enabled - : enabled // ignore: cast_nullable_to_non_nullable - as bool, - path: null == path - ? _value.path - : path // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfigLoggingApi(enabled: $enabled, level: $level, ignoreLogTargets: $ignoreLogTargets)'; } } /// @nodoc -abstract class _$$VeilidFFIConfigLoggingFlameImplCopyWith<$Res> - implements $VeilidFFIConfigLoggingFlameCopyWith<$Res> { - factory _$$VeilidFFIConfigLoggingFlameImplCopyWith( - _$VeilidFFIConfigLoggingFlameImpl value, - $Res Function(_$VeilidFFIConfigLoggingFlameImpl) then) = - __$$VeilidFFIConfigLoggingFlameImplCopyWithImpl<$Res>; +abstract mixin class _$VeilidFFIConfigLoggingApiCopyWith<$Res> + implements $VeilidFFIConfigLoggingApiCopyWith<$Res> { + factory _$VeilidFFIConfigLoggingApiCopyWith(_VeilidFFIConfigLoggingApi value, + $Res Function(_VeilidFFIConfigLoggingApi) _then) = + __$VeilidFFIConfigLoggingApiCopyWithImpl; @override @useResult - $Res call({bool enabled, String path}); + $Res call( + {bool enabled, + VeilidConfigLogLevel level, + List ignoreLogTargets}); } /// @nodoc -class __$$VeilidFFIConfigLoggingFlameImplCopyWithImpl<$Res> - extends _$VeilidFFIConfigLoggingFlameCopyWithImpl<$Res, - _$VeilidFFIConfigLoggingFlameImpl> - implements _$$VeilidFFIConfigLoggingFlameImplCopyWith<$Res> { - __$$VeilidFFIConfigLoggingFlameImplCopyWithImpl( - _$VeilidFFIConfigLoggingFlameImpl _value, - $Res Function(_$VeilidFFIConfigLoggingFlameImpl) _then) - : super(_value, _then); +class __$VeilidFFIConfigLoggingApiCopyWithImpl<$Res> + implements _$VeilidFFIConfigLoggingApiCopyWith<$Res> { + __$VeilidFFIConfigLoggingApiCopyWithImpl(this._self, this._then); - /// Create a copy of VeilidFFIConfigLoggingFlame + final _VeilidFFIConfigLoggingApi _self; + final $Res Function(_VeilidFFIConfigLoggingApi) _then; + + /// Create a copy of VeilidFFIConfigLoggingApi /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') @override + @pragma('vm:prefer-inline') $Res call({ Object? enabled = null, - Object? path = null, + Object? level = null, + Object? ignoreLogTargets = null, }) { - return _then(_$VeilidFFIConfigLoggingFlameImpl( + return _then(_VeilidFFIConfigLoggingApi( enabled: null == enabled - ? _value.enabled + ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable as bool, - path: null == path - ? _value.path - : path // ignore: cast_nullable_to_non_nullable - as String, + level: null == level + ? _self.level + : level // ignore: cast_nullable_to_non_nullable + as VeilidConfigLogLevel, + ignoreLogTargets: null == ignoreLogTargets + ? _self._ignoreLogTargets + : ignoreLogTargets // ignore: cast_nullable_to_non_nullable + as List, )); } } /// @nodoc -@JsonSerializable() -class _$VeilidFFIConfigLoggingFlameImpl - with DiagnosticableTreeMixin - implements _VeilidFFIConfigLoggingFlame { - const _$VeilidFFIConfigLoggingFlameImpl( - {required this.enabled, required this.path}); +mixin _$VeilidFFIConfigLoggingFlame implements DiagnosticableTreeMixin { + bool get enabled; + String get path; - factory _$VeilidFFIConfigLoggingFlameImpl.fromJson( - Map json) => - _$$VeilidFFIConfigLoggingFlameImplFromJson(json); + /// Create a copy of VeilidFFIConfigLoggingFlame + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingFlameCopyWith + get copyWith => _$VeilidFFIConfigLoggingFlameCopyWithImpl< + VeilidFFIConfigLoggingFlame>( + this as VeilidFFIConfigLoggingFlame, _$identity); - @override - final bool enabled; - @override - final String path; - - @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidFFIConfigLoggingFlame(enabled: $enabled, path: $path)'; - } + /// Serializes this VeilidFFIConfigLoggingFlame to a JSON map. + Map toJson(); @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); properties ..add(DiagnosticsProperty('type', 'VeilidFFIConfigLoggingFlame')) ..add(DiagnosticsProperty('enabled', enabled)) @@ -872,7 +740,7 @@ class _$VeilidFFIConfigLoggingFlameImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidFFIConfigLoggingFlameImpl && + other is VeilidFFIConfigLoggingFlame && (identical(other.enabled, enabled) || other.enabled == enabled) && (identical(other.path, path) || other.path == path)); } @@ -881,266 +749,170 @@ class _$VeilidFFIConfigLoggingFlameImpl @override int get hashCode => Object.hash(runtimeType, enabled, path); - /// Create a copy of VeilidFFIConfigLoggingFlame - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidFFIConfigLoggingFlameImplCopyWith<_$VeilidFFIConfigLoggingFlameImpl> - get copyWith => __$$VeilidFFIConfigLoggingFlameImplCopyWithImpl< - _$VeilidFFIConfigLoggingFlameImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidFFIConfigLoggingFlameImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfigLoggingFlame(enabled: $enabled, path: $path)'; } } -abstract class _VeilidFFIConfigLoggingFlame - implements VeilidFFIConfigLoggingFlame { - const factory _VeilidFFIConfigLoggingFlame( - {required final bool enabled, - required final String path}) = _$VeilidFFIConfigLoggingFlameImpl; +/// @nodoc +abstract mixin class $VeilidFFIConfigLoggingFlameCopyWith<$Res> { + factory $VeilidFFIConfigLoggingFlameCopyWith( + VeilidFFIConfigLoggingFlame value, + $Res Function(VeilidFFIConfigLoggingFlame) _then) = + _$VeilidFFIConfigLoggingFlameCopyWithImpl; + @useResult + $Res call({bool enabled, String path}); +} - factory _VeilidFFIConfigLoggingFlame.fromJson(Map json) = - _$VeilidFFIConfigLoggingFlameImpl.fromJson; +/// @nodoc +class _$VeilidFFIConfigLoggingFlameCopyWithImpl<$Res> + implements $VeilidFFIConfigLoggingFlameCopyWith<$Res> { + _$VeilidFFIConfigLoggingFlameCopyWithImpl(this._self, this._then); - @override - bool get enabled; - @override - String get path; + final VeilidFFIConfigLoggingFlame _self; + final $Res Function(VeilidFFIConfigLoggingFlame) _then; /// Create a copy of VeilidFFIConfigLoggingFlame /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidFFIConfigLoggingFlameImplCopyWith<_$VeilidFFIConfigLoggingFlameImpl> - 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; - VeilidFFIConfigLoggingFlame get flame => throw _privateConstructorUsedError; - - /// Serializes this VeilidFFIConfigLogging to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidFFIConfigLogging - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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, - VeilidFFIConfigLoggingFlame flame}); - - $VeilidFFIConfigLoggingTerminalCopyWith<$Res> get terminal; - $VeilidFFIConfigLoggingOtlpCopyWith<$Res> get otlp; - $VeilidFFIConfigLoggingApiCopyWith<$Res> get api; - $VeilidFFIConfigLoggingFlameCopyWith<$Res> get flame; -} - -/// @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; - - /// Create a copy of VeilidFFIConfigLogging - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? terminal = null, - Object? otlp = null, - Object? api = null, - Object? flame = null, + Object? enabled = null, + Object? path = 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, - flame: null == flame - ? _value.flame - : flame // ignore: cast_nullable_to_non_nullable - as VeilidFFIConfigLoggingFlame, - ) as $Val); - } - - /// Create a copy of VeilidFFIConfigLogging - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidFFIConfigLoggingTerminalCopyWith<$Res> get terminal { - return $VeilidFFIConfigLoggingTerminalCopyWith<$Res>(_value.terminal, - (value) { - return _then(_value.copyWith(terminal: value) as $Val); - }); - } - - /// Create a copy of VeilidFFIConfigLogging - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidFFIConfigLoggingOtlpCopyWith<$Res> get otlp { - return $VeilidFFIConfigLoggingOtlpCopyWith<$Res>(_value.otlp, (value) { - return _then(_value.copyWith(otlp: value) as $Val); - }); - } - - /// Create a copy of VeilidFFIConfigLogging - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidFFIConfigLoggingApiCopyWith<$Res> get api { - return $VeilidFFIConfigLoggingApiCopyWith<$Res>(_value.api, (value) { - return _then(_value.copyWith(api: value) as $Val); - }); - } - - /// Create a copy of VeilidFFIConfigLogging - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidFFIConfigLoggingFlameCopyWith<$Res> get flame { - return $VeilidFFIConfigLoggingFlameCopyWith<$Res>(_value.flame, (value) { - return _then(_value.copyWith(flame: value) as $Val); - }); - } -} - -/// @nodoc -abstract class _$$VeilidFFIConfigLoggingImplCopyWith<$Res> - implements $VeilidFFIConfigLoggingCopyWith<$Res> { - factory _$$VeilidFFIConfigLoggingImplCopyWith( - _$VeilidFFIConfigLoggingImpl value, - $Res Function(_$VeilidFFIConfigLoggingImpl) then) = - __$$VeilidFFIConfigLoggingImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {VeilidFFIConfigLoggingTerminal terminal, - VeilidFFIConfigLoggingOtlp otlp, - VeilidFFIConfigLoggingApi api, - VeilidFFIConfigLoggingFlame flame}); - - @override - $VeilidFFIConfigLoggingTerminalCopyWith<$Res> get terminal; - @override - $VeilidFFIConfigLoggingOtlpCopyWith<$Res> get otlp; - @override - $VeilidFFIConfigLoggingApiCopyWith<$Res> get api; - @override - $VeilidFFIConfigLoggingFlameCopyWith<$Res> get flame; -} - -/// @nodoc -class __$$VeilidFFIConfigLoggingImplCopyWithImpl<$Res> - extends _$VeilidFFIConfigLoggingCopyWithImpl<$Res, - _$VeilidFFIConfigLoggingImpl> - implements _$$VeilidFFIConfigLoggingImplCopyWith<$Res> { - __$$VeilidFFIConfigLoggingImplCopyWithImpl( - _$VeilidFFIConfigLoggingImpl _value, - $Res Function(_$VeilidFFIConfigLoggingImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidFFIConfigLogging - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? terminal = null, - Object? otlp = null, - Object? api = null, - Object? flame = null, - }) { - return _then(_$VeilidFFIConfigLoggingImpl( - 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, - flame: null == flame - ? _value.flame - : flame // ignore: cast_nullable_to_non_nullable - as VeilidFFIConfigLoggingFlame, + return _then(_self.copyWith( + enabled: null == enabled + ? _self.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + path: null == path + ? _self.path + : path // ignore: cast_nullable_to_non_nullable + as String, )); } } /// @nodoc @JsonSerializable() -class _$VeilidFFIConfigLoggingImpl +class _VeilidFFIConfigLoggingFlame with DiagnosticableTreeMixin - implements _VeilidFFIConfigLogging { - const _$VeilidFFIConfigLoggingImpl( - {required this.terminal, - required this.otlp, - required this.api, - required this.flame}); - - factory _$VeilidFFIConfigLoggingImpl.fromJson(Map json) => - _$$VeilidFFIConfigLoggingImplFromJson(json); + implements VeilidFFIConfigLoggingFlame { + const _VeilidFFIConfigLoggingFlame( + {required this.enabled, required this.path}); + factory _VeilidFFIConfigLoggingFlame.fromJson(Map json) => + _$VeilidFFIConfigLoggingFlameFromJson(json); @override - final VeilidFFIConfigLoggingTerminal terminal; + final bool enabled; @override - final VeilidFFIConfigLoggingOtlp otlp; + final String path; + + /// Create a copy of VeilidFFIConfigLoggingFlame + /// with the given fields replaced by the non-null parameter values. @override - final VeilidFFIConfigLoggingApi api; - @override - final VeilidFFIConfigLoggingFlame flame; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidFFIConfigLoggingFlameCopyWith<_VeilidFFIConfigLoggingFlame> + get copyWith => __$VeilidFFIConfigLoggingFlameCopyWithImpl< + _VeilidFFIConfigLoggingFlame>(this, _$identity); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidFFIConfigLogging(terminal: $terminal, otlp: $otlp, api: $api, flame: $flame)'; + Map toJson() { + return _$VeilidFFIConfigLoggingFlameToJson( + this, + ); } @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidFFIConfigLoggingFlame')) + ..add(DiagnosticsProperty('enabled', enabled)) + ..add(DiagnosticsProperty('path', path)); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _VeilidFFIConfigLoggingFlame && + (identical(other.enabled, enabled) || other.enabled == enabled) && + (identical(other.path, path) || other.path == path)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, enabled, path); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfigLoggingFlame(enabled: $enabled, path: $path)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidFFIConfigLoggingFlameCopyWith<$Res> + implements $VeilidFFIConfigLoggingFlameCopyWith<$Res> { + factory _$VeilidFFIConfigLoggingFlameCopyWith( + _VeilidFFIConfigLoggingFlame value, + $Res Function(_VeilidFFIConfigLoggingFlame) _then) = + __$VeilidFFIConfigLoggingFlameCopyWithImpl; + @override + @useResult + $Res call({bool enabled, String path}); +} + +/// @nodoc +class __$VeilidFFIConfigLoggingFlameCopyWithImpl<$Res> + implements _$VeilidFFIConfigLoggingFlameCopyWith<$Res> { + __$VeilidFFIConfigLoggingFlameCopyWithImpl(this._self, this._then); + + final _VeilidFFIConfigLoggingFlame _self; + final $Res Function(_VeilidFFIConfigLoggingFlame) _then; + + /// Create a copy of VeilidFFIConfigLoggingFlame + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? enabled = null, + Object? path = null, + }) { + return _then(_VeilidFFIConfigLoggingFlame( + enabled: null == enabled + ? _self.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + path: null == path + ? _self.path + : path // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc +mixin _$VeilidFFIConfigLogging implements DiagnosticableTreeMixin { + VeilidFFIConfigLoggingTerminal get terminal; + VeilidFFIConfigLoggingOtlp get otlp; + VeilidFFIConfigLoggingApi get api; + VeilidFFIConfigLoggingFlame get flame; + + /// Create a copy of VeilidFFIConfigLogging + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingCopyWith get copyWith => + _$VeilidFFIConfigLoggingCopyWithImpl( + this as VeilidFFIConfigLogging, _$identity); + + /// Serializes this VeilidFFIConfigLogging to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidFFIConfigLogging')) ..add(DiagnosticsProperty('terminal', terminal)) @@ -1153,7 +925,7 @@ class _$VeilidFFIConfigLoggingImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidFFIConfigLoggingImpl && + other is VeilidFFIConfigLogging && (identical(other.terminal, terminal) || other.terminal == terminal) && (identical(other.otlp, otlp) || other.otlp == otlp) && @@ -1165,175 +937,301 @@ class _$VeilidFFIConfigLoggingImpl @override int get hashCode => Object.hash(runtimeType, terminal, otlp, api, flame); - /// Create a copy of VeilidFFIConfigLogging - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidFFIConfigLoggingImplCopyWith<_$VeilidFFIConfigLoggingImpl> - get copyWith => __$$VeilidFFIConfigLoggingImplCopyWithImpl< - _$VeilidFFIConfigLoggingImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidFFIConfigLoggingImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfigLogging(terminal: $terminal, otlp: $otlp, api: $api, flame: $flame)'; } } -abstract class _VeilidFFIConfigLogging implements VeilidFFIConfigLogging { - const factory _VeilidFFIConfigLogging( - {required final VeilidFFIConfigLoggingTerminal terminal, - required final VeilidFFIConfigLoggingOtlp otlp, - required final VeilidFFIConfigLoggingApi api, - required final VeilidFFIConfigLoggingFlame flame}) = - _$VeilidFFIConfigLoggingImpl; +/// @nodoc +abstract mixin class $VeilidFFIConfigLoggingCopyWith<$Res> { + factory $VeilidFFIConfigLoggingCopyWith(VeilidFFIConfigLogging value, + $Res Function(VeilidFFIConfigLogging) _then) = + _$VeilidFFIConfigLoggingCopyWithImpl; + @useResult + $Res call( + {VeilidFFIConfigLoggingTerminal terminal, + VeilidFFIConfigLoggingOtlp otlp, + VeilidFFIConfigLoggingApi api, + VeilidFFIConfigLoggingFlame flame}); - factory _VeilidFFIConfigLogging.fromJson(Map json) = - _$VeilidFFIConfigLoggingImpl.fromJson; + $VeilidFFIConfigLoggingTerminalCopyWith<$Res> get terminal; + $VeilidFFIConfigLoggingOtlpCopyWith<$Res> get otlp; + $VeilidFFIConfigLoggingApiCopyWith<$Res> get api; + $VeilidFFIConfigLoggingFlameCopyWith<$Res> get flame; +} - @override - VeilidFFIConfigLoggingTerminal get terminal; - @override - VeilidFFIConfigLoggingOtlp get otlp; - @override - VeilidFFIConfigLoggingApi get api; - @override - VeilidFFIConfigLoggingFlame get flame; +/// @nodoc +class _$VeilidFFIConfigLoggingCopyWithImpl<$Res> + implements $VeilidFFIConfigLoggingCopyWith<$Res> { + _$VeilidFFIConfigLoggingCopyWithImpl(this._self, this._then); + + final VeilidFFIConfigLogging _self; + final $Res Function(VeilidFFIConfigLogging) _then; /// Create a copy of VeilidFFIConfigLogging /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidFFIConfigLoggingImplCopyWith<_$VeilidFFIConfigLoggingImpl> - get copyWith => throw _privateConstructorUsedError; -} - -VeilidFFIConfig _$VeilidFFIConfigFromJson(Map json) { - return _VeilidFFIConfig.fromJson(json); -} - -/// @nodoc -mixin _$VeilidFFIConfig { - VeilidFFIConfigLogging get logging => throw _privateConstructorUsedError; - - /// Serializes this VeilidFFIConfig to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidFFIConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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; - - /// Create a copy of VeilidFFIConfig - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? logging = null, + Object? terminal = null, + Object? otlp = null, + Object? api = null, + Object? flame = null, }) { - return _then(_value.copyWith( - logging: null == logging - ? _value.logging - : logging // ignore: cast_nullable_to_non_nullable - as VeilidFFIConfigLogging, - ) as $Val); + return _then(_self.copyWith( + terminal: null == terminal + ? _self.terminal + : terminal // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLoggingTerminal, + otlp: null == otlp + ? _self.otlp + : otlp // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLoggingOtlp, + api: null == api + ? _self.api + : api // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLoggingApi, + flame: null == flame + ? _self.flame + : flame // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLoggingFlame, + )); } - /// Create a copy of VeilidFFIConfig + /// Create a copy of VeilidFFIConfigLogging /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') - $VeilidFFIConfigLoggingCopyWith<$Res> get logging { - return $VeilidFFIConfigLoggingCopyWith<$Res>(_value.logging, (value) { - return _then(_value.copyWith(logging: value) as $Val); + $VeilidFFIConfigLoggingTerminalCopyWith<$Res> get terminal { + return $VeilidFFIConfigLoggingTerminalCopyWith<$Res>(_self.terminal, + (value) { + return _then(_self.copyWith(terminal: value)); + }); + } + + /// Create a copy of VeilidFFIConfigLogging + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingOtlpCopyWith<$Res> get otlp { + return $VeilidFFIConfigLoggingOtlpCopyWith<$Res>(_self.otlp, (value) { + return _then(_self.copyWith(otlp: value)); + }); + } + + /// Create a copy of VeilidFFIConfigLogging + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingApiCopyWith<$Res> get api { + return $VeilidFFIConfigLoggingApiCopyWith<$Res>(_self.api, (value) { + return _then(_self.copyWith(api: value)); + }); + } + + /// Create a copy of VeilidFFIConfigLogging + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingFlameCopyWith<$Res> get flame { + return $VeilidFFIConfigLoggingFlameCopyWith<$Res>(_self.flame, (value) { + return _then(_self.copyWith(flame: value)); }); } } -/// @nodoc -abstract class _$$VeilidFFIConfigImplCopyWith<$Res> - implements $VeilidFFIConfigCopyWith<$Res> { - factory _$$VeilidFFIConfigImplCopyWith(_$VeilidFFIConfigImpl value, - $Res Function(_$VeilidFFIConfigImpl) then) = - __$$VeilidFFIConfigImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({VeilidFFIConfigLogging logging}); - - @override - $VeilidFFIConfigLoggingCopyWith<$Res> get logging; -} - -/// @nodoc -class __$$VeilidFFIConfigImplCopyWithImpl<$Res> - extends _$VeilidFFIConfigCopyWithImpl<$Res, _$VeilidFFIConfigImpl> - implements _$$VeilidFFIConfigImplCopyWith<$Res> { - __$$VeilidFFIConfigImplCopyWithImpl( - _$VeilidFFIConfigImpl _value, $Res Function(_$VeilidFFIConfigImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidFFIConfig - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? logging = null, - }) { - return _then(_$VeilidFFIConfigImpl( - logging: null == logging - ? _value.logging - : logging // ignore: cast_nullable_to_non_nullable - as VeilidFFIConfigLogging, - )); - } -} - /// @nodoc @JsonSerializable() -class _$VeilidFFIConfigImpl +class _VeilidFFIConfigLogging with DiagnosticableTreeMixin - implements _VeilidFFIConfig { - const _$VeilidFFIConfigImpl({required this.logging}); - - factory _$VeilidFFIConfigImpl.fromJson(Map json) => - _$$VeilidFFIConfigImplFromJson(json); + implements VeilidFFIConfigLogging { + const _VeilidFFIConfigLogging( + {required this.terminal, + required this.otlp, + required this.api, + required this.flame}); + factory _VeilidFFIConfigLogging.fromJson(Map json) => + _$VeilidFFIConfigLoggingFromJson(json); @override - final VeilidFFIConfigLogging logging; + final VeilidFFIConfigLoggingTerminal terminal; + @override + final VeilidFFIConfigLoggingOtlp otlp; + @override + final VeilidFFIConfigLoggingApi api; + @override + final VeilidFFIConfigLoggingFlame flame; + + /// Create a copy of VeilidFFIConfigLogging + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidFFIConfigLoggingCopyWith<_VeilidFFIConfigLogging> get copyWith => + __$VeilidFFIConfigLoggingCopyWithImpl<_VeilidFFIConfigLogging>( + this, _$identity); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidFFIConfig(logging: $logging)'; + Map toJson() { + return _$VeilidFFIConfigLoggingToJson( + this, + ); } @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)) + ..add(DiagnosticsProperty('flame', flame)); + } + + @override + bool operator ==(Object 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) && + (identical(other.flame, flame) || other.flame == flame)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, terminal, otlp, api, flame); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfigLogging(terminal: $terminal, otlp: $otlp, api: $api, flame: $flame)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidFFIConfigLoggingCopyWith<$Res> + implements $VeilidFFIConfigLoggingCopyWith<$Res> { + factory _$VeilidFFIConfigLoggingCopyWith(_VeilidFFIConfigLogging value, + $Res Function(_VeilidFFIConfigLogging) _then) = + __$VeilidFFIConfigLoggingCopyWithImpl; + @override + @useResult + $Res call( + {VeilidFFIConfigLoggingTerminal terminal, + VeilidFFIConfigLoggingOtlp otlp, + VeilidFFIConfigLoggingApi api, + VeilidFFIConfigLoggingFlame flame}); + + @override + $VeilidFFIConfigLoggingTerminalCopyWith<$Res> get terminal; + @override + $VeilidFFIConfigLoggingOtlpCopyWith<$Res> get otlp; + @override + $VeilidFFIConfigLoggingApiCopyWith<$Res> get api; + @override + $VeilidFFIConfigLoggingFlameCopyWith<$Res> get flame; +} + +/// @nodoc +class __$VeilidFFIConfigLoggingCopyWithImpl<$Res> + implements _$VeilidFFIConfigLoggingCopyWith<$Res> { + __$VeilidFFIConfigLoggingCopyWithImpl(this._self, this._then); + + final _VeilidFFIConfigLogging _self; + final $Res Function(_VeilidFFIConfigLogging) _then; + + /// Create a copy of VeilidFFIConfigLogging + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? terminal = null, + Object? otlp = null, + Object? api = null, + Object? flame = null, + }) { + return _then(_VeilidFFIConfigLogging( + terminal: null == terminal + ? _self.terminal + : terminal // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLoggingTerminal, + otlp: null == otlp + ? _self.otlp + : otlp // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLoggingOtlp, + api: null == api + ? _self.api + : api // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLoggingApi, + flame: null == flame + ? _self.flame + : flame // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLoggingFlame, + )); + } + + /// Create a copy of VeilidFFIConfigLogging + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingTerminalCopyWith<$Res> get terminal { + return $VeilidFFIConfigLoggingTerminalCopyWith<$Res>(_self.terminal, + (value) { + return _then(_self.copyWith(terminal: value)); + }); + } + + /// Create a copy of VeilidFFIConfigLogging + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingOtlpCopyWith<$Res> get otlp { + return $VeilidFFIConfigLoggingOtlpCopyWith<$Res>(_self.otlp, (value) { + return _then(_self.copyWith(otlp: value)); + }); + } + + /// Create a copy of VeilidFFIConfigLogging + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingApiCopyWith<$Res> get api { + return $VeilidFFIConfigLoggingApiCopyWith<$Res>(_self.api, (value) { + return _then(_self.copyWith(api: value)); + }); + } + + /// Create a copy of VeilidFFIConfigLogging + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingFlameCopyWith<$Res> get flame { + return $VeilidFFIConfigLoggingFlameCopyWith<$Res>(_self.flame, (value) { + return _then(_self.copyWith(flame: value)); + }); + } +} + +/// @nodoc +mixin _$VeilidFFIConfig implements DiagnosticableTreeMixin { + VeilidFFIConfigLogging get logging; + + /// Create a copy of VeilidFFIConfig + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidFFIConfigCopyWith get copyWith => + _$VeilidFFIConfigCopyWithImpl( + this as VeilidFFIConfig, _$identity); + + /// Serializes this VeilidFFIConfig to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidFFIConfig')) ..add(DiagnosticsProperty('logging', logging)); @@ -1343,7 +1241,7 @@ class _$VeilidFFIConfigImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidFFIConfigImpl && + other is VeilidFFIConfig && (identical(other.logging, logging) || other.logging == logging)); } @@ -1351,136 +1249,219 @@ class _$VeilidFFIConfigImpl @override int get hashCode => Object.hash(runtimeType, logging); + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfig(logging: $logging)'; + } +} + +/// @nodoc +abstract mixin class $VeilidFFIConfigCopyWith<$Res> { + factory $VeilidFFIConfigCopyWith( + VeilidFFIConfig value, $Res Function(VeilidFFIConfig) _then) = + _$VeilidFFIConfigCopyWithImpl; + @useResult + $Res call({VeilidFFIConfigLogging logging}); + + $VeilidFFIConfigLoggingCopyWith<$Res> get logging; +} + +/// @nodoc +class _$VeilidFFIConfigCopyWithImpl<$Res> + implements $VeilidFFIConfigCopyWith<$Res> { + _$VeilidFFIConfigCopyWithImpl(this._self, this._then); + + final VeilidFFIConfig _self; + final $Res Function(VeilidFFIConfig) _then; + + /// Create a copy of VeilidFFIConfig + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? logging = null, + }) { + return _then(_self.copyWith( + logging: null == logging + ? _self.logging + : logging // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLogging, + )); + } + /// Create a copy of VeilidFFIConfig /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$VeilidFFIConfigImplCopyWith<_$VeilidFFIConfigImpl> get copyWith => - __$$VeilidFFIConfigImplCopyWithImpl<_$VeilidFFIConfigImpl>( - this, _$identity); + $VeilidFFIConfigLoggingCopyWith<$Res> get logging { + return $VeilidFFIConfigLoggingCopyWith<$Res>(_self.logging, (value) { + return _then(_self.copyWith(logging: value)); + }); + } +} + +/// @nodoc +@JsonSerializable() +class _VeilidFFIConfig with DiagnosticableTreeMixin implements VeilidFFIConfig { + const _VeilidFFIConfig({required this.logging}); + factory _VeilidFFIConfig.fromJson(Map json) => + _$VeilidFFIConfigFromJson(json); + + @override + final VeilidFFIConfigLogging logging; + + /// Create a copy of VeilidFFIConfig + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidFFIConfigCopyWith<_VeilidFFIConfig> get copyWith => + __$VeilidFFIConfigCopyWithImpl<_VeilidFFIConfig>(this, _$identity); @override Map toJson() { - return _$$VeilidFFIConfigImplToJson( + return _$VeilidFFIConfigToJson( this, ); } -} - -abstract class _VeilidFFIConfig implements VeilidFFIConfig { - const factory _VeilidFFIConfig( - {required final VeilidFFIConfigLogging logging}) = _$VeilidFFIConfigImpl; - - factory _VeilidFFIConfig.fromJson(Map json) = - _$VeilidFFIConfigImpl.fromJson; @override - VeilidFFIConfigLogging get logging; + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'VeilidFFIConfig')) + ..add(DiagnosticsProperty('logging', logging)); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _VeilidFFIConfig && + (identical(other.logging, logging) || other.logging == logging)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, logging); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidFFIConfig(logging: $logging)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidFFIConfigCopyWith<$Res> + implements $VeilidFFIConfigCopyWith<$Res> { + factory _$VeilidFFIConfigCopyWith( + _VeilidFFIConfig value, $Res Function(_VeilidFFIConfig) _then) = + __$VeilidFFIConfigCopyWithImpl; + @override + @useResult + $Res call({VeilidFFIConfigLogging logging}); + + @override + $VeilidFFIConfigLoggingCopyWith<$Res> get logging; +} + +/// @nodoc +class __$VeilidFFIConfigCopyWithImpl<$Res> + implements _$VeilidFFIConfigCopyWith<$Res> { + __$VeilidFFIConfigCopyWithImpl(this._self, this._then); + + final _VeilidFFIConfig _self; + final $Res Function(_VeilidFFIConfig) _then; /// Create a copy of VeilidFFIConfig /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidFFIConfigImplCopyWith<_$VeilidFFIConfigImpl> 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; - List get ignoreLogTargets => throw _privateConstructorUsedError; - - /// Serializes this VeilidWASMConfigLoggingPerformance to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidWASMConfigLoggingPerformance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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, - List ignoreLogTargets}); -} - -/// @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; - - /// Create a copy of VeilidWASMConfigLoggingPerformance - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ - Object? enabled = null, - Object? level = null, - Object? logsInTimings = null, - Object? logsInConsole = null, - Object? ignoreLogTargets = null, + Object? logging = 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, - ignoreLogTargets: null == ignoreLogTargets - ? _value.ignoreLogTargets - : ignoreLogTargets // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + return _then(_VeilidFFIConfig( + logging: null == logging + ? _self.logging + : logging // ignore: cast_nullable_to_non_nullable + as VeilidFFIConfigLogging, + )); + } + + /// Create a copy of VeilidFFIConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidFFIConfigLoggingCopyWith<$Res> get logging { + return $VeilidFFIConfigLoggingCopyWith<$Res>(_self.logging, (value) { + return _then(_self.copyWith(logging: value)); + }); } } /// @nodoc -abstract class _$$VeilidWASMConfigLoggingPerformanceImplCopyWith<$Res> - implements $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> { - factory _$$VeilidWASMConfigLoggingPerformanceImplCopyWith( - _$VeilidWASMConfigLoggingPerformanceImpl value, - $Res Function(_$VeilidWASMConfigLoggingPerformanceImpl) then) = - __$$VeilidWASMConfigLoggingPerformanceImplCopyWithImpl<$Res>; +mixin _$VeilidWASMConfigLoggingPerformance implements DiagnosticableTreeMixin { + bool get enabled; + VeilidConfigLogLevel get level; + bool get logsInTimings; + bool get logsInConsole; + List get ignoreLogTargets; + + /// Create a copy of VeilidWASMConfigLoggingPerformance + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidWASMConfigLoggingPerformanceCopyWith< + VeilidWASMConfigLoggingPerformance> + get copyWith => _$VeilidWASMConfigLoggingPerformanceCopyWithImpl< + VeilidWASMConfigLoggingPerformance>( + this as VeilidWASMConfigLoggingPerformance, _$identity); + + /// Serializes this VeilidWASMConfigLoggingPerformance to a JSON map. + Map toJson(); + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'VeilidWASMConfigLoggingPerformance')) + ..add(DiagnosticsProperty('enabled', enabled)) + ..add(DiagnosticsProperty('level', level)) + ..add(DiagnosticsProperty('logsInTimings', logsInTimings)) + ..add(DiagnosticsProperty('logsInConsole', logsInConsole)) + ..add(DiagnosticsProperty('ignoreLogTargets', ignoreLogTargets)); + } + + @override + bool operator ==(Object 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) && + const DeepCollectionEquality() + .equals(other.ignoreLogTargets, ignoreLogTargets)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, enabled, level, logsInTimings, + logsInConsole, const DeepCollectionEquality().hash(ignoreLogTargets)); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidWASMConfigLoggingPerformance(enabled: $enabled, level: $level, logsInTimings: $logsInTimings, logsInConsole: $logsInConsole, ignoreLogTargets: $ignoreLogTargets)'; + } +} + +/// @nodoc +abstract mixin class $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> { + factory $VeilidWASMConfigLoggingPerformanceCopyWith( + VeilidWASMConfigLoggingPerformance value, + $Res Function(VeilidWASMConfigLoggingPerformance) _then) = + _$VeilidWASMConfigLoggingPerformanceCopyWithImpl; @useResult $Res call( {bool enabled, @@ -1491,14 +1472,12 @@ abstract class _$$VeilidWASMConfigLoggingPerformanceImplCopyWith<$Res> } /// @nodoc -class __$$VeilidWASMConfigLoggingPerformanceImplCopyWithImpl<$Res> - extends _$VeilidWASMConfigLoggingPerformanceCopyWithImpl<$Res, - _$VeilidWASMConfigLoggingPerformanceImpl> - implements _$$VeilidWASMConfigLoggingPerformanceImplCopyWith<$Res> { - __$$VeilidWASMConfigLoggingPerformanceImplCopyWithImpl( - _$VeilidWASMConfigLoggingPerformanceImpl _value, - $Res Function(_$VeilidWASMConfigLoggingPerformanceImpl) _then) - : super(_value, _then); +class _$VeilidWASMConfigLoggingPerformanceCopyWithImpl<$Res> + implements $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> { + _$VeilidWASMConfigLoggingPerformanceCopyWithImpl(this._self, this._then); + + final VeilidWASMConfigLoggingPerformance _self; + final $Res Function(VeilidWASMConfigLoggingPerformance) _then; /// Create a copy of VeilidWASMConfigLoggingPerformance /// with the given fields replaced by the non-null parameter values. @@ -1511,25 +1490,25 @@ class __$$VeilidWASMConfigLoggingPerformanceImplCopyWithImpl<$Res> Object? logsInConsole = null, Object? ignoreLogTargets = null, }) { - return _then(_$VeilidWASMConfigLoggingPerformanceImpl( + return _then(_self.copyWith( enabled: null == enabled - ? _value.enabled + ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable as bool, level: null == level - ? _value.level + ? _self.level : level // ignore: cast_nullable_to_non_nullable as VeilidConfigLogLevel, logsInTimings: null == logsInTimings - ? _value.logsInTimings + ? _self.logsInTimings : logsInTimings // ignore: cast_nullable_to_non_nullable as bool, logsInConsole: null == logsInConsole - ? _value.logsInConsole + ? _self.logsInConsole : logsInConsole // ignore: cast_nullable_to_non_nullable as bool, ignoreLogTargets: null == ignoreLogTargets - ? _value._ignoreLogTargets + ? _self.ignoreLogTargets : ignoreLogTargets // ignore: cast_nullable_to_non_nullable as List, )); @@ -1538,20 +1517,19 @@ class __$$VeilidWASMConfigLoggingPerformanceImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$VeilidWASMConfigLoggingPerformanceImpl +class _VeilidWASMConfigLoggingPerformance with DiagnosticableTreeMixin - implements _VeilidWASMConfigLoggingPerformance { - const _$VeilidWASMConfigLoggingPerformanceImpl( + implements VeilidWASMConfigLoggingPerformance { + const _VeilidWASMConfigLoggingPerformance( {required this.enabled, required this.level, required this.logsInTimings, required this.logsInConsole, final List ignoreLogTargets = const []}) : _ignoreLogTargets = ignoreLogTargets; - - factory _$VeilidWASMConfigLoggingPerformanceImpl.fromJson( + factory _VeilidWASMConfigLoggingPerformance.fromJson( Map json) => - _$$VeilidWASMConfigLoggingPerformanceImplFromJson(json); + _$VeilidWASMConfigLoggingPerformanceFromJson(json); @override final bool enabled; @@ -1571,14 +1549,25 @@ class _$VeilidWASMConfigLoggingPerformanceImpl return EqualUnmodifiableListView(_ignoreLogTargets); } + /// Create a copy of VeilidWASMConfigLoggingPerformance + /// with the given fields replaced by the non-null parameter values. @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidWASMConfigLoggingPerformance(enabled: $enabled, level: $level, logsInTimings: $logsInTimings, logsInConsole: $logsInConsole, ignoreLogTargets: $ignoreLogTargets)'; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidWASMConfigLoggingPerformanceCopyWith< + _VeilidWASMConfigLoggingPerformance> + get copyWith => __$VeilidWASMConfigLoggingPerformanceCopyWithImpl< + _VeilidWASMConfigLoggingPerformance>(this, _$identity); + + @override + Map toJson() { + return _$VeilidWASMConfigLoggingPerformanceToJson( + this, + ); } @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); properties ..add(DiagnosticsProperty('type', 'VeilidWASMConfigLoggingPerformance')) ..add(DiagnosticsProperty('enabled', enabled)) @@ -1592,7 +1581,7 @@ class _$VeilidWASMConfigLoggingPerformanceImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidWASMConfigLoggingPerformanceImpl && + other is _VeilidWASMConfigLoggingPerformance && (identical(other.enabled, enabled) || other.enabled == enabled) && (identical(other.level, level) || other.level == level) && (identical(other.logsInTimings, logsInTimings) || @@ -1608,137 +1597,127 @@ class _$VeilidWASMConfigLoggingPerformanceImpl int get hashCode => Object.hash(runtimeType, enabled, level, logsInTimings, logsInConsole, const DeepCollectionEquality().hash(_ignoreLogTargets)); - /// Create a copy of VeilidWASMConfigLoggingPerformance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidWASMConfigLoggingPerformanceImplCopyWith< - _$VeilidWASMConfigLoggingPerformanceImpl> - get copyWith => __$$VeilidWASMConfigLoggingPerformanceImplCopyWithImpl< - _$VeilidWASMConfigLoggingPerformanceImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidWASMConfigLoggingPerformanceImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidWASMConfigLoggingPerformance(enabled: $enabled, level: $level, logsInTimings: $logsInTimings, logsInConsole: $logsInConsole, ignoreLogTargets: $ignoreLogTargets)'; } } -abstract class _VeilidWASMConfigLoggingPerformance - implements VeilidWASMConfigLoggingPerformance { - const factory _VeilidWASMConfigLoggingPerformance( - {required final bool enabled, - required final VeilidConfigLogLevel level, - required final bool logsInTimings, - required final bool logsInConsole, - final List ignoreLogTargets}) = - _$VeilidWASMConfigLoggingPerformanceImpl; - - factory _VeilidWASMConfigLoggingPerformance.fromJson( - Map json) = - _$VeilidWASMConfigLoggingPerformanceImpl.fromJson; - - @override - bool get enabled; - @override - VeilidConfigLogLevel get level; - @override - bool get logsInTimings; - @override - bool get logsInConsole; - @override - List get ignoreLogTargets; - - /// Create a copy of VeilidWASMConfigLoggingPerformance - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidWASMConfigLoggingPerformanceImplCopyWith< - _$VeilidWASMConfigLoggingPerformanceImpl> - 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; - List get ignoreLogTargets => throw _privateConstructorUsedError; - - /// Serializes this VeilidWASMConfigLoggingApi to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidWASMConfigLoggingApi - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $VeilidWASMConfigLoggingApiCopyWith - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VeilidWASMConfigLoggingApiCopyWith<$Res> { - factory $VeilidWASMConfigLoggingApiCopyWith(VeilidWASMConfigLoggingApi value, - $Res Function(VeilidWASMConfigLoggingApi) then) = - _$VeilidWASMConfigLoggingApiCopyWithImpl<$Res, - VeilidWASMConfigLoggingApi>; +abstract mixin class _$VeilidWASMConfigLoggingPerformanceCopyWith<$Res> + implements $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> { + factory _$VeilidWASMConfigLoggingPerformanceCopyWith( + _VeilidWASMConfigLoggingPerformance value, + $Res Function(_VeilidWASMConfigLoggingPerformance) _then) = + __$VeilidWASMConfigLoggingPerformanceCopyWithImpl; + @override @useResult $Res call( {bool enabled, VeilidConfigLogLevel level, + bool logsInTimings, + bool logsInConsole, List ignoreLogTargets}); } /// @nodoc -class _$VeilidWASMConfigLoggingApiCopyWithImpl<$Res, - $Val extends VeilidWASMConfigLoggingApi> - implements $VeilidWASMConfigLoggingApiCopyWith<$Res> { - _$VeilidWASMConfigLoggingApiCopyWithImpl(this._value, this._then); +class __$VeilidWASMConfigLoggingPerformanceCopyWithImpl<$Res> + implements _$VeilidWASMConfigLoggingPerformanceCopyWith<$Res> { + __$VeilidWASMConfigLoggingPerformanceCopyWithImpl(this._self, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final _VeilidWASMConfigLoggingPerformance _self; + final $Res Function(_VeilidWASMConfigLoggingPerformance) _then; - /// Create a copy of VeilidWASMConfigLoggingApi + /// Create a copy of VeilidWASMConfigLoggingPerformance /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') @override + @pragma('vm:prefer-inline') $Res call({ Object? enabled = null, Object? level = null, + Object? logsInTimings = null, + Object? logsInConsole = null, Object? ignoreLogTargets = null, }) { - return _then(_value.copyWith( + return _then(_VeilidWASMConfigLoggingPerformance( enabled: null == enabled - ? _value.enabled + ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable as bool, level: null == level - ? _value.level + ? _self.level : level // ignore: cast_nullable_to_non_nullable as VeilidConfigLogLevel, + logsInTimings: null == logsInTimings + ? _self.logsInTimings + : logsInTimings // ignore: cast_nullable_to_non_nullable + as bool, + logsInConsole: null == logsInConsole + ? _self.logsInConsole + : logsInConsole // ignore: cast_nullable_to_non_nullable + as bool, ignoreLogTargets: null == ignoreLogTargets - ? _value.ignoreLogTargets + ? _self._ignoreLogTargets : ignoreLogTargets // ignore: cast_nullable_to_non_nullable as List, - ) as $Val); + )); } } /// @nodoc -abstract class _$$VeilidWASMConfigLoggingApiImplCopyWith<$Res> - implements $VeilidWASMConfigLoggingApiCopyWith<$Res> { - factory _$$VeilidWASMConfigLoggingApiImplCopyWith( - _$VeilidWASMConfigLoggingApiImpl value, - $Res Function(_$VeilidWASMConfigLoggingApiImpl) then) = - __$$VeilidWASMConfigLoggingApiImplCopyWithImpl<$Res>; +mixin _$VeilidWASMConfigLoggingApi implements DiagnosticableTreeMixin { + bool get enabled; + VeilidConfigLogLevel get level; + List get ignoreLogTargets; + + /// Create a copy of VeilidWASMConfigLoggingApi + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidWASMConfigLoggingApiCopyWith + get copyWith => + _$VeilidWASMConfigLoggingApiCopyWithImpl( + this as VeilidWASMConfigLoggingApi, _$identity); + + /// Serializes this VeilidWASMConfigLoggingApi to a JSON map. + Map toJson(); + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'VeilidWASMConfigLoggingApi')) + ..add(DiagnosticsProperty('enabled', enabled)) + ..add(DiagnosticsProperty('level', level)) + ..add(DiagnosticsProperty('ignoreLogTargets', ignoreLogTargets)); + } + + @override + bool operator ==(Object 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) && + const DeepCollectionEquality() + .equals(other.ignoreLogTargets, ignoreLogTargets)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, enabled, level, + const DeepCollectionEquality().hash(ignoreLogTargets)); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidWASMConfigLoggingApi(enabled: $enabled, level: $level, ignoreLogTargets: $ignoreLogTargets)'; + } +} + +/// @nodoc +abstract mixin class $VeilidWASMConfigLoggingApiCopyWith<$Res> { + factory $VeilidWASMConfigLoggingApiCopyWith(VeilidWASMConfigLoggingApi value, + $Res Function(VeilidWASMConfigLoggingApi) _then) = + _$VeilidWASMConfigLoggingApiCopyWithImpl; @useResult $Res call( {bool enabled, @@ -1747,14 +1726,12 @@ abstract class _$$VeilidWASMConfigLoggingApiImplCopyWith<$Res> } /// @nodoc -class __$$VeilidWASMConfigLoggingApiImplCopyWithImpl<$Res> - extends _$VeilidWASMConfigLoggingApiCopyWithImpl<$Res, - _$VeilidWASMConfigLoggingApiImpl> - implements _$$VeilidWASMConfigLoggingApiImplCopyWith<$Res> { - __$$VeilidWASMConfigLoggingApiImplCopyWithImpl( - _$VeilidWASMConfigLoggingApiImpl _value, - $Res Function(_$VeilidWASMConfigLoggingApiImpl) _then) - : super(_value, _then); +class _$VeilidWASMConfigLoggingApiCopyWithImpl<$Res> + implements $VeilidWASMConfigLoggingApiCopyWith<$Res> { + _$VeilidWASMConfigLoggingApiCopyWithImpl(this._self, this._then); + + final VeilidWASMConfigLoggingApi _self; + final $Res Function(VeilidWASMConfigLoggingApi) _then; /// Create a copy of VeilidWASMConfigLoggingApi /// with the given fields replaced by the non-null parameter values. @@ -1765,17 +1742,17 @@ class __$$VeilidWASMConfigLoggingApiImplCopyWithImpl<$Res> Object? level = null, Object? ignoreLogTargets = null, }) { - return _then(_$VeilidWASMConfigLoggingApiImpl( + return _then(_self.copyWith( enabled: null == enabled - ? _value.enabled + ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable as bool, level: null == level - ? _value.level + ? _self.level : level // ignore: cast_nullable_to_non_nullable as VeilidConfigLogLevel, ignoreLogTargets: null == ignoreLogTargets - ? _value._ignoreLogTargets + ? _self.ignoreLogTargets : ignoreLogTargets // ignore: cast_nullable_to_non_nullable as List, )); @@ -1784,18 +1761,16 @@ class __$$VeilidWASMConfigLoggingApiImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$VeilidWASMConfigLoggingApiImpl +class _VeilidWASMConfigLoggingApi with DiagnosticableTreeMixin - implements _VeilidWASMConfigLoggingApi { - const _$VeilidWASMConfigLoggingApiImpl( + implements VeilidWASMConfigLoggingApi { + const _VeilidWASMConfigLoggingApi( {required this.enabled, required this.level, final List ignoreLogTargets = const []}) : _ignoreLogTargets = ignoreLogTargets; - - factory _$VeilidWASMConfigLoggingApiImpl.fromJson( - Map json) => - _$$VeilidWASMConfigLoggingApiImplFromJson(json); + factory _VeilidWASMConfigLoggingApi.fromJson(Map json) => + _$VeilidWASMConfigLoggingApiFromJson(json); @override final bool enabled; @@ -1811,14 +1786,24 @@ class _$VeilidWASMConfigLoggingApiImpl return EqualUnmodifiableListView(_ignoreLogTargets); } + /// Create a copy of VeilidWASMConfigLoggingApi + /// with the given fields replaced by the non-null parameter values. @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidWASMConfigLoggingApi(enabled: $enabled, level: $level, ignoreLogTargets: $ignoreLogTargets)'; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidWASMConfigLoggingApiCopyWith<_VeilidWASMConfigLoggingApi> + get copyWith => __$VeilidWASMConfigLoggingApiCopyWithImpl< + _VeilidWASMConfigLoggingApi>(this, _$identity); + + @override + Map toJson() { + return _$VeilidWASMConfigLoggingApiToJson( + this, + ); } @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); properties ..add(DiagnosticsProperty('type', 'VeilidWASMConfigLoggingApi')) ..add(DiagnosticsProperty('enabled', enabled)) @@ -1830,7 +1815,7 @@ class _$VeilidWASMConfigLoggingApiImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidWASMConfigLoggingApiImpl && + other is _VeilidWASMConfigLoggingApi && (identical(other.enabled, enabled) || other.enabled == enabled) && (identical(other.level, level) || other.level == level) && const DeepCollectionEquality() @@ -1842,210 +1827,79 @@ class _$VeilidWASMConfigLoggingApiImpl int get hashCode => Object.hash(runtimeType, enabled, level, const DeepCollectionEquality().hash(_ignoreLogTargets)); - /// Create a copy of VeilidWASMConfigLoggingApi - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidWASMConfigLoggingApiImplCopyWith<_$VeilidWASMConfigLoggingApiImpl> - get copyWith => __$$VeilidWASMConfigLoggingApiImplCopyWithImpl< - _$VeilidWASMConfigLoggingApiImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidWASMConfigLoggingApiImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidWASMConfigLoggingApi(enabled: $enabled, level: $level, ignoreLogTargets: $ignoreLogTargets)'; } } -abstract class _VeilidWASMConfigLoggingApi - implements VeilidWASMConfigLoggingApi { - const factory _VeilidWASMConfigLoggingApi( - {required final bool enabled, - required final VeilidConfigLogLevel level, - final List ignoreLogTargets}) = _$VeilidWASMConfigLoggingApiImpl; +/// @nodoc +abstract mixin class _$VeilidWASMConfigLoggingApiCopyWith<$Res> + implements $VeilidWASMConfigLoggingApiCopyWith<$Res> { + factory _$VeilidWASMConfigLoggingApiCopyWith( + _VeilidWASMConfigLoggingApi value, + $Res Function(_VeilidWASMConfigLoggingApi) _then) = + __$VeilidWASMConfigLoggingApiCopyWithImpl; + @override + @useResult + $Res call( + {bool enabled, + VeilidConfigLogLevel level, + List ignoreLogTargets}); +} - factory _VeilidWASMConfigLoggingApi.fromJson(Map json) = - _$VeilidWASMConfigLoggingApiImpl.fromJson; +/// @nodoc +class __$VeilidWASMConfigLoggingApiCopyWithImpl<$Res> + implements _$VeilidWASMConfigLoggingApiCopyWith<$Res> { + __$VeilidWASMConfigLoggingApiCopyWithImpl(this._self, this._then); - @override - bool get enabled; - @override - VeilidConfigLogLevel get level; - @override - List get ignoreLogTargets; + final _VeilidWASMConfigLoggingApi _self; + final $Res Function(_VeilidWASMConfigLoggingApi) _then; /// Create a copy of VeilidWASMConfigLoggingApi /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidWASMConfigLoggingApiImplCopyWith<_$VeilidWASMConfigLoggingApiImpl> - 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; - - /// Serializes this VeilidWASMConfigLogging to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidWASMConfigLogging - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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; - - /// Create a copy of VeilidWASMConfigLogging - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ - Object? performance = null, - Object? api = null, + Object? enabled = null, + Object? level = null, + Object? ignoreLogTargets = 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); - } - - /// Create a copy of VeilidWASMConfigLogging - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> get performance { - return $VeilidWASMConfigLoggingPerformanceCopyWith<$Res>(_value.performance, - (value) { - return _then(_value.copyWith(performance: value) as $Val); - }); - } - - /// Create a copy of VeilidWASMConfigLogging - /// with the given fields replaced by the non-null parameter values. - @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 _$$VeilidWASMConfigLoggingImplCopyWith<$Res> - implements $VeilidWASMConfigLoggingCopyWith<$Res> { - factory _$$VeilidWASMConfigLoggingImplCopyWith( - _$VeilidWASMConfigLoggingImpl value, - $Res Function(_$VeilidWASMConfigLoggingImpl) then) = - __$$VeilidWASMConfigLoggingImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {VeilidWASMConfigLoggingPerformance performance, - VeilidWASMConfigLoggingApi api}); - - @override - $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> get performance; - @override - $VeilidWASMConfigLoggingApiCopyWith<$Res> get api; -} - -/// @nodoc -class __$$VeilidWASMConfigLoggingImplCopyWithImpl<$Res> - extends _$VeilidWASMConfigLoggingCopyWithImpl<$Res, - _$VeilidWASMConfigLoggingImpl> - implements _$$VeilidWASMConfigLoggingImplCopyWith<$Res> { - __$$VeilidWASMConfigLoggingImplCopyWithImpl( - _$VeilidWASMConfigLoggingImpl _value, - $Res Function(_$VeilidWASMConfigLoggingImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidWASMConfigLogging - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? performance = null, - Object? api = null, - }) { - return _then(_$VeilidWASMConfigLoggingImpl( - 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, + return _then(_VeilidWASMConfigLoggingApi( + enabled: null == enabled + ? _self.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + level: null == level + ? _self.level + : level // ignore: cast_nullable_to_non_nullable + as VeilidConfigLogLevel, + ignoreLogTargets: null == ignoreLogTargets + ? _self._ignoreLogTargets + : ignoreLogTargets // ignore: cast_nullable_to_non_nullable + as List, )); } } /// @nodoc -@JsonSerializable() -class _$VeilidWASMConfigLoggingImpl - with DiagnosticableTreeMixin - implements _VeilidWASMConfigLogging { - const _$VeilidWASMConfigLoggingImpl( - {required this.performance, required this.api}); +mixin _$VeilidWASMConfigLogging implements DiagnosticableTreeMixin { + VeilidWASMConfigLoggingPerformance get performance; + VeilidWASMConfigLoggingApi get api; - factory _$VeilidWASMConfigLoggingImpl.fromJson(Map json) => - _$$VeilidWASMConfigLoggingImplFromJson(json); + /// Create a copy of VeilidWASMConfigLogging + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidWASMConfigLoggingCopyWith get copyWith => + _$VeilidWASMConfigLoggingCopyWithImpl( + this as VeilidWASMConfigLogging, _$identity); - @override - final VeilidWASMConfigLoggingPerformance performance; - @override - final VeilidWASMConfigLoggingApi api; - - @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidWASMConfigLogging(performance: $performance, api: $api)'; - } + /// Serializes this VeilidWASMConfigLogging to a JSON map. + Map toJson(); @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); properties ..add(DiagnosticsProperty('type', 'VeilidWASMConfigLogging')) ..add(DiagnosticsProperty('performance', performance)) @@ -2056,7 +1910,7 @@ class _$VeilidWASMConfigLoggingImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidWASMConfigLoggingImpl && + other is VeilidWASMConfigLogging && (identical(other.performance, performance) || other.performance == performance) && (identical(other.api, api) || other.api == api)); @@ -2066,169 +1920,220 @@ class _$VeilidWASMConfigLoggingImpl @override int get hashCode => Object.hash(runtimeType, performance, api); - /// Create a copy of VeilidWASMConfigLogging - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidWASMConfigLoggingImplCopyWith<_$VeilidWASMConfigLoggingImpl> - get copyWith => __$$VeilidWASMConfigLoggingImplCopyWithImpl< - _$VeilidWASMConfigLoggingImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidWASMConfigLoggingImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidWASMConfigLogging(performance: $performance, api: $api)'; } } -abstract class _VeilidWASMConfigLogging implements VeilidWASMConfigLogging { - const factory _VeilidWASMConfigLogging( - {required final VeilidWASMConfigLoggingPerformance performance, - required final VeilidWASMConfigLoggingApi api}) = - _$VeilidWASMConfigLoggingImpl; +/// @nodoc +abstract mixin class $VeilidWASMConfigLoggingCopyWith<$Res> { + factory $VeilidWASMConfigLoggingCopyWith(VeilidWASMConfigLogging value, + $Res Function(VeilidWASMConfigLogging) _then) = + _$VeilidWASMConfigLoggingCopyWithImpl; + @useResult + $Res call( + {VeilidWASMConfigLoggingPerformance performance, + VeilidWASMConfigLoggingApi api}); - factory _VeilidWASMConfigLogging.fromJson(Map json) = - _$VeilidWASMConfigLoggingImpl.fromJson; + $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> get performance; + $VeilidWASMConfigLoggingApiCopyWith<$Res> get api; +} - @override - VeilidWASMConfigLoggingPerformance get performance; - @override - VeilidWASMConfigLoggingApi get api; +/// @nodoc +class _$VeilidWASMConfigLoggingCopyWithImpl<$Res> + implements $VeilidWASMConfigLoggingCopyWith<$Res> { + _$VeilidWASMConfigLoggingCopyWithImpl(this._self, this._then); + + final VeilidWASMConfigLogging _self; + final $Res Function(VeilidWASMConfigLogging) _then; /// Create a copy of VeilidWASMConfigLogging /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidWASMConfigLoggingImplCopyWith<_$VeilidWASMConfigLoggingImpl> - get copyWith => throw _privateConstructorUsedError; -} - -VeilidWASMConfig _$VeilidWASMConfigFromJson(Map json) { - return _VeilidWASMConfig.fromJson(json); -} - -/// @nodoc -mixin _$VeilidWASMConfig { - VeilidWASMConfigLogging get logging => throw _privateConstructorUsedError; - - /// Serializes this VeilidWASMConfig to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidWASMConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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; - - /// Create a copy of VeilidWASMConfig - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? logging = null, + Object? performance = null, + Object? api = null, }) { - return _then(_value.copyWith( - logging: null == logging - ? _value.logging - : logging // ignore: cast_nullable_to_non_nullable - as VeilidWASMConfigLogging, - ) as $Val); + return _then(_self.copyWith( + performance: null == performance + ? _self.performance + : performance // ignore: cast_nullable_to_non_nullable + as VeilidWASMConfigLoggingPerformance, + api: null == api + ? _self.api + : api // ignore: cast_nullable_to_non_nullable + as VeilidWASMConfigLoggingApi, + )); } - /// Create a copy of VeilidWASMConfig + /// Create a copy of VeilidWASMConfigLogging /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') - $VeilidWASMConfigLoggingCopyWith<$Res> get logging { - return $VeilidWASMConfigLoggingCopyWith<$Res>(_value.logging, (value) { - return _then(_value.copyWith(logging: value) as $Val); + $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> get performance { + return $VeilidWASMConfigLoggingPerformanceCopyWith<$Res>(_self.performance, + (value) { + return _then(_self.copyWith(performance: value)); + }); + } + + /// Create a copy of VeilidWASMConfigLogging + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidWASMConfigLoggingApiCopyWith<$Res> get api { + return $VeilidWASMConfigLoggingApiCopyWith<$Res>(_self.api, (value) { + return _then(_self.copyWith(api: value)); }); } } -/// @nodoc -abstract class _$$VeilidWASMConfigImplCopyWith<$Res> - implements $VeilidWASMConfigCopyWith<$Res> { - factory _$$VeilidWASMConfigImplCopyWith(_$VeilidWASMConfigImpl value, - $Res Function(_$VeilidWASMConfigImpl) then) = - __$$VeilidWASMConfigImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({VeilidWASMConfigLogging logging}); - - @override - $VeilidWASMConfigLoggingCopyWith<$Res> get logging; -} - -/// @nodoc -class __$$VeilidWASMConfigImplCopyWithImpl<$Res> - extends _$VeilidWASMConfigCopyWithImpl<$Res, _$VeilidWASMConfigImpl> - implements _$$VeilidWASMConfigImplCopyWith<$Res> { - __$$VeilidWASMConfigImplCopyWithImpl(_$VeilidWASMConfigImpl _value, - $Res Function(_$VeilidWASMConfigImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidWASMConfig - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? logging = null, - }) { - return _then(_$VeilidWASMConfigImpl( - logging: null == logging - ? _value.logging - : logging // ignore: cast_nullable_to_non_nullable - as VeilidWASMConfigLogging, - )); - } -} - /// @nodoc @JsonSerializable() -class _$VeilidWASMConfigImpl +class _VeilidWASMConfigLogging with DiagnosticableTreeMixin - implements _VeilidWASMConfig { - const _$VeilidWASMConfigImpl({required this.logging}); - - factory _$VeilidWASMConfigImpl.fromJson(Map json) => - _$$VeilidWASMConfigImplFromJson(json); + implements VeilidWASMConfigLogging { + const _VeilidWASMConfigLogging( + {required this.performance, required this.api}); + factory _VeilidWASMConfigLogging.fromJson(Map json) => + _$VeilidWASMConfigLoggingFromJson(json); @override - final VeilidWASMConfigLogging logging; + final VeilidWASMConfigLoggingPerformance performance; + @override + final VeilidWASMConfigLoggingApi api; + + /// Create a copy of VeilidWASMConfigLogging + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidWASMConfigLoggingCopyWith<_VeilidWASMConfigLogging> get copyWith => + __$VeilidWASMConfigLoggingCopyWithImpl<_VeilidWASMConfigLogging>( + this, _$identity); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidWASMConfig(logging: $logging)'; + Map toJson() { + return _$VeilidWASMConfigLoggingToJson( + this, + ); } @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidWASMConfigLogging')) + ..add(DiagnosticsProperty('performance', performance)) + ..add(DiagnosticsProperty('api', api)); + } + + @override + bool operator ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, performance, api); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidWASMConfigLogging(performance: $performance, api: $api)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidWASMConfigLoggingCopyWith<$Res> + implements $VeilidWASMConfigLoggingCopyWith<$Res> { + factory _$VeilidWASMConfigLoggingCopyWith(_VeilidWASMConfigLogging value, + $Res Function(_VeilidWASMConfigLogging) _then) = + __$VeilidWASMConfigLoggingCopyWithImpl; + @override + @useResult + $Res call( + {VeilidWASMConfigLoggingPerformance performance, + VeilidWASMConfigLoggingApi api}); + + @override + $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> get performance; + @override + $VeilidWASMConfigLoggingApiCopyWith<$Res> get api; +} + +/// @nodoc +class __$VeilidWASMConfigLoggingCopyWithImpl<$Res> + implements _$VeilidWASMConfigLoggingCopyWith<$Res> { + __$VeilidWASMConfigLoggingCopyWithImpl(this._self, this._then); + + final _VeilidWASMConfigLogging _self; + final $Res Function(_VeilidWASMConfigLogging) _then; + + /// Create a copy of VeilidWASMConfigLogging + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? performance = null, + Object? api = null, + }) { + return _then(_VeilidWASMConfigLogging( + performance: null == performance + ? _self.performance + : performance // ignore: cast_nullable_to_non_nullable + as VeilidWASMConfigLoggingPerformance, + api: null == api + ? _self.api + : api // ignore: cast_nullable_to_non_nullable + as VeilidWASMConfigLoggingApi, + )); + } + + /// Create a copy of VeilidWASMConfigLogging + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidWASMConfigLoggingPerformanceCopyWith<$Res> get performance { + return $VeilidWASMConfigLoggingPerformanceCopyWith<$Res>(_self.performance, + (value) { + return _then(_self.copyWith(performance: value)); + }); + } + + /// Create a copy of VeilidWASMConfigLogging + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidWASMConfigLoggingApiCopyWith<$Res> get api { + return $VeilidWASMConfigLoggingApiCopyWith<$Res>(_self.api, (value) { + return _then(_self.copyWith(api: value)); + }); + } +} + +/// @nodoc +mixin _$VeilidWASMConfig implements DiagnosticableTreeMixin { + VeilidWASMConfigLogging get logging; + + /// Create a copy of VeilidWASMConfig + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidWASMConfigCopyWith get copyWith => + _$VeilidWASMConfigCopyWithImpl( + this as VeilidWASMConfig, _$identity); + + /// Serializes this VeilidWASMConfig to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidWASMConfig')) ..add(DiagnosticsProperty('logging', logging)); @@ -2238,7 +2143,7 @@ class _$VeilidWASMConfigImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidWASMConfigImpl && + other is VeilidWASMConfig && (identical(other.logging, logging) || other.logging == logging)); } @@ -2246,194 +2151,177 @@ class _$VeilidWASMConfigImpl @override int get hashCode => Object.hash(runtimeType, logging); - /// Create a copy of VeilidWASMConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidWASMConfigImplCopyWith<_$VeilidWASMConfigImpl> get copyWith => - __$$VeilidWASMConfigImplCopyWithImpl<_$VeilidWASMConfigImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$VeilidWASMConfigImplToJson( - this, - ); - } -} - -abstract class _VeilidWASMConfig implements VeilidWASMConfig { - const factory _VeilidWASMConfig( - {required final VeilidWASMConfigLogging logging}) = - _$VeilidWASMConfigImpl; - - factory _VeilidWASMConfig.fromJson(Map json) = - _$VeilidWASMConfigImpl.fromJson; - - @override - VeilidWASMConfigLogging get logging; - - /// Create a copy of VeilidWASMConfig - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidWASMConfigImplCopyWith<_$VeilidWASMConfigImpl> 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; - - /// Serializes this VeilidConfigHTTPS to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigHTTPS - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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; - - /// Create a copy of VeilidConfigHTTPS - /// with the given fields replaced by the non-null parameter values. - @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); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidWASMConfig(logging: $logging)'; } } /// @nodoc -abstract class _$$VeilidConfigHTTPSImplCopyWith<$Res> - implements $VeilidConfigHTTPSCopyWith<$Res> { - factory _$$VeilidConfigHTTPSImplCopyWith(_$VeilidConfigHTTPSImpl value, - $Res Function(_$VeilidConfigHTTPSImpl) then) = - __$$VeilidConfigHTTPSImplCopyWithImpl<$Res>; - @override +abstract mixin class $VeilidWASMConfigCopyWith<$Res> { + factory $VeilidWASMConfigCopyWith( + VeilidWASMConfig value, $Res Function(VeilidWASMConfig) _then) = + _$VeilidWASMConfigCopyWithImpl; @useResult - $Res call({bool enabled, String listenAddress, String path, String? url}); + $Res call({VeilidWASMConfigLogging logging}); + + $VeilidWASMConfigLoggingCopyWith<$Res> get logging; } /// @nodoc -class __$$VeilidConfigHTTPSImplCopyWithImpl<$Res> - extends _$VeilidConfigHTTPSCopyWithImpl<$Res, _$VeilidConfigHTTPSImpl> - implements _$$VeilidConfigHTTPSImplCopyWith<$Res> { - __$$VeilidConfigHTTPSImplCopyWithImpl(_$VeilidConfigHTTPSImpl _value, - $Res Function(_$VeilidConfigHTTPSImpl) _then) - : super(_value, _then); +class _$VeilidWASMConfigCopyWithImpl<$Res> + implements $VeilidWASMConfigCopyWith<$Res> { + _$VeilidWASMConfigCopyWithImpl(this._self, this._then); - /// Create a copy of VeilidConfigHTTPS + final VeilidWASMConfig _self; + final $Res Function(VeilidWASMConfig) _then; + + /// Create a copy of VeilidWASMConfig /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? enabled = null, - Object? listenAddress = null, - Object? path = null, - Object? url = freezed, + Object? logging = null, }) { - return _then(_$VeilidConfigHTTPSImpl( - 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?, + return _then(_self.copyWith( + logging: null == logging + ? _self.logging + : logging // ignore: cast_nullable_to_non_nullable + as VeilidWASMConfigLogging, )); } + + /// Create a copy of VeilidWASMConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidWASMConfigLoggingCopyWith<$Res> get logging { + return $VeilidWASMConfigLoggingCopyWith<$Res>(_self.logging, (value) { + return _then(_self.copyWith(logging: value)); + }); + } } /// @nodoc @JsonSerializable() -class _$VeilidConfigHTTPSImpl +class _VeilidWASMConfig with DiagnosticableTreeMixin - implements _VeilidConfigHTTPS { - const _$VeilidConfigHTTPSImpl( - {required this.enabled, - required this.listenAddress, - required this.path, - this.url}); - - factory _$VeilidConfigHTTPSImpl.fromJson(Map json) => - _$$VeilidConfigHTTPSImplFromJson(json); + implements VeilidWASMConfig { + const _VeilidWASMConfig({required this.logging}); + factory _VeilidWASMConfig.fromJson(Map json) => + _$VeilidWASMConfigFromJson(json); @override - final bool enabled; + final VeilidWASMConfigLogging logging; + + /// Create a copy of VeilidWASMConfig + /// with the given fields replaced by the non-null parameter values. @override - final String listenAddress; - @override - final String path; - @override - final String? url; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidWASMConfigCopyWith<_VeilidWASMConfig> get copyWith => + __$VeilidWASMConfigCopyWithImpl<_VeilidWASMConfig>(this, _$identity); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidConfigHTTPS(enabled: $enabled, listenAddress: $listenAddress, path: $path, url: $url)'; + Map toJson() { + return _$VeilidWASMConfigToJson( + this, + ); } @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidWASMConfig')) + ..add(DiagnosticsProperty('logging', logging)); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _VeilidWASMConfig && + (identical(other.logging, logging) || other.logging == logging)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, logging); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidWASMConfig(logging: $logging)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidWASMConfigCopyWith<$Res> + implements $VeilidWASMConfigCopyWith<$Res> { + factory _$VeilidWASMConfigCopyWith( + _VeilidWASMConfig value, $Res Function(_VeilidWASMConfig) _then) = + __$VeilidWASMConfigCopyWithImpl; + @override + @useResult + $Res call({VeilidWASMConfigLogging logging}); + + @override + $VeilidWASMConfigLoggingCopyWith<$Res> get logging; +} + +/// @nodoc +class __$VeilidWASMConfigCopyWithImpl<$Res> + implements _$VeilidWASMConfigCopyWith<$Res> { + __$VeilidWASMConfigCopyWithImpl(this._self, this._then); + + final _VeilidWASMConfig _self; + final $Res Function(_VeilidWASMConfig) _then; + + /// Create a copy of VeilidWASMConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? logging = null, + }) { + return _then(_VeilidWASMConfig( + logging: null == logging + ? _self.logging + : logging // ignore: cast_nullable_to_non_nullable + as VeilidWASMConfigLogging, + )); + } + + /// Create a copy of VeilidWASMConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidWASMConfigLoggingCopyWith<$Res> get logging { + return $VeilidWASMConfigLoggingCopyWith<$Res>(_self.logging, (value) { + return _then(_self.copyWith(logging: value)); + }); + } +} + +/// @nodoc +mixin _$VeilidConfigHTTPS implements DiagnosticableTreeMixin { + bool get enabled; + String get listenAddress; + String get path; + String? get url; + + /// Create a copy of VeilidConfigHTTPS + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigHTTPSCopyWith get copyWith => + _$VeilidConfigHTTPSCopyWithImpl( + this as VeilidConfigHTTPS, _$identity); + + /// Serializes this VeilidConfigHTTPS to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidConfigHTTPS')) ..add(DiagnosticsProperty('enabled', enabled)) @@ -2446,7 +2334,7 @@ class _$VeilidConfigHTTPSImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigHTTPSImpl && + other is VeilidConfigHTTPS && (identical(other.enabled, enabled) || other.enabled == enabled) && (identical(other.listenAddress, listenAddress) || other.listenAddress == listenAddress) && @@ -2459,91 +2347,30 @@ class _$VeilidConfigHTTPSImpl int get hashCode => Object.hash(runtimeType, enabled, listenAddress, path, url); - /// Create a copy of VeilidConfigHTTPS - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigHTTPSImplCopyWith<_$VeilidConfigHTTPSImpl> get copyWith => - __$$VeilidConfigHTTPSImplCopyWithImpl<_$VeilidConfigHTTPSImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigHTTPSImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigHTTPS(enabled: $enabled, listenAddress: $listenAddress, path: $path, url: $url)'; } } -abstract class _VeilidConfigHTTPS implements VeilidConfigHTTPS { - const factory _VeilidConfigHTTPS( - {required final bool enabled, - required final String listenAddress, - required final String path, - final String? url}) = _$VeilidConfigHTTPSImpl; - - factory _VeilidConfigHTTPS.fromJson(Map json) = - _$VeilidConfigHTTPSImpl.fromJson; - - @override - bool get enabled; - @override - String get listenAddress; - @override - String get path; - @override - String? get url; - - /// Create a copy of VeilidConfigHTTPS - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigHTTPSImplCopyWith<_$VeilidConfigHTTPSImpl> 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; - - /// Serializes this VeilidConfigHTTP to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigHTTP - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $VeilidConfigHTTPCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VeilidConfigHTTPCopyWith<$Res> { - factory $VeilidConfigHTTPCopyWith( - VeilidConfigHTTP value, $Res Function(VeilidConfigHTTP) then) = - _$VeilidConfigHTTPCopyWithImpl<$Res, VeilidConfigHTTP>; +abstract mixin class $VeilidConfigHTTPSCopyWith<$Res> { + factory $VeilidConfigHTTPSCopyWith( + VeilidConfigHTTPS value, $Res Function(VeilidConfigHTTPS) _then) = + _$VeilidConfigHTTPSCopyWithImpl; @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); +class _$VeilidConfigHTTPSCopyWithImpl<$Res> + implements $VeilidConfigHTTPSCopyWith<$Res> { + _$VeilidConfigHTTPSCopyWithImpl(this._self, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final VeilidConfigHTTPS _self; + final $Res Function(VeilidConfigHTTPS) _then; - /// Create a copy of VeilidConfigHTTP + /// Create a copy of VeilidConfigHTTPS /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override @@ -2553,71 +2380,21 @@ class _$VeilidConfigHTTPCopyWithImpl<$Res, $Val extends VeilidConfigHTTP> Object? path = null, Object? url = freezed, }) { - return _then(_value.copyWith( + return _then(_self.copyWith( enabled: null == enabled - ? _value.enabled + ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable as bool, listenAddress: null == listenAddress - ? _value.listenAddress + ? _self.listenAddress : listenAddress // ignore: cast_nullable_to_non_nullable as String, path: null == path - ? _value.path + ? _self.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 _$$VeilidConfigHTTPImplCopyWith<$Res> - implements $VeilidConfigHTTPCopyWith<$Res> { - factory _$$VeilidConfigHTTPImplCopyWith(_$VeilidConfigHTTPImpl value, - $Res Function(_$VeilidConfigHTTPImpl) then) = - __$$VeilidConfigHTTPImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({bool enabled, String listenAddress, String path, String? url}); -} - -/// @nodoc -class __$$VeilidConfigHTTPImplCopyWithImpl<$Res> - extends _$VeilidConfigHTTPCopyWithImpl<$Res, _$VeilidConfigHTTPImpl> - implements _$$VeilidConfigHTTPImplCopyWith<$Res> { - __$$VeilidConfigHTTPImplCopyWithImpl(_$VeilidConfigHTTPImpl _value, - $Res Function(_$VeilidConfigHTTPImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidConfigHTTP - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? enabled = null, - Object? listenAddress = null, - Object? path = null, - Object? url = freezed, - }) { - return _then(_$VeilidConfigHTTPImpl( - 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 + ? _self.url : url // ignore: cast_nullable_to_non_nullable as String?, )); @@ -2626,17 +2403,16 @@ class __$$VeilidConfigHTTPImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$VeilidConfigHTTPImpl +class _VeilidConfigHTTPS with DiagnosticableTreeMixin - implements _VeilidConfigHTTP { - const _$VeilidConfigHTTPImpl( + implements VeilidConfigHTTPS { + const _VeilidConfigHTTPS( {required this.enabled, required this.listenAddress, required this.path, this.url}); - - factory _$VeilidConfigHTTPImpl.fromJson(Map json) => - _$$VeilidConfigHTTPImplFromJson(json); + factory _VeilidConfigHTTPS.fromJson(Map json) => + _$VeilidConfigHTTPSFromJson(json); @override final bool enabled; @@ -2647,14 +2423,124 @@ class _$VeilidConfigHTTPImpl @override final String? url; + /// Create a copy of VeilidConfigHTTPS + /// with the given fields replaced by the non-null parameter values. @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidConfigHTTP(enabled: $enabled, listenAddress: $listenAddress, path: $path, url: $url)'; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigHTTPSCopyWith<_VeilidConfigHTTPS> get copyWith => + __$VeilidConfigHTTPSCopyWithImpl<_VeilidConfigHTTPS>(this, _$identity); + + @override + Map toJson() { + return _$VeilidConfigHTTPSToJson( + this, + ); } @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 ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, enabled, listenAddress, path, url); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigHTTPS(enabled: $enabled, listenAddress: $listenAddress, path: $path, url: $url)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidConfigHTTPSCopyWith<$Res> + implements $VeilidConfigHTTPSCopyWith<$Res> { + factory _$VeilidConfigHTTPSCopyWith( + _VeilidConfigHTTPS value, $Res Function(_VeilidConfigHTTPS) _then) = + __$VeilidConfigHTTPSCopyWithImpl; + @override + @useResult + $Res call({bool enabled, String listenAddress, String path, String? url}); +} + +/// @nodoc +class __$VeilidConfigHTTPSCopyWithImpl<$Res> + implements _$VeilidConfigHTTPSCopyWith<$Res> { + __$VeilidConfigHTTPSCopyWithImpl(this._self, this._then); + + final _VeilidConfigHTTPS _self; + final $Res Function(_VeilidConfigHTTPS) _then; + + /// Create a copy of VeilidConfigHTTPS + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? enabled = null, + Object? listenAddress = null, + Object? path = null, + Object? url = freezed, + }) { + return _then(_VeilidConfigHTTPS( + enabled: null == enabled + ? _self.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + listenAddress: null == listenAddress + ? _self.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + path: null == path + ? _self.path + : path // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +mixin _$VeilidConfigHTTP implements DiagnosticableTreeMixin { + bool get enabled; + String get listenAddress; + String get path; + String? get url; + + /// Create a copy of VeilidConfigHTTP + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigHTTPCopyWith get copyWith => + _$VeilidConfigHTTPCopyWithImpl( + this as VeilidConfigHTTP, _$identity); + + /// Serializes this VeilidConfigHTTP to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidConfigHTTP')) ..add(DiagnosticsProperty('enabled', enabled)) @@ -2667,7 +2553,7 @@ class _$VeilidConfigHTTPImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigHTTPImpl && + other is VeilidConfigHTTP && (identical(other.enabled, enabled) || other.enabled == enabled) && (identical(other.listenAddress, listenAddress) || other.listenAddress == listenAddress) && @@ -2680,206 +2566,198 @@ class _$VeilidConfigHTTPImpl int get hashCode => Object.hash(runtimeType, enabled, listenAddress, path, url); - /// Create a copy of VeilidConfigHTTP - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigHTTPImplCopyWith<_$VeilidConfigHTTPImpl> get copyWith => - __$$VeilidConfigHTTPImplCopyWithImpl<_$VeilidConfigHTTPImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigHTTPImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigHTTP(enabled: $enabled, listenAddress: $listenAddress, path: $path, url: $url)'; } } -abstract class _VeilidConfigHTTP implements VeilidConfigHTTP { - const factory _VeilidConfigHTTP( - {required final bool enabled, - required final String listenAddress, - required final String path, - final String? url}) = _$VeilidConfigHTTPImpl; +/// @nodoc +abstract mixin class $VeilidConfigHTTPCopyWith<$Res> { + factory $VeilidConfigHTTPCopyWith( + VeilidConfigHTTP value, $Res Function(VeilidConfigHTTP) _then) = + _$VeilidConfigHTTPCopyWithImpl; + @useResult + $Res call({bool enabled, String listenAddress, String path, String? url}); +} - factory _VeilidConfigHTTP.fromJson(Map json) = - _$VeilidConfigHTTPImpl.fromJson; +/// @nodoc +class _$VeilidConfigHTTPCopyWithImpl<$Res> + implements $VeilidConfigHTTPCopyWith<$Res> { + _$VeilidConfigHTTPCopyWithImpl(this._self, this._then); - @override - bool get enabled; - @override - String get listenAddress; - @override - String get path; - @override - String? get url; + final VeilidConfigHTTP _self; + final $Res Function(VeilidConfigHTTP) _then; /// Create a copy of VeilidConfigHTTP /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigHTTPImplCopyWith<_$VeilidConfigHTTPImpl> 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; - - /// Serializes this VeilidConfigApplication to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigApplication - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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; - - /// Create a copy of VeilidConfigApplication - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? https = null, - Object? http = null, + Object? enabled = null, + Object? listenAddress = null, + Object? path = null, + Object? url = freezed, }) { - 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); - } - - /// Create a copy of VeilidConfigApplication - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidConfigHTTPSCopyWith<$Res> get https { - return $VeilidConfigHTTPSCopyWith<$Res>(_value.https, (value) { - return _then(_value.copyWith(https: value) as $Val); - }); - } - - /// Create a copy of VeilidConfigApplication - /// with the given fields replaced by the non-null parameter values. - @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 _$$VeilidConfigApplicationImplCopyWith<$Res> - implements $VeilidConfigApplicationCopyWith<$Res> { - factory _$$VeilidConfigApplicationImplCopyWith( - _$VeilidConfigApplicationImpl value, - $Res Function(_$VeilidConfigApplicationImpl) then) = - __$$VeilidConfigApplicationImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({VeilidConfigHTTPS https, VeilidConfigHTTP http}); - - @override - $VeilidConfigHTTPSCopyWith<$Res> get https; - @override - $VeilidConfigHTTPCopyWith<$Res> get http; -} - -/// @nodoc -class __$$VeilidConfigApplicationImplCopyWithImpl<$Res> - extends _$VeilidConfigApplicationCopyWithImpl<$Res, - _$VeilidConfigApplicationImpl> - implements _$$VeilidConfigApplicationImplCopyWith<$Res> { - __$$VeilidConfigApplicationImplCopyWithImpl( - _$VeilidConfigApplicationImpl _value, - $Res Function(_$VeilidConfigApplicationImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidConfigApplication - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? https = null, - Object? http = null, - }) { - return _then(_$VeilidConfigApplicationImpl( - 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, + return _then(_self.copyWith( + enabled: null == enabled + ? _self.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + listenAddress: null == listenAddress + ? _self.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + path: null == path + ? _self.path + : path // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, )); } } /// @nodoc @JsonSerializable() -class _$VeilidConfigApplicationImpl +class _VeilidConfigHTTP with DiagnosticableTreeMixin - implements _VeilidConfigApplication { - const _$VeilidConfigApplicationImpl( - {required this.https, required this.http}); - - factory _$VeilidConfigApplicationImpl.fromJson(Map json) => - _$$VeilidConfigApplicationImplFromJson(json); + implements VeilidConfigHTTP { + const _VeilidConfigHTTP( + {required this.enabled, + required this.listenAddress, + required this.path, + this.url}); + factory _VeilidConfigHTTP.fromJson(Map json) => + _$VeilidConfigHTTPFromJson(json); @override - final VeilidConfigHTTPS https; + final bool enabled; @override - final VeilidConfigHTTP http; + final String listenAddress; + @override + final String path; + @override + final String? url; + + /// Create a copy of VeilidConfigHTTP + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigHTTPCopyWith<_VeilidConfigHTTP> get copyWith => + __$VeilidConfigHTTPCopyWithImpl<_VeilidConfigHTTP>(this, _$identity); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidConfigApplication(https: $https, http: $http)'; + Map toJson() { + return _$VeilidConfigHTTPToJson( + this, + ); } @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 ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, enabled, listenAddress, path, url); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigHTTP(enabled: $enabled, listenAddress: $listenAddress, path: $path, url: $url)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidConfigHTTPCopyWith<$Res> + implements $VeilidConfigHTTPCopyWith<$Res> { + factory _$VeilidConfigHTTPCopyWith( + _VeilidConfigHTTP value, $Res Function(_VeilidConfigHTTP) _then) = + __$VeilidConfigHTTPCopyWithImpl; + @override + @useResult + $Res call({bool enabled, String listenAddress, String path, String? url}); +} + +/// @nodoc +class __$VeilidConfigHTTPCopyWithImpl<$Res> + implements _$VeilidConfigHTTPCopyWith<$Res> { + __$VeilidConfigHTTPCopyWithImpl(this._self, this._then); + + final _VeilidConfigHTTP _self; + final $Res Function(_VeilidConfigHTTP) _then; + + /// Create a copy of VeilidConfigHTTP + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? enabled = null, + Object? listenAddress = null, + Object? path = null, + Object? url = freezed, + }) { + return _then(_VeilidConfigHTTP( + enabled: null == enabled + ? _self.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + listenAddress: null == listenAddress + ? _self.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + path: null == path + ? _self.path + : path // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +mixin _$VeilidConfigApplication implements DiagnosticableTreeMixin { + VeilidConfigHTTPS get https; + VeilidConfigHTTP get http; + + /// Create a copy of VeilidConfigApplication + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigApplicationCopyWith get copyWith => + _$VeilidConfigApplicationCopyWithImpl( + this as VeilidConfigApplication, _$identity); + + /// Serializes this VeilidConfigApplication to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidConfigApplication')) ..add(DiagnosticsProperty('https', https)) @@ -2890,7 +2768,7 @@ class _$VeilidConfigApplicationImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigApplicationImpl && + other is VeilidConfigApplication && (identical(other.https, https) || other.https == https) && (identical(other.http, http) || other.http == http)); } @@ -2899,204 +2777,215 @@ class _$VeilidConfigApplicationImpl @override int get hashCode => Object.hash(runtimeType, https, http); - /// Create a copy of VeilidConfigApplication - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigApplicationImplCopyWith<_$VeilidConfigApplicationImpl> - get copyWith => __$$VeilidConfigApplicationImplCopyWithImpl< - _$VeilidConfigApplicationImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigApplicationImplToJson( - this, - ); - } -} - -abstract class _VeilidConfigApplication implements VeilidConfigApplication { - const factory _VeilidConfigApplication( - {required final VeilidConfigHTTPS https, - required final VeilidConfigHTTP http}) = _$VeilidConfigApplicationImpl; - - factory _VeilidConfigApplication.fromJson(Map json) = - _$VeilidConfigApplicationImpl.fromJson; - - @override - VeilidConfigHTTPS get https; - @override - VeilidConfigHTTP get http; - - /// Create a copy of VeilidConfigApplication - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigApplicationImplCopyWith<_$VeilidConfigApplicationImpl> - 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; - - /// Serializes this VeilidConfigUDP to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigUDP - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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; - - /// Create a copy of VeilidConfigUDP - /// with the given fields replaced by the non-null parameter values. - @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); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigApplication(https: $https, http: $http)'; } } /// @nodoc -abstract class _$$VeilidConfigUDPImplCopyWith<$Res> - implements $VeilidConfigUDPCopyWith<$Res> { - factory _$$VeilidConfigUDPImplCopyWith(_$VeilidConfigUDPImpl value, - $Res Function(_$VeilidConfigUDPImpl) then) = - __$$VeilidConfigUDPImplCopyWithImpl<$Res>; - @override +abstract mixin class $VeilidConfigApplicationCopyWith<$Res> { + factory $VeilidConfigApplicationCopyWith(VeilidConfigApplication value, + $Res Function(VeilidConfigApplication) _then) = + _$VeilidConfigApplicationCopyWithImpl; @useResult - $Res call( - {bool enabled, - int socketPoolSize, - String listenAddress, - String? publicAddress}); + $Res call({VeilidConfigHTTPS https, VeilidConfigHTTP http}); + + $VeilidConfigHTTPSCopyWith<$Res> get https; + $VeilidConfigHTTPCopyWith<$Res> get http; } /// @nodoc -class __$$VeilidConfigUDPImplCopyWithImpl<$Res> - extends _$VeilidConfigUDPCopyWithImpl<$Res, _$VeilidConfigUDPImpl> - implements _$$VeilidConfigUDPImplCopyWith<$Res> { - __$$VeilidConfigUDPImplCopyWithImpl( - _$VeilidConfigUDPImpl _value, $Res Function(_$VeilidConfigUDPImpl) _then) - : super(_value, _then); +class _$VeilidConfigApplicationCopyWithImpl<$Res> + implements $VeilidConfigApplicationCopyWith<$Res> { + _$VeilidConfigApplicationCopyWithImpl(this._self, this._then); - /// Create a copy of VeilidConfigUDP + final VeilidConfigApplication _self; + final $Res Function(VeilidConfigApplication) _then; + + /// Create a copy of VeilidConfigApplication /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? enabled = null, - Object? socketPoolSize = null, - Object? listenAddress = null, - Object? publicAddress = freezed, + Object? https = null, + Object? http = null, }) { - return _then(_$VeilidConfigUDPImpl( - 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?, + return _then(_self.copyWith( + https: null == https + ? _self.https + : https // ignore: cast_nullable_to_non_nullable + as VeilidConfigHTTPS, + http: null == http + ? _self.http + : http // ignore: cast_nullable_to_non_nullable + as VeilidConfigHTTP, )); } + + /// Create a copy of VeilidConfigApplication + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigHTTPSCopyWith<$Res> get https { + return $VeilidConfigHTTPSCopyWith<$Res>(_self.https, (value) { + return _then(_self.copyWith(https: value)); + }); + } + + /// Create a copy of VeilidConfigApplication + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigHTTPCopyWith<$Res> get http { + return $VeilidConfigHTTPCopyWith<$Res>(_self.http, (value) { + return _then(_self.copyWith(http: value)); + }); + } } /// @nodoc @JsonSerializable() -class _$VeilidConfigUDPImpl +class _VeilidConfigApplication with DiagnosticableTreeMixin - implements _VeilidConfigUDP { - const _$VeilidConfigUDPImpl( - {required this.enabled, - required this.socketPoolSize, - required this.listenAddress, - this.publicAddress}); - - factory _$VeilidConfigUDPImpl.fromJson(Map json) => - _$$VeilidConfigUDPImplFromJson(json); + implements VeilidConfigApplication { + const _VeilidConfigApplication({required this.https, required this.http}); + factory _VeilidConfigApplication.fromJson(Map json) => + _$VeilidConfigApplicationFromJson(json); @override - final bool enabled; + final VeilidConfigHTTPS https; @override - final int socketPoolSize; + final VeilidConfigHTTP http; + + /// Create a copy of VeilidConfigApplication + /// with the given fields replaced by the non-null parameter values. @override - final String listenAddress; - @override - final String? publicAddress; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigApplicationCopyWith<_VeilidConfigApplication> get copyWith => + __$VeilidConfigApplicationCopyWithImpl<_VeilidConfigApplication>( + this, _$identity); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidConfigUDP(enabled: $enabled, socketPoolSize: $socketPoolSize, listenAddress: $listenAddress, publicAddress: $publicAddress)'; + Map toJson() { + return _$VeilidConfigApplicationToJson( + this, + ); } @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigApplication')) + ..add(DiagnosticsProperty('https', https)) + ..add(DiagnosticsProperty('http', http)); + } + + @override + bool operator ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, https, http); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigApplication(https: $https, http: $http)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidConfigApplicationCopyWith<$Res> + implements $VeilidConfigApplicationCopyWith<$Res> { + factory _$VeilidConfigApplicationCopyWith(_VeilidConfigApplication value, + $Res Function(_VeilidConfigApplication) _then) = + __$VeilidConfigApplicationCopyWithImpl; + @override + @useResult + $Res call({VeilidConfigHTTPS https, VeilidConfigHTTP http}); + + @override + $VeilidConfigHTTPSCopyWith<$Res> get https; + @override + $VeilidConfigHTTPCopyWith<$Res> get http; +} + +/// @nodoc +class __$VeilidConfigApplicationCopyWithImpl<$Res> + implements _$VeilidConfigApplicationCopyWith<$Res> { + __$VeilidConfigApplicationCopyWithImpl(this._self, this._then); + + final _VeilidConfigApplication _self; + final $Res Function(_VeilidConfigApplication) _then; + + /// Create a copy of VeilidConfigApplication + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? https = null, + Object? http = null, + }) { + return _then(_VeilidConfigApplication( + https: null == https + ? _self.https + : https // ignore: cast_nullable_to_non_nullable + as VeilidConfigHTTPS, + http: null == http + ? _self.http + : http // ignore: cast_nullable_to_non_nullable + as VeilidConfigHTTP, + )); + } + + /// Create a copy of VeilidConfigApplication + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigHTTPSCopyWith<$Res> get https { + return $VeilidConfigHTTPSCopyWith<$Res>(_self.https, (value) { + return _then(_self.copyWith(https: value)); + }); + } + + /// Create a copy of VeilidConfigApplication + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigHTTPCopyWith<$Res> get http { + return $VeilidConfigHTTPCopyWith<$Res>(_self.http, (value) { + return _then(_self.copyWith(http: value)); + }); + } +} + +/// @nodoc +mixin _$VeilidConfigUDP implements DiagnosticableTreeMixin { + bool get enabled; + int get socketPoolSize; + String get listenAddress; + String? get publicAddress; + + /// Create a copy of VeilidConfigUDP + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigUDPCopyWith get copyWith => + _$VeilidConfigUDPCopyWithImpl( + this as VeilidConfigUDP, _$identity); + + /// Serializes this VeilidConfigUDP to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidConfigUDP')) ..add(DiagnosticsProperty('enabled', enabled)) @@ -3109,7 +2998,7 @@ class _$VeilidConfigUDPImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigUDPImpl && + other is VeilidConfigUDP && (identical(other.enabled, enabled) || other.enabled == enabled) && (identical(other.socketPoolSize, socketPoolSize) || other.socketPoolSize == socketPoolSize) && @@ -3124,186 +3013,58 @@ class _$VeilidConfigUDPImpl int get hashCode => Object.hash( runtimeType, enabled, socketPoolSize, listenAddress, publicAddress); - /// Create a copy of VeilidConfigUDP - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigUDPImplCopyWith<_$VeilidConfigUDPImpl> get copyWith => - __$$VeilidConfigUDPImplCopyWithImpl<_$VeilidConfigUDPImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigUDPImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigUDP(enabled: $enabled, socketPoolSize: $socketPoolSize, listenAddress: $listenAddress, publicAddress: $publicAddress)'; } } -abstract class _VeilidConfigUDP implements VeilidConfigUDP { - const factory _VeilidConfigUDP( - {required final bool enabled, - required final int socketPoolSize, - required final String listenAddress, - final String? publicAddress}) = _$VeilidConfigUDPImpl; - - factory _VeilidConfigUDP.fromJson(Map json) = - _$VeilidConfigUDPImpl.fromJson; - - @override - bool get enabled; - @override - int get socketPoolSize; - @override - String get listenAddress; - @override - String? get publicAddress; - - /// Create a copy of VeilidConfigUDP - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigUDPImplCopyWith<_$VeilidConfigUDPImpl> 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; - - /// Serializes this VeilidConfigTCP to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigTCP - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $VeilidConfigTCPCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VeilidConfigTCPCopyWith<$Res> { - factory $VeilidConfigTCPCopyWith( - VeilidConfigTCP value, $Res Function(VeilidConfigTCP) then) = - _$VeilidConfigTCPCopyWithImpl<$Res, VeilidConfigTCP>; +abstract mixin class $VeilidConfigUDPCopyWith<$Res> { + factory $VeilidConfigUDPCopyWith( + VeilidConfigUDP value, $Res Function(VeilidConfigUDP) _then) = + _$VeilidConfigUDPCopyWithImpl; @useResult $Res call( - {bool connect, - bool listen, - int maxConnections, + {bool enabled, + int socketPoolSize, String listenAddress, String? publicAddress}); } /// @nodoc -class _$VeilidConfigTCPCopyWithImpl<$Res, $Val extends VeilidConfigTCP> - implements $VeilidConfigTCPCopyWith<$Res> { - _$VeilidConfigTCPCopyWithImpl(this._value, this._then); +class _$VeilidConfigUDPCopyWithImpl<$Res> + implements $VeilidConfigUDPCopyWith<$Res> { + _$VeilidConfigUDPCopyWithImpl(this._self, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final VeilidConfigUDP _self; + final $Res Function(VeilidConfigUDP) _then; - /// Create a copy of VeilidConfigTCP + /// Create a copy of VeilidConfigUDP /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? connect = null, - Object? listen = null, - Object? maxConnections = null, + Object? enabled = null, + Object? socketPoolSize = null, Object? listenAddress = null, Object? publicAddress = freezed, }) { - return _then(_value.copyWith( - connect: null == connect - ? _value.connect - : connect // ignore: cast_nullable_to_non_nullable + return _then(_self.copyWith( + enabled: null == enabled + ? _self.enabled + : enabled // 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 + socketPoolSize: null == socketPoolSize + ? _self.socketPoolSize + : socketPoolSize // ignore: cast_nullable_to_non_nullable as int, listenAddress: null == listenAddress - ? _value.listenAddress + ? _self.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 _$$VeilidConfigTCPImplCopyWith<$Res> - implements $VeilidConfigTCPCopyWith<$Res> { - factory _$$VeilidConfigTCPImplCopyWith(_$VeilidConfigTCPImpl value, - $Res Function(_$VeilidConfigTCPImpl) then) = - __$$VeilidConfigTCPImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool connect, - bool listen, - int maxConnections, - String listenAddress, - String? publicAddress}); -} - -/// @nodoc -class __$$VeilidConfigTCPImplCopyWithImpl<$Res> - extends _$VeilidConfigTCPCopyWithImpl<$Res, _$VeilidConfigTCPImpl> - implements _$$VeilidConfigTCPImplCopyWith<$Res> { - __$$VeilidConfigTCPImplCopyWithImpl( - _$VeilidConfigTCPImpl _value, $Res Function(_$VeilidConfigTCPImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidConfigTCP - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? connect = null, - Object? listen = null, - Object? maxConnections = null, - Object? listenAddress = null, - Object? publicAddress = freezed, - }) { - return _then(_$VeilidConfigTCPImpl( - 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 + ? _self.publicAddress : publicAddress // ignore: cast_nullable_to_non_nullable as String?, )); @@ -3312,38 +3073,149 @@ class __$$VeilidConfigTCPImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$VeilidConfigTCPImpl - with DiagnosticableTreeMixin - implements _VeilidConfigTCP { - const _$VeilidConfigTCPImpl( - {required this.connect, - required this.listen, - required this.maxConnections, +class _VeilidConfigUDP with DiagnosticableTreeMixin implements VeilidConfigUDP { + const _VeilidConfigUDP( + {required this.enabled, + required this.socketPoolSize, required this.listenAddress, this.publicAddress}); - - factory _$VeilidConfigTCPImpl.fromJson(Map json) => - _$$VeilidConfigTCPImplFromJson(json); + factory _VeilidConfigUDP.fromJson(Map json) => + _$VeilidConfigUDPFromJson(json); @override - final bool connect; + final bool enabled; @override - final bool listen; - @override - final int maxConnections; + final int socketPoolSize; @override final String listenAddress; @override final String? publicAddress; + /// Create a copy of VeilidConfigUDP + /// with the given fields replaced by the non-null parameter values. @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidConfigTCP(connect: $connect, listen: $listen, maxConnections: $maxConnections, listenAddress: $listenAddress, publicAddress: $publicAddress)'; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigUDPCopyWith<_VeilidConfigUDP> get copyWith => + __$VeilidConfigUDPCopyWithImpl<_VeilidConfigUDP>(this, _$identity); + + @override + Map toJson() { + return _$VeilidConfigUDPToJson( + this, + ); } @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 ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, enabled, socketPoolSize, listenAddress, publicAddress); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigUDP(enabled: $enabled, socketPoolSize: $socketPoolSize, listenAddress: $listenAddress, publicAddress: $publicAddress)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidConfigUDPCopyWith<$Res> + implements $VeilidConfigUDPCopyWith<$Res> { + factory _$VeilidConfigUDPCopyWith( + _VeilidConfigUDP value, $Res Function(_VeilidConfigUDP) _then) = + __$VeilidConfigUDPCopyWithImpl; + @override + @useResult + $Res call( + {bool enabled, + int socketPoolSize, + String listenAddress, + String? publicAddress}); +} + +/// @nodoc +class __$VeilidConfigUDPCopyWithImpl<$Res> + implements _$VeilidConfigUDPCopyWith<$Res> { + __$VeilidConfigUDPCopyWithImpl(this._self, this._then); + + final _VeilidConfigUDP _self; + final $Res Function(_VeilidConfigUDP) _then; + + /// Create a copy of VeilidConfigUDP + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? enabled = null, + Object? socketPoolSize = null, + Object? listenAddress = null, + Object? publicAddress = freezed, + }) { + return _then(_VeilidConfigUDP( + enabled: null == enabled + ? _self.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool, + socketPoolSize: null == socketPoolSize + ? _self.socketPoolSize + : socketPoolSize // ignore: cast_nullable_to_non_nullable + as int, + listenAddress: null == listenAddress + ? _self.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + publicAddress: freezed == publicAddress + ? _self.publicAddress + : publicAddress // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +mixin _$VeilidConfigTCP implements DiagnosticableTreeMixin { + bool get connect; + bool get listen; + int get maxConnections; + String get listenAddress; + String? get publicAddress; + + /// Create a copy of VeilidConfigTCP + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigTCPCopyWith get copyWith => + _$VeilidConfigTCPCopyWithImpl( + this as VeilidConfigTCP, _$identity); + + /// Serializes this VeilidConfigTCP to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidConfigTCP')) ..add(DiagnosticsProperty('connect', connect)) @@ -3357,7 +3229,7 @@ class _$VeilidConfigTCPImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigTCPImpl && + other is VeilidConfigTCP && (identical(other.connect, connect) || other.connect == connect) && (identical(other.listen, listen) || other.listen == listen) && (identical(other.maxConnections, maxConnections) || @@ -3373,102 +3245,35 @@ class _$VeilidConfigTCPImpl int get hashCode => Object.hash(runtimeType, connect, listen, maxConnections, listenAddress, publicAddress); - /// Create a copy of VeilidConfigTCP - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigTCPImplCopyWith<_$VeilidConfigTCPImpl> get copyWith => - __$$VeilidConfigTCPImplCopyWithImpl<_$VeilidConfigTCPImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigTCPImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigTCP(connect: $connect, listen: $listen, maxConnections: $maxConnections, listenAddress: $listenAddress, publicAddress: $publicAddress)'; } } -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}) = _$VeilidConfigTCPImpl; - - factory _VeilidConfigTCP.fromJson(Map json) = - _$VeilidConfigTCPImpl.fromJson; - - @override - bool get connect; - @override - bool get listen; - @override - int get maxConnections; - @override - String get listenAddress; - @override - String? get publicAddress; - - /// Create a copy of VeilidConfigTCP - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigTCPImplCopyWith<_$VeilidConfigTCPImpl> 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; - - /// Serializes this VeilidConfigWS to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigWS - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $VeilidConfigWSCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VeilidConfigWSCopyWith<$Res> { - factory $VeilidConfigWSCopyWith( - VeilidConfigWS value, $Res Function(VeilidConfigWS) then) = - _$VeilidConfigWSCopyWithImpl<$Res, VeilidConfigWS>; +abstract mixin class $VeilidConfigTCPCopyWith<$Res> { + factory $VeilidConfigTCPCopyWith( + VeilidConfigTCP value, $Res Function(VeilidConfigTCP) _then) = + _$VeilidConfigTCPCopyWithImpl; @useResult $Res call( {bool connect, bool listen, int maxConnections, String listenAddress, - String path, - String? url}); + String? publicAddress}); } /// @nodoc -class _$VeilidConfigWSCopyWithImpl<$Res, $Val extends VeilidConfigWS> - implements $VeilidConfigWSCopyWith<$Res> { - _$VeilidConfigWSCopyWithImpl(this._value, this._then); +class _$VeilidConfigTCPCopyWithImpl<$Res> + implements $VeilidConfigTCPCopyWith<$Res> { + _$VeilidConfigTCPCopyWithImpl(this._self, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final VeilidConfigTCP _self; + final $Res Function(VeilidConfigTCP) _then; - /// Create a copy of VeilidConfigWS + /// Create a copy of VeilidConfigTCP /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override @@ -3477,99 +3282,28 @@ class _$VeilidConfigWSCopyWithImpl<$Res, $Val extends VeilidConfigWS> Object? listen = null, Object? maxConnections = null, Object? listenAddress = null, - Object? path = null, - Object? url = freezed, + Object? publicAddress = freezed, }) { - return _then(_value.copyWith( + return _then(_self.copyWith( connect: null == connect - ? _value.connect + ? _self.connect : connect // ignore: cast_nullable_to_non_nullable as bool, listen: null == listen - ? _value.listen + ? _self.listen : listen // ignore: cast_nullable_to_non_nullable as bool, maxConnections: null == maxConnections - ? _value.maxConnections + ? _self.maxConnections : maxConnections // ignore: cast_nullable_to_non_nullable as int, listenAddress: null == listenAddress - ? _value.listenAddress + ? _self.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 _$$VeilidConfigWSImplCopyWith<$Res> - implements $VeilidConfigWSCopyWith<$Res> { - factory _$$VeilidConfigWSImplCopyWith(_$VeilidConfigWSImpl value, - $Res Function(_$VeilidConfigWSImpl) then) = - __$$VeilidConfigWSImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool connect, - bool listen, - int maxConnections, - String listenAddress, - String path, - String? url}); -} - -/// @nodoc -class __$$VeilidConfigWSImplCopyWithImpl<$Res> - extends _$VeilidConfigWSCopyWithImpl<$Res, _$VeilidConfigWSImpl> - implements _$$VeilidConfigWSImplCopyWith<$Res> { - __$$VeilidConfigWSImplCopyWithImpl( - _$VeilidConfigWSImpl _value, $Res Function(_$VeilidConfigWSImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidConfigWS - /// with the given fields replaced by the non-null parameter values. - @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(_$VeilidConfigWSImpl( - 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 + publicAddress: freezed == publicAddress + ? _self.publicAddress + : publicAddress // ignore: cast_nullable_to_non_nullable as String?, )); } @@ -3577,19 +3311,15 @@ class __$$VeilidConfigWSImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$VeilidConfigWSImpl - with DiagnosticableTreeMixin - implements _VeilidConfigWS { - const _$VeilidConfigWSImpl( +class _VeilidConfigTCP with DiagnosticableTreeMixin implements VeilidConfigTCP { + const _VeilidConfigTCP( {required this.connect, required this.listen, required this.maxConnections, required this.listenAddress, - required this.path, - this.url}); - - factory _$VeilidConfigWSImpl.fromJson(Map json) => - _$$VeilidConfigWSImplFromJson(json); + this.publicAddress}); + factory _VeilidConfigTCP.fromJson(Map json) => + _$VeilidConfigTCPFromJson(json); @override final bool connect; @@ -3600,18 +3330,142 @@ class _$VeilidConfigWSImpl @override final String listenAddress; @override - final String path; + final String? publicAddress; + + /// Create a copy of VeilidConfigTCP + /// with the given fields replaced by the non-null parameter values. @override - final String? url; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigTCPCopyWith<_VeilidConfigTCP> get copyWith => + __$VeilidConfigTCPCopyWithImpl<_VeilidConfigTCP>(this, _$identity); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidConfigWS(connect: $connect, listen: $listen, maxConnections: $maxConnections, listenAddress: $listenAddress, path: $path, url: $url)'; + Map toJson() { + return _$VeilidConfigTCPToJson( + this, + ); } @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 ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, connect, listen, maxConnections, + listenAddress, publicAddress); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigTCP(connect: $connect, listen: $listen, maxConnections: $maxConnections, listenAddress: $listenAddress, publicAddress: $publicAddress)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidConfigTCPCopyWith<$Res> + implements $VeilidConfigTCPCopyWith<$Res> { + factory _$VeilidConfigTCPCopyWith( + _VeilidConfigTCP value, $Res Function(_VeilidConfigTCP) _then) = + __$VeilidConfigTCPCopyWithImpl; + @override + @useResult + $Res call( + {bool connect, + bool listen, + int maxConnections, + String listenAddress, + String? publicAddress}); +} + +/// @nodoc +class __$VeilidConfigTCPCopyWithImpl<$Res> + implements _$VeilidConfigTCPCopyWith<$Res> { + __$VeilidConfigTCPCopyWithImpl(this._self, this._then); + + final _VeilidConfigTCP _self; + final $Res Function(_VeilidConfigTCP) _then; + + /// Create a copy of VeilidConfigTCP + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? connect = null, + Object? listen = null, + Object? maxConnections = null, + Object? listenAddress = null, + Object? publicAddress = freezed, + }) { + return _then(_VeilidConfigTCP( + connect: null == connect + ? _self.connect + : connect // ignore: cast_nullable_to_non_nullable + as bool, + listen: null == listen + ? _self.listen + : listen // ignore: cast_nullable_to_non_nullable + as bool, + maxConnections: null == maxConnections + ? _self.maxConnections + : maxConnections // ignore: cast_nullable_to_non_nullable + as int, + listenAddress: null == listenAddress + ? _self.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + publicAddress: freezed == publicAddress + ? _self.publicAddress + : publicAddress // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +mixin _$VeilidConfigWS implements DiagnosticableTreeMixin { + bool get connect; + bool get listen; + int get maxConnections; + String get listenAddress; + String get path; + String? get url; + + /// Create a copy of VeilidConfigWS + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigWSCopyWith get copyWith => + _$VeilidConfigWSCopyWithImpl( + this as VeilidConfigWS, _$identity); + + /// Serializes this VeilidConfigWS to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidConfigWS')) ..add(DiagnosticsProperty('connect', connect)) @@ -3626,7 +3480,7 @@ class _$VeilidConfigWSImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigWSImpl && + other is VeilidConfigWS && (identical(other.connect, connect) || other.connect == connect) && (identical(other.listen, listen) || other.listen == listen) && (identical(other.maxConnections, maxConnections) || @@ -3642,84 +3496,17 @@ class _$VeilidConfigWSImpl int get hashCode => Object.hash( runtimeType, connect, listen, maxConnections, listenAddress, path, url); - /// Create a copy of VeilidConfigWS - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigWSImplCopyWith<_$VeilidConfigWSImpl> get copyWith => - __$$VeilidConfigWSImplCopyWithImpl<_$VeilidConfigWSImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigWSImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigWS(connect: $connect, listen: $listen, maxConnections: $maxConnections, listenAddress: $listenAddress, path: $path, url: $url)'; } } -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}) = _$VeilidConfigWSImpl; - - factory _VeilidConfigWS.fromJson(Map json) = - _$VeilidConfigWSImpl.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; - - /// Create a copy of VeilidConfigWS - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigWSImplCopyWith<_$VeilidConfigWSImpl> 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; - - /// Serializes this VeilidConfigWSS to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigWSS - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $VeilidConfigWSSCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VeilidConfigWSSCopyWith<$Res> { - factory $VeilidConfigWSSCopyWith( - VeilidConfigWSS value, $Res Function(VeilidConfigWSS) then) = - _$VeilidConfigWSSCopyWithImpl<$Res, VeilidConfigWSS>; +abstract mixin class $VeilidConfigWSCopyWith<$Res> { + factory $VeilidConfigWSCopyWith( + VeilidConfigWS value, $Res Function(VeilidConfigWS) _then) = + _$VeilidConfigWSCopyWithImpl; @useResult $Res call( {bool connect, @@ -3731,16 +3518,14 @@ abstract class $VeilidConfigWSSCopyWith<$Res> { } /// @nodoc -class _$VeilidConfigWSSCopyWithImpl<$Res, $Val extends VeilidConfigWSS> - implements $VeilidConfigWSSCopyWith<$Res> { - _$VeilidConfigWSSCopyWithImpl(this._value, this._then); +class _$VeilidConfigWSCopyWithImpl<$Res> + implements $VeilidConfigWSCopyWith<$Res> { + _$VeilidConfigWSCopyWithImpl(this._self, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final VeilidConfigWS _self; + final $Res Function(VeilidConfigWS) _then; - /// Create a copy of VeilidConfigWSS + /// Create a copy of VeilidConfigWS /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override @@ -3752,95 +3537,29 @@ class _$VeilidConfigWSSCopyWithImpl<$Res, $Val extends VeilidConfigWSS> Object? path = null, Object? url = freezed, }) { - return _then(_value.copyWith( + return _then(_self.copyWith( connect: null == connect - ? _value.connect + ? _self.connect : connect // ignore: cast_nullable_to_non_nullable as bool, listen: null == listen - ? _value.listen + ? _self.listen : listen // ignore: cast_nullable_to_non_nullable as bool, maxConnections: null == maxConnections - ? _value.maxConnections + ? _self.maxConnections : maxConnections // ignore: cast_nullable_to_non_nullable as int, listenAddress: null == listenAddress - ? _value.listenAddress + ? _self.listenAddress : listenAddress // ignore: cast_nullable_to_non_nullable as String, path: null == path - ? _value.path + ? _self.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 _$$VeilidConfigWSSImplCopyWith<$Res> - implements $VeilidConfigWSSCopyWith<$Res> { - factory _$$VeilidConfigWSSImplCopyWith(_$VeilidConfigWSSImpl value, - $Res Function(_$VeilidConfigWSSImpl) then) = - __$$VeilidConfigWSSImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool connect, - bool listen, - int maxConnections, - String listenAddress, - String path, - String? url}); -} - -/// @nodoc -class __$$VeilidConfigWSSImplCopyWithImpl<$Res> - extends _$VeilidConfigWSSCopyWithImpl<$Res, _$VeilidConfigWSSImpl> - implements _$$VeilidConfigWSSImplCopyWith<$Res> { - __$$VeilidConfigWSSImplCopyWithImpl( - _$VeilidConfigWSSImpl _value, $Res Function(_$VeilidConfigWSSImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidConfigWSS - /// with the given fields replaced by the non-null parameter values. - @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(_$VeilidConfigWSSImpl( - 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 + ? _self.url : url // ignore: cast_nullable_to_non_nullable as String?, )); @@ -3849,19 +3568,16 @@ class __$$VeilidConfigWSSImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$VeilidConfigWSSImpl - with DiagnosticableTreeMixin - implements _VeilidConfigWSS { - const _$VeilidConfigWSSImpl( +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 _$VeilidConfigWSSImpl.fromJson(Map json) => - _$$VeilidConfigWSSImplFromJson(json); + factory _VeilidConfigWS.fromJson(Map json) => + _$VeilidConfigWSFromJson(json); @override final bool connect; @@ -3876,16 +3592,25 @@ class _$VeilidConfigWSSImpl @override final String? url; + /// Create a copy of VeilidConfigWS + /// with the given fields replaced by the non-null parameter values. @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidConfigWSS(connect: $connect, listen: $listen, maxConnections: $maxConnections, listenAddress: $listenAddress, path: $path, url: $url)'; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigWSCopyWith<_VeilidConfigWS> get copyWith => + __$VeilidConfigWSCopyWithImpl<_VeilidConfigWS>(this, _$identity); + + @override + Map toJson() { + return _$VeilidConfigWSToJson( + this, + ); } @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); properties - ..add(DiagnosticsProperty('type', 'VeilidConfigWSS')) + ..add(DiagnosticsProperty('type', 'VeilidConfigWS')) ..add(DiagnosticsProperty('connect', connect)) ..add(DiagnosticsProperty('listen', listen)) ..add(DiagnosticsProperty('maxConnections', maxConnections)) @@ -3898,7 +3623,7 @@ class _$VeilidConfigWSSImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigWSSImpl && + other is _VeilidConfigWS && (identical(other.connect, connect) || other.connect == connect) && (identical(other.listen, listen) || other.listen == listen) && (identical(other.maxConnections, maxConnections) || @@ -3914,271 +3639,365 @@ class _$VeilidConfigWSSImpl int get hashCode => Object.hash( runtimeType, connect, listen, maxConnections, listenAddress, path, url); - /// Create a copy of VeilidConfigWSS - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigWSSImplCopyWith<_$VeilidConfigWSSImpl> get copyWith => - __$$VeilidConfigWSSImplCopyWithImpl<_$VeilidConfigWSSImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigWSSImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigWS(connect: $connect, listen: $listen, maxConnections: $maxConnections, listenAddress: $listenAddress, path: $path, url: $url)'; } } -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}) = _$VeilidConfigWSSImpl; - - factory _VeilidConfigWSS.fromJson(Map json) = - _$VeilidConfigWSSImpl.fromJson; - +/// @nodoc +abstract mixin class _$VeilidConfigWSCopyWith<$Res> + implements $VeilidConfigWSCopyWith<$Res> { + factory _$VeilidConfigWSCopyWith( + _VeilidConfigWS value, $Res Function(_VeilidConfigWS) _then) = + __$VeilidConfigWSCopyWithImpl; @override + @useResult + $Res call( + {bool connect, + bool listen, + int maxConnections, + String listenAddress, + String path, + String? url}); +} + +/// @nodoc +class __$VeilidConfigWSCopyWithImpl<$Res> + implements _$VeilidConfigWSCopyWith<$Res> { + __$VeilidConfigWSCopyWithImpl(this._self, this._then); + + final _VeilidConfigWS _self; + final $Res Function(_VeilidConfigWS) _then; + + /// Create a copy of VeilidConfigWS + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $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 + ? _self.connect + : connect // ignore: cast_nullable_to_non_nullable + as bool, + listen: null == listen + ? _self.listen + : listen // ignore: cast_nullable_to_non_nullable + as bool, + maxConnections: null == maxConnections + ? _self.maxConnections + : maxConnections // ignore: cast_nullable_to_non_nullable + as int, + listenAddress: null == listenAddress + ? _self.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + path: null == path + ? _self.path + : path // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +mixin _$VeilidConfigWSS implements DiagnosticableTreeMixin { bool get connect; - @override bool get listen; - @override int get maxConnections; - @override String get listenAddress; - @override String get path; - @override String? get url; /// Create a copy of VeilidConfigWSS /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigWSSCopyWith get copyWith => + _$VeilidConfigWSSCopyWithImpl( + this as VeilidConfigWSS, _$identity); + + /// Serializes this VeilidConfigWSS to a JSON map. + Map toJson(); + @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigWSSImplCopyWith<_$VeilidConfigWSSImpl> get copyWith => - throw _privateConstructorUsedError; -} + void debugFillProperties(DiagnosticPropertiesBuilder 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)); + } -VeilidConfigProtocol _$VeilidConfigProtocolFromJson(Map json) { - return _VeilidConfigProtocol.fromJson(json); + @override + bool operator ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, connect, listen, maxConnections, listenAddress, path, url); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigWSS(connect: $connect, listen: $listen, maxConnections: $maxConnections, listenAddress: $listenAddress, path: $path, url: $url)'; + } } /// @nodoc -mixin _$VeilidConfigProtocol { - VeilidConfigUDP get udp => throw _privateConstructorUsedError; - VeilidConfigTCP get tcp => throw _privateConstructorUsedError; - VeilidConfigWS get ws => throw _privateConstructorUsedError; - VeilidConfigWSS get wss => throw _privateConstructorUsedError; - - /// Serializes this VeilidConfigProtocol to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigProtocol - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $VeilidConfigProtocolCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VeilidConfigProtocolCopyWith<$Res> { - factory $VeilidConfigProtocolCopyWith(VeilidConfigProtocol value, - $Res Function(VeilidConfigProtocol) then) = - _$VeilidConfigProtocolCopyWithImpl<$Res, VeilidConfigProtocol>; +abstract mixin class $VeilidConfigWSSCopyWith<$Res> { + factory $VeilidConfigWSSCopyWith( + VeilidConfigWSS value, $Res Function(VeilidConfigWSS) _then) = + _$VeilidConfigWSSCopyWithImpl; @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; + {bool connect, + bool listen, + int maxConnections, + String listenAddress, + String path, + String? url}); } /// @nodoc -class _$VeilidConfigProtocolCopyWithImpl<$Res, - $Val extends VeilidConfigProtocol> - implements $VeilidConfigProtocolCopyWith<$Res> { - _$VeilidConfigProtocolCopyWithImpl(this._value, this._then); +class _$VeilidConfigWSSCopyWithImpl<$Res> + implements $VeilidConfigWSSCopyWith<$Res> { + _$VeilidConfigWSSCopyWithImpl(this._self, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final VeilidConfigWSS _self; + final $Res Function(VeilidConfigWSS) _then; - /// Create a copy of VeilidConfigProtocol + /// Create a copy of VeilidConfigWSS /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? udp = null, - Object? tcp = null, - Object? ws = null, - Object? wss = null, + Object? connect = null, + Object? listen = null, + Object? maxConnections = null, + Object? listenAddress = null, + Object? path = null, + Object? url = freezed, }) { - 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); - } - - /// Create a copy of VeilidConfigProtocol - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidConfigUDPCopyWith<$Res> get udp { - return $VeilidConfigUDPCopyWith<$Res>(_value.udp, (value) { - return _then(_value.copyWith(udp: value) as $Val); - }); - } - - /// Create a copy of VeilidConfigProtocol - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidConfigTCPCopyWith<$Res> get tcp { - return $VeilidConfigTCPCopyWith<$Res>(_value.tcp, (value) { - return _then(_value.copyWith(tcp: value) as $Val); - }); - } - - /// Create a copy of VeilidConfigProtocol - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidConfigWSCopyWith<$Res> get ws { - return $VeilidConfigWSCopyWith<$Res>(_value.ws, (value) { - return _then(_value.copyWith(ws: value) as $Val); - }); - } - - /// Create a copy of VeilidConfigProtocol - /// with the given fields replaced by the non-null parameter values. - @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 _$$VeilidConfigProtocolImplCopyWith<$Res> - implements $VeilidConfigProtocolCopyWith<$Res> { - factory _$$VeilidConfigProtocolImplCopyWith(_$VeilidConfigProtocolImpl value, - $Res Function(_$VeilidConfigProtocolImpl) then) = - __$$VeilidConfigProtocolImplCopyWithImpl<$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 __$$VeilidConfigProtocolImplCopyWithImpl<$Res> - extends _$VeilidConfigProtocolCopyWithImpl<$Res, _$VeilidConfigProtocolImpl> - implements _$$VeilidConfigProtocolImplCopyWith<$Res> { - __$$VeilidConfigProtocolImplCopyWithImpl(_$VeilidConfigProtocolImpl _value, - $Res Function(_$VeilidConfigProtocolImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidConfigProtocol - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? udp = null, - Object? tcp = null, - Object? ws = null, - Object? wss = null, - }) { - return _then(_$VeilidConfigProtocolImpl( - 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, + return _then(_self.copyWith( + connect: null == connect + ? _self.connect + : connect // ignore: cast_nullable_to_non_nullable + as bool, + listen: null == listen + ? _self.listen + : listen // ignore: cast_nullable_to_non_nullable + as bool, + maxConnections: null == maxConnections + ? _self.maxConnections + : maxConnections // ignore: cast_nullable_to_non_nullable + as int, + listenAddress: null == listenAddress + ? _self.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + path: null == path + ? _self.path + : path // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, )); } } /// @nodoc @JsonSerializable() -class _$VeilidConfigProtocolImpl - with DiagnosticableTreeMixin - implements _VeilidConfigProtocol { - const _$VeilidConfigProtocolImpl( - {required this.udp, - required this.tcp, - required this.ws, - required this.wss}); - - factory _$VeilidConfigProtocolImpl.fromJson(Map json) => - _$$VeilidConfigProtocolImplFromJson(json); +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 VeilidConfigUDP udp; + final bool connect; @override - final VeilidConfigTCP tcp; + final bool listen; @override - final VeilidConfigWS ws; + final int maxConnections; @override - final VeilidConfigWSS wss; + final String listenAddress; + @override + final String path; + @override + final String? url; + + /// Create a copy of VeilidConfigWSS + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigWSSCopyWith<_VeilidConfigWSS> get copyWith => + __$VeilidConfigWSSCopyWithImpl<_VeilidConfigWSS>(this, _$identity); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidConfigProtocol(udp: $udp, tcp: $tcp, ws: $ws, wss: $wss)'; + Map toJson() { + return _$VeilidConfigWSSToJson( + this, + ); } @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 ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, connect, listen, maxConnections, listenAddress, path, url); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigWSS(connect: $connect, listen: $listen, maxConnections: $maxConnections, listenAddress: $listenAddress, path: $path, url: $url)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidConfigWSSCopyWith<$Res> + implements $VeilidConfigWSSCopyWith<$Res> { + factory _$VeilidConfigWSSCopyWith( + _VeilidConfigWSS value, $Res Function(_VeilidConfigWSS) _then) = + __$VeilidConfigWSSCopyWithImpl; + @override + @useResult + $Res call( + {bool connect, + bool listen, + int maxConnections, + String listenAddress, + String path, + String? url}); +} + +/// @nodoc +class __$VeilidConfigWSSCopyWithImpl<$Res> + implements _$VeilidConfigWSSCopyWith<$Res> { + __$VeilidConfigWSSCopyWithImpl(this._self, this._then); + + final _VeilidConfigWSS _self; + final $Res Function(_VeilidConfigWSS) _then; + + /// Create a copy of VeilidConfigWSS + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $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 + ? _self.connect + : connect // ignore: cast_nullable_to_non_nullable + as bool, + listen: null == listen + ? _self.listen + : listen // ignore: cast_nullable_to_non_nullable + as bool, + maxConnections: null == maxConnections + ? _self.maxConnections + : maxConnections // ignore: cast_nullable_to_non_nullable + as int, + listenAddress: null == listenAddress + ? _self.listenAddress + : listenAddress // ignore: cast_nullable_to_non_nullable + as String, + path: null == path + ? _self.path + : path // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +mixin _$VeilidConfigProtocol implements DiagnosticableTreeMixin { + VeilidConfigUDP get udp; + VeilidConfigTCP get tcp; + VeilidConfigWS get ws; + VeilidConfigWSS get wss; + + /// Create a copy of VeilidConfigProtocol + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigProtocolCopyWith get copyWith => + _$VeilidConfigProtocolCopyWithImpl( + this as VeilidConfigProtocol, _$identity); + + /// Serializes this VeilidConfigProtocol to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidConfigProtocol')) ..add(DiagnosticsProperty('udp', udp)) @@ -4191,7 +4010,7 @@ class _$VeilidConfigProtocolImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigProtocolImpl && + other is VeilidConfigProtocol && (identical(other.udp, udp) || other.udp == udp) && (identical(other.tcp, tcp) || other.tcp == tcp) && (identical(other.ws, ws) || other.ws == ws) && @@ -4202,195 +4021,300 @@ class _$VeilidConfigProtocolImpl @override int get hashCode => Object.hash(runtimeType, udp, tcp, ws, wss); - /// Create a copy of VeilidConfigProtocol - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigProtocolImplCopyWith<_$VeilidConfigProtocolImpl> - get copyWith => - __$$VeilidConfigProtocolImplCopyWithImpl<_$VeilidConfigProtocolImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigProtocolImplToJson( - 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}) = _$VeilidConfigProtocolImpl; - - factory _VeilidConfigProtocol.fromJson(Map json) = - _$VeilidConfigProtocolImpl.fromJson; - - @override - VeilidConfigUDP get udp; - @override - VeilidConfigTCP get tcp; - @override - VeilidConfigWS get ws; - @override - VeilidConfigWSS get wss; - - /// Create a copy of VeilidConfigProtocol - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigProtocolImplCopyWith<_$VeilidConfigProtocolImpl> - 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; - - /// Serializes this VeilidConfigTLS to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigTLS - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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; - - /// Create a copy of VeilidConfigTLS - /// with the given fields replaced by the non-null parameter values. - @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); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigProtocol(udp: $udp, tcp: $tcp, ws: $ws, wss: $wss)'; } } /// @nodoc -abstract class _$$VeilidConfigTLSImplCopyWith<$Res> - implements $VeilidConfigTLSCopyWith<$Res> { - factory _$$VeilidConfigTLSImplCopyWith(_$VeilidConfigTLSImpl value, - $Res Function(_$VeilidConfigTLSImpl) then) = - __$$VeilidConfigTLSImplCopyWithImpl<$Res>; - @override +abstract mixin class $VeilidConfigProtocolCopyWith<$Res> { + factory $VeilidConfigProtocolCopyWith(VeilidConfigProtocol value, + $Res Function(VeilidConfigProtocol) _then) = + _$VeilidConfigProtocolCopyWithImpl; @useResult $Res call( - {String certificatePath, - String privateKeyPath, - int connectionInitialTimeoutMs}); + {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 __$$VeilidConfigTLSImplCopyWithImpl<$Res> - extends _$VeilidConfigTLSCopyWithImpl<$Res, _$VeilidConfigTLSImpl> - implements _$$VeilidConfigTLSImplCopyWith<$Res> { - __$$VeilidConfigTLSImplCopyWithImpl( - _$VeilidConfigTLSImpl _value, $Res Function(_$VeilidConfigTLSImpl) _then) - : super(_value, _then); +class _$VeilidConfigProtocolCopyWithImpl<$Res> + implements $VeilidConfigProtocolCopyWith<$Res> { + _$VeilidConfigProtocolCopyWithImpl(this._self, this._then); - /// Create a copy of VeilidConfigTLS + final VeilidConfigProtocol _self; + final $Res Function(VeilidConfigProtocol) _then; + + /// Create a copy of VeilidConfigProtocol /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? certificatePath = null, - Object? privateKeyPath = null, - Object? connectionInitialTimeoutMs = null, + Object? udp = null, + Object? tcp = null, + Object? ws = null, + Object? wss = null, }) { - return _then(_$VeilidConfigTLSImpl( - 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, + return _then(_self.copyWith( + udp: null == udp + ? _self.udp + : udp // ignore: cast_nullable_to_non_nullable + as VeilidConfigUDP, + tcp: null == tcp + ? _self.tcp + : tcp // ignore: cast_nullable_to_non_nullable + as VeilidConfigTCP, + ws: null == ws + ? _self.ws + : ws // ignore: cast_nullable_to_non_nullable + as VeilidConfigWS, + wss: null == wss + ? _self.wss + : wss // ignore: cast_nullable_to_non_nullable + as VeilidConfigWSS, )); } + + /// Create a copy of VeilidConfigProtocol + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigUDPCopyWith<$Res> get udp { + return $VeilidConfigUDPCopyWith<$Res>(_self.udp, (value) { + return _then(_self.copyWith(udp: value)); + }); + } + + /// Create a copy of VeilidConfigProtocol + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigTCPCopyWith<$Res> get tcp { + return $VeilidConfigTCPCopyWith<$Res>(_self.tcp, (value) { + return _then(_self.copyWith(tcp: value)); + }); + } + + /// Create a copy of VeilidConfigProtocol + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigWSCopyWith<$Res> get ws { + return $VeilidConfigWSCopyWith<$Res>(_self.ws, (value) { + return _then(_self.copyWith(ws: value)); + }); + } + + /// Create a copy of VeilidConfigProtocol + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigWSSCopyWith<$Res> get wss { + return $VeilidConfigWSSCopyWith<$Res>(_self.wss, (value) { + return _then(_self.copyWith(wss: value)); + }); + } } /// @nodoc @JsonSerializable() -class _$VeilidConfigTLSImpl +class _VeilidConfigProtocol with DiagnosticableTreeMixin - implements _VeilidConfigTLS { - const _$VeilidConfigTLSImpl( - {required this.certificatePath, - required this.privateKeyPath, - required this.connectionInitialTimeoutMs}); - - factory _$VeilidConfigTLSImpl.fromJson(Map json) => - _$$VeilidConfigTLSImplFromJson(json); + 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 String certificatePath; + final VeilidConfigUDP udp; @override - final String privateKeyPath; + final VeilidConfigTCP tcp; @override - final int connectionInitialTimeoutMs; + final VeilidConfigWS ws; + @override + final VeilidConfigWSS wss; + + /// Create a copy of VeilidConfigProtocol + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigProtocolCopyWith<_VeilidConfigProtocol> get copyWith => + __$VeilidConfigProtocolCopyWithImpl<_VeilidConfigProtocol>( + this, _$identity); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidConfigTLS(certificatePath: $certificatePath, privateKeyPath: $privateKeyPath, connectionInitialTimeoutMs: $connectionInitialTimeoutMs)'; + Map toJson() { + return _$VeilidConfigProtocolToJson( + this, + ); } @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 ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, udp, tcp, ws, wss); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigProtocol(udp: $udp, tcp: $tcp, ws: $ws, wss: $wss)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidConfigProtocolCopyWith<$Res> + implements $VeilidConfigProtocolCopyWith<$Res> { + factory _$VeilidConfigProtocolCopyWith(_VeilidConfigProtocol value, + $Res Function(_VeilidConfigProtocol) _then) = + __$VeilidConfigProtocolCopyWithImpl; + @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> + implements _$VeilidConfigProtocolCopyWith<$Res> { + __$VeilidConfigProtocolCopyWithImpl(this._self, this._then); + + final _VeilidConfigProtocol _self; + final $Res Function(_VeilidConfigProtocol) _then; + + /// Create a copy of VeilidConfigProtocol + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? udp = null, + Object? tcp = null, + Object? ws = null, + Object? wss = null, + }) { + return _then(_VeilidConfigProtocol( + udp: null == udp + ? _self.udp + : udp // ignore: cast_nullable_to_non_nullable + as VeilidConfigUDP, + tcp: null == tcp + ? _self.tcp + : tcp // ignore: cast_nullable_to_non_nullable + as VeilidConfigTCP, + ws: null == ws + ? _self.ws + : ws // ignore: cast_nullable_to_non_nullable + as VeilidConfigWS, + wss: null == wss + ? _self.wss + : wss // ignore: cast_nullable_to_non_nullable + as VeilidConfigWSS, + )); + } + + /// Create a copy of VeilidConfigProtocol + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigUDPCopyWith<$Res> get udp { + return $VeilidConfigUDPCopyWith<$Res>(_self.udp, (value) { + return _then(_self.copyWith(udp: value)); + }); + } + + /// Create a copy of VeilidConfigProtocol + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigTCPCopyWith<$Res> get tcp { + return $VeilidConfigTCPCopyWith<$Res>(_self.tcp, (value) { + return _then(_self.copyWith(tcp: value)); + }); + } + + /// Create a copy of VeilidConfigProtocol + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigWSCopyWith<$Res> get ws { + return $VeilidConfigWSCopyWith<$Res>(_self.ws, (value) { + return _then(_self.copyWith(ws: value)); + }); + } + + /// Create a copy of VeilidConfigProtocol + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigWSSCopyWith<$Res> get wss { + return $VeilidConfigWSSCopyWith<$Res>(_self.wss, (value) { + return _then(_self.copyWith(wss: value)); + }); + } +} + +/// @nodoc +mixin _$VeilidConfigTLS implements DiagnosticableTreeMixin { + String get certificatePath; + String get privateKeyPath; + int get connectionInitialTimeoutMs; + + /// Create a copy of VeilidConfigTLS + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigTLSCopyWith get copyWith => + _$VeilidConfigTLSCopyWithImpl( + this as VeilidConfigTLS, _$identity); + + /// Serializes this VeilidConfigTLS to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidConfigTLS')) ..add(DiagnosticsProperty('certificatePath', certificatePath)) @@ -4403,7 +4327,7 @@ class _$VeilidConfigTLSImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigTLSImpl && + other is VeilidConfigTLS && (identical(other.certificatePath, certificatePath) || other.certificatePath == certificatePath) && (identical(other.privateKeyPath, privateKeyPath) || @@ -4419,405 +4343,53 @@ class _$VeilidConfigTLSImpl int get hashCode => Object.hash( runtimeType, certificatePath, privateKeyPath, connectionInitialTimeoutMs); - /// Create a copy of VeilidConfigTLS - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigTLSImplCopyWith<_$VeilidConfigTLSImpl> get copyWith => - __$$VeilidConfigTLSImplCopyWithImpl<_$VeilidConfigTLSImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigTLSImplToJson( - this, - ); - } -} - -abstract class _VeilidConfigTLS implements VeilidConfigTLS { - const factory _VeilidConfigTLS( - {required final String certificatePath, - required final String privateKeyPath, - required final int connectionInitialTimeoutMs}) = _$VeilidConfigTLSImpl; - - factory _VeilidConfigTLS.fromJson(Map json) = - _$VeilidConfigTLSImpl.fromJson; - - @override - String get certificatePath; - @override - String get privateKeyPath; - @override - int get connectionInitialTimeoutMs; - - /// Create a copy of VeilidConfigTLS - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigTLSImplCopyWith<_$VeilidConfigTLSImpl> 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; - int get publicWatchLimit => throw _privateConstructorUsedError; - int get memberWatchLimit => throw _privateConstructorUsedError; - int get maxWatchExpirationMs => throw _privateConstructorUsedError; - - /// Serializes this VeilidConfigDHT to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigDHT - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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, - int publicWatchLimit, - int memberWatchLimit, - int maxWatchExpirationMs}); -} - -/// @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; - - /// Create a copy of VeilidConfigDHT - /// with the given fields replaced by the non-null parameter values. - @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, - Object? publicWatchLimit = null, - Object? memberWatchLimit = null, - Object? maxWatchExpirationMs = 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, - publicWatchLimit: null == publicWatchLimit - ? _value.publicWatchLimit - : publicWatchLimit // ignore: cast_nullable_to_non_nullable - as int, - memberWatchLimit: null == memberWatchLimit - ? _value.memberWatchLimit - : memberWatchLimit // ignore: cast_nullable_to_non_nullable - as int, - maxWatchExpirationMs: null == maxWatchExpirationMs - ? _value.maxWatchExpirationMs - : maxWatchExpirationMs // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigTLS(certificatePath: $certificatePath, privateKeyPath: $privateKeyPath, connectionInitialTimeoutMs: $connectionInitialTimeoutMs)'; } } /// @nodoc -abstract class _$$VeilidConfigDHTImplCopyWith<$Res> - implements $VeilidConfigDHTCopyWith<$Res> { - factory _$$VeilidConfigDHTImplCopyWith(_$VeilidConfigDHTImpl value, - $Res Function(_$VeilidConfigDHTImpl) then) = - __$$VeilidConfigDHTImplCopyWithImpl<$Res>; - @override +abstract mixin class $VeilidConfigTLSCopyWith<$Res> { + factory $VeilidConfigTLSCopyWith( + VeilidConfigTLS value, $Res Function(VeilidConfigTLS) _then) = + _$VeilidConfigTLSCopyWithImpl; @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, - int publicWatchLimit, - int memberWatchLimit, - int maxWatchExpirationMs}); + {String certificatePath, + String privateKeyPath, + int connectionInitialTimeoutMs}); } /// @nodoc -class __$$VeilidConfigDHTImplCopyWithImpl<$Res> - extends _$VeilidConfigDHTCopyWithImpl<$Res, _$VeilidConfigDHTImpl> - implements _$$VeilidConfigDHTImplCopyWith<$Res> { - __$$VeilidConfigDHTImplCopyWithImpl( - _$VeilidConfigDHTImpl _value, $Res Function(_$VeilidConfigDHTImpl) _then) - : super(_value, _then); +class _$VeilidConfigTLSCopyWithImpl<$Res> + implements $VeilidConfigTLSCopyWith<$Res> { + _$VeilidConfigTLSCopyWithImpl(this._self, this._then); - /// Create a copy of VeilidConfigDHT + final VeilidConfigTLS _self; + final $Res Function(VeilidConfigTLS) _then; + + /// Create a copy of VeilidConfigTLS /// with the given fields replaced by the non-null parameter values. @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, - Object? publicWatchLimit = null, - Object? memberWatchLimit = null, - Object? maxWatchExpirationMs = null, + Object? certificatePath = null, + Object? privateKeyPath = null, + Object? connectionInitialTimeoutMs = null, }) { - return _then(_$VeilidConfigDHTImpl( - 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, - publicWatchLimit: null == publicWatchLimit - ? _value.publicWatchLimit - : publicWatchLimit // ignore: cast_nullable_to_non_nullable - as int, - memberWatchLimit: null == memberWatchLimit - ? _value.memberWatchLimit - : memberWatchLimit // ignore: cast_nullable_to_non_nullable - as int, - maxWatchExpirationMs: null == maxWatchExpirationMs - ? _value.maxWatchExpirationMs - : maxWatchExpirationMs // ignore: cast_nullable_to_non_nullable + return _then(_self.copyWith( + certificatePath: null == certificatePath + ? _self.certificatePath + : certificatePath // ignore: cast_nullable_to_non_nullable + as String, + privateKeyPath: null == privateKeyPath + ? _self.privateKeyPath + : privateKeyPath // ignore: cast_nullable_to_non_nullable + as String, + connectionInitialTimeoutMs: null == connectionInitialTimeoutMs + ? _self.connectionInitialTimeoutMs + : connectionInitialTimeoutMs // ignore: cast_nullable_to_non_nullable as int, )); } @@ -4825,89 +4397,158 @@ class __$$VeilidConfigDHTImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$VeilidConfigDHTImpl - with DiagnosticableTreeMixin - implements _VeilidConfigDHT { - const _$VeilidConfigDHTImpl( - {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, - required this.publicWatchLimit, - required this.memberWatchLimit, - required this.maxWatchExpirationMs}); - - factory _$VeilidConfigDHTImpl.fromJson(Map json) => - _$$VeilidConfigDHTImplFromJson(json); +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 int resolveNodeTimeoutMs; + final String certificatePath; @override - final int resolveNodeCount; + final String privateKeyPath; @override - final int resolveNodeFanout; + final int connectionInitialTimeoutMs; + + /// Create a copy of VeilidConfigTLS + /// with the given fields replaced by the non-null parameter values. @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 - final int publicWatchLimit; - @override - final int memberWatchLimit; - @override - final int maxWatchExpirationMs; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigTLSCopyWith<_VeilidConfigTLS> get copyWith => + __$VeilidConfigTLSCopyWithImpl<_VeilidConfigTLS>(this, _$identity); @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, publicWatchLimit: $publicWatchLimit, memberWatchLimit: $memberWatchLimit, maxWatchExpirationMs: $maxWatchExpirationMs)'; + Map toJson() { + return _$VeilidConfigTLSToJson( + this, + ); } @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 ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, certificatePath, privateKeyPath, connectionInitialTimeoutMs); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigTLS(certificatePath: $certificatePath, privateKeyPath: $privateKeyPath, connectionInitialTimeoutMs: $connectionInitialTimeoutMs)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidConfigTLSCopyWith<$Res> + implements $VeilidConfigTLSCopyWith<$Res> { + factory _$VeilidConfigTLSCopyWith( + _VeilidConfigTLS value, $Res Function(_VeilidConfigTLS) _then) = + __$VeilidConfigTLSCopyWithImpl; + @override + @useResult + $Res call( + {String certificatePath, + String privateKeyPath, + int connectionInitialTimeoutMs}); +} + +/// @nodoc +class __$VeilidConfigTLSCopyWithImpl<$Res> + implements _$VeilidConfigTLSCopyWith<$Res> { + __$VeilidConfigTLSCopyWithImpl(this._self, this._then); + + final _VeilidConfigTLS _self; + final $Res Function(_VeilidConfigTLS) _then; + + /// Create a copy of VeilidConfigTLS + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? certificatePath = null, + Object? privateKeyPath = null, + Object? connectionInitialTimeoutMs = null, + }) { + return _then(_VeilidConfigTLS( + certificatePath: null == certificatePath + ? _self.certificatePath + : certificatePath // ignore: cast_nullable_to_non_nullable + as String, + privateKeyPath: null == privateKeyPath + ? _self.privateKeyPath + : privateKeyPath // ignore: cast_nullable_to_non_nullable + as String, + connectionInitialTimeoutMs: null == connectionInitialTimeoutMs + ? _self.connectionInitialTimeoutMs + : connectionInitialTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +mixin _$VeilidConfigDHT implements DiagnosticableTreeMixin { + int get resolveNodeTimeoutMs; + int get resolveNodeCount; + int get resolveNodeFanout; + int get maxFindNodeCount; + int get getValueTimeoutMs; + int get getValueCount; + int get getValueFanout; + int get setValueTimeoutMs; + int get setValueCount; + int get setValueFanout; + int get minPeerCount; + int get minPeerRefreshTimeMs; + int get validateDialInfoReceiptTimeMs; + int get localSubkeyCacheSize; + int get localMaxSubkeyCacheMemoryMb; + int get remoteSubkeyCacheSize; + int get remoteMaxRecords; + int get remoteMaxSubkeyCacheMemoryMb; + int get remoteMaxStorageSpaceMb; + int get publicWatchLimit; + int get memberWatchLimit; + int get maxWatchExpirationMs; + + /// Create a copy of VeilidConfigDHT + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigDHTCopyWith get copyWith => + _$VeilidConfigDHTCopyWithImpl( + this as VeilidConfigDHT, _$identity); + + /// Serializes this VeilidConfigDHT to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidConfigDHT')) ..add(DiagnosticsProperty('resolveNodeTimeoutMs', resolveNodeTimeoutMs)) @@ -4942,7 +4583,7 @@ class _$VeilidConfigDHTImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigDHTImpl && + other is VeilidConfigDHT && (identical(other.resolveNodeTimeoutMs, resolveNodeTimeoutMs) || other.resolveNodeTimeoutMs == resolveNodeTimeoutMs) && (identical(other.resolveNodeCount, resolveNodeCount) || @@ -5023,312 +4664,569 @@ class _$VeilidConfigDHTImpl maxWatchExpirationMs ]); - /// Create a copy of VeilidConfigDHT - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigDHTImplCopyWith<_$VeilidConfigDHTImpl> get copyWith => - __$$VeilidConfigDHTImplCopyWithImpl<_$VeilidConfigDHTImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigDHTImplToJson( - 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, - required final int publicWatchLimit, - required final int memberWatchLimit, - required final int maxWatchExpirationMs}) = _$VeilidConfigDHTImpl; - - factory _VeilidConfigDHT.fromJson(Map json) = - _$VeilidConfigDHTImpl.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 - int get publicWatchLimit; - @override - int get memberWatchLimit; - @override - int get maxWatchExpirationMs; - - /// Create a copy of VeilidConfigDHT - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigDHTImplCopyWith<_$VeilidConfigDHTImpl> 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 timeoutMs => throw _privateConstructorUsedError; - int get maxRouteHopCount => throw _privateConstructorUsedError; - int get defaultRouteHopCount => throw _privateConstructorUsedError; - int? get maxTimestampBehindMs => throw _privateConstructorUsedError; - int? get maxTimestampAheadMs => throw _privateConstructorUsedError; - - /// Serializes this VeilidConfigRPC to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigRPC - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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 timeoutMs, - int maxRouteHopCount, - int defaultRouteHopCount, - int? maxTimestampBehindMs, - int? maxTimestampAheadMs}); -} - -/// @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; - - /// Create a copy of VeilidConfigRPC - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? concurrency = null, - Object? queueSize = null, - Object? timeoutMs = null, - Object? maxRouteHopCount = null, - Object? defaultRouteHopCount = null, - Object? maxTimestampBehindMs = freezed, - Object? maxTimestampAheadMs = freezed, - }) { - 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, - 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, - 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?, - ) as $Val); + 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, publicWatchLimit: $publicWatchLimit, memberWatchLimit: $memberWatchLimit, maxWatchExpirationMs: $maxWatchExpirationMs)'; } } /// @nodoc -abstract class _$$VeilidConfigRPCImplCopyWith<$Res> - implements $VeilidConfigRPCCopyWith<$Res> { - factory _$$VeilidConfigRPCImplCopyWith(_$VeilidConfigRPCImpl value, - $Res Function(_$VeilidConfigRPCImpl) then) = - __$$VeilidConfigRPCImplCopyWithImpl<$Res>; - @override +abstract mixin class $VeilidConfigDHTCopyWith<$Res> { + factory $VeilidConfigDHTCopyWith( + VeilidConfigDHT value, $Res Function(VeilidConfigDHT) _then) = + _$VeilidConfigDHTCopyWithImpl; @useResult $Res call( - {int concurrency, - int queueSize, - int timeoutMs, - int maxRouteHopCount, - int defaultRouteHopCount, - int? maxTimestampBehindMs, - int? maxTimestampAheadMs}); + {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, + int publicWatchLimit, + int memberWatchLimit, + int maxWatchExpirationMs}); } /// @nodoc -class __$$VeilidConfigRPCImplCopyWithImpl<$Res> - extends _$VeilidConfigRPCCopyWithImpl<$Res, _$VeilidConfigRPCImpl> - implements _$$VeilidConfigRPCImplCopyWith<$Res> { - __$$VeilidConfigRPCImplCopyWithImpl( - _$VeilidConfigRPCImpl _value, $Res Function(_$VeilidConfigRPCImpl) _then) - : super(_value, _then); +class _$VeilidConfigDHTCopyWithImpl<$Res> + implements $VeilidConfigDHTCopyWith<$Res> { + _$VeilidConfigDHTCopyWithImpl(this._self, this._then); - /// Create a copy of VeilidConfigRPC + final VeilidConfigDHT _self; + final $Res Function(VeilidConfigDHT) _then; + + /// Create a copy of VeilidConfigDHT /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? concurrency = null, - Object? queueSize = null, - Object? timeoutMs = null, - Object? maxRouteHopCount = null, - Object? defaultRouteHopCount = null, - Object? maxTimestampBehindMs = freezed, - Object? maxTimestampAheadMs = freezed, + 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, + Object? publicWatchLimit = null, + Object? memberWatchLimit = null, + Object? maxWatchExpirationMs = null, }) { - return _then(_$VeilidConfigRPCImpl( - concurrency: null == concurrency - ? _value.concurrency - : concurrency // ignore: cast_nullable_to_non_nullable + return _then(_self.copyWith( + resolveNodeTimeoutMs: null == resolveNodeTimeoutMs + ? _self.resolveNodeTimeoutMs + : resolveNodeTimeoutMs // ignore: cast_nullable_to_non_nullable as int, - queueSize: null == queueSize - ? _value.queueSize - : queueSize // ignore: cast_nullable_to_non_nullable + resolveNodeCount: null == resolveNodeCount + ? _self.resolveNodeCount + : resolveNodeCount // ignore: cast_nullable_to_non_nullable as int, - timeoutMs: null == timeoutMs - ? _value.timeoutMs - : timeoutMs // ignore: cast_nullable_to_non_nullable + resolveNodeFanout: null == resolveNodeFanout + ? _self.resolveNodeFanout + : resolveNodeFanout // ignore: cast_nullable_to_non_nullable as int, - maxRouteHopCount: null == maxRouteHopCount - ? _value.maxRouteHopCount - : maxRouteHopCount // ignore: cast_nullable_to_non_nullable + maxFindNodeCount: null == maxFindNodeCount + ? _self.maxFindNodeCount + : maxFindNodeCount // ignore: cast_nullable_to_non_nullable as int, - defaultRouteHopCount: null == defaultRouteHopCount - ? _value.defaultRouteHopCount - : defaultRouteHopCount // ignore: cast_nullable_to_non_nullable + getValueTimeoutMs: null == getValueTimeoutMs + ? _self.getValueTimeoutMs + : getValueTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + getValueCount: null == getValueCount + ? _self.getValueCount + : getValueCount // ignore: cast_nullable_to_non_nullable + as int, + getValueFanout: null == getValueFanout + ? _self.getValueFanout + : getValueFanout // ignore: cast_nullable_to_non_nullable + as int, + setValueTimeoutMs: null == setValueTimeoutMs + ? _self.setValueTimeoutMs + : setValueTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + setValueCount: null == setValueCount + ? _self.setValueCount + : setValueCount // ignore: cast_nullable_to_non_nullable + as int, + setValueFanout: null == setValueFanout + ? _self.setValueFanout + : setValueFanout // ignore: cast_nullable_to_non_nullable + as int, + minPeerCount: null == minPeerCount + ? _self.minPeerCount + : minPeerCount // ignore: cast_nullable_to_non_nullable + as int, + minPeerRefreshTimeMs: null == minPeerRefreshTimeMs + ? _self.minPeerRefreshTimeMs + : minPeerRefreshTimeMs // ignore: cast_nullable_to_non_nullable + as int, + validateDialInfoReceiptTimeMs: null == validateDialInfoReceiptTimeMs + ? _self.validateDialInfoReceiptTimeMs + : validateDialInfoReceiptTimeMs // ignore: cast_nullable_to_non_nullable + as int, + localSubkeyCacheSize: null == localSubkeyCacheSize + ? _self.localSubkeyCacheSize + : localSubkeyCacheSize // ignore: cast_nullable_to_non_nullable + as int, + localMaxSubkeyCacheMemoryMb: null == localMaxSubkeyCacheMemoryMb + ? _self.localMaxSubkeyCacheMemoryMb + : localMaxSubkeyCacheMemoryMb // ignore: cast_nullable_to_non_nullable + as int, + remoteSubkeyCacheSize: null == remoteSubkeyCacheSize + ? _self.remoteSubkeyCacheSize + : remoteSubkeyCacheSize // ignore: cast_nullable_to_non_nullable + as int, + remoteMaxRecords: null == remoteMaxRecords + ? _self.remoteMaxRecords + : remoteMaxRecords // ignore: cast_nullable_to_non_nullable + as int, + remoteMaxSubkeyCacheMemoryMb: null == remoteMaxSubkeyCacheMemoryMb + ? _self.remoteMaxSubkeyCacheMemoryMb + : remoteMaxSubkeyCacheMemoryMb // ignore: cast_nullable_to_non_nullable + as int, + remoteMaxStorageSpaceMb: null == remoteMaxStorageSpaceMb + ? _self.remoteMaxStorageSpaceMb + : remoteMaxStorageSpaceMb // ignore: cast_nullable_to_non_nullable + as int, + publicWatchLimit: null == publicWatchLimit + ? _self.publicWatchLimit + : publicWatchLimit // ignore: cast_nullable_to_non_nullable + as int, + memberWatchLimit: null == memberWatchLimit + ? _self.memberWatchLimit + : memberWatchLimit // ignore: cast_nullable_to_non_nullable + as int, + maxWatchExpirationMs: null == maxWatchExpirationMs + ? _self.maxWatchExpirationMs + : maxWatchExpirationMs // 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?, )); } } /// @nodoc @JsonSerializable() -class _$VeilidConfigRPCImpl - with DiagnosticableTreeMixin - implements _VeilidConfigRPC { - const _$VeilidConfigRPCImpl( - {required this.concurrency, - required this.queueSize, - required this.timeoutMs, - required this.maxRouteHopCount, - required this.defaultRouteHopCount, - this.maxTimestampBehindMs, - this.maxTimestampAheadMs}); - - factory _$VeilidConfigRPCImpl.fromJson(Map json) => - _$$VeilidConfigRPCImplFromJson(json); +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, + required this.publicWatchLimit, + required this.memberWatchLimit, + required this.maxWatchExpirationMs}); + factory _VeilidConfigDHT.fromJson(Map json) => + _$VeilidConfigDHTFromJson(json); @override - final int concurrency; + final int resolveNodeTimeoutMs; @override - final int queueSize; + final int resolveNodeCount; @override - final int timeoutMs; + final int resolveNodeFanout; @override - final int maxRouteHopCount; + final int maxFindNodeCount; @override - final int defaultRouteHopCount; + final int getValueTimeoutMs; @override - final int? maxTimestampBehindMs; + final int getValueCount; @override - final int? maxTimestampAheadMs; + 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 + final int publicWatchLimit; + @override + final int memberWatchLimit; + @override + final int maxWatchExpirationMs; + + /// Create a copy of VeilidConfigDHT + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigDHTCopyWith<_VeilidConfigDHT> get copyWith => + __$VeilidConfigDHTCopyWithImpl<_VeilidConfigDHT>(this, _$identity); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidConfigRPC(concurrency: $concurrency, queueSize: $queueSize, timeoutMs: $timeoutMs, maxRouteHopCount: $maxRouteHopCount, defaultRouteHopCount: $defaultRouteHopCount, maxTimestampBehindMs: $maxTimestampBehindMs, maxTimestampAheadMs: $maxTimestampAheadMs)'; + Map toJson() { + return _$VeilidConfigDHTToJson( + this, + ); } @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)) + ..add(DiagnosticsProperty('publicWatchLimit', publicWatchLimit)) + ..add(DiagnosticsProperty('memberWatchLimit', memberWatchLimit)) + ..add(DiagnosticsProperty('maxWatchExpirationMs', maxWatchExpirationMs)); + } + + @override + bool operator ==(Object 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) && + (identical(other.publicWatchLimit, publicWatchLimit) || + other.publicWatchLimit == publicWatchLimit) && + (identical(other.memberWatchLimit, memberWatchLimit) || + other.memberWatchLimit == memberWatchLimit) && + (identical(other.maxWatchExpirationMs, maxWatchExpirationMs) || + other.maxWatchExpirationMs == maxWatchExpirationMs)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @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, + publicWatchLimit, + memberWatchLimit, + maxWatchExpirationMs + ]); + + @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, publicWatchLimit: $publicWatchLimit, memberWatchLimit: $memberWatchLimit, maxWatchExpirationMs: $maxWatchExpirationMs)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidConfigDHTCopyWith<$Res> + implements $VeilidConfigDHTCopyWith<$Res> { + factory _$VeilidConfigDHTCopyWith( + _VeilidConfigDHT value, $Res Function(_VeilidConfigDHT) _then) = + __$VeilidConfigDHTCopyWithImpl; + @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, + int publicWatchLimit, + int memberWatchLimit, + int maxWatchExpirationMs}); +} + +/// @nodoc +class __$VeilidConfigDHTCopyWithImpl<$Res> + implements _$VeilidConfigDHTCopyWith<$Res> { + __$VeilidConfigDHTCopyWithImpl(this._self, this._then); + + final _VeilidConfigDHT _self; + final $Res Function(_VeilidConfigDHT) _then; + + /// Create a copy of VeilidConfigDHT + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $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, + Object? publicWatchLimit = null, + Object? memberWatchLimit = null, + Object? maxWatchExpirationMs = null, + }) { + return _then(_VeilidConfigDHT( + resolveNodeTimeoutMs: null == resolveNodeTimeoutMs + ? _self.resolveNodeTimeoutMs + : resolveNodeTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + resolveNodeCount: null == resolveNodeCount + ? _self.resolveNodeCount + : resolveNodeCount // ignore: cast_nullable_to_non_nullable + as int, + resolveNodeFanout: null == resolveNodeFanout + ? _self.resolveNodeFanout + : resolveNodeFanout // ignore: cast_nullable_to_non_nullable + as int, + maxFindNodeCount: null == maxFindNodeCount + ? _self.maxFindNodeCount + : maxFindNodeCount // ignore: cast_nullable_to_non_nullable + as int, + getValueTimeoutMs: null == getValueTimeoutMs + ? _self.getValueTimeoutMs + : getValueTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + getValueCount: null == getValueCount + ? _self.getValueCount + : getValueCount // ignore: cast_nullable_to_non_nullable + as int, + getValueFanout: null == getValueFanout + ? _self.getValueFanout + : getValueFanout // ignore: cast_nullable_to_non_nullable + as int, + setValueTimeoutMs: null == setValueTimeoutMs + ? _self.setValueTimeoutMs + : setValueTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + setValueCount: null == setValueCount + ? _self.setValueCount + : setValueCount // ignore: cast_nullable_to_non_nullable + as int, + setValueFanout: null == setValueFanout + ? _self.setValueFanout + : setValueFanout // ignore: cast_nullable_to_non_nullable + as int, + minPeerCount: null == minPeerCount + ? _self.minPeerCount + : minPeerCount // ignore: cast_nullable_to_non_nullable + as int, + minPeerRefreshTimeMs: null == minPeerRefreshTimeMs + ? _self.minPeerRefreshTimeMs + : minPeerRefreshTimeMs // ignore: cast_nullable_to_non_nullable + as int, + validateDialInfoReceiptTimeMs: null == validateDialInfoReceiptTimeMs + ? _self.validateDialInfoReceiptTimeMs + : validateDialInfoReceiptTimeMs // ignore: cast_nullable_to_non_nullable + as int, + localSubkeyCacheSize: null == localSubkeyCacheSize + ? _self.localSubkeyCacheSize + : localSubkeyCacheSize // ignore: cast_nullable_to_non_nullable + as int, + localMaxSubkeyCacheMemoryMb: null == localMaxSubkeyCacheMemoryMb + ? _self.localMaxSubkeyCacheMemoryMb + : localMaxSubkeyCacheMemoryMb // ignore: cast_nullable_to_non_nullable + as int, + remoteSubkeyCacheSize: null == remoteSubkeyCacheSize + ? _self.remoteSubkeyCacheSize + : remoteSubkeyCacheSize // ignore: cast_nullable_to_non_nullable + as int, + remoteMaxRecords: null == remoteMaxRecords + ? _self.remoteMaxRecords + : remoteMaxRecords // ignore: cast_nullable_to_non_nullable + as int, + remoteMaxSubkeyCacheMemoryMb: null == remoteMaxSubkeyCacheMemoryMb + ? _self.remoteMaxSubkeyCacheMemoryMb + : remoteMaxSubkeyCacheMemoryMb // ignore: cast_nullable_to_non_nullable + as int, + remoteMaxStorageSpaceMb: null == remoteMaxStorageSpaceMb + ? _self.remoteMaxStorageSpaceMb + : remoteMaxStorageSpaceMb // ignore: cast_nullable_to_non_nullable + as int, + publicWatchLimit: null == publicWatchLimit + ? _self.publicWatchLimit + : publicWatchLimit // ignore: cast_nullable_to_non_nullable + as int, + memberWatchLimit: null == memberWatchLimit + ? _self.memberWatchLimit + : memberWatchLimit // ignore: cast_nullable_to_non_nullable + as int, + maxWatchExpirationMs: null == maxWatchExpirationMs + ? _self.maxWatchExpirationMs + : maxWatchExpirationMs // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +mixin _$VeilidConfigRPC implements DiagnosticableTreeMixin { + int get concurrency; + int get queueSize; + int get timeoutMs; + int get maxRouteHopCount; + int get defaultRouteHopCount; + int? get maxTimestampBehindMs; + int? get maxTimestampAheadMs; + + /// Create a copy of VeilidConfigRPC + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigRPCCopyWith get copyWith => + _$VeilidConfigRPCCopyWithImpl( + this as VeilidConfigRPC, _$identity); + + /// Serializes this VeilidConfigRPC to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidConfigRPC')) ..add(DiagnosticsProperty('concurrency', concurrency)) @@ -5344,7 +5242,7 @@ class _$VeilidConfigRPCImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigRPCImpl && + other is VeilidConfigRPC && (identical(other.concurrency, concurrency) || other.concurrency == concurrency) && (identical(other.queueSize, queueSize) || @@ -5373,174 +5271,331 @@ class _$VeilidConfigRPCImpl maxTimestampBehindMs, maxTimestampAheadMs); + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigRPC(concurrency: $concurrency, queueSize: $queueSize, timeoutMs: $timeoutMs, maxRouteHopCount: $maxRouteHopCount, defaultRouteHopCount: $defaultRouteHopCount, maxTimestampBehindMs: $maxTimestampBehindMs, maxTimestampAheadMs: $maxTimestampAheadMs)'; + } +} + +/// @nodoc +abstract mixin class $VeilidConfigRPCCopyWith<$Res> { + factory $VeilidConfigRPCCopyWith( + VeilidConfigRPC value, $Res Function(VeilidConfigRPC) _then) = + _$VeilidConfigRPCCopyWithImpl; + @useResult + $Res call( + {int concurrency, + int queueSize, + int timeoutMs, + int maxRouteHopCount, + int defaultRouteHopCount, + int? maxTimestampBehindMs, + int? maxTimestampAheadMs}); +} + +/// @nodoc +class _$VeilidConfigRPCCopyWithImpl<$Res> + implements $VeilidConfigRPCCopyWith<$Res> { + _$VeilidConfigRPCCopyWithImpl(this._self, this._then); + + final VeilidConfigRPC _self; + final $Res Function(VeilidConfigRPC) _then; + /// Create a copy of VeilidConfigRPC /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override @pragma('vm:prefer-inline') - _$$VeilidConfigRPCImplCopyWith<_$VeilidConfigRPCImpl> get copyWith => - __$$VeilidConfigRPCImplCopyWithImpl<_$VeilidConfigRPCImpl>( - this, _$identity); + @override + $Res call({ + Object? concurrency = null, + Object? queueSize = null, + Object? timeoutMs = null, + Object? maxRouteHopCount = null, + Object? defaultRouteHopCount = null, + Object? maxTimestampBehindMs = freezed, + Object? maxTimestampAheadMs = freezed, + }) { + return _then(_self.copyWith( + concurrency: null == concurrency + ? _self.concurrency + : concurrency // ignore: cast_nullable_to_non_nullable + as int, + queueSize: null == queueSize + ? _self.queueSize + : queueSize // ignore: cast_nullable_to_non_nullable + as int, + timeoutMs: null == timeoutMs + ? _self.timeoutMs + : timeoutMs // ignore: cast_nullable_to_non_nullable + as int, + maxRouteHopCount: null == maxRouteHopCount + ? _self.maxRouteHopCount + : maxRouteHopCount // ignore: cast_nullable_to_non_nullable + as int, + defaultRouteHopCount: null == defaultRouteHopCount + ? _self.defaultRouteHopCount + : defaultRouteHopCount // ignore: cast_nullable_to_non_nullable + as int, + maxTimestampBehindMs: freezed == maxTimestampBehindMs + ? _self.maxTimestampBehindMs + : maxTimestampBehindMs // ignore: cast_nullable_to_non_nullable + as int?, + maxTimestampAheadMs: freezed == maxTimestampAheadMs + ? _self.maxTimestampAheadMs + : maxTimestampAheadMs // ignore: cast_nullable_to_non_nullable + as int?, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _VeilidConfigRPC with DiagnosticableTreeMixin implements VeilidConfigRPC { + const _VeilidConfigRPC( + {required this.concurrency, + required this.queueSize, + required this.timeoutMs, + required this.maxRouteHopCount, + required this.defaultRouteHopCount, + this.maxTimestampBehindMs, + this.maxTimestampAheadMs}); + factory _VeilidConfigRPC.fromJson(Map json) => + _$VeilidConfigRPCFromJson(json); + + @override + final int concurrency; + @override + final int queueSize; + @override + final int timeoutMs; + @override + final int maxRouteHopCount; + @override + final int defaultRouteHopCount; + @override + final int? maxTimestampBehindMs; + @override + final int? maxTimestampAheadMs; + + /// Create a copy of VeilidConfigRPC + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigRPCCopyWith<_VeilidConfigRPC> get copyWith => + __$VeilidConfigRPCCopyWithImpl<_VeilidConfigRPC>(this, _$identity); @override Map toJson() { - return _$$VeilidConfigRPCImplToJson( + return _$VeilidConfigRPCToJson( this, ); } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigRPC')) + ..add(DiagnosticsProperty('concurrency', concurrency)) + ..add(DiagnosticsProperty('queueSize', queueSize)) + ..add(DiagnosticsProperty('timeoutMs', timeoutMs)) + ..add(DiagnosticsProperty('maxRouteHopCount', maxRouteHopCount)) + ..add(DiagnosticsProperty('defaultRouteHopCount', defaultRouteHopCount)) + ..add(DiagnosticsProperty('maxTimestampBehindMs', maxTimestampBehindMs)) + ..add(DiagnosticsProperty('maxTimestampAheadMs', maxTimestampAheadMs)); + } + + @override + bool operator ==(Object 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.timeoutMs, timeoutMs) || + other.timeoutMs == timeoutMs) && + (identical(other.maxRouteHopCount, maxRouteHopCount) || + other.maxRouteHopCount == maxRouteHopCount) && + (identical(other.defaultRouteHopCount, defaultRouteHopCount) || + other.defaultRouteHopCount == defaultRouteHopCount) && + (identical(other.maxTimestampBehindMs, maxTimestampBehindMs) || + other.maxTimestampBehindMs == maxTimestampBehindMs) && + (identical(other.maxTimestampAheadMs, maxTimestampAheadMs) || + other.maxTimestampAheadMs == maxTimestampAheadMs)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + concurrency, + queueSize, + timeoutMs, + maxRouteHopCount, + defaultRouteHopCount, + maxTimestampBehindMs, + maxTimestampAheadMs); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigRPC(concurrency: $concurrency, queueSize: $queueSize, timeoutMs: $timeoutMs, maxRouteHopCount: $maxRouteHopCount, defaultRouteHopCount: $defaultRouteHopCount, maxTimestampBehindMs: $maxTimestampBehindMs, maxTimestampAheadMs: $maxTimestampAheadMs)'; + } } -abstract class _VeilidConfigRPC implements VeilidConfigRPC { - const factory _VeilidConfigRPC( - {required final int concurrency, - required final int queueSize, - required final int timeoutMs, - required final int maxRouteHopCount, - required final int defaultRouteHopCount, - final int? maxTimestampBehindMs, - final int? maxTimestampAheadMs}) = _$VeilidConfigRPCImpl; +/// @nodoc +abstract mixin class _$VeilidConfigRPCCopyWith<$Res> + implements $VeilidConfigRPCCopyWith<$Res> { + factory _$VeilidConfigRPCCopyWith( + _VeilidConfigRPC value, $Res Function(_VeilidConfigRPC) _then) = + __$VeilidConfigRPCCopyWithImpl; + @override + @useResult + $Res call( + {int concurrency, + int queueSize, + int timeoutMs, + int maxRouteHopCount, + int defaultRouteHopCount, + int? maxTimestampBehindMs, + int? maxTimestampAheadMs}); +} - factory _VeilidConfigRPC.fromJson(Map json) = - _$VeilidConfigRPCImpl.fromJson; +/// @nodoc +class __$VeilidConfigRPCCopyWithImpl<$Res> + implements _$VeilidConfigRPCCopyWith<$Res> { + __$VeilidConfigRPCCopyWithImpl(this._self, this._then); - @override - int get concurrency; - @override - int get queueSize; - @override - int get timeoutMs; - @override - int get maxRouteHopCount; - @override - int get defaultRouteHopCount; - @override - int? get maxTimestampBehindMs; - @override - int? get maxTimestampAheadMs; + final _VeilidConfigRPC _self; + final $Res Function(_VeilidConfigRPC) _then; /// Create a copy of VeilidConfigRPC /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigRPCImplCopyWith<_$VeilidConfigRPCImpl> 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; - - /// Serializes this VeilidConfigRoutingTable to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigRoutingTable - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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; - - /// Create a copy of VeilidConfigRoutingTable - /// with the given fields replaced by the non-null parameter values. @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, + Object? concurrency = null, + Object? queueSize = null, + Object? timeoutMs = null, + Object? maxRouteHopCount = null, + Object? defaultRouteHopCount = null, + Object? maxTimestampBehindMs = freezed, + Object? maxTimestampAheadMs = freezed, }) { - 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 + return _then(_VeilidConfigRPC( + concurrency: null == concurrency + ? _self.concurrency + : concurrency // ignore: cast_nullable_to_non_nullable as int, - limitFullyAttached: null == limitFullyAttached - ? _value.limitFullyAttached - : limitFullyAttached // ignore: cast_nullable_to_non_nullable + queueSize: null == queueSize + ? _self.queueSize + : queueSize // ignore: cast_nullable_to_non_nullable as int, - limitAttachedStrong: null == limitAttachedStrong - ? _value.limitAttachedStrong - : limitAttachedStrong // ignore: cast_nullable_to_non_nullable + timeoutMs: null == timeoutMs + ? _self.timeoutMs + : timeoutMs // ignore: cast_nullable_to_non_nullable as int, - limitAttachedGood: null == limitAttachedGood - ? _value.limitAttachedGood - : limitAttachedGood // ignore: cast_nullable_to_non_nullable + maxRouteHopCount: null == maxRouteHopCount + ? _self.maxRouteHopCount + : maxRouteHopCount // ignore: cast_nullable_to_non_nullable as int, - limitAttachedWeak: null == limitAttachedWeak - ? _value.limitAttachedWeak - : limitAttachedWeak // ignore: cast_nullable_to_non_nullable + defaultRouteHopCount: null == defaultRouteHopCount + ? _self.defaultRouteHopCount + : defaultRouteHopCount // ignore: cast_nullable_to_non_nullable as int, - ) as $Val); + maxTimestampBehindMs: freezed == maxTimestampBehindMs + ? _self.maxTimestampBehindMs + : maxTimestampBehindMs // ignore: cast_nullable_to_non_nullable + as int?, + maxTimestampAheadMs: freezed == maxTimestampAheadMs + ? _self.maxTimestampAheadMs + : maxTimestampAheadMs // ignore: cast_nullable_to_non_nullable + as int?, + )); } } /// @nodoc -abstract class _$$VeilidConfigRoutingTableImplCopyWith<$Res> - implements $VeilidConfigRoutingTableCopyWith<$Res> { - factory _$$VeilidConfigRoutingTableImplCopyWith( - _$VeilidConfigRoutingTableImpl value, - $Res Function(_$VeilidConfigRoutingTableImpl) then) = - __$$VeilidConfigRoutingTableImplCopyWithImpl<$Res>; +mixin _$VeilidConfigRoutingTable implements DiagnosticableTreeMixin { + List get nodeId; + List get nodeIdSecret; + List get bootstrap; + int get limitOverAttached; + int get limitFullyAttached; + int get limitAttachedStrong; + int get limitAttachedGood; + int get limitAttachedWeak; + + /// Create a copy of VeilidConfigRoutingTable + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigRoutingTableCopyWith get copyWith => + _$VeilidConfigRoutingTableCopyWithImpl( + this as VeilidConfigRoutingTable, _$identity); + + /// Serializes this VeilidConfigRoutingTable to a JSON map. + Map toJson(); + @override + void debugFillProperties(DiagnosticPropertiesBuilder 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 ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(nodeId), + const DeepCollectionEquality().hash(nodeIdSecret), + const DeepCollectionEquality().hash(bootstrap), + limitOverAttached, + limitFullyAttached, + limitAttachedStrong, + limitAttachedGood, + 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)'; + } +} + +/// @nodoc +abstract mixin class $VeilidConfigRoutingTableCopyWith<$Res> { + factory $VeilidConfigRoutingTableCopyWith(VeilidConfigRoutingTable value, + $Res Function(VeilidConfigRoutingTable) _then) = + _$VeilidConfigRoutingTableCopyWithImpl; @useResult $Res call( {List> nodeId, @@ -5554,14 +5609,12 @@ abstract class _$$VeilidConfigRoutingTableImplCopyWith<$Res> } /// @nodoc -class __$$VeilidConfigRoutingTableImplCopyWithImpl<$Res> - extends _$VeilidConfigRoutingTableCopyWithImpl<$Res, - _$VeilidConfigRoutingTableImpl> - implements _$$VeilidConfigRoutingTableImplCopyWith<$Res> { - __$$VeilidConfigRoutingTableImplCopyWithImpl( - _$VeilidConfigRoutingTableImpl _value, - $Res Function(_$VeilidConfigRoutingTableImpl) _then) - : super(_value, _then); +class _$VeilidConfigRoutingTableCopyWithImpl<$Res> + implements $VeilidConfigRoutingTableCopyWith<$Res> { + _$VeilidConfigRoutingTableCopyWithImpl(this._self, this._then); + + final VeilidConfigRoutingTable _self; + final $Res Function(VeilidConfigRoutingTable) _then; /// Create a copy of VeilidConfigRoutingTable /// with the given fields replaced by the non-null parameter values. @@ -5577,37 +5630,37 @@ class __$$VeilidConfigRoutingTableImplCopyWithImpl<$Res> Object? limitAttachedGood = null, Object? limitAttachedWeak = null, }) { - return _then(_$VeilidConfigRoutingTableImpl( + return _then(_self.copyWith( nodeId: null == nodeId - ? _value._nodeId + ? _self.nodeId! : nodeId // ignore: cast_nullable_to_non_nullable as List>, nodeIdSecret: null == nodeIdSecret - ? _value._nodeIdSecret + ? _self.nodeIdSecret! : nodeIdSecret // ignore: cast_nullable_to_non_nullable as List>, bootstrap: null == bootstrap - ? _value._bootstrap + ? _self.bootstrap : bootstrap // ignore: cast_nullable_to_non_nullable as List, limitOverAttached: null == limitOverAttached - ? _value.limitOverAttached + ? _self.limitOverAttached : limitOverAttached // ignore: cast_nullable_to_non_nullable as int, limitFullyAttached: null == limitFullyAttached - ? _value.limitFullyAttached + ? _self.limitFullyAttached : limitFullyAttached // ignore: cast_nullable_to_non_nullable as int, limitAttachedStrong: null == limitAttachedStrong - ? _value.limitAttachedStrong + ? _self.limitAttachedStrong : limitAttachedStrong // ignore: cast_nullable_to_non_nullable as int, limitAttachedGood: null == limitAttachedGood - ? _value.limitAttachedGood + ? _self.limitAttachedGood : limitAttachedGood // ignore: cast_nullable_to_non_nullable as int, limitAttachedWeak: null == limitAttachedWeak - ? _value.limitAttachedWeak + ? _self.limitAttachedWeak : limitAttachedWeak // ignore: cast_nullable_to_non_nullable as int, )); @@ -5616,10 +5669,10 @@ class __$$VeilidConfigRoutingTableImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$VeilidConfigRoutingTableImpl +class _VeilidConfigRoutingTable with DiagnosticableTreeMixin - implements _VeilidConfigRoutingTable { - const _$VeilidConfigRoutingTableImpl( + implements VeilidConfigRoutingTable { + const _VeilidConfigRoutingTable( {required final List> nodeId, required final List> nodeIdSecret, required final List bootstrap, @@ -5631,9 +5684,8 @@ class _$VeilidConfigRoutingTableImpl : _nodeId = nodeId, _nodeIdSecret = nodeIdSecret, _bootstrap = bootstrap; - - factory _$VeilidConfigRoutingTableImpl.fromJson(Map json) => - _$$VeilidConfigRoutingTableImplFromJson(json); + factory _VeilidConfigRoutingTable.fromJson(Map json) => + _$VeilidConfigRoutingTableFromJson(json); final List> _nodeId; @override @@ -5670,14 +5722,24 @@ class _$VeilidConfigRoutingTableImpl @override final int limitAttachedWeak; + /// Create a copy of VeilidConfigRoutingTable + /// with the given fields replaced by the non-null parameter values. @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)'; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigRoutingTableCopyWith<_VeilidConfigRoutingTable> get copyWith => + __$VeilidConfigRoutingTableCopyWithImpl<_VeilidConfigRoutingTable>( + this, _$identity); + + @override + Map toJson() { + return _$VeilidConfigRoutingTableToJson( + this, + ); } @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); properties ..add(DiagnosticsProperty('type', 'VeilidConfigRoutingTable')) ..add(DiagnosticsProperty('nodeId', nodeId)) @@ -5694,7 +5756,7 @@ class _$VeilidConfigRoutingTableImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigRoutingTableImpl && + other is _VeilidConfigRoutingTable && const DeepCollectionEquality().equals(other._nodeId, _nodeId) && const DeepCollectionEquality() .equals(other._nodeIdSecret, _nodeIdSecret) && @@ -5725,544 +5787,125 @@ class _$VeilidConfigRoutingTableImpl limitAttachedGood, limitAttachedWeak); - /// Create a copy of VeilidConfigRoutingTable - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigRoutingTableImplCopyWith<_$VeilidConfigRoutingTableImpl> - get copyWith => __$$VeilidConfigRoutingTableImplCopyWithImpl< - _$VeilidConfigRoutingTableImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigRoutingTableImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigRoutingTable(nodeId: $nodeId, nodeIdSecret: $nodeIdSecret, bootstrap: $bootstrap, limitOverAttached: $limitOverAttached, limitFullyAttached: $limitFullyAttached, limitAttachedStrong: $limitAttachedStrong, limitAttachedGood: $limitAttachedGood, limitAttachedWeak: $limitAttachedWeak)'; } } -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}) = _$VeilidConfigRoutingTableImpl; +/// @nodoc +abstract mixin class _$VeilidConfigRoutingTableCopyWith<$Res> + implements $VeilidConfigRoutingTableCopyWith<$Res> { + factory _$VeilidConfigRoutingTableCopyWith(_VeilidConfigRoutingTable value, + $Res Function(_VeilidConfigRoutingTable) _then) = + __$VeilidConfigRoutingTableCopyWithImpl; + @override + @useResult + $Res call( + {List> nodeId, + List> nodeIdSecret, + List bootstrap, + int limitOverAttached, + int limitFullyAttached, + int limitAttachedStrong, + int limitAttachedGood, + int limitAttachedWeak}); +} - factory _VeilidConfigRoutingTable.fromJson(Map json) = - _$VeilidConfigRoutingTableImpl.fromJson; +/// @nodoc +class __$VeilidConfigRoutingTableCopyWithImpl<$Res> + implements _$VeilidConfigRoutingTableCopyWith<$Res> { + __$VeilidConfigRoutingTableCopyWithImpl(this._self, this._then); - @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; + final _VeilidConfigRoutingTable _self; + final $Res Function(_VeilidConfigRoutingTable) _then; /// Create a copy of VeilidConfigRoutingTable /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigRoutingTableImplCopyWith<_$VeilidConfigRoutingTableImpl> - 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 clientAllowlistTimeoutMs => throw _privateConstructorUsedError; - int get reverseConnectionReceiptTimeMs => throw _privateConstructorUsedError; - int get holePunchReceiptTimeMs => 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; - String? get networkKeyPassword => throw _privateConstructorUsedError; - - /// Serializes this VeilidConfigNetwork to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigNetwork - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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 clientAllowlistTimeoutMs, - int reverseConnectionReceiptTimeMs, - int holePunchReceiptTimeMs, - VeilidConfigRoutingTable routingTable, - VeilidConfigRPC rpc, - VeilidConfigDHT dht, - bool upnp, - bool detectAddressChanges, - int restrictedNatRetries, - VeilidConfigTLS tls, - VeilidConfigApplication application, - VeilidConfigProtocol protocol, - String? networkKeyPassword}); - - $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; - - /// Create a copy of VeilidConfigNetwork - /// with the given fields replaced by the non-null parameter values. @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? clientAllowlistTimeoutMs = null, - Object? reverseConnectionReceiptTimeMs = null, - Object? holePunchReceiptTimeMs = null, - 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, - Object? networkKeyPassword = freezed, + 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( - connectionInitialTimeoutMs: null == connectionInitialTimeoutMs - ? _value.connectionInitialTimeoutMs - : connectionInitialTimeoutMs // ignore: cast_nullable_to_non_nullable + return _then(_VeilidConfigRoutingTable( + nodeId: null == nodeId + ? _self._nodeId + : nodeId // ignore: cast_nullable_to_non_nullable + as List>, + nodeIdSecret: null == nodeIdSecret + ? _self._nodeIdSecret + : nodeIdSecret // ignore: cast_nullable_to_non_nullable + as List>, + bootstrap: null == bootstrap + ? _self._bootstrap + : bootstrap // ignore: cast_nullable_to_non_nullable + as List, + limitOverAttached: null == limitOverAttached + ? _self.limitOverAttached + : limitOverAttached // ignore: cast_nullable_to_non_nullable as int, - connectionInactivityTimeoutMs: null == connectionInactivityTimeoutMs - ? _value.connectionInactivityTimeoutMs - : connectionInactivityTimeoutMs // ignore: cast_nullable_to_non_nullable + limitFullyAttached: null == limitFullyAttached + ? _self.limitFullyAttached + : limitFullyAttached // ignore: cast_nullable_to_non_nullable as int, - maxConnectionsPerIp4: null == maxConnectionsPerIp4 - ? _value.maxConnectionsPerIp4 - : maxConnectionsPerIp4 // ignore: cast_nullable_to_non_nullable + limitAttachedStrong: null == limitAttachedStrong + ? _self.limitAttachedStrong + : limitAttachedStrong // ignore: cast_nullable_to_non_nullable as int, - maxConnectionsPerIp6Prefix: null == maxConnectionsPerIp6Prefix - ? _value.maxConnectionsPerIp6Prefix - : maxConnectionsPerIp6Prefix // ignore: cast_nullable_to_non_nullable + limitAttachedGood: null == limitAttachedGood + ? _self.limitAttachedGood + : limitAttachedGood // ignore: cast_nullable_to_non_nullable as int, - maxConnectionsPerIp6PrefixSize: null == maxConnectionsPerIp6PrefixSize - ? _value.maxConnectionsPerIp6PrefixSize - : maxConnectionsPerIp6PrefixSize // ignore: cast_nullable_to_non_nullable + limitAttachedWeak: null == limitAttachedWeak + ? _self.limitAttachedWeak + : limitAttachedWeak // ignore: cast_nullable_to_non_nullable as int, - maxConnectionFrequencyPerMin: null == maxConnectionFrequencyPerMin - ? _value.maxConnectionFrequencyPerMin - : maxConnectionFrequencyPerMin // ignore: cast_nullable_to_non_nullable - as int, - clientAllowlistTimeoutMs: null == clientAllowlistTimeoutMs - ? _value.clientAllowlistTimeoutMs - : clientAllowlistTimeoutMs // 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, - 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, - networkKeyPassword: freezed == networkKeyPassword - ? _value.networkKeyPassword - : networkKeyPassword // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } - - /// Create a copy of VeilidConfigNetwork - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidConfigRoutingTableCopyWith<$Res> get routingTable { - return $VeilidConfigRoutingTableCopyWith<$Res>(_value.routingTable, - (value) { - return _then(_value.copyWith(routingTable: value) as $Val); - }); - } - - /// Create a copy of VeilidConfigNetwork - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidConfigRPCCopyWith<$Res> get rpc { - return $VeilidConfigRPCCopyWith<$Res>(_value.rpc, (value) { - return _then(_value.copyWith(rpc: value) as $Val); - }); - } - - /// Create a copy of VeilidConfigNetwork - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidConfigDHTCopyWith<$Res> get dht { - return $VeilidConfigDHTCopyWith<$Res>(_value.dht, (value) { - return _then(_value.copyWith(dht: value) as $Val); - }); - } - - /// Create a copy of VeilidConfigNetwork - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidConfigTLSCopyWith<$Res> get tls { - return $VeilidConfigTLSCopyWith<$Res>(_value.tls, (value) { - return _then(_value.copyWith(tls: value) as $Val); - }); - } - - /// Create a copy of VeilidConfigNetwork - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidConfigApplicationCopyWith<$Res> get application { - return $VeilidConfigApplicationCopyWith<$Res>(_value.application, (value) { - return _then(_value.copyWith(application: value) as $Val); - }); - } - - /// Create a copy of VeilidConfigNetwork - /// with the given fields replaced by the non-null parameter values. - @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 _$$VeilidConfigNetworkImplCopyWith<$Res> - implements $VeilidConfigNetworkCopyWith<$Res> { - factory _$$VeilidConfigNetworkImplCopyWith(_$VeilidConfigNetworkImpl value, - $Res Function(_$VeilidConfigNetworkImpl) then) = - __$$VeilidConfigNetworkImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {int connectionInitialTimeoutMs, - int connectionInactivityTimeoutMs, - int maxConnectionsPerIp4, - int maxConnectionsPerIp6Prefix, - int maxConnectionsPerIp6PrefixSize, - int maxConnectionFrequencyPerMin, - int clientAllowlistTimeoutMs, - int reverseConnectionReceiptTimeMs, - int holePunchReceiptTimeMs, - VeilidConfigRoutingTable routingTable, - VeilidConfigRPC rpc, - VeilidConfigDHT dht, - bool upnp, - bool detectAddressChanges, - int restrictedNatRetries, - VeilidConfigTLS tls, - VeilidConfigApplication application, - VeilidConfigProtocol protocol, - String? networkKeyPassword}); - - @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 __$$VeilidConfigNetworkImplCopyWithImpl<$Res> - extends _$VeilidConfigNetworkCopyWithImpl<$Res, _$VeilidConfigNetworkImpl> - implements _$$VeilidConfigNetworkImplCopyWith<$Res> { - __$$VeilidConfigNetworkImplCopyWithImpl(_$VeilidConfigNetworkImpl _value, - $Res Function(_$VeilidConfigNetworkImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidConfigNetwork - /// with the given fields replaced by the non-null parameter values. - @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? clientAllowlistTimeoutMs = null, - Object? reverseConnectionReceiptTimeMs = null, - Object? holePunchReceiptTimeMs = null, - 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, - Object? networkKeyPassword = freezed, - }) { - return _then(_$VeilidConfigNetworkImpl( - 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, - clientAllowlistTimeoutMs: null == clientAllowlistTimeoutMs - ? _value.clientAllowlistTimeoutMs - : clientAllowlistTimeoutMs // 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, - 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, - networkKeyPassword: freezed == networkKeyPassword - ? _value.networkKeyPassword - : networkKeyPassword // ignore: cast_nullable_to_non_nullable - as String?, )); } } /// @nodoc -@JsonSerializable() -class _$VeilidConfigNetworkImpl - with DiagnosticableTreeMixin - implements _VeilidConfigNetwork { - const _$VeilidConfigNetworkImpl( - {required this.connectionInitialTimeoutMs, - required this.connectionInactivityTimeoutMs, - required this.maxConnectionsPerIp4, - required this.maxConnectionsPerIp6Prefix, - required this.maxConnectionsPerIp6PrefixSize, - required this.maxConnectionFrequencyPerMin, - required this.clientAllowlistTimeoutMs, - required this.reverseConnectionReceiptTimeMs, - required this.holePunchReceiptTimeMs, - 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, - this.networkKeyPassword}); +mixin _$VeilidConfigNetwork implements DiagnosticableTreeMixin { + int get connectionInitialTimeoutMs; + int get connectionInactivityTimeoutMs; + int get maxConnectionsPerIp4; + int get maxConnectionsPerIp6Prefix; + int get maxConnectionsPerIp6PrefixSize; + int get maxConnectionFrequencyPerMin; + int get clientAllowlistTimeoutMs; + int get reverseConnectionReceiptTimeMs; + int get holePunchReceiptTimeMs; + VeilidConfigRoutingTable get routingTable; + VeilidConfigRPC get rpc; + VeilidConfigDHT get dht; + bool get upnp; + bool get detectAddressChanges; + int get restrictedNatRetries; + VeilidConfigTLS get tls; + VeilidConfigApplication get application; + VeilidConfigProtocol get protocol; + String? get networkKeyPassword; - factory _$VeilidConfigNetworkImpl.fromJson(Map json) => - _$$VeilidConfigNetworkImplFromJson(json); + /// Create a copy of VeilidConfigNetwork + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigNetworkCopyWith get copyWith => + _$VeilidConfigNetworkCopyWithImpl( + this as VeilidConfigNetwork, _$identity); - @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 clientAllowlistTimeoutMs; - @override - final int reverseConnectionReceiptTimeMs; - @override - final int holePunchReceiptTimeMs; - @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 - final String? networkKeyPassword; - - @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidConfigNetwork(connectionInitialTimeoutMs: $connectionInitialTimeoutMs, connectionInactivityTimeoutMs: $connectionInactivityTimeoutMs, maxConnectionsPerIp4: $maxConnectionsPerIp4, maxConnectionsPerIp6Prefix: $maxConnectionsPerIp6Prefix, maxConnectionsPerIp6PrefixSize: $maxConnectionsPerIp6PrefixSize, maxConnectionFrequencyPerMin: $maxConnectionFrequencyPerMin, clientAllowlistTimeoutMs: $clientAllowlistTimeoutMs, reverseConnectionReceiptTimeMs: $reverseConnectionReceiptTimeMs, holePunchReceiptTimeMs: $holePunchReceiptTimeMs, routingTable: $routingTable, rpc: $rpc, dht: $dht, upnp: $upnp, detectAddressChanges: $detectAddressChanges, restrictedNatRetries: $restrictedNatRetries, tls: $tls, application: $application, protocol: $protocol, networkKeyPassword: $networkKeyPassword)'; - } + /// Serializes this VeilidConfigNetwork to a JSON map. + Map toJson(); @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); properties ..add(DiagnosticsProperty('type', 'VeilidConfigNetwork')) ..add(DiagnosticsProperty( @@ -6298,7 +5941,7 @@ class _$VeilidConfigNetworkImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigNetworkImpl && + other is VeilidConfigNetwork && (identical(other.connectionInitialTimeoutMs, connectionInitialTimeoutMs) || other.connectionInitialTimeoutMs == connectionInitialTimeoutMs) && @@ -6367,223 +6010,651 @@ class _$VeilidConfigNetworkImpl networkKeyPassword ]); - /// Create a copy of VeilidConfigNetwork - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigNetworkImplCopyWith<_$VeilidConfigNetworkImpl> get copyWith => - __$$VeilidConfigNetworkImplCopyWithImpl<_$VeilidConfigNetworkImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigNetworkImplToJson( - 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 clientAllowlistTimeoutMs, - required final int reverseConnectionReceiptTimeMs, - required final int holePunchReceiptTimeMs, - 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, - final String? networkKeyPassword}) = _$VeilidConfigNetworkImpl; - - factory _VeilidConfigNetwork.fromJson(Map json) = - _$VeilidConfigNetworkImpl.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 clientAllowlistTimeoutMs; - @override - int get reverseConnectionReceiptTimeMs; - @override - int get holePunchReceiptTimeMs; - @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 - String? get networkKeyPassword; - - /// Create a copy of VeilidConfigNetwork - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigNetworkImplCopyWith<_$VeilidConfigNetworkImpl> 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; - - /// Serializes this VeilidConfigTableStore to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigTableStore - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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; - - /// Create a copy of VeilidConfigTableStore - /// with the given fields replaced by the non-null parameter values. - @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); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigNetwork(connectionInitialTimeoutMs: $connectionInitialTimeoutMs, connectionInactivityTimeoutMs: $connectionInactivityTimeoutMs, maxConnectionsPerIp4: $maxConnectionsPerIp4, maxConnectionsPerIp6Prefix: $maxConnectionsPerIp6Prefix, maxConnectionsPerIp6PrefixSize: $maxConnectionsPerIp6PrefixSize, maxConnectionFrequencyPerMin: $maxConnectionFrequencyPerMin, clientAllowlistTimeoutMs: $clientAllowlistTimeoutMs, reverseConnectionReceiptTimeMs: $reverseConnectionReceiptTimeMs, holePunchReceiptTimeMs: $holePunchReceiptTimeMs, routingTable: $routingTable, rpc: $rpc, dht: $dht, upnp: $upnp, detectAddressChanges: $detectAddressChanges, restrictedNatRetries: $restrictedNatRetries, tls: $tls, application: $application, protocol: $protocol, networkKeyPassword: $networkKeyPassword)'; } } /// @nodoc -abstract class _$$VeilidConfigTableStoreImplCopyWith<$Res> - implements $VeilidConfigTableStoreCopyWith<$Res> { - factory _$$VeilidConfigTableStoreImplCopyWith( - _$VeilidConfigTableStoreImpl value, - $Res Function(_$VeilidConfigTableStoreImpl) then) = - __$$VeilidConfigTableStoreImplCopyWithImpl<$Res>; - @override +abstract mixin class $VeilidConfigNetworkCopyWith<$Res> { + factory $VeilidConfigNetworkCopyWith( + VeilidConfigNetwork value, $Res Function(VeilidConfigNetwork) _then) = + _$VeilidConfigNetworkCopyWithImpl; @useResult - $Res call({String directory, bool delete}); + $Res call( + {int connectionInitialTimeoutMs, + int connectionInactivityTimeoutMs, + int maxConnectionsPerIp4, + int maxConnectionsPerIp6Prefix, + int maxConnectionsPerIp6PrefixSize, + int maxConnectionFrequencyPerMin, + int clientAllowlistTimeoutMs, + int reverseConnectionReceiptTimeMs, + int holePunchReceiptTimeMs, + VeilidConfigRoutingTable routingTable, + VeilidConfigRPC rpc, + VeilidConfigDHT dht, + bool upnp, + bool detectAddressChanges, + int restrictedNatRetries, + VeilidConfigTLS tls, + VeilidConfigApplication application, + VeilidConfigProtocol protocol, + String? networkKeyPassword}); + + $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 __$$VeilidConfigTableStoreImplCopyWithImpl<$Res> - extends _$VeilidConfigTableStoreCopyWithImpl<$Res, - _$VeilidConfigTableStoreImpl> - implements _$$VeilidConfigTableStoreImplCopyWith<$Res> { - __$$VeilidConfigTableStoreImplCopyWithImpl( - _$VeilidConfigTableStoreImpl _value, - $Res Function(_$VeilidConfigTableStoreImpl) _then) - : super(_value, _then); +class _$VeilidConfigNetworkCopyWithImpl<$Res> + implements $VeilidConfigNetworkCopyWith<$Res> { + _$VeilidConfigNetworkCopyWithImpl(this._self, this._then); - /// Create a copy of VeilidConfigTableStore + final VeilidConfigNetwork _self; + final $Res Function(VeilidConfigNetwork) _then; + + /// Create a copy of VeilidConfigNetwork /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? directory = null, - Object? delete = null, + Object? connectionInitialTimeoutMs = null, + Object? connectionInactivityTimeoutMs = null, + Object? maxConnectionsPerIp4 = null, + Object? maxConnectionsPerIp6Prefix = null, + Object? maxConnectionsPerIp6PrefixSize = null, + Object? maxConnectionFrequencyPerMin = null, + Object? clientAllowlistTimeoutMs = null, + Object? reverseConnectionReceiptTimeMs = null, + Object? holePunchReceiptTimeMs = null, + 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, + Object? networkKeyPassword = freezed, }) { - return _then(_$VeilidConfigTableStoreImpl( - 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 + return _then(_self.copyWith( + connectionInitialTimeoutMs: null == connectionInitialTimeoutMs + ? _self.connectionInitialTimeoutMs + : connectionInitialTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + connectionInactivityTimeoutMs: null == connectionInactivityTimeoutMs + ? _self.connectionInactivityTimeoutMs + : connectionInactivityTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionsPerIp4: null == maxConnectionsPerIp4 + ? _self.maxConnectionsPerIp4 + : maxConnectionsPerIp4 // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionsPerIp6Prefix: null == maxConnectionsPerIp6Prefix + ? _self.maxConnectionsPerIp6Prefix + : maxConnectionsPerIp6Prefix // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionsPerIp6PrefixSize: null == maxConnectionsPerIp6PrefixSize + ? _self.maxConnectionsPerIp6PrefixSize + : maxConnectionsPerIp6PrefixSize // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionFrequencyPerMin: null == maxConnectionFrequencyPerMin + ? _self.maxConnectionFrequencyPerMin + : maxConnectionFrequencyPerMin // ignore: cast_nullable_to_non_nullable + as int, + clientAllowlistTimeoutMs: null == clientAllowlistTimeoutMs + ? _self.clientAllowlistTimeoutMs + : clientAllowlistTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + reverseConnectionReceiptTimeMs: null == reverseConnectionReceiptTimeMs + ? _self.reverseConnectionReceiptTimeMs + : reverseConnectionReceiptTimeMs // ignore: cast_nullable_to_non_nullable + as int, + holePunchReceiptTimeMs: null == holePunchReceiptTimeMs + ? _self.holePunchReceiptTimeMs + : holePunchReceiptTimeMs // ignore: cast_nullable_to_non_nullable + as int, + routingTable: null == routingTable + ? _self.routingTable + : routingTable // ignore: cast_nullable_to_non_nullable + as VeilidConfigRoutingTable, + rpc: null == rpc + ? _self.rpc + : rpc // ignore: cast_nullable_to_non_nullable + as VeilidConfigRPC, + dht: null == dht + ? _self.dht + : dht // ignore: cast_nullable_to_non_nullable + as VeilidConfigDHT, + upnp: null == upnp + ? _self.upnp + : upnp // ignore: cast_nullable_to_non_nullable as bool, + detectAddressChanges: null == detectAddressChanges + ? _self.detectAddressChanges + : detectAddressChanges // ignore: cast_nullable_to_non_nullable + as bool, + restrictedNatRetries: null == restrictedNatRetries + ? _self.restrictedNatRetries + : restrictedNatRetries // ignore: cast_nullable_to_non_nullable + as int, + tls: null == tls + ? _self.tls + : tls // ignore: cast_nullable_to_non_nullable + as VeilidConfigTLS, + application: null == application + ? _self.application + : application // ignore: cast_nullable_to_non_nullable + as VeilidConfigApplication, + protocol: null == protocol + ? _self.protocol + : protocol // ignore: cast_nullable_to_non_nullable + as VeilidConfigProtocol, + networkKeyPassword: freezed == networkKeyPassword + ? _self.networkKeyPassword + : networkKeyPassword // ignore: cast_nullable_to_non_nullable + as String?, )); } + + /// Create a copy of VeilidConfigNetwork + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigRoutingTableCopyWith<$Res> get routingTable { + return $VeilidConfigRoutingTableCopyWith<$Res>(_self.routingTable, (value) { + return _then(_self.copyWith(routingTable: value)); + }); + } + + /// Create a copy of VeilidConfigNetwork + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigRPCCopyWith<$Res> get rpc { + return $VeilidConfigRPCCopyWith<$Res>(_self.rpc, (value) { + return _then(_self.copyWith(rpc: value)); + }); + } + + /// Create a copy of VeilidConfigNetwork + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigDHTCopyWith<$Res> get dht { + return $VeilidConfigDHTCopyWith<$Res>(_self.dht, (value) { + return _then(_self.copyWith(dht: value)); + }); + } + + /// Create a copy of VeilidConfigNetwork + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigTLSCopyWith<$Res> get tls { + return $VeilidConfigTLSCopyWith<$Res>(_self.tls, (value) { + return _then(_self.copyWith(tls: value)); + }); + } + + /// Create a copy of VeilidConfigNetwork + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigApplicationCopyWith<$Res> get application { + return $VeilidConfigApplicationCopyWith<$Res>(_self.application, (value) { + return _then(_self.copyWith(application: value)); + }); + } + + /// Create a copy of VeilidConfigNetwork + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigProtocolCopyWith<$Res> get protocol { + return $VeilidConfigProtocolCopyWith<$Res>(_self.protocol, (value) { + return _then(_self.copyWith(protocol: value)); + }); + } } /// @nodoc @JsonSerializable() -class _$VeilidConfigTableStoreImpl +class _VeilidConfigNetwork with DiagnosticableTreeMixin - implements _VeilidConfigTableStore { - const _$VeilidConfigTableStoreImpl( - {required this.directory, required this.delete}); - - factory _$VeilidConfigTableStoreImpl.fromJson(Map json) => - _$$VeilidConfigTableStoreImplFromJson(json); + implements VeilidConfigNetwork { + const _VeilidConfigNetwork( + {required this.connectionInitialTimeoutMs, + required this.connectionInactivityTimeoutMs, + required this.maxConnectionsPerIp4, + required this.maxConnectionsPerIp6Prefix, + required this.maxConnectionsPerIp6PrefixSize, + required this.maxConnectionFrequencyPerMin, + required this.clientAllowlistTimeoutMs, + required this.reverseConnectionReceiptTimeMs, + required this.holePunchReceiptTimeMs, + 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, + this.networkKeyPassword}); + factory _VeilidConfigNetwork.fromJson(Map json) => + _$VeilidConfigNetworkFromJson(json); @override - final String directory; + final int connectionInitialTimeoutMs; @override - final bool delete; + final int connectionInactivityTimeoutMs; + @override + final int maxConnectionsPerIp4; + @override + final int maxConnectionsPerIp6Prefix; + @override + final int maxConnectionsPerIp6PrefixSize; + @override + final int maxConnectionFrequencyPerMin; + @override + final int clientAllowlistTimeoutMs; + @override + final int reverseConnectionReceiptTimeMs; + @override + final int holePunchReceiptTimeMs; + @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 + final String? networkKeyPassword; + + /// Create a copy of VeilidConfigNetwork + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigNetworkCopyWith<_VeilidConfigNetwork> get copyWith => + __$VeilidConfigNetworkCopyWithImpl<_VeilidConfigNetwork>( + this, _$identity); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidConfigTableStore(directory: $directory, delete: $delete)'; + Map toJson() { + return _$VeilidConfigNetworkToJson( + this, + ); } @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( + 'clientAllowlistTimeoutMs', clientAllowlistTimeoutMs)) + ..add(DiagnosticsProperty( + 'reverseConnectionReceiptTimeMs', reverseConnectionReceiptTimeMs)) + ..add( + DiagnosticsProperty('holePunchReceiptTimeMs', holePunchReceiptTimeMs)) + ..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)) + ..add(DiagnosticsProperty('networkKeyPassword', networkKeyPassword)); + } + + @override + bool operator ==(Object 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.clientAllowlistTimeoutMs, clientAllowlistTimeoutMs) || + other.clientAllowlistTimeoutMs == clientAllowlistTimeoutMs) && + (identical(other.reverseConnectionReceiptTimeMs, + reverseConnectionReceiptTimeMs) || + other.reverseConnectionReceiptTimeMs == + reverseConnectionReceiptTimeMs) && + (identical(other.holePunchReceiptTimeMs, holePunchReceiptTimeMs) || + other.holePunchReceiptTimeMs == holePunchReceiptTimeMs) && + (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) && + (identical(other.networkKeyPassword, networkKeyPassword) || + other.networkKeyPassword == networkKeyPassword)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hashAll([ + runtimeType, + connectionInitialTimeoutMs, + connectionInactivityTimeoutMs, + maxConnectionsPerIp4, + maxConnectionsPerIp6Prefix, + maxConnectionsPerIp6PrefixSize, + maxConnectionFrequencyPerMin, + clientAllowlistTimeoutMs, + reverseConnectionReceiptTimeMs, + holePunchReceiptTimeMs, + routingTable, + rpc, + dht, + upnp, + detectAddressChanges, + restrictedNatRetries, + tls, + application, + protocol, + networkKeyPassword + ]); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigNetwork(connectionInitialTimeoutMs: $connectionInitialTimeoutMs, connectionInactivityTimeoutMs: $connectionInactivityTimeoutMs, maxConnectionsPerIp4: $maxConnectionsPerIp4, maxConnectionsPerIp6Prefix: $maxConnectionsPerIp6Prefix, maxConnectionsPerIp6PrefixSize: $maxConnectionsPerIp6PrefixSize, maxConnectionFrequencyPerMin: $maxConnectionFrequencyPerMin, clientAllowlistTimeoutMs: $clientAllowlistTimeoutMs, reverseConnectionReceiptTimeMs: $reverseConnectionReceiptTimeMs, holePunchReceiptTimeMs: $holePunchReceiptTimeMs, routingTable: $routingTable, rpc: $rpc, dht: $dht, upnp: $upnp, detectAddressChanges: $detectAddressChanges, restrictedNatRetries: $restrictedNatRetries, tls: $tls, application: $application, protocol: $protocol, networkKeyPassword: $networkKeyPassword)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidConfigNetworkCopyWith<$Res> + implements $VeilidConfigNetworkCopyWith<$Res> { + factory _$VeilidConfigNetworkCopyWith(_VeilidConfigNetwork value, + $Res Function(_VeilidConfigNetwork) _then) = + __$VeilidConfigNetworkCopyWithImpl; + @override + @useResult + $Res call( + {int connectionInitialTimeoutMs, + int connectionInactivityTimeoutMs, + int maxConnectionsPerIp4, + int maxConnectionsPerIp6Prefix, + int maxConnectionsPerIp6PrefixSize, + int maxConnectionFrequencyPerMin, + int clientAllowlistTimeoutMs, + int reverseConnectionReceiptTimeMs, + int holePunchReceiptTimeMs, + VeilidConfigRoutingTable routingTable, + VeilidConfigRPC rpc, + VeilidConfigDHT dht, + bool upnp, + bool detectAddressChanges, + int restrictedNatRetries, + VeilidConfigTLS tls, + VeilidConfigApplication application, + VeilidConfigProtocol protocol, + String? networkKeyPassword}); + + @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> + implements _$VeilidConfigNetworkCopyWith<$Res> { + __$VeilidConfigNetworkCopyWithImpl(this._self, this._then); + + final _VeilidConfigNetwork _self; + final $Res Function(_VeilidConfigNetwork) _then; + + /// Create a copy of VeilidConfigNetwork + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? connectionInitialTimeoutMs = null, + Object? connectionInactivityTimeoutMs = null, + Object? maxConnectionsPerIp4 = null, + Object? maxConnectionsPerIp6Prefix = null, + Object? maxConnectionsPerIp6PrefixSize = null, + Object? maxConnectionFrequencyPerMin = null, + Object? clientAllowlistTimeoutMs = null, + Object? reverseConnectionReceiptTimeMs = null, + Object? holePunchReceiptTimeMs = null, + 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, + Object? networkKeyPassword = freezed, + }) { + return _then(_VeilidConfigNetwork( + connectionInitialTimeoutMs: null == connectionInitialTimeoutMs + ? _self.connectionInitialTimeoutMs + : connectionInitialTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + connectionInactivityTimeoutMs: null == connectionInactivityTimeoutMs + ? _self.connectionInactivityTimeoutMs + : connectionInactivityTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionsPerIp4: null == maxConnectionsPerIp4 + ? _self.maxConnectionsPerIp4 + : maxConnectionsPerIp4 // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionsPerIp6Prefix: null == maxConnectionsPerIp6Prefix + ? _self.maxConnectionsPerIp6Prefix + : maxConnectionsPerIp6Prefix // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionsPerIp6PrefixSize: null == maxConnectionsPerIp6PrefixSize + ? _self.maxConnectionsPerIp6PrefixSize + : maxConnectionsPerIp6PrefixSize // ignore: cast_nullable_to_non_nullable + as int, + maxConnectionFrequencyPerMin: null == maxConnectionFrequencyPerMin + ? _self.maxConnectionFrequencyPerMin + : maxConnectionFrequencyPerMin // ignore: cast_nullable_to_non_nullable + as int, + clientAllowlistTimeoutMs: null == clientAllowlistTimeoutMs + ? _self.clientAllowlistTimeoutMs + : clientAllowlistTimeoutMs // ignore: cast_nullable_to_non_nullable + as int, + reverseConnectionReceiptTimeMs: null == reverseConnectionReceiptTimeMs + ? _self.reverseConnectionReceiptTimeMs + : reverseConnectionReceiptTimeMs // ignore: cast_nullable_to_non_nullable + as int, + holePunchReceiptTimeMs: null == holePunchReceiptTimeMs + ? _self.holePunchReceiptTimeMs + : holePunchReceiptTimeMs // ignore: cast_nullable_to_non_nullable + as int, + routingTable: null == routingTable + ? _self.routingTable + : routingTable // ignore: cast_nullable_to_non_nullable + as VeilidConfigRoutingTable, + rpc: null == rpc + ? _self.rpc + : rpc // ignore: cast_nullable_to_non_nullable + as VeilidConfigRPC, + dht: null == dht + ? _self.dht + : dht // ignore: cast_nullable_to_non_nullable + as VeilidConfigDHT, + upnp: null == upnp + ? _self.upnp + : upnp // ignore: cast_nullable_to_non_nullable + as bool, + detectAddressChanges: null == detectAddressChanges + ? _self.detectAddressChanges + : detectAddressChanges // ignore: cast_nullable_to_non_nullable + as bool, + restrictedNatRetries: null == restrictedNatRetries + ? _self.restrictedNatRetries + : restrictedNatRetries // ignore: cast_nullable_to_non_nullable + as int, + tls: null == tls + ? _self.tls + : tls // ignore: cast_nullable_to_non_nullable + as VeilidConfigTLS, + application: null == application + ? _self.application + : application // ignore: cast_nullable_to_non_nullable + as VeilidConfigApplication, + protocol: null == protocol + ? _self.protocol + : protocol // ignore: cast_nullable_to_non_nullable + as VeilidConfigProtocol, + networkKeyPassword: freezed == networkKeyPassword + ? _self.networkKeyPassword + : networkKeyPassword // ignore: cast_nullable_to_non_nullable + as String?, + )); + } + + /// Create a copy of VeilidConfigNetwork + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigRoutingTableCopyWith<$Res> get routingTable { + return $VeilidConfigRoutingTableCopyWith<$Res>(_self.routingTable, (value) { + return _then(_self.copyWith(routingTable: value)); + }); + } + + /// Create a copy of VeilidConfigNetwork + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigRPCCopyWith<$Res> get rpc { + return $VeilidConfigRPCCopyWith<$Res>(_self.rpc, (value) { + return _then(_self.copyWith(rpc: value)); + }); + } + + /// Create a copy of VeilidConfigNetwork + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigDHTCopyWith<$Res> get dht { + return $VeilidConfigDHTCopyWith<$Res>(_self.dht, (value) { + return _then(_self.copyWith(dht: value)); + }); + } + + /// Create a copy of VeilidConfigNetwork + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigTLSCopyWith<$Res> get tls { + return $VeilidConfigTLSCopyWith<$Res>(_self.tls, (value) { + return _then(_self.copyWith(tls: value)); + }); + } + + /// Create a copy of VeilidConfigNetwork + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigApplicationCopyWith<$Res> get application { + return $VeilidConfigApplicationCopyWith<$Res>(_self.application, (value) { + return _then(_self.copyWith(application: value)); + }); + } + + /// Create a copy of VeilidConfigNetwork + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigProtocolCopyWith<$Res> get protocol { + return $VeilidConfigProtocolCopyWith<$Res>(_self.protocol, (value) { + return _then(_self.copyWith(protocol: value)); + }); + } +} + +/// @nodoc +mixin _$VeilidConfigTableStore implements DiagnosticableTreeMixin { + String get directory; + bool get delete; + + /// Create a copy of VeilidConfigTableStore + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigTableStoreCopyWith get copyWith => + _$VeilidConfigTableStoreCopyWithImpl( + this as VeilidConfigTableStore, _$identity); + + /// Serializes this VeilidConfigTableStore to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidConfigTableStore')) ..add(DiagnosticsProperty('directory', directory)) @@ -6594,7 +6665,7 @@ class _$VeilidConfigTableStoreImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigTableStoreImpl && + other is VeilidConfigTableStore && (identical(other.directory, directory) || other.directory == directory) && (identical(other.delete, delete) || other.delete == delete)); @@ -6604,85 +6675,30 @@ class _$VeilidConfigTableStoreImpl @override int get hashCode => Object.hash(runtimeType, directory, delete); - /// Create a copy of VeilidConfigTableStore - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigTableStoreImplCopyWith<_$VeilidConfigTableStoreImpl> - get copyWith => __$$VeilidConfigTableStoreImplCopyWithImpl< - _$VeilidConfigTableStoreImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigTableStoreImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigTableStore(directory: $directory, delete: $delete)'; } } -abstract class _VeilidConfigTableStore implements VeilidConfigTableStore { - const factory _VeilidConfigTableStore( - {required final String directory, - required final bool delete}) = _$VeilidConfigTableStoreImpl; - - factory _VeilidConfigTableStore.fromJson(Map json) = - _$VeilidConfigTableStoreImpl.fromJson; - - @override - String get directory; - @override - bool get delete; - - /// Create a copy of VeilidConfigTableStore - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigTableStoreImplCopyWith<_$VeilidConfigTableStoreImpl> - 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; - - /// Serializes this VeilidConfigBlockStore to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigBlockStore - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $VeilidConfigBlockStoreCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VeilidConfigBlockStoreCopyWith<$Res> { - factory $VeilidConfigBlockStoreCopyWith(VeilidConfigBlockStore value, - $Res Function(VeilidConfigBlockStore) then) = - _$VeilidConfigBlockStoreCopyWithImpl<$Res, VeilidConfigBlockStore>; +abstract mixin class $VeilidConfigTableStoreCopyWith<$Res> { + factory $VeilidConfigTableStoreCopyWith(VeilidConfigTableStore value, + $Res Function(VeilidConfigTableStore) _then) = + _$VeilidConfigTableStoreCopyWithImpl; @useResult $Res call({String directory, bool delete}); } /// @nodoc -class _$VeilidConfigBlockStoreCopyWithImpl<$Res, - $Val extends VeilidConfigBlockStore> - implements $VeilidConfigBlockStoreCopyWith<$Res> { - _$VeilidConfigBlockStoreCopyWithImpl(this._value, this._then); +class _$VeilidConfigTableStoreCopyWithImpl<$Res> + implements $VeilidConfigTableStoreCopyWith<$Res> { + _$VeilidConfigTableStoreCopyWithImpl(this._self, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final VeilidConfigTableStore _self; + final $Res Function(VeilidConfigTableStore) _then; - /// Create a copy of VeilidConfigBlockStore + /// Create a copy of VeilidConfigTableStore /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override @@ -6690,56 +6706,13 @@ class _$VeilidConfigBlockStoreCopyWithImpl<$Res, Object? directory = null, Object? delete = null, }) { - return _then(_value.copyWith( + return _then(_self.copyWith( directory: null == directory - ? _value.directory + ? _self.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 _$$VeilidConfigBlockStoreImplCopyWith<$Res> - implements $VeilidConfigBlockStoreCopyWith<$Res> { - factory _$$VeilidConfigBlockStoreImplCopyWith( - _$VeilidConfigBlockStoreImpl value, - $Res Function(_$VeilidConfigBlockStoreImpl) then) = - __$$VeilidConfigBlockStoreImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String directory, bool delete}); -} - -/// @nodoc -class __$$VeilidConfigBlockStoreImplCopyWithImpl<$Res> - extends _$VeilidConfigBlockStoreCopyWithImpl<$Res, - _$VeilidConfigBlockStoreImpl> - implements _$$VeilidConfigBlockStoreImplCopyWith<$Res> { - __$$VeilidConfigBlockStoreImplCopyWithImpl( - _$VeilidConfigBlockStoreImpl _value, - $Res Function(_$VeilidConfigBlockStoreImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidConfigBlockStore - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? directory = null, - Object? delete = null, - }) { - return _then(_$VeilidConfigBlockStoreImpl( - directory: null == directory - ? _value.directory - : directory // ignore: cast_nullable_to_non_nullable - as String, - delete: null == delete - ? _value.delete + ? _self.delete : delete // ignore: cast_nullable_to_non_nullable as bool, )); @@ -6748,28 +6721,121 @@ class __$$VeilidConfigBlockStoreImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$VeilidConfigBlockStoreImpl +class _VeilidConfigTableStore with DiagnosticableTreeMixin - implements _VeilidConfigBlockStore { - const _$VeilidConfigBlockStoreImpl( + implements VeilidConfigTableStore { + const _VeilidConfigTableStore( {required this.directory, required this.delete}); - - factory _$VeilidConfigBlockStoreImpl.fromJson(Map json) => - _$$VeilidConfigBlockStoreImplFromJson(json); + factory _VeilidConfigTableStore.fromJson(Map json) => + _$VeilidConfigTableStoreFromJson(json); @override final String directory; @override final bool delete; + /// Create a copy of VeilidConfigTableStore + /// with the given fields replaced by the non-null parameter values. @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidConfigBlockStore(directory: $directory, delete: $delete)'; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigTableStoreCopyWith<_VeilidConfigTableStore> get copyWith => + __$VeilidConfigTableStoreCopyWithImpl<_VeilidConfigTableStore>( + this, _$identity); + + @override + Map toJson() { + return _$VeilidConfigTableStoreToJson( + this, + ); } @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigTableStore')) + ..add(DiagnosticsProperty('directory', directory)) + ..add(DiagnosticsProperty('delete', delete)); + } + + @override + bool operator ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, directory, delete); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigTableStore(directory: $directory, delete: $delete)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidConfigTableStoreCopyWith<$Res> + implements $VeilidConfigTableStoreCopyWith<$Res> { + factory _$VeilidConfigTableStoreCopyWith(_VeilidConfigTableStore value, + $Res Function(_VeilidConfigTableStore) _then) = + __$VeilidConfigTableStoreCopyWithImpl; + @override + @useResult + $Res call({String directory, bool delete}); +} + +/// @nodoc +class __$VeilidConfigTableStoreCopyWithImpl<$Res> + implements _$VeilidConfigTableStoreCopyWith<$Res> { + __$VeilidConfigTableStoreCopyWithImpl(this._self, this._then); + + final _VeilidConfigTableStore _self; + final $Res Function(_VeilidConfigTableStore) _then; + + /// Create a copy of VeilidConfigTableStore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? directory = null, + Object? delete = null, + }) { + return _then(_VeilidConfigTableStore( + directory: null == directory + ? _self.directory + : directory // ignore: cast_nullable_to_non_nullable + as String, + delete: null == delete + ? _self.delete + : delete // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @nodoc +mixin _$VeilidConfigBlockStore implements DiagnosticableTreeMixin { + String get directory; + bool get delete; + + /// Create a copy of VeilidConfigBlockStore + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigBlockStoreCopyWith get copyWith => + _$VeilidConfigBlockStoreCopyWithImpl( + this as VeilidConfigBlockStore, _$identity); + + /// Serializes this VeilidConfigBlockStore to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidConfigBlockStore')) ..add(DiagnosticsProperty('directory', directory)) @@ -6780,7 +6846,7 @@ class _$VeilidConfigBlockStoreImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigBlockStoreImpl && + other is VeilidConfigBlockStore && (identical(other.directory, directory) || other.directory == directory) && (identical(other.delete, delete) || other.delete == delete)); @@ -6790,244 +6856,172 @@ class _$VeilidConfigBlockStoreImpl @override int get hashCode => Object.hash(runtimeType, directory, delete); - /// Create a copy of VeilidConfigBlockStore - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigBlockStoreImplCopyWith<_$VeilidConfigBlockStoreImpl> - get copyWith => __$$VeilidConfigBlockStoreImplCopyWithImpl< - _$VeilidConfigBlockStoreImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigBlockStoreImplToJson( - this, - ); - } -} - -abstract class _VeilidConfigBlockStore implements VeilidConfigBlockStore { - const factory _VeilidConfigBlockStore( - {required final String directory, - required final bool delete}) = _$VeilidConfigBlockStoreImpl; - - factory _VeilidConfigBlockStore.fromJson(Map json) = - _$VeilidConfigBlockStoreImpl.fromJson; - - @override - String get directory; - @override - bool get delete; - - /// Create a copy of VeilidConfigBlockStore - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigBlockStoreImplCopyWith<_$VeilidConfigBlockStoreImpl> - 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; - - /// Serializes this VeilidConfigProtectedStore to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigProtectedStore - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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; - - /// Create a copy of VeilidConfigProtectedStore - /// with the given fields replaced by the non-null parameter values. - @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); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigBlockStore(directory: $directory, delete: $delete)'; } } /// @nodoc -abstract class _$$VeilidConfigProtectedStoreImplCopyWith<$Res> - implements $VeilidConfigProtectedStoreCopyWith<$Res> { - factory _$$VeilidConfigProtectedStoreImplCopyWith( - _$VeilidConfigProtectedStoreImpl value, - $Res Function(_$VeilidConfigProtectedStoreImpl) then) = - __$$VeilidConfigProtectedStoreImplCopyWithImpl<$Res>; - @override +abstract mixin class $VeilidConfigBlockStoreCopyWith<$Res> { + factory $VeilidConfigBlockStoreCopyWith(VeilidConfigBlockStore value, + $Res Function(VeilidConfigBlockStore) _then) = + _$VeilidConfigBlockStoreCopyWithImpl; @useResult - $Res call( - {bool allowInsecureFallback, - bool alwaysUseInsecureStorage, - String directory, - bool delete, - String deviceEncryptionKeyPassword, - String? newDeviceEncryptionKeyPassword}); + $Res call({String directory, bool delete}); } /// @nodoc -class __$$VeilidConfigProtectedStoreImplCopyWithImpl<$Res> - extends _$VeilidConfigProtectedStoreCopyWithImpl<$Res, - _$VeilidConfigProtectedStoreImpl> - implements _$$VeilidConfigProtectedStoreImplCopyWith<$Res> { - __$$VeilidConfigProtectedStoreImplCopyWithImpl( - _$VeilidConfigProtectedStoreImpl _value, - $Res Function(_$VeilidConfigProtectedStoreImpl) _then) - : super(_value, _then); +class _$VeilidConfigBlockStoreCopyWithImpl<$Res> + implements $VeilidConfigBlockStoreCopyWith<$Res> { + _$VeilidConfigBlockStoreCopyWithImpl(this._self, this._then); - /// Create a copy of VeilidConfigProtectedStore + final VeilidConfigBlockStore _self; + final $Res Function(VeilidConfigBlockStore) _then; + + /// Create a copy of VeilidConfigBlockStore /// with the given fields replaced by the non-null parameter values. @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(_$VeilidConfigProtectedStoreImpl( - 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, + return _then(_self.copyWith( directory: null == directory - ? _value.directory + ? _self.directory : directory // ignore: cast_nullable_to_non_nullable as String, delete: null == delete - ? _value.delete + ? _self.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 _$VeilidConfigProtectedStoreImpl +class _VeilidConfigBlockStore with DiagnosticableTreeMixin - implements _VeilidConfigProtectedStore { - const _$VeilidConfigProtectedStoreImpl( - {required this.allowInsecureFallback, - required this.alwaysUseInsecureStorage, - required this.directory, - required this.delete, - required this.deviceEncryptionKeyPassword, - this.newDeviceEncryptionKeyPassword}); + implements VeilidConfigBlockStore { + const _VeilidConfigBlockStore( + {required this.directory, required this.delete}); + factory _VeilidConfigBlockStore.fromJson(Map json) => + _$VeilidConfigBlockStoreFromJson(json); - factory _$VeilidConfigProtectedStoreImpl.fromJson( - Map json) => - _$$VeilidConfigProtectedStoreImplFromJson(json); - - @override - final bool allowInsecureFallback; - @override - final bool alwaysUseInsecureStorage; @override final String directory; @override final bool delete; + + /// Create a copy of VeilidConfigBlockStore + /// with the given fields replaced by the non-null parameter values. @override - final String deviceEncryptionKeyPassword; - @override - final String? newDeviceEncryptionKeyPassword; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigBlockStoreCopyWith<_VeilidConfigBlockStore> get copyWith => + __$VeilidConfigBlockStoreCopyWithImpl<_VeilidConfigBlockStore>( + this, _$identity); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidConfigProtectedStore(allowInsecureFallback: $allowInsecureFallback, alwaysUseInsecureStorage: $alwaysUseInsecureStorage, directory: $directory, delete: $delete, deviceEncryptionKeyPassword: $deviceEncryptionKeyPassword, newDeviceEncryptionKeyPassword: $newDeviceEncryptionKeyPassword)'; + Map toJson() { + return _$VeilidConfigBlockStoreToJson( + this, + ); } @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigBlockStore')) + ..add(DiagnosticsProperty('directory', directory)) + ..add(DiagnosticsProperty('delete', delete)); + } + + @override + bool operator ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, directory, delete); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigBlockStore(directory: $directory, delete: $delete)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidConfigBlockStoreCopyWith<$Res> + implements $VeilidConfigBlockStoreCopyWith<$Res> { + factory _$VeilidConfigBlockStoreCopyWith(_VeilidConfigBlockStore value, + $Res Function(_VeilidConfigBlockStore) _then) = + __$VeilidConfigBlockStoreCopyWithImpl; + @override + @useResult + $Res call({String directory, bool delete}); +} + +/// @nodoc +class __$VeilidConfigBlockStoreCopyWithImpl<$Res> + implements _$VeilidConfigBlockStoreCopyWith<$Res> { + __$VeilidConfigBlockStoreCopyWithImpl(this._self, this._then); + + final _VeilidConfigBlockStore _self; + final $Res Function(_VeilidConfigBlockStore) _then; + + /// Create a copy of VeilidConfigBlockStore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? directory = null, + Object? delete = null, + }) { + return _then(_VeilidConfigBlockStore( + directory: null == directory + ? _self.directory + : directory // ignore: cast_nullable_to_non_nullable + as String, + delete: null == delete + ? _self.delete + : delete // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @nodoc +mixin _$VeilidConfigProtectedStore implements DiagnosticableTreeMixin { + bool get allowInsecureFallback; + bool get alwaysUseInsecureStorage; + String get directory; + bool get delete; + String get deviceEncryptionKeyPassword; + String? get newDeviceEncryptionKeyPassword; + + /// Create a copy of VeilidConfigProtectedStore + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigProtectedStoreCopyWith + get copyWith => + _$VeilidConfigProtectedStoreCopyWithImpl( + this as VeilidConfigProtectedStore, _$identity); + + /// Serializes this VeilidConfigProtectedStore to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidConfigProtectedStore')) ..add(DiagnosticsProperty('allowInsecureFallback', allowInsecureFallback)) @@ -7045,7 +7039,7 @@ class _$VeilidConfigProtectedStoreImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigProtectedStoreImpl && + other is VeilidConfigProtectedStore && (identical(other.allowInsecureFallback, allowInsecureFallback) || other.allowInsecureFallback == allowInsecureFallback) && (identical( @@ -7075,178 +7069,259 @@ class _$VeilidConfigProtectedStoreImpl deviceEncryptionKeyPassword, newDeviceEncryptionKeyPassword); - /// Create a copy of VeilidConfigProtectedStore - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigProtectedStoreImplCopyWith<_$VeilidConfigProtectedStoreImpl> - get copyWith => __$$VeilidConfigProtectedStoreImplCopyWithImpl< - _$VeilidConfigProtectedStoreImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigProtectedStoreImplToJson( - 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}) = - _$VeilidConfigProtectedStoreImpl; - - factory _VeilidConfigProtectedStore.fromJson(Map json) = - _$VeilidConfigProtectedStoreImpl.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; - - /// Create a copy of VeilidConfigProtectedStore - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigProtectedStoreImplCopyWith<_$VeilidConfigProtectedStoreImpl> - get copyWith => throw _privateConstructorUsedError; -} - -VeilidConfigCapabilities _$VeilidConfigCapabilitiesFromJson( - Map json) { - return _VeilidConfigCapabilities.fromJson(json); -} - -/// @nodoc -mixin _$VeilidConfigCapabilities { - List get disable => throw _privateConstructorUsedError; - - /// Serializes this VeilidConfigCapabilities to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfigCapabilities - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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; - - /// Create a copy of VeilidConfigCapabilities - /// with the given fields replaced by the non-null parameter values. - @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); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigProtectedStore(allowInsecureFallback: $allowInsecureFallback, alwaysUseInsecureStorage: $alwaysUseInsecureStorage, directory: $directory, delete: $delete, deviceEncryptionKeyPassword: $deviceEncryptionKeyPassword, newDeviceEncryptionKeyPassword: $newDeviceEncryptionKeyPassword)'; } } /// @nodoc -abstract class _$$VeilidConfigCapabilitiesImplCopyWith<$Res> - implements $VeilidConfigCapabilitiesCopyWith<$Res> { - factory _$$VeilidConfigCapabilitiesImplCopyWith( - _$VeilidConfigCapabilitiesImpl value, - $Res Function(_$VeilidConfigCapabilitiesImpl) then) = - __$$VeilidConfigCapabilitiesImplCopyWithImpl<$Res>; - @override +abstract mixin class $VeilidConfigProtectedStoreCopyWith<$Res> { + factory $VeilidConfigProtectedStoreCopyWith(VeilidConfigProtectedStore value, + $Res Function(VeilidConfigProtectedStore) _then) = + _$VeilidConfigProtectedStoreCopyWithImpl; @useResult - $Res call({List disable}); + $Res call( + {bool allowInsecureFallback, + bool alwaysUseInsecureStorage, + String directory, + bool delete, + String deviceEncryptionKeyPassword, + String? newDeviceEncryptionKeyPassword}); } /// @nodoc -class __$$VeilidConfigCapabilitiesImplCopyWithImpl<$Res> - extends _$VeilidConfigCapabilitiesCopyWithImpl<$Res, - _$VeilidConfigCapabilitiesImpl> - implements _$$VeilidConfigCapabilitiesImplCopyWith<$Res> { - __$$VeilidConfigCapabilitiesImplCopyWithImpl( - _$VeilidConfigCapabilitiesImpl _value, - $Res Function(_$VeilidConfigCapabilitiesImpl) _then) - : super(_value, _then); +class _$VeilidConfigProtectedStoreCopyWithImpl<$Res> + implements $VeilidConfigProtectedStoreCopyWith<$Res> { + _$VeilidConfigProtectedStoreCopyWithImpl(this._self, this._then); - /// Create a copy of VeilidConfigCapabilities + final VeilidConfigProtectedStore _self; + final $Res Function(VeilidConfigProtectedStore) _then; + + /// Create a copy of VeilidConfigProtectedStore /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? disable = null, + Object? allowInsecureFallback = null, + Object? alwaysUseInsecureStorage = null, + Object? directory = null, + Object? delete = null, + Object? deviceEncryptionKeyPassword = null, + Object? newDeviceEncryptionKeyPassword = freezed, }) { - return _then(_$VeilidConfigCapabilitiesImpl( - disable: null == disable - ? _value._disable - : disable // ignore: cast_nullable_to_non_nullable - as List, + return _then(_self.copyWith( + allowInsecureFallback: null == allowInsecureFallback + ? _self.allowInsecureFallback + : allowInsecureFallback // ignore: cast_nullable_to_non_nullable + as bool, + alwaysUseInsecureStorage: null == alwaysUseInsecureStorage + ? _self.alwaysUseInsecureStorage + : alwaysUseInsecureStorage // ignore: cast_nullable_to_non_nullable + as bool, + directory: null == directory + ? _self.directory + : directory // ignore: cast_nullable_to_non_nullable + as String, + delete: null == delete + ? _self.delete + : delete // ignore: cast_nullable_to_non_nullable + as bool, + deviceEncryptionKeyPassword: null == deviceEncryptionKeyPassword + ? _self.deviceEncryptionKeyPassword + : deviceEncryptionKeyPassword // ignore: cast_nullable_to_non_nullable + as String, + newDeviceEncryptionKeyPassword: freezed == newDeviceEncryptionKeyPassword + ? _self.newDeviceEncryptionKeyPassword + : newDeviceEncryptionKeyPassword // ignore: cast_nullable_to_non_nullable + as String?, )); } } /// @nodoc @JsonSerializable() -class _$VeilidConfigCapabilitiesImpl +class _VeilidConfigProtectedStore with DiagnosticableTreeMixin - implements _VeilidConfigCapabilities { - const _$VeilidConfigCapabilitiesImpl({required final List disable}) - : _disable = disable; - - factory _$VeilidConfigCapabilitiesImpl.fromJson(Map json) => - _$$VeilidConfigCapabilitiesImplFromJson(json); - - final List _disable; - @override - List get disable { - if (_disable is EqualUnmodifiableListView) return _disable; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_disable); - } + 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 - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { - return 'VeilidConfigCapabilities(disable: $disable)'; + final bool allowInsecureFallback; + @override + final bool alwaysUseInsecureStorage; + @override + final String directory; + @override + final bool delete; + @override + final String deviceEncryptionKeyPassword; + @override + final String? newDeviceEncryptionKeyPassword; + + /// Create a copy of VeilidConfigProtectedStore + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigProtectedStoreCopyWith<_VeilidConfigProtectedStore> + get copyWith => __$VeilidConfigProtectedStoreCopyWithImpl< + _VeilidConfigProtectedStore>(this, _$identity); + + @override + Map toJson() { + return _$VeilidConfigProtectedStoreToJson( + this, + ); } @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 ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + allowInsecureFallback, + alwaysUseInsecureStorage, + directory, + delete, + deviceEncryptionKeyPassword, + newDeviceEncryptionKeyPassword); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigProtectedStore(allowInsecureFallback: $allowInsecureFallback, alwaysUseInsecureStorage: $alwaysUseInsecureStorage, directory: $directory, delete: $delete, deviceEncryptionKeyPassword: $deviceEncryptionKeyPassword, newDeviceEncryptionKeyPassword: $newDeviceEncryptionKeyPassword)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidConfigProtectedStoreCopyWith<$Res> + implements $VeilidConfigProtectedStoreCopyWith<$Res> { + factory _$VeilidConfigProtectedStoreCopyWith( + _VeilidConfigProtectedStore value, + $Res Function(_VeilidConfigProtectedStore) _then) = + __$VeilidConfigProtectedStoreCopyWithImpl; + @override + @useResult + $Res call( + {bool allowInsecureFallback, + bool alwaysUseInsecureStorage, + String directory, + bool delete, + String deviceEncryptionKeyPassword, + String? newDeviceEncryptionKeyPassword}); +} + +/// @nodoc +class __$VeilidConfigProtectedStoreCopyWithImpl<$Res> + implements _$VeilidConfigProtectedStoreCopyWith<$Res> { + __$VeilidConfigProtectedStoreCopyWithImpl(this._self, this._then); + + final _VeilidConfigProtectedStore _self; + final $Res Function(_VeilidConfigProtectedStore) _then; + + /// Create a copy of VeilidConfigProtectedStore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $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 + ? _self.allowInsecureFallback + : allowInsecureFallback // ignore: cast_nullable_to_non_nullable + as bool, + alwaysUseInsecureStorage: null == alwaysUseInsecureStorage + ? _self.alwaysUseInsecureStorage + : alwaysUseInsecureStorage // ignore: cast_nullable_to_non_nullable + as bool, + directory: null == directory + ? _self.directory + : directory // ignore: cast_nullable_to_non_nullable + as String, + delete: null == delete + ? _self.delete + : delete // ignore: cast_nullable_to_non_nullable + as bool, + deviceEncryptionKeyPassword: null == deviceEncryptionKeyPassword + ? _self.deviceEncryptionKeyPassword + : deviceEncryptionKeyPassword // ignore: cast_nullable_to_non_nullable + as String, + newDeviceEncryptionKeyPassword: freezed == newDeviceEncryptionKeyPassword + ? _self.newDeviceEncryptionKeyPassword + : newDeviceEncryptionKeyPassword // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +mixin _$VeilidConfigCapabilities implements DiagnosticableTreeMixin { + List get disable; + + /// Create a copy of VeilidConfigCapabilities + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigCapabilitiesCopyWith get copyWith => + _$VeilidConfigCapabilitiesCopyWithImpl( + this as VeilidConfigCapabilities, _$identity); + + /// Serializes this VeilidConfigCapabilities to a JSON map. + Map toJson(); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'VeilidConfigCapabilities')) ..add(DiagnosticsProperty('disable', disable)); @@ -7256,7 +7331,100 @@ class _$VeilidConfigCapabilitiesImpl bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigCapabilitiesImpl && + other is VeilidConfigCapabilities && + const DeepCollectionEquality().equals(other.disable, disable)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, const DeepCollectionEquality().hash(disable)); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigCapabilities(disable: $disable)'; + } +} + +/// @nodoc +abstract mixin class $VeilidConfigCapabilitiesCopyWith<$Res> { + factory $VeilidConfigCapabilitiesCopyWith(VeilidConfigCapabilities value, + $Res Function(VeilidConfigCapabilities) _then) = + _$VeilidConfigCapabilitiesCopyWithImpl; + @useResult + $Res call({List disable}); +} + +/// @nodoc +class _$VeilidConfigCapabilitiesCopyWithImpl<$Res> + implements $VeilidConfigCapabilitiesCopyWith<$Res> { + _$VeilidConfigCapabilitiesCopyWithImpl(this._self, this._then); + + final VeilidConfigCapabilities _self; + final $Res Function(VeilidConfigCapabilities) _then; + + /// Create a copy of VeilidConfigCapabilities + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? disable = null, + }) { + return _then(_self.copyWith( + disable: null == disable + ? _self.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); + } + + /// Create a copy of VeilidConfigCapabilities + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidConfigCapabilitiesCopyWith<_VeilidConfigCapabilities> get copyWith => + __$VeilidConfigCapabilitiesCopyWithImpl<_VeilidConfigCapabilities>( + this, _$identity); + + @override + Map toJson() { + return _$VeilidConfigCapabilitiesToJson( + this, + ); + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'VeilidConfigCapabilities')) + ..add(DiagnosticsProperty('disable', disable)); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _VeilidConfigCapabilities && const DeepCollectionEquality().equals(other._disable, _disable)); } @@ -7265,318 +7433,70 @@ class _$VeilidConfigCapabilitiesImpl int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_disable)); - /// Create a copy of VeilidConfigCapabilities - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigCapabilitiesImplCopyWith<_$VeilidConfigCapabilitiesImpl> - get copyWith => __$$VeilidConfigCapabilitiesImplCopyWithImpl< - _$VeilidConfigCapabilitiesImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigCapabilitiesImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfigCapabilities(disable: $disable)'; } } -abstract class _VeilidConfigCapabilities implements VeilidConfigCapabilities { - const factory _VeilidConfigCapabilities( - {required final List disable}) = _$VeilidConfigCapabilitiesImpl; - - factory _VeilidConfigCapabilities.fromJson(Map json) = - _$VeilidConfigCapabilitiesImpl.fromJson; - +/// @nodoc +abstract mixin class _$VeilidConfigCapabilitiesCopyWith<$Res> + implements $VeilidConfigCapabilitiesCopyWith<$Res> { + factory _$VeilidConfigCapabilitiesCopyWith(_VeilidConfigCapabilities value, + $Res Function(_VeilidConfigCapabilities) _then) = + __$VeilidConfigCapabilitiesCopyWithImpl; @override - List get disable; + @useResult + $Res call({List disable}); +} + +/// @nodoc +class __$VeilidConfigCapabilitiesCopyWithImpl<$Res> + implements _$VeilidConfigCapabilitiesCopyWith<$Res> { + __$VeilidConfigCapabilitiesCopyWithImpl(this._self, this._then); + + final _VeilidConfigCapabilities _self; + final $Res Function(_VeilidConfigCapabilities) _then; /// Create a copy of VeilidConfigCapabilities /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigCapabilitiesImplCopyWith<_$VeilidConfigCapabilitiesImpl> - 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; - - /// Serializes this VeilidConfig to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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; - - /// Create a copy of VeilidConfig - /// with the given fields replaced by the non-null parameter values. @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, + Object? disable = 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); - } - - /// Create a copy of VeilidConfig - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidConfigCapabilitiesCopyWith<$Res> get capabilities { - return $VeilidConfigCapabilitiesCopyWith<$Res>(_value.capabilities, - (value) { - return _then(_value.copyWith(capabilities: value) as $Val); - }); - } - - /// Create a copy of VeilidConfig - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidConfigProtectedStoreCopyWith<$Res> get protectedStore { - return $VeilidConfigProtectedStoreCopyWith<$Res>(_value.protectedStore, - (value) { - return _then(_value.copyWith(protectedStore: value) as $Val); - }); - } - - /// Create a copy of VeilidConfig - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidConfigTableStoreCopyWith<$Res> get tableStore { - return $VeilidConfigTableStoreCopyWith<$Res>(_value.tableStore, (value) { - return _then(_value.copyWith(tableStore: value) as $Val); - }); - } - - /// Create a copy of VeilidConfig - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidConfigBlockStoreCopyWith<$Res> get blockStore { - return $VeilidConfigBlockStoreCopyWith<$Res>(_value.blockStore, (value) { - return _then(_value.copyWith(blockStore: value) as $Val); - }); - } - - /// Create a copy of VeilidConfig - /// with the given fields replaced by the non-null parameter values. - @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 _$$VeilidConfigImplCopyWith<$Res> - implements $VeilidConfigCopyWith<$Res> { - factory _$$VeilidConfigImplCopyWith( - _$VeilidConfigImpl value, $Res Function(_$VeilidConfigImpl) then) = - __$$VeilidConfigImplCopyWithImpl<$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 __$$VeilidConfigImplCopyWithImpl<$Res> - extends _$VeilidConfigCopyWithImpl<$Res, _$VeilidConfigImpl> - implements _$$VeilidConfigImplCopyWith<$Res> { - __$$VeilidConfigImplCopyWithImpl( - _$VeilidConfigImpl _value, $Res Function(_$VeilidConfigImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidConfig - /// with the given fields replaced by the non-null parameter values. - @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(_$VeilidConfigImpl( - 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, + return _then(_VeilidConfigCapabilities( + disable: null == disable + ? _self._disable + : disable // ignore: cast_nullable_to_non_nullable + as List, )); } } /// @nodoc -@JsonSerializable() -class _$VeilidConfigImpl with DiagnosticableTreeMixin implements _VeilidConfig { - const _$VeilidConfigImpl( - {required this.programName, - required this.namespace, - required this.capabilities, - required this.protectedStore, - required this.tableStore, - required this.blockStore, - required this.network}); +mixin _$VeilidConfig implements DiagnosticableTreeMixin { + String get programName; + String get namespace; + VeilidConfigCapabilities get capabilities; + VeilidConfigProtectedStore get protectedStore; + VeilidConfigTableStore get tableStore; + VeilidConfigBlockStore get blockStore; + VeilidConfigNetwork get network; - factory _$VeilidConfigImpl.fromJson(Map json) => - _$$VeilidConfigImplFromJson(json); + /// Create a copy of VeilidConfig + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidConfigCopyWith get copyWith => + _$VeilidConfigCopyWithImpl( + this as VeilidConfig, _$identity); - @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)'; - } + /// Serializes this VeilidConfig to a JSON map. + Map toJson(); @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); properties ..add(DiagnosticsProperty('type', 'VeilidConfig')) ..add(DiagnosticsProperty('programName', programName)) @@ -7592,7 +7512,7 @@ class _$VeilidConfigImpl with DiagnosticableTreeMixin implements _VeilidConfig { bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidConfigImpl && + other is VeilidConfig && (identical(other.programName, programName) || other.programName == programName) && (identical(other.namespace, namespace) || @@ -7613,54 +7533,358 @@ class _$VeilidConfigImpl with DiagnosticableTreeMixin implements _VeilidConfig { int get hashCode => Object.hash(runtimeType, programName, namespace, capabilities, protectedStore, tableStore, blockStore, network); - /// Create a copy of VeilidConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidConfigImplCopyWith<_$VeilidConfigImpl> get copyWith => - __$$VeilidConfigImplCopyWithImpl<_$VeilidConfigImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidConfigImplToJson( - this, - ); + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfig(programName: $programName, namespace: $namespace, capabilities: $capabilities, protectedStore: $protectedStore, tableStore: $tableStore, blockStore: $blockStore, network: $network)'; } } -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}) = _$VeilidConfigImpl; +/// @nodoc +abstract mixin class $VeilidConfigCopyWith<$Res> { + factory $VeilidConfigCopyWith( + VeilidConfig value, $Res Function(VeilidConfig) _then) = + _$VeilidConfigCopyWithImpl; + @useResult + $Res call( + {String programName, + String namespace, + VeilidConfigCapabilities capabilities, + VeilidConfigProtectedStore protectedStore, + VeilidConfigTableStore tableStore, + VeilidConfigBlockStore blockStore, + VeilidConfigNetwork network}); - factory _VeilidConfig.fromJson(Map json) = - _$VeilidConfigImpl.fromJson; + $VeilidConfigCapabilitiesCopyWith<$Res> get capabilities; + $VeilidConfigProtectedStoreCopyWith<$Res> get protectedStore; + $VeilidConfigTableStoreCopyWith<$Res> get tableStore; + $VeilidConfigBlockStoreCopyWith<$Res> get blockStore; + $VeilidConfigNetworkCopyWith<$Res> get network; +} + +/// @nodoc +class _$VeilidConfigCopyWithImpl<$Res> implements $VeilidConfigCopyWith<$Res> { + _$VeilidConfigCopyWithImpl(this._self, this._then); + + final VeilidConfig _self; + final $Res Function(VeilidConfig) _then; + + /// Create a copy of VeilidConfig + /// with the given fields replaced by the non-null parameter values. + @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(_self.copyWith( + programName: null == programName + ? _self.programName + : programName // ignore: cast_nullable_to_non_nullable + as String, + namespace: null == namespace + ? _self.namespace + : namespace // ignore: cast_nullable_to_non_nullable + as String, + capabilities: null == capabilities + ? _self.capabilities + : capabilities // ignore: cast_nullable_to_non_nullable + as VeilidConfigCapabilities, + protectedStore: null == protectedStore + ? _self.protectedStore + : protectedStore // ignore: cast_nullable_to_non_nullable + as VeilidConfigProtectedStore, + tableStore: null == tableStore + ? _self.tableStore + : tableStore // ignore: cast_nullable_to_non_nullable + as VeilidConfigTableStore, + blockStore: null == blockStore + ? _self.blockStore + : blockStore // ignore: cast_nullable_to_non_nullable + as VeilidConfigBlockStore, + network: null == network + ? _self.network + : network // ignore: cast_nullable_to_non_nullable + as VeilidConfigNetwork, + )); + } + + /// Create a copy of VeilidConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigCapabilitiesCopyWith<$Res> get capabilities { + return $VeilidConfigCapabilitiesCopyWith<$Res>(_self.capabilities, (value) { + return _then(_self.copyWith(capabilities: value)); + }); + } + + /// Create a copy of VeilidConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigProtectedStoreCopyWith<$Res> get protectedStore { + return $VeilidConfigProtectedStoreCopyWith<$Res>(_self.protectedStore, + (value) { + return _then(_self.copyWith(protectedStore: value)); + }); + } + + /// Create a copy of VeilidConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigTableStoreCopyWith<$Res> get tableStore { + return $VeilidConfigTableStoreCopyWith<$Res>(_self.tableStore, (value) { + return _then(_self.copyWith(tableStore: value)); + }); + } + + /// Create a copy of VeilidConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigBlockStoreCopyWith<$Res> get blockStore { + return $VeilidConfigBlockStoreCopyWith<$Res>(_self.blockStore, (value) { + return _then(_self.copyWith(blockStore: value)); + }); + } + + /// Create a copy of VeilidConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigNetworkCopyWith<$Res> get network { + return $VeilidConfigNetworkCopyWith<$Res>(_self.network, (value) { + return _then(_self.copyWith(network: value)); + }); + } +} + +/// @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 - String get programName; + final String programName; @override - String get namespace; + final String namespace; @override - VeilidConfigCapabilities get capabilities; + final VeilidConfigCapabilities capabilities; @override - VeilidConfigProtectedStore get protectedStore; + final VeilidConfigProtectedStore protectedStore; @override - VeilidConfigTableStore get tableStore; + final VeilidConfigTableStore tableStore; @override - VeilidConfigBlockStore get blockStore; + final VeilidConfigBlockStore blockStore; @override - VeilidConfigNetwork get network; + final VeilidConfigNetwork network; /// Create a copy of VeilidConfig /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidConfigImplCopyWith<_$VeilidConfigImpl> get copyWith => - throw _privateConstructorUsedError; + @pragma('vm:prefer-inline') + _$VeilidConfigCopyWith<_VeilidConfig> get copyWith => + __$VeilidConfigCopyWithImpl<_VeilidConfig>(this, _$identity); + + @override + Map toJson() { + return _$VeilidConfigToJson( + this, + ); + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder 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 ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, programName, namespace, + capabilities, protectedStore, tableStore, blockStore, network); + + @override + String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + return 'VeilidConfig(programName: $programName, namespace: $namespace, capabilities: $capabilities, protectedStore: $protectedStore, tableStore: $tableStore, blockStore: $blockStore, network: $network)'; + } } + +/// @nodoc +abstract mixin class _$VeilidConfigCopyWith<$Res> + implements $VeilidConfigCopyWith<$Res> { + factory _$VeilidConfigCopyWith( + _VeilidConfig value, $Res Function(_VeilidConfig) _then) = + __$VeilidConfigCopyWithImpl; + @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> + implements _$VeilidConfigCopyWith<$Res> { + __$VeilidConfigCopyWithImpl(this._self, this._then); + + final _VeilidConfig _self; + final $Res Function(_VeilidConfig) _then; + + /// Create a copy of VeilidConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $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 + ? _self.programName + : programName // ignore: cast_nullable_to_non_nullable + as String, + namespace: null == namespace + ? _self.namespace + : namespace // ignore: cast_nullable_to_non_nullable + as String, + capabilities: null == capabilities + ? _self.capabilities + : capabilities // ignore: cast_nullable_to_non_nullable + as VeilidConfigCapabilities, + protectedStore: null == protectedStore + ? _self.protectedStore + : protectedStore // ignore: cast_nullable_to_non_nullable + as VeilidConfigProtectedStore, + tableStore: null == tableStore + ? _self.tableStore + : tableStore // ignore: cast_nullable_to_non_nullable + as VeilidConfigTableStore, + blockStore: null == blockStore + ? _self.blockStore + : blockStore // ignore: cast_nullable_to_non_nullable + as VeilidConfigBlockStore, + network: null == network + ? _self.network + : network // ignore: cast_nullable_to_non_nullable + as VeilidConfigNetwork, + )); + } + + /// Create a copy of VeilidConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigCapabilitiesCopyWith<$Res> get capabilities { + return $VeilidConfigCapabilitiesCopyWith<$Res>(_self.capabilities, (value) { + return _then(_self.copyWith(capabilities: value)); + }); + } + + /// Create a copy of VeilidConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigProtectedStoreCopyWith<$Res> get protectedStore { + return $VeilidConfigProtectedStoreCopyWith<$Res>(_self.protectedStore, + (value) { + return _then(_self.copyWith(protectedStore: value)); + }); + } + + /// Create a copy of VeilidConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigTableStoreCopyWith<$Res> get tableStore { + return $VeilidConfigTableStoreCopyWith<$Res>(_self.tableStore, (value) { + return _then(_self.copyWith(tableStore: value)); + }); + } + + /// Create a copy of VeilidConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigBlockStoreCopyWith<$Res> get blockStore { + return $VeilidConfigBlockStoreCopyWith<$Res>(_self.blockStore, (value) { + return _then(_self.copyWith(blockStore: value)); + }); + } + + /// Create a copy of VeilidConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigNetworkCopyWith<$Res> get network { + return $VeilidConfigNetworkCopyWith<$Res>(_self.network, (value) { + return _then(_self.copyWith(network: value)); + }); + } +} + +// dart format on diff --git a/veilid-flutter/lib/veilid_config.g.dart b/veilid-flutter/lib/veilid_config.g.dart index 1e881819..8f0fe7ba 100644 --- a/veilid-flutter/lib/veilid_config.g.dart +++ b/veilid-flutter/lib/veilid_config.g.dart @@ -6,28 +6,28 @@ part of 'veilid_config.dart'; // JsonSerializableGenerator // ************************************************************************** -_$VeilidFFIConfigLoggingTerminalImpl - _$$VeilidFFIConfigLoggingTerminalImplFromJson(Map json) => - _$VeilidFFIConfigLoggingTerminalImpl( - enabled: json['enabled'] as bool, - level: VeilidConfigLogLevel.fromJson(json['level']), - ignoreLogTargets: (json['ignore_log_targets'] as List?) - ?.map((e) => e as String) - .toList() ?? - const [], - ); +_VeilidFFIConfigLoggingTerminal _$VeilidFFIConfigLoggingTerminalFromJson( + Map json) => + _VeilidFFIConfigLoggingTerminal( + enabled: json['enabled'] as bool, + level: VeilidConfigLogLevel.fromJson(json['level']), + ignoreLogTargets: (json['ignore_log_targets'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + ); -Map _$$VeilidFFIConfigLoggingTerminalImplToJson( - _$VeilidFFIConfigLoggingTerminalImpl instance) => +Map _$VeilidFFIConfigLoggingTerminalToJson( + _VeilidFFIConfigLoggingTerminal instance) => { 'enabled': instance.enabled, 'level': instance.level.toJson(), 'ignore_log_targets': instance.ignoreLogTargets, }; -_$VeilidFFIConfigLoggingOtlpImpl _$$VeilidFFIConfigLoggingOtlpImplFromJson( +_VeilidFFIConfigLoggingOtlp _$VeilidFFIConfigLoggingOtlpFromJson( Map json) => - _$VeilidFFIConfigLoggingOtlpImpl( + _VeilidFFIConfigLoggingOtlp( enabled: json['enabled'] as bool, level: VeilidConfigLogLevel.fromJson(json['level']), grpcEndpoint: json['grpc_endpoint'] as String, @@ -38,8 +38,8 @@ _$VeilidFFIConfigLoggingOtlpImpl _$$VeilidFFIConfigLoggingOtlpImplFromJson( const [], ); -Map _$$VeilidFFIConfigLoggingOtlpImplToJson( - _$VeilidFFIConfigLoggingOtlpImpl instance) => +Map _$VeilidFFIConfigLoggingOtlpToJson( + _VeilidFFIConfigLoggingOtlp instance) => { 'enabled': instance.enabled, 'level': instance.level.toJson(), @@ -48,9 +48,9 @@ Map _$$VeilidFFIConfigLoggingOtlpImplToJson( 'ignore_log_targets': instance.ignoreLogTargets, }; -_$VeilidFFIConfigLoggingApiImpl _$$VeilidFFIConfigLoggingApiImplFromJson( +_VeilidFFIConfigLoggingApi _$VeilidFFIConfigLoggingApiFromJson( Map json) => - _$VeilidFFIConfigLoggingApiImpl( + _VeilidFFIConfigLoggingApi( enabled: json['enabled'] as bool, level: VeilidConfigLogLevel.fromJson(json['level']), ignoreLogTargets: (json['ignore_log_targets'] as List?) @@ -59,39 +59,39 @@ _$VeilidFFIConfigLoggingApiImpl _$$VeilidFFIConfigLoggingApiImplFromJson( const [], ); -Map _$$VeilidFFIConfigLoggingApiImplToJson( - _$VeilidFFIConfigLoggingApiImpl instance) => +Map _$VeilidFFIConfigLoggingApiToJson( + _VeilidFFIConfigLoggingApi instance) => { 'enabled': instance.enabled, 'level': instance.level.toJson(), 'ignore_log_targets': instance.ignoreLogTargets, }; -_$VeilidFFIConfigLoggingFlameImpl _$$VeilidFFIConfigLoggingFlameImplFromJson( +_VeilidFFIConfigLoggingFlame _$VeilidFFIConfigLoggingFlameFromJson( Map json) => - _$VeilidFFIConfigLoggingFlameImpl( + _VeilidFFIConfigLoggingFlame( enabled: json['enabled'] as bool, path: json['path'] as String, ); -Map _$$VeilidFFIConfigLoggingFlameImplToJson( - _$VeilidFFIConfigLoggingFlameImpl instance) => +Map _$VeilidFFIConfigLoggingFlameToJson( + _VeilidFFIConfigLoggingFlame instance) => { 'enabled': instance.enabled, 'path': instance.path, }; -_$VeilidFFIConfigLoggingImpl _$$VeilidFFIConfigLoggingImplFromJson( +_VeilidFFIConfigLogging _$VeilidFFIConfigLoggingFromJson( Map json) => - _$VeilidFFIConfigLoggingImpl( + _VeilidFFIConfigLogging( terminal: VeilidFFIConfigLoggingTerminal.fromJson(json['terminal']), otlp: VeilidFFIConfigLoggingOtlp.fromJson(json['otlp']), api: VeilidFFIConfigLoggingApi.fromJson(json['api']), flame: VeilidFFIConfigLoggingFlame.fromJson(json['flame']), ); -Map _$$VeilidFFIConfigLoggingImplToJson( - _$VeilidFFIConfigLoggingImpl instance) => +Map _$VeilidFFIConfigLoggingToJson( + _VeilidFFIConfigLogging instance) => { 'terminal': instance.terminal.toJson(), 'otlp': instance.otlp.toJson(), @@ -99,22 +99,19 @@ Map _$$VeilidFFIConfigLoggingImplToJson( 'flame': instance.flame.toJson(), }; -_$VeilidFFIConfigImpl _$$VeilidFFIConfigImplFromJson( - Map json) => - _$VeilidFFIConfigImpl( +_VeilidFFIConfig _$VeilidFFIConfigFromJson(Map json) => + _VeilidFFIConfig( logging: VeilidFFIConfigLogging.fromJson(json['logging']), ); -Map _$$VeilidFFIConfigImplToJson( - _$VeilidFFIConfigImpl instance) => +Map _$VeilidFFIConfigToJson(_VeilidFFIConfig instance) => { 'logging': instance.logging.toJson(), }; -_$VeilidWASMConfigLoggingPerformanceImpl - _$$VeilidWASMConfigLoggingPerformanceImplFromJson( - Map json) => - _$VeilidWASMConfigLoggingPerformanceImpl( +_VeilidWASMConfigLoggingPerformance + _$VeilidWASMConfigLoggingPerformanceFromJson(Map json) => + _VeilidWASMConfigLoggingPerformance( enabled: json['enabled'] as bool, level: VeilidConfigLogLevel.fromJson(json['level']), logsInTimings: json['logs_in_timings'] as bool, @@ -125,8 +122,8 @@ _$VeilidWASMConfigLoggingPerformanceImpl const [], ); -Map _$$VeilidWASMConfigLoggingPerformanceImplToJson( - _$VeilidWASMConfigLoggingPerformanceImpl instance) => +Map _$VeilidWASMConfigLoggingPerformanceToJson( + _VeilidWASMConfigLoggingPerformance instance) => { 'enabled': instance.enabled, 'level': instance.level.toJson(), @@ -135,9 +132,9 @@ Map _$$VeilidWASMConfigLoggingPerformanceImplToJson( 'ignore_log_targets': instance.ignoreLogTargets, }; -_$VeilidWASMConfigLoggingApiImpl _$$VeilidWASMConfigLoggingApiImplFromJson( +_VeilidWASMConfigLoggingApi _$VeilidWASMConfigLoggingApiFromJson( Map json) => - _$VeilidWASMConfigLoggingApiImpl( + _VeilidWASMConfigLoggingApi( enabled: json['enabled'] as bool, level: VeilidConfigLogLevel.fromJson(json['level']), ignoreLogTargets: (json['ignore_log_targets'] as List?) @@ -146,52 +143,48 @@ _$VeilidWASMConfigLoggingApiImpl _$$VeilidWASMConfigLoggingApiImplFromJson( const [], ); -Map _$$VeilidWASMConfigLoggingApiImplToJson( - _$VeilidWASMConfigLoggingApiImpl instance) => +Map _$VeilidWASMConfigLoggingApiToJson( + _VeilidWASMConfigLoggingApi instance) => { 'enabled': instance.enabled, 'level': instance.level.toJson(), 'ignore_log_targets': instance.ignoreLogTargets, }; -_$VeilidWASMConfigLoggingImpl _$$VeilidWASMConfigLoggingImplFromJson( +_VeilidWASMConfigLogging _$VeilidWASMConfigLoggingFromJson( Map json) => - _$VeilidWASMConfigLoggingImpl( + _VeilidWASMConfigLogging( performance: VeilidWASMConfigLoggingPerformance.fromJson(json['performance']), api: VeilidWASMConfigLoggingApi.fromJson(json['api']), ); -Map _$$VeilidWASMConfigLoggingImplToJson( - _$VeilidWASMConfigLoggingImpl instance) => +Map _$VeilidWASMConfigLoggingToJson( + _VeilidWASMConfigLogging instance) => { 'performance': instance.performance.toJson(), 'api': instance.api.toJson(), }; -_$VeilidWASMConfigImpl _$$VeilidWASMConfigImplFromJson( - Map json) => - _$VeilidWASMConfigImpl( +_VeilidWASMConfig _$VeilidWASMConfigFromJson(Map json) => + _VeilidWASMConfig( logging: VeilidWASMConfigLogging.fromJson(json['logging']), ); -Map _$$VeilidWASMConfigImplToJson( - _$VeilidWASMConfigImpl instance) => +Map _$VeilidWASMConfigToJson(_VeilidWASMConfig instance) => { 'logging': instance.logging.toJson(), }; -_$VeilidConfigHTTPSImpl _$$VeilidConfigHTTPSImplFromJson( - Map json) => - _$VeilidConfigHTTPSImpl( +_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 _$$VeilidConfigHTTPSImplToJson( - _$VeilidConfigHTTPSImpl instance) => +Map _$VeilidConfigHTTPSToJson(_VeilidConfigHTTPS instance) => { 'enabled': instance.enabled, 'listen_address': instance.listenAddress, @@ -199,17 +192,15 @@ Map _$$VeilidConfigHTTPSImplToJson( 'url': instance.url, }; -_$VeilidConfigHTTPImpl _$$VeilidConfigHTTPImplFromJson( - Map json) => - _$VeilidConfigHTTPImpl( +_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 _$$VeilidConfigHTTPImplToJson( - _$VeilidConfigHTTPImpl instance) => +Map _$VeilidConfigHTTPToJson(_VeilidConfigHTTP instance) => { 'enabled': instance.enabled, 'listen_address': instance.listenAddress, @@ -217,31 +208,29 @@ Map _$$VeilidConfigHTTPImplToJson( 'url': instance.url, }; -_$VeilidConfigApplicationImpl _$$VeilidConfigApplicationImplFromJson( +_VeilidConfigApplication _$VeilidConfigApplicationFromJson( Map json) => - _$VeilidConfigApplicationImpl( + _VeilidConfigApplication( https: VeilidConfigHTTPS.fromJson(json['https']), http: VeilidConfigHTTP.fromJson(json['http']), ); -Map _$$VeilidConfigApplicationImplToJson( - _$VeilidConfigApplicationImpl instance) => +Map _$VeilidConfigApplicationToJson( + _VeilidConfigApplication instance) => { 'https': instance.https.toJson(), 'http': instance.http.toJson(), }; -_$VeilidConfigUDPImpl _$$VeilidConfigUDPImplFromJson( - Map json) => - _$VeilidConfigUDPImpl( +_VeilidConfigUDP _$VeilidConfigUDPFromJson(Map json) => + _VeilidConfigUDP( enabled: json['enabled'] as bool, socketPoolSize: (json['socket_pool_size'] as num).toInt(), listenAddress: json['listen_address'] as String, publicAddress: json['public_address'] as String?, ); -Map _$$VeilidConfigUDPImplToJson( - _$VeilidConfigUDPImpl instance) => +Map _$VeilidConfigUDPToJson(_VeilidConfigUDP instance) => { 'enabled': instance.enabled, 'socket_pool_size': instance.socketPoolSize, @@ -249,9 +238,8 @@ Map _$$VeilidConfigUDPImplToJson( 'public_address': instance.publicAddress, }; -_$VeilidConfigTCPImpl _$$VeilidConfigTCPImplFromJson( - Map json) => - _$VeilidConfigTCPImpl( +_VeilidConfigTCP _$VeilidConfigTCPFromJson(Map json) => + _VeilidConfigTCP( connect: json['connect'] as bool, listen: json['listen'] as bool, maxConnections: (json['max_connections'] as num).toInt(), @@ -259,8 +247,7 @@ _$VeilidConfigTCPImpl _$$VeilidConfigTCPImplFromJson( publicAddress: json['public_address'] as String?, ); -Map _$$VeilidConfigTCPImplToJson( - _$VeilidConfigTCPImpl instance) => +Map _$VeilidConfigTCPToJson(_VeilidConfigTCP instance) => { 'connect': instance.connect, 'listen': instance.listen, @@ -269,8 +256,8 @@ Map _$$VeilidConfigTCPImplToJson( 'public_address': instance.publicAddress, }; -_$VeilidConfigWSImpl _$$VeilidConfigWSImplFromJson(Map json) => - _$VeilidConfigWSImpl( +_VeilidConfigWS _$VeilidConfigWSFromJson(Map json) => + _VeilidConfigWS( connect: json['connect'] as bool, listen: json['listen'] as bool, maxConnections: (json['max_connections'] as num).toInt(), @@ -279,8 +266,7 @@ _$VeilidConfigWSImpl _$$VeilidConfigWSImplFromJson(Map json) => url: json['url'] as String?, ); -Map _$$VeilidConfigWSImplToJson( - _$VeilidConfigWSImpl instance) => +Map _$VeilidConfigWSToJson(_VeilidConfigWS instance) => { 'connect': instance.connect, 'listen': instance.listen, @@ -290,9 +276,8 @@ Map _$$VeilidConfigWSImplToJson( 'url': instance.url, }; -_$VeilidConfigWSSImpl _$$VeilidConfigWSSImplFromJson( - Map json) => - _$VeilidConfigWSSImpl( +_VeilidConfigWSS _$VeilidConfigWSSFromJson(Map json) => + _VeilidConfigWSS( connect: json['connect'] as bool, listen: json['listen'] as bool, maxConnections: (json['max_connections'] as num).toInt(), @@ -301,8 +286,7 @@ _$VeilidConfigWSSImpl _$$VeilidConfigWSSImplFromJson( url: json['url'] as String?, ); -Map _$$VeilidConfigWSSImplToJson( - _$VeilidConfigWSSImpl instance) => +Map _$VeilidConfigWSSToJson(_VeilidConfigWSS instance) => { 'connect': instance.connect, 'listen': instance.listen, @@ -312,17 +296,17 @@ Map _$$VeilidConfigWSSImplToJson( 'url': instance.url, }; -_$VeilidConfigProtocolImpl _$$VeilidConfigProtocolImplFromJson( +_VeilidConfigProtocol _$VeilidConfigProtocolFromJson( Map json) => - _$VeilidConfigProtocolImpl( + _VeilidConfigProtocol( udp: VeilidConfigUDP.fromJson(json['udp']), tcp: VeilidConfigTCP.fromJson(json['tcp']), ws: VeilidConfigWS.fromJson(json['ws']), wss: VeilidConfigWSS.fromJson(json['wss']), ); -Map _$$VeilidConfigProtocolImplToJson( - _$VeilidConfigProtocolImpl instance) => +Map _$VeilidConfigProtocolToJson( + _VeilidConfigProtocol instance) => { 'udp': instance.udp.toJson(), 'tcp': instance.tcp.toJson(), @@ -330,26 +314,23 @@ Map _$$VeilidConfigProtocolImplToJson( 'wss': instance.wss.toJson(), }; -_$VeilidConfigTLSImpl _$$VeilidConfigTLSImplFromJson( - Map json) => - _$VeilidConfigTLSImpl( +_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 num).toInt(), ); -Map _$$VeilidConfigTLSImplToJson( - _$VeilidConfigTLSImpl instance) => +Map _$VeilidConfigTLSToJson(_VeilidConfigTLS instance) => { 'certificate_path': instance.certificatePath, 'private_key_path': instance.privateKeyPath, 'connection_initial_timeout_ms': instance.connectionInitialTimeoutMs, }; -_$VeilidConfigDHTImpl _$$VeilidConfigDHTImplFromJson( - Map json) => - _$VeilidConfigDHTImpl( +_VeilidConfigDHT _$VeilidConfigDHTFromJson(Map json) => + _VeilidConfigDHT( resolveNodeTimeoutMs: (json['resolve_node_timeout_ms'] as num).toInt(), resolveNodeCount: (json['resolve_node_count'] as num).toInt(), resolveNodeFanout: (json['resolve_node_fanout'] as num).toInt(), @@ -378,8 +359,7 @@ _$VeilidConfigDHTImpl _$$VeilidConfigDHTImplFromJson( maxWatchExpirationMs: (json['max_watch_expiration_ms'] as num).toInt(), ); -Map _$$VeilidConfigDHTImplToJson( - _$VeilidConfigDHTImpl instance) => +Map _$VeilidConfigDHTToJson(_VeilidConfigDHT instance) => { 'resolve_node_timeout_ms': instance.resolveNodeTimeoutMs, 'resolve_node_count': instance.resolveNodeCount, @@ -407,9 +387,8 @@ Map _$$VeilidConfigDHTImplToJson( 'max_watch_expiration_ms': instance.maxWatchExpirationMs, }; -_$VeilidConfigRPCImpl _$$VeilidConfigRPCImplFromJson( - Map json) => - _$VeilidConfigRPCImpl( +_VeilidConfigRPC _$VeilidConfigRPCFromJson(Map json) => + _VeilidConfigRPC( concurrency: (json['concurrency'] as num).toInt(), queueSize: (json['queue_size'] as num).toInt(), timeoutMs: (json['timeout_ms'] as num).toInt(), @@ -419,8 +398,7 @@ _$VeilidConfigRPCImpl _$$VeilidConfigRPCImplFromJson( maxTimestampAheadMs: (json['max_timestamp_ahead_ms'] as num?)?.toInt(), ); -Map _$$VeilidConfigRPCImplToJson( - _$VeilidConfigRPCImpl instance) => +Map _$VeilidConfigRPCToJson(_VeilidConfigRPC instance) => { 'concurrency': instance.concurrency, 'queue_size': instance.queueSize, @@ -431,9 +409,9 @@ Map _$$VeilidConfigRPCImplToJson( 'max_timestamp_ahead_ms': instance.maxTimestampAheadMs, }; -_$VeilidConfigRoutingTableImpl _$$VeilidConfigRoutingTableImplFromJson( +_VeilidConfigRoutingTable _$VeilidConfigRoutingTableFromJson( Map json) => - _$VeilidConfigRoutingTableImpl( + _VeilidConfigRoutingTable( nodeId: (json['node_id'] as List) .map(Typed.fromJson) .toList(), @@ -449,8 +427,8 @@ _$VeilidConfigRoutingTableImpl _$$VeilidConfigRoutingTableImplFromJson( limitAttachedWeak: (json['limit_attached_weak'] as num).toInt(), ); -Map _$$VeilidConfigRoutingTableImplToJson( - _$VeilidConfigRoutingTableImpl instance) => +Map _$VeilidConfigRoutingTableToJson( + _VeilidConfigRoutingTable instance) => { 'node_id': instance.nodeId.map((e) => e.toJson()).toList(), 'node_id_secret': instance.nodeIdSecret.map((e) => e.toJson()).toList(), @@ -462,9 +440,8 @@ Map _$$VeilidConfigRoutingTableImplToJson( 'limit_attached_weak': instance.limitAttachedWeak, }; -_$VeilidConfigNetworkImpl _$$VeilidConfigNetworkImplFromJson( - Map json) => - _$VeilidConfigNetworkImpl( +_VeilidConfigNetwork _$VeilidConfigNetworkFromJson(Map json) => + _VeilidConfigNetwork( connectionInitialTimeoutMs: (json['connection_initial_timeout_ms'] as num).toInt(), connectionInactivityTimeoutMs: @@ -494,8 +471,8 @@ _$VeilidConfigNetworkImpl _$$VeilidConfigNetworkImplFromJson( networkKeyPassword: json['network_key_password'] as String?, ); -Map _$$VeilidConfigNetworkImplToJson( - _$VeilidConfigNetworkImpl instance) => +Map _$VeilidConfigNetworkToJson( + _VeilidConfigNetwork instance) => { 'connection_initial_timeout_ms': instance.connectionInitialTimeoutMs, 'connection_inactivity_timeout_ms': @@ -521,37 +498,37 @@ Map _$$VeilidConfigNetworkImplToJson( 'network_key_password': instance.networkKeyPassword, }; -_$VeilidConfigTableStoreImpl _$$VeilidConfigTableStoreImplFromJson( +_VeilidConfigTableStore _$VeilidConfigTableStoreFromJson( Map json) => - _$VeilidConfigTableStoreImpl( + _VeilidConfigTableStore( directory: json['directory'] as String, delete: json['delete'] as bool, ); -Map _$$VeilidConfigTableStoreImplToJson( - _$VeilidConfigTableStoreImpl instance) => +Map _$VeilidConfigTableStoreToJson( + _VeilidConfigTableStore instance) => { 'directory': instance.directory, 'delete': instance.delete, }; -_$VeilidConfigBlockStoreImpl _$$VeilidConfigBlockStoreImplFromJson( +_VeilidConfigBlockStore _$VeilidConfigBlockStoreFromJson( Map json) => - _$VeilidConfigBlockStoreImpl( + _VeilidConfigBlockStore( directory: json['directory'] as String, delete: json['delete'] as bool, ); -Map _$$VeilidConfigBlockStoreImplToJson( - _$VeilidConfigBlockStoreImpl instance) => +Map _$VeilidConfigBlockStoreToJson( + _VeilidConfigBlockStore instance) => { 'directory': instance.directory, 'delete': instance.delete, }; -_$VeilidConfigProtectedStoreImpl _$$VeilidConfigProtectedStoreImplFromJson( +_VeilidConfigProtectedStore _$VeilidConfigProtectedStoreFromJson( Map json) => - _$VeilidConfigProtectedStoreImpl( + _VeilidConfigProtectedStore( allowInsecureFallback: json['allow_insecure_fallback'] as bool, alwaysUseInsecureStorage: json['always_use_insecure_storage'] as bool, directory: json['directory'] as String, @@ -562,8 +539,8 @@ _$VeilidConfigProtectedStoreImpl _$$VeilidConfigProtectedStoreImplFromJson( json['new_device_encryption_key_password'] as String?, ); -Map _$$VeilidConfigProtectedStoreImplToJson( - _$VeilidConfigProtectedStoreImpl instance) => +Map _$VeilidConfigProtectedStoreToJson( + _VeilidConfigProtectedStore instance) => { 'allow_insecure_fallback': instance.allowInsecureFallback, 'always_use_insecure_storage': instance.alwaysUseInsecureStorage, @@ -574,21 +551,21 @@ Map _$$VeilidConfigProtectedStoreImplToJson( instance.newDeviceEncryptionKeyPassword, }; -_$VeilidConfigCapabilitiesImpl _$$VeilidConfigCapabilitiesImplFromJson( +_VeilidConfigCapabilities _$VeilidConfigCapabilitiesFromJson( Map json) => - _$VeilidConfigCapabilitiesImpl( + _VeilidConfigCapabilities( disable: (json['disable'] as List).map((e) => e as String).toList(), ); -Map _$$VeilidConfigCapabilitiesImplToJson( - _$VeilidConfigCapabilitiesImpl instance) => +Map _$VeilidConfigCapabilitiesToJson( + _VeilidConfigCapabilities instance) => { 'disable': instance.disable, }; -_$VeilidConfigImpl _$$VeilidConfigImplFromJson(Map json) => - _$VeilidConfigImpl( +_VeilidConfig _$VeilidConfigFromJson(Map json) => + _VeilidConfig( programName: json['program_name'] as String, namespace: json['namespace'] as String, capabilities: VeilidConfigCapabilities.fromJson(json['capabilities']), @@ -599,7 +576,7 @@ _$VeilidConfigImpl _$$VeilidConfigImplFromJson(Map json) => network: VeilidConfigNetwork.fromJson(json['network']), ); -Map _$$VeilidConfigImplToJson(_$VeilidConfigImpl instance) => +Map _$VeilidConfigToJson(_VeilidConfig instance) => { 'program_name': instance.programName, 'namespace': instance.namespace, diff --git a/veilid-flutter/lib/veilid_state.dart b/veilid-flutter/lib/veilid_state.dart index 73223617..87ee3dd0 100644 --- a/veilid-flutter/lib/veilid_state.dart +++ b/veilid-flutter/lib/veilid_state.dart @@ -46,7 +46,7 @@ enum VeilidLogLevel { //////////// @freezed -class LatencyStats with _$LatencyStats { +sealed class LatencyStats with _$LatencyStats { const factory LatencyStats({ required TimestampDuration fastest, required TimestampDuration average, @@ -64,7 +64,7 @@ class LatencyStats with _$LatencyStats { //////////// @freezed -class TransferStats with _$TransferStats { +sealed class TransferStats with _$TransferStats { const factory TransferStats({ required BigInt total, required BigInt maximum, @@ -79,7 +79,7 @@ class TransferStats with _$TransferStats { //////////// @freezed -class TransferStatsDownUp with _$TransferStatsDownUp { +sealed class TransferStatsDownUp with _$TransferStatsDownUp { const factory TransferStatsDownUp({ required TransferStats down, required TransferStats up, @@ -92,7 +92,7 @@ class TransferStatsDownUp with _$TransferStatsDownUp { //////////// @freezed -class StateStats with _$StateStats { +sealed class StateStats with _$StateStats { const factory StateStats({ required TimestampDuration span, required TimestampDuration reliable, @@ -109,7 +109,7 @@ class StateStats with _$StateStats { //////////// @freezed -class StateReasonStats with _$StateReasonStats { +sealed class StateReasonStats with _$StateReasonStats { const factory StateReasonStats({ required TimestampDuration canNotSend, required TimestampDuration tooManyLostAnswers, @@ -127,7 +127,7 @@ class StateReasonStats with _$StateReasonStats { //////////// @freezed -class AnswerStats with _$AnswerStats { +sealed class AnswerStats with _$AnswerStats { const factory AnswerStats({ required TimestampDuration span, required int questions, @@ -148,7 +148,7 @@ class AnswerStats with _$AnswerStats { //////////// @freezed -class RPCStats with _$RPCStats { +sealed class RPCStats with _$RPCStats { const factory RPCStats({ required int messagesSent, required int messagesRcvd, @@ -170,7 +170,7 @@ class RPCStats with _$RPCStats { //////////// @freezed -class PeerStats with _$PeerStats { +sealed class PeerStats with _$PeerStats { const factory PeerStats({ required Timestamp timeAdded, required RPCStats rpcStats, @@ -186,7 +186,7 @@ class PeerStats with _$PeerStats { //////////// @freezed -class PeerTableData with _$PeerTableData { +sealed class PeerTableData with _$PeerTableData { const factory PeerTableData({ required List nodeIds, required String peerAddress, @@ -251,7 +251,7 @@ sealed class VeilidUpdate with _$VeilidUpdate { /// VeilidStateAttachment @freezed -class VeilidStateAttachment with _$VeilidStateAttachment { +sealed class VeilidStateAttachment with _$VeilidStateAttachment { const factory VeilidStateAttachment( {required AttachmentState state, required bool publicInternetReady, @@ -267,7 +267,7 @@ class VeilidStateAttachment with _$VeilidStateAttachment { /// VeilidStateNetwork @freezed -class VeilidStateNetwork with _$VeilidStateNetwork { +sealed class VeilidStateNetwork with _$VeilidStateNetwork { const factory VeilidStateNetwork( {required bool started, required BigInt bpsDown, @@ -282,7 +282,7 @@ class VeilidStateNetwork with _$VeilidStateNetwork { /// VeilidStateConfig @freezed -class VeilidStateConfig with _$VeilidStateConfig { +sealed class VeilidStateConfig with _$VeilidStateConfig { const factory VeilidStateConfig({ required VeilidConfig config, }) = _VeilidStateConfig; @@ -295,7 +295,7 @@ class VeilidStateConfig with _$VeilidStateConfig { /// VeilidState @freezed -class VeilidState with _$VeilidState { +sealed class VeilidState with _$VeilidState { const factory VeilidState({ required VeilidStateAttachment attachment, required VeilidStateNetwork network, diff --git a/veilid-flutter/lib/veilid_state.freezed.dart b/veilid-flutter/lib/veilid_state.freezed.dart index dc920883..a1e42bc2 100644 --- a/veilid-flutter/lib/veilid_state.freezed.dart +++ b/veilid-flutter/lib/veilid_state.freezed.dart @@ -1,3 +1,4 @@ +// dart format width=80 // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint @@ -9,114 +10,60 @@ part of 'veilid_state.dart'; // FreezedGenerator // ************************************************************************** +// dart format off 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#adding-getters-and-methods-to-our-models'); - -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; - TimestampDuration get tm90 => throw _privateConstructorUsedError; - TimestampDuration get tm75 => throw _privateConstructorUsedError; - TimestampDuration get p90 => throw _privateConstructorUsedError; - TimestampDuration get p75 => throw _privateConstructorUsedError; - - /// Serializes this LatencyStats to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + TimestampDuration get fastest; + TimestampDuration get average; + TimestampDuration get slowest; + TimestampDuration get tm90; + TimestampDuration get tm75; + TimestampDuration get p90; + TimestampDuration get p75; /// Create a copy of LatencyStats /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $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, - TimestampDuration tm90, - TimestampDuration tm75, - TimestampDuration p90, - TimestampDuration p75}); -} - -/// @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; - - /// Create a copy of LatencyStats - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') + $LatencyStatsCopyWith get copyWith => + _$LatencyStatsCopyWithImpl( + this as LatencyStats, _$identity); + + /// Serializes this LatencyStats to a JSON map. + Map toJson(); + @override - $Res call({ - Object? fastest = null, - Object? average = null, - Object? slowest = null, - Object? tm90 = null, - Object? tm75 = null, - Object? p90 = null, - Object? p75 = 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, - tm90: null == tm90 - ? _value.tm90 - : tm90 // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - tm75: null == tm75 - ? _value.tm75 - : tm75 // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - p90: null == p90 - ? _value.p90 - : p90 // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - p75: null == p75 - ? _value.p75 - : p75 // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - ) as $Val); + bool operator ==(Object 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) && + (identical(other.tm90, tm90) || other.tm90 == tm90) && + (identical(other.tm75, tm75) || other.tm75 == tm75) && + (identical(other.p90, p90) || other.p90 == p90) && + (identical(other.p75, p75) || other.p75 == p75)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, fastest, average, slowest, tm90, tm75, p90, p75); + + @override + String toString() { + return 'LatencyStats(fastest: $fastest, average: $average, slowest: $slowest, tm90: $tm90, tm75: $tm75, p90: $p90, p75: $p75)'; } } /// @nodoc -abstract class _$$LatencyStatsImplCopyWith<$Res> - implements $LatencyStatsCopyWith<$Res> { - factory _$$LatencyStatsImplCopyWith( - _$LatencyStatsImpl value, $Res Function(_$LatencyStatsImpl) then) = - __$$LatencyStatsImplCopyWithImpl<$Res>; - @override +abstract mixin class $LatencyStatsCopyWith<$Res> { + factory $LatencyStatsCopyWith( + LatencyStats value, $Res Function(LatencyStats) _then) = + _$LatencyStatsCopyWithImpl; @useResult $Res call( {TimestampDuration fastest, @@ -129,12 +76,11 @@ abstract class _$$LatencyStatsImplCopyWith<$Res> } /// @nodoc -class __$$LatencyStatsImplCopyWithImpl<$Res> - extends _$LatencyStatsCopyWithImpl<$Res, _$LatencyStatsImpl> - implements _$$LatencyStatsImplCopyWith<$Res> { - __$$LatencyStatsImplCopyWithImpl( - _$LatencyStatsImpl _value, $Res Function(_$LatencyStatsImpl) _then) - : super(_value, _then); +class _$LatencyStatsCopyWithImpl<$Res> implements $LatencyStatsCopyWith<$Res> { + _$LatencyStatsCopyWithImpl(this._self, this._then); + + final LatencyStats _self; + final $Res Function(LatencyStats) _then; /// Create a copy of LatencyStats /// with the given fields replaced by the non-null parameter values. @@ -149,33 +95,33 @@ class __$$LatencyStatsImplCopyWithImpl<$Res> Object? p90 = null, Object? p75 = null, }) { - return _then(_$LatencyStatsImpl( + return _then(_self.copyWith( fastest: null == fastest - ? _value.fastest + ? _self.fastest : fastest // ignore: cast_nullable_to_non_nullable as TimestampDuration, average: null == average - ? _value.average + ? _self.average : average // ignore: cast_nullable_to_non_nullable as TimestampDuration, slowest: null == slowest - ? _value.slowest + ? _self.slowest : slowest // ignore: cast_nullable_to_non_nullable as TimestampDuration, tm90: null == tm90 - ? _value.tm90 + ? _self.tm90 : tm90 // ignore: cast_nullable_to_non_nullable as TimestampDuration, tm75: null == tm75 - ? _value.tm75 + ? _self.tm75 : tm75 // ignore: cast_nullable_to_non_nullable as TimestampDuration, p90: null == p90 - ? _value.p90 + ? _self.p90 : p90 // ignore: cast_nullable_to_non_nullable as TimestampDuration, p75: null == p75 - ? _value.p75 + ? _self.p75 : p75 // ignore: cast_nullable_to_non_nullable as TimestampDuration, )); @@ -184,8 +130,8 @@ class __$$LatencyStatsImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$LatencyStatsImpl implements _LatencyStats { - const _$LatencyStatsImpl( +class _LatencyStats implements LatencyStats { + const _LatencyStats( {required this.fastest, required this.average, required this.slowest, @@ -193,9 +139,8 @@ class _$LatencyStatsImpl implements _LatencyStats { required this.tm75, required this.p90, required this.p75}); - - factory _$LatencyStatsImpl.fromJson(Map json) => - _$$LatencyStatsImplFromJson(json); + factory _LatencyStats.fromJson(Map json) => + _$LatencyStatsFromJson(json); @override final TimestampDuration fastest; @@ -212,16 +157,26 @@ class _$LatencyStatsImpl implements _LatencyStats { @override final TimestampDuration p75; + /// Create a copy of LatencyStats + /// with the given fields replaced by the non-null parameter values. @override - String toString() { - return 'LatencyStats(fastest: $fastest, average: $average, slowest: $slowest, tm90: $tm90, tm75: $tm75, p90: $p90, p75: $p75)'; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$LatencyStatsCopyWith<_LatencyStats> get copyWith => + __$LatencyStatsCopyWithImpl<_LatencyStats>(this, _$identity); + + @override + Map toJson() { + return _$LatencyStatsToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$LatencyStatsImpl && + other is _LatencyStats && (identical(other.fastest, fastest) || other.fastest == fastest) && (identical(other.average, average) || other.average == average) && (identical(other.slowest, slowest) || other.slowest == slowest) && @@ -236,210 +191,107 @@ class _$LatencyStatsImpl implements _LatencyStats { int get hashCode => Object.hash(runtimeType, fastest, average, slowest, tm90, tm75, p90, p75); - /// Create a copy of LatencyStats - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$LatencyStatsImplCopyWith<_$LatencyStatsImpl> get copyWith => - __$$LatencyStatsImplCopyWithImpl<_$LatencyStatsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$LatencyStatsImplToJson( - this, - ); - } -} - -abstract class _LatencyStats implements LatencyStats { - const factory _LatencyStats( - {required final TimestampDuration fastest, - required final TimestampDuration average, - required final TimestampDuration slowest, - required final TimestampDuration tm90, - required final TimestampDuration tm75, - required final TimestampDuration p90, - required final TimestampDuration p75}) = _$LatencyStatsImpl; - - factory _LatencyStats.fromJson(Map json) = - _$LatencyStatsImpl.fromJson; - - @override - TimestampDuration get fastest; - @override - TimestampDuration get average; - @override - TimestampDuration get slowest; - @override - TimestampDuration get tm90; - @override - TimestampDuration get tm75; - @override - TimestampDuration get p90; - @override - TimestampDuration get p75; - - /// Create a copy of LatencyStats - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$LatencyStatsImplCopyWith<_$LatencyStatsImpl> 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; - - /// Serializes this TransferStats to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of TransferStats - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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; - - /// Create a copy of TransferStats - /// with the given fields replaced by the non-null parameter values. - @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); + String toString() { + return 'LatencyStats(fastest: $fastest, average: $average, slowest: $slowest, tm90: $tm90, tm75: $tm75, p90: $p90, p75: $p75)'; } } /// @nodoc -abstract class _$$TransferStatsImplCopyWith<$Res> - implements $TransferStatsCopyWith<$Res> { - factory _$$TransferStatsImplCopyWith( - _$TransferStatsImpl value, $Res Function(_$TransferStatsImpl) then) = - __$$TransferStatsImplCopyWithImpl<$Res>; +abstract mixin class _$LatencyStatsCopyWith<$Res> + implements $LatencyStatsCopyWith<$Res> { + factory _$LatencyStatsCopyWith( + _LatencyStats value, $Res Function(_LatencyStats) _then) = + __$LatencyStatsCopyWithImpl; @override @useResult - $Res call({BigInt total, BigInt maximum, BigInt average, BigInt minimum}); + $Res call( + {TimestampDuration fastest, + TimestampDuration average, + TimestampDuration slowest, + TimestampDuration tm90, + TimestampDuration tm75, + TimestampDuration p90, + TimestampDuration p75}); } /// @nodoc -class __$$TransferStatsImplCopyWithImpl<$Res> - extends _$TransferStatsCopyWithImpl<$Res, _$TransferStatsImpl> - implements _$$TransferStatsImplCopyWith<$Res> { - __$$TransferStatsImplCopyWithImpl( - _$TransferStatsImpl _value, $Res Function(_$TransferStatsImpl) _then) - : super(_value, _then); +class __$LatencyStatsCopyWithImpl<$Res> + implements _$LatencyStatsCopyWith<$Res> { + __$LatencyStatsCopyWithImpl(this._self, this._then); - /// Create a copy of TransferStats + final _LatencyStats _self; + final $Res Function(_LatencyStats) _then; + + /// Create a copy of LatencyStats /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') @override + @pragma('vm:prefer-inline') $Res call({ - Object? total = null, - Object? maximum = null, + Object? fastest = null, Object? average = null, - Object? minimum = null, + Object? slowest = null, + Object? tm90 = null, + Object? tm75 = null, + Object? p90 = null, + Object? p75 = null, }) { - return _then(_$TransferStatsImpl( - 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, + return _then(_LatencyStats( + fastest: null == fastest + ? _self.fastest + : fastest // ignore: cast_nullable_to_non_nullable + as TimestampDuration, average: null == average - ? _value.average + ? _self.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 TimestampDuration, + slowest: null == slowest + ? _self.slowest + : slowest // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + tm90: null == tm90 + ? _self.tm90 + : tm90 // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + tm75: null == tm75 + ? _self.tm75 + : tm75 // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + p90: null == p90 + ? _self.p90 + : p90 // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + p75: null == p75 + ? _self.p75 + : p75 // ignore: cast_nullable_to_non_nullable + as TimestampDuration, )); } } /// @nodoc -@JsonSerializable() -class _$TransferStatsImpl implements _TransferStats { - const _$TransferStatsImpl( - {required this.total, - required this.maximum, - required this.average, - required this.minimum}); +mixin _$TransferStats { + BigInt get total; + BigInt get maximum; + BigInt get average; + BigInt get minimum; - factory _$TransferStatsImpl.fromJson(Map json) => - _$$TransferStatsImplFromJson(json); + /// Create a copy of TransferStats + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $TransferStatsCopyWith get copyWith => + _$TransferStatsCopyWithImpl( + this as TransferStats, _$identity); - @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)'; - } + /// Serializes this TransferStats to a JSON map. + Map toJson(); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$TransferStatsImpl && + other is TransferStats && (identical(other.total, total) || other.total == total) && (identical(other.maximum, maximum) || other.maximum == maximum) && (identical(other.average, average) || other.average == average) && @@ -451,199 +303,188 @@ class _$TransferStatsImpl implements _TransferStats { int get hashCode => Object.hash(runtimeType, total, maximum, average, minimum); - /// Create a copy of TransferStats - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$TransferStatsImplCopyWith<_$TransferStatsImpl> get copyWith => - __$$TransferStatsImplCopyWithImpl<_$TransferStatsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$TransferStatsImplToJson( - this, - ); + String toString() { + return 'TransferStats(total: $total, maximum: $maximum, average: $average, minimum: $minimum)'; } } -abstract class _TransferStats implements TransferStats { - const factory _TransferStats( - {required final BigInt total, - required final BigInt maximum, - required final BigInt average, - required final BigInt minimum}) = _$TransferStatsImpl; +/// @nodoc +abstract mixin class $TransferStatsCopyWith<$Res> { + factory $TransferStatsCopyWith( + TransferStats value, $Res Function(TransferStats) _then) = + _$TransferStatsCopyWithImpl; + @useResult + $Res call({BigInt total, BigInt maximum, BigInt average, BigInt minimum}); +} - factory _TransferStats.fromJson(Map json) = - _$TransferStatsImpl.fromJson; +/// @nodoc +class _$TransferStatsCopyWithImpl<$Res> + implements $TransferStatsCopyWith<$Res> { + _$TransferStatsCopyWithImpl(this._self, this._then); - @override - BigInt get total; - @override - BigInt get maximum; - @override - BigInt get average; - @override - BigInt get minimum; + final TransferStats _self; + final $Res Function(TransferStats) _then; /// Create a copy of TransferStats /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$TransferStatsImplCopyWith<_$TransferStatsImpl> 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; - - /// Serializes this TransferStatsDownUp to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of TransferStatsDownUp - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $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; - - /// Create a copy of TransferStatsDownUp - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? down = null, - Object? up = null, + Object? total = null, + Object? maximum = null, + Object? average = null, + Object? minimum = 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); - } - - /// Create a copy of TransferStatsDownUp - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $TransferStatsCopyWith<$Res> get down { - return $TransferStatsCopyWith<$Res>(_value.down, (value) { - return _then(_value.copyWith(down: value) as $Val); - }); - } - - /// Create a copy of TransferStatsDownUp - /// with the given fields replaced by the non-null parameter values. - @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 _$$TransferStatsDownUpImplCopyWith<$Res> - implements $TransferStatsDownUpCopyWith<$Res> { - factory _$$TransferStatsDownUpImplCopyWith(_$TransferStatsDownUpImpl value, - $Res Function(_$TransferStatsDownUpImpl) then) = - __$$TransferStatsDownUpImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({TransferStats down, TransferStats up}); - - @override - $TransferStatsCopyWith<$Res> get down; - @override - $TransferStatsCopyWith<$Res> get up; -} - -/// @nodoc -class __$$TransferStatsDownUpImplCopyWithImpl<$Res> - extends _$TransferStatsDownUpCopyWithImpl<$Res, _$TransferStatsDownUpImpl> - implements _$$TransferStatsDownUpImplCopyWith<$Res> { - __$$TransferStatsDownUpImplCopyWithImpl(_$TransferStatsDownUpImpl _value, - $Res Function(_$TransferStatsDownUpImpl) _then) - : super(_value, _then); - - /// Create a copy of TransferStatsDownUp - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? down = null, - Object? up = null, - }) { - return _then(_$TransferStatsDownUpImpl( - 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, + return _then(_self.copyWith( + total: null == total + ? _self.total + : total // ignore: cast_nullable_to_non_nullable + as BigInt, + maximum: null == maximum + ? _self.maximum + : maximum // ignore: cast_nullable_to_non_nullable + as BigInt, + average: null == average + ? _self.average + : average // ignore: cast_nullable_to_non_nullable + as BigInt, + minimum: null == minimum + ? _self.minimum + : minimum // ignore: cast_nullable_to_non_nullable + as BigInt, )); } } /// @nodoc @JsonSerializable() -class _$TransferStatsDownUpImpl implements _TransferStatsDownUp { - const _$TransferStatsDownUpImpl({required this.down, required this.up}); - - factory _$TransferStatsDownUpImpl.fromJson(Map json) => - _$$TransferStatsDownUpImplFromJson(json); +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 TransferStats down; + final BigInt total; @override - final TransferStats up; + final BigInt maximum; + @override + final BigInt average; + @override + final BigInt minimum; + + /// Create a copy of TransferStats + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$TransferStatsCopyWith<_TransferStats> get copyWith => + __$TransferStatsCopyWithImpl<_TransferStats>(this, _$identity); @override - String toString() { - return 'TransferStatsDownUp(down: $down, up: $up)'; + Map toJson() { + return _$TransferStatsToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$TransferStatsDownUpImpl && + 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, total, maximum, average, minimum); + + @override + String toString() { + return 'TransferStats(total: $total, maximum: $maximum, average: $average, minimum: $minimum)'; + } +} + +/// @nodoc +abstract mixin class _$TransferStatsCopyWith<$Res> + implements $TransferStatsCopyWith<$Res> { + factory _$TransferStatsCopyWith( + _TransferStats value, $Res Function(_TransferStats) _then) = + __$TransferStatsCopyWithImpl; + @override + @useResult + $Res call({BigInt total, BigInt maximum, BigInt average, BigInt minimum}); +} + +/// @nodoc +class __$TransferStatsCopyWithImpl<$Res> + implements _$TransferStatsCopyWith<$Res> { + __$TransferStatsCopyWithImpl(this._self, this._then); + + final _TransferStats _self; + final $Res Function(_TransferStats) _then; + + /// Create a copy of TransferStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? total = null, + Object? maximum = null, + Object? average = null, + Object? minimum = null, + }) { + return _then(_TransferStats( + total: null == total + ? _self.total + : total // ignore: cast_nullable_to_non_nullable + as BigInt, + maximum: null == maximum + ? _self.maximum + : maximum // ignore: cast_nullable_to_non_nullable + as BigInt, + average: null == average + ? _self.average + : average // ignore: cast_nullable_to_non_nullable + as BigInt, + minimum: null == minimum + ? _self.minimum + : minimum // ignore: cast_nullable_to_non_nullable + as BigInt, + )); + } +} + +/// @nodoc +mixin _$TransferStatsDownUp { + TransferStats get down; + TransferStats get up; + + /// Create a copy of TransferStatsDownUp + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $TransferStatsDownUpCopyWith get copyWith => + _$TransferStatsDownUpCopyWithImpl( + this as TransferStatsDownUp, _$identity); + + /// Serializes this TransferStatsDownUp to a JSON map. + Map toJson(); + + @override + bool operator ==(Object 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)); } @@ -652,251 +493,209 @@ class _$TransferStatsDownUpImpl implements _TransferStatsDownUp { @override int get hashCode => Object.hash(runtimeType, down, up); - /// Create a copy of TransferStatsDownUp - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$TransferStatsDownUpImplCopyWith<_$TransferStatsDownUpImpl> get copyWith => - __$$TransferStatsDownUpImplCopyWithImpl<_$TransferStatsDownUpImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$TransferStatsDownUpImplToJson( - this, - ); + String toString() { + return 'TransferStatsDownUp(down: $down, up: $up)'; } } -abstract class _TransferStatsDownUp implements TransferStatsDownUp { - const factory _TransferStatsDownUp( - {required final TransferStats down, - required final TransferStats up}) = _$TransferStatsDownUpImpl; +/// @nodoc +abstract mixin class $TransferStatsDownUpCopyWith<$Res> { + factory $TransferStatsDownUpCopyWith( + TransferStatsDownUp value, $Res Function(TransferStatsDownUp) _then) = + _$TransferStatsDownUpCopyWithImpl; + @useResult + $Res call({TransferStats down, TransferStats up}); - factory _TransferStatsDownUp.fromJson(Map json) = - _$TransferStatsDownUpImpl.fromJson; + $TransferStatsCopyWith<$Res> get down; + $TransferStatsCopyWith<$Res> get up; +} - @override - TransferStats get down; - @override - TransferStats get up; +/// @nodoc +class _$TransferStatsDownUpCopyWithImpl<$Res> + implements $TransferStatsDownUpCopyWith<$Res> { + _$TransferStatsDownUpCopyWithImpl(this._self, this._then); + + final TransferStatsDownUp _self; + final $Res Function(TransferStatsDownUp) _then; /// Create a copy of TransferStatsDownUp /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$TransferStatsDownUpImplCopyWith<_$TransferStatsDownUpImpl> get copyWith => - throw _privateConstructorUsedError; -} - -StateStats _$StateStatsFromJson(Map json) { - return _StateStats.fromJson(json); -} - -/// @nodoc -mixin _$StateStats { - TimestampDuration get span => throw _privateConstructorUsedError; - TimestampDuration get reliable => throw _privateConstructorUsedError; - TimestampDuration get unreliable => throw _privateConstructorUsedError; - TimestampDuration get dead => throw _privateConstructorUsedError; - TimestampDuration get punished => throw _privateConstructorUsedError; - StateReasonStats get reason => throw _privateConstructorUsedError; - - /// Serializes this StateStats to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of StateStats - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $StateStatsCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $StateStatsCopyWith<$Res> { - factory $StateStatsCopyWith( - StateStats value, $Res Function(StateStats) then) = - _$StateStatsCopyWithImpl<$Res, StateStats>; - @useResult - $Res call( - {TimestampDuration span, - TimestampDuration reliable, - TimestampDuration unreliable, - TimestampDuration dead, - TimestampDuration punished, - StateReasonStats reason}); - - $StateReasonStatsCopyWith<$Res> get reason; -} - -/// @nodoc -class _$StateStatsCopyWithImpl<$Res, $Val extends StateStats> - implements $StateStatsCopyWith<$Res> { - _$StateStatsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of StateStats - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? span = null, - Object? reliable = null, - Object? unreliable = null, - Object? dead = null, - Object? punished = null, - Object? reason = null, + Object? down = null, + Object? up = null, }) { - return _then(_value.copyWith( - span: null == span - ? _value.span - : span // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - reliable: null == reliable - ? _value.reliable - : reliable // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - unreliable: null == unreliable - ? _value.unreliable - : unreliable // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - dead: null == dead - ? _value.dead - : dead // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - punished: null == punished - ? _value.punished - : punished // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - reason: null == reason - ? _value.reason - : reason // ignore: cast_nullable_to_non_nullable - as StateReasonStats, - ) as $Val); + return _then(_self.copyWith( + down: null == down + ? _self.down + : down // ignore: cast_nullable_to_non_nullable + as TransferStats, + up: null == up + ? _self.up + : up // ignore: cast_nullable_to_non_nullable + as TransferStats, + )); } - /// Create a copy of StateStats + /// Create a copy of TransferStatsDownUp /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') - $StateReasonStatsCopyWith<$Res> get reason { - return $StateReasonStatsCopyWith<$Res>(_value.reason, (value) { - return _then(_value.copyWith(reason: value) as $Val); + $TransferStatsCopyWith<$Res> get down { + return $TransferStatsCopyWith<$Res>(_self.down, (value) { + return _then(_self.copyWith(down: value)); + }); + } + + /// Create a copy of TransferStatsDownUp + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $TransferStatsCopyWith<$Res> get up { + return $TransferStatsCopyWith<$Res>(_self.up, (value) { + return _then(_self.copyWith(up: value)); }); } } -/// @nodoc -abstract class _$$StateStatsImplCopyWith<$Res> - implements $StateStatsCopyWith<$Res> { - factory _$$StateStatsImplCopyWith( - _$StateStatsImpl value, $Res Function(_$StateStatsImpl) then) = - __$$StateStatsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {TimestampDuration span, - TimestampDuration reliable, - TimestampDuration unreliable, - TimestampDuration dead, - TimestampDuration punished, - StateReasonStats reason}); - - @override - $StateReasonStatsCopyWith<$Res> get reason; -} - -/// @nodoc -class __$$StateStatsImplCopyWithImpl<$Res> - extends _$StateStatsCopyWithImpl<$Res, _$StateStatsImpl> - implements _$$StateStatsImplCopyWith<$Res> { - __$$StateStatsImplCopyWithImpl( - _$StateStatsImpl _value, $Res Function(_$StateStatsImpl) _then) - : super(_value, _then); - - /// Create a copy of StateStats - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? span = null, - Object? reliable = null, - Object? unreliable = null, - Object? dead = null, - Object? punished = null, - Object? reason = null, - }) { - return _then(_$StateStatsImpl( - span: null == span - ? _value.span - : span // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - reliable: null == reliable - ? _value.reliable - : reliable // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - unreliable: null == unreliable - ? _value.unreliable - : unreliable // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - dead: null == dead - ? _value.dead - : dead // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - punished: null == punished - ? _value.punished - : punished // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - reason: null == reason - ? _value.reason - : reason // ignore: cast_nullable_to_non_nullable - as StateReasonStats, - )); - } -} - /// @nodoc @JsonSerializable() -class _$StateStatsImpl implements _StateStats { - const _$StateStatsImpl( - {required this.span, - required this.reliable, - required this.unreliable, - required this.dead, - required this.punished, - required this.reason}); - - factory _$StateStatsImpl.fromJson(Map json) => - _$$StateStatsImplFromJson(json); +class _TransferStatsDownUp implements TransferStatsDownUp { + const _TransferStatsDownUp({required this.down, required this.up}); + factory _TransferStatsDownUp.fromJson(Map json) => + _$TransferStatsDownUpFromJson(json); @override - final TimestampDuration span; + final TransferStats down; @override - final TimestampDuration reliable; + final TransferStats up; + + /// Create a copy of TransferStatsDownUp + /// with the given fields replaced by the non-null parameter values. @override - final TimestampDuration unreliable; - @override - final TimestampDuration dead; - @override - final TimestampDuration punished; - @override - final StateReasonStats reason; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$TransferStatsDownUpCopyWith<_TransferStatsDownUp> get copyWith => + __$TransferStatsDownUpCopyWithImpl<_TransferStatsDownUp>( + this, _$identity); @override - String toString() { - return 'StateStats(span: $span, reliable: $reliable, unreliable: $unreliable, dead: $dead, punished: $punished, reason: $reason)'; + Map toJson() { + return _$TransferStatsDownUpToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$StateStatsImpl && + other is _TransferStatsDownUp && + (identical(other.down, down) || other.down == down) && + (identical(other.up, up) || other.up == up)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, down, up); + + @override + String toString() { + return 'TransferStatsDownUp(down: $down, up: $up)'; + } +} + +/// @nodoc +abstract mixin class _$TransferStatsDownUpCopyWith<$Res> + implements $TransferStatsDownUpCopyWith<$Res> { + factory _$TransferStatsDownUpCopyWith(_TransferStatsDownUp value, + $Res Function(_TransferStatsDownUp) _then) = + __$TransferStatsDownUpCopyWithImpl; + @override + @useResult + $Res call({TransferStats down, TransferStats up}); + + @override + $TransferStatsCopyWith<$Res> get down; + @override + $TransferStatsCopyWith<$Res> get up; +} + +/// @nodoc +class __$TransferStatsDownUpCopyWithImpl<$Res> + implements _$TransferStatsDownUpCopyWith<$Res> { + __$TransferStatsDownUpCopyWithImpl(this._self, this._then); + + final _TransferStatsDownUp _self; + final $Res Function(_TransferStatsDownUp) _then; + + /// Create a copy of TransferStatsDownUp + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? down = null, + Object? up = null, + }) { + return _then(_TransferStatsDownUp( + down: null == down + ? _self.down + : down // ignore: cast_nullable_to_non_nullable + as TransferStats, + up: null == up + ? _self.up + : up // ignore: cast_nullable_to_non_nullable + as TransferStats, + )); + } + + /// Create a copy of TransferStatsDownUp + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $TransferStatsCopyWith<$Res> get down { + return $TransferStatsCopyWith<$Res>(_self.down, (value) { + return _then(_self.copyWith(down: value)); + }); + } + + /// Create a copy of TransferStatsDownUp + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $TransferStatsCopyWith<$Res> get up { + return $TransferStatsCopyWith<$Res>(_self.up, (value) { + return _then(_self.copyWith(up: value)); + }); + } +} + +/// @nodoc +mixin _$StateStats { + TimestampDuration get span; + TimestampDuration get reliable; + TimestampDuration get unreliable; + TimestampDuration get dead; + TimestampDuration get punished; + StateReasonStats get reason; + + /// Create a copy of StateStats + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $StateStatsCopyWith get copyWith => + _$StateStatsCopyWithImpl(this as StateStats, _$identity); + + /// Serializes this StateStats to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is StateStats && (identical(other.span, span) || other.span == span) && (identical(other.reliable, reliable) || other.reliable == reliable) && @@ -913,266 +712,259 @@ class _$StateStatsImpl implements _StateStats { int get hashCode => Object.hash( runtimeType, span, reliable, unreliable, dead, punished, reason); - /// Create a copy of StateStats - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$StateStatsImplCopyWith<_$StateStatsImpl> get copyWith => - __$$StateStatsImplCopyWithImpl<_$StateStatsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$StateStatsImplToJson( - this, - ); - } -} - -abstract class _StateStats implements StateStats { - const factory _StateStats( - {required final TimestampDuration span, - required final TimestampDuration reliable, - required final TimestampDuration unreliable, - required final TimestampDuration dead, - required final TimestampDuration punished, - required final StateReasonStats reason}) = _$StateStatsImpl; - - factory _StateStats.fromJson(Map json) = - _$StateStatsImpl.fromJson; - - @override - TimestampDuration get span; - @override - TimestampDuration get reliable; - @override - TimestampDuration get unreliable; - @override - TimestampDuration get dead; - @override - TimestampDuration get punished; - @override - StateReasonStats get reason; - - /// Create a copy of StateStats - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$StateStatsImplCopyWith<_$StateStatsImpl> get copyWith => - throw _privateConstructorUsedError; -} - -StateReasonStats _$StateReasonStatsFromJson(Map json) { - return _StateReasonStats.fromJson(json); -} - -/// @nodoc -mixin _$StateReasonStats { - TimestampDuration get canNotSend => throw _privateConstructorUsedError; - TimestampDuration get tooManyLostAnswers => - throw _privateConstructorUsedError; - TimestampDuration get noPingResponse => throw _privateConstructorUsedError; - TimestampDuration get failedToSend => throw _privateConstructorUsedError; - TimestampDuration get lostAnswers => throw _privateConstructorUsedError; - TimestampDuration get notSeenConsecutively => - throw _privateConstructorUsedError; - TimestampDuration get inUnreliablePingSpan => - throw _privateConstructorUsedError; - - /// Serializes this StateReasonStats to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of StateReasonStats - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $StateReasonStatsCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $StateReasonStatsCopyWith<$Res> { - factory $StateReasonStatsCopyWith( - StateReasonStats value, $Res Function(StateReasonStats) then) = - _$StateReasonStatsCopyWithImpl<$Res, StateReasonStats>; - @useResult - $Res call( - {TimestampDuration canNotSend, - TimestampDuration tooManyLostAnswers, - TimestampDuration noPingResponse, - TimestampDuration failedToSend, - TimestampDuration lostAnswers, - TimestampDuration notSeenConsecutively, - TimestampDuration inUnreliablePingSpan}); -} - -/// @nodoc -class _$StateReasonStatsCopyWithImpl<$Res, $Val extends StateReasonStats> - implements $StateReasonStatsCopyWith<$Res> { - _$StateReasonStatsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of StateReasonStats - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? canNotSend = null, - Object? tooManyLostAnswers = null, - Object? noPingResponse = null, - Object? failedToSend = null, - Object? lostAnswers = null, - Object? notSeenConsecutively = null, - Object? inUnreliablePingSpan = null, - }) { - return _then(_value.copyWith( - canNotSend: null == canNotSend - ? _value.canNotSend - : canNotSend // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - tooManyLostAnswers: null == tooManyLostAnswers - ? _value.tooManyLostAnswers - : tooManyLostAnswers // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - noPingResponse: null == noPingResponse - ? _value.noPingResponse - : noPingResponse // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - failedToSend: null == failedToSend - ? _value.failedToSend - : failedToSend // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - lostAnswers: null == lostAnswers - ? _value.lostAnswers - : lostAnswers // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - notSeenConsecutively: null == notSeenConsecutively - ? _value.notSeenConsecutively - : notSeenConsecutively // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - inUnreliablePingSpan: null == inUnreliablePingSpan - ? _value.inUnreliablePingSpan - : inUnreliablePingSpan // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - ) as $Val); + String toString() { + return 'StateStats(span: $span, reliable: $reliable, unreliable: $unreliable, dead: $dead, punished: $punished, reason: $reason)'; } } /// @nodoc -abstract class _$$StateReasonStatsImplCopyWith<$Res> - implements $StateReasonStatsCopyWith<$Res> { - factory _$$StateReasonStatsImplCopyWith(_$StateReasonStatsImpl value, - $Res Function(_$StateReasonStatsImpl) then) = - __$$StateReasonStatsImplCopyWithImpl<$Res>; - @override +abstract mixin class $StateStatsCopyWith<$Res> { + factory $StateStatsCopyWith( + StateStats value, $Res Function(StateStats) _then) = + _$StateStatsCopyWithImpl; @useResult $Res call( - {TimestampDuration canNotSend, - TimestampDuration tooManyLostAnswers, - TimestampDuration noPingResponse, - TimestampDuration failedToSend, - TimestampDuration lostAnswers, - TimestampDuration notSeenConsecutively, - TimestampDuration inUnreliablePingSpan}); + {TimestampDuration span, + TimestampDuration reliable, + TimestampDuration unreliable, + TimestampDuration dead, + TimestampDuration punished, + StateReasonStats reason}); + + $StateReasonStatsCopyWith<$Res> get reason; } /// @nodoc -class __$$StateReasonStatsImplCopyWithImpl<$Res> - extends _$StateReasonStatsCopyWithImpl<$Res, _$StateReasonStatsImpl> - implements _$$StateReasonStatsImplCopyWith<$Res> { - __$$StateReasonStatsImplCopyWithImpl(_$StateReasonStatsImpl _value, - $Res Function(_$StateReasonStatsImpl) _then) - : super(_value, _then); +class _$StateStatsCopyWithImpl<$Res> implements $StateStatsCopyWith<$Res> { + _$StateStatsCopyWithImpl(this._self, this._then); - /// Create a copy of StateReasonStats + final StateStats _self; + final $Res Function(StateStats) _then; + + /// Create a copy of StateStats /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? canNotSend = null, - Object? tooManyLostAnswers = null, - Object? noPingResponse = null, - Object? failedToSend = null, - Object? lostAnswers = null, - Object? notSeenConsecutively = null, - Object? inUnreliablePingSpan = null, + Object? span = null, + Object? reliable = null, + Object? unreliable = null, + Object? dead = null, + Object? punished = null, + Object? reason = null, }) { - return _then(_$StateReasonStatsImpl( - canNotSend: null == canNotSend - ? _value.canNotSend - : canNotSend // ignore: cast_nullable_to_non_nullable + return _then(_self.copyWith( + span: null == span + ? _self.span + : span // ignore: cast_nullable_to_non_nullable as TimestampDuration, - tooManyLostAnswers: null == tooManyLostAnswers - ? _value.tooManyLostAnswers - : tooManyLostAnswers // ignore: cast_nullable_to_non_nullable + reliable: null == reliable + ? _self.reliable + : reliable // ignore: cast_nullable_to_non_nullable as TimestampDuration, - noPingResponse: null == noPingResponse - ? _value.noPingResponse - : noPingResponse // ignore: cast_nullable_to_non_nullable + unreliable: null == unreliable + ? _self.unreliable + : unreliable // ignore: cast_nullable_to_non_nullable as TimestampDuration, - failedToSend: null == failedToSend - ? _value.failedToSend - : failedToSend // ignore: cast_nullable_to_non_nullable + dead: null == dead + ? _self.dead + : dead // ignore: cast_nullable_to_non_nullable as TimestampDuration, - lostAnswers: null == lostAnswers - ? _value.lostAnswers - : lostAnswers // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - notSeenConsecutively: null == notSeenConsecutively - ? _value.notSeenConsecutively - : notSeenConsecutively // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - inUnreliablePingSpan: null == inUnreliablePingSpan - ? _value.inUnreliablePingSpan - : inUnreliablePingSpan // ignore: cast_nullable_to_non_nullable + punished: null == punished + ? _self.punished + : punished // ignore: cast_nullable_to_non_nullable as TimestampDuration, + reason: null == reason + ? _self.reason + : reason // ignore: cast_nullable_to_non_nullable + as StateReasonStats, )); } + + /// Create a copy of StateStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $StateReasonStatsCopyWith<$Res> get reason { + return $StateReasonStatsCopyWith<$Res>(_self.reason, (value) { + return _then(_self.copyWith(reason: value)); + }); + } } /// @nodoc @JsonSerializable() -class _$StateReasonStatsImpl implements _StateReasonStats { - const _$StateReasonStatsImpl( - {required this.canNotSend, - required this.tooManyLostAnswers, - required this.noPingResponse, - required this.failedToSend, - required this.lostAnswers, - required this.notSeenConsecutively, - required this.inUnreliablePingSpan}); - - factory _$StateReasonStatsImpl.fromJson(Map json) => - _$$StateReasonStatsImplFromJson(json); +class _StateStats implements StateStats { + const _StateStats( + {required this.span, + required this.reliable, + required this.unreliable, + required this.dead, + required this.punished, + required this.reason}); + factory _StateStats.fromJson(Map json) => + _$StateStatsFromJson(json); @override - final TimestampDuration canNotSend; + final TimestampDuration span; @override - final TimestampDuration tooManyLostAnswers; + final TimestampDuration reliable; @override - final TimestampDuration noPingResponse; + final TimestampDuration unreliable; @override - final TimestampDuration failedToSend; + final TimestampDuration dead; @override - final TimestampDuration lostAnswers; + final TimestampDuration punished; @override - final TimestampDuration notSeenConsecutively; + final StateReasonStats reason; + + /// Create a copy of StateStats + /// with the given fields replaced by the non-null parameter values. @override - final TimestampDuration inUnreliablePingSpan; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$StateStatsCopyWith<_StateStats> get copyWith => + __$StateStatsCopyWithImpl<_StateStats>(this, _$identity); @override - String toString() { - return 'StateReasonStats(canNotSend: $canNotSend, tooManyLostAnswers: $tooManyLostAnswers, noPingResponse: $noPingResponse, failedToSend: $failedToSend, lostAnswers: $lostAnswers, notSeenConsecutively: $notSeenConsecutively, inUnreliablePingSpan: $inUnreliablePingSpan)'; + Map toJson() { + return _$StateStatsToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$StateReasonStatsImpl && + other is _StateStats && + (identical(other.span, span) || other.span == span) && + (identical(other.reliable, reliable) || + other.reliable == reliable) && + (identical(other.unreliable, unreliable) || + other.unreliable == unreliable) && + (identical(other.dead, dead) || other.dead == dead) && + (identical(other.punished, punished) || + other.punished == punished) && + (identical(other.reason, reason) || other.reason == reason)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, span, reliable, unreliable, dead, punished, reason); + + @override + String toString() { + return 'StateStats(span: $span, reliable: $reliable, unreliable: $unreliable, dead: $dead, punished: $punished, reason: $reason)'; + } +} + +/// @nodoc +abstract mixin class _$StateStatsCopyWith<$Res> + implements $StateStatsCopyWith<$Res> { + factory _$StateStatsCopyWith( + _StateStats value, $Res Function(_StateStats) _then) = + __$StateStatsCopyWithImpl; + @override + @useResult + $Res call( + {TimestampDuration span, + TimestampDuration reliable, + TimestampDuration unreliable, + TimestampDuration dead, + TimestampDuration punished, + StateReasonStats reason}); + + @override + $StateReasonStatsCopyWith<$Res> get reason; +} + +/// @nodoc +class __$StateStatsCopyWithImpl<$Res> implements _$StateStatsCopyWith<$Res> { + __$StateStatsCopyWithImpl(this._self, this._then); + + final _StateStats _self; + final $Res Function(_StateStats) _then; + + /// Create a copy of StateStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? span = null, + Object? reliable = null, + Object? unreliable = null, + Object? dead = null, + Object? punished = null, + Object? reason = null, + }) { + return _then(_StateStats( + span: null == span + ? _self.span + : span // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + reliable: null == reliable + ? _self.reliable + : reliable // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + unreliable: null == unreliable + ? _self.unreliable + : unreliable // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + dead: null == dead + ? _self.dead + : dead // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + punished: null == punished + ? _self.punished + : punished // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + reason: null == reason + ? _self.reason + : reason // ignore: cast_nullable_to_non_nullable + as StateReasonStats, + )); + } + + /// Create a copy of StateStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $StateReasonStatsCopyWith<$Res> get reason { + return $StateReasonStatsCopyWith<$Res>(_self.reason, (value) { + return _then(_self.copyWith(reason: value)); + }); + } +} + +/// @nodoc +mixin _$StateReasonStats { + TimestampDuration get canNotSend; + TimestampDuration get tooManyLostAnswers; + TimestampDuration get noPingResponse; + TimestampDuration get failedToSend; + TimestampDuration get lostAnswers; + TimestampDuration get notSeenConsecutively; + TimestampDuration get inUnreliablePingSpan; + + /// Create a copy of StateReasonStats + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $StateReasonStatsCopyWith get copyWith => + _$StateReasonStatsCopyWithImpl( + this as StateReasonStats, _$identity); + + /// Serializes this StateReasonStats to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is StateReasonStats && (identical(other.canNotSend, canNotSend) || other.canNotSend == canNotSend) && (identical(other.tooManyLostAnswers, tooManyLostAnswers) || @@ -1201,316 +993,265 @@ class _$StateReasonStatsImpl implements _StateReasonStats { notSeenConsecutively, inUnreliablePingSpan); - /// Create a copy of StateReasonStats - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$StateReasonStatsImplCopyWith<_$StateReasonStatsImpl> get copyWith => - __$$StateReasonStatsImplCopyWithImpl<_$StateReasonStatsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$StateReasonStatsImplToJson( - this, - ); - } -} - -abstract class _StateReasonStats implements StateReasonStats { - const factory _StateReasonStats( - {required final TimestampDuration canNotSend, - required final TimestampDuration tooManyLostAnswers, - required final TimestampDuration noPingResponse, - required final TimestampDuration failedToSend, - required final TimestampDuration lostAnswers, - required final TimestampDuration notSeenConsecutively, - required final TimestampDuration inUnreliablePingSpan}) = - _$StateReasonStatsImpl; - - factory _StateReasonStats.fromJson(Map json) = - _$StateReasonStatsImpl.fromJson; - - @override - TimestampDuration get canNotSend; - @override - TimestampDuration get tooManyLostAnswers; - @override - TimestampDuration get noPingResponse; - @override - TimestampDuration get failedToSend; - @override - TimestampDuration get lostAnswers; - @override - TimestampDuration get notSeenConsecutively; - @override - TimestampDuration get inUnreliablePingSpan; - - /// Create a copy of StateReasonStats - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$StateReasonStatsImplCopyWith<_$StateReasonStatsImpl> get copyWith => - throw _privateConstructorUsedError; -} - -AnswerStats _$AnswerStatsFromJson(Map json) { - return _AnswerStats.fromJson(json); -} - -/// @nodoc -mixin _$AnswerStats { - TimestampDuration get span => throw _privateConstructorUsedError; - int get questions => throw _privateConstructorUsedError; - int get answers => throw _privateConstructorUsedError; - int get lostAnswers => throw _privateConstructorUsedError; - int get consecutiveAnswersMaximum => throw _privateConstructorUsedError; - int get consecutiveAnswersAverage => throw _privateConstructorUsedError; - int get consecutiveAnswersMinimum => throw _privateConstructorUsedError; - int get consecutiveLostAnswersMaximum => throw _privateConstructorUsedError; - int get consecutiveLostAnswersAverage => throw _privateConstructorUsedError; - int get consecutiveLostAnswersMinimum => throw _privateConstructorUsedError; - - /// Serializes this AnswerStats to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of AnswerStats - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $AnswerStatsCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $AnswerStatsCopyWith<$Res> { - factory $AnswerStatsCopyWith( - AnswerStats value, $Res Function(AnswerStats) then) = - _$AnswerStatsCopyWithImpl<$Res, AnswerStats>; - @useResult - $Res call( - {TimestampDuration span, - int questions, - int answers, - int lostAnswers, - int consecutiveAnswersMaximum, - int consecutiveAnswersAverage, - int consecutiveAnswersMinimum, - int consecutiveLostAnswersMaximum, - int consecutiveLostAnswersAverage, - int consecutiveLostAnswersMinimum}); -} - -/// @nodoc -class _$AnswerStatsCopyWithImpl<$Res, $Val extends AnswerStats> - implements $AnswerStatsCopyWith<$Res> { - _$AnswerStatsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of AnswerStats - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? span = null, - Object? questions = null, - Object? answers = null, - Object? lostAnswers = null, - Object? consecutiveAnswersMaximum = null, - Object? consecutiveAnswersAverage = null, - Object? consecutiveAnswersMinimum = null, - Object? consecutiveLostAnswersMaximum = null, - Object? consecutiveLostAnswersAverage = null, - Object? consecutiveLostAnswersMinimum = null, - }) { - return _then(_value.copyWith( - span: null == span - ? _value.span - : span // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - questions: null == questions - ? _value.questions - : questions // ignore: cast_nullable_to_non_nullable - as int, - answers: null == answers - ? _value.answers - : answers // ignore: cast_nullable_to_non_nullable - as int, - lostAnswers: null == lostAnswers - ? _value.lostAnswers - : lostAnswers // ignore: cast_nullable_to_non_nullable - as int, - consecutiveAnswersMaximum: null == consecutiveAnswersMaximum - ? _value.consecutiveAnswersMaximum - : consecutiveAnswersMaximum // ignore: cast_nullable_to_non_nullable - as int, - consecutiveAnswersAverage: null == consecutiveAnswersAverage - ? _value.consecutiveAnswersAverage - : consecutiveAnswersAverage // ignore: cast_nullable_to_non_nullable - as int, - consecutiveAnswersMinimum: null == consecutiveAnswersMinimum - ? _value.consecutiveAnswersMinimum - : consecutiveAnswersMinimum // ignore: cast_nullable_to_non_nullable - as int, - consecutiveLostAnswersMaximum: null == consecutiveLostAnswersMaximum - ? _value.consecutiveLostAnswersMaximum - : consecutiveLostAnswersMaximum // ignore: cast_nullable_to_non_nullable - as int, - consecutiveLostAnswersAverage: null == consecutiveLostAnswersAverage - ? _value.consecutiveLostAnswersAverage - : consecutiveLostAnswersAverage // ignore: cast_nullable_to_non_nullable - as int, - consecutiveLostAnswersMinimum: null == consecutiveLostAnswersMinimum - ? _value.consecutiveLostAnswersMinimum - : consecutiveLostAnswersMinimum // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); + String toString() { + return 'StateReasonStats(canNotSend: $canNotSend, tooManyLostAnswers: $tooManyLostAnswers, noPingResponse: $noPingResponse, failedToSend: $failedToSend, lostAnswers: $lostAnswers, notSeenConsecutively: $notSeenConsecutively, inUnreliablePingSpan: $inUnreliablePingSpan)'; } } /// @nodoc -abstract class _$$AnswerStatsImplCopyWith<$Res> - implements $AnswerStatsCopyWith<$Res> { - factory _$$AnswerStatsImplCopyWith( - _$AnswerStatsImpl value, $Res Function(_$AnswerStatsImpl) then) = - __$$AnswerStatsImplCopyWithImpl<$Res>; - @override +abstract mixin class $StateReasonStatsCopyWith<$Res> { + factory $StateReasonStatsCopyWith( + StateReasonStats value, $Res Function(StateReasonStats) _then) = + _$StateReasonStatsCopyWithImpl; @useResult $Res call( - {TimestampDuration span, - int questions, - int answers, - int lostAnswers, - int consecutiveAnswersMaximum, - int consecutiveAnswersAverage, - int consecutiveAnswersMinimum, - int consecutiveLostAnswersMaximum, - int consecutiveLostAnswersAverage, - int consecutiveLostAnswersMinimum}); + {TimestampDuration canNotSend, + TimestampDuration tooManyLostAnswers, + TimestampDuration noPingResponse, + TimestampDuration failedToSend, + TimestampDuration lostAnswers, + TimestampDuration notSeenConsecutively, + TimestampDuration inUnreliablePingSpan}); } /// @nodoc -class __$$AnswerStatsImplCopyWithImpl<$Res> - extends _$AnswerStatsCopyWithImpl<$Res, _$AnswerStatsImpl> - implements _$$AnswerStatsImplCopyWith<$Res> { - __$$AnswerStatsImplCopyWithImpl( - _$AnswerStatsImpl _value, $Res Function(_$AnswerStatsImpl) _then) - : super(_value, _then); +class _$StateReasonStatsCopyWithImpl<$Res> + implements $StateReasonStatsCopyWith<$Res> { + _$StateReasonStatsCopyWithImpl(this._self, this._then); - /// Create a copy of AnswerStats + final StateReasonStats _self; + final $Res Function(StateReasonStats) _then; + + /// Create a copy of StateReasonStats /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? span = null, - Object? questions = null, - Object? answers = null, + Object? canNotSend = null, + Object? tooManyLostAnswers = null, + Object? noPingResponse = null, + Object? failedToSend = null, Object? lostAnswers = null, - Object? consecutiveAnswersMaximum = null, - Object? consecutiveAnswersAverage = null, - Object? consecutiveAnswersMinimum = null, - Object? consecutiveLostAnswersMaximum = null, - Object? consecutiveLostAnswersAverage = null, - Object? consecutiveLostAnswersMinimum = null, + Object? notSeenConsecutively = null, + Object? inUnreliablePingSpan = null, }) { - return _then(_$AnswerStatsImpl( - span: null == span - ? _value.span - : span // ignore: cast_nullable_to_non_nullable + return _then(_self.copyWith( + canNotSend: null == canNotSend + ? _self.canNotSend + : canNotSend // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + tooManyLostAnswers: null == tooManyLostAnswers + ? _self.tooManyLostAnswers + : tooManyLostAnswers // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + noPingResponse: null == noPingResponse + ? _self.noPingResponse + : noPingResponse // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + failedToSend: null == failedToSend + ? _self.failedToSend + : failedToSend // ignore: cast_nullable_to_non_nullable as TimestampDuration, - questions: null == questions - ? _value.questions - : questions // ignore: cast_nullable_to_non_nullable - as int, - answers: null == answers - ? _value.answers - : answers // ignore: cast_nullable_to_non_nullable - as int, lostAnswers: null == lostAnswers - ? _value.lostAnswers + ? _self.lostAnswers : lostAnswers // ignore: cast_nullable_to_non_nullable - as int, - consecutiveAnswersMaximum: null == consecutiveAnswersMaximum - ? _value.consecutiveAnswersMaximum - : consecutiveAnswersMaximum // ignore: cast_nullable_to_non_nullable - as int, - consecutiveAnswersAverage: null == consecutiveAnswersAverage - ? _value.consecutiveAnswersAverage - : consecutiveAnswersAverage // ignore: cast_nullable_to_non_nullable - as int, - consecutiveAnswersMinimum: null == consecutiveAnswersMinimum - ? _value.consecutiveAnswersMinimum - : consecutiveAnswersMinimum // ignore: cast_nullable_to_non_nullable - as int, - consecutiveLostAnswersMaximum: null == consecutiveLostAnswersMaximum - ? _value.consecutiveLostAnswersMaximum - : consecutiveLostAnswersMaximum // ignore: cast_nullable_to_non_nullable - as int, - consecutiveLostAnswersAverage: null == consecutiveLostAnswersAverage - ? _value.consecutiveLostAnswersAverage - : consecutiveLostAnswersAverage // ignore: cast_nullable_to_non_nullable - as int, - consecutiveLostAnswersMinimum: null == consecutiveLostAnswersMinimum - ? _value.consecutiveLostAnswersMinimum - : consecutiveLostAnswersMinimum // ignore: cast_nullable_to_non_nullable - as int, + as TimestampDuration, + notSeenConsecutively: null == notSeenConsecutively + ? _self.notSeenConsecutively + : notSeenConsecutively // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + inUnreliablePingSpan: null == inUnreliablePingSpan + ? _self.inUnreliablePingSpan + : inUnreliablePingSpan // ignore: cast_nullable_to_non_nullable + as TimestampDuration, )); } } /// @nodoc @JsonSerializable() -class _$AnswerStatsImpl implements _AnswerStats { - const _$AnswerStatsImpl( - {required this.span, - required this.questions, - required this.answers, +class _StateReasonStats implements StateReasonStats { + const _StateReasonStats( + {required this.canNotSend, + required this.tooManyLostAnswers, + required this.noPingResponse, + required this.failedToSend, required this.lostAnswers, - required this.consecutiveAnswersMaximum, - required this.consecutiveAnswersAverage, - required this.consecutiveAnswersMinimum, - required this.consecutiveLostAnswersMaximum, - required this.consecutiveLostAnswersAverage, - required this.consecutiveLostAnswersMinimum}); - - factory _$AnswerStatsImpl.fromJson(Map json) => - _$$AnswerStatsImplFromJson(json); + required this.notSeenConsecutively, + required this.inUnreliablePingSpan}); + factory _StateReasonStats.fromJson(Map json) => + _$StateReasonStatsFromJson(json); @override - final TimestampDuration span; + final TimestampDuration canNotSend; @override - final int questions; + final TimestampDuration tooManyLostAnswers; @override - final int answers; + final TimestampDuration noPingResponse; @override - final int lostAnswers; + final TimestampDuration failedToSend; @override - final int consecutiveAnswersMaximum; + final TimestampDuration lostAnswers; @override - final int consecutiveAnswersAverage; + final TimestampDuration notSeenConsecutively; @override - final int consecutiveAnswersMinimum; + final TimestampDuration inUnreliablePingSpan; + + /// Create a copy of StateReasonStats + /// with the given fields replaced by the non-null parameter values. @override - final int consecutiveLostAnswersMaximum; - @override - final int consecutiveLostAnswersAverage; - @override - final int consecutiveLostAnswersMinimum; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$StateReasonStatsCopyWith<_StateReasonStats> get copyWith => + __$StateReasonStatsCopyWithImpl<_StateReasonStats>(this, _$identity); @override - String toString() { - return 'AnswerStats(span: $span, questions: $questions, answers: $answers, lostAnswers: $lostAnswers, consecutiveAnswersMaximum: $consecutiveAnswersMaximum, consecutiveAnswersAverage: $consecutiveAnswersAverage, consecutiveAnswersMinimum: $consecutiveAnswersMinimum, consecutiveLostAnswersMaximum: $consecutiveLostAnswersMaximum, consecutiveLostAnswersAverage: $consecutiveLostAnswersAverage, consecutiveLostAnswersMinimum: $consecutiveLostAnswersMinimum)'; + Map toJson() { + return _$StateReasonStatsToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$AnswerStatsImpl && + other is _StateReasonStats && + (identical(other.canNotSend, canNotSend) || + other.canNotSend == canNotSend) && + (identical(other.tooManyLostAnswers, tooManyLostAnswers) || + other.tooManyLostAnswers == tooManyLostAnswers) && + (identical(other.noPingResponse, noPingResponse) || + other.noPingResponse == noPingResponse) && + (identical(other.failedToSend, failedToSend) || + other.failedToSend == failedToSend) && + (identical(other.lostAnswers, lostAnswers) || + other.lostAnswers == lostAnswers) && + (identical(other.notSeenConsecutively, notSeenConsecutively) || + other.notSeenConsecutively == notSeenConsecutively) && + (identical(other.inUnreliablePingSpan, inUnreliablePingSpan) || + other.inUnreliablePingSpan == inUnreliablePingSpan)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + canNotSend, + tooManyLostAnswers, + noPingResponse, + failedToSend, + lostAnswers, + notSeenConsecutively, + inUnreliablePingSpan); + + @override + String toString() { + return 'StateReasonStats(canNotSend: $canNotSend, tooManyLostAnswers: $tooManyLostAnswers, noPingResponse: $noPingResponse, failedToSend: $failedToSend, lostAnswers: $lostAnswers, notSeenConsecutively: $notSeenConsecutively, inUnreliablePingSpan: $inUnreliablePingSpan)'; + } +} + +/// @nodoc +abstract mixin class _$StateReasonStatsCopyWith<$Res> + implements $StateReasonStatsCopyWith<$Res> { + factory _$StateReasonStatsCopyWith( + _StateReasonStats value, $Res Function(_StateReasonStats) _then) = + __$StateReasonStatsCopyWithImpl; + @override + @useResult + $Res call( + {TimestampDuration canNotSend, + TimestampDuration tooManyLostAnswers, + TimestampDuration noPingResponse, + TimestampDuration failedToSend, + TimestampDuration lostAnswers, + TimestampDuration notSeenConsecutively, + TimestampDuration inUnreliablePingSpan}); +} + +/// @nodoc +class __$StateReasonStatsCopyWithImpl<$Res> + implements _$StateReasonStatsCopyWith<$Res> { + __$StateReasonStatsCopyWithImpl(this._self, this._then); + + final _StateReasonStats _self; + final $Res Function(_StateReasonStats) _then; + + /// Create a copy of StateReasonStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? canNotSend = null, + Object? tooManyLostAnswers = null, + Object? noPingResponse = null, + Object? failedToSend = null, + Object? lostAnswers = null, + Object? notSeenConsecutively = null, + Object? inUnreliablePingSpan = null, + }) { + return _then(_StateReasonStats( + canNotSend: null == canNotSend + ? _self.canNotSend + : canNotSend // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + tooManyLostAnswers: null == tooManyLostAnswers + ? _self.tooManyLostAnswers + : tooManyLostAnswers // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + noPingResponse: null == noPingResponse + ? _self.noPingResponse + : noPingResponse // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + failedToSend: null == failedToSend + ? _self.failedToSend + : failedToSend // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + lostAnswers: null == lostAnswers + ? _self.lostAnswers + : lostAnswers // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + notSeenConsecutively: null == notSeenConsecutively + ? _self.notSeenConsecutively + : notSeenConsecutively // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + inUnreliablePingSpan: null == inUnreliablePingSpan + ? _self.inUnreliablePingSpan + : inUnreliablePingSpan // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + )); + } +} + +/// @nodoc +mixin _$AnswerStats { + TimestampDuration get span; + int get questions; + int get answers; + int get lostAnswers; + int get consecutiveAnswersMaximum; + int get consecutiveAnswersAverage; + int get consecutiveAnswersMinimum; + int get consecutiveLostAnswersMaximum; + int get consecutiveLostAnswersAverage; + int get consecutiveLostAnswersMinimum; + + /// Create a copy of AnswerStats + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $AnswerStatsCopyWith get copyWith => + _$AnswerStatsCopyWithImpl(this as AnswerStats, _$identity); + + /// Serializes this AnswerStats to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is AnswerStats && (identical(other.span, span) || other.span == span) && (identical(other.questions, questions) || other.questions == questions) && @@ -1555,366 +1296,325 @@ class _$AnswerStatsImpl implements _AnswerStats { consecutiveLostAnswersAverage, consecutiveLostAnswersMinimum); - /// Create a copy of AnswerStats - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$AnswerStatsImplCopyWith<_$AnswerStatsImpl> get copyWith => - __$$AnswerStatsImplCopyWithImpl<_$AnswerStatsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$AnswerStatsImplToJson( - this, - ); + String toString() { + return 'AnswerStats(span: $span, questions: $questions, answers: $answers, lostAnswers: $lostAnswers, consecutiveAnswersMaximum: $consecutiveAnswersMaximum, consecutiveAnswersAverage: $consecutiveAnswersAverage, consecutiveAnswersMinimum: $consecutiveAnswersMinimum, consecutiveLostAnswersMaximum: $consecutiveLostAnswersMaximum, consecutiveLostAnswersAverage: $consecutiveLostAnswersAverage, consecutiveLostAnswersMinimum: $consecutiveLostAnswersMinimum)'; } } -abstract class _AnswerStats implements AnswerStats { - const factory _AnswerStats( - {required final TimestampDuration span, - required final int questions, - required final int answers, - required final int lostAnswers, - required final int consecutiveAnswersMaximum, - required final int consecutiveAnswersAverage, - required final int consecutiveAnswersMinimum, - required final int consecutiveLostAnswersMaximum, - required final int consecutiveLostAnswersAverage, - required final int consecutiveLostAnswersMinimum}) = _$AnswerStatsImpl; - - factory _AnswerStats.fromJson(Map json) = - _$AnswerStatsImpl.fromJson; - - @override - TimestampDuration get span; - @override - int get questions; - @override - int get answers; - @override - int get lostAnswers; - @override - int get consecutiveAnswersMaximum; - @override - int get consecutiveAnswersAverage; - @override - int get consecutiveAnswersMinimum; - @override - int get consecutiveLostAnswersMaximum; - @override - int get consecutiveLostAnswersAverage; - @override - int get consecutiveLostAnswersMinimum; - - /// Create a copy of AnswerStats - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$AnswerStatsImplCopyWith<_$AnswerStatsImpl> 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 lastQuestionTs => throw _privateConstructorUsedError; - Timestamp? get lastSeenTs => throw _privateConstructorUsedError; - Timestamp? get firstConsecutiveSeenTs => throw _privateConstructorUsedError; - int get recentLostAnswersUnordered => throw _privateConstructorUsedError; - int get recentLostAnswersOrdered => throw _privateConstructorUsedError; - int get failedToSend => throw _privateConstructorUsedError; - AnswerStats get answerUnordered => throw _privateConstructorUsedError; - AnswerStats get answerOrdered => throw _privateConstructorUsedError; - - /// Serializes this RPCStats to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of RPCStats - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $RPCStatsCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $RPCStatsCopyWith<$Res> { - factory $RPCStatsCopyWith(RPCStats value, $Res Function(RPCStats) then) = - _$RPCStatsCopyWithImpl<$Res, RPCStats>; +abstract mixin class $AnswerStatsCopyWith<$Res> { + factory $AnswerStatsCopyWith( + AnswerStats value, $Res Function(AnswerStats) _then) = + _$AnswerStatsCopyWithImpl; @useResult $Res call( - {int messagesSent, - int messagesRcvd, - int questionsInFlight, - Timestamp? lastQuestionTs, - Timestamp? lastSeenTs, - Timestamp? firstConsecutiveSeenTs, - int recentLostAnswersUnordered, - int recentLostAnswersOrdered, - int failedToSend, - AnswerStats answerUnordered, - AnswerStats answerOrdered}); - - $AnswerStatsCopyWith<$Res> get answerUnordered; - $AnswerStatsCopyWith<$Res> get answerOrdered; + {TimestampDuration span, + int questions, + int answers, + int lostAnswers, + int consecutiveAnswersMaximum, + int consecutiveAnswersAverage, + int consecutiveAnswersMinimum, + int consecutiveLostAnswersMaximum, + int consecutiveLostAnswersAverage, + int consecutiveLostAnswersMinimum}); } /// @nodoc -class _$RPCStatsCopyWithImpl<$Res, $Val extends RPCStats> - implements $RPCStatsCopyWith<$Res> { - _$RPCStatsCopyWithImpl(this._value, this._then); +class _$AnswerStatsCopyWithImpl<$Res> implements $AnswerStatsCopyWith<$Res> { + _$AnswerStatsCopyWithImpl(this._self, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final AnswerStats _self; + final $Res Function(AnswerStats) _then; - /// Create a copy of RPCStats + /// Create a copy of AnswerStats /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? messagesSent = null, - Object? messagesRcvd = null, - Object? questionsInFlight = null, - Object? lastQuestionTs = freezed, - Object? lastSeenTs = freezed, - Object? firstConsecutiveSeenTs = freezed, - Object? recentLostAnswersUnordered = null, - Object? recentLostAnswersOrdered = null, - Object? failedToSend = null, - Object? answerUnordered = null, - Object? answerOrdered = null, + Object? span = null, + Object? questions = null, + Object? answers = null, + Object? lostAnswers = null, + Object? consecutiveAnswersMaximum = null, + Object? consecutiveAnswersAverage = null, + Object? consecutiveAnswersMinimum = null, + Object? consecutiveLostAnswersMaximum = null, + Object? consecutiveLostAnswersAverage = null, + Object? consecutiveLostAnswersMinimum = null, }) { - return _then(_value.copyWith( - messagesSent: null == messagesSent - ? _value.messagesSent - : messagesSent // ignore: cast_nullable_to_non_nullable + return _then(_self.copyWith( + span: null == span + ? _self.span + : span // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + questions: null == questions + ? _self.questions + : questions // ignore: cast_nullable_to_non_nullable as int, - messagesRcvd: null == messagesRcvd - ? _value.messagesRcvd - : messagesRcvd // ignore: cast_nullable_to_non_nullable + answers: null == answers + ? _self.answers + : answers // ignore: cast_nullable_to_non_nullable as int, - questionsInFlight: null == questionsInFlight - ? _value.questionsInFlight - : questionsInFlight // ignore: cast_nullable_to_non_nullable + lostAnswers: null == lostAnswers + ? _self.lostAnswers + : lostAnswers // ignore: cast_nullable_to_non_nullable as int, - lastQuestionTs: freezed == lastQuestionTs - ? _value.lastQuestionTs - : lastQuestionTs // 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?, - recentLostAnswersUnordered: null == recentLostAnswersUnordered - ? _value.recentLostAnswersUnordered - : recentLostAnswersUnordered // ignore: cast_nullable_to_non_nullable + consecutiveAnswersMaximum: null == consecutiveAnswersMaximum + ? _self.consecutiveAnswersMaximum + : consecutiveAnswersMaximum // ignore: cast_nullable_to_non_nullable as int, - recentLostAnswersOrdered: null == recentLostAnswersOrdered - ? _value.recentLostAnswersOrdered - : recentLostAnswersOrdered // ignore: cast_nullable_to_non_nullable + consecutiveAnswersAverage: null == consecutiveAnswersAverage + ? _self.consecutiveAnswersAverage + : consecutiveAnswersAverage // ignore: cast_nullable_to_non_nullable as int, - failedToSend: null == failedToSend - ? _value.failedToSend - : failedToSend // ignore: cast_nullable_to_non_nullable + consecutiveAnswersMinimum: null == consecutiveAnswersMinimum + ? _self.consecutiveAnswersMinimum + : consecutiveAnswersMinimum // ignore: cast_nullable_to_non_nullable as int, - answerUnordered: null == answerUnordered - ? _value.answerUnordered - : answerUnordered // ignore: cast_nullable_to_non_nullable - as AnswerStats, - answerOrdered: null == answerOrdered - ? _value.answerOrdered - : answerOrdered // ignore: cast_nullable_to_non_nullable - as AnswerStats, - ) as $Val); - } - - /// Create a copy of RPCStats - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AnswerStatsCopyWith<$Res> get answerUnordered { - return $AnswerStatsCopyWith<$Res>(_value.answerUnordered, (value) { - return _then(_value.copyWith(answerUnordered: value) as $Val); - }); - } - - /// Create a copy of RPCStats - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AnswerStatsCopyWith<$Res> get answerOrdered { - return $AnswerStatsCopyWith<$Res>(_value.answerOrdered, (value) { - return _then(_value.copyWith(answerOrdered: value) as $Val); - }); - } -} - -/// @nodoc -abstract class _$$RPCStatsImplCopyWith<$Res> - implements $RPCStatsCopyWith<$Res> { - factory _$$RPCStatsImplCopyWith( - _$RPCStatsImpl value, $Res Function(_$RPCStatsImpl) then) = - __$$RPCStatsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {int messagesSent, - int messagesRcvd, - int questionsInFlight, - Timestamp? lastQuestionTs, - Timestamp? lastSeenTs, - Timestamp? firstConsecutiveSeenTs, - int recentLostAnswersUnordered, - int recentLostAnswersOrdered, - int failedToSend, - AnswerStats answerUnordered, - AnswerStats answerOrdered}); - - @override - $AnswerStatsCopyWith<$Res> get answerUnordered; - @override - $AnswerStatsCopyWith<$Res> get answerOrdered; -} - -/// @nodoc -class __$$RPCStatsImplCopyWithImpl<$Res> - extends _$RPCStatsCopyWithImpl<$Res, _$RPCStatsImpl> - implements _$$RPCStatsImplCopyWith<$Res> { - __$$RPCStatsImplCopyWithImpl( - _$RPCStatsImpl _value, $Res Function(_$RPCStatsImpl) _then) - : super(_value, _then); - - /// Create a copy of RPCStats - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? messagesSent = null, - Object? messagesRcvd = null, - Object? questionsInFlight = null, - Object? lastQuestionTs = freezed, - Object? lastSeenTs = freezed, - Object? firstConsecutiveSeenTs = freezed, - Object? recentLostAnswersUnordered = null, - Object? recentLostAnswersOrdered = null, - Object? failedToSend = null, - Object? answerUnordered = null, - Object? answerOrdered = null, - }) { - return _then(_$RPCStatsImpl( - messagesSent: null == messagesSent - ? _value.messagesSent - : messagesSent // ignore: cast_nullable_to_non_nullable + consecutiveLostAnswersMaximum: null == consecutiveLostAnswersMaximum + ? _self.consecutiveLostAnswersMaximum + : consecutiveLostAnswersMaximum // ignore: cast_nullable_to_non_nullable as int, - messagesRcvd: null == messagesRcvd - ? _value.messagesRcvd - : messagesRcvd // ignore: cast_nullable_to_non_nullable + consecutiveLostAnswersAverage: null == consecutiveLostAnswersAverage + ? _self.consecutiveLostAnswersAverage + : consecutiveLostAnswersAverage // ignore: cast_nullable_to_non_nullable as int, - questionsInFlight: null == questionsInFlight - ? _value.questionsInFlight - : questionsInFlight // ignore: cast_nullable_to_non_nullable + consecutiveLostAnswersMinimum: null == consecutiveLostAnswersMinimum + ? _self.consecutiveLostAnswersMinimum + : consecutiveLostAnswersMinimum // ignore: cast_nullable_to_non_nullable as int, - lastQuestionTs: freezed == lastQuestionTs - ? _value.lastQuestionTs - : lastQuestionTs // 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?, - recentLostAnswersUnordered: null == recentLostAnswersUnordered - ? _value.recentLostAnswersUnordered - : recentLostAnswersUnordered // ignore: cast_nullable_to_non_nullable - as int, - recentLostAnswersOrdered: null == recentLostAnswersOrdered - ? _value.recentLostAnswersOrdered - : recentLostAnswersOrdered // ignore: cast_nullable_to_non_nullable - as int, - failedToSend: null == failedToSend - ? _value.failedToSend - : failedToSend // ignore: cast_nullable_to_non_nullable - as int, - answerUnordered: null == answerUnordered - ? _value.answerUnordered - : answerUnordered // ignore: cast_nullable_to_non_nullable - as AnswerStats, - answerOrdered: null == answerOrdered - ? _value.answerOrdered - : answerOrdered // ignore: cast_nullable_to_non_nullable - as AnswerStats, )); } } /// @nodoc @JsonSerializable() -class _$RPCStatsImpl implements _RPCStats { - const _$RPCStatsImpl( - {required this.messagesSent, - required this.messagesRcvd, - required this.questionsInFlight, - required this.lastQuestionTs, - required this.lastSeenTs, - required this.firstConsecutiveSeenTs, - required this.recentLostAnswersUnordered, - required this.recentLostAnswersOrdered, - required this.failedToSend, - required this.answerUnordered, - required this.answerOrdered}); - - factory _$RPCStatsImpl.fromJson(Map json) => - _$$RPCStatsImplFromJson(json); +class _AnswerStats implements AnswerStats { + const _AnswerStats( + {required this.span, + required this.questions, + required this.answers, + required this.lostAnswers, + required this.consecutiveAnswersMaximum, + required this.consecutiveAnswersAverage, + required this.consecutiveAnswersMinimum, + required this.consecutiveLostAnswersMaximum, + required this.consecutiveLostAnswersAverage, + required this.consecutiveLostAnswersMinimum}); + factory _AnswerStats.fromJson(Map json) => + _$AnswerStatsFromJson(json); @override - final int messagesSent; + final TimestampDuration span; @override - final int messagesRcvd; + final int questions; @override - final int questionsInFlight; + final int answers; @override - final Timestamp? lastQuestionTs; + final int lostAnswers; @override - final Timestamp? lastSeenTs; + final int consecutiveAnswersMaximum; @override - final Timestamp? firstConsecutiveSeenTs; + final int consecutiveAnswersAverage; @override - final int recentLostAnswersUnordered; + final int consecutiveAnswersMinimum; @override - final int recentLostAnswersOrdered; + final int consecutiveLostAnswersMaximum; @override - final int failedToSend; + final int consecutiveLostAnswersAverage; @override - final AnswerStats answerUnordered; + final int consecutiveLostAnswersMinimum; + + /// Create a copy of AnswerStats + /// with the given fields replaced by the non-null parameter values. @override - final AnswerStats answerOrdered; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$AnswerStatsCopyWith<_AnswerStats> get copyWith => + __$AnswerStatsCopyWithImpl<_AnswerStats>(this, _$identity); @override - String toString() { - return 'RPCStats(messagesSent: $messagesSent, messagesRcvd: $messagesRcvd, questionsInFlight: $questionsInFlight, lastQuestionTs: $lastQuestionTs, lastSeenTs: $lastSeenTs, firstConsecutiveSeenTs: $firstConsecutiveSeenTs, recentLostAnswersUnordered: $recentLostAnswersUnordered, recentLostAnswersOrdered: $recentLostAnswersOrdered, failedToSend: $failedToSend, answerUnordered: $answerUnordered, answerOrdered: $answerOrdered)'; + Map toJson() { + return _$AnswerStatsToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$RPCStatsImpl && + other is _AnswerStats && + (identical(other.span, span) || other.span == span) && + (identical(other.questions, questions) || + other.questions == questions) && + (identical(other.answers, answers) || other.answers == answers) && + (identical(other.lostAnswers, lostAnswers) || + other.lostAnswers == lostAnswers) && + (identical(other.consecutiveAnswersMaximum, + consecutiveAnswersMaximum) || + other.consecutiveAnswersMaximum == consecutiveAnswersMaximum) && + (identical(other.consecutiveAnswersAverage, + consecutiveAnswersAverage) || + other.consecutiveAnswersAverage == consecutiveAnswersAverage) && + (identical(other.consecutiveAnswersMinimum, + consecutiveAnswersMinimum) || + other.consecutiveAnswersMinimum == consecutiveAnswersMinimum) && + (identical(other.consecutiveLostAnswersMaximum, + consecutiveLostAnswersMaximum) || + other.consecutiveLostAnswersMaximum == + consecutiveLostAnswersMaximum) && + (identical(other.consecutiveLostAnswersAverage, + consecutiveLostAnswersAverage) || + other.consecutiveLostAnswersAverage == + consecutiveLostAnswersAverage) && + (identical(other.consecutiveLostAnswersMinimum, + consecutiveLostAnswersMinimum) || + other.consecutiveLostAnswersMinimum == + consecutiveLostAnswersMinimum)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + span, + questions, + answers, + lostAnswers, + consecutiveAnswersMaximum, + consecutiveAnswersAverage, + consecutiveAnswersMinimum, + consecutiveLostAnswersMaximum, + consecutiveLostAnswersAverage, + consecutiveLostAnswersMinimum); + + @override + String toString() { + return 'AnswerStats(span: $span, questions: $questions, answers: $answers, lostAnswers: $lostAnswers, consecutiveAnswersMaximum: $consecutiveAnswersMaximum, consecutiveAnswersAverage: $consecutiveAnswersAverage, consecutiveAnswersMinimum: $consecutiveAnswersMinimum, consecutiveLostAnswersMaximum: $consecutiveLostAnswersMaximum, consecutiveLostAnswersAverage: $consecutiveLostAnswersAverage, consecutiveLostAnswersMinimum: $consecutiveLostAnswersMinimum)'; + } +} + +/// @nodoc +abstract mixin class _$AnswerStatsCopyWith<$Res> + implements $AnswerStatsCopyWith<$Res> { + factory _$AnswerStatsCopyWith( + _AnswerStats value, $Res Function(_AnswerStats) _then) = + __$AnswerStatsCopyWithImpl; + @override + @useResult + $Res call( + {TimestampDuration span, + int questions, + int answers, + int lostAnswers, + int consecutiveAnswersMaximum, + int consecutiveAnswersAverage, + int consecutiveAnswersMinimum, + int consecutiveLostAnswersMaximum, + int consecutiveLostAnswersAverage, + int consecutiveLostAnswersMinimum}); +} + +/// @nodoc +class __$AnswerStatsCopyWithImpl<$Res> implements _$AnswerStatsCopyWith<$Res> { + __$AnswerStatsCopyWithImpl(this._self, this._then); + + final _AnswerStats _self; + final $Res Function(_AnswerStats) _then; + + /// Create a copy of AnswerStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? span = null, + Object? questions = null, + Object? answers = null, + Object? lostAnswers = null, + Object? consecutiveAnswersMaximum = null, + Object? consecutiveAnswersAverage = null, + Object? consecutiveAnswersMinimum = null, + Object? consecutiveLostAnswersMaximum = null, + Object? consecutiveLostAnswersAverage = null, + Object? consecutiveLostAnswersMinimum = null, + }) { + return _then(_AnswerStats( + span: null == span + ? _self.span + : span // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + questions: null == questions + ? _self.questions + : questions // ignore: cast_nullable_to_non_nullable + as int, + answers: null == answers + ? _self.answers + : answers // ignore: cast_nullable_to_non_nullable + as int, + lostAnswers: null == lostAnswers + ? _self.lostAnswers + : lostAnswers // ignore: cast_nullable_to_non_nullable + as int, + consecutiveAnswersMaximum: null == consecutiveAnswersMaximum + ? _self.consecutiveAnswersMaximum + : consecutiveAnswersMaximum // ignore: cast_nullable_to_non_nullable + as int, + consecutiveAnswersAverage: null == consecutiveAnswersAverage + ? _self.consecutiveAnswersAverage + : consecutiveAnswersAverage // ignore: cast_nullable_to_non_nullable + as int, + consecutiveAnswersMinimum: null == consecutiveAnswersMinimum + ? _self.consecutiveAnswersMinimum + : consecutiveAnswersMinimum // ignore: cast_nullable_to_non_nullable + as int, + consecutiveLostAnswersMaximum: null == consecutiveLostAnswersMaximum + ? _self.consecutiveLostAnswersMaximum + : consecutiveLostAnswersMaximum // ignore: cast_nullable_to_non_nullable + as int, + consecutiveLostAnswersAverage: null == consecutiveLostAnswersAverage + ? _self.consecutiveLostAnswersAverage + : consecutiveLostAnswersAverage // ignore: cast_nullable_to_non_nullable + as int, + consecutiveLostAnswersMinimum: null == consecutiveLostAnswersMinimum + ? _self.consecutiveLostAnswersMinimum + : consecutiveLostAnswersMinimum // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +mixin _$RPCStats { + int get messagesSent; + int get messagesRcvd; + int get questionsInFlight; + Timestamp? get lastQuestionTs; + Timestamp? get lastSeenTs; + Timestamp? get firstConsecutiveSeenTs; + int get recentLostAnswersUnordered; + int get recentLostAnswersOrdered; + int get failedToSend; + AnswerStats get answerUnordered; + AnswerStats get answerOrdered; + + /// Create a copy of RPCStats + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $RPCStatsCopyWith get copyWith => + _$RPCStatsCopyWithImpl(this as RPCStats, _$identity); + + /// Serializes this RPCStats to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is RPCStats && (identical(other.messagesSent, messagesSent) || other.messagesSent == messagesSent) && (identical(other.messagesRcvd, messagesRcvd) || @@ -1958,303 +1658,379 @@ class _$RPCStatsImpl implements _RPCStats { answerUnordered, answerOrdered); - /// Create a copy of RPCStats - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$RPCStatsImplCopyWith<_$RPCStatsImpl> get copyWith => - __$$RPCStatsImplCopyWithImpl<_$RPCStatsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$RPCStatsImplToJson( - this, - ); + String toString() { + return 'RPCStats(messagesSent: $messagesSent, messagesRcvd: $messagesRcvd, questionsInFlight: $questionsInFlight, lastQuestionTs: $lastQuestionTs, lastSeenTs: $lastSeenTs, firstConsecutiveSeenTs: $firstConsecutiveSeenTs, recentLostAnswersUnordered: $recentLostAnswersUnordered, recentLostAnswersOrdered: $recentLostAnswersOrdered, failedToSend: $failedToSend, answerUnordered: $answerUnordered, answerOrdered: $answerOrdered)'; } } -abstract class _RPCStats implements RPCStats { - const factory _RPCStats( - {required final int messagesSent, - required final int messagesRcvd, - required final int questionsInFlight, - required final Timestamp? lastQuestionTs, - required final Timestamp? lastSeenTs, - required final Timestamp? firstConsecutiveSeenTs, - required final int recentLostAnswersUnordered, - required final int recentLostAnswersOrdered, - required final int failedToSend, - required final AnswerStats answerUnordered, - required final AnswerStats answerOrdered}) = _$RPCStatsImpl; - - factory _RPCStats.fromJson(Map json) = - _$RPCStatsImpl.fromJson; - - @override - int get messagesSent; - @override - int get messagesRcvd; - @override - int get questionsInFlight; - @override - Timestamp? get lastQuestionTs; - @override - Timestamp? get lastSeenTs; - @override - Timestamp? get firstConsecutiveSeenTs; - @override - int get recentLostAnswersUnordered; - @override - int get recentLostAnswersOrdered; - @override - int get failedToSend; - @override - AnswerStats get answerUnordered; - @override - AnswerStats get answerOrdered; - - /// Create a copy of RPCStats - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$RPCStatsImplCopyWith<_$RPCStatsImpl> 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; - TransferStatsDownUp get transfer => throw _privateConstructorUsedError; - StateStats get state => throw _privateConstructorUsedError; - LatencyStats? get latency => throw _privateConstructorUsedError; - - /// Serializes this PeerStats to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of PeerStats - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PeerStatsCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $PeerStatsCopyWith<$Res> { - factory $PeerStatsCopyWith(PeerStats value, $Res Function(PeerStats) then) = - _$PeerStatsCopyWithImpl<$Res, PeerStats>; +abstract mixin class $RPCStatsCopyWith<$Res> { + factory $RPCStatsCopyWith(RPCStats value, $Res Function(RPCStats) _then) = + _$RPCStatsCopyWithImpl; @useResult $Res call( - {Timestamp timeAdded, - RPCStats rpcStats, - TransferStatsDownUp transfer, - StateStats state, - LatencyStats? latency}); + {int messagesSent, + int messagesRcvd, + int questionsInFlight, + Timestamp? lastQuestionTs, + Timestamp? lastSeenTs, + Timestamp? firstConsecutiveSeenTs, + int recentLostAnswersUnordered, + int recentLostAnswersOrdered, + int failedToSend, + AnswerStats answerUnordered, + AnswerStats answerOrdered}); - $RPCStatsCopyWith<$Res> get rpcStats; - $TransferStatsDownUpCopyWith<$Res> get transfer; - $StateStatsCopyWith<$Res> get state; - $LatencyStatsCopyWith<$Res>? get latency; + $AnswerStatsCopyWith<$Res> get answerUnordered; + $AnswerStatsCopyWith<$Res> get answerOrdered; } /// @nodoc -class _$PeerStatsCopyWithImpl<$Res, $Val extends PeerStats> - implements $PeerStatsCopyWith<$Res> { - _$PeerStatsCopyWithImpl(this._value, this._then); +class _$RPCStatsCopyWithImpl<$Res> implements $RPCStatsCopyWith<$Res> { + _$RPCStatsCopyWithImpl(this._self, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final RPCStats _self; + final $Res Function(RPCStats) _then; - /// Create a copy of PeerStats + /// Create a copy of RPCStats /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? timeAdded = null, - Object? rpcStats = null, - Object? transfer = null, - Object? state = null, - Object? latency = freezed, + Object? messagesSent = null, + Object? messagesRcvd = null, + Object? questionsInFlight = null, + Object? lastQuestionTs = freezed, + Object? lastSeenTs = freezed, + Object? firstConsecutiveSeenTs = freezed, + Object? recentLostAnswersUnordered = null, + Object? recentLostAnswersOrdered = null, + Object? failedToSend = null, + Object? answerUnordered = null, + Object? answerOrdered = 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, - transfer: null == transfer - ? _value.transfer - : transfer // ignore: cast_nullable_to_non_nullable - as TransferStatsDownUp, - state: null == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as StateStats, - latency: freezed == latency - ? _value.latency - : latency // ignore: cast_nullable_to_non_nullable - as LatencyStats?, - ) as $Val); - } - - /// Create a copy of PeerStats - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $RPCStatsCopyWith<$Res> get rpcStats { - return $RPCStatsCopyWith<$Res>(_value.rpcStats, (value) { - return _then(_value.copyWith(rpcStats: value) as $Val); - }); - } - - /// Create a copy of PeerStats - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $TransferStatsDownUpCopyWith<$Res> get transfer { - return $TransferStatsDownUpCopyWith<$Res>(_value.transfer, (value) { - return _then(_value.copyWith(transfer: value) as $Val); - }); - } - - /// Create a copy of PeerStats - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StateStatsCopyWith<$Res> get state { - return $StateStatsCopyWith<$Res>(_value.state, (value) { - return _then(_value.copyWith(state: value) as $Val); - }); - } - - /// Create a copy of PeerStats - /// with the given fields replaced by the non-null parameter values. - @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); - }); - } -} - -/// @nodoc -abstract class _$$PeerStatsImplCopyWith<$Res> - implements $PeerStatsCopyWith<$Res> { - factory _$$PeerStatsImplCopyWith( - _$PeerStatsImpl value, $Res Function(_$PeerStatsImpl) then) = - __$$PeerStatsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {Timestamp timeAdded, - RPCStats rpcStats, - TransferStatsDownUp transfer, - StateStats state, - LatencyStats? latency}); - - @override - $RPCStatsCopyWith<$Res> get rpcStats; - @override - $TransferStatsDownUpCopyWith<$Res> get transfer; - @override - $StateStatsCopyWith<$Res> get state; - @override - $LatencyStatsCopyWith<$Res>? get latency; -} - -/// @nodoc -class __$$PeerStatsImplCopyWithImpl<$Res> - extends _$PeerStatsCopyWithImpl<$Res, _$PeerStatsImpl> - implements _$$PeerStatsImplCopyWith<$Res> { - __$$PeerStatsImplCopyWithImpl( - _$PeerStatsImpl _value, $Res Function(_$PeerStatsImpl) _then) - : super(_value, _then); - - /// Create a copy of PeerStats - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? timeAdded = null, - Object? rpcStats = null, - Object? transfer = null, - Object? state = null, - Object? latency = freezed, - }) { - return _then(_$PeerStatsImpl( - 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, - transfer: null == transfer - ? _value.transfer - : transfer // ignore: cast_nullable_to_non_nullable - as TransferStatsDownUp, - state: null == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as StateStats, - latency: freezed == latency - ? _value.latency - : latency // ignore: cast_nullable_to_non_nullable - as LatencyStats?, + return _then(_self.copyWith( + messagesSent: null == messagesSent + ? _self.messagesSent + : messagesSent // ignore: cast_nullable_to_non_nullable + as int, + messagesRcvd: null == messagesRcvd + ? _self.messagesRcvd + : messagesRcvd // ignore: cast_nullable_to_non_nullable + as int, + questionsInFlight: null == questionsInFlight + ? _self.questionsInFlight + : questionsInFlight // ignore: cast_nullable_to_non_nullable + as int, + lastQuestionTs: freezed == lastQuestionTs + ? _self.lastQuestionTs + : lastQuestionTs // ignore: cast_nullable_to_non_nullable + as Timestamp?, + lastSeenTs: freezed == lastSeenTs + ? _self.lastSeenTs + : lastSeenTs // ignore: cast_nullable_to_non_nullable + as Timestamp?, + firstConsecutiveSeenTs: freezed == firstConsecutiveSeenTs + ? _self.firstConsecutiveSeenTs + : firstConsecutiveSeenTs // ignore: cast_nullable_to_non_nullable + as Timestamp?, + recentLostAnswersUnordered: null == recentLostAnswersUnordered + ? _self.recentLostAnswersUnordered + : recentLostAnswersUnordered // ignore: cast_nullable_to_non_nullable + as int, + recentLostAnswersOrdered: null == recentLostAnswersOrdered + ? _self.recentLostAnswersOrdered + : recentLostAnswersOrdered // ignore: cast_nullable_to_non_nullable + as int, + failedToSend: null == failedToSend + ? _self.failedToSend + : failedToSend // ignore: cast_nullable_to_non_nullable + as int, + answerUnordered: null == answerUnordered + ? _self.answerUnordered + : answerUnordered // ignore: cast_nullable_to_non_nullable + as AnswerStats, + answerOrdered: null == answerOrdered + ? _self.answerOrdered + : answerOrdered // ignore: cast_nullable_to_non_nullable + as AnswerStats, )); } + + /// Create a copy of RPCStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $AnswerStatsCopyWith<$Res> get answerUnordered { + return $AnswerStatsCopyWith<$Res>(_self.answerUnordered, (value) { + return _then(_self.copyWith(answerUnordered: value)); + }); + } + + /// Create a copy of RPCStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $AnswerStatsCopyWith<$Res> get answerOrdered { + return $AnswerStatsCopyWith<$Res>(_self.answerOrdered, (value) { + return _then(_self.copyWith(answerOrdered: value)); + }); + } } /// @nodoc @JsonSerializable() -class _$PeerStatsImpl implements _PeerStats { - const _$PeerStatsImpl( - {required this.timeAdded, - required this.rpcStats, - required this.transfer, - required this.state, - this.latency}); - - factory _$PeerStatsImpl.fromJson(Map json) => - _$$PeerStatsImplFromJson(json); +class _RPCStats implements RPCStats { + const _RPCStats( + {required this.messagesSent, + required this.messagesRcvd, + required this.questionsInFlight, + required this.lastQuestionTs, + required this.lastSeenTs, + required this.firstConsecutiveSeenTs, + required this.recentLostAnswersUnordered, + required this.recentLostAnswersOrdered, + required this.failedToSend, + required this.answerUnordered, + required this.answerOrdered}); + factory _RPCStats.fromJson(Map json) => + _$RPCStatsFromJson(json); @override - final Timestamp timeAdded; + final int messagesSent; @override - final RPCStats rpcStats; + final int messagesRcvd; @override - final TransferStatsDownUp transfer; + final int questionsInFlight; @override - final StateStats state; + final Timestamp? lastQuestionTs; @override - final LatencyStats? latency; + final Timestamp? lastSeenTs; + @override + final Timestamp? firstConsecutiveSeenTs; + @override + final int recentLostAnswersUnordered; + @override + final int recentLostAnswersOrdered; + @override + final int failedToSend; + @override + final AnswerStats answerUnordered; + @override + final AnswerStats answerOrdered; + + /// Create a copy of RPCStats + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$RPCStatsCopyWith<_RPCStats> get copyWith => + __$RPCStatsCopyWithImpl<_RPCStats>(this, _$identity); @override - String toString() { - return 'PeerStats(timeAdded: $timeAdded, rpcStats: $rpcStats, transfer: $transfer, state: $state, latency: $latency)'; + Map toJson() { + return _$RPCStatsToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$PeerStatsImpl && + 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.lastQuestionTs, lastQuestionTs) || + other.lastQuestionTs == lastQuestionTs) && + (identical(other.lastSeenTs, lastSeenTs) || + other.lastSeenTs == lastSeenTs) && + (identical(other.firstConsecutiveSeenTs, firstConsecutiveSeenTs) || + other.firstConsecutiveSeenTs == firstConsecutiveSeenTs) && + (identical(other.recentLostAnswersUnordered, + recentLostAnswersUnordered) || + other.recentLostAnswersUnordered == + recentLostAnswersUnordered) && + (identical( + other.recentLostAnswersOrdered, recentLostAnswersOrdered) || + other.recentLostAnswersOrdered == recentLostAnswersOrdered) && + (identical(other.failedToSend, failedToSend) || + other.failedToSend == failedToSend) && + (identical(other.answerUnordered, answerUnordered) || + other.answerUnordered == answerUnordered) && + (identical(other.answerOrdered, answerOrdered) || + other.answerOrdered == answerOrdered)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + messagesSent, + messagesRcvd, + questionsInFlight, + lastQuestionTs, + lastSeenTs, + firstConsecutiveSeenTs, + recentLostAnswersUnordered, + recentLostAnswersOrdered, + failedToSend, + answerUnordered, + answerOrdered); + + @override + String toString() { + return 'RPCStats(messagesSent: $messagesSent, messagesRcvd: $messagesRcvd, questionsInFlight: $questionsInFlight, lastQuestionTs: $lastQuestionTs, lastSeenTs: $lastSeenTs, firstConsecutiveSeenTs: $firstConsecutiveSeenTs, recentLostAnswersUnordered: $recentLostAnswersUnordered, recentLostAnswersOrdered: $recentLostAnswersOrdered, failedToSend: $failedToSend, answerUnordered: $answerUnordered, answerOrdered: $answerOrdered)'; + } +} + +/// @nodoc +abstract mixin class _$RPCStatsCopyWith<$Res> + implements $RPCStatsCopyWith<$Res> { + factory _$RPCStatsCopyWith(_RPCStats value, $Res Function(_RPCStats) _then) = + __$RPCStatsCopyWithImpl; + @override + @useResult + $Res call( + {int messagesSent, + int messagesRcvd, + int questionsInFlight, + Timestamp? lastQuestionTs, + Timestamp? lastSeenTs, + Timestamp? firstConsecutiveSeenTs, + int recentLostAnswersUnordered, + int recentLostAnswersOrdered, + int failedToSend, + AnswerStats answerUnordered, + AnswerStats answerOrdered}); + + @override + $AnswerStatsCopyWith<$Res> get answerUnordered; + @override + $AnswerStatsCopyWith<$Res> get answerOrdered; +} + +/// @nodoc +class __$RPCStatsCopyWithImpl<$Res> implements _$RPCStatsCopyWith<$Res> { + __$RPCStatsCopyWithImpl(this._self, this._then); + + final _RPCStats _self; + final $Res Function(_RPCStats) _then; + + /// Create a copy of RPCStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? messagesSent = null, + Object? messagesRcvd = null, + Object? questionsInFlight = null, + Object? lastQuestionTs = freezed, + Object? lastSeenTs = freezed, + Object? firstConsecutiveSeenTs = freezed, + Object? recentLostAnswersUnordered = null, + Object? recentLostAnswersOrdered = null, + Object? failedToSend = null, + Object? answerUnordered = null, + Object? answerOrdered = null, + }) { + return _then(_RPCStats( + messagesSent: null == messagesSent + ? _self.messagesSent + : messagesSent // ignore: cast_nullable_to_non_nullable + as int, + messagesRcvd: null == messagesRcvd + ? _self.messagesRcvd + : messagesRcvd // ignore: cast_nullable_to_non_nullable + as int, + questionsInFlight: null == questionsInFlight + ? _self.questionsInFlight + : questionsInFlight // ignore: cast_nullable_to_non_nullable + as int, + lastQuestionTs: freezed == lastQuestionTs + ? _self.lastQuestionTs + : lastQuestionTs // ignore: cast_nullable_to_non_nullable + as Timestamp?, + lastSeenTs: freezed == lastSeenTs + ? _self.lastSeenTs + : lastSeenTs // ignore: cast_nullable_to_non_nullable + as Timestamp?, + firstConsecutiveSeenTs: freezed == firstConsecutiveSeenTs + ? _self.firstConsecutiveSeenTs + : firstConsecutiveSeenTs // ignore: cast_nullable_to_non_nullable + as Timestamp?, + recentLostAnswersUnordered: null == recentLostAnswersUnordered + ? _self.recentLostAnswersUnordered + : recentLostAnswersUnordered // ignore: cast_nullable_to_non_nullable + as int, + recentLostAnswersOrdered: null == recentLostAnswersOrdered + ? _self.recentLostAnswersOrdered + : recentLostAnswersOrdered // ignore: cast_nullable_to_non_nullable + as int, + failedToSend: null == failedToSend + ? _self.failedToSend + : failedToSend // ignore: cast_nullable_to_non_nullable + as int, + answerUnordered: null == answerUnordered + ? _self.answerUnordered + : answerUnordered // ignore: cast_nullable_to_non_nullable + as AnswerStats, + answerOrdered: null == answerOrdered + ? _self.answerOrdered + : answerOrdered // ignore: cast_nullable_to_non_nullable + as AnswerStats, + )); + } + + /// Create a copy of RPCStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $AnswerStatsCopyWith<$Res> get answerUnordered { + return $AnswerStatsCopyWith<$Res>(_self.answerUnordered, (value) { + return _then(_self.copyWith(answerUnordered: value)); + }); + } + + /// Create a copy of RPCStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $AnswerStatsCopyWith<$Res> get answerOrdered { + return $AnswerStatsCopyWith<$Res>(_self.answerOrdered, (value) { + return _then(_self.copyWith(answerOrdered: value)); + }); + } +} + +/// @nodoc +mixin _$PeerStats { + Timestamp get timeAdded; + RPCStats get rpcStats; + TransferStatsDownUp get transfer; + StateStats get state; + LatencyStats? get latency; + + /// Create a copy of PeerStats + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $PeerStatsCopyWith get copyWith => + _$PeerStatsCopyWithImpl(this as PeerStats, _$identity); + + /// Serializes this PeerStats to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is PeerStats && (identical(other.timeAdded, timeAdded) || other.timeAdded == timeAdded) && (identical(other.rpcStats, rpcStats) || @@ -2270,78 +2046,338 @@ class _$PeerStatsImpl implements _PeerStats { int get hashCode => Object.hash(runtimeType, timeAdded, rpcStats, transfer, state, latency); - /// Create a copy of PeerStats - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$PeerStatsImplCopyWith<_$PeerStatsImpl> get copyWith => - __$$PeerStatsImplCopyWithImpl<_$PeerStatsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PeerStatsImplToJson( - this, - ); + String toString() { + return 'PeerStats(timeAdded: $timeAdded, rpcStats: $rpcStats, transfer: $transfer, state: $state, latency: $latency)'; } } -abstract class _PeerStats implements PeerStats { - const factory _PeerStats( - {required final Timestamp timeAdded, - required final RPCStats rpcStats, - required final TransferStatsDownUp transfer, - required final StateStats state, - final LatencyStats? latency}) = _$PeerStatsImpl; +/// @nodoc +abstract mixin class $PeerStatsCopyWith<$Res> { + factory $PeerStatsCopyWith(PeerStats value, $Res Function(PeerStats) _then) = + _$PeerStatsCopyWithImpl; + @useResult + $Res call( + {Timestamp timeAdded, + RPCStats rpcStats, + TransferStatsDownUp transfer, + StateStats state, + LatencyStats? latency}); - factory _PeerStats.fromJson(Map json) = - _$PeerStatsImpl.fromJson; + $RPCStatsCopyWith<$Res> get rpcStats; + $TransferStatsDownUpCopyWith<$Res> get transfer; + $StateStatsCopyWith<$Res> get state; + $LatencyStatsCopyWith<$Res>? get latency; +} + +/// @nodoc +class _$PeerStatsCopyWithImpl<$Res> implements $PeerStatsCopyWith<$Res> { + _$PeerStatsCopyWithImpl(this._self, this._then); + + final PeerStats _self; + final $Res Function(PeerStats) _then; + + /// Create a copy of PeerStats + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? timeAdded = null, + Object? rpcStats = null, + Object? transfer = null, + Object? state = null, + Object? latency = freezed, + }) { + return _then(_self.copyWith( + timeAdded: null == timeAdded + ? _self.timeAdded + : timeAdded // ignore: cast_nullable_to_non_nullable + as Timestamp, + rpcStats: null == rpcStats + ? _self.rpcStats + : rpcStats // ignore: cast_nullable_to_non_nullable + as RPCStats, + transfer: null == transfer + ? _self.transfer + : transfer // ignore: cast_nullable_to_non_nullable + as TransferStatsDownUp, + state: null == state + ? _self.state + : state // ignore: cast_nullable_to_non_nullable + as StateStats, + latency: freezed == latency + ? _self.latency + : latency // ignore: cast_nullable_to_non_nullable + as LatencyStats?, + )); + } + + /// Create a copy of PeerStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $RPCStatsCopyWith<$Res> get rpcStats { + return $RPCStatsCopyWith<$Res>(_self.rpcStats, (value) { + return _then(_self.copyWith(rpcStats: value)); + }); + } + + /// Create a copy of PeerStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $TransferStatsDownUpCopyWith<$Res> get transfer { + return $TransferStatsDownUpCopyWith<$Res>(_self.transfer, (value) { + return _then(_self.copyWith(transfer: value)); + }); + } + + /// Create a copy of PeerStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $StateStatsCopyWith<$Res> get state { + return $StateStatsCopyWith<$Res>(_self.state, (value) { + return _then(_self.copyWith(state: value)); + }); + } + + /// Create a copy of PeerStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $LatencyStatsCopyWith<$Res>? get latency { + if (_self.latency == null) { + return null; + } + + return $LatencyStatsCopyWith<$Res>(_self.latency!, (value) { + return _then(_self.copyWith(latency: value)); + }); + } +} + +/// @nodoc +@JsonSerializable() +class _PeerStats implements PeerStats { + const _PeerStats( + {required this.timeAdded, + required this.rpcStats, + required this.transfer, + required this.state, + this.latency}); + factory _PeerStats.fromJson(Map json) => + _$PeerStatsFromJson(json); @override - Timestamp get timeAdded; + final Timestamp timeAdded; @override - RPCStats get rpcStats; + final RPCStats rpcStats; @override - TransferStatsDownUp get transfer; + final TransferStatsDownUp transfer; @override - StateStats get state; + final StateStats state; @override - LatencyStats? get latency; + final LatencyStats? latency; /// Create a copy of PeerStats /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PeerStatsImplCopyWith<_$PeerStatsImpl> get copyWith => - throw _privateConstructorUsedError; + @pragma('vm:prefer-inline') + _$PeerStatsCopyWith<_PeerStats> get copyWith => + __$PeerStatsCopyWithImpl<_PeerStats>(this, _$identity); + + @override + Map toJson() { + return _$PeerStatsToJson( + this, + ); + } + + @override + bool operator ==(Object 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.transfer, transfer) || + other.transfer == transfer) && + (identical(other.state, state) || other.state == state) && + (identical(other.latency, latency) || other.latency == latency)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, timeAdded, rpcStats, transfer, state, latency); + + @override + String toString() { + return 'PeerStats(timeAdded: $timeAdded, rpcStats: $rpcStats, transfer: $transfer, state: $state, latency: $latency)'; + } } -PeerTableData _$PeerTableDataFromJson(Map json) { - return _PeerTableData.fromJson(json); +/// @nodoc +abstract mixin class _$PeerStatsCopyWith<$Res> + implements $PeerStatsCopyWith<$Res> { + factory _$PeerStatsCopyWith( + _PeerStats value, $Res Function(_PeerStats) _then) = + __$PeerStatsCopyWithImpl; + @override + @useResult + $Res call( + {Timestamp timeAdded, + RPCStats rpcStats, + TransferStatsDownUp transfer, + StateStats state, + LatencyStats? latency}); + + @override + $RPCStatsCopyWith<$Res> get rpcStats; + @override + $TransferStatsDownUpCopyWith<$Res> get transfer; + @override + $StateStatsCopyWith<$Res> get state; + @override + $LatencyStatsCopyWith<$Res>? get latency; +} + +/// @nodoc +class __$PeerStatsCopyWithImpl<$Res> implements _$PeerStatsCopyWith<$Res> { + __$PeerStatsCopyWithImpl(this._self, this._then); + + final _PeerStats _self; + final $Res Function(_PeerStats) _then; + + /// Create a copy of PeerStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? timeAdded = null, + Object? rpcStats = null, + Object? transfer = null, + Object? state = null, + Object? latency = freezed, + }) { + return _then(_PeerStats( + timeAdded: null == timeAdded + ? _self.timeAdded + : timeAdded // ignore: cast_nullable_to_non_nullable + as Timestamp, + rpcStats: null == rpcStats + ? _self.rpcStats + : rpcStats // ignore: cast_nullable_to_non_nullable + as RPCStats, + transfer: null == transfer + ? _self.transfer + : transfer // ignore: cast_nullable_to_non_nullable + as TransferStatsDownUp, + state: null == state + ? _self.state + : state // ignore: cast_nullable_to_non_nullable + as StateStats, + latency: freezed == latency + ? _self.latency + : latency // ignore: cast_nullable_to_non_nullable + as LatencyStats?, + )); + } + + /// Create a copy of PeerStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $RPCStatsCopyWith<$Res> get rpcStats { + return $RPCStatsCopyWith<$Res>(_self.rpcStats, (value) { + return _then(_self.copyWith(rpcStats: value)); + }); + } + + /// Create a copy of PeerStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $TransferStatsDownUpCopyWith<$Res> get transfer { + return $TransferStatsDownUpCopyWith<$Res>(_self.transfer, (value) { + return _then(_self.copyWith(transfer: value)); + }); + } + + /// Create a copy of PeerStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $StateStatsCopyWith<$Res> get state { + return $StateStatsCopyWith<$Res>(_self.state, (value) { + return _then(_self.copyWith(state: value)); + }); + } + + /// Create a copy of PeerStats + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $LatencyStatsCopyWith<$Res>? get latency { + if (_self.latency == null) { + return null; + } + + return $LatencyStatsCopyWith<$Res>(_self.latency!, (value) { + return _then(_self.copyWith(latency: value)); + }); + } } /// @nodoc mixin _$PeerTableData { - List> get nodeIds => - throw _privateConstructorUsedError; - String get peerAddress => throw _privateConstructorUsedError; - PeerStats get peerStats => throw _privateConstructorUsedError; - - /// Serializes this PeerTableData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + List get nodeIds; + String get peerAddress; + PeerStats get peerStats; /// Create a copy of PeerTableData /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') $PeerTableDataCopyWith get copyWith => - throw _privateConstructorUsedError; + _$PeerTableDataCopyWithImpl( + this as PeerTableData, _$identity); + + /// Serializes this PeerTableData to a JSON map. + Map toJson(); + + @override + bool operator ==(Object 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(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, + const DeepCollectionEquality().hash(nodeIds), peerAddress, peerStats); + + @override + String toString() { + return 'PeerTableData(nodeIds: $nodeIds, peerAddress: $peerAddress, peerStats: $peerStats)'; + } } /// @nodoc -abstract class $PeerTableDataCopyWith<$Res> { +abstract mixin class $PeerTableDataCopyWith<$Res> { factory $PeerTableDataCopyWith( - PeerTableData value, $Res Function(PeerTableData) then) = - _$PeerTableDataCopyWithImpl<$Res, PeerTableData>; + PeerTableData value, $Res Function(PeerTableData) _then) = + _$PeerTableDataCopyWithImpl; @useResult $Res call( {List> nodeIds, @@ -2352,14 +2388,12 @@ abstract class $PeerTableDataCopyWith<$Res> { } /// @nodoc -class _$PeerTableDataCopyWithImpl<$Res, $Val extends PeerTableData> +class _$PeerTableDataCopyWithImpl<$Res> implements $PeerTableDataCopyWith<$Res> { - _$PeerTableDataCopyWithImpl(this._value, this._then); + _$PeerTableDataCopyWithImpl(this._self, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final PeerTableData _self; + final $Res Function(PeerTableData) _then; /// Create a copy of PeerTableData /// with the given fields replaced by the non-null parameter values. @@ -2370,20 +2404,20 @@ class _$PeerTableDataCopyWithImpl<$Res, $Val extends PeerTableData> Object? peerAddress = null, Object? peerStats = null, }) { - return _then(_value.copyWith( + return _then(_self.copyWith( nodeIds: null == nodeIds - ? _value.nodeIds + ? _self.nodeIds! : nodeIds // ignore: cast_nullable_to_non_nullable as List>, peerAddress: null == peerAddress - ? _value.peerAddress + ? _self.peerAddress : peerAddress // ignore: cast_nullable_to_non_nullable as String, peerStats: null == peerStats - ? _value.peerStats + ? _self.peerStats : peerStats // ignore: cast_nullable_to_non_nullable as PeerStats, - ) as $Val); + )); } /// Create a copy of PeerTableData @@ -2391,74 +2425,22 @@ class _$PeerTableDataCopyWithImpl<$Res, $Val extends PeerTableData> @override @pragma('vm:prefer-inline') $PeerStatsCopyWith<$Res> get peerStats { - return $PeerStatsCopyWith<$Res>(_value.peerStats, (value) { - return _then(_value.copyWith(peerStats: value) as $Val); + return $PeerStatsCopyWith<$Res>(_self.peerStats, (value) { + return _then(_self.copyWith(peerStats: value)); }); } } -/// @nodoc -abstract class _$$PeerTableDataImplCopyWith<$Res> - implements $PeerTableDataCopyWith<$Res> { - factory _$$PeerTableDataImplCopyWith( - _$PeerTableDataImpl value, $Res Function(_$PeerTableDataImpl) then) = - __$$PeerTableDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {List> nodeIds, - String peerAddress, - PeerStats peerStats}); - - @override - $PeerStatsCopyWith<$Res> get peerStats; -} - -/// @nodoc -class __$$PeerTableDataImplCopyWithImpl<$Res> - extends _$PeerTableDataCopyWithImpl<$Res, _$PeerTableDataImpl> - implements _$$PeerTableDataImplCopyWith<$Res> { - __$$PeerTableDataImplCopyWithImpl( - _$PeerTableDataImpl _value, $Res Function(_$PeerTableDataImpl) _then) - : super(_value, _then); - - /// Create a copy of PeerTableData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? nodeIds = null, - Object? peerAddress = null, - Object? peerStats = null, - }) { - return _then(_$PeerTableDataImpl( - 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 _$PeerTableDataImpl implements _PeerTableData { - const _$PeerTableDataImpl( +class _PeerTableData implements PeerTableData { + const _PeerTableData( {required final List> nodeIds, required this.peerAddress, required this.peerStats}) : _nodeIds = nodeIds; - - factory _$PeerTableDataImpl.fromJson(Map json) => - _$$PeerTableDataImplFromJson(json); + factory _PeerTableData.fromJson(Map json) => + _$PeerTableDataFromJson(json); final List> _nodeIds; @override @@ -2473,16 +2455,26 @@ class _$PeerTableDataImpl implements _PeerTableData { @override final PeerStats peerStats; + /// Create a copy of PeerTableData + /// with the given fields replaced by the non-null parameter values. @override - String toString() { - return 'PeerTableData(nodeIds: $nodeIds, peerAddress: $peerAddress, peerStats: $peerStats)'; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$PeerTableDataCopyWith<_PeerTableData> get copyWith => + __$PeerTableDataCopyWithImpl<_PeerTableData>(this, _$identity); + + @override + Map toJson() { + return _$PeerTableDataToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$PeerTableDataImpl && + other is _PeerTableData && const DeepCollectionEquality().equals(other._nodeIds, _nodeIds) && (identical(other.peerAddress, peerAddress) || other.peerAddress == peerAddress) && @@ -2495,44 +2487,71 @@ class _$PeerTableDataImpl implements _PeerTableData { int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_nodeIds), peerAddress, peerStats); - /// Create a copy of PeerTableData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$PeerTableDataImplCopyWith<_$PeerTableDataImpl> get copyWith => - __$$PeerTableDataImplCopyWithImpl<_$PeerTableDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PeerTableDataImplToJson( - this, - ); + String toString() { + return 'PeerTableData(nodeIds: $nodeIds, peerAddress: $peerAddress, peerStats: $peerStats)'; } } -abstract class _PeerTableData implements PeerTableData { - const factory _PeerTableData( - {required final List> nodeIds, - required final String peerAddress, - required final PeerStats peerStats}) = _$PeerTableDataImpl; - - factory _PeerTableData.fromJson(Map json) = - _$PeerTableDataImpl.fromJson; +/// @nodoc +abstract mixin class _$PeerTableDataCopyWith<$Res> + implements $PeerTableDataCopyWith<$Res> { + factory _$PeerTableDataCopyWith( + _PeerTableData value, $Res Function(_PeerTableData) _then) = + __$PeerTableDataCopyWithImpl; + @override + @useResult + $Res call( + {List> nodeIds, + String peerAddress, + PeerStats peerStats}); @override - List> get nodeIds; - @override - String get peerAddress; - @override - PeerStats get peerStats; + $PeerStatsCopyWith<$Res> get peerStats; +} + +/// @nodoc +class __$PeerTableDataCopyWithImpl<$Res> + implements _$PeerTableDataCopyWith<$Res> { + __$PeerTableDataCopyWithImpl(this._self, this._then); + + final _PeerTableData _self; + final $Res Function(_PeerTableData) _then; /// Create a copy of PeerTableData /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PeerTableDataImplCopyWith<_$PeerTableDataImpl> get copyWith => - throw _privateConstructorUsedError; + @pragma('vm:prefer-inline') + $Res call({ + Object? nodeIds = null, + Object? peerAddress = null, + Object? peerStats = null, + }) { + return _then(_PeerTableData( + nodeIds: null == nodeIds + ? _self._nodeIds + : nodeIds // ignore: cast_nullable_to_non_nullable + as List>, + peerAddress: null == peerAddress + ? _self.peerAddress + : peerAddress // ignore: cast_nullable_to_non_nullable + as String, + peerStats: null == peerStats + ? _self.peerStats + : peerStats // ignore: cast_nullable_to_non_nullable + as PeerStats, + )); + } + + /// Create a copy of PeerTableData + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $PeerStatsCopyWith<$Res> get peerStats { + return $PeerStatsCopyWith<$Res>(_self.peerStats, (value) { + return _then(_self.copyWith(peerStats: value)); + }); + } } VeilidUpdate _$VeilidUpdateFromJson(Map json) { @@ -2562,245 +2581,68 @@ VeilidUpdate _$VeilidUpdateFromJson(Map json) { /// @nodoc mixin _$VeilidUpdate { - @optionalTypeArgs - TResult when({ - required TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace) - log, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, - String? routeId) - appMessage, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId) - appCall, - required TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime) - attachment, - required TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers) - network, - required TResult Function(VeilidConfig config) config, - required TResult Function( - List deadRoutes, List deadRemoteRoutes) - routeChange, - required TResult Function(Typed key, - List subkeys, int count, ValueData? value) - valueChange, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult? Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult? Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult? Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult? Function(VeilidConfig config)? config, - TResult? Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult? Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult Function(VeilidConfig config)? config, - TResult Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(VeilidLog value) log, - required TResult Function(VeilidAppMessage value) appMessage, - required TResult Function(VeilidAppCall value) appCall, - required TResult Function(VeilidUpdateAttachment value) attachment, - required TResult Function(VeilidUpdateNetwork value) network, - required TResult Function(VeilidUpdateConfig value) config, - required TResult Function(VeilidUpdateRouteChange value) routeChange, - required TResult Function(VeilidUpdateValueChange value) valueChange, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(VeilidLog value)? log, - TResult? Function(VeilidAppMessage value)? appMessage, - TResult? Function(VeilidAppCall value)? appCall, - TResult? Function(VeilidUpdateAttachment value)? attachment, - TResult? Function(VeilidUpdateNetwork value)? network, - TResult? Function(VeilidUpdateConfig value)? config, - TResult? Function(VeilidUpdateRouteChange value)? routeChange, - TResult? Function(VeilidUpdateValueChange value)? valueChange, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(VeilidLog value)? log, - TResult Function(VeilidAppMessage value)? appMessage, - TResult Function(VeilidAppCall value)? appCall, - TResult Function(VeilidUpdateAttachment value)? attachment, - TResult Function(VeilidUpdateNetwork value)? network, - TResult Function(VeilidUpdateConfig value)? config, - TResult Function(VeilidUpdateRouteChange value)? routeChange, - TResult Function(VeilidUpdateValueChange value)? valueChange, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - /// Serializes this VeilidUpdate to a JSON map. - Map toJson() => throw _privateConstructorUsedError; -} + Map toJson(); -/// @nodoc -abstract class $VeilidUpdateCopyWith<$Res> { - factory $VeilidUpdateCopyWith( - VeilidUpdate value, $Res Function(VeilidUpdate) then) = - _$VeilidUpdateCopyWithImpl<$Res, VeilidUpdate>; -} - -/// @nodoc -class _$VeilidUpdateCopyWithImpl<$Res, $Val extends VeilidUpdate> - implements $VeilidUpdateCopyWith<$Res> { - _$VeilidUpdateCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. -} - -/// @nodoc -abstract class _$$VeilidLogImplCopyWith<$Res> { - factory _$$VeilidLogImplCopyWith( - _$VeilidLogImpl value, $Res Function(_$VeilidLogImpl) then) = - __$$VeilidLogImplCopyWithImpl<$Res>; - @useResult - $Res call({VeilidLogLevel logLevel, String message, String? backtrace}); -} - -/// @nodoc -class __$$VeilidLogImplCopyWithImpl<$Res> - extends _$VeilidUpdateCopyWithImpl<$Res, _$VeilidLogImpl> - implements _$$VeilidLogImplCopyWith<$Res> { - __$$VeilidLogImplCopyWithImpl( - _$VeilidLogImpl _value, $Res Function(_$VeilidLogImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') @override - $Res call({ - Object? logLevel = null, - Object? message = null, - Object? backtrace = freezed, - }) { - return _then(_$VeilidLogImpl( - logLevel: null == logLevel - ? _value.logLevel - : logLevel // ignore: cast_nullable_to_non_nullable - as VeilidLogLevel, - message: null == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String, - backtrace: freezed == backtrace - ? _value.backtrace - : backtrace // ignore: cast_nullable_to_non_nullable - as String?, - )); + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is VeilidUpdate); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => runtimeType.hashCode; + + @override + String toString() { + return 'VeilidUpdate()'; } } +/// @nodoc +class $VeilidUpdateCopyWith<$Res> { + $VeilidUpdateCopyWith(VeilidUpdate _, $Res Function(VeilidUpdate) __); +} + /// @nodoc @JsonSerializable() -class _$VeilidLogImpl implements VeilidLog { - const _$VeilidLogImpl( +class VeilidLog implements VeilidUpdate { + const VeilidLog( {required this.logLevel, required this.message, this.backtrace, final String? $type}) : $type = $type ?? 'Log'; + factory VeilidLog.fromJson(Map json) => + _$VeilidLogFromJson(json); - factory _$VeilidLogImpl.fromJson(Map json) => - _$$VeilidLogImplFromJson(json); - - @override final VeilidLogLevel logLevel; - @override final String message; - @override final String? backtrace; @JsonKey(name: 'kind') final String $type; + /// Create a copy of VeilidUpdate + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidLogCopyWith get copyWith => + _$VeilidLogCopyWithImpl(this, _$identity); + @override - String toString() { - return 'VeilidUpdate.log(logLevel: $logLevel, message: $message, backtrace: $backtrace)'; + Map toJson() { + return _$VeilidLogToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidLogImpl && + other is VeilidLog && (identical(other.logLevel, logLevel) || other.logLevel == logLevel) && (identical(other.message, message) || other.message == message) && @@ -2812,244 +2654,48 @@ class _$VeilidLogImpl implements VeilidLog { @override int get hashCode => Object.hash(runtimeType, logLevel, message, backtrace); - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidLogImplCopyWith<_$VeilidLogImpl> get copyWith => - __$$VeilidLogImplCopyWithImpl<_$VeilidLogImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace) - log, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, - String? routeId) - appMessage, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId) - appCall, - required TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime) - attachment, - required TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers) - network, - required TResult Function(VeilidConfig config) config, - required TResult Function( - List deadRoutes, List deadRemoteRoutes) - routeChange, - required TResult Function(Typed key, - List subkeys, int count, ValueData? value) - valueChange, - }) { - return log(logLevel, message, backtrace); + String toString() { + return 'VeilidUpdate.log(logLevel: $logLevel, message: $message, backtrace: $backtrace)'; } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult? Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult? Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult? Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult? Function(VeilidConfig config)? config, - TResult? Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult? Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - }) { - return log?.call(logLevel, message, backtrace); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult Function(VeilidConfig config)? config, - TResult Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - required TResult orElse(), - }) { - if (log != null) { - return log(logLevel, message, backtrace); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(VeilidLog value) log, - required TResult Function(VeilidAppMessage value) appMessage, - required TResult Function(VeilidAppCall value) appCall, - required TResult Function(VeilidUpdateAttachment value) attachment, - required TResult Function(VeilidUpdateNetwork value) network, - required TResult Function(VeilidUpdateConfig value) config, - required TResult Function(VeilidUpdateRouteChange value) routeChange, - required TResult Function(VeilidUpdateValueChange value) valueChange, - }) { - return log(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(VeilidLog value)? log, - TResult? Function(VeilidAppMessage value)? appMessage, - TResult? Function(VeilidAppCall value)? appCall, - TResult? Function(VeilidUpdateAttachment value)? attachment, - TResult? Function(VeilidUpdateNetwork value)? network, - TResult? Function(VeilidUpdateConfig value)? config, - TResult? Function(VeilidUpdateRouteChange value)? routeChange, - TResult? Function(VeilidUpdateValueChange value)? valueChange, - }) { - return log?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(VeilidLog value)? log, - TResult Function(VeilidAppMessage value)? appMessage, - TResult Function(VeilidAppCall value)? appCall, - TResult Function(VeilidUpdateAttachment value)? attachment, - TResult Function(VeilidUpdateNetwork value)? network, - TResult Function(VeilidUpdateConfig value)? config, - TResult Function(VeilidUpdateRouteChange value)? routeChange, - TResult Function(VeilidUpdateValueChange value)? valueChange, - required TResult orElse(), - }) { - if (log != null) { - return log(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$VeilidLogImplToJson( - this, - ); - } -} - -abstract class VeilidLog implements VeilidUpdate { - const factory VeilidLog( - {required final VeilidLogLevel logLevel, - required final String message, - final String? backtrace}) = _$VeilidLogImpl; - - factory VeilidLog.fromJson(Map json) = - _$VeilidLogImpl.fromJson; - - VeilidLogLevel get logLevel; - String get message; - String? get backtrace; - - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidLogImplCopyWith<_$VeilidLogImpl> get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$VeilidAppMessageImplCopyWith<$Res> { - factory _$$VeilidAppMessageImplCopyWith(_$VeilidAppMessageImpl value, - $Res Function(_$VeilidAppMessageImpl) then) = - __$$VeilidAppMessageImplCopyWithImpl<$Res>; +abstract mixin class $VeilidLogCopyWith<$Res> + implements $VeilidUpdateCopyWith<$Res> { + factory $VeilidLogCopyWith(VeilidLog value, $Res Function(VeilidLog) _then) = + _$VeilidLogCopyWithImpl; @useResult - $Res call( - {@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, - String? routeId}); + $Res call({VeilidLogLevel logLevel, String message, String? backtrace}); } /// @nodoc -class __$$VeilidAppMessageImplCopyWithImpl<$Res> - extends _$VeilidUpdateCopyWithImpl<$Res, _$VeilidAppMessageImpl> - implements _$$VeilidAppMessageImplCopyWith<$Res> { - __$$VeilidAppMessageImplCopyWithImpl(_$VeilidAppMessageImpl _value, - $Res Function(_$VeilidAppMessageImpl) _then) - : super(_value, _then); +class _$VeilidLogCopyWithImpl<$Res> implements $VeilidLogCopyWith<$Res> { + _$VeilidLogCopyWithImpl(this._self, this._then); + + final VeilidLog _self; + final $Res Function(VeilidLog) _then; /// Create a copy of VeilidUpdate /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ + Object? logLevel = null, Object? message = null, - Object? sender = freezed, - Object? routeId = freezed, + Object? backtrace = freezed, }) { - return _then(_$VeilidAppMessageImpl( + return _then(VeilidLog( + logLevel: null == logLevel + ? _self.logLevel + : logLevel // ignore: cast_nullable_to_non_nullable + as VeilidLogLevel, message: null == message - ? _value.message + ? _self.message : message // ignore: cast_nullable_to_non_nullable - as Uint8List, - sender: freezed == sender - ? _value.sender - : sender // ignore: cast_nullable_to_non_nullable - as Typed?, - routeId: freezed == routeId - ? _value.routeId - : routeId // ignore: cast_nullable_to_non_nullable + as String, + backtrace: freezed == backtrace + ? _self.backtrace + : backtrace // ignore: cast_nullable_to_non_nullable as String?, )); } @@ -3057,38 +2703,43 @@ class __$$VeilidAppMessageImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$VeilidAppMessageImpl implements VeilidAppMessage { - const _$VeilidAppMessageImpl( +class VeilidAppMessage implements VeilidUpdate { + const VeilidAppMessage( {@Uint8ListJsonConverter.jsIsArray() required this.message, this.sender, this.routeId, final String? $type}) : $type = $type ?? 'AppMessage'; + factory VeilidAppMessage.fromJson(Map json) => + _$VeilidAppMessageFromJson(json); - factory _$VeilidAppMessageImpl.fromJson(Map json) => - _$$VeilidAppMessageImplFromJson(json); - - @override @Uint8ListJsonConverter.jsIsArray() final Uint8List message; - @override final Typed? sender; - @override final String? routeId; @JsonKey(name: 'kind') final String $type; + /// Create a copy of VeilidUpdate + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidAppMessageCopyWith get copyWith => + _$VeilidAppMessageCopyWithImpl(this, _$identity); + @override - String toString() { - return 'VeilidUpdate.appMessage(message: $message, sender: $sender, routeId: $routeId)'; + Map toJson() { + return _$VeilidAppMessageToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidAppMessageImpl && + other is VeilidAppMessage && const DeepCollectionEquality().equals(other.message, message) && (identical(other.sender, sender) || other.sender == sender) && (identical(other.routeId, routeId) || other.routeId == routeId)); @@ -3099,251 +2750,52 @@ class _$VeilidAppMessageImpl implements VeilidAppMessage { int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(message), sender, routeId); - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidAppMessageImplCopyWith<_$VeilidAppMessageImpl> get copyWith => - __$$VeilidAppMessageImplCopyWithImpl<_$VeilidAppMessageImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace) - log, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, - String? routeId) - appMessage, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId) - appCall, - required TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime) - attachment, - required TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers) - network, - required TResult Function(VeilidConfig config) config, - required TResult Function( - List deadRoutes, List deadRemoteRoutes) - routeChange, - required TResult Function(Typed key, - List subkeys, int count, ValueData? value) - valueChange, - }) { - return appMessage(message, sender, routeId); + String toString() { + return 'VeilidUpdate.appMessage(message: $message, sender: $sender, routeId: $routeId)'; } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult? Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult? Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult? Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult? Function(VeilidConfig config)? config, - TResult? Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult? Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - }) { - return appMessage?.call(message, sender, routeId); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult Function(VeilidConfig config)? config, - TResult Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - required TResult orElse(), - }) { - if (appMessage != null) { - return appMessage(message, sender, routeId); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(VeilidLog value) log, - required TResult Function(VeilidAppMessage value) appMessage, - required TResult Function(VeilidAppCall value) appCall, - required TResult Function(VeilidUpdateAttachment value) attachment, - required TResult Function(VeilidUpdateNetwork value) network, - required TResult Function(VeilidUpdateConfig value) config, - required TResult Function(VeilidUpdateRouteChange value) routeChange, - required TResult Function(VeilidUpdateValueChange value) valueChange, - }) { - return appMessage(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(VeilidLog value)? log, - TResult? Function(VeilidAppMessage value)? appMessage, - TResult? Function(VeilidAppCall value)? appCall, - TResult? Function(VeilidUpdateAttachment value)? attachment, - TResult? Function(VeilidUpdateNetwork value)? network, - TResult? Function(VeilidUpdateConfig value)? config, - TResult? Function(VeilidUpdateRouteChange value)? routeChange, - TResult? Function(VeilidUpdateValueChange value)? valueChange, - }) { - return appMessage?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(VeilidLog value)? log, - TResult Function(VeilidAppMessage value)? appMessage, - TResult Function(VeilidAppCall value)? appCall, - TResult Function(VeilidUpdateAttachment value)? attachment, - TResult Function(VeilidUpdateNetwork value)? network, - TResult Function(VeilidUpdateConfig value)? config, - TResult Function(VeilidUpdateRouteChange value)? routeChange, - TResult Function(VeilidUpdateValueChange value)? valueChange, - required TResult orElse(), - }) { - if (appMessage != null) { - return appMessage(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$VeilidAppMessageImplToJson( - this, - ); - } -} - -abstract class VeilidAppMessage implements VeilidUpdate { - const factory VeilidAppMessage( - {@Uint8ListJsonConverter.jsIsArray() required final Uint8List message, - final Typed? sender, - final String? routeId}) = _$VeilidAppMessageImpl; - - factory VeilidAppMessage.fromJson(Map json) = - _$VeilidAppMessageImpl.fromJson; - - @Uint8ListJsonConverter.jsIsArray() - Uint8List get message; - Typed? get sender; - String? get routeId; - - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidAppMessageImplCopyWith<_$VeilidAppMessageImpl> get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$VeilidAppCallImplCopyWith<$Res> { - factory _$$VeilidAppCallImplCopyWith( - _$VeilidAppCallImpl value, $Res Function(_$VeilidAppCallImpl) then) = - __$$VeilidAppCallImplCopyWithImpl<$Res>; +abstract mixin class $VeilidAppMessageCopyWith<$Res> + implements $VeilidUpdateCopyWith<$Res> { + factory $VeilidAppMessageCopyWith( + VeilidAppMessage value, $Res Function(VeilidAppMessage) _then) = + _$VeilidAppMessageCopyWithImpl; @useResult $Res call( {@Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, Typed? sender, String? routeId}); } /// @nodoc -class __$$VeilidAppCallImplCopyWithImpl<$Res> - extends _$VeilidUpdateCopyWithImpl<$Res, _$VeilidAppCallImpl> - implements _$$VeilidAppCallImplCopyWith<$Res> { - __$$VeilidAppCallImplCopyWithImpl( - _$VeilidAppCallImpl _value, $Res Function(_$VeilidAppCallImpl) _then) - : super(_value, _then); +class _$VeilidAppMessageCopyWithImpl<$Res> + implements $VeilidAppMessageCopyWith<$Res> { + _$VeilidAppMessageCopyWithImpl(this._self, this._then); + + final VeilidAppMessage _self; + final $Res Function(VeilidAppMessage) _then; /// Create a copy of VeilidUpdate /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ Object? message = null, - Object? callId = null, Object? sender = freezed, Object? routeId = freezed, }) { - return _then(_$VeilidAppCallImpl( + return _then(VeilidAppMessage( message: null == message - ? _value.message + ? _self.message : message // ignore: cast_nullable_to_non_nullable as Uint8List, - callId: null == callId - ? _value.callId - : callId // ignore: cast_nullable_to_non_nullable - as String, sender: freezed == sender - ? _value.sender + ? _self.sender : sender // ignore: cast_nullable_to_non_nullable as Typed?, routeId: freezed == routeId - ? _value.routeId + ? _self.routeId : routeId // ignore: cast_nullable_to_non_nullable as String?, )); @@ -3352,41 +2804,45 @@ class __$$VeilidAppCallImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$VeilidAppCallImpl implements VeilidAppCall { - const _$VeilidAppCallImpl( +class VeilidAppCall implements VeilidUpdate { + const VeilidAppCall( {@Uint8ListJsonConverter.jsIsArray() required this.message, required this.callId, this.sender, this.routeId, final String? $type}) : $type = $type ?? 'AppCall'; + factory VeilidAppCall.fromJson(Map json) => + _$VeilidAppCallFromJson(json); - factory _$VeilidAppCallImpl.fromJson(Map json) => - _$$VeilidAppCallImplFromJson(json); - - @override @Uint8ListJsonConverter.jsIsArray() final Uint8List message; - @override final String callId; - @override final Typed? sender; - @override final String? routeId; @JsonKey(name: 'kind') final String $type; + /// Create a copy of VeilidUpdate + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidAppCallCopyWith get copyWith => + _$VeilidAppCallCopyWithImpl(this, _$identity); + @override - String toString() { - return 'VeilidUpdate.appCall(message: $message, callId: $callId, sender: $sender, routeId: $routeId)'; + Map toJson() { + return _$VeilidAppCallToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidAppCallImpl && + other is VeilidAppCall && const DeepCollectionEquality().equals(other.message, message) && (identical(other.callId, callId) || other.callId == callId) && (identical(other.sender, sender) || other.sender == sender) && @@ -3398,270 +2854,68 @@ class _$VeilidAppCallImpl implements VeilidAppCall { int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(message), callId, sender, routeId); - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidAppCallImplCopyWith<_$VeilidAppCallImpl> get copyWith => - __$$VeilidAppCallImplCopyWithImpl<_$VeilidAppCallImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace) - log, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, - String? routeId) - appMessage, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId) - appCall, - required TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime) - attachment, - required TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers) - network, - required TResult Function(VeilidConfig config) config, - required TResult Function( - List deadRoutes, List deadRemoteRoutes) - routeChange, - required TResult Function(Typed key, - List subkeys, int count, ValueData? value) - valueChange, - }) { - return appCall(message, callId, sender, routeId); + String toString() { + return 'VeilidUpdate.appCall(message: $message, callId: $callId, sender: $sender, routeId: $routeId)'; } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult? Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult? Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult? Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult? Function(VeilidConfig config)? config, - TResult? Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult? Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - }) { - return appCall?.call(message, callId, sender, routeId); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult Function(VeilidConfig config)? config, - TResult Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - required TResult orElse(), - }) { - if (appCall != null) { - return appCall(message, callId, sender, routeId); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(VeilidLog value) log, - required TResult Function(VeilidAppMessage value) appMessage, - required TResult Function(VeilidAppCall value) appCall, - required TResult Function(VeilidUpdateAttachment value) attachment, - required TResult Function(VeilidUpdateNetwork value) network, - required TResult Function(VeilidUpdateConfig value) config, - required TResult Function(VeilidUpdateRouteChange value) routeChange, - required TResult Function(VeilidUpdateValueChange value) valueChange, - }) { - return appCall(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(VeilidLog value)? log, - TResult? Function(VeilidAppMessage value)? appMessage, - TResult? Function(VeilidAppCall value)? appCall, - TResult? Function(VeilidUpdateAttachment value)? attachment, - TResult? Function(VeilidUpdateNetwork value)? network, - TResult? Function(VeilidUpdateConfig value)? config, - TResult? Function(VeilidUpdateRouteChange value)? routeChange, - TResult? Function(VeilidUpdateValueChange value)? valueChange, - }) { - return appCall?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(VeilidLog value)? log, - TResult Function(VeilidAppMessage value)? appMessage, - TResult Function(VeilidAppCall value)? appCall, - TResult Function(VeilidUpdateAttachment value)? attachment, - TResult Function(VeilidUpdateNetwork value)? network, - TResult Function(VeilidUpdateConfig value)? config, - TResult Function(VeilidUpdateRouteChange value)? routeChange, - TResult Function(VeilidUpdateValueChange value)? valueChange, - required TResult orElse(), - }) { - if (appCall != null) { - return appCall(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$VeilidAppCallImplToJson( - this, - ); - } -} - -abstract class VeilidAppCall implements VeilidUpdate { - const factory VeilidAppCall( - {@Uint8ListJsonConverter.jsIsArray() required final Uint8List message, - required final String callId, - final Typed? sender, - final String? routeId}) = _$VeilidAppCallImpl; - - factory VeilidAppCall.fromJson(Map json) = - _$VeilidAppCallImpl.fromJson; - - @Uint8ListJsonConverter.jsIsArray() - Uint8List get message; - String get callId; - Typed? get sender; - String? get routeId; - - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidAppCallImplCopyWith<_$VeilidAppCallImpl> get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$VeilidUpdateAttachmentImplCopyWith<$Res> { - factory _$$VeilidUpdateAttachmentImplCopyWith( - _$VeilidUpdateAttachmentImpl value, - $Res Function(_$VeilidUpdateAttachmentImpl) then) = - __$$VeilidUpdateAttachmentImplCopyWithImpl<$Res>; +abstract mixin class $VeilidAppCallCopyWith<$Res> + implements $VeilidUpdateCopyWith<$Res> { + factory $VeilidAppCallCopyWith( + VeilidAppCall value, $Res Function(VeilidAppCall) _then) = + _$VeilidAppCallCopyWithImpl; @useResult $Res call( - {AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime}); + {@Uint8ListJsonConverter.jsIsArray() Uint8List message, + String callId, + Typed? sender, + String? routeId}); } /// @nodoc -class __$$VeilidUpdateAttachmentImplCopyWithImpl<$Res> - extends _$VeilidUpdateCopyWithImpl<$Res, _$VeilidUpdateAttachmentImpl> - implements _$$VeilidUpdateAttachmentImplCopyWith<$Res> { - __$$VeilidUpdateAttachmentImplCopyWithImpl( - _$VeilidUpdateAttachmentImpl _value, - $Res Function(_$VeilidUpdateAttachmentImpl) _then) - : super(_value, _then); +class _$VeilidAppCallCopyWithImpl<$Res> + implements $VeilidAppCallCopyWith<$Res> { + _$VeilidAppCallCopyWithImpl(this._self, this._then); + + final VeilidAppCall _self; + final $Res Function(VeilidAppCall) _then; /// Create a copy of VeilidUpdate /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ - Object? state = null, - Object? publicInternetReady = null, - Object? localNetworkReady = null, - Object? uptime = null, - Object? attachedUptime = freezed, + Object? message = null, + Object? callId = null, + Object? sender = freezed, + Object? routeId = freezed, }) { - return _then(_$VeilidUpdateAttachmentImpl( - state: null == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as AttachmentState, - publicInternetReady: null == publicInternetReady - ? _value.publicInternetReady - : publicInternetReady // ignore: cast_nullable_to_non_nullable - as bool, - localNetworkReady: null == localNetworkReady - ? _value.localNetworkReady - : localNetworkReady // ignore: cast_nullable_to_non_nullable - as bool, - uptime: null == uptime - ? _value.uptime - : uptime // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - attachedUptime: freezed == attachedUptime - ? _value.attachedUptime - : attachedUptime // ignore: cast_nullable_to_non_nullable - as TimestampDuration?, + return _then(VeilidAppCall( + message: null == message + ? _self.message + : message // ignore: cast_nullable_to_non_nullable + as Uint8List, + callId: null == callId + ? _self.callId + : callId // ignore: cast_nullable_to_non_nullable + as String, + sender: freezed == sender + ? _self.sender + : sender // ignore: cast_nullable_to_non_nullable + as Typed?, + routeId: freezed == routeId + ? _self.routeId + : routeId // ignore: cast_nullable_to_non_nullable + as String?, )); } } /// @nodoc @JsonSerializable() -class _$VeilidUpdateAttachmentImpl implements VeilidUpdateAttachment { - const _$VeilidUpdateAttachmentImpl( +class VeilidUpdateAttachment implements VeilidUpdate { + const VeilidUpdateAttachment( {required this.state, required this.publicInternetReady, required this.localNetworkReady, @@ -3669,34 +2923,38 @@ class _$VeilidUpdateAttachmentImpl implements VeilidUpdateAttachment { required this.attachedUptime, final String? $type}) : $type = $type ?? 'Attachment'; + factory VeilidUpdateAttachment.fromJson(Map json) => + _$VeilidUpdateAttachmentFromJson(json); - factory _$VeilidUpdateAttachmentImpl.fromJson(Map json) => - _$$VeilidUpdateAttachmentImplFromJson(json); - - @override final AttachmentState state; - @override final bool publicInternetReady; - @override final bool localNetworkReady; - @override final TimestampDuration uptime; - @override final TimestampDuration? attachedUptime; @JsonKey(name: 'kind') final String $type; + /// Create a copy of VeilidUpdate + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidUpdateAttachmentCopyWith get copyWith => + _$VeilidUpdateAttachmentCopyWithImpl( + this, _$identity); + @override - String toString() { - return 'VeilidUpdate.attachment(state: $state, publicInternetReady: $publicInternetReady, localNetworkReady: $localNetworkReady, uptime: $uptime, attachedUptime: $attachedUptime)'; + Map toJson() { + return _$VeilidUpdateAttachmentToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidUpdateAttachmentImpl && + other is VeilidUpdateAttachment && (identical(other.state, state) || other.state == state) && (identical(other.publicInternetReady, publicInternetReady) || other.publicInternetReady == publicInternetReady) && @@ -3712,265 +2970,74 @@ class _$VeilidUpdateAttachmentImpl implements VeilidUpdateAttachment { int get hashCode => Object.hash(runtimeType, state, publicInternetReady, localNetworkReady, uptime, attachedUptime); - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidUpdateAttachmentImplCopyWith<_$VeilidUpdateAttachmentImpl> - get copyWith => __$$VeilidUpdateAttachmentImplCopyWithImpl< - _$VeilidUpdateAttachmentImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace) - log, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, - String? routeId) - appMessage, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId) - appCall, - required TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime) - attachment, - required TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers) - network, - required TResult Function(VeilidConfig config) config, - required TResult Function( - List deadRoutes, List deadRemoteRoutes) - routeChange, - required TResult Function(Typed key, - List subkeys, int count, ValueData? value) - valueChange, - }) { - return attachment( - state, publicInternetReady, localNetworkReady, uptime, attachedUptime); + String toString() { + return 'VeilidUpdate.attachment(state: $state, publicInternetReady: $publicInternetReady, localNetworkReady: $localNetworkReady, uptime: $uptime, attachedUptime: $attachedUptime)'; } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult? Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult? Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult? Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult? Function(VeilidConfig config)? config, - TResult? Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult? Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - }) { - return attachment?.call( - state, publicInternetReady, localNetworkReady, uptime, attachedUptime); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult Function(VeilidConfig config)? config, - TResult Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - required TResult orElse(), - }) { - if (attachment != null) { - return attachment(state, publicInternetReady, localNetworkReady, uptime, - attachedUptime); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(VeilidLog value) log, - required TResult Function(VeilidAppMessage value) appMessage, - required TResult Function(VeilidAppCall value) appCall, - required TResult Function(VeilidUpdateAttachment value) attachment, - required TResult Function(VeilidUpdateNetwork value) network, - required TResult Function(VeilidUpdateConfig value) config, - required TResult Function(VeilidUpdateRouteChange value) routeChange, - required TResult Function(VeilidUpdateValueChange value) valueChange, - }) { - return attachment(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(VeilidLog value)? log, - TResult? Function(VeilidAppMessage value)? appMessage, - TResult? Function(VeilidAppCall value)? appCall, - TResult? Function(VeilidUpdateAttachment value)? attachment, - TResult? Function(VeilidUpdateNetwork value)? network, - TResult? Function(VeilidUpdateConfig value)? config, - TResult? Function(VeilidUpdateRouteChange value)? routeChange, - TResult? Function(VeilidUpdateValueChange value)? valueChange, - }) { - return attachment?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(VeilidLog value)? log, - TResult Function(VeilidAppMessage value)? appMessage, - TResult Function(VeilidAppCall value)? appCall, - TResult Function(VeilidUpdateAttachment value)? attachment, - TResult Function(VeilidUpdateNetwork value)? network, - TResult Function(VeilidUpdateConfig value)? config, - TResult Function(VeilidUpdateRouteChange value)? routeChange, - TResult Function(VeilidUpdateValueChange value)? valueChange, - required TResult orElse(), - }) { - if (attachment != null) { - return attachment(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$VeilidUpdateAttachmentImplToJson( - this, - ); - } -} - -abstract class VeilidUpdateAttachment implements VeilidUpdate { - const factory VeilidUpdateAttachment( - {required final AttachmentState state, - required final bool publicInternetReady, - required final bool localNetworkReady, - required final TimestampDuration uptime, - required final TimestampDuration? attachedUptime}) = - _$VeilidUpdateAttachmentImpl; - - factory VeilidUpdateAttachment.fromJson(Map json) = - _$VeilidUpdateAttachmentImpl.fromJson; - - AttachmentState get state; - bool get publicInternetReady; - bool get localNetworkReady; - TimestampDuration get uptime; - TimestampDuration? get attachedUptime; - - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidUpdateAttachmentImplCopyWith<_$VeilidUpdateAttachmentImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$VeilidUpdateNetworkImplCopyWith<$Res> { - factory _$$VeilidUpdateNetworkImplCopyWith(_$VeilidUpdateNetworkImpl value, - $Res Function(_$VeilidUpdateNetworkImpl) then) = - __$$VeilidUpdateNetworkImplCopyWithImpl<$Res>; +abstract mixin class $VeilidUpdateAttachmentCopyWith<$Res> + implements $VeilidUpdateCopyWith<$Res> { + factory $VeilidUpdateAttachmentCopyWith(VeilidUpdateAttachment value, + $Res Function(VeilidUpdateAttachment) _then) = + _$VeilidUpdateAttachmentCopyWithImpl; @useResult $Res call( - {bool started, BigInt bpsDown, BigInt bpsUp, List peers}); + {AttachmentState state, + bool publicInternetReady, + bool localNetworkReady, + TimestampDuration uptime, + TimestampDuration? attachedUptime}); } /// @nodoc -class __$$VeilidUpdateNetworkImplCopyWithImpl<$Res> - extends _$VeilidUpdateCopyWithImpl<$Res, _$VeilidUpdateNetworkImpl> - implements _$$VeilidUpdateNetworkImplCopyWith<$Res> { - __$$VeilidUpdateNetworkImplCopyWithImpl(_$VeilidUpdateNetworkImpl _value, - $Res Function(_$VeilidUpdateNetworkImpl) _then) - : super(_value, _then); +class _$VeilidUpdateAttachmentCopyWithImpl<$Res> + implements $VeilidUpdateAttachmentCopyWith<$Res> { + _$VeilidUpdateAttachmentCopyWithImpl(this._self, this._then); + + final VeilidUpdateAttachment _self; + final $Res Function(VeilidUpdateAttachment) _then; /// Create a copy of VeilidUpdate /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ - Object? started = null, - Object? bpsDown = null, - Object? bpsUp = null, - Object? peers = null, + Object? state = null, + Object? publicInternetReady = null, + Object? localNetworkReady = null, + Object? uptime = null, + Object? attachedUptime = freezed, }) { - return _then(_$VeilidUpdateNetworkImpl( - started: null == started - ? _value.started - : started // ignore: cast_nullable_to_non_nullable + return _then(VeilidUpdateAttachment( + state: null == state + ? _self.state + : state // ignore: cast_nullable_to_non_nullable + as AttachmentState, + publicInternetReady: null == publicInternetReady + ? _self.publicInternetReady + : publicInternetReady // ignore: cast_nullable_to_non_nullable as bool, - bpsDown: null == bpsDown - ? _value.bpsDown - : bpsDown // ignore: cast_nullable_to_non_nullable - as BigInt, - bpsUp: null == bpsUp - ? _value.bpsUp - : bpsUp // ignore: cast_nullable_to_non_nullable - as BigInt, - peers: null == peers - ? _value._peers - : peers // ignore: cast_nullable_to_non_nullable - as List, + localNetworkReady: null == localNetworkReady + ? _self.localNetworkReady + : localNetworkReady // ignore: cast_nullable_to_non_nullable + as bool, + uptime: null == uptime + ? _self.uptime + : uptime // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + attachedUptime: freezed == attachedUptime + ? _self.attachedUptime + : attachedUptime // ignore: cast_nullable_to_non_nullable + as TimestampDuration?, )); } } /// @nodoc @JsonSerializable() -class _$VeilidUpdateNetworkImpl implements VeilidUpdateNetwork { - const _$VeilidUpdateNetworkImpl( +class VeilidUpdateNetwork implements VeilidUpdate { + const VeilidUpdateNetwork( {required this.started, required this.bpsDown, required this.bpsUp, @@ -3978,18 +3045,13 @@ class _$VeilidUpdateNetworkImpl implements VeilidUpdateNetwork { final String? $type}) : _peers = peers, $type = $type ?? 'Network'; + factory VeilidUpdateNetwork.fromJson(Map json) => + _$VeilidUpdateNetworkFromJson(json); - factory _$VeilidUpdateNetworkImpl.fromJson(Map json) => - _$$VeilidUpdateNetworkImplFromJson(json); - - @override final bool started; - @override final BigInt bpsDown; - @override final BigInt bpsUp; final List _peers; - @override List get peers { if (_peers is EqualUnmodifiableListView) return _peers; // ignore: implicit_dynamic_type @@ -3999,16 +3061,25 @@ class _$VeilidUpdateNetworkImpl implements VeilidUpdateNetwork { @JsonKey(name: 'kind') final String $type; + /// Create a copy of VeilidUpdate + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidUpdateNetworkCopyWith get copyWith => + _$VeilidUpdateNetworkCopyWithImpl(this, _$identity); + @override - String toString() { - return 'VeilidUpdate.network(started: $started, bpsDown: $bpsDown, bpsUp: $bpsUp, peers: $peers)'; + Map toJson() { + return _$VeilidUpdateNetworkToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidUpdateNetworkImpl && + other is VeilidUpdateNetwork && (identical(other.started, started) || other.started == started) && (identical(other.bpsDown, bpsDown) || other.bpsDown == bpsDown) && (identical(other.bpsUp, bpsUp) || other.bpsUp == bpsUp) && @@ -4020,211 +3091,112 @@ class _$VeilidUpdateNetworkImpl implements VeilidUpdateNetwork { int get hashCode => Object.hash(runtimeType, started, bpsDown, bpsUp, const DeepCollectionEquality().hash(_peers)); - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidUpdateNetworkImplCopyWith<_$VeilidUpdateNetworkImpl> get copyWith => - __$$VeilidUpdateNetworkImplCopyWithImpl<_$VeilidUpdateNetworkImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace) - log, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, - String? routeId) - appMessage, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId) - appCall, - required TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime) - attachment, - required TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers) - network, - required TResult Function(VeilidConfig config) config, - required TResult Function( - List deadRoutes, List deadRemoteRoutes) - routeChange, - required TResult Function(Typed key, - List subkeys, int count, ValueData? value) - valueChange, - }) { - return network(started, bpsDown, bpsUp, peers); + String toString() { + return 'VeilidUpdate.network(started: $started, bpsDown: $bpsDown, bpsUp: $bpsUp, peers: $peers)'; } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult? Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult? Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult? Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult? Function(VeilidConfig config)? config, - TResult? Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult? Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - }) { - return network?.call(started, bpsDown, bpsUp, peers); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult Function(VeilidConfig config)? config, - TResult Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - required TResult orElse(), - }) { - if (network != null) { - return network(started, bpsDown, bpsUp, peers); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(VeilidLog value) log, - required TResult Function(VeilidAppMessage value) appMessage, - required TResult Function(VeilidAppCall value) appCall, - required TResult Function(VeilidUpdateAttachment value) attachment, - required TResult Function(VeilidUpdateNetwork value) network, - required TResult Function(VeilidUpdateConfig value) config, - required TResult Function(VeilidUpdateRouteChange value) routeChange, - required TResult Function(VeilidUpdateValueChange value) valueChange, - }) { - return network(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(VeilidLog value)? log, - TResult? Function(VeilidAppMessage value)? appMessage, - TResult? Function(VeilidAppCall value)? appCall, - TResult? Function(VeilidUpdateAttachment value)? attachment, - TResult? Function(VeilidUpdateNetwork value)? network, - TResult? Function(VeilidUpdateConfig value)? config, - TResult? Function(VeilidUpdateRouteChange value)? routeChange, - TResult? Function(VeilidUpdateValueChange value)? valueChange, - }) { - return network?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(VeilidLog value)? log, - TResult Function(VeilidAppMessage value)? appMessage, - TResult Function(VeilidAppCall value)? appCall, - TResult Function(VeilidUpdateAttachment value)? attachment, - TResult Function(VeilidUpdateNetwork value)? network, - TResult Function(VeilidUpdateConfig value)? config, - TResult Function(VeilidUpdateRouteChange value)? routeChange, - TResult Function(VeilidUpdateValueChange value)? valueChange, - required TResult orElse(), - }) { - if (network != null) { - return network(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$VeilidUpdateNetworkImplToJson( - this, - ); - } -} - -abstract class VeilidUpdateNetwork implements VeilidUpdate { - const factory VeilidUpdateNetwork( - {required final bool started, - required final BigInt bpsDown, - required final BigInt bpsUp, - required final List peers}) = _$VeilidUpdateNetworkImpl; - - factory VeilidUpdateNetwork.fromJson(Map json) = - _$VeilidUpdateNetworkImpl.fromJson; - - bool get started; - BigInt get bpsDown; - BigInt get bpsUp; - List get peers; - - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidUpdateNetworkImplCopyWith<_$VeilidUpdateNetworkImpl> get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$VeilidUpdateConfigImplCopyWith<$Res> { - factory _$$VeilidUpdateConfigImplCopyWith(_$VeilidUpdateConfigImpl value, - $Res Function(_$VeilidUpdateConfigImpl) then) = - __$$VeilidUpdateConfigImplCopyWithImpl<$Res>; +abstract mixin class $VeilidUpdateNetworkCopyWith<$Res> + implements $VeilidUpdateCopyWith<$Res> { + factory $VeilidUpdateNetworkCopyWith( + VeilidUpdateNetwork value, $Res Function(VeilidUpdateNetwork) _then) = + _$VeilidUpdateNetworkCopyWithImpl; + @useResult + $Res call( + {bool started, BigInt bpsDown, BigInt bpsUp, List peers}); +} + +/// @nodoc +class _$VeilidUpdateNetworkCopyWithImpl<$Res> + implements $VeilidUpdateNetworkCopyWith<$Res> { + _$VeilidUpdateNetworkCopyWithImpl(this._self, this._then); + + final VeilidUpdateNetwork _self; + final $Res Function(VeilidUpdateNetwork) _then; + + /// Create a copy of VeilidUpdate + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + $Res call({ + Object? started = null, + Object? bpsDown = null, + Object? bpsUp = null, + Object? peers = null, + }) { + return _then(VeilidUpdateNetwork( + started: null == started + ? _self.started + : started // ignore: cast_nullable_to_non_nullable + as bool, + bpsDown: null == bpsDown + ? _self.bpsDown + : bpsDown // ignore: cast_nullable_to_non_nullable + as BigInt, + bpsUp: null == bpsUp + ? _self.bpsUp + : bpsUp // ignore: cast_nullable_to_non_nullable + as BigInt, + peers: null == peers + ? _self._peers + : peers // ignore: cast_nullable_to_non_nullable + as List, + )); + } +} + +/// @nodoc +@JsonSerializable() +class VeilidUpdateConfig implements VeilidUpdate { + const VeilidUpdateConfig({required this.config, final String? $type}) + : $type = $type ?? 'Config'; + factory VeilidUpdateConfig.fromJson(Map json) => + _$VeilidUpdateConfigFromJson(json); + + final VeilidConfig config; + + @JsonKey(name: 'kind') + final String $type; + + /// Create a copy of VeilidUpdate + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidUpdateConfigCopyWith get copyWith => + _$VeilidUpdateConfigCopyWithImpl(this, _$identity); + + @override + Map toJson() { + return _$VeilidUpdateConfigToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is VeilidUpdateConfig && + (identical(other.config, config) || other.config == config)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, config); + + @override + String toString() { + return 'VeilidUpdate.config(config: $config)'; + } +} + +/// @nodoc +abstract mixin class $VeilidUpdateConfigCopyWith<$Res> + implements $VeilidUpdateCopyWith<$Res> { + factory $VeilidUpdateConfigCopyWith( + VeilidUpdateConfig value, $Res Function(VeilidUpdateConfig) _then) = + _$VeilidUpdateConfigCopyWithImpl; @useResult $Res call({VeilidConfig config}); @@ -4232,23 +3204,22 @@ abstract class _$$VeilidUpdateConfigImplCopyWith<$Res> { } /// @nodoc -class __$$VeilidUpdateConfigImplCopyWithImpl<$Res> - extends _$VeilidUpdateCopyWithImpl<$Res, _$VeilidUpdateConfigImpl> - implements _$$VeilidUpdateConfigImplCopyWith<$Res> { - __$$VeilidUpdateConfigImplCopyWithImpl(_$VeilidUpdateConfigImpl _value, - $Res Function(_$VeilidUpdateConfigImpl) _then) - : super(_value, _then); +class _$VeilidUpdateConfigCopyWithImpl<$Res> + implements $VeilidUpdateConfigCopyWith<$Res> { + _$VeilidUpdateConfigCopyWithImpl(this._self, this._then); + + final VeilidUpdateConfig _self; + final $Res Function(VeilidUpdateConfig) _then; /// Create a copy of VeilidUpdate /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ Object? config = null, }) { - return _then(_$VeilidUpdateConfigImpl( + return _then(VeilidUpdateConfig( config: null == config - ? _value.config + ? _self.config : config // ignore: cast_nullable_to_non_nullable as VeilidConfig, )); @@ -4259,294 +3230,26 @@ class __$$VeilidUpdateConfigImplCopyWithImpl<$Res> @override @pragma('vm:prefer-inline') $VeilidConfigCopyWith<$Res> get config { - return $VeilidConfigCopyWith<$Res>(_value.config, (value) { - return _then(_value.copyWith(config: value)); + return $VeilidConfigCopyWith<$Res>(_self.config, (value) { + return _then(_self.copyWith(config: value)); }); } } /// @nodoc @JsonSerializable() -class _$VeilidUpdateConfigImpl implements VeilidUpdateConfig { - const _$VeilidUpdateConfigImpl({required this.config, final String? $type}) - : $type = $type ?? 'Config'; - - factory _$VeilidUpdateConfigImpl.fromJson(Map json) => - _$$VeilidUpdateConfigImplFromJson(json); - - @override - final VeilidConfig config; - - @JsonKey(name: 'kind') - final String $type; - - @override - String toString() { - return 'VeilidUpdate.config(config: $config)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$VeilidUpdateConfigImpl && - (identical(other.config, config) || other.config == config)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, config); - - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$VeilidUpdateConfigImplCopyWith<_$VeilidUpdateConfigImpl> get copyWith => - __$$VeilidUpdateConfigImplCopyWithImpl<_$VeilidUpdateConfigImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace) - log, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, - String? routeId) - appMessage, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId) - appCall, - required TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime) - attachment, - required TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers) - network, - required TResult Function(VeilidConfig config) config, - required TResult Function( - List deadRoutes, List deadRemoteRoutes) - routeChange, - required TResult Function(Typed key, - List subkeys, int count, ValueData? value) - valueChange, - }) { - return config(this.config); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult? Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult? Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult? Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult? Function(VeilidConfig config)? config, - TResult? Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult? Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - }) { - return config?.call(this.config); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult Function(VeilidConfig config)? config, - TResult Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - required TResult orElse(), - }) { - if (config != null) { - return config(this.config); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(VeilidLog value) log, - required TResult Function(VeilidAppMessage value) appMessage, - required TResult Function(VeilidAppCall value) appCall, - required TResult Function(VeilidUpdateAttachment value) attachment, - required TResult Function(VeilidUpdateNetwork value) network, - required TResult Function(VeilidUpdateConfig value) config, - required TResult Function(VeilidUpdateRouteChange value) routeChange, - required TResult Function(VeilidUpdateValueChange value) valueChange, - }) { - return config(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(VeilidLog value)? log, - TResult? Function(VeilidAppMessage value)? appMessage, - TResult? Function(VeilidAppCall value)? appCall, - TResult? Function(VeilidUpdateAttachment value)? attachment, - TResult? Function(VeilidUpdateNetwork value)? network, - TResult? Function(VeilidUpdateConfig value)? config, - TResult? Function(VeilidUpdateRouteChange value)? routeChange, - TResult? Function(VeilidUpdateValueChange value)? valueChange, - }) { - return config?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(VeilidLog value)? log, - TResult Function(VeilidAppMessage value)? appMessage, - TResult Function(VeilidAppCall value)? appCall, - TResult Function(VeilidUpdateAttachment value)? attachment, - TResult Function(VeilidUpdateNetwork value)? network, - TResult Function(VeilidUpdateConfig value)? config, - TResult Function(VeilidUpdateRouteChange value)? routeChange, - TResult Function(VeilidUpdateValueChange value)? valueChange, - required TResult orElse(), - }) { - if (config != null) { - return config(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$VeilidUpdateConfigImplToJson( - this, - ); - } -} - -abstract class VeilidUpdateConfig implements VeilidUpdate { - const factory VeilidUpdateConfig({required final VeilidConfig config}) = - _$VeilidUpdateConfigImpl; - - factory VeilidUpdateConfig.fromJson(Map json) = - _$VeilidUpdateConfigImpl.fromJson; - - VeilidConfig get config; - - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidUpdateConfigImplCopyWith<_$VeilidUpdateConfigImpl> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$VeilidUpdateRouteChangeImplCopyWith<$Res> { - factory _$$VeilidUpdateRouteChangeImplCopyWith( - _$VeilidUpdateRouteChangeImpl value, - $Res Function(_$VeilidUpdateRouteChangeImpl) then) = - __$$VeilidUpdateRouteChangeImplCopyWithImpl<$Res>; - @useResult - $Res call({List deadRoutes, List deadRemoteRoutes}); -} - -/// @nodoc -class __$$VeilidUpdateRouteChangeImplCopyWithImpl<$Res> - extends _$VeilidUpdateCopyWithImpl<$Res, _$VeilidUpdateRouteChangeImpl> - implements _$$VeilidUpdateRouteChangeImplCopyWith<$Res> { - __$$VeilidUpdateRouteChangeImplCopyWithImpl( - _$VeilidUpdateRouteChangeImpl _value, - $Res Function(_$VeilidUpdateRouteChangeImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? deadRoutes = null, - Object? deadRemoteRoutes = null, - }) { - return _then(_$VeilidUpdateRouteChangeImpl( - deadRoutes: null == deadRoutes - ? _value._deadRoutes - : deadRoutes // ignore: cast_nullable_to_non_nullable - as List, - deadRemoteRoutes: null == deadRemoteRoutes - ? _value._deadRemoteRoutes - : deadRemoteRoutes // ignore: cast_nullable_to_non_nullable - as List, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$VeilidUpdateRouteChangeImpl implements VeilidUpdateRouteChange { - const _$VeilidUpdateRouteChangeImpl( +class VeilidUpdateRouteChange implements VeilidUpdate { + const VeilidUpdateRouteChange( {required final List deadRoutes, required final List deadRemoteRoutes, final String? $type}) : _deadRoutes = deadRoutes, _deadRemoteRoutes = deadRemoteRoutes, $type = $type ?? 'RouteChange'; - - factory _$VeilidUpdateRouteChangeImpl.fromJson(Map json) => - _$$VeilidUpdateRouteChangeImplFromJson(json); + factory VeilidUpdateRouteChange.fromJson(Map json) => + _$VeilidUpdateRouteChangeFromJson(json); final List _deadRoutes; - @override List get deadRoutes { if (_deadRoutes is EqualUnmodifiableListView) return _deadRoutes; // ignore: implicit_dynamic_type @@ -4554,7 +3257,6 @@ class _$VeilidUpdateRouteChangeImpl implements VeilidUpdateRouteChange { } final List _deadRemoteRoutes; - @override List get deadRemoteRoutes { if (_deadRemoteRoutes is EqualUnmodifiableListView) return _deadRemoteRoutes; @@ -4565,16 +3267,26 @@ class _$VeilidUpdateRouteChangeImpl implements VeilidUpdateRouteChange { @JsonKey(name: 'kind') final String $type; + /// Create a copy of VeilidUpdate + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidUpdateRouteChangeCopyWith get copyWith => + _$VeilidUpdateRouteChangeCopyWithImpl( + this, _$identity); + @override - String toString() { - return 'VeilidUpdate.routeChange(deadRoutes: $deadRoutes, deadRemoteRoutes: $deadRemoteRoutes)'; + Map toJson() { + return _$VeilidUpdateRouteChangeToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidUpdateRouteChangeImpl && + other is VeilidUpdateRouteChange && const DeepCollectionEquality() .equals(other._deadRoutes, _deadRoutes) && const DeepCollectionEquality() @@ -4588,277 +3300,54 @@ class _$VeilidUpdateRouteChangeImpl implements VeilidUpdateRouteChange { const DeepCollectionEquality().hash(_deadRoutes), const DeepCollectionEquality().hash(_deadRemoteRoutes)); - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidUpdateRouteChangeImplCopyWith<_$VeilidUpdateRouteChangeImpl> - get copyWith => __$$VeilidUpdateRouteChangeImplCopyWithImpl< - _$VeilidUpdateRouteChangeImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace) - log, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, - String? routeId) - appMessage, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId) - appCall, - required TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime) - attachment, - required TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers) - network, - required TResult Function(VeilidConfig config) config, - required TResult Function( - List deadRoutes, List deadRemoteRoutes) - routeChange, - required TResult Function(Typed key, - List subkeys, int count, ValueData? value) - valueChange, - }) { - return routeChange(deadRoutes, deadRemoteRoutes); + String toString() { + return 'VeilidUpdate.routeChange(deadRoutes: $deadRoutes, deadRemoteRoutes: $deadRemoteRoutes)'; } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult? Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult? Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult? Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult? Function(VeilidConfig config)? config, - TResult? Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult? Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - }) { - return routeChange?.call(deadRoutes, deadRemoteRoutes); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult Function(VeilidConfig config)? config, - TResult Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - required TResult orElse(), - }) { - if (routeChange != null) { - return routeChange(deadRoutes, deadRemoteRoutes); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(VeilidLog value) log, - required TResult Function(VeilidAppMessage value) appMessage, - required TResult Function(VeilidAppCall value) appCall, - required TResult Function(VeilidUpdateAttachment value) attachment, - required TResult Function(VeilidUpdateNetwork value) network, - required TResult Function(VeilidUpdateConfig value) config, - required TResult Function(VeilidUpdateRouteChange value) routeChange, - required TResult Function(VeilidUpdateValueChange value) valueChange, - }) { - return routeChange(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(VeilidLog value)? log, - TResult? Function(VeilidAppMessage value)? appMessage, - TResult? Function(VeilidAppCall value)? appCall, - TResult? Function(VeilidUpdateAttachment value)? attachment, - TResult? Function(VeilidUpdateNetwork value)? network, - TResult? Function(VeilidUpdateConfig value)? config, - TResult? Function(VeilidUpdateRouteChange value)? routeChange, - TResult? Function(VeilidUpdateValueChange value)? valueChange, - }) { - return routeChange?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(VeilidLog value)? log, - TResult Function(VeilidAppMessage value)? appMessage, - TResult Function(VeilidAppCall value)? appCall, - TResult Function(VeilidUpdateAttachment value)? attachment, - TResult Function(VeilidUpdateNetwork value)? network, - TResult Function(VeilidUpdateConfig value)? config, - TResult Function(VeilidUpdateRouteChange value)? routeChange, - TResult Function(VeilidUpdateValueChange value)? valueChange, - required TResult orElse(), - }) { - if (routeChange != null) { - return routeChange(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$VeilidUpdateRouteChangeImplToJson( - this, - ); - } -} - -abstract class VeilidUpdateRouteChange implements VeilidUpdate { - const factory VeilidUpdateRouteChange( - {required final List deadRoutes, - required final List deadRemoteRoutes}) = - _$VeilidUpdateRouteChangeImpl; - - factory VeilidUpdateRouteChange.fromJson(Map json) = - _$VeilidUpdateRouteChangeImpl.fromJson; - - List get deadRoutes; - List get deadRemoteRoutes; - - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidUpdateRouteChangeImplCopyWith<_$VeilidUpdateRouteChangeImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$VeilidUpdateValueChangeImplCopyWith<$Res> { - factory _$$VeilidUpdateValueChangeImplCopyWith( - _$VeilidUpdateValueChangeImpl value, - $Res Function(_$VeilidUpdateValueChangeImpl) then) = - __$$VeilidUpdateValueChangeImplCopyWithImpl<$Res>; +abstract mixin class $VeilidUpdateRouteChangeCopyWith<$Res> + implements $VeilidUpdateCopyWith<$Res> { + factory $VeilidUpdateRouteChangeCopyWith(VeilidUpdateRouteChange value, + $Res Function(VeilidUpdateRouteChange) _then) = + _$VeilidUpdateRouteChangeCopyWithImpl; @useResult - $Res call( - {Typed key, - List subkeys, - int count, - ValueData? value}); - - $ValueDataCopyWith<$Res>? get value; + $Res call({List deadRoutes, List deadRemoteRoutes}); } /// @nodoc -class __$$VeilidUpdateValueChangeImplCopyWithImpl<$Res> - extends _$VeilidUpdateCopyWithImpl<$Res, _$VeilidUpdateValueChangeImpl> - implements _$$VeilidUpdateValueChangeImplCopyWith<$Res> { - __$$VeilidUpdateValueChangeImplCopyWithImpl( - _$VeilidUpdateValueChangeImpl _value, - $Res Function(_$VeilidUpdateValueChangeImpl) _then) - : super(_value, _then); +class _$VeilidUpdateRouteChangeCopyWithImpl<$Res> + implements $VeilidUpdateRouteChangeCopyWith<$Res> { + _$VeilidUpdateRouteChangeCopyWithImpl(this._self, this._then); + + final VeilidUpdateRouteChange _self; + final $Res Function(VeilidUpdateRouteChange) _then; /// Create a copy of VeilidUpdate /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ - Object? key = null, - Object? subkeys = null, - Object? count = null, - Object? value = freezed, + Object? deadRoutes = null, + Object? deadRemoteRoutes = null, }) { - return _then(_$VeilidUpdateValueChangeImpl( - key: null == key - ? _value.key - : key // ignore: cast_nullable_to_non_nullable - as Typed, - subkeys: null == subkeys - ? _value._subkeys - : subkeys // ignore: cast_nullable_to_non_nullable - as List, - count: null == count - ? _value.count - : count // ignore: cast_nullable_to_non_nullable - as int, - value: freezed == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as ValueData?, + return _then(VeilidUpdateRouteChange( + deadRoutes: null == deadRoutes + ? _self._deadRoutes + : deadRoutes // ignore: cast_nullable_to_non_nullable + as List, + deadRemoteRoutes: null == deadRemoteRoutes + ? _self._deadRemoteRoutes + : deadRemoteRoutes // ignore: cast_nullable_to_non_nullable + as List, )); } - - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ValueDataCopyWith<$Res>? get value { - if (_value.value == null) { - return null; - } - - return $ValueDataCopyWith<$Res>(_value.value!, (value) { - return _then(_value.copyWith(value: value)); - }); - } } /// @nodoc @JsonSerializable() -class _$VeilidUpdateValueChangeImpl implements VeilidUpdateValueChange { - const _$VeilidUpdateValueChangeImpl( +class VeilidUpdateValueChange implements VeilidUpdate { + const VeilidUpdateValueChange( {required this.key, required final List subkeys, required this.count, @@ -4866,38 +3355,43 @@ class _$VeilidUpdateValueChangeImpl implements VeilidUpdateValueChange { final String? $type}) : _subkeys = subkeys, $type = $type ?? 'ValueChange'; + factory VeilidUpdateValueChange.fromJson(Map json) => + _$VeilidUpdateValueChangeFromJson(json); - factory _$VeilidUpdateValueChangeImpl.fromJson(Map json) => - _$$VeilidUpdateValueChangeImplFromJson(json); - - @override final Typed key; final List _subkeys; - @override List get subkeys { if (_subkeys is EqualUnmodifiableListView) return _subkeys; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_subkeys); } - @override final int count; - @override final ValueData? value; @JsonKey(name: 'kind') final String $type; + /// Create a copy of VeilidUpdate + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidUpdateValueChangeCopyWith get copyWith => + _$VeilidUpdateValueChangeCopyWithImpl( + this, _$identity); + @override - String toString() { - return 'VeilidUpdate.valueChange(key: $key, subkeys: $subkeys, count: $count, value: $value)'; + Map toJson() { + return _$VeilidUpdateValueChangeToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidUpdateValueChangeImpl && + other is VeilidUpdateValueChange && (identical(other.key, key) || other.key == key) && const DeepCollectionEquality().equals(other._subkeys, _subkeys) && (identical(other.count, count) || other.count == count) && @@ -4909,386 +3403,104 @@ class _$VeilidUpdateValueChangeImpl implements VeilidUpdateValueChange { int get hashCode => Object.hash(runtimeType, key, const DeepCollectionEquality().hash(_subkeys), count, value); + @override + String toString() { + return 'VeilidUpdate.valueChange(key: $key, subkeys: $subkeys, count: $count, value: $value)'; + } +} + +/// @nodoc +abstract mixin class $VeilidUpdateValueChangeCopyWith<$Res> + implements $VeilidUpdateCopyWith<$Res> { + factory $VeilidUpdateValueChangeCopyWith(VeilidUpdateValueChange value, + $Res Function(VeilidUpdateValueChange) _then) = + _$VeilidUpdateValueChangeCopyWithImpl; + @useResult + $Res call( + {Typed key, + List subkeys, + int count, + ValueData? value}); + + $ValueDataCopyWith<$Res>? get value; +} + +/// @nodoc +class _$VeilidUpdateValueChangeCopyWithImpl<$Res> + implements $VeilidUpdateValueChangeCopyWith<$Res> { + _$VeilidUpdateValueChangeCopyWithImpl(this._self, this._then); + + final VeilidUpdateValueChange _self; + final $Res Function(VeilidUpdateValueChange) _then; + + /// Create a copy of VeilidUpdate + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + $Res call({ + Object? key = null, + Object? subkeys = null, + Object? count = null, + Object? value = freezed, + }) { + return _then(VeilidUpdateValueChange( + key: null == key + ? _self.key + : key // ignore: cast_nullable_to_non_nullable + as Typed, + subkeys: null == subkeys + ? _self._subkeys + : subkeys // ignore: cast_nullable_to_non_nullable + as List, + count: null == count + ? _self.count + : count // ignore: cast_nullable_to_non_nullable + as int, + value: freezed == value + ? _self.value + : value // ignore: cast_nullable_to_non_nullable + as ValueData?, + )); + } + /// Create a copy of VeilidUpdate /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$VeilidUpdateValueChangeImplCopyWith<_$VeilidUpdateValueChangeImpl> - get copyWith => __$$VeilidUpdateValueChangeImplCopyWithImpl< - _$VeilidUpdateValueChangeImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace) - log, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, - String? routeId) - appMessage, - required TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId) - appCall, - required TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime) - attachment, - required TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers) - network, - required TResult Function(VeilidConfig config) config, - required TResult Function( - List deadRoutes, List deadRemoteRoutes) - routeChange, - required TResult Function(Typed key, - List subkeys, int count, ValueData? value) - valueChange, - }) { - return valueChange(key, subkeys, count, value); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult? Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult? Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult? Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult? Function(VeilidConfig config)? config, - TResult? Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult? Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - }) { - return valueChange?.call(key, subkeys, count, value); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function( - VeilidLogLevel logLevel, String message, String? backtrace)? - log, - TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message, - Typed? sender, String? routeId)? - appMessage, - TResult Function( - @Uint8ListJsonConverter.jsIsArray() Uint8List message, - String callId, - Typed? sender, - String? routeId)? - appCall, - TResult Function( - AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime)? - attachment, - TResult Function(bool started, BigInt bpsDown, BigInt bpsUp, - List peers)? - network, - TResult Function(VeilidConfig config)? config, - TResult Function(List deadRoutes, List deadRemoteRoutes)? - routeChange, - TResult Function(Typed key, - List subkeys, int count, ValueData? value)? - valueChange, - required TResult orElse(), - }) { - if (valueChange != null) { - return valueChange(key, subkeys, count, value); + $ValueDataCopyWith<$Res>? get value { + if (_self.value == null) { + return null; } - return orElse(); + + return $ValueDataCopyWith<$Res>(_self.value!, (value) { + return _then(_self.copyWith(value: value)); + }); } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(VeilidLog value) log, - required TResult Function(VeilidAppMessage value) appMessage, - required TResult Function(VeilidAppCall value) appCall, - required TResult Function(VeilidUpdateAttachment value) attachment, - required TResult Function(VeilidUpdateNetwork value) network, - required TResult Function(VeilidUpdateConfig value) config, - required TResult Function(VeilidUpdateRouteChange value) routeChange, - required TResult Function(VeilidUpdateValueChange value) valueChange, - }) { - return valueChange(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(VeilidLog value)? log, - TResult? Function(VeilidAppMessage value)? appMessage, - TResult? Function(VeilidAppCall value)? appCall, - TResult? Function(VeilidUpdateAttachment value)? attachment, - TResult? Function(VeilidUpdateNetwork value)? network, - TResult? Function(VeilidUpdateConfig value)? config, - TResult? Function(VeilidUpdateRouteChange value)? routeChange, - TResult? Function(VeilidUpdateValueChange value)? valueChange, - }) { - return valueChange?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(VeilidLog value)? log, - TResult Function(VeilidAppMessage value)? appMessage, - TResult Function(VeilidAppCall value)? appCall, - TResult Function(VeilidUpdateAttachment value)? attachment, - TResult Function(VeilidUpdateNetwork value)? network, - TResult Function(VeilidUpdateConfig value)? config, - TResult Function(VeilidUpdateRouteChange value)? routeChange, - TResult Function(VeilidUpdateValueChange value)? valueChange, - required TResult orElse(), - }) { - if (valueChange != null) { - return valueChange(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$VeilidUpdateValueChangeImplToJson( - this, - ); - } -} - -abstract class VeilidUpdateValueChange implements VeilidUpdate { - const factory VeilidUpdateValueChange( - {required final Typed key, - required final List subkeys, - required final int count, - required final ValueData? value}) = _$VeilidUpdateValueChangeImpl; - - factory VeilidUpdateValueChange.fromJson(Map json) = - _$VeilidUpdateValueChangeImpl.fromJson; - - Typed get key; - List get subkeys; - int get count; - ValueData? get value; - - /// Create a copy of VeilidUpdate - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidUpdateValueChangeImplCopyWith<_$VeilidUpdateValueChangeImpl> - get copyWith => throw _privateConstructorUsedError; -} - -VeilidStateAttachment _$VeilidStateAttachmentFromJson( - Map json) { - return _VeilidStateAttachment.fromJson(json); } /// @nodoc mixin _$VeilidStateAttachment { - AttachmentState get state => throw _privateConstructorUsedError; - bool get publicInternetReady => throw _privateConstructorUsedError; - bool get localNetworkReady => throw _privateConstructorUsedError; - TimestampDuration get uptime => throw _privateConstructorUsedError; - TimestampDuration? get attachedUptime => throw _privateConstructorUsedError; - - /// Serializes this VeilidStateAttachment to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + AttachmentState get state; + bool get publicInternetReady; + bool get localNetworkReady; + TimestampDuration get uptime; + TimestampDuration? get attachedUptime; /// Create a copy of VeilidStateAttachment /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') $VeilidStateAttachmentCopyWith get copyWith => - throw _privateConstructorUsedError; -} + _$VeilidStateAttachmentCopyWithImpl( + this as VeilidStateAttachment, _$identity); -/// @nodoc -abstract class $VeilidStateAttachmentCopyWith<$Res> { - factory $VeilidStateAttachmentCopyWith(VeilidStateAttachment value, - $Res Function(VeilidStateAttachment) then) = - _$VeilidStateAttachmentCopyWithImpl<$Res, VeilidStateAttachment>; - @useResult - $Res call( - {AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime}); -} - -/// @nodoc -class _$VeilidStateAttachmentCopyWithImpl<$Res, - $Val extends VeilidStateAttachment> - implements $VeilidStateAttachmentCopyWith<$Res> { - _$VeilidStateAttachmentCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of VeilidStateAttachment - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? state = null, - Object? publicInternetReady = null, - Object? localNetworkReady = null, - Object? uptime = null, - Object? attachedUptime = freezed, - }) { - return _then(_value.copyWith( - state: null == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as AttachmentState, - publicInternetReady: null == publicInternetReady - ? _value.publicInternetReady - : publicInternetReady // ignore: cast_nullable_to_non_nullable - as bool, - localNetworkReady: null == localNetworkReady - ? _value.localNetworkReady - : localNetworkReady // ignore: cast_nullable_to_non_nullable - as bool, - uptime: null == uptime - ? _value.uptime - : uptime // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - attachedUptime: freezed == attachedUptime - ? _value.attachedUptime - : attachedUptime // ignore: cast_nullable_to_non_nullable - as TimestampDuration?, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$VeilidStateAttachmentImplCopyWith<$Res> - implements $VeilidStateAttachmentCopyWith<$Res> { - factory _$$VeilidStateAttachmentImplCopyWith( - _$VeilidStateAttachmentImpl value, - $Res Function(_$VeilidStateAttachmentImpl) then) = - __$$VeilidStateAttachmentImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {AttachmentState state, - bool publicInternetReady, - bool localNetworkReady, - TimestampDuration uptime, - TimestampDuration? attachedUptime}); -} - -/// @nodoc -class __$$VeilidStateAttachmentImplCopyWithImpl<$Res> - extends _$VeilidStateAttachmentCopyWithImpl<$Res, - _$VeilidStateAttachmentImpl> - implements _$$VeilidStateAttachmentImplCopyWith<$Res> { - __$$VeilidStateAttachmentImplCopyWithImpl(_$VeilidStateAttachmentImpl _value, - $Res Function(_$VeilidStateAttachmentImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidStateAttachment - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? state = null, - Object? publicInternetReady = null, - Object? localNetworkReady = null, - Object? uptime = null, - Object? attachedUptime = freezed, - }) { - return _then(_$VeilidStateAttachmentImpl( - state: null == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as AttachmentState, - publicInternetReady: null == publicInternetReady - ? _value.publicInternetReady - : publicInternetReady // ignore: cast_nullable_to_non_nullable - as bool, - localNetworkReady: null == localNetworkReady - ? _value.localNetworkReady - : localNetworkReady // ignore: cast_nullable_to_non_nullable - as bool, - uptime: null == uptime - ? _value.uptime - : uptime // ignore: cast_nullable_to_non_nullable - as TimestampDuration, - attachedUptime: freezed == attachedUptime - ? _value.attachedUptime - : attachedUptime // ignore: cast_nullable_to_non_nullable - as TimestampDuration?, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$VeilidStateAttachmentImpl implements _VeilidStateAttachment { - const _$VeilidStateAttachmentImpl( - {required this.state, - required this.publicInternetReady, - required this.localNetworkReady, - required this.uptime, - required this.attachedUptime}); - - factory _$VeilidStateAttachmentImpl.fromJson(Map json) => - _$$VeilidStateAttachmentImplFromJson(json); - - @override - final AttachmentState state; - @override - final bool publicInternetReady; - @override - final bool localNetworkReady; - @override - final TimestampDuration uptime; - @override - final TimestampDuration? attachedUptime; - - @override - String toString() { - return 'VeilidStateAttachment(state: $state, publicInternetReady: $publicInternetReady, localNetworkReady: $localNetworkReady, uptime: $uptime, attachedUptime: $attachedUptime)'; - } + /// Serializes this VeilidStateAttachment to a JSON map. + Map toJson(); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidStateAttachmentImpl && + other is VeilidStateAttachment && (identical(other.state, state) || other.state == state) && (identical(other.publicInternetReady, publicInternetReady) || other.publicInternetReady == publicInternetReady) && @@ -5304,145 +3516,252 @@ class _$VeilidStateAttachmentImpl implements _VeilidStateAttachment { int get hashCode => Object.hash(runtimeType, state, publicInternetReady, localNetworkReady, uptime, attachedUptime); - /// Create a copy of VeilidStateAttachment - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidStateAttachmentImplCopyWith<_$VeilidStateAttachmentImpl> - get copyWith => __$$VeilidStateAttachmentImplCopyWithImpl< - _$VeilidStateAttachmentImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidStateAttachmentImplToJson( - this, - ); + String toString() { + return 'VeilidStateAttachment(state: $state, publicInternetReady: $publicInternetReady, localNetworkReady: $localNetworkReady, uptime: $uptime, attachedUptime: $attachedUptime)'; } } -abstract class _VeilidStateAttachment implements VeilidStateAttachment { - const factory _VeilidStateAttachment( - {required final AttachmentState state, - required final bool publicInternetReady, - required final bool localNetworkReady, - required final TimestampDuration uptime, - required final TimestampDuration? attachedUptime}) = - _$VeilidStateAttachmentImpl; +/// @nodoc +abstract mixin class $VeilidStateAttachmentCopyWith<$Res> { + factory $VeilidStateAttachmentCopyWith(VeilidStateAttachment value, + $Res Function(VeilidStateAttachment) _then) = + _$VeilidStateAttachmentCopyWithImpl; + @useResult + $Res call( + {AttachmentState state, + bool publicInternetReady, + bool localNetworkReady, + TimestampDuration uptime, + TimestampDuration? attachedUptime}); +} - factory _VeilidStateAttachment.fromJson(Map json) = - _$VeilidStateAttachmentImpl.fromJson; +/// @nodoc +class _$VeilidStateAttachmentCopyWithImpl<$Res> + implements $VeilidStateAttachmentCopyWith<$Res> { + _$VeilidStateAttachmentCopyWithImpl(this._self, this._then); + + final VeilidStateAttachment _self; + final $Res Function(VeilidStateAttachment) _then; + + /// Create a copy of VeilidStateAttachment + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? state = null, + Object? publicInternetReady = null, + Object? localNetworkReady = null, + Object? uptime = null, + Object? attachedUptime = freezed, + }) { + return _then(_self.copyWith( + state: null == state + ? _self.state + : state // ignore: cast_nullable_to_non_nullable + as AttachmentState, + publicInternetReady: null == publicInternetReady + ? _self.publicInternetReady + : publicInternetReady // ignore: cast_nullable_to_non_nullable + as bool, + localNetworkReady: null == localNetworkReady + ? _self.localNetworkReady + : localNetworkReady // ignore: cast_nullable_to_non_nullable + as bool, + uptime: null == uptime + ? _self.uptime + : uptime // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + attachedUptime: freezed == attachedUptime + ? _self.attachedUptime + : attachedUptime // ignore: cast_nullable_to_non_nullable + as TimestampDuration?, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _VeilidStateAttachment implements VeilidStateAttachment { + const _VeilidStateAttachment( + {required this.state, + required this.publicInternetReady, + required this.localNetworkReady, + required this.uptime, + required this.attachedUptime}); + factory _VeilidStateAttachment.fromJson(Map json) => + _$VeilidStateAttachmentFromJson(json); @override - AttachmentState get state; + final AttachmentState state; @override - bool get publicInternetReady; + final bool publicInternetReady; @override - bool get localNetworkReady; + final bool localNetworkReady; @override - TimestampDuration get uptime; + final TimestampDuration uptime; @override - TimestampDuration? get attachedUptime; + final TimestampDuration? attachedUptime; /// Create a copy of VeilidStateAttachment /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidStateAttachmentImplCopyWith<_$VeilidStateAttachmentImpl> - get copyWith => throw _privateConstructorUsedError; + @pragma('vm:prefer-inline') + _$VeilidStateAttachmentCopyWith<_VeilidStateAttachment> get copyWith => + __$VeilidStateAttachmentCopyWithImpl<_VeilidStateAttachment>( + this, _$identity); + + @override + Map toJson() { + return _$VeilidStateAttachmentToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _VeilidStateAttachment && + (identical(other.state, state) || other.state == state) && + (identical(other.publicInternetReady, publicInternetReady) || + other.publicInternetReady == publicInternetReady) && + (identical(other.localNetworkReady, localNetworkReady) || + other.localNetworkReady == localNetworkReady) && + (identical(other.uptime, uptime) || other.uptime == uptime) && + (identical(other.attachedUptime, attachedUptime) || + other.attachedUptime == attachedUptime)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, state, publicInternetReady, + localNetworkReady, uptime, attachedUptime); + + @override + String toString() { + return 'VeilidStateAttachment(state: $state, publicInternetReady: $publicInternetReady, localNetworkReady: $localNetworkReady, uptime: $uptime, attachedUptime: $attachedUptime)'; + } } -VeilidStateNetwork _$VeilidStateNetworkFromJson(Map json) { - return _VeilidStateNetwork.fromJson(json); +/// @nodoc +abstract mixin class _$VeilidStateAttachmentCopyWith<$Res> + implements $VeilidStateAttachmentCopyWith<$Res> { + factory _$VeilidStateAttachmentCopyWith(_VeilidStateAttachment value, + $Res Function(_VeilidStateAttachment) _then) = + __$VeilidStateAttachmentCopyWithImpl; + @override + @useResult + $Res call( + {AttachmentState state, + bool publicInternetReady, + bool localNetworkReady, + TimestampDuration uptime, + TimestampDuration? attachedUptime}); +} + +/// @nodoc +class __$VeilidStateAttachmentCopyWithImpl<$Res> + implements _$VeilidStateAttachmentCopyWith<$Res> { + __$VeilidStateAttachmentCopyWithImpl(this._self, this._then); + + final _VeilidStateAttachment _self; + final $Res Function(_VeilidStateAttachment) _then; + + /// Create a copy of VeilidStateAttachment + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? state = null, + Object? publicInternetReady = null, + Object? localNetworkReady = null, + Object? uptime = null, + Object? attachedUptime = freezed, + }) { + return _then(_VeilidStateAttachment( + state: null == state + ? _self.state + : state // ignore: cast_nullable_to_non_nullable + as AttachmentState, + publicInternetReady: null == publicInternetReady + ? _self.publicInternetReady + : publicInternetReady // ignore: cast_nullable_to_non_nullable + as bool, + localNetworkReady: null == localNetworkReady + ? _self.localNetworkReady + : localNetworkReady // ignore: cast_nullable_to_non_nullable + as bool, + uptime: null == uptime + ? _self.uptime + : uptime // ignore: cast_nullable_to_non_nullable + as TimestampDuration, + attachedUptime: freezed == attachedUptime + ? _self.attachedUptime + : attachedUptime // ignore: cast_nullable_to_non_nullable + as TimestampDuration?, + )); + } } /// @nodoc mixin _$VeilidStateNetwork { - bool get started => throw _privateConstructorUsedError; - BigInt get bpsDown => throw _privateConstructorUsedError; - BigInt get bpsUp => throw _privateConstructorUsedError; - List get peers => throw _privateConstructorUsedError; - - /// Serializes this VeilidStateNetwork to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + bool get started; + BigInt get bpsDown; + BigInt get bpsUp; + List get peers; /// Create a copy of VeilidStateNetwork /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $VeilidStateNetworkCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VeilidStateNetworkCopyWith<$Res> { - factory $VeilidStateNetworkCopyWith( - VeilidStateNetwork value, $Res Function(VeilidStateNetwork) then) = - _$VeilidStateNetworkCopyWithImpl<$Res, VeilidStateNetwork>; - @useResult - $Res call( - {bool started, BigInt bpsDown, BigInt bpsUp, List peers}); -} - -/// @nodoc -class _$VeilidStateNetworkCopyWithImpl<$Res, $Val extends VeilidStateNetwork> - implements $VeilidStateNetworkCopyWith<$Res> { - _$VeilidStateNetworkCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of VeilidStateNetwork - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') + $VeilidStateNetworkCopyWith get copyWith => + _$VeilidStateNetworkCopyWithImpl( + this as VeilidStateNetwork, _$identity); + + /// Serializes this VeilidStateNetwork to a JSON map. + Map toJson(); + @override - $Res call({ - Object? started = null, - Object? bpsDown = null, - Object? bpsUp = null, - Object? peers = null, - }) { - return _then(_value.copyWith( - started: null == started - ? _value.started - : started // ignore: cast_nullable_to_non_nullable - as bool, - bpsDown: null == bpsDown - ? _value.bpsDown - : bpsDown // ignore: cast_nullable_to_non_nullable - as BigInt, - bpsUp: null == bpsUp - ? _value.bpsUp - : bpsUp // ignore: cast_nullable_to_non_nullable - as BigInt, - peers: null == peers - ? _value.peers - : peers // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is VeilidStateNetwork && + (identical(other.started, started) || other.started == started) && + (identical(other.bpsDown, bpsDown) || other.bpsDown == bpsDown) && + (identical(other.bpsUp, bpsUp) || other.bpsUp == bpsUp) && + const DeepCollectionEquality().equals(other.peers, peers)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, started, bpsDown, bpsUp, + const DeepCollectionEquality().hash(peers)); + + @override + String toString() { + return 'VeilidStateNetwork(started: $started, bpsDown: $bpsDown, bpsUp: $bpsUp, peers: $peers)'; } } /// @nodoc -abstract class _$$VeilidStateNetworkImplCopyWith<$Res> - implements $VeilidStateNetworkCopyWith<$Res> { - factory _$$VeilidStateNetworkImplCopyWith(_$VeilidStateNetworkImpl value, - $Res Function(_$VeilidStateNetworkImpl) then) = - __$$VeilidStateNetworkImplCopyWithImpl<$Res>; - @override +abstract mixin class $VeilidStateNetworkCopyWith<$Res> { + factory $VeilidStateNetworkCopyWith( + VeilidStateNetwork value, $Res Function(VeilidStateNetwork) _then) = + _$VeilidStateNetworkCopyWithImpl; @useResult $Res call( {bool started, BigInt bpsDown, BigInt bpsUp, List peers}); } /// @nodoc -class __$$VeilidStateNetworkImplCopyWithImpl<$Res> - extends _$VeilidStateNetworkCopyWithImpl<$Res, _$VeilidStateNetworkImpl> - implements _$$VeilidStateNetworkImplCopyWith<$Res> { - __$$VeilidStateNetworkImplCopyWithImpl(_$VeilidStateNetworkImpl _value, - $Res Function(_$VeilidStateNetworkImpl) _then) - : super(_value, _then); +class _$VeilidStateNetworkCopyWithImpl<$Res> + implements $VeilidStateNetworkCopyWith<$Res> { + _$VeilidStateNetworkCopyWithImpl(this._self, this._then); + + final VeilidStateNetwork _self; + final $Res Function(VeilidStateNetwork) _then; /// Create a copy of VeilidStateNetwork /// with the given fields replaced by the non-null parameter values. @@ -5454,21 +3773,21 @@ class __$$VeilidStateNetworkImplCopyWithImpl<$Res> Object? bpsUp = null, Object? peers = null, }) { - return _then(_$VeilidStateNetworkImpl( + return _then(_self.copyWith( started: null == started - ? _value.started + ? _self.started : started // ignore: cast_nullable_to_non_nullable as bool, bpsDown: null == bpsDown - ? _value.bpsDown + ? _self.bpsDown : bpsDown // ignore: cast_nullable_to_non_nullable as BigInt, bpsUp: null == bpsUp - ? _value.bpsUp + ? _self.bpsUp : bpsUp // ignore: cast_nullable_to_non_nullable as BigInt, peers: null == peers - ? _value._peers + ? _self.peers : peers // ignore: cast_nullable_to_non_nullable as List, )); @@ -5477,16 +3796,15 @@ class __$$VeilidStateNetworkImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$VeilidStateNetworkImpl implements _VeilidStateNetwork { - const _$VeilidStateNetworkImpl( +class _VeilidStateNetwork implements VeilidStateNetwork { + const _VeilidStateNetwork( {required this.started, required this.bpsDown, required this.bpsUp, required final List peers}) : _peers = peers; - - factory _$VeilidStateNetworkImpl.fromJson(Map json) => - _$$VeilidStateNetworkImplFromJson(json); + factory _VeilidStateNetwork.fromJson(Map json) => + _$VeilidStateNetworkFromJson(json); @override final bool started; @@ -5502,16 +3820,26 @@ class _$VeilidStateNetworkImpl implements _VeilidStateNetwork { return EqualUnmodifiableListView(_peers); } + /// Create a copy of VeilidStateNetwork + /// with the given fields replaced by the non-null parameter values. @override - String toString() { - return 'VeilidStateNetwork(started: $started, bpsDown: $bpsDown, bpsUp: $bpsUp, peers: $peers)'; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidStateNetworkCopyWith<_VeilidStateNetwork> get copyWith => + __$VeilidStateNetworkCopyWithImpl<_VeilidStateNetwork>(this, _$identity); + + @override + Map toJson() { + return _$VeilidStateNetworkToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidStateNetworkImpl && + other is _VeilidStateNetwork && (identical(other.started, started) || other.started == started) && (identical(other.bpsDown, bpsDown) || other.bpsDown == bpsDown) && (identical(other.bpsUp, bpsUp) || other.bpsUp == bpsUp) && @@ -5523,174 +3851,83 @@ class _$VeilidStateNetworkImpl implements _VeilidStateNetwork { int get hashCode => Object.hash(runtimeType, started, bpsDown, bpsUp, const DeepCollectionEquality().hash(_peers)); - /// Create a copy of VeilidStateNetwork - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidStateNetworkImplCopyWith<_$VeilidStateNetworkImpl> get copyWith => - __$$VeilidStateNetworkImplCopyWithImpl<_$VeilidStateNetworkImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$VeilidStateNetworkImplToJson( - this, - ); + String toString() { + return 'VeilidStateNetwork(started: $started, bpsDown: $bpsDown, bpsUp: $bpsUp, peers: $peers)'; } } -abstract class _VeilidStateNetwork implements VeilidStateNetwork { - const factory _VeilidStateNetwork( - {required final bool started, - required final BigInt bpsDown, - required final BigInt bpsUp, - required final List peers}) = _$VeilidStateNetworkImpl; +/// @nodoc +abstract mixin class _$VeilidStateNetworkCopyWith<$Res> + implements $VeilidStateNetworkCopyWith<$Res> { + factory _$VeilidStateNetworkCopyWith( + _VeilidStateNetwork value, $Res Function(_VeilidStateNetwork) _then) = + __$VeilidStateNetworkCopyWithImpl; + @override + @useResult + $Res call( + {bool started, BigInt bpsDown, BigInt bpsUp, List peers}); +} - factory _VeilidStateNetwork.fromJson(Map json) = - _$VeilidStateNetworkImpl.fromJson; +/// @nodoc +class __$VeilidStateNetworkCopyWithImpl<$Res> + implements _$VeilidStateNetworkCopyWith<$Res> { + __$VeilidStateNetworkCopyWithImpl(this._self, this._then); - @override - bool get started; - @override - BigInt get bpsDown; - @override - BigInt get bpsUp; - @override - List get peers; + final _VeilidStateNetwork _self; + final $Res Function(_VeilidStateNetwork) _then; /// Create a copy of VeilidStateNetwork /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidStateNetworkImplCopyWith<_$VeilidStateNetworkImpl> get copyWith => - throw _privateConstructorUsedError; -} - -VeilidStateConfig _$VeilidStateConfigFromJson(Map json) { - return _VeilidStateConfig.fromJson(json); -} - -/// @nodoc -mixin _$VeilidStateConfig { - VeilidConfig get config => throw _privateConstructorUsedError; - - /// Serializes this VeilidStateConfig to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidStateConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $VeilidStateConfigCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VeilidStateConfigCopyWith<$Res> { - factory $VeilidStateConfigCopyWith( - VeilidStateConfig value, $Res Function(VeilidStateConfig) then) = - _$VeilidStateConfigCopyWithImpl<$Res, VeilidStateConfig>; - @useResult - $Res call({VeilidConfig config}); - - $VeilidConfigCopyWith<$Res> get config; -} - -/// @nodoc -class _$VeilidStateConfigCopyWithImpl<$Res, $Val extends VeilidStateConfig> - implements $VeilidStateConfigCopyWith<$Res> { - _$VeilidStateConfigCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of VeilidStateConfig - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ - Object? config = null, + Object? started = null, + Object? bpsDown = null, + Object? bpsUp = null, + Object? peers = null, }) { - return _then(_value.copyWith( - config: null == config - ? _value.config - : config // ignore: cast_nullable_to_non_nullable - as VeilidConfig, - ) as $Val); - } - - /// Create a copy of VeilidStateConfig - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidConfigCopyWith<$Res> get config { - return $VeilidConfigCopyWith<$Res>(_value.config, (value) { - return _then(_value.copyWith(config: value) as $Val); - }); - } -} - -/// @nodoc -abstract class _$$VeilidStateConfigImplCopyWith<$Res> - implements $VeilidStateConfigCopyWith<$Res> { - factory _$$VeilidStateConfigImplCopyWith(_$VeilidStateConfigImpl value, - $Res Function(_$VeilidStateConfigImpl) then) = - __$$VeilidStateConfigImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({VeilidConfig config}); - - @override - $VeilidConfigCopyWith<$Res> get config; -} - -/// @nodoc -class __$$VeilidStateConfigImplCopyWithImpl<$Res> - extends _$VeilidStateConfigCopyWithImpl<$Res, _$VeilidStateConfigImpl> - implements _$$VeilidStateConfigImplCopyWith<$Res> { - __$$VeilidStateConfigImplCopyWithImpl(_$VeilidStateConfigImpl _value, - $Res Function(_$VeilidStateConfigImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidStateConfig - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? config = null, - }) { - return _then(_$VeilidStateConfigImpl( - config: null == config - ? _value.config - : config // ignore: cast_nullable_to_non_nullable - as VeilidConfig, + return _then(_VeilidStateNetwork( + started: null == started + ? _self.started + : started // ignore: cast_nullable_to_non_nullable + as bool, + bpsDown: null == bpsDown + ? _self.bpsDown + : bpsDown // ignore: cast_nullable_to_non_nullable + as BigInt, + bpsUp: null == bpsUp + ? _self.bpsUp + : bpsUp // ignore: cast_nullable_to_non_nullable + as BigInt, + peers: null == peers + ? _self._peers + : peers // ignore: cast_nullable_to_non_nullable + as List, )); } } /// @nodoc -@JsonSerializable() -class _$VeilidStateConfigImpl implements _VeilidStateConfig { - const _$VeilidStateConfigImpl({required this.config}); +mixin _$VeilidStateConfig { + VeilidConfig get config; - factory _$VeilidStateConfigImpl.fromJson(Map json) => - _$$VeilidStateConfigImplFromJson(json); + /// Create a copy of VeilidStateConfig + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidStateConfigCopyWith get copyWith => + _$VeilidStateConfigCopyWithImpl( + this as VeilidStateConfig, _$identity); - @override - final VeilidConfig config; - - @override - String toString() { - return 'VeilidStateConfig(config: $config)'; - } + /// Serializes this VeilidStateConfig to a JSON map. + Map toJson(); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidStateConfigImpl && + other is VeilidStateConfig && (identical(other.config, config) || other.config == config)); } @@ -5698,224 +3935,169 @@ class _$VeilidStateConfigImpl implements _VeilidStateConfig { @override int get hashCode => Object.hash(runtimeType, config); - /// Create a copy of VeilidStateConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidStateConfigImplCopyWith<_$VeilidStateConfigImpl> get copyWith => - __$$VeilidStateConfigImplCopyWithImpl<_$VeilidStateConfigImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$VeilidStateConfigImplToJson( - this, - ); + String toString() { + return 'VeilidStateConfig(config: $config)'; } } -abstract class _VeilidStateConfig implements VeilidStateConfig { - const factory _VeilidStateConfig({required final VeilidConfig config}) = - _$VeilidStateConfigImpl; +/// @nodoc +abstract mixin class $VeilidStateConfigCopyWith<$Res> { + factory $VeilidStateConfigCopyWith( + VeilidStateConfig value, $Res Function(VeilidStateConfig) _then) = + _$VeilidStateConfigCopyWithImpl; + @useResult + $Res call({VeilidConfig config}); - factory _VeilidStateConfig.fromJson(Map json) = - _$VeilidStateConfigImpl.fromJson; + $VeilidConfigCopyWith<$Res> get config; +} - @override - VeilidConfig get config; +/// @nodoc +class _$VeilidStateConfigCopyWithImpl<$Res> + implements $VeilidStateConfigCopyWith<$Res> { + _$VeilidStateConfigCopyWithImpl(this._self, this._then); + + final VeilidStateConfig _self; + final $Res Function(VeilidStateConfig) _then; /// Create a copy of VeilidStateConfig /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidStateConfigImplCopyWith<_$VeilidStateConfigImpl> get copyWith => - throw _privateConstructorUsedError; -} - -VeilidState _$VeilidStateFromJson(Map json) { - return _VeilidState.fromJson(json); -} - -/// @nodoc -mixin _$VeilidState { - VeilidStateAttachment get attachment => throw _privateConstructorUsedError; - VeilidStateNetwork get network => throw _privateConstructorUsedError; - VeilidStateConfig get config => throw _privateConstructorUsedError; - - /// Serializes this VeilidState to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of VeilidState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $VeilidStateCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VeilidStateCopyWith<$Res> { - factory $VeilidStateCopyWith( - VeilidState value, $Res Function(VeilidState) then) = - _$VeilidStateCopyWithImpl<$Res, VeilidState>; - @useResult - $Res call( - {VeilidStateAttachment attachment, - VeilidStateNetwork network, - VeilidStateConfig config}); - - $VeilidStateAttachmentCopyWith<$Res> get attachment; - $VeilidStateNetworkCopyWith<$Res> get network; - $VeilidStateConfigCopyWith<$Res> get config; -} - -/// @nodoc -class _$VeilidStateCopyWithImpl<$Res, $Val extends VeilidState> - implements $VeilidStateCopyWith<$Res> { - _$VeilidStateCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of VeilidState - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? attachment = null, - Object? network = null, Object? config = null, }) { - return _then(_value.copyWith( - attachment: null == attachment - ? _value.attachment - : attachment // ignore: cast_nullable_to_non_nullable - as VeilidStateAttachment, - network: null == network - ? _value.network - : network // ignore: cast_nullable_to_non_nullable - as VeilidStateNetwork, + return _then(_self.copyWith( config: null == config - ? _value.config + ? _self.config : config // ignore: cast_nullable_to_non_nullable - as VeilidStateConfig, - ) as $Val); - } - - /// Create a copy of VeilidState - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidStateAttachmentCopyWith<$Res> get attachment { - return $VeilidStateAttachmentCopyWith<$Res>(_value.attachment, (value) { - return _then(_value.copyWith(attachment: value) as $Val); - }); - } - - /// Create a copy of VeilidState - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidStateNetworkCopyWith<$Res> get network { - return $VeilidStateNetworkCopyWith<$Res>(_value.network, (value) { - return _then(_value.copyWith(network: value) as $Val); - }); - } - - /// Create a copy of VeilidState - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $VeilidStateConfigCopyWith<$Res> get config { - return $VeilidStateConfigCopyWith<$Res>(_value.config, (value) { - return _then(_value.copyWith(config: value) as $Val); - }); - } -} - -/// @nodoc -abstract class _$$VeilidStateImplCopyWith<$Res> - implements $VeilidStateCopyWith<$Res> { - factory _$$VeilidStateImplCopyWith( - _$VeilidStateImpl value, $Res Function(_$VeilidStateImpl) then) = - __$$VeilidStateImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {VeilidStateAttachment attachment, - VeilidStateNetwork network, - VeilidStateConfig config}); - - @override - $VeilidStateAttachmentCopyWith<$Res> get attachment; - @override - $VeilidStateNetworkCopyWith<$Res> get network; - @override - $VeilidStateConfigCopyWith<$Res> get config; -} - -/// @nodoc -class __$$VeilidStateImplCopyWithImpl<$Res> - extends _$VeilidStateCopyWithImpl<$Res, _$VeilidStateImpl> - implements _$$VeilidStateImplCopyWith<$Res> { - __$$VeilidStateImplCopyWithImpl( - _$VeilidStateImpl _value, $Res Function(_$VeilidStateImpl) _then) - : super(_value, _then); - - /// Create a copy of VeilidState - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? attachment = null, - Object? network = null, - Object? config = null, - }) { - return _then(_$VeilidStateImpl( - attachment: null == attachment - ? _value.attachment - : attachment // ignore: cast_nullable_to_non_nullable - as VeilidStateAttachment, - network: null == network - ? _value.network - : network // ignore: cast_nullable_to_non_nullable - as VeilidStateNetwork, - config: null == config - ? _value.config - : config // ignore: cast_nullable_to_non_nullable - as VeilidStateConfig, + as VeilidConfig, )); } + + /// Create a copy of VeilidStateConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigCopyWith<$Res> get config { + return $VeilidConfigCopyWith<$Res>(_self.config, (value) { + return _then(_self.copyWith(config: value)); + }); + } } /// @nodoc @JsonSerializable() -class _$VeilidStateImpl implements _VeilidState { - const _$VeilidStateImpl( - {required this.attachment, required this.network, required this.config}); - - factory _$VeilidStateImpl.fromJson(Map json) => - _$$VeilidStateImplFromJson(json); +class _VeilidStateConfig implements VeilidStateConfig { + const _VeilidStateConfig({required this.config}); + factory _VeilidStateConfig.fromJson(Map json) => + _$VeilidStateConfigFromJson(json); @override - final VeilidStateAttachment attachment; + final VeilidConfig config; + + /// Create a copy of VeilidStateConfig + /// with the given fields replaced by the non-null parameter values. @override - final VeilidStateNetwork network; - @override - final VeilidStateConfig config; + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$VeilidStateConfigCopyWith<_VeilidStateConfig> get copyWith => + __$VeilidStateConfigCopyWithImpl<_VeilidStateConfig>(this, _$identity); @override - String toString() { - return 'VeilidState(attachment: $attachment, network: $network, config: $config)'; + Map toJson() { + return _$VeilidStateConfigToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VeilidStateImpl && + other is _VeilidStateConfig && + (identical(other.config, config) || other.config == config)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, config); + + @override + String toString() { + return 'VeilidStateConfig(config: $config)'; + } +} + +/// @nodoc +abstract mixin class _$VeilidStateConfigCopyWith<$Res> + implements $VeilidStateConfigCopyWith<$Res> { + factory _$VeilidStateConfigCopyWith( + _VeilidStateConfig value, $Res Function(_VeilidStateConfig) _then) = + __$VeilidStateConfigCopyWithImpl; + @override + @useResult + $Res call({VeilidConfig config}); + + @override + $VeilidConfigCopyWith<$Res> get config; +} + +/// @nodoc +class __$VeilidStateConfigCopyWithImpl<$Res> + implements _$VeilidStateConfigCopyWith<$Res> { + __$VeilidStateConfigCopyWithImpl(this._self, this._then); + + final _VeilidStateConfig _self; + final $Res Function(_VeilidStateConfig) _then; + + /// Create a copy of VeilidStateConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? config = null, + }) { + return _then(_VeilidStateConfig( + config: null == config + ? _self.config + : config // ignore: cast_nullable_to_non_nullable + as VeilidConfig, + )); + } + + /// Create a copy of VeilidStateConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidConfigCopyWith<$Res> get config { + return $VeilidConfigCopyWith<$Res>(_self.config, (value) { + return _then(_self.copyWith(config: value)); + }); + } +} + +/// @nodoc +mixin _$VeilidState { + VeilidStateAttachment get attachment; + VeilidStateNetwork get network; + VeilidStateConfig get config; + + /// Create a copy of VeilidState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $VeilidStateCopyWith get copyWith => + _$VeilidStateCopyWithImpl(this as VeilidState, _$identity); + + /// Serializes this VeilidState to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is VeilidState && (identical(other.attachment, attachment) || other.attachment == attachment) && (identical(other.network, network) || other.network == network) && @@ -5926,42 +4108,224 @@ class _$VeilidStateImpl implements _VeilidState { @override int get hashCode => Object.hash(runtimeType, attachment, network, config); - /// Create a copy of VeilidState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$VeilidStateImplCopyWith<_$VeilidStateImpl> get copyWith => - __$$VeilidStateImplCopyWithImpl<_$VeilidStateImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VeilidStateImplToJson( - this, - ); + String toString() { + return 'VeilidState(attachment: $attachment, network: $network, config: $config)'; } } -abstract class _VeilidState implements VeilidState { - const factory _VeilidState( - {required final VeilidStateAttachment attachment, - required final VeilidStateNetwork network, - required final VeilidStateConfig config}) = _$VeilidStateImpl; +/// @nodoc +abstract mixin class $VeilidStateCopyWith<$Res> { + factory $VeilidStateCopyWith( + VeilidState value, $Res Function(VeilidState) _then) = + _$VeilidStateCopyWithImpl; + @useResult + $Res call( + {VeilidStateAttachment attachment, + VeilidStateNetwork network, + VeilidStateConfig config}); - factory _VeilidState.fromJson(Map json) = - _$VeilidStateImpl.fromJson; + $VeilidStateAttachmentCopyWith<$Res> get attachment; + $VeilidStateNetworkCopyWith<$Res> get network; + $VeilidStateConfigCopyWith<$Res> get config; +} + +/// @nodoc +class _$VeilidStateCopyWithImpl<$Res> implements $VeilidStateCopyWith<$Res> { + _$VeilidStateCopyWithImpl(this._self, this._then); + + final VeilidState _self; + final $Res Function(VeilidState) _then; + + /// Create a copy of VeilidState + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? attachment = null, + Object? network = null, + Object? config = null, + }) { + return _then(_self.copyWith( + attachment: null == attachment + ? _self.attachment + : attachment // ignore: cast_nullable_to_non_nullable + as VeilidStateAttachment, + network: null == network + ? _self.network + : network // ignore: cast_nullable_to_non_nullable + as VeilidStateNetwork, + config: null == config + ? _self.config + : config // ignore: cast_nullable_to_non_nullable + as VeilidStateConfig, + )); + } + + /// Create a copy of VeilidState + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidStateAttachmentCopyWith<$Res> get attachment { + return $VeilidStateAttachmentCopyWith<$Res>(_self.attachment, (value) { + return _then(_self.copyWith(attachment: value)); + }); + } + + /// Create a copy of VeilidState + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidStateNetworkCopyWith<$Res> get network { + return $VeilidStateNetworkCopyWith<$Res>(_self.network, (value) { + return _then(_self.copyWith(network: value)); + }); + } + + /// Create a copy of VeilidState + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidStateConfigCopyWith<$Res> get config { + return $VeilidStateConfigCopyWith<$Res>(_self.config, (value) { + return _then(_self.copyWith(config: value)); + }); + } +} + +/// @nodoc +@JsonSerializable() +class _VeilidState implements VeilidState { + const _VeilidState( + {required this.attachment, required this.network, required this.config}); + factory _VeilidState.fromJson(Map json) => + _$VeilidStateFromJson(json); @override - VeilidStateAttachment get attachment; + final VeilidStateAttachment attachment; @override - VeilidStateNetwork get network; + final VeilidStateNetwork network; @override - VeilidStateConfig get config; + final VeilidStateConfig config; /// Create a copy of VeilidState /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$VeilidStateImplCopyWith<_$VeilidStateImpl> get copyWith => - throw _privateConstructorUsedError; + @pragma('vm:prefer-inline') + _$VeilidStateCopyWith<_VeilidState> get copyWith => + __$VeilidStateCopyWithImpl<_VeilidState>(this, _$identity); + + @override + Map toJson() { + return _$VeilidStateToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _VeilidState && + (identical(other.attachment, attachment) || + other.attachment == attachment) && + (identical(other.network, network) || other.network == network) && + (identical(other.config, config) || other.config == config)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, attachment, network, config); + + @override + String toString() { + return 'VeilidState(attachment: $attachment, network: $network, config: $config)'; + } } + +/// @nodoc +abstract mixin class _$VeilidStateCopyWith<$Res> + implements $VeilidStateCopyWith<$Res> { + factory _$VeilidStateCopyWith( + _VeilidState value, $Res Function(_VeilidState) _then) = + __$VeilidStateCopyWithImpl; + @override + @useResult + $Res call( + {VeilidStateAttachment attachment, + VeilidStateNetwork network, + VeilidStateConfig config}); + + @override + $VeilidStateAttachmentCopyWith<$Res> get attachment; + @override + $VeilidStateNetworkCopyWith<$Res> get network; + @override + $VeilidStateConfigCopyWith<$Res> get config; +} + +/// @nodoc +class __$VeilidStateCopyWithImpl<$Res> implements _$VeilidStateCopyWith<$Res> { + __$VeilidStateCopyWithImpl(this._self, this._then); + + final _VeilidState _self; + final $Res Function(_VeilidState) _then; + + /// Create a copy of VeilidState + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? attachment = null, + Object? network = null, + Object? config = null, + }) { + return _then(_VeilidState( + attachment: null == attachment + ? _self.attachment + : attachment // ignore: cast_nullable_to_non_nullable + as VeilidStateAttachment, + network: null == network + ? _self.network + : network // ignore: cast_nullable_to_non_nullable + as VeilidStateNetwork, + config: null == config + ? _self.config + : config // ignore: cast_nullable_to_non_nullable + as VeilidStateConfig, + )); + } + + /// Create a copy of VeilidState + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidStateAttachmentCopyWith<$Res> get attachment { + return $VeilidStateAttachmentCopyWith<$Res>(_self.attachment, (value) { + return _then(_self.copyWith(attachment: value)); + }); + } + + /// Create a copy of VeilidState + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidStateNetworkCopyWith<$Res> get network { + return $VeilidStateNetworkCopyWith<$Res>(_self.network, (value) { + return _then(_self.copyWith(network: value)); + }); + } + + /// Create a copy of VeilidState + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $VeilidStateConfigCopyWith<$Res> get config { + return $VeilidStateConfigCopyWith<$Res>(_self.config, (value) { + return _then(_self.copyWith(config: value)); + }); + } +} + +// dart format on diff --git a/veilid-flutter/lib/veilid_state.g.dart b/veilid-flutter/lib/veilid_state.g.dart index 261357d0..3de9ec69 100644 --- a/veilid-flutter/lib/veilid_state.g.dart +++ b/veilid-flutter/lib/veilid_state.g.dart @@ -6,8 +6,8 @@ part of 'veilid_state.dart'; // JsonSerializableGenerator // ************************************************************************** -_$LatencyStatsImpl _$$LatencyStatsImplFromJson(Map json) => - _$LatencyStatsImpl( +_LatencyStats _$LatencyStatsFromJson(Map json) => + _LatencyStats( fastest: TimestampDuration.fromJson(json['fastest']), average: TimestampDuration.fromJson(json['average']), slowest: TimestampDuration.fromJson(json['slowest']), @@ -17,7 +17,7 @@ _$LatencyStatsImpl _$$LatencyStatsImplFromJson(Map json) => p75: TimestampDuration.fromJson(json['p75']), ); -Map _$$LatencyStatsImplToJson(_$LatencyStatsImpl instance) => +Map _$LatencyStatsToJson(_LatencyStats instance) => { 'fastest': instance.fastest.toJson(), 'average': instance.average.toJson(), @@ -28,15 +28,15 @@ Map _$$LatencyStatsImplToJson(_$LatencyStatsImpl instance) => 'p75': instance.p75.toJson(), }; -_$TransferStatsImpl _$$TransferStatsImplFromJson(Map json) => - _$TransferStatsImpl( +_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 _$$TransferStatsImplToJson(_$TransferStatsImpl instance) => +Map _$TransferStatsToJson(_TransferStats instance) => { 'total': instance.total.toString(), 'maximum': instance.maximum.toString(), @@ -44,22 +44,20 @@ Map _$$TransferStatsImplToJson(_$TransferStatsImpl instance) => 'minimum': instance.minimum.toString(), }; -_$TransferStatsDownUpImpl _$$TransferStatsDownUpImplFromJson( - Map json) => - _$TransferStatsDownUpImpl( +_TransferStatsDownUp _$TransferStatsDownUpFromJson(Map json) => + _TransferStatsDownUp( down: TransferStats.fromJson(json['down']), up: TransferStats.fromJson(json['up']), ); -Map _$$TransferStatsDownUpImplToJson( - _$TransferStatsDownUpImpl instance) => +Map _$TransferStatsDownUpToJson( + _TransferStatsDownUp instance) => { 'down': instance.down.toJson(), 'up': instance.up.toJson(), }; -_$StateStatsImpl _$$StateStatsImplFromJson(Map json) => - _$StateStatsImpl( +_StateStats _$StateStatsFromJson(Map json) => _StateStats( span: TimestampDuration.fromJson(json['span']), reliable: TimestampDuration.fromJson(json['reliable']), unreliable: TimestampDuration.fromJson(json['unreliable']), @@ -68,7 +66,7 @@ _$StateStatsImpl _$$StateStatsImplFromJson(Map json) => reason: StateReasonStats.fromJson(json['reason']), ); -Map _$$StateStatsImplToJson(_$StateStatsImpl instance) => +Map _$StateStatsToJson(_StateStats instance) => { 'span': instance.span.toJson(), 'reliable': instance.reliable.toJson(), @@ -78,9 +76,8 @@ Map _$$StateStatsImplToJson(_$StateStatsImpl instance) => 'reason': instance.reason.toJson(), }; -_$StateReasonStatsImpl _$$StateReasonStatsImplFromJson( - Map json) => - _$StateReasonStatsImpl( +_StateReasonStats _$StateReasonStatsFromJson(Map json) => + _StateReasonStats( canNotSend: TimestampDuration.fromJson(json['can_not_send']), tooManyLostAnswers: TimestampDuration.fromJson(json['too_many_lost_answers']), @@ -93,8 +90,7 @@ _$StateReasonStatsImpl _$$StateReasonStatsImplFromJson( TimestampDuration.fromJson(json['in_unreliable_ping_span']), ); -Map _$$StateReasonStatsImplToJson( - _$StateReasonStatsImpl instance) => +Map _$StateReasonStatsToJson(_StateReasonStats instance) => { 'can_not_send': instance.canNotSend.toJson(), 'too_many_lost_answers': instance.tooManyLostAnswers.toJson(), @@ -105,8 +101,7 @@ Map _$$StateReasonStatsImplToJson( 'in_unreliable_ping_span': instance.inUnreliablePingSpan.toJson(), }; -_$AnswerStatsImpl _$$AnswerStatsImplFromJson(Map json) => - _$AnswerStatsImpl( +_AnswerStats _$AnswerStatsFromJson(Map json) => _AnswerStats( span: TimestampDuration.fromJson(json['span']), questions: (json['questions'] as num).toInt(), answers: (json['answers'] as num).toInt(), @@ -125,7 +120,7 @@ _$AnswerStatsImpl _$$AnswerStatsImplFromJson(Map json) => (json['consecutive_lost_answers_minimum'] as num).toInt(), ); -Map _$$AnswerStatsImplToJson(_$AnswerStatsImpl instance) => +Map _$AnswerStatsToJson(_AnswerStats instance) => { 'span': instance.span.toJson(), 'questions': instance.questions, @@ -142,8 +137,7 @@ Map _$$AnswerStatsImplToJson(_$AnswerStatsImpl instance) => instance.consecutiveLostAnswersMinimum, }; -_$RPCStatsImpl _$$RPCStatsImplFromJson(Map json) => - _$RPCStatsImpl( +_RPCStats _$RPCStatsFromJson(Map json) => _RPCStats( messagesSent: (json['messages_sent'] as num).toInt(), messagesRcvd: (json['messages_rcvd'] as num).toInt(), questionsInFlight: (json['questions_in_flight'] as num).toInt(), @@ -165,8 +159,7 @@ _$RPCStatsImpl _$$RPCStatsImplFromJson(Map json) => answerOrdered: AnswerStats.fromJson(json['answer_ordered']), ); -Map _$$RPCStatsImplToJson(_$RPCStatsImpl instance) => - { +Map _$RPCStatsToJson(_RPCStats instance) => { 'messages_sent': instance.messagesSent, 'messages_rcvd': instance.messagesRcvd, 'questions_in_flight': instance.questionsInFlight, @@ -180,8 +173,7 @@ Map _$$RPCStatsImplToJson(_$RPCStatsImpl instance) => 'answer_ordered': instance.answerOrdered.toJson(), }; -_$PeerStatsImpl _$$PeerStatsImplFromJson(Map json) => - _$PeerStatsImpl( +_PeerStats _$PeerStatsFromJson(Map json) => _PeerStats( timeAdded: Timestamp.fromJson(json['time_added']), rpcStats: RPCStats.fromJson(json['rpc_stats']), transfer: TransferStatsDownUp.fromJson(json['transfer']), @@ -191,7 +183,7 @@ _$PeerStatsImpl _$$PeerStatsImplFromJson(Map json) => : LatencyStats.fromJson(json['latency']), ); -Map _$$PeerStatsImplToJson(_$PeerStatsImpl instance) => +Map _$PeerStatsToJson(_PeerStats instance) => { 'time_added': instance.timeAdded.toJson(), 'rpc_stats': instance.rpcStats.toJson(), @@ -200,8 +192,8 @@ Map _$$PeerStatsImplToJson(_$PeerStatsImpl instance) => 'latency': instance.latency?.toJson(), }; -_$PeerTableDataImpl _$$PeerTableDataImplFromJson(Map json) => - _$PeerTableDataImpl( +_PeerTableData _$PeerTableDataFromJson(Map json) => + _PeerTableData( nodeIds: (json['node_ids'] as List) .map(Typed.fromJson) .toList(), @@ -209,32 +201,29 @@ _$PeerTableDataImpl _$$PeerTableDataImplFromJson(Map json) => peerStats: PeerStats.fromJson(json['peer_stats']), ); -Map _$$PeerTableDataImplToJson(_$PeerTableDataImpl instance) => +Map _$PeerTableDataToJson(_PeerTableData instance) => { 'node_ids': instance.nodeIds.map((e) => e.toJson()).toList(), 'peer_address': instance.peerAddress, 'peer_stats': instance.peerStats.toJson(), }; -_$VeilidLogImpl _$$VeilidLogImplFromJson(Map json) => - _$VeilidLogImpl( +VeilidLog _$VeilidLogFromJson(Map json) => VeilidLog( logLevel: VeilidLogLevel.fromJson(json['log_level']), message: json['message'] as String, backtrace: json['backtrace'] as String?, $type: json['kind'] as String?, ); -Map _$$VeilidLogImplToJson(_$VeilidLogImpl instance) => - { +Map _$VeilidLogToJson(VeilidLog instance) => { 'log_level': instance.logLevel.toJson(), 'message': instance.message, 'backtrace': instance.backtrace, 'kind': instance.$type, }; -_$VeilidAppMessageImpl _$$VeilidAppMessageImplFromJson( - Map json) => - _$VeilidAppMessageImpl( +VeilidAppMessage _$VeilidAppMessageFromJson(Map json) => + VeilidAppMessage( message: const Uint8ListJsonConverter.jsIsArray().fromJson(json['message']), sender: json['sender'] == null @@ -244,8 +233,7 @@ _$VeilidAppMessageImpl _$$VeilidAppMessageImplFromJson( $type: json['kind'] as String?, ); -Map _$$VeilidAppMessageImplToJson( - _$VeilidAppMessageImpl instance) => +Map _$VeilidAppMessageToJson(VeilidAppMessage instance) => { 'message': const Uint8ListJsonConverter.jsIsArray().toJson(instance.message), @@ -254,8 +242,8 @@ Map _$$VeilidAppMessageImplToJson( 'kind': instance.$type, }; -_$VeilidAppCallImpl _$$VeilidAppCallImplFromJson(Map json) => - _$VeilidAppCallImpl( +VeilidAppCall _$VeilidAppCallFromJson(Map json) => + VeilidAppCall( message: const Uint8ListJsonConverter.jsIsArray().fromJson(json['message']), callId: json['call_id'] as String, @@ -266,7 +254,7 @@ _$VeilidAppCallImpl _$$VeilidAppCallImplFromJson(Map json) => $type: json['kind'] as String?, ); -Map _$$VeilidAppCallImplToJson(_$VeilidAppCallImpl instance) => +Map _$VeilidAppCallToJson(VeilidAppCall instance) => { 'message': const Uint8ListJsonConverter.jsIsArray().toJson(instance.message), @@ -276,9 +264,9 @@ Map _$$VeilidAppCallImplToJson(_$VeilidAppCallImpl instance) => 'kind': instance.$type, }; -_$VeilidUpdateAttachmentImpl _$$VeilidUpdateAttachmentImplFromJson( +VeilidUpdateAttachment _$VeilidUpdateAttachmentFromJson( Map json) => - _$VeilidUpdateAttachmentImpl( + VeilidUpdateAttachment( state: AttachmentState.fromJson(json['state']), publicInternetReady: json['public_internet_ready'] as bool, localNetworkReady: json['local_network_ready'] as bool, @@ -289,8 +277,8 @@ _$VeilidUpdateAttachmentImpl _$$VeilidUpdateAttachmentImplFromJson( $type: json['kind'] as String?, ); -Map _$$VeilidUpdateAttachmentImplToJson( - _$VeilidUpdateAttachmentImpl instance) => +Map _$VeilidUpdateAttachmentToJson( + VeilidUpdateAttachment instance) => { 'state': instance.state.toJson(), 'public_internet_ready': instance.publicInternetReady, @@ -300,9 +288,8 @@ Map _$$VeilidUpdateAttachmentImplToJson( 'kind': instance.$type, }; -_$VeilidUpdateNetworkImpl _$$VeilidUpdateNetworkImplFromJson( - Map json) => - _$VeilidUpdateNetworkImpl( +VeilidUpdateNetwork _$VeilidUpdateNetworkFromJson(Map json) => + VeilidUpdateNetwork( started: json['started'] as bool, bpsDown: BigInt.parse(json['bps_down'] as String), bpsUp: BigInt.parse(json['bps_up'] as String), @@ -311,8 +298,8 @@ _$VeilidUpdateNetworkImpl _$$VeilidUpdateNetworkImplFromJson( $type: json['kind'] as String?, ); -Map _$$VeilidUpdateNetworkImplToJson( - _$VeilidUpdateNetworkImpl instance) => +Map _$VeilidUpdateNetworkToJson( + VeilidUpdateNetwork instance) => { 'started': instance.started, 'bps_down': instance.bpsDown.toString(), @@ -321,23 +308,21 @@ Map _$$VeilidUpdateNetworkImplToJson( 'kind': instance.$type, }; -_$VeilidUpdateConfigImpl _$$VeilidUpdateConfigImplFromJson( - Map json) => - _$VeilidUpdateConfigImpl( +VeilidUpdateConfig _$VeilidUpdateConfigFromJson(Map json) => + VeilidUpdateConfig( config: VeilidConfig.fromJson(json['config']), $type: json['kind'] as String?, ); -Map _$$VeilidUpdateConfigImplToJson( - _$VeilidUpdateConfigImpl instance) => +Map _$VeilidUpdateConfigToJson(VeilidUpdateConfig instance) => { 'config': instance.config.toJson(), 'kind': instance.$type, }; -_$VeilidUpdateRouteChangeImpl _$$VeilidUpdateRouteChangeImplFromJson( +VeilidUpdateRouteChange _$VeilidUpdateRouteChangeFromJson( Map json) => - _$VeilidUpdateRouteChangeImpl( + VeilidUpdateRouteChange( deadRoutes: (json['dead_routes'] as List) .map((e) => e as String) .toList(), @@ -347,17 +332,17 @@ _$VeilidUpdateRouteChangeImpl _$$VeilidUpdateRouteChangeImplFromJson( $type: json['kind'] as String?, ); -Map _$$VeilidUpdateRouteChangeImplToJson( - _$VeilidUpdateRouteChangeImpl instance) => +Map _$VeilidUpdateRouteChangeToJson( + VeilidUpdateRouteChange instance) => { 'dead_routes': instance.deadRoutes, 'dead_remote_routes': instance.deadRemoteRoutes, 'kind': instance.$type, }; -_$VeilidUpdateValueChangeImpl _$$VeilidUpdateValueChangeImplFromJson( +VeilidUpdateValueChange _$VeilidUpdateValueChangeFromJson( Map json) => - _$VeilidUpdateValueChangeImpl( + VeilidUpdateValueChange( key: Typed.fromJson(json['key']), subkeys: (json['subkeys'] as List) .map(ValueSubkeyRange.fromJson) @@ -367,8 +352,8 @@ _$VeilidUpdateValueChangeImpl _$$VeilidUpdateValueChangeImplFromJson( $type: json['kind'] as String?, ); -Map _$$VeilidUpdateValueChangeImplToJson( - _$VeilidUpdateValueChangeImpl instance) => +Map _$VeilidUpdateValueChangeToJson( + VeilidUpdateValueChange instance) => { 'key': instance.key.toJson(), 'subkeys': instance.subkeys.map((e) => e.toJson()).toList(), @@ -377,9 +362,9 @@ Map _$$VeilidUpdateValueChangeImplToJson( 'kind': instance.$type, }; -_$VeilidStateAttachmentImpl _$$VeilidStateAttachmentImplFromJson( +_VeilidStateAttachment _$VeilidStateAttachmentFromJson( Map json) => - _$VeilidStateAttachmentImpl( + _VeilidStateAttachment( state: AttachmentState.fromJson(json['state']), publicInternetReady: json['public_internet_ready'] as bool, localNetworkReady: json['local_network_ready'] as bool, @@ -389,8 +374,8 @@ _$VeilidStateAttachmentImpl _$$VeilidStateAttachmentImplFromJson( : TimestampDuration.fromJson(json['attached_uptime']), ); -Map _$$VeilidStateAttachmentImplToJson( - _$VeilidStateAttachmentImpl instance) => +Map _$VeilidStateAttachmentToJson( + _VeilidStateAttachment instance) => { 'state': instance.state.toJson(), 'public_internet_ready': instance.publicInternetReady, @@ -399,9 +384,8 @@ Map _$$VeilidStateAttachmentImplToJson( 'attached_uptime': instance.attachedUptime?.toJson(), }; -_$VeilidStateNetworkImpl _$$VeilidStateNetworkImplFromJson( - Map json) => - _$VeilidStateNetworkImpl( +_VeilidStateNetwork _$VeilidStateNetworkFromJson(Map json) => + _VeilidStateNetwork( started: json['started'] as bool, bpsDown: BigInt.parse(json['bps_down'] as String), bpsUp: BigInt.parse(json['bps_up'] as String), @@ -409,8 +393,7 @@ _$VeilidStateNetworkImpl _$$VeilidStateNetworkImplFromJson( (json['peers'] as List).map(PeerTableData.fromJson).toList(), ); -Map _$$VeilidStateNetworkImplToJson( - _$VeilidStateNetworkImpl instance) => +Map _$VeilidStateNetworkToJson(_VeilidStateNetwork instance) => { 'started': instance.started, 'bps_down': instance.bpsDown.toString(), @@ -418,26 +401,23 @@ Map _$$VeilidStateNetworkImplToJson( 'peers': instance.peers.map((e) => e.toJson()).toList(), }; -_$VeilidStateConfigImpl _$$VeilidStateConfigImplFromJson( - Map json) => - _$VeilidStateConfigImpl( +_VeilidStateConfig _$VeilidStateConfigFromJson(Map json) => + _VeilidStateConfig( config: VeilidConfig.fromJson(json['config']), ); -Map _$$VeilidStateConfigImplToJson( - _$VeilidStateConfigImpl instance) => +Map _$VeilidStateConfigToJson(_VeilidStateConfig instance) => { 'config': instance.config.toJson(), }; -_$VeilidStateImpl _$$VeilidStateImplFromJson(Map json) => - _$VeilidStateImpl( +_VeilidState _$VeilidStateFromJson(Map json) => _VeilidState( attachment: VeilidStateAttachment.fromJson(json['attachment']), network: VeilidStateNetwork.fromJson(json['network']), config: VeilidStateConfig.fromJson(json['config']), ); -Map _$$VeilidStateImplToJson(_$VeilidStateImpl instance) => +Map _$VeilidStateToJson(_VeilidState instance) => { 'attachment': instance.attachment.toJson(), 'network': instance.network.toJson(), diff --git a/veilid-flutter/linux/rust.cmake b/veilid-flutter/linux/rust.cmake index 0e76d497..8f8825a6 100644 --- a/veilid-flutter/linux/rust.cmake +++ b/veilid-flutter/linux/rust.cmake @@ -9,7 +9,7 @@ include(FetchContent) FetchContent_Declare( Corrosion GIT_REPOSITORY https://github.com/AndrewGaspar/corrosion.git - GIT_TAG v0.5.0 # Optionally specify a version tag or branch here + GIT_TAG v0.5.1 # Optionally specify a version tag or branch here ) FetchContent_MakeAvailable(Corrosion) diff --git a/veilid-flutter/build.bat b/veilid-flutter/update_generated_files.bat similarity index 100% rename from veilid-flutter/build.bat rename to veilid-flutter/update_generated_files.bat diff --git a/veilid-flutter/build.sh b/veilid-flutter/update_generated_files.sh similarity index 100% rename from veilid-flutter/build.sh rename to veilid-flutter/update_generated_files.sh diff --git a/veilid-flutter/windows/rust.cmake b/veilid-flutter/windows/rust.cmake index ae7254a1..8f8825a6 100644 --- a/veilid-flutter/windows/rust.cmake +++ b/veilid-flutter/windows/rust.cmake @@ -9,7 +9,7 @@ include(FetchContent) FetchContent_Declare( Corrosion GIT_REPOSITORY https://github.com/AndrewGaspar/corrosion.git - GIT_TAG v0.4.10 # Optionally specify a version tag or branch here + GIT_TAG v0.5.1 # Optionally specify a version tag or branch here ) FetchContent_MakeAvailable(Corrosion) @@ -29,4 +29,3 @@ corrosion_import_crate(MANIFEST_PATH ${repository_root}/../veilid/Cargo.toml CRA set(CRATE_NAME "veilid_flutter") target_link_libraries(${PLUGIN_NAME} PUBLIC ${CRATE_NAME}) -# list(APPEND PLUGIN_BUNDLED_LIBRARIES $) \ No newline at end of file diff --git a/veilid-python/tests/test_dht.py b/veilid-python/tests/test_dht.py index 5bf6f3cb..1555f7c6 100644 --- a/veilid-python/tests/test_dht.py +++ b/veilid-python/tests/test_dht.py @@ -7,7 +7,7 @@ import os import veilid from veilid import ValueSubkey, Timestamp, SafetySelection -from veilid.types import VeilidJSONEncoder +from veilid.types import ValueSeqNum, VeilidJSONEncoder ################################################################## BOGUS_KEY = veilid.TypedKey.from_value( @@ -118,8 +118,8 @@ async def test_set_get_dht_value_with_owner(api_connection: veilid.VeilidAPI): vd4 = await rc.get_dht_value(rec.key, ValueSubkey(1), False) assert vd4 is None - print("vd2: {}", vd2.__dict__) - print("vd3: {}", vd3.__dict__) + #print("vd2: {}", vd2.__dict__) + #print("vd3: {}", vd3.__dict__) assert vd2 == vd3 @@ -135,7 +135,7 @@ async def test_open_writer_dht_value(api_connection: veilid.VeilidAPI): key = rec.key owner = rec.owner secret = rec.owner_secret - print(f"key:{key}") + #print(f"key:{key}") cs = await api_connection.get_crypto_system(rec.key.kind()) async with cs: @@ -237,6 +237,14 @@ async def test_open_writer_dht_value(api_connection: veilid.VeilidAPI): await rc.set_dht_value(key, ValueSubkey(0), va) # Verify subkey 0 can be set because override with the right writer + # Should have prior sequence number as its returned value because it exists online at seq 0 + vdtemp = await rc.set_dht_value(key, ValueSubkey(0), va, veilid.KeyPair.from_parts(owner, secret)) + assert vdtemp is not None + assert vdtemp.data == vb + assert vdtemp.seq == 0 + assert vdtemp.writer == owner + + # Should update the second time to seq 1 vdtemp = await rc.set_dht_value(key, ValueSubkey(0), va, veilid.KeyPair.from_parts(owner, secret)) assert vdtemp is None @@ -297,7 +305,7 @@ async def test_watch_dht_values(): await sync(rc0, [rec0]) # Server 0: Make a watch on all the subkeys - active = await rc0.watch_dht_values(rec0.key, [], Timestamp(0), 0xFFFFFFFF) + active = await rc0.watch_dht_values(rec0.key) assert active # Server 1: Open the subkey @@ -462,7 +470,7 @@ async def test_watch_many_dht_values(): assert vd is None # Server 0: Make a watch on all the subkeys - active = await rc0.watch_dht_values(records[n].key, [], Timestamp(0), 0xFFFFFFFF) + active = await rc0.watch_dht_values(records[n].key) assert active # Open and set all records @@ -516,16 +524,18 @@ async def test_inspect_dht_record(api_connection: veilid.VeilidAPI): assert vd is None rr = await rc.inspect_dht_record(rec.key, [], veilid.DHTReportScope.LOCAL) - print("rr: {}", rr.__dict__) - assert rr.subkeys == [(0,1)] - assert rr.local_seqs == [0, 0xFFFFFFFF] - assert rr.network_seqs == [] + #print("rr: {}", rr.__dict__) + assert rr.subkeys == [(0, 1)] + assert rr.local_seqs == [0, None] + assert rr.network_seqs == [None, None] + + await sync(rc, [rec]) rr2 = await rc.inspect_dht_record(rec.key, [], veilid.DHTReportScope.SYNC_GET) - print("rr2: {}", rr2.__dict__) - assert rr2.subkeys == [(0,1)] - assert rr2.local_seqs == [0, 0xFFFFFFFF] - assert rr2.network_seqs == [0, 0xFFFFFFFF] + #print("rr2: {}", rr2.__dict__) + assert rr2.subkeys == [(0, 1)] + assert rr2.local_seqs == [0, None] + assert rr2.network_seqs == [0, None] await rc.close_dht_record(rec.key) await rc.delete_dht_record(rec.key) @@ -932,7 +942,7 @@ async def sync_win( if key is not None: futurerecords.remove(key) - if len(rr.subkeys) == 1 and rr.subkeys[0] == (0, subkey_count-1) and veilid.ValueSeqNum.NONE not in rr.local_seqs and len(rr.offline_subkeys) == 0: + if len(rr.subkeys) == 1 and rr.subkeys[0] == (0, subkey_count-1) and None not in rr.local_seqs and len(rr.offline_subkeys) == 0: if key in recordreports: del recordreports[key] donerecords.add(key) @@ -959,7 +969,7 @@ async def sync_win( win.addstr(n+2, 1, " " * subkey_count, curses.color_pair(1)) for (a,b) in rr.subkeys: for m in range(a, b+1): - if rr.local_seqs[m] != veilid.ValueSeqNum.NONE: + if rr.local_seqs[m] != None: win.addstr(n+2, m+1, " ", curses.color_pair(2)) for (a,b) in rr.offline_subkeys: win.addstr(n+2, a+1, " " * (b-a+1), curses.color_pair(3)) diff --git a/veilid-python/veilid/schema/RecvMessage.json b/veilid-python/veilid/schema/RecvMessage.json index 592177a0..ecc8239d 100644 --- a/veilid-python/veilid/schema/RecvMessage.json +++ b/veilid-python/veilid/schema/RecvMessage.json @@ -2947,7 +2947,10 @@ "description": "The sequence numbers of each subkey requested from a locally stored DHT Record", "type": "array", "items": { - "type": "integer", + "type": [ + "integer", + "null" + ], "format": "uint32", "minimum": 0.0 } @@ -2956,7 +2959,10 @@ "description": "The sequence numbers of each subkey requested from the DHT over the network", "type": "array", "items": { - "type": "integer", + "type": [ + "integer", + "null" + ], "format": "uint32", "minimum": 0.0 } diff --git a/veilid-python/veilid/types.py b/veilid-python/veilid/types.py index 8ec6a782..edd83522 100644 --- a/veilid-python/veilid/types.py +++ b/veilid-python/veilid/types.py @@ -237,8 +237,7 @@ class ValueSubkey(int): class ValueSeqNum(int): - NONE = 4294967295 - + pass #################################################################### @@ -405,15 +404,15 @@ class DHTRecordDescriptor: class DHTRecordReport: subkeys: list[tuple[ValueSubkey, ValueSubkey]] offline_subkeys: list[tuple[ValueSubkey, ValueSubkey]] - local_seqs: list[ValueSeqNum] - network_seqs: list[ValueSeqNum] + local_seqs: list[Optional[ValueSeqNum]] + network_seqs: list[Optional[ValueSeqNum]] def __init__( self, subkeys: list[tuple[ValueSubkey, ValueSubkey]], offline_subkeys: list[tuple[ValueSubkey, ValueSubkey]], - local_seqs: list[ValueSeqNum], - network_seqs: list[ValueSeqNum], + local_seqs: list[Optional[ValueSeqNum]], + network_seqs: list[Optional[ValueSeqNum]], ): self.subkeys = subkeys self.offline_subkeys = offline_subkeys @@ -428,8 +427,8 @@ class DHTRecordReport: return cls( [(p[0], p[1]) for p in j["subkeys"]], [(p[0], p[1]) for p in j["offline_subkeys"]], - [ValueSeqNum(s) for s in j["local_seqs"]], - [ValueSeqNum(s) for s in j["network_seqs"]], + [(ValueSeqNum(s) if s is not None else None) for s in j["local_seqs"] ], + [(ValueSeqNum(s) if s is not None else None) for s in j["network_seqs"] ], ) def to_json(self) -> dict: diff --git a/veilid-server/src/main.rs b/veilid-server/src/main.rs index 265071bf..02a9560a 100644 --- a/veilid-server/src/main.rs +++ b/veilid-server/src/main.rs @@ -212,13 +212,13 @@ fn main() -> EyreResult<()> { settingsrw.logging.terminal.enabled = true; settingsrw.logging.terminal.level = LogLevel::Debug; settingsrw.logging.api.enabled = true; - settingsrw.logging.api.level = LogLevel::Debug; + settingsrw.logging.api.level = LogLevel::Info; } if args.logging.trace { settingsrw.logging.terminal.enabled = true; settingsrw.logging.terminal.level = LogLevel::Trace; settingsrw.logging.api.enabled = true; - settingsrw.logging.api.level = LogLevel::Trace; + settingsrw.logging.api.level = LogLevel::Info; } if let Some(subnode_index) = args.subnode_index { diff --git a/veilid-wasm/src/veilid_client_js.rs b/veilid-wasm/src/veilid_client_js.rs index e2c70d47..cdfb8731 100644 --- a/veilid-wasm/src/veilid_client_js.rs +++ b/veilid-wasm/src/veilid_client_js.rs @@ -13,6 +13,8 @@ export type KeyPair = `${PublicKey}:${SecretKey}`; export type FourCC = "NONE" | "VLD0" | string; export type CryptoTyped = `${FourCC}:${TCryptoKey}`; export type CryptoTypedGroup = Array>; + +export "#; #[wasm_bindgen] diff --git a/veilid-wasm/tests/package.json b/veilid-wasm/tests/package.json index bf725717..5ca15324 100644 --- a/veilid-wasm/tests/package.json +++ b/veilid-wasm/tests/package.json @@ -17,7 +17,7 @@ }, "scripts": { "test": "wdio run ./wdio.conf.ts", - "test:headless": "WDIO_HEADLESS=true npm run test", + "test:headless": "WDIO_HEADLESS=true npm run test --", "start": "tsc && npm run test:headless" } } \ No newline at end of file diff --git a/veilid-wasm/tests/src/VeilidRoutingContext.test.ts b/veilid-wasm/tests/src/VeilidRoutingContext.test.ts index d97f558e..e8a43263 100644 --- a/veilid-wasm/tests/src/VeilidRoutingContext.test.ts +++ b/veilid-wasm/tests/src/VeilidRoutingContext.test.ts @@ -149,6 +149,9 @@ describe('VeilidRoutingContext', () => { ); expect(setValueRes).toBeUndefined(); + // Wait for synchronization + await waitForOfflineSubkeyWrite(routingContext, dhtRecord.key); + const getValueRes = await routingContext.getDhtValue( dhtRecord.key, 0, @@ -282,9 +285,9 @@ describe('VeilidRoutingContext', () => { "Local", ); expect(inspectRes).toBeDefined(); - expect(inspectRes.subkeys.concat(inspectRes.offline_subkeys)).toEqual([[0, 0]]); + expect(inspectRes.subkeys).toEqual([[0, 0]]); expect(inspectRes.local_seqs).toEqual([0]); - expect(inspectRes.network_seqs).toEqual([]); + expect(inspectRes.network_seqs).toEqual([undefined]); // Wait for synchronization await waitForOfflineSubkeyWrite(routingContext, dhtRecord.key); @@ -310,14 +313,17 @@ describe('VeilidRoutingContext', () => { ); expect(setValueRes).toBeUndefined(); + // Wait for synchronization + await waitForOfflineSubkeyWrite(routingContext, dhtRecord.key); + // Inspect locally const inspectRes = await routingContext.inspectDhtRecord( dhtRecord.key, ); expect(inspectRes).toBeDefined(); - expect(inspectRes.subkeys.concat(inspectRes.offline_subkeys)).toEqual([[0, 0]]); + expect(inspectRes.offline_subkeys).toEqual([]); expect(inspectRes.local_seqs).toEqual([0]); - expect(inspectRes.network_seqs).toEqual([]); + expect(inspectRes.network_seqs).toEqual([undefined]); }); }); }); diff --git a/veilid-wasm/tests/src/utils/veilid-config.ts b/veilid-wasm/tests/src/utils/veilid-config.ts index fd4ef898..b9ce4691 100644 --- a/veilid-wasm/tests/src/utils/veilid-config.ts +++ b/veilid-wasm/tests/src/utils/veilid-config.ts @@ -21,5 +21,9 @@ export const veilidCoreInitConfig: VeilidWASMConfig = { export var veilidCoreStartupConfig = (() => { var defaultConfig = JSON.parse(veilidClient.defaultConfig()); defaultConfig.program_name = 'veilid-wasm-test'; + // Ensure we are starting from scratch + defaultConfig.table_store.delete = true; + defaultConfig.protected_store.delete = true; + defaultConfig.block_store.delete = true; return defaultConfig; })(); diff --git a/veilid-wasm/tests/src/veilidClient.test.ts b/veilid-wasm/tests/src/veilidClient.test.ts index 61c9204f..8a879c2f 100644 --- a/veilid-wasm/tests/src/veilidClient.test.ts +++ b/veilid-wasm/tests/src/veilidClient.test.ts @@ -5,8 +5,8 @@ import { veilidCoreStartupConfig, } from './utils/veilid-config'; -import { VeilidState, veilidClient } from 'veilid-wasm'; -import { asyncCallWithTimeout, waitForPublicAttachment } from './utils/wait-utils'; +import { VeilidState, veilidClient } from '../../pkg/veilid_wasm'; +import { asyncCallWithTimeout, waitForDetached, waitForPublicAttachment } from './utils/wait-utils'; describe('veilidClient', function () { before('veilid startup', async function () { @@ -45,16 +45,17 @@ describe('veilidClient', function () { await veilidClient.attach(); await asyncCallWithTimeout(waitForPublicAttachment(), 10000); await veilidClient.detach(); + await asyncCallWithTimeout(waitForDetached(), 10000); }); describe('kitchen sink', function () { before('attach', async function () { await veilidClient.attach(); - await waitForPublicAttachment(); - + await asyncCallWithTimeout(waitForPublicAttachment(), 10000); }); after('detach', async function () { await veilidClient.detach(); + await asyncCallWithTimeout(waitForDetached(), 10000); }); let state: VeilidState; diff --git a/veilid-wasm/wasm_test.sh b/veilid-wasm/wasm_test.sh index d7cc848c..4c9cc45c 100755 --- a/veilid-wasm/wasm_test.sh +++ b/veilid-wasm/wasm_test.sh @@ -18,7 +18,7 @@ npm install original_tmpdir=$TMPDIR mkdir -p ~/tmp export TMPDIR=~/tmp -npm run test:headless +npm run test:headless -- $@ export TMPDIR=$original_tmpdir popd &> /dev/null