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, serde::Deserialize)]
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, serde::Deserialize, Serialize)]
351pub struct IcDailyStatsRow {
352 /// Raw UTC calendar day returned by the Dashboard.
353 pub day: String,
354 /// Observation timestamp as Unix seconds.
355 #[serde(rename(deserialize = "timestamp"))]
356 pub timestamp_unix_secs: u64,
357 /// Raw average query-transaction rate.
358 pub average_query_transactions_per_second: String,
359 /// Raw average update-transaction rate.
360 pub average_update_transactions_per_second: String,
361 /// Raw average total-transaction rate.
362 pub average_transactions_per_second: String,
363 /// Raw maximum query-transaction rate.
364 pub max_query_transactions_per_second: String,
365 /// Raw maximum update-transaction rate.
366 pub max_update_transactions_per_second: String,
367 /// Raw maximum total-transaction rate.
368 pub max_total_transactions_per_second: String,
369 /// Raw average block-production rate.
370 pub blocks_per_second_average: String,
371}
372
373///
374/// IcDailyStatsReport
375///
376/// One bounded daily network-activity response from the official Dashboard API.
377///
378
379#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
380pub struct IcDailyStatsReport {
381 /// Shared Dashboard provenance, flattened in serialized report JSON.
382 #[serde(flatten)]
383 pub provenance: IcDashboardReportProvenance,
384 /// Exact requested time bounds, flattened in report JSON.
385 #[serde(flatten)]
386 pub query: IcDailyStatsQuery,
387 /// Number of daily rows returned by the API.
388 pub returned_day_count: usize,
389 /// Rows in strictly increasing timestamp order.
390 pub rows: Vec<IcDailyStatsRow>,
391}
392
393///
394/// IcBoundaryNodeDataCenterRow
395///
396/// One raw data-center aggregate returned by the boundary-node API.
397///
398
399#[derive(Clone, Debug, Eq, PartialEq, Serialize, serde::Deserialize)]
400pub struct IcBoundaryNodeDataCenterRow {
401 /// Dashboard data-center identifier.
402 pub dc_id: String,
403 /// Raw data-center display name.
404 pub name: String,
405 /// Raw infrastructure-owner label.
406 pub owner: String,
407 /// Raw Dashboard region label.
408 pub region: String,
409 /// Raw decimal latitude.
410 pub latitude: String,
411 /// Raw decimal longitude.
412 pub longitude: String,
413 /// Raw decimal count of boundary nodes assigned to this data center.
414 pub total_nodes: String,
415}
416
417///
418/// IcBoundaryNodeDataCentersReport
419///
420/// One complete response from the official boundary-node data-center resource.
421///
422
423#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
424pub struct IcBoundaryNodeDataCentersReport {
425 /// Shared Dashboard provenance, flattened in serialized report JSON.
426 #[serde(flatten)]
427 pub provenance: IcDashboardReportProvenance,
428 /// Number of data-center rows returned by the API.
429 pub data_center_count: usize,
430 /// Sum of the raw per-data-center boundary-node counts.
431 pub total_node_count: u64,
432 /// Rows in canonical data-center-id order, including zero-node locations.
433 pub rows: Vec<IcBoundaryNodeDataCenterRow>,
434}
435
436///
437/// IcNodeProviderRewardXdrConversionRate
438///
439/// XDR conversion-rate evidence recorded with one node-provider reward.
440///
441
442#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
443pub struct IcNodeProviderRewardXdrConversionRate {
444 /// Conversion-rate timestamp as Unix seconds, when present in the record.
445 #[serde(skip_serializing_if = "Option::is_none")]
446 pub timestamp_unix_secs: Option<u64>,
447 /// XDR per ICP multiplied by 10,000, when present in the record.
448 #[serde(skip_serializing_if = "Option::is_none")]
449 pub xdr_permyriad_per_icp: Option<u64>,
450}
451
452///
453/// IcNodeProviderRewardRow
454///
455/// One raw node-provider reward record returned by the official Dashboard API.
456///
457
458#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
459pub struct IcNodeProviderRewardRow {
460 /// Dashboard reward record id.
461 pub reward_id: u64,
462 /// Reward amount in raw ICP e8s.
463 pub amount_e8s: u64,
464 /// Mode-specific raw reward details preserved as a JSON object.
465 pub details: BTreeMap<String, serde_json::Value>,
466 /// Maximum node-provider reward in e8s used for this record, when available.
467 pub maximum_node_provider_rewards_e8s: Option<u64>,
468 /// Minimum XDR-permyriad-per-ICP floor used for this record, when available.
469 pub minimum_xdr_permyriad_per_icp: Option<u64>,
470 /// Canonical node-provider principal.
471 pub node_provider_id: String,
472 /// NNS proposal associated with this reward, when recorded by the Dashboard.
473 pub proposal_id: Option<u64>,
474 /// Registry version associated with this reward, when recorded by the Dashboard.
475 pub registry_version: Option<u64>,
476 /// Raw mode name so additive Dashboard reward modes remain visible.
477 pub reward_mode: String,
478 /// Reward timestamp as Unix seconds.
479 pub reward_timestamp_unix_secs: u64,
480 /// Raw Dashboard database update timestamp.
481 pub dashboard_updated_at: String,
482 /// XDR conversion-rate evidence, empty for historical records that predate it.
483 pub xdr_conversion_rate: IcNodeProviderRewardXdrConversionRate,
484}
485
486///
487/// IcNodeProviderRewardListReport
488///
489/// One explicitly bounded node-provider reward page from the official Dashboard API.
490///
491
492#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
493pub struct IcNodeProviderRewardListReport {
494 /// Shared Dashboard provenance, flattened in serialized report JSON.
495 #[serde(flatten)]
496 pub provenance: IcDashboardReportProvenance,
497 /// Exact requested page bounds, flattened in report JSON.
498 #[serde(flatten)]
499 pub query: IcNodeProviderRewardListQuery,
500 /// Reward-index ceiling selected by the Dashboard for this page series.
501 pub resolved_max_reward_index: u64,
502 /// Number of reward records matching the selected reward-index ceiling.
503 pub total_reward_records: u64,
504 /// Number of rows returned in this page.
505 pub returned_count: usize,
506 /// Arithmetic offset hint for an explicit later request, when more records remain.
507 pub next_offset_hint: Option<u64>,
508 /// Whether adjacent upstream offset pages can contain overlapping record ids.
509 pub pages_may_overlap: bool,
510 /// Reward rows in the exact order returned by the Dashboard.
511 pub rows: Vec<IcNodeProviderRewardRow>,
512}
513
514///
515/// IcNodeProviderRewardInfoReport
516///
517/// One exact node-provider reward record from the official Dashboard API.
518///
519
520#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
521pub struct IcNodeProviderRewardInfoReport {
522 /// Shared Dashboard provenance, flattened in serialized report JSON.
523 #[serde(flatten)]
524 pub provenance: IcDashboardReportProvenance,
525 /// Exact reward record, flattened in serialized report JSON.
526 #[serde(flatten)]
527 pub reward: IcNodeProviderRewardRow,
528}
529
530///
531/// IcNodeProviderRewardHistoryObservation
532///
533/// One aggregate reward amount returned by the Dashboard history endpoint.
534///
535
536#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
537pub struct IcNodeProviderRewardHistoryObservation {
538 /// Observation timestamp as Unix seconds.
539 pub timestamp_unix_secs: u64,
540 /// Aggregate node-provider reward amount in raw ICP e8s.
541 pub amount_e8s: u64,
542}
543
544///
545/// IcNodeProviderRewardHistoryReport
546///
547/// One bounded aggregate node-provider reward history response.
548///
549
550#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
551pub struct IcNodeProviderRewardHistoryReport {
552 /// Shared Dashboard provenance, flattened in serialized report JSON.
553 #[serde(flatten)]
554 pub provenance: IcDashboardReportProvenance,
555 /// Exact requested history bounds, flattened in report JSON.
556 #[serde(flatten)]
557 pub query: IcNodeProviderRewardHistoryQuery,
558 /// Maximum observations implied by the requested inclusive window.
559 pub requested_observation_limit: u64,
560 /// Number of observations returned by the API.
561 pub returned_observation_count: usize,
562 /// Aggregate observations in strictly increasing timestamp order.
563 pub observations: Vec<IcNodeProviderRewardHistoryObservation>,
564}
565
566///
567/// IcReplicaVersionStatus
568///
569/// Raw lifecycle status exposed by the official Dashboard release index.
570///
571
572#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize)]
573#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
574pub enum IcReplicaVersionStatus {
575 /// The election proposal has been adopted but not executed.
576 Adopted,
577 /// The election proposal has executed.
578 Executed,
579 /// The election proposal remains open.
580 Open,
581}
582
583impl IcReplicaVersionStatus {
584 /// Return the exact official Dashboard query value.
585 #[must_use]
586 pub const fn as_dashboard_value(self) -> &'static str {
587 match self {
588 Self::Adopted => "ADOPTED",
589 Self::Executed => "EXECUTED",
590 Self::Open => "OPEN",
591 }
592 }
593}
594
595impl fmt::Display for IcReplicaVersionStatus {
596 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
597 formatter.write_str(self.as_dashboard_value())
598 }
599}
600
601///
602/// IcReplicaVersionSubnetRollout
603///
604/// One Dashboard-recorded proposal assigning a Subnet to a replica version.
605///
606
607#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, Serialize)]
608pub struct IcReplicaVersionSubnetRollout {
609 /// Canonical Subnet principal.
610 pub subnet_id: String,
611 /// NNS proposal that assigned the Subnet to this version.
612 pub proposal_id: u64,
613 /// Proposal execution time as raw Unix seconds.
614 pub executed_timestamp_seconds: u64,
615}
616
617///
618/// IcReplicaVersionListRow
619///
620/// One release-election row from a bounded official Dashboard page.
621///
622
623#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
624pub struct IcReplicaVersionListRow {
625 /// Lowercase hexadecimal replica-version identifier.
626 pub replica_version_id: String,
627 /// NNS proposal that elected this version.
628 pub proposal_id: u64,
629 /// Election proposal execution time, or zero before execution.
630 pub executed_timestamp_seconds: u64,
631 /// Raw Dashboard proposal lifecycle status.
632 pub status: IcReplicaVersionStatus,
633 /// Raw proposal title.
634 pub title: String,
635 /// Raw proposal discussion URL.
636 pub url: String,
637 /// Number of Dashboard-recorded Subnet assignments.
638 pub subnet_count: usize,
639 /// Dashboard-recorded Subnet assignments in execution order.
640 pub subnets: Vec<IcReplicaVersionSubnetRollout>,
641}
642
643///
644/// IcReplicaVersionListReport
645///
646/// One explicitly bounded replica-version page from the official Dashboard API.
647///
648
649#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
650pub struct IcReplicaVersionListReport {
651 /// Shared Dashboard provenance, flattened in serialized report JSON.
652 #[serde(flatten)]
653 pub provenance: IcDashboardReportProvenance,
654 /// Exact requested page bounds, flattened in report JSON.
655 #[serde(flatten)]
656 pub query: IcReplicaVersionListQuery,
657 /// Proposal-index ceiling selected by the Dashboard for this page series.
658 pub resolved_max_proposal_index: u64,
659 /// Number of release records matching the selected proposal-index ceiling.
660 pub total_proposals: u64,
661 /// Number of rows returned in this page.
662 pub returned_count: usize,
663 /// Offset for an explicit next-page request, when more rows remain.
664 pub next_offset: Option<u64>,
665 /// Release rows in the Dashboard's requested descending execution-time order.
666 pub rows: Vec<IcReplicaVersionListRow>,
667}
668
669///
670/// IcReplicaVersionInfoReport
671///
672/// One exact replica-version release record from the official Dashboard API.
673///
674
675#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
676pub struct IcReplicaVersionInfoReport {
677 /// Shared Dashboard provenance, flattened in serialized report JSON.
678 #[serde(flatten)]
679 pub provenance: IcDashboardReportProvenance,
680 /// Lowercase hexadecimal replica-version identifier.
681 pub replica_version_id: String,
682 /// NNS proposal that elected this version.
683 pub proposal_id: u64,
684 /// Election proposal execution time as raw Unix seconds.
685 pub executed_timestamp_seconds: u64,
686 /// Raw proposal title.
687 pub title: String,
688 /// Raw proposal discussion URL.
689 pub url: String,
690 /// Raw release-note summary.
691 pub summary: String,
692 /// Number of Dashboard-recorded Subnet assignments.
693 pub subnet_count: usize,
694 /// Dashboard-recorded Subnet assignments in execution order.
695 pub subnets: Vec<IcReplicaVersionSubnetRollout>,
696}
697
698///
699/// IcCanisterReport
700///
701/// One live canister metadata report from the official Dashboard API.
702///
703
704#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
705pub struct IcCanisterReport {
706 /// Shared Dashboard provenance, flattened in serialized report JSON.
707 #[serde(flatten)]
708 pub provenance: IcDashboardReportProvenance,
709 /// Canonical canister principal.
710 pub canister_id: String,
711 /// Dashboard database row identifier.
712 pub dashboard_id: u64,
713 /// Raw optional Dashboard canister classification.
714 pub canister_type: Option<String>,
715 /// Raw Dashboard canister name; an empty string means no name was recorded.
716 pub name: String,
717 /// Canonical Subnet principal recorded by the Dashboard.
718 pub subnet_id: String,
719 /// Canonically ordered controller principals recorded by the Dashboard.
720 pub controllers: Vec<String>,
721 /// Raw Dashboard language label; an empty string means no language was recorded.
722 pub language: String,
723 /// Raw current module hash; an empty string means no hash was recorded.
724 pub module_hash: String,
725 /// Raw Dashboard row update timestamp.
726 pub dashboard_updated_at: String,
727 /// Number of proposal-linked upgrades when history is available.
728 pub upgrade_count: Option<usize>,
729 /// Proposal-linked upgrade history, or `None` when the Dashboard returned `null`.
730 pub upgrades: Option<Vec<IcCanisterUpgrade>>,
731}
732
733///
734/// IcCanisterCountReport
735///
736/// One filtered canister count from the official Dashboard API.
737///
738
739#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
740pub struct IcCanisterCountReport {
741 /// Shared Dashboard provenance, flattened in serialized report JSON.
742 #[serde(flatten)]
743 pub provenance: IcDashboardReportProvenance,
744 /// Filters applied by the Dashboard.
745 pub filters: IcCanisterFilters,
746 /// Number of matching Dashboard canister records.
747 pub total: u64,
748}
749
750///
751/// IcCanisterPageController
752///
753/// One controller entry returned by the Dashboard canister collection API.
754///
755
756#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
757pub struct IcCanisterPageController {
758 /// Canonical controller principal.
759 pub principal_id: String,
760 /// Raw optional Dashboard metadata associated with the controller.
761 pub raw_metadata: Option<String>,
762}
763
764///
765/// IcCanisterPageRow
766///
767/// One discovery row from a bounded Dashboard canister page.
768///
769
770#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
771pub struct IcCanisterPageRow {
772 /// Canonical canister principal.
773 pub canister_id: String,
774 /// Dashboard database row identifier.
775 pub dashboard_id: u64,
776 /// Raw optional Dashboard canister classification.
777 pub canister_type: Option<String>,
778 /// Raw Dashboard canister name.
779 pub name: String,
780 /// Canonical Subnet principal recorded by the Dashboard.
781 pub subnet_id: String,
782 /// Canonically ordered controller entries recorded by the Dashboard.
783 pub controllers: Vec<IcCanisterPageController>,
784 /// Raw Dashboard language label.
785 pub language: String,
786 /// Raw current module hash.
787 pub module_hash: String,
788 /// Raw Dashboard row update timestamp.
789 pub dashboard_updated_at: String,
790}
791
792///
793/// IcCanisterPageReport
794///
795/// One explicitly bounded page from the official Dashboard canister collection.
796///
797
798#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
799pub struct IcCanisterPageReport {
800 /// Shared Dashboard provenance, flattened in serialized report JSON.
801 #[serde(flatten)]
802 pub provenance: IcDashboardReportProvenance,
803 /// Filters applied by the Dashboard.
804 pub filters: IcCanisterFilters,
805 /// Maximum rows requested from the API.
806 pub requested_limit: u16,
807 /// Number of rows returned in this report.
808 pub returned_count: usize,
809 /// Exclusive forward cursor supplied to this request.
810 pub after: Option<String>,
811 /// Exclusive backward cursor supplied to this request.
812 pub before: Option<String>,
813 /// Cursor for an explicit request for the preceding page.
814 pub previous_cursor: Option<String>,
815 /// Cursor for an explicit request for the following page.
816 pub next_cursor: Option<String>,
817 /// Canister discovery rows in Dashboard canister-id order.
818 pub rows: Vec<IcCanisterPageRow>,
819}