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    /// Whether to include SNS instances outside the normal visible lifecycle set.
21    pub all_lifecycles: bool,
22    pub verbose: bool,
23    pub sort: SnsListSort,
24}
25
26impl SnsListRequest {
27    #[must_use]
28    pub fn new(
29        network: impl Into<String>,
30        source_endpoint: impl Into<String>,
31        now_unix_secs: u64,
32    ) -> Self {
33        Self {
34            network: network.into(),
35            source_endpoint: source_endpoint.into(),
36            now_unix_secs,
37            all_lifecycles: false,
38            verbose: false,
39            sort: SnsListSort::default(),
40        }
41    }
42
43    #[must_use]
44    pub const fn with_verbose(mut self, verbose: bool) -> Self {
45        self.verbose = verbose;
46        self
47    }
48
49    /// Sets whether the list view includes every lifecycle represented in the catalog.
50    #[must_use]
51    pub const fn with_all_lifecycles(mut self, all_lifecycles: bool) -> Self {
52        self.all_lifecycles = all_lifecycles;
53        self
54    }
55
56    #[must_use]
57    pub const fn with_sort(mut self, sort: SnsListSort) -> Self {
58        self.sort = sort;
59        self
60    }
61}