ic_query/nns/node/report/model/
request.rs1use std::path::PathBuf;
2
3#[derive(Clone, Debug, Eq, PartialEq)]
7pub struct NnsNodeCacheRequest {
8 pub icp_root: PathBuf,
9 pub network: String,
10}
11
12#[derive(Clone, Debug, Eq, PartialEq)]
16pub struct NnsNodeListRequest {
17 pub cache: NnsNodeCacheRequest,
18 pub source_endpoint: String,
19 pub now_unix_secs: u64,
20 pub filters: NnsNodeListFilters,
21}
22
23#[derive(Clone, Debug, Eq, PartialEq)]
27pub struct NnsNodeInfoRequest {
28 pub cache: NnsNodeCacheRequest,
29 pub source_endpoint: String,
30 pub input: String,
31 pub now_unix_secs: u64,
32}
33
34#[cfg(feature = "host")]
38#[derive(Clone, Debug, Eq, PartialEq)]
39pub struct NnsNodeRefreshRequest {
40 pub cache: NnsNodeCacheRequest,
41 pub source_endpoint: String,
42 pub now_unix_secs: u64,
43 pub lock_stale_after_seconds: u64,
44 pub dry_run: bool,
45 pub output_path: Option<PathBuf>,
46}
47
48#[cfg(feature = "host")]
49impl_nns_leaf_cache_and_refresh_requests!(NnsNodeCacheRequest, NnsNodeRefreshRequest);
50
51#[derive(Clone, Debug, Default, Eq, PartialEq)]
55pub struct NnsNodeListFilters {
56 pub subnet: Option<String>,
57 pub subnet_kind: Option<String>,
58 pub data_center: Option<String>,
59 pub node_provider: Option<String>,
60 pub node_operator: Option<String>,
61}
62
63impl NnsNodeListFilters {
64 #[must_use]
65 pub const fn is_empty(&self) -> bool {
66 self.subnet.is_none()
67 && self.subnet_kind.is_none()
68 && self.data_center.is_none()
69 && self.node_provider.is_none()
70 && self.node_operator.is_none()
71 }
72}