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