Skip to main content

nominal_api/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 = String, into)))]
71    #[serde(
72        rename = "labels",
73        skip_serializing_if = "std::collections::BTreeSet::is_empty",
74        default
75    )]
76    labels: std::collections::BTreeSet<String>,
77    #[builder(default, map(key(type = String, into), value(type = String, into)))]
78    #[serde(
79        rename = "properties",
80        skip_serializing_if = "std::collections::BTreeMap::is_empty",
81        default
82    )]
83    properties: std::collections::BTreeMap<String, String>,
84    #[serde(rename = "granularity")]
85    granularity: super::super::super::api::Granularity,
86    #[serde(rename = "allowStreaming")]
87    allow_streaming: bool,
88    #[serde(rename = "isArchived")]
89    is_archived: bool,
90    #[builder(default, into)]
91    #[serde(rename = "datasetType", skip_serializing_if = "Option::is_none", default)]
92    dataset_type: Option<super::DatasetBackingType>,
93    #[builder(
94        default,
95        custom(
96            type = impl
97            Into<Option<super::ExternalConnectionMetadata>>,
98            convert = |v|v.into().map(Box::new)
99        )
100    )]
101    #[serde(
102        rename = "externalConnectionMetadata",
103        skip_serializing_if = "Option::is_none",
104        default
105    )]
106    external_connection_metadata: Option<Box<super::ExternalConnectionMetadata>>,
107    #[builder(
108        default,
109        custom(
110            type = impl
111            Into<Option<super::DerivedDefinition>>,
112            convert = |v|v.into().map(Box::new)
113        )
114    )]
115    #[serde(
116        rename = "derivedDefinition",
117        skip_serializing_if = "Option::is_none",
118        default
119    )]
120    derived_definition: Option<Box<super::DerivedDefinition>>,
121}
122impl EnrichedDataset {
123    #[inline]
124    pub fn rid(&self) -> &conjure_object::ResourceIdentifier {
125        &self.rid
126    }
127    #[inline]
128    pub fn uuid(&self) -> conjure_object::Uuid {
129        self.uuid
130    }
131    #[inline]
132    pub fn name(&self) -> &str {
133        &*self.name
134    }
135    #[inline]
136    pub fn description(&self) -> Option<&str> {
137        self.description.as_ref().map(|o| &**o)
138    }
139    #[inline]
140    pub fn display_name(&self) -> &str {
141        &*self.display_name
142    }
143    #[deprecated(note = "Deprecated in favor of properties.")]
144    #[inline]
145    pub fn metadata(&self) -> Option<&std::collections::BTreeMap<String, String>> {
146        self.metadata.as_ref().map(|o| &*o)
147    }
148    #[deprecated(note = "Deprecated. Use DatasetFile#handle")]
149    #[inline]
150    pub fn handle(&self) -> Option<&super::Handle> {
151        self.handle.as_ref().map(|o| &**o)
152    }
153    #[inline]
154    pub fn ingest_date(&self) -> conjure_object::DateTime<conjure_object::Utc> {
155        self.ingest_date
156    }
157    #[deprecated(note = "Deprecated. Use lastIngestStatus.")]
158    #[inline]
159    pub fn ingest_status(&self) -> Option<&super::IngestStatus> {
160        self.ingest_status.as_ref().map(|o| &*o)
161    }
162    #[inline]
163    pub fn origin_metadata(&self) -> &super::DatasetOriginMetadata {
164        &*self.origin_metadata
165    }
166    #[inline]
167    pub fn last_ingest_status(&self) -> &super::super::super::api::IngestStatusV2 {
168        &*self.last_ingest_status
169    }
170    #[inline]
171    pub fn retention_policy(&self) -> &super::RetentionPolicy {
172        &*self.retention_policy
173    }
174    #[inline]
175    pub fn source(&self) -> Option<&str> {
176        self.source.as_ref().map(|o| &**o)
177    }
178    #[inline]
179    pub fn bounds(&self) -> Option<&super::Bounds> {
180        self.bounds.as_ref().map(|o| &**o)
181    }
182    #[inline]
183    pub fn timestamp_type(&self) -> &super::WeakTimestampType {
184        &self.timestamp_type
185    }
186    #[inline]
187    pub fn labels(&self) -> &std::collections::BTreeSet<String> {
188        &self.labels
189    }
190    #[inline]
191    pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
192        &self.properties
193    }
194    #[inline]
195    pub fn granularity(&self) -> &super::super::super::api::Granularity {
196        &self.granularity
197    }
198    #[inline]
199    pub fn allow_streaming(&self) -> bool {
200        self.allow_streaming
201    }
202    #[inline]
203    pub fn is_archived(&self) -> bool {
204        self.is_archived
205    }
206    #[inline]
207    pub fn dataset_type(&self) -> Option<&super::DatasetBackingType> {
208        self.dataset_type.as_ref().map(|o| &*o)
209    }
210    #[inline]
211    pub fn external_connection_metadata(
212        &self,
213    ) -> Option<&super::ExternalConnectionMetadata> {
214        self.external_connection_metadata.as_ref().map(|o| &**o)
215    }
216    /// Definition for a derived dataset. When present, this dataset is virtual and backed by the referenced
217    /// DataFrame instead of persisted dataset files.
218    #[inline]
219    pub fn derived_definition(&self) -> Option<&super::DerivedDefinition> {
220        self.derived_definition.as_ref().map(|o| &**o)
221    }
222}