/// This config is used to scrape data from a Timescale database that has a pivoted schema.
/// time | name           | value | device
///  1   | temperature    | 1     | a
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct PivotedTimescaleScrapingConfig {
    #[builder(default, list(item(type = super::TimescaleScrapingFilter)))]
    #[serde(rename = "filter", skip_serializing_if = "Vec::is_empty", default)]
    filter: Vec<super::TimescaleScrapingFilter>,
    #[serde(rename = "timeColumn")]
    time_column: super::ColumnName,
    #[serde(rename = "nameColumn")]
    name_column: super::ColumnName,
    #[serde(rename = "valueColumn")]
    value_column: super::ColumnName,
    #[builder(default, set(item(type = super::ColumnName)))]
    #[serde(
        rename = "dimensionColumns",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    dimension_columns: std::collections::BTreeSet<super::ColumnName>,
    #[builder(default, list(item(type = super::PivotedTimescaleChannelNameComponent)))]
    #[serde(
        rename = "channelNameComponents",
        skip_serializing_if = "Vec::is_empty",
        default
    )]
    channel_name_components: Vec<super::PivotedTimescaleChannelNameComponent>,
    #[builder(into)]
    #[serde(rename = "separator")]
    separator: String,
}
impl PivotedTimescaleScrapingConfig {
    /// In order for data to be picked up by the scraper, it must match all
    /// filters in this list. To exclude chunks of data, it's possible to use
    /// a not filter.
    #[inline]
    pub fn filter(&self) -> &[super::TimescaleScrapingFilter] {
        &*self.filter
    }
    /// The name of the column that holds the timestamp.
    #[inline]
    pub fn time_column(&self) -> &super::ColumnName {
        &self.time_column
    }
    /// The name of the column that holds the series name.
    #[inline]
    pub fn name_column(&self) -> &super::ColumnName {
        &self.name_column
    }
    /// The name of the column that holds the series values.
    #[inline]
    pub fn value_column(&self) -> &super::ColumnName {
        &self.value_column
    }
    /// The names of the columns that comprise a dimension. They should have a database index for efficient filtering. We do not discover
    /// dimensions based on hypertable schema because they are not necessarily configured properly.
    #[inline]
    pub fn dimension_columns(&self) -> &std::collections::BTreeSet<super::ColumnName> {
        &self.dimension_columns
    }
    /// channelNameComponents will be combined, together with separator, to form
    /// a fully qualified channel name.
    #[inline]
    pub fn channel_name_components(
        &self,
    ) -> &[super::PivotedTimescaleChannelNameComponent] {
        &*self.channel_name_components
    }
    #[inline]
    pub fn separator(&self) -> &str {
        &*self.separator
    }
}
