Skip to main content

aws_sdk_glue/schema_serde/
shape_data_quality_results_v2_description.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2static DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_RESULT_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3    ::aws_smithy_schema::ShapeId::from_parts(
4        "com.amazonaws.glue#DataQualityResultsV2Description$ResultId",
5        "com.amazonaws.glue",
6        "DataQualityResultsV2Description",
7    ),
8    ::aws_smithy_schema::ShapeType::String,
9    "ResultId",
10    0,
11);
12static DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_EVALUATION_RUN_MODE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
13    ::aws_smithy_schema::ShapeId::from_parts(
14        "com.amazonaws.glue#DataQualityResultsV2Description$EvaluationRunMode",
15        "com.amazonaws.glue",
16        "DataQualityResultsV2Description",
17    ),
18    ::aws_smithy_schema::ShapeType::String,
19    "EvaluationRunMode",
20    1,
21);
22static DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DATA_QUALITY_EVALUATION_CONFIG: ::aws_smithy_schema::Schema<'static> =
23    ::aws_smithy_schema::Schema::new_member(
24        ::aws_smithy_schema::ShapeId::from_parts(
25            "com.amazonaws.glue#DataQualityResultsV2Description$DataQualityEvaluationConfig",
26            "com.amazonaws.glue",
27            "DataQualityResultsV2Description",
28        ),
29        ::aws_smithy_schema::ShapeType::String,
30        "DataQualityEvaluationConfig",
31        2,
32    );
33static DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DATA_SOURCE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
34    ::aws_smithy_schema::ShapeId::from_parts(
35        "com.amazonaws.glue#DataQualityResultsV2Description$DataSource",
36        "com.amazonaws.glue",
37        "DataQualityResultsV2Description",
38    ),
39    ::aws_smithy_schema::ShapeType::Structure,
40    "DataSource",
41    3,
42);
43static DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_RESULT_PUBLISHED_ON: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
44    ::aws_smithy_schema::ShapeId::from_parts(
45        "com.amazonaws.glue#DataQualityResultsV2Description$ResultPublishedOn",
46        "com.amazonaws.glue",
47        "DataQualityResultsV2Description",
48    ),
49    ::aws_smithy_schema::ShapeType::Timestamp,
50    "ResultPublishedOn",
51    4,
52);
53static DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DIMENSIONS_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
54    ::aws_smithy_schema::ShapeId::from_parts(
55        "com.amazonaws.glue#PublishDataQualityResultDimensions$key",
56        "com.amazonaws.glue",
57        "PublishDataQualityResultDimensions",
58    ),
59    ::aws_smithy_schema::ShapeType::String,
60    "key",
61    0,
62);
63static DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DIMENSIONS_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
64    ::aws_smithy_schema::ShapeId::from_parts(
65        "com.amazonaws.glue#PublishDataQualityResultDimensions$value",
66        "com.amazonaws.glue",
67        "PublishDataQualityResultDimensions",
68    ),
69    ::aws_smithy_schema::ShapeType::String,
70    "value",
71    1,
72);
73static DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DIMENSIONS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
74    ::aws_smithy_schema::ShapeId::from_parts(
75        "com.amazonaws.glue#DataQualityResultsV2Description$Dimensions",
76        "com.amazonaws.glue",
77        "DataQualityResultsV2Description",
78    ),
79    ::aws_smithy_schema::ShapeType::Map,
80    "Dimensions",
81    5,
82)
83.with_map_members(
84    &DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DIMENSIONS_KEY,
85    &DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DIMENSIONS_VALUE,
86);
87static DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_EVALUATION_CONTEXT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
88    ::aws_smithy_schema::ShapeId::from_parts(
89        "com.amazonaws.glue#DataQualityResultsV2Description$EvaluationContext",
90        "com.amazonaws.glue",
91        "DataQualityResultsV2Description",
92    ),
93    ::aws_smithy_schema::ShapeType::String,
94    "EvaluationContext",
95    6,
96);
97static DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DESCRIPTORS_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
98    ::aws_smithy_schema::ShapeId::from_parts(
99        "com.amazonaws.glue#PublishDataQualityResultDescriptors$key",
100        "com.amazonaws.glue",
101        "PublishDataQualityResultDescriptors",
102    ),
103    ::aws_smithy_schema::ShapeType::String,
104    "key",
105    0,
106);
107static DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DESCRIPTORS_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
108    ::aws_smithy_schema::ShapeId::from_parts(
109        "com.amazonaws.glue#PublishDataQualityResultDescriptors$value",
110        "com.amazonaws.glue",
111        "PublishDataQualityResultDescriptors",
112    ),
113    ::aws_smithy_schema::ShapeType::String,
114    "value",
115    1,
116);
117static DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DESCRIPTORS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
118    ::aws_smithy_schema::ShapeId::from_parts(
119        "com.amazonaws.glue#DataQualityResultsV2Description$Descriptors",
120        "com.amazonaws.glue",
121        "DataQualityResultsV2Description",
122    ),
123    ::aws_smithy_schema::ShapeType::Map,
124    "Descriptors",
125    7,
126)
127.with_map_members(
128    &DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DESCRIPTORS_KEY,
129    &DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DESCRIPTORS_VALUE,
130);
131static DATAQUALITYRESULTSV2DESCRIPTION_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
132    ::aws_smithy_schema::ShapeId::from_parts(
133        "com.amazonaws.glue#DataQualityResultsV2Description",
134        "com.amazonaws.glue",
135        "DataQualityResultsV2Description",
136    ),
137    ::aws_smithy_schema::ShapeType::Structure,
138    &[
139        &DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_RESULT_ID,
140        &DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_EVALUATION_RUN_MODE,
141        &DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DATA_QUALITY_EVALUATION_CONFIG,
142        &DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DATA_SOURCE,
143        &DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_RESULT_PUBLISHED_ON,
144        &DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DIMENSIONS,
145        &DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_EVALUATION_CONTEXT,
146        &DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DESCRIPTORS,
147    ],
148);
149impl crate::types::DataQualityResultsV2Description {
150    /// The schema for this shape.
151    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DATAQUALITYRESULTSV2DESCRIPTION_SCHEMA;
152}
153impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::DataQualityResultsV2Description {
154    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
155        Self::SCHEMA
156    }
157
158    #[allow(unused_variables, clippy::diverging_sub_expression)]
159    fn serialize_members(
160        &self,
161        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
162    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
163        if let Some(ref val) = self.result_id {
164            ser.write_string(&DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_RESULT_ID, val)?;
165        }
166        if let Some(ref val) = self.evaluation_run_mode {
167            ser.write_string(&DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_EVALUATION_RUN_MODE, val.as_str())?;
168        }
169        if let Some(ref val) = self.data_quality_evaluation_config {
170            ser.write_string(&DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DATA_QUALITY_EVALUATION_CONFIG, val)?;
171        }
172        if let Some(ref val) = self.data_source {
173            ser.write_struct(&DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DATA_SOURCE, val)?;
174        }
175        if let Some(ref val) = self.result_published_on {
176            ser.write_timestamp(&DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_RESULT_PUBLISHED_ON, val)?;
177        }
178        if let Some(ref val) = self.dimensions {
179            ser.write_map(
180                &DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DIMENSIONS,
181                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
182                    for (key, value) in val {
183                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
184                        ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
185                    }
186                    Ok(())
187                },
188            )?;
189        }
190        if let Some(ref val) = self.evaluation_context {
191            ser.write_string(&DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_EVALUATION_CONTEXT, val)?;
192        }
193        if let Some(ref val) = self.descriptors {
194            ser.write_map(
195                &DATAQUALITYRESULTSV2DESCRIPTION_MEMBER_DESCRIPTORS,
196                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
197                    for (key, value) in val {
198                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
199                        ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
200                    }
201                    Ok(())
202                },
203            )?;
204        }
205        Ok(())
206    }
207}
208impl crate::types::builders::DataQualityResultsV2DescriptionBuilder {
209    #[allow(
210        unused_variables,
211        unreachable_code,
212        clippy::single_match,
213        clippy::match_single_binding,
214        clippy::diverging_sub_expression
215    )]
216    pub(crate) fn deserialize_members(
217        &mut self,
218        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
219    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
220        deserializer.read_struct(&DATAQUALITYRESULTSV2DESCRIPTION_SCHEMA, &mut |member, deser| {
221            match member.member_index() {
222                Some(0) => {
223                    if deser.is_null() {
224                        deser.read_null()?;
225                    } else {
226                        self.result_id = Some(deser.read_string(member)?);
227                    }
228                }
229                Some(1) => {
230                    if deser.is_null() {
231                        deser.read_null()?;
232                    } else {
233                        self.evaluation_run_mode = Some(crate::types::DataQualityEvaluationRunMode::from(deser.read_string(member)?.as_str()));
234                    }
235                }
236                Some(2) => {
237                    if deser.is_null() {
238                        deser.read_null()?;
239                    } else {
240                        self.data_quality_evaluation_config = Some(deser.read_string(member)?);
241                    }
242                }
243                Some(3) => {
244                    if deser.is_null() {
245                        deser.read_null()?;
246                    } else {
247                        self.data_source = Some(crate::types::DataSource::deserialize(deser)?);
248                    }
249                }
250                Some(4) => {
251                    if deser.is_null() {
252                        deser.read_null()?;
253                    } else {
254                        self.result_published_on = Some(deser.read_timestamp(member)?);
255                    }
256                }
257                Some(5) => {
258                    if deser.is_null() {
259                        deser.read_null()?;
260                    } else {
261                        self.dimensions = Some(deser.read_string_string_map(member)?);
262                    }
263                }
264                Some(6) => {
265                    if deser.is_null() {
266                        deser.read_null()?;
267                    } else {
268                        self.evaluation_context = Some(deser.read_string(member)?);
269                    }
270                }
271                Some(7) => {
272                    if deser.is_null() {
273                        deser.read_null()?;
274                    } else {
275                        self.descriptors = Some(deser.read_string_string_map(member)?);
276                    }
277                }
278                _ => {}
279            }
280            Ok(())
281        })
282    }
283}
284
285impl crate::types::DataQualityResultsV2Description {
286    /// Deserializes this structure from a [`ShapeDeserializer`].
287    pub fn deserialize(
288        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
289    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
290        let mut builder = Self::builder();
291        builder.deserialize_members(deserializer)?;
292        Ok(builder.build())
293    }
294}