44 44 | "com.amazonaws.timestreamquery",
|
45 45 | "MixedMeasureMapping",
|
46 46 | );
|
47 47 | static MIXEDMEASUREMAPPING_MEMBER_MEASURE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
48 48 | ::aws_smithy_schema::ShapeId::from_static(
|
49 49 | "com.amazonaws.timestreamquery#MixedMeasureMapping$MeasureName",
|
50 50 | "com.amazonaws.timestreamquery",
|
51 51 | "MixedMeasureMapping",
|
52 52 | ),
|
53 53 | ::aws_smithy_schema::ShapeType::String,
|
54 - | "measure_name",
|
54 + | "MeasureName",
|
55 55 | 0,
|
56 56 | );
|
57 57 | static MIXEDMEASUREMAPPING_MEMBER_SOURCE_COLUMN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
58 58 | ::aws_smithy_schema::ShapeId::from_static(
|
59 59 | "com.amazonaws.timestreamquery#MixedMeasureMapping$SourceColumn",
|
60 60 | "com.amazonaws.timestreamquery",
|
61 61 | "MixedMeasureMapping",
|
62 62 | ),
|
63 63 | ::aws_smithy_schema::ShapeType::String,
|
64 - | "source_column",
|
64 + | "SourceColumn",
|
65 65 | 1,
|
66 66 | );
|
67 67 | static MIXEDMEASUREMAPPING_MEMBER_TARGET_MEASURE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
68 68 | ::aws_smithy_schema::ShapeId::from_static(
|
69 69 | "com.amazonaws.timestreamquery#MixedMeasureMapping$TargetMeasureName",
|
70 70 | "com.amazonaws.timestreamquery",
|
71 71 | "MixedMeasureMapping",
|
72 72 | ),
|
73 73 | ::aws_smithy_schema::ShapeType::String,
|
74 - | "target_measure_name",
|
74 + | "TargetMeasureName",
|
75 75 | 2,
|
76 76 | );
|
77 77 | static MIXEDMEASUREMAPPING_MEMBER_MEASURE_VALUE_TYPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
78 78 | ::aws_smithy_schema::ShapeId::from_static(
|
79 79 | "com.amazonaws.timestreamquery#MixedMeasureMapping$MeasureValueType",
|
80 80 | "com.amazonaws.timestreamquery",
|
81 81 | "MixedMeasureMapping",
|
82 82 | ),
|
83 83 | ::aws_smithy_schema::ShapeType::String,
|
84 - | "measure_value_type",
|
84 + | "MeasureValueType",
|
85 85 | 3,
|
86 86 | );
|
87 87 | static MIXEDMEASUREMAPPING_MEMBER_MULTI_MEASURE_ATTRIBUTE_MAPPINGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
88 88 | ::aws_smithy_schema::ShapeId::from_static(
|
89 89 | "com.amazonaws.timestreamquery#MixedMeasureMapping$MultiMeasureAttributeMappings",
|
90 90 | "com.amazonaws.timestreamquery",
|
91 91 | "MixedMeasureMapping",
|
92 92 | ),
|
93 93 | ::aws_smithy_schema::ShapeType::List,
|
94 - | "multi_measure_attribute_mappings",
|
94 + | "MultiMeasureAttributeMappings",
|
95 95 | 4,
|
96 96 | );
|
97 97 | static MIXEDMEASUREMAPPING_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
98 98 | MIXEDMEASUREMAPPING_SCHEMA_ID,
|
99 99 | ::aws_smithy_schema::ShapeType::Structure,
|
100 100 | &[
|
101 101 | &MIXEDMEASUREMAPPING_MEMBER_MEASURE_NAME,
|
102 102 | &MIXEDMEASUREMAPPING_MEMBER_SOURCE_COLUMN,
|
103 103 | &MIXEDMEASUREMAPPING_MEMBER_TARGET_MEASURE_NAME,
|
104 104 | &MIXEDMEASUREMAPPING_MEMBER_MEASURE_VALUE_TYPE,
|
105 105 | &MIXEDMEASUREMAPPING_MEMBER_MULTI_MEASURE_ATTRIBUTE_MAPPINGS,
|
106 106 | ],
|
107 107 | );
|
108 108 | impl MixedMeasureMapping {
|
109 109 | /// The schema for this shape.
|
110 110 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MIXEDMEASUREMAPPING_SCHEMA;
|
111 111 | }
|
112 112 | impl ::aws_smithy_schema::serde::SerializableStruct for MixedMeasureMapping {
|
113 113 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
114 114 | fn serialize_members(
|
115 115 | &self,
|
116 116 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
117 117 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
118 118 | if let Some(ref val) = self.measure_name {
|
119 119 | ser.write_string(&MIXEDMEASUREMAPPING_MEMBER_MEASURE_NAME, val)?;
|
120 120 | }
|
121 121 | if let Some(ref val) = self.source_column {
|
122 122 | ser.write_string(&MIXEDMEASUREMAPPING_MEMBER_SOURCE_COLUMN, val)?;
|
123 123 | }
|
124 124 | if let Some(ref val) = self.target_measure_name {
|
125 125 | ser.write_string(&MIXEDMEASUREMAPPING_MEMBER_TARGET_MEASURE_NAME, val)?;
|
126 126 | }
|
127 127 | {
|
128 128 | let val = &self.measure_value_type;
|
129 129 | ser.write_string(&MIXEDMEASUREMAPPING_MEMBER_MEASURE_VALUE_TYPE, val.as_str())?;
|
130 130 | }
|
131 131 | if let Some(ref val) = self.multi_measure_attribute_mappings {
|
132 132 | ser.write_list(
|
133 133 | &MIXEDMEASUREMAPPING_MEMBER_MULTI_MEASURE_ATTRIBUTE_MAPPINGS,
|
134 134 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
135 135 | for item in val {
|
136 136 | ser.write_struct(crate::types::MultiMeasureAttributeMapping::SCHEMA, item)?;
|
137 137 | }
|
138 138 | Ok(())
|
139 139 | },
|
140 140 | )?;
|
141 141 | }
|
142 142 | Ok(())
|
143 143 | }
|
144 144 | }
|
145 145 | impl MixedMeasureMapping {
|
146 146 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
147 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
148 - | deserializer: &mut D,
|
147 + | pub fn deserialize(
|
148 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
149 149 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
150 150 | #[allow(unused_variables, unused_mut)]
|
151 151 | let mut builder = Self::builder();
|
152 152 | #[allow(
|
153 153 | unused_variables,
|
154 154 | unreachable_code,
|
155 155 | clippy::single_match,
|
156 156 | clippy::match_single_binding,
|
157 157 | clippy::diverging_sub_expression
|
158 158 | )]
|
159 - | deserializer.read_struct(&MIXEDMEASUREMAPPING_SCHEMA, (), |_, member, deser| {
|
159 + | deserializer.read_struct(&MIXEDMEASUREMAPPING_SCHEMA, &mut |member, deser| {
|
160 160 | match member.member_index() {
|
161 161 | Some(0) => {
|
162 162 | builder.measure_name = Some(deser.read_string(member)?);
|
163 163 | }
|
164 164 | Some(1) => {
|
165 165 | builder.source_column = Some(deser.read_string(member)?);
|
166 166 | }
|
167 167 | Some(2) => {
|
168 168 | builder.target_measure_name = Some(deser.read_string(member)?);
|
169 169 | }
|
170 170 | Some(3) => {
|
171 171 | builder.measure_value_type = Some(crate::types::MeasureValueType::from(deser.read_string(member)?.as_str()));
|
172 172 | }
|
173 173 | Some(4) => {
|
174 174 | builder.multi_measure_attribute_mappings = Some({
|
175 - | let container = if let Some(cap) = deser.container_size() {
|
176 - | Vec::with_capacity(cap)
|
177 - | } else {
|
178 - | Vec::new()
|
179 - | };
|
180 - | deser.read_list(member, container, |mut list, deser| {
|
181 - | list.push(crate::types::MultiMeasureAttributeMapping::deserialize(deser)?);
|
182 - | Ok(list)
|
183 - | })?
|
175 + | let mut container = Vec::new();
|
176 + | deser.read_list(member, &mut |deser| {
|
177 + | container.push(crate::types::MultiMeasureAttributeMapping::deserialize(deser)?);
|
178 + | Ok(())
|
179 + | })?;
|
180 + | container
|
184 181 | });
|
185 182 | }
|
186 183 | _ => {}
|
187 184 | }
|
188 185 | Ok(())
|
189 186 | })?;
|
190 187 | builder
|
191 188 | .build()
|
192 189 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
193 190 | }
|
194 191 | }
|
192 + | impl MixedMeasureMapping {
|
193 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
194 + | pub fn deserialize_with_response(
|
195 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
196 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
197 + | _status: u16,
|
198 + | _body: &[u8],
|
199 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
200 + | Self::deserialize(deserializer)
|
201 + | }
|
202 + | }
|
195 203 | impl MixedMeasureMapping {
|
196 204 | /// Creates a new builder-style object to manufacture [`MixedMeasureMapping`](crate::types::MixedMeasureMapping).
|
197 205 | pub fn builder() -> crate::types::builders::MixedMeasureMappingBuilder {
|
198 206 | crate::types::builders::MixedMeasureMappingBuilder::default()
|
199 207 | }
|
200 208 | }
|
201 209 |
|
202 210 | /// A builder for [`MixedMeasureMapping`](crate::types::MixedMeasureMapping).
|
203 211 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
204 212 | #[non_exhaustive]
|