Skip to main content

nominal_api_conjure/conjure/objects/scout/catalog/
enriched_dataset.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    conjure_object::private::DeriveWith
7)]
8#[serde(crate = "conjure_object::serde")]
9#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[conjure_object::private::staged_builder::staged_builder]
11#[builder(crate = conjure_object::private::staged_builder, update, inline)]
12pub struct EnrichedDataset {
13    #[serde(rename = "rid")]
14    rid: conjure_object::ResourceIdentifier,
15    #[serde(rename = "uuid")]
16    uuid: conjure_object::Uuid,
17    #[builder(into)]
18    #[serde(rename = "name")]
19    name: String,
20    #[builder(default, into)]
21    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
22    description: Option<String>,
23    #[builder(into)]
24    #[serde(rename = "displayName")]
25    display_name: String,
26    #[builder(default, into)]
27    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none", default)]
28    metadata: Option<std::collections::BTreeMap<String, String>>,
29    #[builder(
30        default,
31        custom(
32            type = impl
33            Into<Option<super::Handle>>,
34            convert = |v|v.into().map(Box::new)
35        )
36    )]
37    #[serde(rename = "handle", skip_serializing_if = "Option::is_none", default)]
38    handle: Option<Box<super::Handle>>,
39    #[serde(rename = "ingestDate")]
40    ingest_date: conjure_object::DateTime<conjure_object::Utc>,
41    #[builder(default, into)]
42    #[serde(rename = "ingestStatus", skip_serializing_if = "Option::is_none", default)]
43    ingest_status: Option<super::IngestStatus>,
44    #[builder(custom(type = super::DatasetOriginMetadata, convert = Box::new))]
45    #[serde(rename = "originMetadata")]
46    origin_metadata: Box<super::DatasetOriginMetadata>,
47    #[builder(
48        custom(type = super::super::super::api::IngestStatusV2, convert = Box::new)
49    )]
50    #[serde(rename = "lastIngestStatus")]
51    last_ingest_status: Box<super::super::super::api::IngestStatusV2>,
52    #[builder(custom(type = super::RetentionPolicy, convert = Box::new))]
53    #[serde(rename = "retentionPolicy")]
54    retention_policy: Box<super::RetentionPolicy>,
55    #[builder(default, into)]
56    #[serde(rename = "source", skip_serializing_if = "Option::is_none", default)]
57    source: Option<String>,
58    #[builder(
59        default,
60        custom(
61            type = impl
62            Into<Option<super::Bounds>>,
63            convert = |v|v.into().map(Box::new)
64        )
65    )]
66    #[serde(rename = "bounds", skip_serializing_if = "Option::is_none", default)]
67    bounds: Option<Box<super::Bounds>>,
68    #[serde(rename = "timestampType")]
69    timestamp_type: super::WeakTimestampType,
70    #[builder(default, set(item(type = super::super::super::api::Label)))]
71    #[serde(
72        rename = "labels",
73        skip_serializing_if = "std::collections::BTreeSet::is_empty",
74        default
75    )]
76    labels: std::collections::BTreeSet<super::super::super::api::Label>,
77    #[builder(
78        default,
79        map(
80            key(type = super::super::super::api::PropertyName),
81            value(type = super::super::super::api::PropertyValue)
82        )
83    )]
84    #[serde(
85        rename = "properties",
86        skip_serializing_if = "std::collections::BTreeMap::is_empty",
87        default
88    )]
89    properties: std::collections::BTreeMap<
90        super::super::super::api::PropertyName,
91        super::super::super::api::PropertyValue,
92    >,
93    #[serde(rename = "granularity")]
94    granularity: super::super::super::api::Granularity,
95    #[serde(rename = "allowStreaming")]
96    allow_streaming: bool,
97    #[serde(rename = "isArchived")]
98    is_archived: bool,
99    #[builder(default, into)]
100    #[serde(rename = "datasetType", skip_serializing_if = "Option::is_none", default)]
101    dataset_type: Option<super::DatasetBackingType>,
102    #[builder(default, into)]
103    #[serde(
104        rename = "migratedFromConnectionRid",
105        skip_serializing_if = "Option::is_none",
106        default
107    )]
108    migrated_from_connection_rid: Option<
109        super::super::datasource::connection::api::ConnectionRid,
110    >,
111    #[builder(
112        default,
113        custom(
114            type = impl
115            Into<Option<super::ExternalConnectionMetadata>>,
116            convert = |v|v.into().map(Box::new)
117        )
118    )]
119    #[serde(
120        rename = "externalConnectionMetadata",
121        skip_serializing_if = "Option::is_none",
122        default
123    )]
124    external_connection_metadata: Option<Box<super::ExternalConnectionMetadata>>,
125    #[builder(
126        default,
127        custom(
128            type = impl
129            Into<Option<super::DerivedDefinition>>,
130            convert = |v|v.into().map(Box::new)
131        )
132    )]
133    #[serde(
134        rename = "derivedDefinition",
135        skip_serializing_if = "Option::is_none",
136        default
137    )]
138    derived_definition: Option<Box<super::DerivedDefinition>>,
139}
140impl EnrichedDataset {
141    #[inline]
142    pub fn rid(&self) -> &conjure_object::ResourceIdentifier {
143        &self.rid
144    }
145    #[inline]
146    pub fn uuid(&self) -> conjure_object::Uuid {
147        self.uuid
148    }
149    #[inline]
150    pub fn name(&self) -> &str {
151        &*self.name
152    }
153    #[inline]
154    pub fn description(&self) -> Option<&str> {
155        self.description.as_ref().map(|o| &**o)
156    }
157    #[inline]
158    pub fn display_name(&self) -> &str {
159        &*self.display_name
160    }
161    #[deprecated(note = "Deprecated in favor of properties.")]
162    #[inline]
163    pub fn metadata(&self) -> Option<&std::collections::BTreeMap<String, String>> {
164        self.metadata.as_ref().map(|o| &*o)
165    }
166    #[deprecated(note = "Deprecated. Use DatasetFile#handle")]
167    #[inline]
168    pub fn handle(&self) -> Option<&super::Handle> {
169        self.handle.as_ref().map(|o| &**o)
170    }
171    #[inline]
172    pub fn ingest_date(&self) -> conjure_object::DateTime<conjure_object::Utc> {
173        self.ingest_date
174    }
175    #[deprecated(note = "Deprecated. Use lastIngestStatus.")]
176    #[inline]
177    pub fn ingest_status(&self) -> Option<&super::IngestStatus> {
178        self.ingest_status.as_ref().map(|o| &*o)
179    }
180    #[inline]
181    pub fn origin_metadata(&self) -> &super::DatasetOriginMetadata {
182        &*self.origin_metadata
183    }
184    #[inline]
185    pub fn last_ingest_status(&self) -> &super::super::super::api::IngestStatusV2 {
186        &*self.last_ingest_status
187    }
188    #[inline]
189    pub fn retention_policy(&self) -> &super::RetentionPolicy {
190        &*self.retention_policy
191    }
192    #[inline]
193    pub fn source(&self) -> Option<&str> {
194        self.source.as_ref().map(|o| &**o)
195    }
196    #[inline]
197    pub fn bounds(&self) -> Option<&super::Bounds> {
198        self.bounds.as_ref().map(|o| &**o)
199    }
200    #[inline]
201    pub fn timestamp_type(&self) -> &super::WeakTimestampType {
202        &self.timestamp_type
203    }
204    #[inline]
205    pub fn labels(
206        &self,
207    ) -> &std::collections::BTreeSet<super::super::super::api::Label> {
208        &self.labels
209    }
210    #[inline]
211    pub fn properties(
212        &self,
213    ) -> &std::collections::BTreeMap<
214        super::super::super::api::PropertyName,
215        super::super::super::api::PropertyValue,
216    > {
217        &self.properties
218    }
219    #[inline]
220    pub fn granularity(&self) -> &super::super::super::api::Granularity {
221        &self.granularity
222    }
223    #[inline]
224    pub fn allow_streaming(&self) -> bool {
225        self.allow_streaming
226    }
227    #[inline]
228    pub fn is_archived(&self) -> bool {
229        self.is_archived
230    }
231    #[inline]
232    pub fn dataset_type(&self) -> Option<&super::DatasetBackingType> {
233        self.dataset_type.as_ref().map(|o| &*o)
234    }
235    /// Connection RID whose data source was migrated into this dataset. Empty for datasets that were not created
236    /// by the legacy connection-to-dataset migrations, or when the original connection row no longer exists.
237    #[inline]
238    pub fn migrated_from_connection_rid(
239        &self,
240    ) -> Option<&super::super::datasource::connection::api::ConnectionRid> {
241        self.migrated_from_connection_rid.as_ref().map(|o| &*o)
242    }
243    #[inline]
244    pub fn external_connection_metadata(
245        &self,
246    ) -> Option<&super::ExternalConnectionMetadata> {
247        self.external_connection_metadata.as_ref().map(|o| &**o)
248    }
249    /// Definition for a derived dataset. When present, this dataset is virtual and backed by the referenced
250    /// provided Dataset definition instead of persisted dataset files.
251    #[inline]
252    pub fn derived_definition(&self) -> Option<&super::DerivedDefinition> {
253        self.derived_definition.as_ref().map(|o| &**o)
254    }
255}