Skip to main content

nominal_api/conjure/objects/ingest/api/
timestamp_metadata.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 TimestampMetadata {
16    #[builder(into)]
17    #[serde(rename = "seriesName")]
18    series_name: String,
19    #[builder(custom(type = super::TimestampType, convert = Box::new))]
20    #[serde(rename = "timestampType")]
21    timestamp_type: Box<super::TimestampType>,
22}
23impl TimestampMetadata {
24    /// Constructs a new instance of the type.
25    #[inline]
26    pub fn new(
27        series_name: impl Into<String>,
28        timestamp_type: super::TimestampType,
29    ) -> Self {
30        Self::builder().series_name(series_name).timestamp_type(timestamp_type).build()
31    }
32    #[inline]
33    pub fn series_name(&self) -> &str {
34        &*self.series_name
35    }
36    #[inline]
37    pub fn timestamp_type(&self) -> &super::TimestampType {
38        &*self.timestamp_type
39    }
40}