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 MalformedContentTypeWithGenericString {
|
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("MalformedContentTypeWithGenericString");
|
97 108 |
|
98 109 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
|
99 110 | MalformedContentTypeWithGenericStringRequestSerializer,
|
100 111 | ));
|
101 112 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
|
102 113 | MalformedContentTypeWithGenericStringResponseDeserializer,
|
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 | "MalformedContentTypeWithGenericString",
|
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("MalformedContentTypeWithGenericString")
|
123 134 | .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
|
124 135 | .with_interceptor(MalformedContentTypeWithGenericStringEndpointParamsInterceptor)
|
125 136 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
|
126 137 | crate::operation::malformed_content_type_with_generic_string::MalformedContentTypeWithGenericStringError,
|
127 138 | >::new())
|
128 139 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
|
129 140 | crate::operation::malformed_content_type_with_generic_string::MalformedContentTypeWithGenericStringError,
|
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 MalformedContentTypeWithGenericStringResponseDeserializer;
|
138 150 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedContentTypeWithGenericStringResponseDeserializer {
|
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_malformed_content_type_with_generic_string::de_malformed_content_type_with_generic_string_http_error(
|
151 163 | status, headers, body,
|
152 164 | )
|
153 165 | } else {
|
154 166 | crate::protocol_serde::shape_malformed_content_type_with_generic_string::de_malformed_content_type_with_generic_string_http_response(
|
155 167 | status, headers, body,
|
156 168 | )
|
157 169 | };
|
158 170 | crate::protocol_serde::type_erase_result(parse_result)
|
159 171 | }
|
160 172 | }
|
173 + | /* RequestSerializerGenerator.kt:67 */
|
161 174 | #[derive(Debug)]
|
162 175 | struct MalformedContentTypeWithGenericStringRequestSerializer;
|
163 176 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedContentTypeWithGenericStringRequestSerializer {
|
164 177 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
165 178 | fn serialize_input(
|
166 179 | &self,
|
167 180 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
168 181 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
169 182 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
170 183 | let input = input
|
171 184 | .downcast::<crate::operation::malformed_content_type_with_generic_string::MalformedContentTypeWithGenericStringInput>()
|
172 185 | .expect("correct type");
|
173 186 | let _header_serialization_settings = _cfg
|
174 187 | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
175 188 | .cloned()
|
176 189 | .unwrap_or_default();
|
177 190 | let mut request_builder = {
|
178 191 | fn uri_base(
|
179 192 | _input: &crate::operation::malformed_content_type_with_generic_string::MalformedContentTypeWithGenericStringInput,
|
180 193 | output: &mut ::std::string::String,
|
181 194 | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
182 195 | use ::std::fmt::Write as _;
|
183 196 | ::std::write!(output, "/MalformedContentTypeWithGenericString").expect("formatting should succeed");
|
184 197 | ::std::result::Result::Ok(())
|
185 198 | }
|
186 199 | #[allow(clippy::unnecessary_wraps)]
|
187 200 | fn update_http_builder(
|
188 201 | input: &crate::operation::malformed_content_type_with_generic_string::MalformedContentTypeWithGenericStringInput,
|
189 202 | builder: ::http::request::Builder,
|
190 203 | ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
191 204 | let mut uri = ::std::string::String::new();
|
192 205 | uri_base(input, &mut uri)?;
|
193 206 | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
194 207 | }
|
195 208 | let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
|
196 209 | builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "text/plain");
|
197 210 | builder
|
198 211 | };
|
199 212 | let body = ::aws_smithy_types::body::SdkBody::from(
|
200 213 | crate::protocol_serde::shape_malformed_content_type_with_generic_string_input::ser_payload_http_payload(input.payload)?,
|
201 214 | );
|
202 215 | if let Some(content_length) = body.content_length() {
|
203 216 | let content_length = content_length.to_string();
|
204 217 | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
|
205 218 | }
|
206 219 | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
207 220 | }
|
208 221 | }
|
222 + | /* EndpointParamsInterceptorGenerator.kt:86 */
|
209 223 | #[derive(Debug)]
|
210 224 | struct MalformedContentTypeWithGenericStringEndpointParamsInterceptor;
|
211 225 |
|
212 226 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedContentTypeWithGenericStringEndpointParamsInterceptor {
|
213 227 | fn name(&self) -> &'static str {
|
214 228 | "MalformedContentTypeWithGenericStringEndpointParamsInterceptor"
|
215 229 | }
|
216 230 |
|
217 231 | fn read_before_execution(
|
218 232 | &self,
|
219 233 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
220 234 | '_,
|
221 235 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
222 236 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
223 237 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
224 238 | >,
|
225 239 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
226 240 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
227 241 | let _input = context
|
228 242 | .input()
|
229 243 | .downcast_ref::<MalformedContentTypeWithGenericStringInput>()
|
230 244 | .ok_or("failed to downcast to MalformedContentTypeWithGenericStringInput")?;
|
231 245 |
|
232 246 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
233 247 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
234 248 | })?;
|
235 249 | cfg.interceptor_state()
|
236 250 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
237 251 | ::std::result::Result::Ok(())
|
238 252 | }
|
239 253 | }
|
240 254 |
|
241 255 | // The get_* functions below are generated from JMESPath expressions in the
|
242 256 | // operationContextParams trait. They target the operation's input shape.
|
243 257 |
|
258 + | /* OperationErrorGenerator.kt:79 */
|
244 259 | /// Error type for the `MalformedContentTypeWithGenericStringError` operation.
|
260 + | /* RustType.kt:516 */
|
245 261 | #[non_exhaustive]
|
262 + | /* RustType.kt:516 */
|
246 263 | #[derive(::std::fmt::Debug)]
|
247 - | pub enum MalformedContentTypeWithGenericStringError {
|
264 + | pub /* OperationErrorGenerator.kt:81 */ enum MalformedContentTypeWithGenericStringError {
|
265 + | /* OperationErrorGenerator.kt:88 */
|
248 266 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
249 267 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
250 268 | variable wildcard pattern and check `.code()`:
|
251 269 | \
|
252 270 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
253 271 | \
|
254 272 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-MalformedContentTypeWithGenericStringError) for what information is available for the error.")]
|
255 273 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
274 + | /* OperationErrorGenerator.kt:81 */
|
256 275 | }
|
276 + | /* OperationErrorGenerator.kt:218 */
|
257 277 | impl MalformedContentTypeWithGenericStringError {
|
278 + | /* OperationErrorGenerator.kt:219 */
|
258 279 | /// Creates the `MalformedContentTypeWithGenericStringError::Unhandled` variant from any error type.
|
259 280 | pub fn unhandled(
|
260 281 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
261 282 | ) -> Self {
|
262 283 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
263 284 | source: err.into(),
|
264 285 | meta: ::std::default::Default::default(),
|
265 286 | })
|
266 287 | }
|
267 288 |
|
268 289 | /// Creates the `MalformedContentTypeWithGenericStringError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
269 290 | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
270 291 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
271 292 | source: err.clone().into(),
|
272 293 | meta: err,
|
273 294 | })
|
274 295 | }
|
275 - | ///
|
296 + | /// /* OperationErrorGenerator.kt:236 */
|
276 297 | /// Returns error metadata, which includes the error code, message,
|
277 298 | /// request ID, and potentially additional information.
|
278 299 | ///
|
300 + | /* OperationErrorGenerator.kt:242 */
|
279 301 | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
302 + | /* OperationErrorGenerator.kt:243 */
|
280 303 | match self {
|
281 - | Self::Unhandled(e) => &e.meta,
|
304 + | /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
|
305 + | /* OperationErrorGenerator.kt:243 */
|
282 306 | }
|
307 + | /* OperationErrorGenerator.kt:242 */
|
283 308 | }
|
309 + | /* OperationErrorGenerator.kt:218 */
|
284 310 | }
|
311 + | /* OperationErrorGenerator.kt:269 */
|
285 312 | impl ::std::error::Error for MalformedContentTypeWithGenericStringError {
|
313 + | /* OperationErrorGenerator.kt:270 */
|
286 314 | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
315 + | /* OperationErrorGenerator.kt:318 */
|
287 316 | match self {
|
288 - | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
317 + | /* OperationErrorGenerator.kt:326 */
|
318 + | Self::Unhandled(_inner) => {
|
319 + | /* OperationErrorGenerator.kt:279 */
|
320 + | ::std::option::Option::Some(&*_inner.source)
|
321 + | /* OperationErrorGenerator.kt:326 */
|
322 + | } /* OperationErrorGenerator.kt:318 */
|
289 323 | }
|
324 + | /* OperationErrorGenerator.kt:270 */
|
290 325 | }
|
326 + | /* OperationErrorGenerator.kt:269 */
|
291 327 | }
|
328 + | /* OperationErrorGenerator.kt:133 */
|
292 329 | impl ::std::fmt::Display for MalformedContentTypeWithGenericStringError {
|
330 + | /* OperationErrorGenerator.kt:134 */
|
293 331 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
332 + | /* OperationErrorGenerator.kt:318 */
|
294 333 | match self {
|
334 + | /* OperationErrorGenerator.kt:326 */
|
295 335 | Self::Unhandled(_inner) => {
|
336 + | /* OperationErrorGenerator.kt:139 */
|
296 337 | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
297 338 | write!(f, "unhandled error ({code})")
|
298 339 | } else {
|
299 340 | f.write_str("unhandled error")
|
300 341 | }
|
301 - | }
|
342 + | /* OperationErrorGenerator.kt:326 */
|
343 + | } /* OperationErrorGenerator.kt:318 */
|
302 344 | }
|
345 + | /* OperationErrorGenerator.kt:134 */
|
303 346 | }
|
347 + | /* OperationErrorGenerator.kt:133 */
|
304 348 | }
|
349 + | /* OperationErrorGenerator.kt:182 */
|
305 350 | impl ::aws_smithy_types::retry::ProvideErrorKind for MalformedContentTypeWithGenericStringError {
|
351 + | /* OperationErrorGenerator.kt:186 */
|
306 352 | fn code(&self) -> ::std::option::Option<&str> {
|
353 + | /* OperationErrorGenerator.kt:187 */
|
307 354 | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
355 + | /* OperationErrorGenerator.kt:186 */
|
308 356 | }
|
357 + | /* OperationErrorGenerator.kt:190 */
|
309 358 | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
359 + | /* OperationErrorGenerator.kt:197 */
|
310 360 | ::std::option::Option::None
|
361 + | /* OperationErrorGenerator.kt:190 */
|
311 362 | }
|
363 + | /* OperationErrorGenerator.kt:182 */
|
312 364 | }
|
365 + | /* OperationErrorGenerator.kt:163 */
|
313 366 | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for MalformedContentTypeWithGenericStringError {
|
367 + | /* OperationErrorGenerator.kt:164 */
|
314 368 | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
369 + | /* OperationErrorGenerator.kt:318 */
|
315 370 | match self {
|
316 - | Self::Unhandled(_inner) => &_inner.meta,
|
371 + | /* OperationErrorGenerator.kt:326 */
|
372 + | Self::Unhandled(_inner) => {
|
373 + | /* OperationErrorGenerator.kt:168 */
|
374 + | &_inner.meta
|
375 + | /* OperationErrorGenerator.kt:326 */
|
376 + | } /* OperationErrorGenerator.kt:318 */
|
317 377 | }
|
378 + | /* OperationErrorGenerator.kt:164 */
|
318 379 | }
|
380 + | /* OperationErrorGenerator.kt:163 */
|
319 381 | }
|
382 + | /* OperationErrorGenerator.kt:109 */
|
320 383 | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for MalformedContentTypeWithGenericStringError {
|
384 + | /* OperationErrorGenerator.kt:110 */
|
321 385 | fn create_unhandled_error(
|
322 386 | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
323 387 | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
324 388 | ) -> Self {
|
389 + | /* OperationErrorGenerator.kt:121 */
|
325 390 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
326 391 | source,
|
327 392 | meta: meta.unwrap_or_default(),
|
328 393 | })
|
394 + | /* OperationErrorGenerator.kt:110 */
|
329 395 | }
|
396 + | /* OperationErrorGenerator.kt:109 */
|
330 397 | }
|
331 398 |
|
399 + | /* CodegenDelegator.kt:255 */
|
332 400 | pub use crate::operation::malformed_content_type_with_generic_string::_malformed_content_type_with_generic_string_output::MalformedContentTypeWithGenericStringOutput;
|
333 401 |
|
402 + | /* CodegenDelegator.kt:255 */
|
334 403 | pub use crate::operation::malformed_content_type_with_generic_string::_malformed_content_type_with_generic_string_input::MalformedContentTypeWithGenericStringInput;
|
335 404 |
|
405 + | /* RustModule.kt:172 */
|
336 406 | mod _malformed_content_type_with_generic_string_input;
|
337 407 |
|
408 + | /* RustModule.kt:172 */
|
338 409 | mod _malformed_content_type_with_generic_string_output;
|
339 410 |
|
340 - | /// Builders
|
411 + | /// /* CodegenDelegator.kt:51 */Builders
|
341 412 | pub mod builders;
|