104 104 | "com.amazonaws.ec2.synthetic",
|
105 105 | "GetCapacityReservationUsageOutput",
|
106 106 | );
|
107 107 | static GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
108 108 | ::aws_smithy_schema::ShapeId::from_static(
|
109 109 | "com.amazonaws.ec2.synthetic#GetCapacityReservationUsageOutput$NextToken",
|
110 110 | "com.amazonaws.ec2.synthetic",
|
111 111 | "GetCapacityReservationUsageOutput",
|
112 112 | ),
|
113 113 | ::aws_smithy_schema::ShapeType::String,
|
114 - | "next_token",
|
114 + | "NextToken",
|
115 115 | 0,
|
116 116 | )
|
117 117 | .with_xml_name("nextToken");
|
118 118 | static GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_CAPACITY_RESERVATION_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
119 119 | ::aws_smithy_schema::ShapeId::from_static(
|
120 120 | "com.amazonaws.ec2.synthetic#GetCapacityReservationUsageOutput$CapacityReservationId",
|
121 121 | "com.amazonaws.ec2.synthetic",
|
122 122 | "GetCapacityReservationUsageOutput",
|
123 123 | ),
|
124 124 | ::aws_smithy_schema::ShapeType::String,
|
125 - | "capacity_reservation_id",
|
125 + | "CapacityReservationId",
|
126 126 | 1,
|
127 127 | )
|
128 128 | .with_xml_name("capacityReservationId");
|
129 129 | static GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_INSTANCE_TYPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
130 130 | ::aws_smithy_schema::ShapeId::from_static(
|
131 131 | "com.amazonaws.ec2.synthetic#GetCapacityReservationUsageOutput$InstanceType",
|
132 132 | "com.amazonaws.ec2.synthetic",
|
133 133 | "GetCapacityReservationUsageOutput",
|
134 134 | ),
|
135 135 | ::aws_smithy_schema::ShapeType::String,
|
136 - | "instance_type",
|
136 + | "InstanceType",
|
137 137 | 2,
|
138 138 | )
|
139 139 | .with_xml_name("instanceType");
|
140 140 | static GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_TOTAL_INSTANCE_COUNT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
141 141 | ::aws_smithy_schema::ShapeId::from_static(
|
142 142 | "com.amazonaws.ec2.synthetic#GetCapacityReservationUsageOutput$TotalInstanceCount",
|
143 143 | "com.amazonaws.ec2.synthetic",
|
144 144 | "GetCapacityReservationUsageOutput",
|
145 145 | ),
|
146 146 | ::aws_smithy_schema::ShapeType::Integer,
|
147 - | "total_instance_count",
|
147 + | "TotalInstanceCount",
|
148 148 | 3,
|
149 149 | )
|
150 150 | .with_xml_name("totalInstanceCount");
|
151 151 | static GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_AVAILABLE_INSTANCE_COUNT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
152 152 | ::aws_smithy_schema::ShapeId::from_static(
|
153 153 | "com.amazonaws.ec2.synthetic#GetCapacityReservationUsageOutput$AvailableInstanceCount",
|
154 154 | "com.amazonaws.ec2.synthetic",
|
155 155 | "GetCapacityReservationUsageOutput",
|
156 156 | ),
|
157 157 | ::aws_smithy_schema::ShapeType::Integer,
|
158 - | "available_instance_count",
|
158 + | "AvailableInstanceCount",
|
159 159 | 4,
|
160 160 | )
|
161 161 | .with_xml_name("availableInstanceCount");
|
162 162 | static GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_STATE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
163 163 | ::aws_smithy_schema::ShapeId::from_static(
|
164 164 | "com.amazonaws.ec2.synthetic#GetCapacityReservationUsageOutput$State",
|
165 165 | "com.amazonaws.ec2.synthetic",
|
166 166 | "GetCapacityReservationUsageOutput",
|
167 167 | ),
|
168 168 | ::aws_smithy_schema::ShapeType::String,
|
169 - | "state",
|
169 + | "State",
|
170 170 | 5,
|
171 171 | )
|
172 172 | .with_xml_name("state");
|
173 173 | static GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_INSTANCE_USAGES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
174 174 | ::aws_smithy_schema::ShapeId::from_static(
|
175 175 | "com.amazonaws.ec2.synthetic#GetCapacityReservationUsageOutput$InstanceUsages",
|
176 176 | "com.amazonaws.ec2.synthetic",
|
177 177 | "GetCapacityReservationUsageOutput",
|
178 178 | ),
|
179 179 | ::aws_smithy_schema::ShapeType::List,
|
180 - | "instance_usages",
|
180 + | "InstanceUsages",
|
181 181 | 6,
|
182 182 | )
|
183 183 | .with_xml_name("instanceUsageSet");
|
184 + | static GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
185 + | ::aws_smithy_schema::ShapeId::from_static("synthetic#request_id", "synthetic", "request_id"),
|
186 + | ::aws_smithy_schema::ShapeType::String,
|
187 + | "request_id",
|
188 + | 7,
|
189 + | )
|
190 + | .with_http_header("x-amzn-requestid");
|
184 191 | static GETCAPACITYRESERVATIONUSAGEOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
185 192 | GETCAPACITYRESERVATIONUSAGEOUTPUT_SCHEMA_ID,
|
186 193 | ::aws_smithy_schema::ShapeType::Structure,
|
187 194 | &[
|
188 195 | &GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_NEXT_TOKEN,
|
189 196 | &GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_CAPACITY_RESERVATION_ID,
|
190 197 | &GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_INSTANCE_TYPE,
|
191 198 | &GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_TOTAL_INSTANCE_COUNT,
|
192 199 | &GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_AVAILABLE_INSTANCE_COUNT,
|
193 200 | &GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_STATE,
|
194 201 | &GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_INSTANCE_USAGES,
|
202 + | &GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER__REQUEST_ID,
|
195 203 | ],
|
196 204 | );
|
197 205 | impl GetCapacityReservationUsageOutput {
|
198 206 | /// The schema for this shape.
|
199 207 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GETCAPACITYRESERVATIONUSAGEOUTPUT_SCHEMA;
|
200 208 | }
|
201 209 | impl ::aws_smithy_schema::serde::SerializableStruct for GetCapacityReservationUsageOutput {
|
202 210 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
203 211 | fn serialize_members(
|
204 212 | &self,
|
205 213 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
206 214 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
207 215 | if let Some(ref val) = self.next_token {
|
208 216 | ser.write_string(&GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_NEXT_TOKEN, val)?;
|
209 217 | }
|
210 218 | if let Some(ref val) = self.capacity_reservation_id {
|
211 219 | ser.write_string(&GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_CAPACITY_RESERVATION_ID, val)?;
|
212 220 | }
|
213 221 | if let Some(ref val) = self.instance_type {
|
214 222 | ser.write_string(&GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_INSTANCE_TYPE, val)?;
|
215 223 | }
|
216 224 | if let Some(ref val) = self.total_instance_count {
|
217 225 | ser.write_integer(&GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_TOTAL_INSTANCE_COUNT, *val)?;
|
218 226 | }
|
219 227 | if let Some(ref val) = self.available_instance_count {
|
220 228 | ser.write_integer(&GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_AVAILABLE_INSTANCE_COUNT, *val)?;
|
221 229 | }
|
222 230 | if let Some(ref val) = self.state {
|
223 231 | ser.write_string(&GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_STATE, val.as_str())?;
|
224 232 | }
|
225 233 | if let Some(ref val) = self.instance_usages {
|
226 234 | ser.write_list(
|
227 235 | &GETCAPACITYRESERVATIONUSAGEOUTPUT_MEMBER_INSTANCE_USAGES,
|
228 236 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
229 237 | for item in val {
|
230 238 | ser.write_struct(crate::types::InstanceUsage::SCHEMA, item)?;
|
231 239 | }
|
232 240 | Ok(())
|
233 241 | },
|
234 242 | )?;
|
235 243 | }
|
236 244 | Ok(())
|
237 245 | }
|
238 246 | }
|
239 247 | impl GetCapacityReservationUsageOutput {
|
240 248 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
241 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
242 - | deserializer: &mut D,
|
249 + | pub fn deserialize(
|
250 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
243 251 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
244 252 | #[allow(unused_variables, unused_mut)]
|
245 253 | let mut builder = Self::builder();
|
246 254 | #[allow(
|
247 255 | unused_variables,
|
248 256 | unreachable_code,
|
249 257 | clippy::single_match,
|
250 258 | clippy::match_single_binding,
|
251 259 | clippy::diverging_sub_expression
|
252 260 | )]
|
253 - | deserializer.read_struct(&GETCAPACITYRESERVATIONUSAGEOUTPUT_SCHEMA, (), |_, member, deser| {
|
261 + | deserializer.read_struct(&GETCAPACITYRESERVATIONUSAGEOUTPUT_SCHEMA, &mut |member, deser| {
|
262 + | match member.member_index() {
|
263 + | Some(0) => {
|
264 + | builder.next_token = Some(deser.read_string(member)?);
|
265 + | }
|
266 + | Some(1) => {
|
267 + | builder.capacity_reservation_id = Some(deser.read_string(member)?);
|
268 + | }
|
269 + | Some(2) => {
|
270 + | builder.instance_type = Some(deser.read_string(member)?);
|
271 + | }
|
272 + | Some(3) => {
|
273 + | builder.total_instance_count = Some(deser.read_integer(member)?);
|
274 + | }
|
275 + | Some(4) => {
|
276 + | builder.available_instance_count = Some(deser.read_integer(member)?);
|
277 + | }
|
278 + | Some(5) => {
|
279 + | builder.state = Some(crate::types::CapacityReservationState::from(deser.read_string(member)?.as_str()));
|
280 + | }
|
281 + | Some(6) => {
|
282 + | builder.instance_usages = Some({
|
283 + | let mut container = Vec::new();
|
284 + | deser.read_list(member, &mut |deser| {
|
285 + | container.push(crate::types::InstanceUsage::deserialize(deser)?);
|
286 + | Ok(())
|
287 + | })?;
|
288 + | container
|
289 + | });
|
290 + | }
|
291 + | Some(7) => {
|
292 + | builder._request_id = Some(deser.read_string(member)?);
|
293 + | }
|
294 + | _ => {}
|
295 + | }
|
296 + | Ok(())
|
297 + | })?;
|
298 + | Ok(builder.build())
|
299 + | }
|
300 + | }
|
301 + | impl GetCapacityReservationUsageOutput {
|
302 + | /// Deserializes this structure from a body deserializer and HTTP response headers.
|
303 + | /// Header-bound members are read directly from headers, avoiding runtime
|
304 + | /// member iteration overhead. Body members are read via the deserializer.
|
305 + | pub fn deserialize_with_response(
|
306 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
307 + | headers: &::aws_smithy_runtime_api::http::Headers,
|
308 + | _status: u16,
|
309 + | _body: &[u8],
|
310 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
311 + | #[allow(unused_variables, unused_mut)]
|
312 + | let mut builder = Self::builder();
|
313 + | if let Some(val) = headers.get("x-amzn-requestid") {
|
314 + | builder._request_id = Some(val.to_string());
|
315 + | }
|
316 + | #[allow(
|
317 + | unused_variables,
|
318 + | unreachable_code,
|
319 + | clippy::single_match,
|
320 + | clippy::match_single_binding,
|
321 + | clippy::diverging_sub_expression
|
322 + | )]
|
323 + | deserializer.read_struct(&GETCAPACITYRESERVATIONUSAGEOUTPUT_SCHEMA, &mut |member, deser| {
|
254 324 | match member.member_index() {
|
255 325 | Some(0) => {
|
256 326 | builder.next_token = Some(deser.read_string(member)?);
|
257 327 | }
|
258 328 | Some(1) => {
|
259 329 | builder.capacity_reservation_id = Some(deser.read_string(member)?);
|
260 330 | }
|
261 331 | Some(2) => {
|
262 332 | builder.instance_type = Some(deser.read_string(member)?);
|
263 333 | }
|
264 334 | Some(3) => {
|
265 335 | builder.total_instance_count = Some(deser.read_integer(member)?);
|
266 336 | }
|
267 337 | Some(4) => {
|
268 338 | builder.available_instance_count = Some(deser.read_integer(member)?);
|
269 339 | }
|
270 340 | Some(5) => {
|
271 341 | builder.state = Some(crate::types::CapacityReservationState::from(deser.read_string(member)?.as_str()));
|
272 342 | }
|
273 343 | Some(6) => {
|
274 344 | builder.instance_usages = Some({
|
275 - | let container = if let Some(cap) = deser.container_size() {
|
276 - | Vec::with_capacity(cap)
|
277 - | } else {
|
278 - | Vec::new()
|
279 - | };
|
280 - | deser.read_list(member, container, |mut list, deser| {
|
281 - | list.push(crate::types::InstanceUsage::deserialize(deser)?);
|
282 - | Ok(list)
|
283 - | })?
|
345 + | let mut container = Vec::new();
|
346 + | deser.read_list(member, &mut |deser| {
|
347 + | container.push(crate::types::InstanceUsage::deserialize(deser)?);
|
348 + | Ok(())
|
349 + | })?;
|
350 + | container
|
284 351 | });
|
285 352 | }
|
286 353 | _ => {}
|
287 354 | }
|
288 355 | Ok(())
|
289 356 | })?;
|
290 357 | Ok(builder.build())
|
291 358 | }
|
292 359 | }
|
293 360 | impl ::aws_types::request_id::RequestId for GetCapacityReservationUsageOutput {
|