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    #[builder(
94        default,
95        map(
96            key(type = super::super::super::api::PropertyName),
97            value(type = super::super::super::api::TypedPropertyValue)
98        )
99    )]
100    #[serde(
101        rename = "typedProperties",
102        skip_serializing_if = "std::collections::BTreeMap::is_empty",
103        default
104    )]
105    typed_properties: std::collections::BTreeMap<
106        super::super::super::api::PropertyName,
107        super::super::super::api::TypedPropertyValue,
108    >,
109    #[serde(rename = "granularity")]
110    granularity: super::super::super::api::Granularity,
111    #[serde(rename = "allowStreaming")]
112    allow_streaming: bool,
113    #[serde(rename = "isArchived")]
114    is_archived: bool,
115    #[builder(default, into)]
116    #[serde(rename = "datasetType", skip_serializing_if = "Option::is_none", default)]
117    dataset_type: Option<super::DatasetBackingType>,
118    #[builder(default, into)]
119    #[serde(
120        rename = "migratedFromConnectionRid",
121        skip_serializing_if = "Option::is_none",
122        default
123    )]
124    migrated_from_connection_rid: Option<
125        super::super::datasource::connection::api::ConnectionRid,
126    >,
127    #[builder(
128        default,
129        custom(
130            type = impl
131            Into<Option<super::ExternalConnectionMetadata>>,
132            convert = |v|v.into().map(Box::new)
133        )
134    )]
135    #[serde(
136        rename = "externalConnectionMetadata",
137        skip_serializing_if = "Option::is_none",
138        default
139    )]
140    external_connection_metadata: Option<Box<super::ExternalConnectionMetadata>>,
141    #[builder(
142        default,
143        custom(
144            type = impl
145            Into<Option<super::DerivedDefinition>>,
146            convert = |v|v.into().map(Box::new)
147        )
148    )]
149    #[serde(
150        rename = "derivedDefinition",
151        skip_serializing_if = "Option::is_none",
152        default
153    )]
154    derived_definition: Option<Box<super::DerivedDefinition>>,
155}
156impl EnrichedDataset {
157    #[inline]
158    pub fn rid(&self) -> &conjure_object::ResourceIdentifier {
159        &self.rid
160    }
161    #[inline]
162    pub fn uuid(&self) -> conjure_object::Uuid {
163        self.uuid
164    }
165    #[inline]
166    pub fn name(&self) -> &str {
167        &*self.name
168    }
169    #[inline]
170    pub fn description(&self) -> Option<&str> {
171        self.description.as_ref().map(|o| &**o)
172    }
173    #[inline]
174    pub fn display_name(&self) -> &str {
175        &*self.display_name
176    }
177    #[deprecated(note = "Deprecated in favor of properties.")]
178    #[inline]
179    pub fn metadata(&self) -> Option<&std::collections::BTreeMap<String, String>> {
180        self.metadata.as_ref().map(|o| &*o)
181    }
182    #[deprecated(note = "Deprecated. Use DatasetFile#handle")]
183    #[inline]
184    pub fn handle(&self) -> Option<&super::Handle> {
185        self.handle.as_ref().map(|o| &**o)
186    }
187    #[inline]
188    pub fn ingest_date(&self) -> conjure_object::DateTime<conjure_object::Utc> {
189        self.ingest_date
190    }
191    #[deprecated(note = "Deprecated. Use lastIngestStatus.")]
192    #[inline]
193    pub fn ingest_status(&self) -> Option<&super::IngestStatus> {
194        self.ingest_status.as_ref().map(|o| &*o)
195    }
196    #[inline]
197    pub fn origin_metadata(&self) -> &super::DatasetOriginMetadata {
198        &*self.origin_metadata
199    }
200    #[inline]
201    pub fn last_ingest_status(&self) -> &super::super::super::api::IngestStatusV2 {
202        &*self.last_ingest_status
203    }
204    #[inline]
205    pub fn retention_policy(&self) -> &super::RetentionPolicy {
206        &*self.retention_policy
207    }
208    #[inline]
209    pub fn source(&self) -> Option<&str> {
210        self.source.as_ref().map(|o| &**o)
211    }
212    #[inline]
213    pub fn bounds(&self) -> Option<&super::Bounds> {
214        self.bounds.as_ref().map(|o| &**o)
215    }
216    #[inline]
217    pub fn timestamp_type(&self) -> &super::WeakTimestampType {
218        &self.timestamp_type
219    }
220    #[inline]
221    pub fn labels(
222        &self,
223    ) -> &std::collections::BTreeSet<super::super::super::api::Label> {
224        &self.labels
225    }
226    #[deprecated(note = "use typedProperties")]
227    #[inline]
228    pub fn properties(
229        &self,
230    ) -> &std::collections::BTreeMap<
231        super::super::super::api::PropertyName,
232        super::super::super::api::PropertyValue,
233    > {
234        &self.properties
235    }
236    #[inline]
237    pub fn typed_properties(
238        &self,
239    ) -> &std::collections::BTreeMap<
240        super::super::super::api::PropertyName,
241        super::super::super::api::TypedPropertyValue,
242    > {
243        &self.typed_properties
244    }
245    #[inline]
246    pub fn granularity(&self) -> &super::super::super::api::Granularity {
247        &self.granularity
248    }
249    #[inline]
250    pub fn allow_streaming(&self) -> bool {
251        self.allow_streaming
252    }
253    #[inline]
254    pub fn is_archived(&self) -> bool {
255        self.is_archived
256    }
257    #[inline]
258    pub fn dataset_type(&self) -> Option<&super::DatasetBackingType> {
259        self.dataset_type.as_ref().map(|o| &*o)
260    }
261    /// Connection RID whose data source was migrated into this dataset. Empty for datasets that were not created
262    /// by the legacy connection-to-dataset migrations, or when the original connection row no longer exists.
263    #[inline]
264    pub fn migrated_from_connection_rid(
265        &self,
266    ) -> Option<&super::super::datasource::connection::api::ConnectionRid> {
267        self.migrated_from_connection_rid.as_ref().map(|o| &*o)
268    }
269    #[inline]
270    pub fn external_connection_metadata(
271        &self,
272    ) -> Option<&super::ExternalConnectionMetadata> {
273        self.external_connection_metadata.as_ref().map(|o| &**o)
274    }
275    /// Definition for a derived dataset. When present, this dataset is virtual and backed by the referenced
276    /// provided Dataset definition instead of persisted dataset files.
277    #[inline]
278    pub fn derived_definition(&self) -> Option<&super::DerivedDefinition> {
279        self.derived_definition.as_ref().map(|o| &**o)
280    }
281}