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