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    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 EnrichedDataset {
16    #[serde(rename = "rid")]
17    rid: conjure_object::ResourceIdentifier,
18    #[serde(rename = "uuid")]
19    uuid: conjure_object::Uuid,
20    #[builder(into)]
21    #[serde(rename = "name")]
22    name: String,
23    #[builder(default, into)]
24    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
25    description: Option<String>,
26    #[builder(into)]
27    #[serde(rename = "displayName")]
28    display_name: String,
29    #[builder(default, into)]
30    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none", default)]
31    metadata: Option<std::collections::BTreeMap<String, String>>,
32    #[builder(
33        default,
34        custom(
35            type = impl
36            Into<Option<super::Handle>>,
37            convert = |v|v.into().map(Box::new)
38        )
39    )]
40    #[serde(rename = "handle", skip_serializing_if = "Option::is_none", default)]
41    handle: Option<Box<super::Handle>>,
42    #[serde(rename = "ingestDate")]
43    ingest_date: conjure_object::DateTime<conjure_object::Utc>,
44    #[builder(default, into)]
45    #[serde(rename = "ingestStatus", skip_serializing_if = "Option::is_none", default)]
46    ingest_status: Option<super::IngestStatus>,
47    #[builder(custom(type = super::DatasetOriginMetadata, convert = Box::new))]
48    #[serde(rename = "originMetadata")]
49    origin_metadata: Box<super::DatasetOriginMetadata>,
50    #[builder(
51        custom(type = super::super::super::api::IngestStatusV2, convert = Box::new)
52    )]
53    #[serde(rename = "lastIngestStatus")]
54    last_ingest_status: Box<super::super::super::api::IngestStatusV2>,
55    #[builder(custom(type = super::RetentionPolicy, convert = Box::new))]
56    #[serde(rename = "retentionPolicy")]
57    retention_policy: Box<super::RetentionPolicy>,
58    #[builder(default, into)]
59    #[serde(rename = "source", skip_serializing_if = "Option::is_none", default)]
60    source: Option<String>,
61    #[builder(
62        default,
63        custom(
64            type = impl
65            Into<Option<super::Bounds>>,
66            convert = |v|v.into().map(Box::new)
67        )
68    )]
69    #[serde(rename = "bounds", skip_serializing_if = "Option::is_none", default)]
70    bounds: Option<Box<super::Bounds>>,
71    #[serde(rename = "timestampType")]
72    timestamp_type: super::WeakTimestampType,
73    #[builder(default, set(item(type = super::super::super::api::Label)))]
74    #[serde(
75        rename = "labels",
76        skip_serializing_if = "std::collections::BTreeSet::is_empty",
77        default
78    )]
79    labels: std::collections::BTreeSet<super::super::super::api::Label>,
80    #[builder(
81        default,
82        map(
83            key(type = super::super::super::api::PropertyName),
84            value(type = super::super::super::api::PropertyValue)
85        )
86    )]
87    #[serde(
88        rename = "properties",
89        skip_serializing_if = "std::collections::BTreeMap::is_empty",
90        default
91    )]
92    properties: std::collections::BTreeMap<
93        super::super::super::api::PropertyName,
94        super::super::super::api::PropertyValue,
95    >,
96    #[serde(rename = "granularity")]
97    granularity: super::super::super::api::Granularity,
98    #[serde(rename = "allowStreaming")]
99    allow_streaming: bool,
100    #[serde(rename = "isArchived")]
101    is_archived: bool,
102    #[builder(default, into)]
103    #[serde(rename = "datasetType", skip_serializing_if = "Option::is_none", default)]
104    dataset_type: Option<super::DatasetBackingType>,
105    #[builder(
106        default,
107        custom(
108            type = impl
109            Into<Option<super::ExternalConnectionMetadata>>,
110            convert = |v|v.into().map(Box::new)
111        )
112    )]
113    #[serde(
114        rename = "externalConnectionMetadata",
115        skip_serializing_if = "Option::is_none",
116        default
117    )]
118    external_connection_metadata: Option<Box<super::ExternalConnectionMetadata>>,
119}
120impl EnrichedDataset {
121    #[inline]
122    pub fn rid(&self) -> &conjure_object::ResourceIdentifier {
123        &self.rid
124    }
125    #[inline]
126    pub fn uuid(&self) -> conjure_object::Uuid {
127        self.uuid
128    }
129    #[inline]
130    pub fn name(&self) -> &str {
131        &*self.name
132    }
133    #[inline]
134    pub fn description(&self) -> Option<&str> {
135        self.description.as_ref().map(|o| &**o)
136    }
137    #[inline]
138    pub fn display_name(&self) -> &str {
139        &*self.display_name
140    }
141    #[deprecated(note = "Deprecated in favor of properties.")]
142    #[inline]
143    pub fn metadata(&self) -> Option<&std::collections::BTreeMap<String, String>> {
144        self.metadata.as_ref().map(|o| &*o)
145    }
146    #[deprecated(note = "Deprecated. Use DatasetFile#handle")]
147    #[inline]
148    pub fn handle(&self) -> Option<&super::Handle> {
149        self.handle.as_ref().map(|o| &**o)
150    }
151    #[inline]
152    pub fn ingest_date(&self) -> conjure_object::DateTime<conjure_object::Utc> {
153        self.ingest_date
154    }
155    #[deprecated(note = "Deprecated. Use lastIngestStatus.")]
156    #[inline]
157    pub fn ingest_status(&self) -> Option<&super::IngestStatus> {
158        self.ingest_status.as_ref().map(|o| &*o)
159    }
160    #[inline]
161    pub fn origin_metadata(&self) -> &super::DatasetOriginMetadata {
162        &*self.origin_metadata
163    }
164    #[inline]
165    pub fn last_ingest_status(&self) -> &super::super::super::api::IngestStatusV2 {
166        &*self.last_ingest_status
167    }
168    #[inline]
169    pub fn retention_policy(&self) -> &super::RetentionPolicy {
170        &*self.retention_policy
171    }
172    #[inline]
173    pub fn source(&self) -> Option<&str> {
174        self.source.as_ref().map(|o| &**o)
175    }
176    #[inline]
177    pub fn bounds(&self) -> Option<&super::Bounds> {
178        self.bounds.as_ref().map(|o| &**o)
179    }
180    #[inline]
181    pub fn timestamp_type(&self) -> &super::WeakTimestampType {
182        &self.timestamp_type
183    }
184    #[inline]
185    pub fn labels(
186        &self,
187    ) -> &std::collections::BTreeSet<super::super::super::api::Label> {
188        &self.labels
189    }
190    #[inline]
191    pub fn properties(
192        &self,
193    ) -> &std::collections::BTreeMap<
194        super::super::super::api::PropertyName,
195        super::super::super::api::PropertyValue,
196    > {
197        &self.properties
198    }
199    #[inline]
200    pub fn granularity(&self) -> &super::super::super::api::Granularity {
201        &self.granularity
202    }
203    #[inline]
204    pub fn allow_streaming(&self) -> bool {
205        self.allow_streaming
206    }
207    #[inline]
208    pub fn is_archived(&self) -> bool {
209        self.is_archived
210    }
211    #[inline]
212    pub fn dataset_type(&self) -> Option<&super::DatasetBackingType> {
213        self.dataset_type.as_ref().map(|o| &*o)
214    }
215    #[inline]
216    pub fn external_connection_metadata(
217        &self,
218    ) -> Option<&super::ExternalConnectionMetadata> {
219        self.external_connection_metadata.as_ref().map(|o| &**o)
220    }
221}