Skip to main content

nominal_api/conjure/objects/scout/datasource/connection/api/
timestream_scraping_config.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct TimestreamScrapingConfig {
16    #[builder(default, list(item(type = super::TimestreamScrapingFilter)))]
17    #[serde(rename = "filter", skip_serializing_if = "Vec::is_empty", default)]
18    filter: Vec<super::TimestreamScrapingFilter>,
19    #[builder(default, list(item(type = super::TimestreamChannelNameComponent)))]
20    #[serde(
21        rename = "channelNameComponents",
22        skip_serializing_if = "Vec::is_empty",
23        default
24    )]
25    channel_name_components: Vec<super::TimestreamChannelNameComponent>,
26    #[builder(into)]
27    #[serde(rename = "separator")]
28    separator: String,
29    #[builder(default, into)]
30    #[serde(
31        rename = "maxLookBackPeriodHours",
32        skip_serializing_if = "Option::is_none",
33        default
34    )]
35    max_look_back_period_hours: Option<i32>,
36}
37impl TimestreamScrapingConfig {
38    /// Constructs a new instance of the type.
39    #[inline]
40    pub fn new(separator: impl Into<String>) -> Self {
41        Self::builder().separator(separator).build()
42    }
43    /// In order for data to be picked up by the scraper, it must match all
44    /// filters in this list.
45    #[inline]
46    pub fn filter(&self) -> &[super::TimestreamScrapingFilter] {
47        &*self.filter
48    }
49    /// channelNameComponents will be combined, together with separator, to form
50    /// a fully qualified channel name.
51    #[inline]
52    pub fn channel_name_components(&self) -> &[super::TimestreamChannelNameComponent] {
53        &*self.channel_name_components
54    }
55    #[inline]
56    pub fn separator(&self) -> &str {
57        &*self.separator
58    }
59    /// The maximum time in hours to look back over series data to find unique measure and tag combinations.
60    /// If not specified, the default look back period will be used.
61    #[inline]
62    pub fn max_look_back_period_hours(&self) -> Option<i32> {
63        self.max_look_back_period_hours.as_ref().map(|o| *o)
64    }
65}