Skip to main content

nominal_api/conjure/objects/ingest/api/
existing_dataset_ingest_destination.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 ExistingDatasetIngestDestination {
16    #[serde(rename = "datasetRid")]
17    dataset_rid: conjure_object::ResourceIdentifier,
18    #[builder(default, into)]
19    #[serde(
20        rename = "expandRunBounds",
21        skip_serializing_if = "Option::is_none",
22        default
23    )]
24    expand_run_bounds: Option<Vec<super::super::super::scout::run::api::RunRid>>,
25}
26impl ExistingDatasetIngestDestination {
27    /// Constructs a new instance of the type.
28    #[inline]
29    pub fn new(dataset_rid: conjure_object::ResourceIdentifier) -> Self {
30        Self::builder().dataset_rid(dataset_rid).build()
31    }
32    #[inline]
33    pub fn dataset_rid(&self) -> &conjure_object::ResourceIdentifier {
34        &self.dataset_rid
35    }
36    /// The ingest will keep track of the range of timestamps in the ingested data and update the included
37    /// run's time bounds.
38    /// For runs with no end time (uninitialized), it will always set the start time to the file's start time
39    /// and set the end time to the file's end time.
40    /// For runs with existing end times, it will only expand the bounds (earliest start time, latest end time).
41    #[inline]
42    pub fn expand_run_bounds(
43        &self,
44    ) -> Option<&[super::super::super::scout::run::api::RunRid]> {
45        self.expand_run_bounds.as_ref().map(|o| &**o)
46    }
47}