aws_sdk_glue/schema_serde/
shape_datapoint_inclusion_annotation.rs1static DATAPOINTINCLUSIONANNOTATION_MEMBER_PROFILE_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3 ::aws_smithy_schema::ShapeId::from_parts(
4 "com.amazonaws.glue#DatapointInclusionAnnotation$ProfileId",
5 "com.amazonaws.glue",
6 "DatapointInclusionAnnotation",
7 ),
8 ::aws_smithy_schema::ShapeType::String,
9 "ProfileId",
10 0,
11);
12static DATAPOINTINCLUSIONANNOTATION_MEMBER_STATISTIC_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
13 ::aws_smithy_schema::ShapeId::from_parts(
14 "com.amazonaws.glue#DatapointInclusionAnnotation$StatisticId",
15 "com.amazonaws.glue",
16 "DatapointInclusionAnnotation",
17 ),
18 ::aws_smithy_schema::ShapeType::String,
19 "StatisticId",
20 1,
21);
22static DATAPOINTINCLUSIONANNOTATION_MEMBER_INCLUSION_ANNOTATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
23 ::aws_smithy_schema::ShapeId::from_parts(
24 "com.amazonaws.glue#DatapointInclusionAnnotation$InclusionAnnotation",
25 "com.amazonaws.glue",
26 "DatapointInclusionAnnotation",
27 ),
28 ::aws_smithy_schema::ShapeType::String,
29 "InclusionAnnotation",
30 2,
31);
32static DATAPOINTINCLUSIONANNOTATION_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
33 ::aws_smithy_schema::ShapeId::from_parts(
34 "com.amazonaws.glue#DatapointInclusionAnnotation",
35 "com.amazonaws.glue",
36 "DatapointInclusionAnnotation",
37 ),
38 ::aws_smithy_schema::ShapeType::Structure,
39 &[
40 &DATAPOINTINCLUSIONANNOTATION_MEMBER_PROFILE_ID,
41 &DATAPOINTINCLUSIONANNOTATION_MEMBER_STATISTIC_ID,
42 &DATAPOINTINCLUSIONANNOTATION_MEMBER_INCLUSION_ANNOTATION,
43 ],
44);
45impl crate::types::DatapointInclusionAnnotation {
46 pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DATAPOINTINCLUSIONANNOTATION_SCHEMA;
48}
49impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::DatapointInclusionAnnotation {
50 fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
51 Self::SCHEMA
52 }
53
54 #[allow(unused_variables, clippy::diverging_sub_expression)]
55 fn serialize_members(
56 &self,
57 ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
58 ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
59 if let Some(ref val) = self.profile_id {
60 ser.write_string(&DATAPOINTINCLUSIONANNOTATION_MEMBER_PROFILE_ID, val)?;
61 }
62 if let Some(ref val) = self.statistic_id {
63 ser.write_string(&DATAPOINTINCLUSIONANNOTATION_MEMBER_STATISTIC_ID, val)?;
64 }
65 if let Some(ref val) = self.inclusion_annotation {
66 ser.write_string(&DATAPOINTINCLUSIONANNOTATION_MEMBER_INCLUSION_ANNOTATION, val.as_str())?;
67 }
68 Ok(())
69 }
70}
71impl crate::types::builders::DatapointInclusionAnnotationBuilder {
72 #[allow(
73 unused_variables,
74 unreachable_code,
75 clippy::single_match,
76 clippy::match_single_binding,
77 clippy::diverging_sub_expression
78 )]
79 pub(crate) fn deserialize_members(
80 &mut self,
81 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
82 ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
83 deserializer.read_struct(&DATAPOINTINCLUSIONANNOTATION_SCHEMA, &mut |member, deser| {
84 match member.member_index() {
85 Some(0) => {
86 if deser.is_null() {
87 deser.read_null()?;
88 } else {
89 self.profile_id = Some(deser.read_string(member)?);
90 }
91 }
92 Some(1) => {
93 if deser.is_null() {
94 deser.read_null()?;
95 } else {
96 self.statistic_id = Some(deser.read_string(member)?);
97 }
98 }
99 Some(2) => {
100 if deser.is_null() {
101 deser.read_null()?;
102 } else {
103 self.inclusion_annotation = Some(crate::types::InclusionAnnotationValue::from(deser.read_string(member)?.as_str()));
104 }
105 }
106 _ => {}
107 }
108 Ok(())
109 })
110 }
111}
112
113impl crate::types::DatapointInclusionAnnotation {
114 pub fn deserialize(
116 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
117 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
118 let mut builder = Self::builder();
119 builder.deserialize_members(deserializer)?;
120 Ok(builder.build())
121 }
122}