83 92 | runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
|
84 93 | }
|
85 94 | runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
|
86 95 | config_override,
|
87 96 | client_config.config.clone(),
|
88 97 | &client_config.runtime_components,
|
89 98 | ));
|
90 99 | }
|
91 100 | runtime_plugins
|
92 101 | }
|
102 + | /* OperationGenerator.kt:85 */
|
93 103 | }
|
104 + | /* OperationRuntimePluginGenerator.kt:55 */
|
94 105 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for FlattenedXmlMapWithXmlName {
|
95 106 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
96 107 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("FlattenedXmlMapWithXmlName");
|
97 108 |
|
98 109 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
|
99 110 | FlattenedXmlMapWithXmlNameRequestSerializer,
|
100 111 | ));
|
101 112 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
|
102 113 | FlattenedXmlMapWithXmlNameResponseDeserializer,
|
103 114 | ));
|
104 115 |
|
105 116 | cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
|
106 117 | ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
|
107 118 | ));
|
108 119 |
|
109 120 | cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
|
110 121 | "FlattenedXmlMapWithXmlName",
|
111 122 | "Query Protocol",
|
112 123 | ));
|
113 124 |
|
114 125 | ::std::option::Option::Some(cfg.freeze())
|
115 126 | }
|
116 127 |
|
117 128 | fn runtime_components(
|
118 129 | &self,
|
119 130 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
120 131 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
121 132 | #[allow(unused_mut)]
|
122 133 | let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("FlattenedXmlMapWithXmlName")
|
123 134 | .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
|
124 135 | .with_interceptor(FlattenedXmlMapWithXmlNameEndpointParamsInterceptor)
|
125 136 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
|
126 137 | crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError,
|
127 138 | >::new())
|
128 139 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
|
129 140 | crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError,
|
130 141 | >::new());
|
131 142 |
|
132 143 | ::std::borrow::Cow::Owned(rcb)
|
133 144 | }
|
134 145 | }
|
135 146 |
|
147 + | /* ResponseDeserializerGenerator.kt:64 */
|
136 148 | #[derive(Debug)]
|
137 149 | struct FlattenedXmlMapWithXmlNameResponseDeserializer;
|
138 150 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for FlattenedXmlMapWithXmlNameResponseDeserializer {
|
139 151 | fn deserialize_nonstreaming(
|
140 152 | &self,
|
141 153 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
142 154 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
143 155 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
144 156 | let headers = response.headers();
|
145 157 | let body = response.body().bytes().expect("body loaded");
|
146 158 | #[allow(unused_mut)]
|
147 159 | let mut force_error = false;
|
148 160 |
|
149 161 | let parse_result = if !success && status != 200 || force_error {
|
150 162 | crate::protocol_serde::shape_flattened_xml_map_with_xml_name::de_flattened_xml_map_with_xml_name_http_error(status, headers, body)
|
151 163 | } else {
|
152 164 | crate::protocol_serde::shape_flattened_xml_map_with_xml_name::de_flattened_xml_map_with_xml_name_http_response(status, headers, body)
|
153 165 | };
|
154 166 | crate::protocol_serde::type_erase_result(parse_result)
|
155 167 | }
|
156 168 | }
|
169 + | /* RequestSerializerGenerator.kt:67 */
|
157 170 | #[derive(Debug)]
|
158 171 | struct FlattenedXmlMapWithXmlNameRequestSerializer;
|
159 172 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for FlattenedXmlMapWithXmlNameRequestSerializer {
|
160 173 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
161 174 | fn serialize_input(
|
162 175 | &self,
|
163 176 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
164 177 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
165 178 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
166 179 | let input = input
|
167 180 | .downcast::<crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameInput>()
|
168 181 | .expect("correct type");
|
169 182 | let _header_serialization_settings = _cfg
|
170 183 | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
171 184 | .cloned()
|
172 185 | .unwrap_or_default();
|
173 186 | let mut request_builder = {
|
174 187 | fn uri_base(
|
175 188 | _input: &crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameInput,
|
176 189 | output: &mut ::std::string::String,
|
177 190 | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
178 191 | use ::std::fmt::Write as _;
|
179 192 | ::std::write!(output, "/").expect("formatting should succeed");
|
180 193 | ::std::result::Result::Ok(())
|
181 194 | }
|
182 195 | #[allow(clippy::unnecessary_wraps)]
|
183 196 | fn update_http_builder(
|
184 197 | input: &crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameInput,
|
185 198 | builder: ::http::request::Builder,
|
186 199 | ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
187 200 | let mut uri = ::std::string::String::new();
|
188 201 | uri_base(input, &mut uri)?;
|
189 202 | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
190 203 | }
|
191 204 | let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
|
192 205 | builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded");
|
193 206 | builder
|
194 207 | };
|
195 208 | let body = ::aws_smithy_types::body::SdkBody::from(
|
196 209 | crate::protocol_serde::shape_flattened_xml_map_with_xml_name_input::ser_flattened_xml_map_with_xml_name_input_input_input(&input)?,
|
197 210 | );
|
198 211 |
|
199 212 | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
200 213 | }
|
201 214 | }
|
215 + | /* EndpointParamsInterceptorGenerator.kt:86 */
|
202 216 | #[derive(Debug)]
|
203 217 | struct FlattenedXmlMapWithXmlNameEndpointParamsInterceptor;
|
204 218 |
|
205 219 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for FlattenedXmlMapWithXmlNameEndpointParamsInterceptor {
|
206 220 | fn name(&self) -> &'static str {
|
207 221 | "FlattenedXmlMapWithXmlNameEndpointParamsInterceptor"
|
208 222 | }
|
209 223 |
|
210 224 | fn read_before_execution(
|
211 225 | &self,
|
212 226 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
213 227 | '_,
|
214 228 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
215 229 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
216 230 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
217 231 | >,
|
218 232 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
219 233 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
220 234 | let _input = context
|
221 235 | .input()
|
222 236 | .downcast_ref::<FlattenedXmlMapWithXmlNameInput>()
|
223 237 | .ok_or("failed to downcast to FlattenedXmlMapWithXmlNameInput")?;
|
224 238 |
|
225 239 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
226 240 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
227 241 | })?;
|
228 242 | cfg.interceptor_state()
|
229 243 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
230 244 | ::std::result::Result::Ok(())
|
231 245 | }
|
232 246 | }
|
233 247 |
|
234 248 | // The get_* functions below are generated from JMESPath expressions in the
|
235 249 | // operationContextParams trait. They target the operation's input shape.
|
236 250 |
|
251 + | /* RustType.kt:516 */
|
237 252 | #[allow(unreachable_code, unused_variables)]
|
253 + | /* RustType.kt:516 */
|
238 254 | #[cfg(test)]
|
255 + | /* ProtocolTestGenerator.kt:98 */
|
239 256 | mod flattened_xml_map_with_xml_name_test {
|
240 257 |
|
241 258 | /// Serializes flattened XML maps in responses that have xmlName on members
|
242 259 | /// Test ID: QueryQueryFlattenedXmlMapWithXmlName
|
243 260 | #[::tokio::test]
|
244 261 | #[::tracing_test::traced_test]
|
245 262 | async fn query_query_flattened_xml_map_with_xml_name_response() {
|
246 263 | let expected_output = crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput::builder()
|
247 264 | .set_my_map(::std::option::Option::Some({
|
248 265 | let mut ret = ::std::collections::HashMap::new();
|
249 266 | ret.insert("a".to_owned(), "A".to_owned());
|
250 267 | ret.insert("b".to_owned(), "B".to_owned());
|
251 268 | ret
|
252 269 | }))
|
253 270 | .build();
|
254 271 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http::response::Builder::new()
|
255 272 | .header("Content-Type", "text/xml")
|
256 273 | .status(200)
|
257 274 | .body(::aws_smithy_types::body::SdkBody::from("<FlattenedXmlMapWithXmlNameResponse xmlns=\"https://example.com/\">\n <FlattenedXmlMapWithXmlNameResult>\n <KVP>\n <K>a</K>\n <V>A</V>\n </KVP>\n <KVP>\n <K>b</K>\n <V>B</V>\n </KVP>\n </FlattenedXmlMapWithXmlNameResult>\n</FlattenedXmlMapWithXmlNameResponse>"))
|
258 275 | .unwrap()
|
259 276 | ).unwrap();
|
260 277 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
261 278 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
262 279 |
|
263 280 | let op = crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlName::new();
|
264 281 | let config = op.config().expect("the operation has config");
|
265 282 | let de = config
|
266 283 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
267 284 | .expect("the config must have a deserializer");
|
268 285 |
|
269 286 | let parsed = de.deserialize_streaming(&mut http_response);
|
270 287 | let parsed = parsed.unwrap_or_else(|| {
|
271 288 | let http_response = http_response.map(|body| {
|
272 289 | ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
273 290 | body.bytes().unwrap(),
|
274 291 | ::aws_smithy_protocol_test::MediaType::from("application/xml"),
|
275 292 | )))
|
276 293 | });
|
277 294 | de.deserialize_nonstreaming(&http_response)
|
278 295 | });
|
279 296 | let parsed = parsed
|
280 297 | .expect("should be successful response")
|
281 298 | .downcast::<crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput>()
|
282 299 | .unwrap();
|
283 300 | ::pretty_assertions::assert_eq!(parsed.my_map, expected_output.my_map, "Unexpected value for `my_map`");
|
284 301 | }
|
302 + |
|
303 + | /* ProtocolTestGenerator.kt:98 */
|
285 304 | }
|
286 305 |
|
306 + | /* OperationErrorGenerator.kt:79 */
|
287 307 | /// Error type for the `FlattenedXmlMapWithXmlNameError` operation.
|
308 + | /* RustType.kt:516 */
|
288 309 | #[non_exhaustive]
|
310 + | /* RustType.kt:516 */
|
289 311 | #[derive(::std::fmt::Debug)]
|
290 - | pub enum FlattenedXmlMapWithXmlNameError {
|
312 + | pub /* OperationErrorGenerator.kt:81 */ enum FlattenedXmlMapWithXmlNameError {
|
313 + | /* OperationErrorGenerator.kt:88 */
|
291 314 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
292 315 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
293 316 | variable wildcard pattern and check `.code()`:
|
294 317 | \
|
295 318 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
296 319 | \
|
297 320 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-FlattenedXmlMapWithXmlNameError) for what information is available for the error.")]
|
298 321 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
322 + | /* OperationErrorGenerator.kt:81 */
|
299 323 | }
|
324 + | /* OperationErrorGenerator.kt:218 */
|
300 325 | impl FlattenedXmlMapWithXmlNameError {
|
326 + | /* OperationErrorGenerator.kt:219 */
|
301 327 | /// Creates the `FlattenedXmlMapWithXmlNameError::Unhandled` variant from any error type.
|
302 328 | pub fn unhandled(
|
303 329 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
304 330 | ) -> Self {
|
305 331 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
306 332 | source: err.into(),
|
307 333 | meta: ::std::default::Default::default(),
|
308 334 | })
|
309 335 | }
|
310 336 |
|
311 337 | /// Creates the `FlattenedXmlMapWithXmlNameError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
312 338 | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
313 339 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
314 340 | source: err.clone().into(),
|
315 341 | meta: err,
|
316 342 | })
|
317 343 | }
|
318 - | ///
|
344 + | /// /* OperationErrorGenerator.kt:236 */
|
319 345 | /// Returns error metadata, which includes the error code, message,
|
320 346 | /// request ID, and potentially additional information.
|
321 347 | ///
|
348 + | /* OperationErrorGenerator.kt:242 */
|
322 349 | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
350 + | /* OperationErrorGenerator.kt:243 */
|
323 351 | match self {
|
324 - | Self::Unhandled(e) => &e.meta,
|
352 + | /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
|
353 + | /* OperationErrorGenerator.kt:243 */
|
325 354 | }
|
355 + | /* OperationErrorGenerator.kt:242 */
|
326 356 | }
|
357 + | /* OperationErrorGenerator.kt:218 */
|
327 358 | }
|
359 + | /* OperationErrorGenerator.kt:269 */
|
328 360 | impl ::std::error::Error for FlattenedXmlMapWithXmlNameError {
|
361 + | /* OperationErrorGenerator.kt:270 */
|
329 362 | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
363 + | /* OperationErrorGenerator.kt:318 */
|
330 364 | match self {
|
331 - | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
365 + | /* OperationErrorGenerator.kt:326 */
|
366 + | Self::Unhandled(_inner) => {
|
367 + | /* OperationErrorGenerator.kt:279 */
|
368 + | ::std::option::Option::Some(&*_inner.source)
|
369 + | /* OperationErrorGenerator.kt:326 */
|
370 + | } /* OperationErrorGenerator.kt:318 */
|
332 371 | }
|
372 + | /* OperationErrorGenerator.kt:270 */
|
333 373 | }
|
374 + | /* OperationErrorGenerator.kt:269 */
|
334 375 | }
|
376 + | /* OperationErrorGenerator.kt:133 */
|
335 377 | impl ::std::fmt::Display for FlattenedXmlMapWithXmlNameError {
|
378 + | /* OperationErrorGenerator.kt:134 */
|
336 379 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
380 + | /* OperationErrorGenerator.kt:318 */
|
337 381 | match self {
|
382 + | /* OperationErrorGenerator.kt:326 */
|
338 383 | Self::Unhandled(_inner) => {
|
384 + | /* OperationErrorGenerator.kt:139 */
|
339 385 | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
340 386 | write!(f, "unhandled error ({code})")
|
341 387 | } else {
|
342 388 | f.write_str("unhandled error")
|
343 389 | }
|
390 + | /* OperationErrorGenerator.kt:326 */
|
391 + | } /* OperationErrorGenerator.kt:318 */
|
344 392 | }
|
393 + | /* OperationErrorGenerator.kt:134 */
|
345 394 | }
|
346 - | }
|
395 + | /* OperationErrorGenerator.kt:133 */
|
347 396 | }
|
397 + | /* OperationErrorGenerator.kt:182 */
|
348 398 | impl ::aws_smithy_types::retry::ProvideErrorKind for FlattenedXmlMapWithXmlNameError {
|
399 + | /* OperationErrorGenerator.kt:186 */
|
349 400 | fn code(&self) -> ::std::option::Option<&str> {
|
401 + | /* OperationErrorGenerator.kt:187 */
|
350 402 | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
403 + | /* OperationErrorGenerator.kt:186 */
|
351 404 | }
|
405 + | /* OperationErrorGenerator.kt:190 */
|
352 406 | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
407 + | /* OperationErrorGenerator.kt:197 */
|
353 408 | ::std::option::Option::None
|
409 + | /* OperationErrorGenerator.kt:190 */
|
354 410 | }
|
411 + | /* OperationErrorGenerator.kt:182 */
|
355 412 | }
|
413 + | /* OperationErrorGenerator.kt:163 */
|
356 414 | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for FlattenedXmlMapWithXmlNameError {
|
415 + | /* OperationErrorGenerator.kt:164 */
|
357 416 | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
417 + | /* OperationErrorGenerator.kt:318 */
|
358 418 | match self {
|
359 - | Self::Unhandled(_inner) => &_inner.meta,
|
419 + | /* OperationErrorGenerator.kt:326 */
|
420 + | Self::Unhandled(_inner) => {
|
421 + | /* OperationErrorGenerator.kt:168 */
|
422 + | &_inner.meta
|
423 + | /* OperationErrorGenerator.kt:326 */
|
424 + | } /* OperationErrorGenerator.kt:318 */
|
360 425 | }
|
426 + | /* OperationErrorGenerator.kt:164 */
|
361 427 | }
|
428 + | /* OperationErrorGenerator.kt:163 */
|
362 429 | }
|
430 + | /* OperationErrorGenerator.kt:109 */
|
363 431 | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for FlattenedXmlMapWithXmlNameError {
|
432 + | /* OperationErrorGenerator.kt:110 */
|
364 433 | fn create_unhandled_error(
|
365 434 | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
366 435 | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
367 436 | ) -> Self {
|
437 + | /* OperationErrorGenerator.kt:121 */
|
368 438 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
369 439 | source,
|
370 440 | meta: meta.unwrap_or_default(),
|
371 441 | })
|
442 + | /* OperationErrorGenerator.kt:110 */
|
372 443 | }
|
444 + | /* OperationErrorGenerator.kt:109 */
|
373 445 | }
|
374 446 |
|
447 + | /* CodegenDelegator.kt:255 */
|
375 448 | pub use crate::operation::flattened_xml_map_with_xml_name::_flattened_xml_map_with_xml_name_output::FlattenedXmlMapWithXmlNameOutput;
|
376 449 |
|
450 + | /* CodegenDelegator.kt:255 */
|
377 451 | pub use crate::operation::flattened_xml_map_with_xml_name::_flattened_xml_map_with_xml_name_input::FlattenedXmlMapWithXmlNameInput;
|
378 452 |
|
453 + | /* RustModule.kt:172 */
|
379 454 | mod _flattened_xml_map_with_xml_name_input;
|
380 455 |
|
456 + | /* RustModule.kt:172 */
|
381 457 | mod _flattened_xml_map_with_xml_name_output;
|
382 458 |
|
383 - | /// Builders
|
459 + | /// /* CodegenDelegator.kt:51 */Builders
|
384 460 | pub mod builders;
|