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