Skip to main content

nominal_api/conjure/objects/ingest/api/
ingest_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 IngestMetadata {
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    #[builder(default, into)]
31    #[serde(rename = "channelPrefix", skip_serializing_if = "Option::is_none", default)]
32    channel_prefix: Option<String>,
33    #[builder(default, into)]
34    #[serde(rename = "tagColumns", skip_serializing_if = "Option::is_none", default)]
35    tag_columns: Option<
36        std::collections::BTreeMap<
37            super::super::super::api::TagName,
38            super::super::super::api::ColumnName,
39        >,
40    >,
41    #[builder(default, into)]
42    #[serde(
43        rename = "additionalFileTags",
44        skip_serializing_if = "Option::is_none",
45        default
46    )]
47    additional_file_tags: Option<
48        std::collections::BTreeMap<
49            super::super::super::api::TagName,
50            super::super::super::api::TagValue,
51        >,
52    >,
53}
54impl IngestMetadata {
55    /// Constructs a new instance of the type.
56    #[inline]
57    pub fn new() -> Self {
58        Self::builder().build()
59    }
60    /// The timestamp metadata will be recovered from the dataset files if possible.
61    /// Older datasets may have unrecoverable timestamp metadata.
62    /// If unrecoverable, reingestion will throw MissingMetadataForReingest if not provided in request.
63    #[inline]
64    pub fn timestamp_metadata(&self) -> Option<&super::TimestampMetadata> {
65        self.timestamp_metadata.as_ref().map(|o| &**o)
66    }
67    /// Channel prefix to use when reingesting the dataset.
68    /// Defaults to empty string. Not recoverable from prior ingests and must be provided in request if needed.
69    #[inline]
70    pub fn channel_prefix(&self) -> Option<&str> {
71        self.channel_prefix.as_ref().map(|o| &**o)
72    }
73    /// A map of tag names to column names to derive the tag values from.
74    /// Not recoverable from prior ingests and must be provided in request if needed.
75    #[inline]
76    pub fn tag_columns(
77        &self,
78    ) -> Option<
79        &std::collections::BTreeMap<
80            super::super::super::api::TagName,
81            super::super::super::api::ColumnName,
82        >,
83    > {
84        self.tag_columns.as_ref().map(|o| &*o)
85    }
86    /// Additional tags to apply to all dataset files within the the given dataset.
87    /// Not recoverable from prior ingests and must be provided in request if needed.
88    #[inline]
89    pub fn additional_file_tags(
90        &self,
91    ) -> Option<
92        &std::collections::BTreeMap<
93            super::super::super::api::TagName,
94            super::super::super::api::TagValue,
95        >,
96    > {
97        self.additional_file_tags.as_ref().map(|o| &*o)
98    }
99}