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 DocumentTypeAsMapValue {
|
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("DocumentTypeAsMapValue");
|
97 108 |
|
98 109 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
|
99 110 | DocumentTypeAsMapValueRequestSerializer,
|
100 111 | ));
|
101 112 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
|
102 113 | DocumentTypeAsMapValueResponseDeserializer,
|
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 | "DocumentTypeAsMapValue",
|
111 122 | "Rest Json 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("DocumentTypeAsMapValue")
|
123 134 | .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
|
124 135 | .with_interceptor(DocumentTypeAsMapValueEndpointParamsInterceptor)
|
125 136 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
|
126 137 | crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError,
|
127 138 | >::new())
|
128 139 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
|
129 140 | crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError,
|
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 DocumentTypeAsMapValueResponseDeserializer;
|
138 150 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DocumentTypeAsMapValueResponseDeserializer {
|
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_document_type_as_map_value::de_document_type_as_map_value_http_error(status, headers, body)
|
151 163 | } else {
|
152 164 | crate::protocol_serde::shape_document_type_as_map_value::de_document_type_as_map_value_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 DocumentTypeAsMapValueRequestSerializer;
|
159 172 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DocumentTypeAsMapValueRequestSerializer {
|
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::document_type_as_map_value::DocumentTypeAsMapValueInput>()
|
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::document_type_as_map_value::DocumentTypeAsMapValueInput,
|
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, "/DocumentTypeAsMapValue").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::document_type_as_map_value::DocumentTypeAsMapValueInput,
|
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/json");
|
193 206 | builder
|
194 207 | };
|
195 208 | let body = ::aws_smithy_types::body::SdkBody::from(
|
196 209 | crate::protocol_serde::shape_document_type_as_map_value::ser_document_type_as_map_value_input(&input)?,
|
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 DocumentTypeAsMapValueEndpointParamsInterceptor;
|
207 221 |
|
208 222 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DocumentTypeAsMapValueEndpointParamsInterceptor {
|
209 223 | fn name(&self) -> &'static str {
|
210 224 | "DocumentTypeAsMapValueEndpointParamsInterceptor"
|
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::<DocumentTypeAsMapValueInput>()
|
226 240 | .ok_or("failed to downcast to DocumentTypeAsMapValueInput")?;
|
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 document_type_as_map_value_test {
|
243 260 |
|
244 261 | /// Serializes a map that uses documents as the value.
|
245 262 | /// Test ID: DocumentTypeAsMapValueInput
|
246 263 | #[::tokio::test]
|
247 264 | #[::tracing_test::traced_test]
|
248 265 | async fn document_type_as_map_value_input_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 |
|
354 371 | let parsed = parsed
|
355 372 | .expect("should be successful response")
|
356 373 | .downcast::<crate::operation::document_type_as_map_value::DocumentTypeAsMapValueOutput>()
|
357 374 | .unwrap();
|
358 375 | ::pretty_assertions::assert_eq!(
|
359 376 | parsed.doc_valued_map,
|
360 377 | expected_output.doc_valued_map,
|
361 378 | "Unexpected value for `doc_valued_map`"
|
362 379 | );
|
363 380 | }
|
381 + |
|
382 + | /* ProtocolTestGenerator.kt:98 */
|
364 383 | }
|
365 384 |
|
385 + | /* OperationErrorGenerator.kt:79 */
|
366 386 | /// Error type for the `DocumentTypeAsMapValueError` operation.
|
387 + | /* RustType.kt:516 */
|
367 388 | #[non_exhaustive]
|
389 + | /* RustType.kt:516 */
|
368 390 | #[derive(::std::fmt::Debug)]
|
369 - | pub enum DocumentTypeAsMapValueError {
|
391 + | pub /* OperationErrorGenerator.kt:81 */ enum DocumentTypeAsMapValueError {
|
392 + | /* OperationErrorGenerator.kt:88 */
|
370 393 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
371 394 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
372 395 | variable wildcard pattern and check `.code()`:
|
373 396 | \
|
374 397 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
375 398 | \
|
376 399 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DocumentTypeAsMapValueError) for what information is available for the error.")]
|
377 400 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
401 + | /* OperationErrorGenerator.kt:81 */
|
378 402 | }
|
403 + | /* OperationErrorGenerator.kt:218 */
|
379 404 | impl DocumentTypeAsMapValueError {
|
405 + | /* OperationErrorGenerator.kt:219 */
|
380 406 | /// Creates the `DocumentTypeAsMapValueError::Unhandled` variant from any error type.
|
381 407 | pub fn unhandled(
|
382 408 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
383 409 | ) -> Self {
|
384 410 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
385 411 | source: err.into(),
|
386 412 | meta: ::std::default::Default::default(),
|
387 413 | })
|
388 414 | }
|
389 415 |
|
390 416 | /// Creates the `DocumentTypeAsMapValueError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
391 417 | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
392 418 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
393 419 | source: err.clone().into(),
|
394 420 | meta: err,
|
395 421 | })
|
396 422 | }
|
397 - | ///
|
423 + | /// /* OperationErrorGenerator.kt:236 */
|
398 424 | /// Returns error metadata, which includes the error code, message,
|
399 425 | /// request ID, and potentially additional information.
|
400 426 | ///
|
427 + | /* OperationErrorGenerator.kt:242 */
|
401 428 | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
429 + | /* OperationErrorGenerator.kt:243 */
|
402 430 | match self {
|
403 - | Self::Unhandled(e) => &e.meta,
|
431 + | /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
|
432 + | /* OperationErrorGenerator.kt:243 */
|
404 433 | }
|
434 + | /* OperationErrorGenerator.kt:242 */
|
405 435 | }
|
436 + | /* OperationErrorGenerator.kt:218 */
|
406 437 | }
|
438 + | /* OperationErrorGenerator.kt:269 */
|
407 439 | impl ::std::error::Error for DocumentTypeAsMapValueError {
|
440 + | /* OperationErrorGenerator.kt:270 */
|
408 441 | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
442 + | /* OperationErrorGenerator.kt:318 */
|
409 443 | match self {
|
410 - | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
444 + | /* OperationErrorGenerator.kt:326 */
|
445 + | Self::Unhandled(_inner) => {
|
446 + | /* OperationErrorGenerator.kt:279 */
|
447 + | ::std::option::Option::Some(&*_inner.source)
|
448 + | /* OperationErrorGenerator.kt:326 */
|
449 + | } /* OperationErrorGenerator.kt:318 */
|
411 450 | }
|
451 + | /* OperationErrorGenerator.kt:270 */
|
412 452 | }
|
453 + | /* OperationErrorGenerator.kt:269 */
|
413 454 | }
|
455 + | /* OperationErrorGenerator.kt:133 */
|
414 456 | impl ::std::fmt::Display for DocumentTypeAsMapValueError {
|
457 + | /* OperationErrorGenerator.kt:134 */
|
415 458 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
459 + | /* OperationErrorGenerator.kt:318 */
|
416 460 | match self {
|
461 + | /* OperationErrorGenerator.kt:326 */
|
417 462 | Self::Unhandled(_inner) => {
|
463 + | /* OperationErrorGenerator.kt:139 */
|
418 464 | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
419 465 | write!(f, "unhandled error ({code})")
|
420 466 | } else {
|
421 467 | f.write_str("unhandled error")
|
422 468 | }
|
469 + | /* OperationErrorGenerator.kt:326 */
|
470 + | } /* OperationErrorGenerator.kt:318 */
|
423 471 | }
|
472 + | /* OperationErrorGenerator.kt:134 */
|
424 473 | }
|
425 - | }
|
474 + | /* OperationErrorGenerator.kt:133 */
|
426 475 | }
|
476 + | /* OperationErrorGenerator.kt:182 */
|
427 477 | impl ::aws_smithy_types::retry::ProvideErrorKind for DocumentTypeAsMapValueError {
|
478 + | /* OperationErrorGenerator.kt:186 */
|
428 479 | fn code(&self) -> ::std::option::Option<&str> {
|
480 + | /* OperationErrorGenerator.kt:187 */
|
429 481 | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
482 + | /* OperationErrorGenerator.kt:186 */
|
430 483 | }
|
484 + | /* OperationErrorGenerator.kt:190 */
|
431 485 | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
486 + | /* OperationErrorGenerator.kt:197 */
|
432 487 | ::std::option::Option::None
|
488 + | /* OperationErrorGenerator.kt:190 */
|
433 489 | }
|
490 + | /* OperationErrorGenerator.kt:182 */
|
434 491 | }
|
492 + | /* OperationErrorGenerator.kt:163 */
|
435 493 | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DocumentTypeAsMapValueError {
|
494 + | /* OperationErrorGenerator.kt:164 */
|
436 495 | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
496 + | /* OperationErrorGenerator.kt:318 */
|
437 497 | match self {
|
438 - | Self::Unhandled(_inner) => &_inner.meta,
|
498 + | /* OperationErrorGenerator.kt:326 */
|
499 + | Self::Unhandled(_inner) => {
|
500 + | /* OperationErrorGenerator.kt:168 */
|
501 + | &_inner.meta
|
502 + | /* OperationErrorGenerator.kt:326 */
|
503 + | } /* OperationErrorGenerator.kt:318 */
|
439 504 | }
|
505 + | /* OperationErrorGenerator.kt:164 */
|
440 506 | }
|
507 + | /* OperationErrorGenerator.kt:163 */
|
441 508 | }
|
509 + | /* OperationErrorGenerator.kt:109 */
|
442 510 | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DocumentTypeAsMapValueError {
|
511 + | /* OperationErrorGenerator.kt:110 */
|
443 512 | fn create_unhandled_error(
|
444 513 | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
445 514 | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
446 515 | ) -> Self {
|
516 + | /* OperationErrorGenerator.kt:121 */
|
447 517 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
448 518 | source,
|
449 519 | meta: meta.unwrap_or_default(),
|
450 520 | })
|
521 + | /* OperationErrorGenerator.kt:110 */
|
451 522 | }
|
523 + | /* OperationErrorGenerator.kt:109 */
|
452 524 | }
|
453 525 |
|
526 + | /* CodegenDelegator.kt:255 */
|
454 527 | pub use crate::operation::document_type_as_map_value::_document_type_as_map_value_output::DocumentTypeAsMapValueOutput;
|
455 528 |
|
529 + | /* CodegenDelegator.kt:255 */
|
456 530 | pub use crate::operation::document_type_as_map_value::_document_type_as_map_value_input::DocumentTypeAsMapValueInput;
|
457 531 |
|
532 + | /* RustModule.kt:172 */
|
458 533 | mod _document_type_as_map_value_input;
|
459 534 |
|
535 + | /* RustModule.kt:172 */
|
460 536 | mod _document_type_as_map_value_output;
|
461 537 |
|
462 - | /// Builders
|
538 + | /// /* CodegenDelegator.kt:51 */Builders
|
463 539 | pub mod builders;
|