Skip to main content

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