nominal-api 0.1240.0

API bindings for the Nominal platform
Documentation
#[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 TelegrafMetric {
    #[builder(
        default,
        map(
            key(type = super::Field),
            value(
                custom(
                    type = impl
                    conjure_object::serde::Serialize,
                    convert = |v|conjure_object::Any::new(
                        v
                    ).expect("value failed to serialize")
                )
            )
        )
    )]
    #[serde(
        rename = "fields",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    fields: std::collections::BTreeMap<super::Field, conjure_object::Any>,
    #[serde(rename = "name")]
    name: super::MeasurementName,
    #[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(
        custom(
            type = impl
            conjure_object::serde::Serialize,
            convert = |v|conjure_object::Any::new(v).expect("value failed to serialize")
        )
    )]
    #[serde(rename = "timestamp")]
    timestamp: conjure_object::Any,
}
impl TelegrafMetric {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        name: super::MeasurementName,
        timestamp: impl conjure_object::serde::Serialize,
    ) -> Self {
        Self::builder().name(name).timestamp(timestamp).build()
    }
    /// The values are expected to be either numeric or string values
    #[inline]
    pub fn fields(
        &self,
    ) -> &std::collections::BTreeMap<super::Field, conjure_object::Any> {
        &self.fields
    }
    /// The measurement name. Measurement name and field are concatenated when creating the Nominal channel name.
    #[inline]
    pub fn name(&self) -> &super::MeasurementName {
        &self.name
    }
    #[inline]
    pub fn tags(
        &self,
    ) -> &std::collections::BTreeMap<
        super::super::super::super::api::TagName,
        super::super::super::super::api::TagValue,
    > {
        &self.tags
    }
    #[inline]
    pub fn timestamp(&self) -> &conjure_object::Any {
        &self.timestamp
    }
}