Skip to main content

ic_query/sns/report/model/requests/
list.rs

1//! Module: sns::report::model::requests::list
2//!
3//! Responsibility: request DTO for deployed SNS list reports.
4//! Does not own: command option parsing, source lookup, or text rendering.
5//! Boundary: carries validated command inputs into the list report builder.
6
7use crate::sns::report::SnsListSort;
8
9///
10/// SnsListRequest
11///
12/// Request accepted by the deployed SNS list report builder.
13///
14
15#[derive(Clone, Debug, Eq, PartialEq)]
16pub struct SnsListRequest {
17    pub network: String,
18    pub source_endpoint: String,
19    pub now_unix_secs: u64,
20    pub verbose: bool,
21    pub sort: SnsListSort,
22}
23
24impl SnsListRequest {
25    #[must_use]
26    pub fn new(
27        network: impl Into<String>,
28        source_endpoint: impl Into<String>,
29        now_unix_secs: u64,
30    ) -> Self {
31        Self {
32            network: network.into(),
33            source_endpoint: source_endpoint.into(),
34            now_unix_secs,
35            verbose: false,
36            sort: SnsListSort::default(),
37        }
38    }
39
40    #[must_use]
41    pub const fn with_verbose(mut self, verbose: bool) -> Self {
42        self.verbose = verbose;
43        self
44    }
45
46    #[must_use]
47    pub const fn with_sort(mut self, sort: SnsListSort) -> Self {
48        self.sort = sort;
49        self
50    }
51}