Skip to main content

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