38 38 | "com.amazonaws.ec2.synthetic",
|
39 39 | "GetHostReservationPurchasePreviewOutput",
|
40 40 | );
|
41 41 | static GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_MEMBER_CURRENCY_CODE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
42 42 | ::aws_smithy_schema::ShapeId::from_static(
|
43 43 | "com.amazonaws.ec2.synthetic#GetHostReservationPurchasePreviewOutput$CurrencyCode",
|
44 44 | "com.amazonaws.ec2.synthetic",
|
45 45 | "GetHostReservationPurchasePreviewOutput",
|
46 46 | ),
|
47 47 | ::aws_smithy_schema::ShapeType::String,
|
48 - | "currency_code",
|
48 + | "CurrencyCode",
|
49 49 | 0,
|
50 50 | )
|
51 51 | .with_xml_name("currencyCode");
|
52 52 | static GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_MEMBER_PURCHASE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
53 53 | ::aws_smithy_schema::ShapeId::from_static(
|
54 54 | "com.amazonaws.ec2.synthetic#GetHostReservationPurchasePreviewOutput$Purchase",
|
55 55 | "com.amazonaws.ec2.synthetic",
|
56 56 | "GetHostReservationPurchasePreviewOutput",
|
57 57 | ),
|
58 58 | ::aws_smithy_schema::ShapeType::List,
|
59 - | "purchase",
|
59 + | "Purchase",
|
60 60 | 1,
|
61 61 | )
|
62 62 | .with_xml_name("purchase");
|
63 63 | static GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_MEMBER_TOTAL_HOURLY_PRICE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
64 64 | ::aws_smithy_schema::ShapeId::from_static(
|
65 65 | "com.amazonaws.ec2.synthetic#GetHostReservationPurchasePreviewOutput$TotalHourlyPrice",
|
66 66 | "com.amazonaws.ec2.synthetic",
|
67 67 | "GetHostReservationPurchasePreviewOutput",
|
68 68 | ),
|
69 69 | ::aws_smithy_schema::ShapeType::String,
|
70 - | "total_hourly_price",
|
70 + | "TotalHourlyPrice",
|
71 71 | 2,
|
72 72 | )
|
73 73 | .with_xml_name("totalHourlyPrice");
|
74 74 | static GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_MEMBER_TOTAL_UPFRONT_PRICE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
75 75 | ::aws_smithy_schema::ShapeId::from_static(
|
76 76 | "com.amazonaws.ec2.synthetic#GetHostReservationPurchasePreviewOutput$TotalUpfrontPrice",
|
77 77 | "com.amazonaws.ec2.synthetic",
|
78 78 | "GetHostReservationPurchasePreviewOutput",
|
79 79 | ),
|
80 80 | ::aws_smithy_schema::ShapeType::String,
|
81 - | "total_upfront_price",
|
81 + | "TotalUpfrontPrice",
|
82 82 | 3,
|
83 83 | )
|
84 84 | .with_xml_name("totalUpfrontPrice");
|
85 + | static GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
86 + | ::aws_smithy_schema::ShapeId::from_static("synthetic#request_id", "synthetic", "request_id"),
|
87 + | ::aws_smithy_schema::ShapeType::String,
|
88 + | "request_id",
|
89 + | 4,
|
90 + | )
|
91 + | .with_http_header("x-amzn-requestid");
|
85 92 | static GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
86 93 | GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_SCHEMA_ID,
|
87 94 | ::aws_smithy_schema::ShapeType::Structure,
|
88 95 | &[
|
89 96 | &GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_MEMBER_CURRENCY_CODE,
|
90 97 | &GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_MEMBER_PURCHASE,
|
91 98 | &GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_MEMBER_TOTAL_HOURLY_PRICE,
|
92 99 | &GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_MEMBER_TOTAL_UPFRONT_PRICE,
|
100 + | &GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_MEMBER__REQUEST_ID,
|
93 101 | ],
|
94 102 | );
|
95 103 | impl GetHostReservationPurchasePreviewOutput {
|
96 104 | /// The schema for this shape.
|
97 105 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_SCHEMA;
|
98 106 | }
|
99 107 | impl ::aws_smithy_schema::serde::SerializableStruct for GetHostReservationPurchasePreviewOutput {
|
100 108 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
101 109 | fn serialize_members(
|
102 110 | &self,
|
103 111 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
104 112 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
105 113 | if let Some(ref val) = self.currency_code {
|
106 114 | ser.write_string(&GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_MEMBER_CURRENCY_CODE, val.as_str())?;
|
107 115 | }
|
108 116 | if let Some(ref val) = self.purchase {
|
109 117 | ser.write_list(
|
110 118 | &GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_MEMBER_PURCHASE,
|
111 119 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
112 120 | for item in val {
|
113 121 | ser.write_struct(crate::types::Purchase::SCHEMA, item)?;
|
114 122 | }
|
115 123 | Ok(())
|
116 124 | },
|
117 125 | )?;
|
118 126 | }
|
119 127 | if let Some(ref val) = self.total_hourly_price {
|
120 128 | ser.write_string(&GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_MEMBER_TOTAL_HOURLY_PRICE, val)?;
|
121 129 | }
|
122 130 | if let Some(ref val) = self.total_upfront_price {
|
123 131 | ser.write_string(&GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_MEMBER_TOTAL_UPFRONT_PRICE, val)?;
|
124 132 | }
|
125 133 | Ok(())
|
126 134 | }
|
127 135 | }
|
128 136 | impl GetHostReservationPurchasePreviewOutput {
|
129 137 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
130 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
131 - | deserializer: &mut D,
|
138 + | pub fn deserialize(
|
139 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
140 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
141 + | #[allow(unused_variables, unused_mut)]
|
142 + | let mut builder = Self::builder();
|
143 + | #[allow(
|
144 + | unused_variables,
|
145 + | unreachable_code,
|
146 + | clippy::single_match,
|
147 + | clippy::match_single_binding,
|
148 + | clippy::diverging_sub_expression
|
149 + | )]
|
150 + | deserializer.read_struct(&GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_SCHEMA, &mut |member, deser| {
|
151 + | match member.member_index() {
|
152 + | Some(0) => {
|
153 + | builder.currency_code = Some(crate::types::CurrencyCodeValues::from(deser.read_string(member)?.as_str()));
|
154 + | }
|
155 + | Some(1) => {
|
156 + | builder.purchase = Some({
|
157 + | let mut container = Vec::new();
|
158 + | deser.read_list(member, &mut |deser| {
|
159 + | container.push(crate::types::Purchase::deserialize(deser)?);
|
160 + | Ok(())
|
161 + | })?;
|
162 + | container
|
163 + | });
|
164 + | }
|
165 + | Some(2) => {
|
166 + | builder.total_hourly_price = Some(deser.read_string(member)?);
|
167 + | }
|
168 + | Some(3) => {
|
169 + | builder.total_upfront_price = Some(deser.read_string(member)?);
|
170 + | }
|
171 + | Some(4) => {
|
172 + | builder._request_id = Some(deser.read_string(member)?);
|
173 + | }
|
174 + | _ => {}
|
175 + | }
|
176 + | Ok(())
|
177 + | })?;
|
178 + | Ok(builder.build())
|
179 + | }
|
180 + | }
|
181 + | impl GetHostReservationPurchasePreviewOutput {
|
182 + | /// Deserializes this structure from a body deserializer and HTTP response headers.
|
183 + | /// Header-bound members are read directly from headers, avoiding runtime
|
184 + | /// member iteration overhead. Body members are read via the deserializer.
|
185 + | pub fn deserialize_with_response(
|
186 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
187 + | headers: &::aws_smithy_runtime_api::http::Headers,
|
188 + | _status: u16,
|
189 + | _body: &[u8],
|
132 190 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
133 191 | #[allow(unused_variables, unused_mut)]
|
134 192 | let mut builder = Self::builder();
|
193 + | if let Some(val) = headers.get("x-amzn-requestid") {
|
194 + | builder._request_id = Some(val.to_string());
|
195 + | }
|
135 196 | #[allow(
|
136 197 | unused_variables,
|
137 198 | unreachable_code,
|
138 199 | clippy::single_match,
|
139 200 | clippy::match_single_binding,
|
140 201 | clippy::diverging_sub_expression
|
141 202 | )]
|
142 - | deserializer.read_struct(&GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_SCHEMA, (), |_, member, deser| {
|
203 + | deserializer.read_struct(&GETHOSTRESERVATIONPURCHASEPREVIEWOUTPUT_SCHEMA, &mut |member, deser| {
|
143 204 | match member.member_index() {
|
144 205 | Some(0) => {
|
145 206 | builder.currency_code = Some(crate::types::CurrencyCodeValues::from(deser.read_string(member)?.as_str()));
|
146 207 | }
|
147 208 | Some(1) => {
|
148 209 | builder.purchase = Some({
|
149 - | let container = if let Some(cap) = deser.container_size() {
|
150 - | Vec::with_capacity(cap)
|
151 - | } else {
|
152 - | Vec::new()
|
153 - | };
|
154 - | deser.read_list(member, container, |mut list, deser| {
|
155 - | list.push(crate::types::Purchase::deserialize(deser)?);
|
156 - | Ok(list)
|
157 - | })?
|
210 + | let mut container = Vec::new();
|
211 + | deser.read_list(member, &mut |deser| {
|
212 + | container.push(crate::types::Purchase::deserialize(deser)?);
|
213 + | Ok(())
|
214 + | })?;
|
215 + | container
|
158 216 | });
|
159 217 | }
|
160 218 | Some(2) => {
|
161 219 | builder.total_hourly_price = Some(deser.read_string(member)?);
|
162 220 | }
|
163 221 | Some(3) => {
|
164 222 | builder.total_upfront_price = Some(deser.read_string(member)?);
|
165 223 | }
|
166 224 | _ => {}
|
167 225 | }
|