Skip to main content

ic_query/ic/model/requests/
network.rs

1//! Module: ic::model::requests::network
2//!
3//! Responsibility: bounded official Dashboard network-resource request contracts.
4//! Does not own: metrics, canister discovery, transport, or reports.
5//! Boundary: captures daily-statistics bounds and finite boundary-node resource intent.
6
7use super::IcDashboardRequest;
8
9use serde::Serialize;
10
11///
12/// IcDailyStatsQuery
13///
14/// One explicitly bounded official Dashboard daily-statistics query.
15///
16
17#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
18pub struct IcDailyStatsQuery {
19    /// Inclusive query start as Unix seconds.
20    pub start_unix_secs: u64,
21    /// Inclusive query end as Unix seconds.
22    pub end_unix_secs: u64,
23}
24
25impl IcDailyStatsQuery {
26    /// Construct one explicit daily-statistics query window.
27    #[must_use]
28    pub const fn new(start_unix_secs: u64, end_unix_secs: u64) -> Self {
29        Self {
30            start_unix_secs,
31            end_unix_secs,
32        }
33    }
34}
35
36///
37/// IcDailyStatsRequest
38///
39/// Request accepted by the bounded official Dashboard daily-statistics builder.
40///
41
42#[derive(Clone, Debug, Eq, PartialEq)]
43pub struct IcDailyStatsRequest {
44    /// Explicit Dashboard endpoint and caller collection clock.
45    pub dashboard: IcDashboardRequest,
46    /// Explicitly bounded daily-statistics query.
47    pub query: IcDailyStatsQuery,
48}
49
50impl IcDailyStatsRequest {
51    /// Construct one bounded live Dashboard daily-statistics request.
52    #[must_use]
53    pub const fn new(dashboard: IcDashboardRequest, query: IcDailyStatsQuery) -> Self {
54        Self { dashboard, query }
55    }
56}