nominal-api 0.1239.0

API bindings for the Nominal platform
Documentation
/// Batch of data to stream for a single channel with their associated timestamps.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct ColumnBatch {
    #[serde(rename = "channel")]
    channel: super::super::super::super::api::Channel,
    #[builder(
        default,
        map(
            key(type = super::super::super::super::api::TagName),
            value(type = super::super::super::super::api::TagValue)
        )
    )]
    #[serde(
        rename = "tags",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    tags: std::collections::BTreeMap<
        super::super::super::super::api::TagName,
        super::super::super::super::api::TagValue,
    >,
    #[builder(default, list(item(type = super::super::super::super::api::Timestamp)))]
    #[serde(rename = "timestamps", skip_serializing_if = "Vec::is_empty", default)]
    timestamps: Vec<super::super::super::super::api::Timestamp>,
    #[builder(custom(type = super::ColumnValues, convert = Box::new))]
    #[serde(rename = "values")]
    values: Box<super::ColumnValues>,
}
impl ColumnBatch {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        channel: super::super::super::super::api::Channel,
        values: super::ColumnValues,
    ) -> Self {
        Self::builder().channel(channel).values(values).build()
    }
    /// Channel within nominal to stream data to.
    #[inline]
    pub fn channel(&self) -> &super::super::super::super::api::Channel {
        &self.channel
    }
    /// Mapping of key-value pairs to provide as tags to all points within the batch
    #[inline]
    pub fn tags(
        &self,
    ) -> &std::collections::BTreeMap<
        super::super::super::super::api::TagName,
        super::super::super::super::api::TagValue,
    > {
        &self.tags
    }
    /// List of timestamp values that correspond to the provided list of column values. The number of timestamps
    /// provided MUST match the number of columnar values provided, otherwise a 400 error will be returned.
    #[inline]
    pub fn timestamps(&self) -> &[super::super::super::super::api::Timestamp] {
        &*self.timestamps
    }
    /// List of time series values that should be ingested to a single channel. The number of columnar values
    /// provided MUST match the number of timestamps provided, otherwise a 400 error will be returned.
    #[inline]
    pub fn values(&self) -> &super::ColumnValues {
        &*self.values
    }
}