Skip to main content

ic_query/ic/model/
reports.rs

1//! Module: ic::model::reports
2//!
3//! Responsibility: public serialized Dashboard report, row, and provenance contracts.
4//! Does not own: requests, host source data, errors, transport, or projection.
5//! Boundary: preserves raw Dashboard values and explicit off-chain provenance.
6
7use super::requests::{
8    IcCanisterFilters, IcDailyStatsQuery, IcIcrcAccountListQuery, IcIcrcHolderListQuery,
9    IcIcrcIndexedCountKind, IcIcrcTokenValueQuery, IcIcrcTotalSupplyQuery, IcMetricQuery,
10    IcNodeProviderRewardHistoryQuery, IcNodeProviderRewardListQuery, IcReplicaVersionListQuery,
11};
12use serde::Serialize;
13use std::{collections::BTreeMap, fmt};
14
15///
16/// IcCanisterUpgrade
17///
18/// One proposal-linked canister upgrade recorded by the Dashboard API.
19///
20
21#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
22pub struct IcCanisterUpgrade {
23    /// Proposal execution time as raw Unix seconds.
24    pub executed_timestamp_seconds: u64,
25    /// Wasm module hash as raw lowercase hexadecimal text.
26    pub module_hash: String,
27    /// NNS proposal that installed this module.
28    pub proposal_id: u64,
29}
30
31///
32/// IcDashboardReportProvenance
33///
34/// Shared off-chain provenance and authority guarantees for Dashboard reports.
35///
36
37#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
38pub struct IcDashboardReportProvenance {
39    /// Report schema version.
40    pub schema_version: u32,
41    /// Network represented by the official Dashboard API.
42    pub network: String,
43    /// Authority that supplied the report fields.
44    pub authority: String,
45    /// Dashboard API base endpoint queried by the source.
46    pub source_endpoint: String,
47    /// Time this report was collected.
48    pub fetched_at: String,
49    /// Collector identity.
50    pub fetched_by: String,
51    /// Whether the API response is cryptographically certified IC state.
52    pub certified: bool,
53    /// Whether every returned value is guaranteed to describe one point in time.
54    pub point_in_time_guaranteed: bool,
55}
56
57///
58/// IcMetricObservation
59///
60/// One raw timestamp and value returned by the Dashboard Metrics API.
61///
62
63#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
64pub struct IcMetricObservation {
65    /// Observation timestamp as Unix seconds.
66    pub timestamp_unix_secs: u64,
67    /// Raw value string returned by the Dashboard.
68    pub value: String,
69}
70
71///
72/// IcMetricSeries
73///
74/// One named raw series in a Dashboard metric response.
75///
76
77#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
78pub struct IcMetricSeries {
79    /// Raw Dashboard response field that names this series.
80    pub name: String,
81    /// Observations in strictly increasing timestamp order.
82    pub observations: Vec<IcMetricObservation>,
83}
84
85///
86/// IcMetricReport
87///
88/// One bounded time-series response from the official Dashboard Metrics API.
89///
90
91#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
92pub struct IcMetricReport {
93    /// Shared Dashboard provenance, flattened in serialized report JSON.
94    #[serde(flatten)]
95    pub provenance: IcDashboardReportProvenance,
96    /// Metric and explicit time-series bounds, flattened in report JSON.
97    #[serde(flatten)]
98    pub query: IcMetricQuery,
99    /// Number of named series returned by the API.
100    pub returned_series_count: usize,
101    /// Total number of observations across all returned series.
102    pub returned_observation_count: usize,
103    /// Raw named time series in canonical series-name order.
104    pub series: Vec<IcMetricSeries>,
105}
106
107///
108/// IcIcrcTotalSupplyObservation
109///
110/// One raw ICRC ledger total-supply observation returned by the Dashboard API.
111///
112
113#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
114pub struct IcIcrcTotalSupplyObservation {
115    /// Observation timestamp as Unix seconds.
116    pub timestamp_unix_secs: u64,
117    /// Raw total supply in ledger base units.
118    pub total_supply_base_units: String,
119}
120
121///
122/// IcIcrcTotalSupplyReport
123///
124/// One bounded total-supply series from the official Dashboard ICRC API.
125///
126
127#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
128pub struct IcIcrcTotalSupplyReport {
129    /// Shared Dashboard provenance, flattened in serialized report JSON.
130    #[serde(flatten)]
131    pub provenance: IcDashboardReportProvenance,
132    /// Canonical ICRC ledger canister principal requested from the API.
133    pub ledger_canister_id: String,
134    /// Exact requested time bounds, flattened in report JSON.
135    #[serde(flatten)]
136    pub query: IcIcrcTotalSupplyQuery,
137    /// Maximum observations implied by the requested inclusive window.
138    pub requested_observation_limit: u64,
139    /// Number of observations returned by the API.
140    pub returned_observation_count: usize,
141    /// Raw observations in strictly increasing timestamp order.
142    pub observations: Vec<IcIcrcTotalSupplyObservation>,
143}
144
145///
146/// IcIcrcIndexedCountReport
147///
148/// One current scalar count from the official Dashboard ICRC index.
149///
150
151#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
152pub struct IcIcrcIndexedCountReport {
153    /// Shared Dashboard provenance, flattened in serialized report JSON.
154    #[serde(flatten)]
155    pub provenance: IcDashboardReportProvenance,
156    /// Canonical ICRC ledger canister principal requested from the API.
157    pub ledger_canister_id: String,
158    /// Indexed resource represented by this count.
159    pub kind: IcIcrcIndexedCountKind,
160    /// Number of matching resources currently represented by the Dashboard index.
161    pub total: u64,
162}
163
164///
165/// IcIcrcAccountRow
166///
167/// One account record maintained by the official ICRC index.
168///
169
170#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
171pub struct IcIcrcAccountRow {
172    /// Opaque stable account id used for exact API follow-up.
173    pub account_id: String,
174    /// Canonical account owner principal.
175    pub owner: String,
176    /// Raw subaccount text returned by the API; empty denotes the default subaccount.
177    pub subaccount: String,
178    /// Raw current indexed balance in ledger base units.
179    pub balance_base_units: String,
180    /// Number of indexed transactions involving this account.
181    pub total_transactions: u64,
182    /// Account creation timestamp normalized to Unix seconds.
183    pub created_at_unix_secs: u64,
184    /// Nanoseconds below the normalized creation second, preserving upstream precision.
185    pub created_at_subsec_nanos: u32,
186    /// Canonical ledger canister principal carried by the row.
187    pub ledger_canister_id: String,
188    /// Latest indexed transaction involving this account.
189    pub latest_transaction_index: u64,
190    /// Raw Dashboard database update timestamp.
191    pub dashboard_updated_at: String,
192    /// Whether the account is currently classified as an active fee collector.
193    pub active_fee_collector: bool,
194    /// Raw fee-collector block-range arrays returned by the Dashboard.
195    pub fee_collector_block_ranges: Vec<Vec<serde_json::Value>>,
196}
197
198///
199/// IcIcrcAccountListReport
200///
201/// One explicitly bounded account-index page from the official ICRC API.
202///
203
204#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
205pub struct IcIcrcAccountListReport {
206    /// Shared Dashboard provenance, flattened in serialized report JSON.
207    #[serde(flatten)]
208    pub provenance: IcDashboardReportProvenance,
209    /// Canonical ICRC ledger canister principal requested from the API.
210    pub ledger_canister_id: String,
211    /// Exact page query, flattened in report JSON.
212    #[serde(flatten)]
213    pub query: IcIcrcAccountListQuery,
214    /// Number of account rows returned in this page.
215    pub returned_count: usize,
216    /// Opaque cursor for an explicit preceding-page request.
217    pub previous_cursor: Option<String>,
218    /// Opaque cursor for an explicit following-page request.
219    pub next_cursor: Option<String>,
220    /// Account rows in the exact order returned by the API.
221    pub rows: Vec<IcIcrcAccountRow>,
222}
223
224///
225/// IcIcrcAccountInfoReport
226///
227/// One exact account record from the official ICRC API.
228///
229
230#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
231pub struct IcIcrcAccountInfoReport {
232    /// Shared Dashboard provenance, flattened in serialized report JSON.
233    #[serde(flatten)]
234    pub provenance: IcDashboardReportProvenance,
235    /// Exact account record, flattened in serialized report JSON.
236    #[serde(flatten)]
237    pub account: IcIcrcAccountRow,
238}
239
240///
241/// IcIcrcHolderRow
242///
243/// One principal-level holder aggregate maintained by the official ICRC index.
244///
245
246#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
247pub struct IcIcrcHolderRow {
248    /// Canonical holder principal.
249    pub principal: String,
250    /// Raw aggregate balance in ledger base units.
251    pub balance_base_units: String,
252    /// Number of indexed transactions across the holder's accounts.
253    pub total_transactions: u64,
254    /// Earliest indexed account creation timestamp normalized to Unix seconds.
255    pub created_at_unix_secs: u64,
256    /// Nanoseconds below the normalized creation second, preserving upstream precision.
257    pub created_at_subsec_nanos: u32,
258    /// Canonical ledger canister principal carried by the row.
259    pub ledger_canister_id: String,
260    /// Latest indexed transaction across the holder's accounts.
261    pub latest_transaction_index: u64,
262    /// Raw numeric supply percentage returned by the Dashboard.
263    pub percentage: serde_json::Value,
264    /// Raw nullable USD value returned by the Dashboard.
265    pub value_usd: serde_json::Value,
266    /// Raw Dashboard database update timestamp.
267    pub dashboard_updated_at: String,
268}
269
270///
271/// IcIcrcHolderListReport
272///
273/// One explicitly bounded holder-index page from the official ICRC API.
274///
275
276#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
277pub struct IcIcrcHolderListReport {
278    /// Shared Dashboard provenance, flattened in serialized report JSON.
279    #[serde(flatten)]
280    pub provenance: IcDashboardReportProvenance,
281    /// Canonical ICRC ledger canister principal requested from the API.
282    pub ledger_canister_id: String,
283    /// Exact page query, flattened in report JSON.
284    #[serde(flatten)]
285    pub query: IcIcrcHolderListQuery,
286    /// Number of holder rows returned in this page.
287    pub returned_count: usize,
288    /// Opaque cursor for an explicit preceding-page request.
289    pub previous_cursor: Option<String>,
290    /// Opaque cursor for an explicit following-page request.
291    pub next_cursor: Option<String>,
292    /// Holder rows in the exact order returned by the API.
293    pub rows: Vec<IcIcrcHolderRow>,
294}
295
296///
297/// IcIcrcTokenValueRow
298///
299/// One raw externally sourced token-value record returned by the Dashboard API.
300///
301
302#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
303pub struct IcIcrcTokenValueRow {
304    /// Raw legacy price field in USD, when returned.
305    pub price: Option<String>,
306    /// Raw legacy 24-hour volume field in USD, when returned.
307    pub volume_24h: Option<String>,
308    /// Raw explicit price-in-USD field, when returned.
309    pub price_usd: Option<String>,
310    /// Raw explicit 24-hour volume-in-USD field, when returned.
311    pub volume_24h_usd: Option<String>,
312    /// External value provider named by the Dashboard, when returned.
313    pub source: Option<String>,
314    /// External value-provider URL returned by the Dashboard, when present.
315    pub source_url: Option<String>,
316    /// Observation timestamp as Unix seconds.
317    pub timestamp_unix_secs: u64,
318}
319
320///
321/// IcIcrcTokenValueReport
322///
323/// One bounded token-value series from the official Dashboard ICRC API.
324///
325
326#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
327pub struct IcIcrcTokenValueReport {
328    /// Shared Dashboard provenance, flattened in serialized report JSON.
329    #[serde(flatten)]
330    pub provenance: IcDashboardReportProvenance,
331    /// Canonical ICRC ledger canister principal requested from the API.
332    pub ledger_canister_id: String,
333    /// Exact requested time and row bounds, flattened in report JSON.
334    #[serde(flatten)]
335    pub query: IcIcrcTokenValueQuery,
336    /// Number of rows returned by the API.
337    pub returned_row_count: usize,
338    /// Whether the response reached the requested limit and may be truncated.
339    pub limit_reached: bool,
340    /// Raw token-value rows in nondecreasing timestamp order.
341    pub rows: Vec<IcIcrcTokenValueRow>,
342}
343
344///
345/// IcDailyStatsRow
346///
347/// Selected raw daily network-activity values returned by the Dashboard API.
348///
349
350#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
351pub struct IcDailyStatsRow {
352    /// Raw UTC calendar day returned by the Dashboard.
353    pub day: String,
354    /// Observation timestamp as Unix seconds.
355    pub timestamp_unix_secs: u64,
356    /// Raw average query-transaction rate.
357    pub average_query_transactions_per_second: String,
358    /// Raw average update-transaction rate.
359    pub average_update_transactions_per_second: String,
360    /// Raw average total-transaction rate.
361    pub average_transactions_per_second: String,
362    /// Raw maximum query-transaction rate.
363    pub max_query_transactions_per_second: String,
364    /// Raw maximum update-transaction rate.
365    pub max_update_transactions_per_second: String,
366    /// Raw maximum total-transaction rate.
367    pub max_total_transactions_per_second: String,
368    /// Raw average block-production rate.
369    pub blocks_per_second_average: String,
370}
371
372///
373/// IcDailyStatsReport
374///
375/// One bounded daily network-activity response from the official Dashboard API.
376///
377
378#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
379pub struct IcDailyStatsReport {
380    /// Shared Dashboard provenance, flattened in serialized report JSON.
381    #[serde(flatten)]
382    pub provenance: IcDashboardReportProvenance,
383    /// Exact requested time bounds, flattened in report JSON.
384    #[serde(flatten)]
385    pub query: IcDailyStatsQuery,
386    /// Number of daily rows returned by the API.
387    pub returned_day_count: usize,
388    /// Rows in strictly increasing timestamp order.
389    pub rows: Vec<IcDailyStatsRow>,
390}
391
392///
393/// IcBoundaryNodeDataCenterRow
394///
395/// One raw data-center aggregate returned by the boundary-node API.
396///
397
398#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
399pub struct IcBoundaryNodeDataCenterRow {
400    /// Dashboard data-center identifier.
401    pub dc_id: String,
402    /// Raw data-center display name.
403    pub name: String,
404    /// Raw infrastructure-owner label.
405    pub owner: String,
406    /// Raw Dashboard region label.
407    pub region: String,
408    /// Raw decimal latitude.
409    pub latitude: String,
410    /// Raw decimal longitude.
411    pub longitude: String,
412    /// Raw decimal count of boundary nodes assigned to this data center.
413    pub total_nodes: String,
414}
415
416///
417/// IcBoundaryNodeDataCentersReport
418///
419/// One complete response from the official boundary-node data-center resource.
420///
421
422#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
423pub struct IcBoundaryNodeDataCentersReport {
424    /// Shared Dashboard provenance, flattened in serialized report JSON.
425    #[serde(flatten)]
426    pub provenance: IcDashboardReportProvenance,
427    /// Number of data-center rows returned by the API.
428    pub data_center_count: usize,
429    /// Sum of the raw per-data-center boundary-node counts.
430    pub total_node_count: u64,
431    /// Rows in canonical data-center-id order, including zero-node locations.
432    pub rows: Vec<IcBoundaryNodeDataCenterRow>,
433}
434
435///
436/// IcNodeProviderRewardXdrConversionRate
437///
438/// XDR conversion-rate evidence recorded with one node-provider reward.
439///
440
441#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
442pub struct IcNodeProviderRewardXdrConversionRate {
443    /// Conversion-rate timestamp as Unix seconds, when present in the record.
444    #[serde(skip_serializing_if = "Option::is_none")]
445    pub timestamp_unix_secs: Option<u64>,
446    /// XDR per ICP multiplied by 10,000, when present in the record.
447    #[serde(skip_serializing_if = "Option::is_none")]
448    pub xdr_permyriad_per_icp: Option<u64>,
449}
450
451///
452/// IcNodeProviderRewardRow
453///
454/// One raw node-provider reward record returned by the official Dashboard API.
455///
456
457#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
458pub struct IcNodeProviderRewardRow {
459    /// Dashboard reward record id.
460    pub reward_id: u64,
461    /// Reward amount in raw ICP e8s.
462    pub amount_e8s: u64,
463    /// Mode-specific raw reward details preserved as a JSON object.
464    pub details: BTreeMap<String, serde_json::Value>,
465    /// Maximum node-provider reward in e8s used for this record, when available.
466    pub maximum_node_provider_rewards_e8s: Option<u64>,
467    /// Minimum XDR-permyriad-per-ICP floor used for this record, when available.
468    pub minimum_xdr_permyriad_per_icp: Option<u64>,
469    /// Canonical node-provider principal.
470    pub node_provider_id: String,
471    /// NNS proposal associated with this reward, when recorded by the Dashboard.
472    pub proposal_id: Option<u64>,
473    /// Registry version associated with this reward, when recorded by the Dashboard.
474    pub registry_version: Option<u64>,
475    /// Raw mode name so additive Dashboard reward modes remain visible.
476    pub reward_mode: String,
477    /// Reward timestamp as Unix seconds.
478    pub reward_timestamp_unix_secs: u64,
479    /// Raw Dashboard database update timestamp.
480    pub dashboard_updated_at: String,
481    /// XDR conversion-rate evidence, empty for historical records that predate it.
482    pub xdr_conversion_rate: IcNodeProviderRewardXdrConversionRate,
483}
484
485///
486/// IcNodeProviderRewardListReport
487///
488/// One explicitly bounded node-provider reward page from the official Dashboard API.
489///
490
491#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
492pub struct IcNodeProviderRewardListReport {
493    /// Shared Dashboard provenance, flattened in serialized report JSON.
494    #[serde(flatten)]
495    pub provenance: IcDashboardReportProvenance,
496    /// Exact requested page bounds, flattened in report JSON.
497    #[serde(flatten)]
498    pub query: IcNodeProviderRewardListQuery,
499    /// Reward-index ceiling selected by the Dashboard for this page series.
500    pub resolved_max_reward_index: u64,
501    /// Number of reward records matching the selected reward-index ceiling.
502    pub total_reward_records: u64,
503    /// Number of rows returned in this page.
504    pub returned_count: usize,
505    /// Arithmetic offset hint for an explicit later request, when more records remain.
506    pub next_offset_hint: Option<u64>,
507    /// Whether adjacent upstream offset pages can contain overlapping record ids.
508    pub pages_may_overlap: bool,
509    /// Reward rows in the exact order returned by the Dashboard.
510    pub rows: Vec<IcNodeProviderRewardRow>,
511}
512
513///
514/// IcNodeProviderRewardInfoReport
515///
516/// One exact node-provider reward record from the official Dashboard API.
517///
518
519#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
520pub struct IcNodeProviderRewardInfoReport {
521    /// Shared Dashboard provenance, flattened in serialized report JSON.
522    #[serde(flatten)]
523    pub provenance: IcDashboardReportProvenance,
524    /// Exact reward record, flattened in serialized report JSON.
525    #[serde(flatten)]
526    pub reward: IcNodeProviderRewardRow,
527}
528
529///
530/// IcNodeProviderRewardHistoryObservation
531///
532/// One aggregate reward amount returned by the Dashboard history endpoint.
533///
534
535#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
536pub struct IcNodeProviderRewardHistoryObservation {
537    /// Observation timestamp as Unix seconds.
538    pub timestamp_unix_secs: u64,
539    /// Aggregate node-provider reward amount in raw ICP e8s.
540    pub amount_e8s: u64,
541}
542
543///
544/// IcNodeProviderRewardHistoryReport
545///
546/// One bounded aggregate node-provider reward history response.
547///
548
549#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
550pub struct IcNodeProviderRewardHistoryReport {
551    /// Shared Dashboard provenance, flattened in serialized report JSON.
552    #[serde(flatten)]
553    pub provenance: IcDashboardReportProvenance,
554    /// Exact requested history bounds, flattened in report JSON.
555    #[serde(flatten)]
556    pub query: IcNodeProviderRewardHistoryQuery,
557    /// Maximum observations implied by the requested inclusive window.
558    pub requested_observation_limit: u64,
559    /// Number of observations returned by the API.
560    pub returned_observation_count: usize,
561    /// Aggregate observations in strictly increasing timestamp order.
562    pub observations: Vec<IcNodeProviderRewardHistoryObservation>,
563}
564
565///
566/// IcReplicaVersionStatus
567///
568/// Raw lifecycle status exposed by the official Dashboard release index.
569///
570
571#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize)]
572#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
573pub enum IcReplicaVersionStatus {
574    /// The election proposal has been adopted but not executed.
575    Adopted,
576    /// The election proposal has executed.
577    Executed,
578    /// The election proposal remains open.
579    Open,
580}
581
582impl IcReplicaVersionStatus {
583    /// Return the exact official Dashboard query value.
584    #[must_use]
585    pub const fn as_dashboard_value(self) -> &'static str {
586        match self {
587            Self::Adopted => "ADOPTED",
588            Self::Executed => "EXECUTED",
589            Self::Open => "OPEN",
590        }
591    }
592}
593
594impl fmt::Display for IcReplicaVersionStatus {
595    fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
596        formatter.write_str(self.as_dashboard_value())
597    }
598}
599
600///
601/// IcReplicaVersionSubnetRollout
602///
603/// One Dashboard-recorded proposal assigning a Subnet to a replica version.
604///
605
606#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
607pub struct IcReplicaVersionSubnetRollout {
608    /// Canonical Subnet principal.
609    pub subnet_id: String,
610    /// NNS proposal that assigned the Subnet to this version.
611    pub proposal_id: u64,
612    /// Proposal execution time as raw Unix seconds.
613    pub executed_timestamp_seconds: u64,
614}
615
616///
617/// IcReplicaVersionListRow
618///
619/// One release-election row from a bounded official Dashboard page.
620///
621
622#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
623pub struct IcReplicaVersionListRow {
624    /// Lowercase hexadecimal replica-version identifier.
625    pub replica_version_id: String,
626    /// NNS proposal that elected this version.
627    pub proposal_id: u64,
628    /// Election proposal execution time, or zero before execution.
629    pub executed_timestamp_seconds: u64,
630    /// Raw Dashboard proposal lifecycle status.
631    pub status: IcReplicaVersionStatus,
632    /// Raw proposal title.
633    pub title: String,
634    /// Raw proposal discussion URL.
635    pub url: String,
636    /// Number of Dashboard-recorded Subnet assignments.
637    pub subnet_count: usize,
638    /// Dashboard-recorded Subnet assignments in execution order.
639    pub subnets: Vec<IcReplicaVersionSubnetRollout>,
640}
641
642///
643/// IcReplicaVersionListReport
644///
645/// One explicitly bounded replica-version page from the official Dashboard API.
646///
647
648#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
649pub struct IcReplicaVersionListReport {
650    /// Shared Dashboard provenance, flattened in serialized report JSON.
651    #[serde(flatten)]
652    pub provenance: IcDashboardReportProvenance,
653    /// Exact requested page bounds, flattened in report JSON.
654    #[serde(flatten)]
655    pub query: IcReplicaVersionListQuery,
656    /// Proposal-index ceiling selected by the Dashboard for this page series.
657    pub resolved_max_proposal_index: u64,
658    /// Number of release records matching the selected proposal-index ceiling.
659    pub total_proposals: u64,
660    /// Number of rows returned in this page.
661    pub returned_count: usize,
662    /// Offset for an explicit next-page request, when more rows remain.
663    pub next_offset: Option<u64>,
664    /// Release rows in the Dashboard's requested descending execution-time order.
665    pub rows: Vec<IcReplicaVersionListRow>,
666}
667
668///
669/// IcReplicaVersionInfoReport
670///
671/// One exact replica-version release record from the official Dashboard API.
672///
673
674#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
675pub struct IcReplicaVersionInfoReport {
676    /// Shared Dashboard provenance, flattened in serialized report JSON.
677    #[serde(flatten)]
678    pub provenance: IcDashboardReportProvenance,
679    /// Lowercase hexadecimal replica-version identifier.
680    pub replica_version_id: String,
681    /// NNS proposal that elected this version.
682    pub proposal_id: u64,
683    /// Election proposal execution time as raw Unix seconds.
684    pub executed_timestamp_seconds: u64,
685    /// Raw proposal title.
686    pub title: String,
687    /// Raw proposal discussion URL.
688    pub url: String,
689    /// Raw release-note summary.
690    pub summary: String,
691    /// Number of Dashboard-recorded Subnet assignments.
692    pub subnet_count: usize,
693    /// Dashboard-recorded Subnet assignments in execution order.
694    pub subnets: Vec<IcReplicaVersionSubnetRollout>,
695}
696
697///
698/// IcCanisterReport
699///
700/// One live canister metadata report from the official Dashboard API.
701///
702
703#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
704pub struct IcCanisterReport {
705    /// Shared Dashboard provenance, flattened in serialized report JSON.
706    #[serde(flatten)]
707    pub provenance: IcDashboardReportProvenance,
708    /// Canonical canister principal.
709    pub canister_id: String,
710    /// Dashboard database row identifier.
711    pub dashboard_id: u64,
712    /// Raw optional Dashboard canister classification.
713    pub canister_type: Option<String>,
714    /// Raw Dashboard canister name; an empty string means no name was recorded.
715    pub name: String,
716    /// Canonical Subnet principal recorded by the Dashboard.
717    pub subnet_id: String,
718    /// Canonically ordered controller principals recorded by the Dashboard.
719    pub controllers: Vec<String>,
720    /// Raw Dashboard language label; an empty string means no language was recorded.
721    pub language: String,
722    /// Raw current module hash; an empty string means no hash was recorded.
723    pub module_hash: String,
724    /// Raw Dashboard row update timestamp.
725    pub dashboard_updated_at: String,
726    /// Number of proposal-linked upgrades when history is available.
727    pub upgrade_count: Option<usize>,
728    /// Proposal-linked upgrade history, or `None` when the Dashboard returned `null`.
729    pub upgrades: Option<Vec<IcCanisterUpgrade>>,
730}
731
732///
733/// IcCanisterCountReport
734///
735/// One filtered canister count from the official Dashboard API.
736///
737
738#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
739pub struct IcCanisterCountReport {
740    /// Shared Dashboard provenance, flattened in serialized report JSON.
741    #[serde(flatten)]
742    pub provenance: IcDashboardReportProvenance,
743    /// Filters applied by the Dashboard.
744    pub filters: IcCanisterFilters,
745    /// Number of matching Dashboard canister records.
746    pub total: u64,
747}
748
749///
750/// IcCanisterPageController
751///
752/// One controller entry returned by the Dashboard canister collection API.
753///
754
755#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
756pub struct IcCanisterPageController {
757    /// Canonical controller principal.
758    pub principal_id: String,
759    /// Raw optional Dashboard metadata associated with the controller.
760    pub raw_metadata: Option<String>,
761}
762
763///
764/// IcCanisterPageRow
765///
766/// One discovery row from a bounded Dashboard canister page.
767///
768
769#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
770pub struct IcCanisterPageRow {
771    /// Canonical canister principal.
772    pub canister_id: String,
773    /// Dashboard database row identifier.
774    pub dashboard_id: u64,
775    /// Raw optional Dashboard canister classification.
776    pub canister_type: Option<String>,
777    /// Raw Dashboard canister name.
778    pub name: String,
779    /// Canonical Subnet principal recorded by the Dashboard.
780    pub subnet_id: String,
781    /// Canonically ordered controller entries recorded by the Dashboard.
782    pub controllers: Vec<IcCanisterPageController>,
783    /// Raw Dashboard language label.
784    pub language: String,
785    /// Raw current module hash.
786    pub module_hash: String,
787    /// Raw Dashboard row update timestamp.
788    pub dashboard_updated_at: String,
789}
790
791///
792/// IcCanisterPageReport
793///
794/// One explicitly bounded page from the official Dashboard canister collection.
795///
796
797#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
798pub struct IcCanisterPageReport {
799    /// Shared Dashboard provenance, flattened in serialized report JSON.
800    #[serde(flatten)]
801    pub provenance: IcDashboardReportProvenance,
802    /// Filters applied by the Dashboard.
803    pub filters: IcCanisterFilters,
804    /// Maximum rows requested from the API.
805    pub requested_limit: u16,
806    /// Number of rows returned in this report.
807    pub returned_count: usize,
808    /// Exclusive forward cursor supplied to this request.
809    pub after: Option<String>,
810    /// Exclusive backward cursor supplied to this request.
811    pub before: Option<String>,
812    /// Cursor for an explicit request for the preceding page.
813    pub previous_cursor: Option<String>,
814    /// Cursor for an explicit request for the following page.
815    pub next_cursor: Option<String>,
816    /// Canister discovery rows in Dashboard canister-id order.
817    pub rows: Vec<IcCanisterPageRow>,
818}