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 HttpPayloadWithXmlNamespace {
|
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("HttpPayloadWithXmlNamespace");
|
97 108 |
|
98 109 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
|
99 110 | HttpPayloadWithXmlNamespaceRequestSerializer,
|
100 111 | ));
|
101 112 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
|
102 113 | HttpPayloadWithXmlNamespaceResponseDeserializer,
|
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 | "HttpPayloadWithXmlNamespace",
|
111 122 | "Rest Xml 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("HttpPayloadWithXmlNamespace")
|
123 134 | .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
|
124 135 | .with_interceptor(HttpPayloadWithXmlNamespaceEndpointParamsInterceptor)
|
125 136 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
|
126 137 | crate::operation::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceError,
|
127 138 | >::new())
|
128 139 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
|
129 140 | crate::operation::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceError,
|
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 HttpPayloadWithXmlNamespaceResponseDeserializer;
|
138 150 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpPayloadWithXmlNamespaceResponseDeserializer {
|
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_http_payload_with_xml_namespace::de_http_payload_with_xml_namespace_http_error(status, headers, body)
|
151 163 | } else {
|
152 164 | crate::protocol_serde::shape_http_payload_with_xml_namespace::de_http_payload_with_xml_namespace_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 HttpPayloadWithXmlNamespaceRequestSerializer;
|
159 172 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for HttpPayloadWithXmlNamespaceRequestSerializer {
|
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::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceInput>()
|
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::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceInput,
|
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, "/HttpPayloadWithXmlNamespace").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::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceInput,
|
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("PUT").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/xml");
|
193 206 | builder
|
194 207 | };
|
195 208 | let body = ::aws_smithy_types::body::SdkBody::from(
|
196 209 | crate::protocol_serde::shape_http_payload_with_xml_namespace_input::ser_nested_http_payload(&input.nested)?,
|
197 210 | );
|
198 211 | if let Some(content_length) = body.content_length() {
|
199 212 | let content_length = content_length.to_string();
|
200 213 | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
|
201 214 | }
|
202 215 | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
203 216 | }
|
204 217 | }
|
218 + | /* EndpointParamsInterceptorGenerator.kt:86 */
|
205 219 | #[derive(Debug)]
|
206 220 | struct HttpPayloadWithXmlNamespaceEndpointParamsInterceptor;
|
207 221 |
|
208 222 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for HttpPayloadWithXmlNamespaceEndpointParamsInterceptor {
|
209 223 | fn name(&self) -> &'static str {
|
210 224 | "HttpPayloadWithXmlNamespaceEndpointParamsInterceptor"
|
211 225 | }
|
212 226 |
|
213 227 | fn read_before_execution(
|
214 228 | &self,
|
215 229 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
216 230 | '_,
|
217 231 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
218 232 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
219 233 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
220 234 | >,
|
221 235 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
222 236 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
223 237 | let _input = context
|
224 238 | .input()
|
225 239 | .downcast_ref::<HttpPayloadWithXmlNamespaceInput>()
|
226 240 | .ok_or("failed to downcast to HttpPayloadWithXmlNamespaceInput")?;
|
227 241 |
|
228 242 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
229 243 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
230 244 | })?;
|
231 245 | cfg.interceptor_state()
|
232 246 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
233 247 | ::std::result::Result::Ok(())
|
234 248 | }
|
235 249 | }
|
236 250 |
|
237 251 | // The get_* functions below are generated from JMESPath expressions in the
|
238 252 | // operationContextParams trait. They target the operation's input shape.
|
239 253 |
|
254 + | /* RustType.kt:516 */
|
240 255 | #[allow(unreachable_code, unused_variables)]
|
256 + | /* RustType.kt:516 */
|
241 257 | #[cfg(test)]
|
258 + | /* ProtocolTestGenerator.kt:98 */
|
242 259 | mod http_payload_with_xml_namespace_test {
|
243 260 |
|
244 261 | /// Serializes a structure in the payload using a wrapper with an XML namespace
|
245 262 | /// Test ID: HttpPayloadWithXmlNamespace
|
246 263 | #[::tokio::test]
|
247 264 | #[::tracing_test::traced_test]
|
248 265 | async fn http_payload_with_xml_namespace_request() {
|
249 266 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
250 267 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
251 268 |
|
316 333 | )))
|
317 334 | });
|
318 335 | de.deserialize_nonstreaming(&http_response)
|
319 336 | });
|
320 337 | let parsed = parsed
|
321 338 | .expect("should be successful response")
|
322 339 | .downcast::<crate::operation::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceOutput>()
|
323 340 | .unwrap();
|
324 341 | ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
|
325 342 | }
|
343 + |
|
344 + | /* ProtocolTestGenerator.kt:98 */
|
326 345 | }
|
327 346 |
|
347 + | /* OperationErrorGenerator.kt:79 */
|
328 348 | /// Error type for the `HttpPayloadWithXmlNamespaceError` operation.
|
349 + | /* RustType.kt:516 */
|
329 350 | #[non_exhaustive]
|
351 + | /* RustType.kt:516 */
|
330 352 | #[derive(::std::fmt::Debug)]
|
331 - | pub enum HttpPayloadWithXmlNamespaceError {
|
353 + | pub /* OperationErrorGenerator.kt:81 */ enum HttpPayloadWithXmlNamespaceError {
|
354 + | /* OperationErrorGenerator.kt:88 */
|
332 355 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
333 356 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
334 357 | variable wildcard pattern and check `.code()`:
|
335 358 | \
|
336 359 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
337 360 | \
|
338 361 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-HttpPayloadWithXmlNamespaceError) for what information is available for the error.")]
|
339 362 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
363 + | /* OperationErrorGenerator.kt:81 */
|
340 364 | }
|
365 + | /* OperationErrorGenerator.kt:218 */
|
341 366 | impl HttpPayloadWithXmlNamespaceError {
|
367 + | /* OperationErrorGenerator.kt:219 */
|
342 368 | /// Creates the `HttpPayloadWithXmlNamespaceError::Unhandled` variant from any error type.
|
343 369 | pub fn unhandled(
|
344 370 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
345 371 | ) -> Self {
|
346 372 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
347 373 | source: err.into(),
|
348 374 | meta: ::std::default::Default::default(),
|
349 375 | })
|
350 376 | }
|
351 377 |
|
352 378 | /// Creates the `HttpPayloadWithXmlNamespaceError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
353 379 | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
354 380 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
355 381 | source: err.clone().into(),
|
356 382 | meta: err,
|
357 383 | })
|
358 384 | }
|
359 - | ///
|
385 + | /// /* OperationErrorGenerator.kt:236 */
|
360 386 | /// Returns error metadata, which includes the error code, message,
|
361 387 | /// request ID, and potentially additional information.
|
362 388 | ///
|
389 + | /* OperationErrorGenerator.kt:242 */
|
363 390 | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
391 + | /* OperationErrorGenerator.kt:243 */
|
364 392 | match self {
|
365 - | Self::Unhandled(e) => &e.meta,
|
393 + | /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
|
394 + | /* OperationErrorGenerator.kt:243 */
|
366 395 | }
|
396 + | /* OperationErrorGenerator.kt:242 */
|
367 397 | }
|
398 + | /* OperationErrorGenerator.kt:218 */
|
368 399 | }
|
400 + | /* OperationErrorGenerator.kt:269 */
|
369 401 | impl ::std::error::Error for HttpPayloadWithXmlNamespaceError {
|
402 + | /* OperationErrorGenerator.kt:270 */
|
370 403 | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
404 + | /* OperationErrorGenerator.kt:318 */
|
371 405 | match self {
|
372 - | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
406 + | /* OperationErrorGenerator.kt:326 */
|
407 + | Self::Unhandled(_inner) => {
|
408 + | /* OperationErrorGenerator.kt:279 */
|
409 + | ::std::option::Option::Some(&*_inner.source)
|
410 + | /* OperationErrorGenerator.kt:326 */
|
411 + | } /* OperationErrorGenerator.kt:318 */
|
373 412 | }
|
413 + | /* OperationErrorGenerator.kt:270 */
|
374 414 | }
|
415 + | /* OperationErrorGenerator.kt:269 */
|
375 416 | }
|
417 + | /* OperationErrorGenerator.kt:133 */
|
376 418 | impl ::std::fmt::Display for HttpPayloadWithXmlNamespaceError {
|
419 + | /* OperationErrorGenerator.kt:134 */
|
377 420 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
421 + | /* OperationErrorGenerator.kt:318 */
|
378 422 | match self {
|
423 + | /* OperationErrorGenerator.kt:326 */
|
379 424 | Self::Unhandled(_inner) => {
|
425 + | /* OperationErrorGenerator.kt:139 */
|
380 426 | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
381 427 | write!(f, "unhandled error ({code})")
|
382 428 | } else {
|
383 429 | f.write_str("unhandled error")
|
384 430 | }
|
431 + | /* OperationErrorGenerator.kt:326 */
|
432 + | } /* OperationErrorGenerator.kt:318 */
|
385 433 | }
|
434 + | /* OperationErrorGenerator.kt:134 */
|
386 435 | }
|
387 - | }
|
436 + | /* OperationErrorGenerator.kt:133 */
|
388 437 | }
|
438 + | /* OperationErrorGenerator.kt:182 */
|
389 439 | impl ::aws_smithy_types::retry::ProvideErrorKind for HttpPayloadWithXmlNamespaceError {
|
440 + | /* OperationErrorGenerator.kt:186 */
|
390 441 | fn code(&self) -> ::std::option::Option<&str> {
|
442 + | /* OperationErrorGenerator.kt:187 */
|
391 443 | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
444 + | /* OperationErrorGenerator.kt:186 */
|
392 445 | }
|
446 + | /* OperationErrorGenerator.kt:190 */
|
393 447 | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
448 + | /* OperationErrorGenerator.kt:197 */
|
394 449 | ::std::option::Option::None
|
450 + | /* OperationErrorGenerator.kt:190 */
|
395 451 | }
|
452 + | /* OperationErrorGenerator.kt:182 */
|
396 453 | }
|
454 + | /* OperationErrorGenerator.kt:163 */
|
397 455 | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for HttpPayloadWithXmlNamespaceError {
|
456 + | /* OperationErrorGenerator.kt:164 */
|
398 457 | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
458 + | /* OperationErrorGenerator.kt:318 */
|
399 459 | match self {
|
400 - | Self::Unhandled(_inner) => &_inner.meta,
|
460 + | /* OperationErrorGenerator.kt:326 */
|
461 + | Self::Unhandled(_inner) => {
|
462 + | /* OperationErrorGenerator.kt:168 */
|
463 + | &_inner.meta
|
464 + | /* OperationErrorGenerator.kt:326 */
|
465 + | } /* OperationErrorGenerator.kt:318 */
|
401 466 | }
|
467 + | /* OperationErrorGenerator.kt:164 */
|
402 468 | }
|
469 + | /* OperationErrorGenerator.kt:163 */
|
403 470 | }
|
471 + | /* OperationErrorGenerator.kt:109 */
|
404 472 | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for HttpPayloadWithXmlNamespaceError {
|
473 + | /* OperationErrorGenerator.kt:110 */
|
405 474 | fn create_unhandled_error(
|
406 475 | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
407 476 | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
408 477 | ) -> Self {
|
478 + | /* OperationErrorGenerator.kt:121 */
|
409 479 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
410 480 | source,
|
411 481 | meta: meta.unwrap_or_default(),
|
412 482 | })
|
483 + | /* OperationErrorGenerator.kt:110 */
|
413 484 | }
|
485 + | /* OperationErrorGenerator.kt:109 */
|
414 486 | }
|
415 487 |
|
488 + | /* CodegenDelegator.kt:255 */
|
416 489 | pub use crate::operation::http_payload_with_xml_namespace::_http_payload_with_xml_namespace_output::HttpPayloadWithXmlNamespaceOutput;
|
417 490 |
|
491 + | /* CodegenDelegator.kt:255 */
|
418 492 | pub use crate::operation::http_payload_with_xml_namespace::_http_payload_with_xml_namespace_input::HttpPayloadWithXmlNamespaceInput;
|
419 493 |
|
494 + | /* RustModule.kt:172 */
|
420 495 | mod _http_payload_with_xml_namespace_input;
|
421 496 |
|
497 + | /* RustModule.kt:172 */
|
422 498 | mod _http_payload_with_xml_namespace_output;
|
423 499 |
|
424 - | /// Builders
|
500 + | /// /* CodegenDelegator.kt:51 */Builders
|
425 501 | pub mod builders;
|