Skip to main content

nominal_api/conjure/objects/ingest/api/
dataflash_opts.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 DataflashOpts {
16    #[builder(custom(type = super::IngestSource, convert = Box::new))]
17    #[serde(rename = "source")]
18    source: Box<super::IngestSource>,
19    #[builder(custom(type = super::DatasetIngestTarget, convert = Box::new))]
20    #[serde(rename = "target")]
21    target: Box<super::DatasetIngestTarget>,
22    #[builder(default, into)]
23    #[serde(
24        rename = "additionalFileTags",
25        skip_serializing_if = "Option::is_none",
26        default
27    )]
28    additional_file_tags: Option<
29        std::collections::BTreeMap<
30            super::super::super::api::TagName,
31            super::super::super::api::TagValue,
32        >,
33    >,
34}
35impl DataflashOpts {
36    /// Constructs a new instance of the type.
37    #[inline]
38    pub fn new(source: super::IngestSource, target: super::DatasetIngestTarget) -> Self {
39        Self::builder().source(source).target(target).build()
40    }
41    #[inline]
42    pub fn source(&self) -> &super::IngestSource {
43        &*self.source
44    }
45    #[inline]
46    pub fn target(&self) -> &super::DatasetIngestTarget {
47        &*self.target
48    }
49    /// Specifies a tag set to apply to all data in the file.
50    #[inline]
51    pub fn additional_file_tags(
52        &self,
53    ) -> Option<
54        &std::collections::BTreeMap<
55            super::super::super::api::TagName,
56            super::super::super::api::TagValue,
57        >,
58    > {
59        self.additional_file_tags.as_ref().map(|o| &*o)
60    }
61}