use super::{
reports::{
IcBoundaryNodeDataCenterRow, IcCanisterPageRow, IcCanisterUpgrade, IcDailyStatsRow,
IcMetricSeries,
},
requests::{IcCanisterFilters, IcDailyStatsQuery, IcMetricQuery},
};
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct IcSourceRequest {
pub endpoint: String,
pub fetched_at: String,
pub fetched_by: String,
}
impl IcSourceRequest {
#[must_use]
pub fn new(
endpoint: impl Into<String>,
fetched_at: impl Into<String>,
fetched_by: impl Into<String>,
) -> Self {
Self {
endpoint: endpoint.into(),
fetched_at: fetched_at.into(),
fetched_by: fetched_by.into(),
}
}
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct IcCanisterSourceData {
pub source: IcSourceRequest,
pub canister_id: String,
pub dashboard_id: u64,
pub canister_type: Option<String>,
pub name: String,
pub subnet_id: String,
pub controllers: Vec<String>,
pub language: String,
pub module_hash: String,
pub dashboard_updated_at: String,
pub upgrades: Option<Vec<IcCanisterUpgrade>>,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct IcCanisterCountSourceData {
pub source: IcSourceRequest,
pub filters: IcCanisterFilters,
pub total: u64,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct IcCanisterPageSourceData {
pub source: IcSourceRequest,
pub filters: IcCanisterFilters,
pub requested_limit: u16,
pub after: Option<String>,
pub before: Option<String>,
pub previous_cursor: Option<String>,
pub next_cursor: Option<String>,
pub rows: Vec<IcCanisterPageRow>,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct IcMetricSourceData {
pub source: IcSourceRequest,
pub query: IcMetricQuery,
pub series: Vec<IcMetricSeries>,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct IcDailyStatsSourceData {
pub source: IcSourceRequest,
pub query: IcDailyStatsQuery,
pub rows: Vec<IcDailyStatsRow>,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct IcBoundaryNodeDataCentersSourceData {
pub source: IcSourceRequest,
pub rows: Vec<IcBoundaryNodeDataCenterRow>,
}