Skip to main content

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