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 EmptyInputAndEmptyOutput {
|
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("EmptyInputAndEmptyOutput");
|
97 108 |
|
98 109 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
|
99 110 | EmptyInputAndEmptyOutputRequestSerializer,
|
100 111 | ));
|
101 112 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
|
102 113 | EmptyInputAndEmptyOutputResponseDeserializer,
|
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 | "EmptyInputAndEmptyOutput",
|
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("EmptyInputAndEmptyOutput")
|
123 134 | .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
|
124 135 | .with_interceptor(EmptyInputAndEmptyOutputEndpointParamsInterceptor)
|
125 136 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
|
126 137 | crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
|
127 138 | >::new())
|
128 139 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
|
129 140 | crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
|
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 EmptyInputAndEmptyOutputResponseDeserializer;
|
138 150 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EmptyInputAndEmptyOutputResponseDeserializer {
|
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_empty_input_and_empty_output::de_empty_input_and_empty_output_http_error(status, headers, body)
|
151 163 | } else {
|
152 164 | crate::protocol_serde::shape_empty_input_and_empty_output::de_empty_input_and_empty_output_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 EmptyInputAndEmptyOutputRequestSerializer;
|
159 172 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for EmptyInputAndEmptyOutputRequestSerializer {
|
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::empty_input_and_empty_output::EmptyInputAndEmptyOutputInput>()
|
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::empty_input_and_empty_output::EmptyInputAndEmptyOutputInput,
|
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, "/EmptyInputAndEmptyOutput").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::empty_input_and_empty_output::EmptyInputAndEmptyOutputInput,
|
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
|
193 206 | };
|
194 207 | let body = ::aws_smithy_types::body::SdkBody::from("");
|
195 208 |
|
196 209 | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
197 210 | }
|
198 211 | }
|
212 + | /* EndpointParamsInterceptorGenerator.kt:86 */
|
199 213 | #[derive(Debug)]
|
200 214 | struct EmptyInputAndEmptyOutputEndpointParamsInterceptor;
|
201 215 |
|
202 216 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EmptyInputAndEmptyOutputEndpointParamsInterceptor {
|
203 217 | fn name(&self) -> &'static str {
|
204 218 | "EmptyInputAndEmptyOutputEndpointParamsInterceptor"
|
205 219 | }
|
206 220 |
|
207 221 | fn read_before_execution(
|
208 222 | &self,
|
209 223 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
210 224 | '_,
|
211 225 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
212 226 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
213 227 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
214 228 | >,
|
215 229 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
216 230 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
217 231 | let _input = context
|
218 232 | .input()
|
219 233 | .downcast_ref::<EmptyInputAndEmptyOutputInput>()
|
220 234 | .ok_or("failed to downcast to EmptyInputAndEmptyOutputInput")?;
|
221 235 |
|
222 236 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
223 237 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
224 238 | })?;
|
225 239 | cfg.interceptor_state()
|
226 240 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
227 241 | ::std::result::Result::Ok(())
|
228 242 | }
|
229 243 | }
|
230 244 |
|
231 245 | // The get_* functions below are generated from JMESPath expressions in the
|
232 246 | // operationContextParams trait. They target the operation's input shape.
|
233 247 |
|
248 + | /* RustType.kt:516 */
|
234 249 | #[allow(unreachable_code, unused_variables)]
|
250 + | /* RustType.kt:516 */
|
235 251 | #[cfg(test)]
|
252 + | /* ProtocolTestGenerator.kt:98 */
|
236 253 | mod empty_input_and_empty_output_test {
|
237 254 |
|
238 255 | /// Empty input serializes no payload
|
239 256 | /// Test ID: EmptyInputAndEmptyOutput
|
240 257 | #[::tokio::test]
|
241 258 | #[::tracing_test::traced_test]
|
242 259 | async fn empty_input_and_empty_output_request() {
|
243 260 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
244 261 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
245 262 |
|
246 263 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
247 264 | let result = client.empty_input_and_empty_output().send().await;
|
248 265 | let _ = dbg!(result);
|
249 266 | let http_request = request_receiver.expect_request();
|
250 267 | let body = http_request.body().bytes().expect("body should be strict");
|
251 268 | // No body.
|
252 269 | ::pretty_assertions::assert_eq!(&body, &bytes::Bytes::new());
|
253 270 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
254 271 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
255 272 | ::pretty_assertions::assert_eq!(uri.path(), "/EmptyInputAndEmptyOutput", "path was incorrect");
|
256 273 | }
|
257 274 |
|
258 275 | /// Empty output serializes no payload
|
259 276 | /// Test ID: EmptyInputAndEmptyOutput
|
260 277 | #[::tokio::test]
|
261 278 | #[::tracing_test::traced_test]
|
262 279 | async fn empty_input_and_empty_output_response() {
|
263 280 | let expected_output = crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput::builder().build();
|
264 281 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
265 282 | ::http::response::Builder::new()
|
266 283 | .status(200)
|
267 284 | .body(::aws_smithy_types::body::SdkBody::from(""))
|
268 285 | .unwrap(),
|
269 286 | )
|
270 287 | .unwrap();
|
271 288 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
272 289 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
273 290 |
|
274 291 | let op = crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutput::new();
|
275 292 | let config = op.config().expect("the operation has config");
|
276 293 | let de = config
|
277 294 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
278 295 | .expect("the config must have a deserializer");
|
279 296 |
|
280 297 | let parsed = de.deserialize_streaming(&mut http_response);
|
281 298 | let parsed = parsed.unwrap_or_else(|| {
|
282 299 | let http_response = http_response.map(|body| {
|
283 300 | ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
284 301 | body.bytes().unwrap(),
|
285 302 | ::aws_smithy_protocol_test::MediaType::from("unknown"),
|
286 303 | )))
|
287 304 | });
|
288 305 | de.deserialize_nonstreaming(&http_response)
|
289 306 | });
|
290 307 | let parsed = parsed
|
291 308 | .expect("should be successful response")
|
292 309 | .downcast::<crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput>()
|
293 310 | .unwrap();
|
294 311 | }
|
312 + |
|
313 + | /* ProtocolTestGenerator.kt:98 */
|
295 314 | }
|
296 315 |
|
316 + | /* OperationErrorGenerator.kt:79 */
|
297 317 | /// Error type for the `EmptyInputAndEmptyOutputError` operation.
|
318 + | /* RustType.kt:516 */
|
298 319 | #[non_exhaustive]
|
320 + | /* RustType.kt:516 */
|
299 321 | #[derive(::std::fmt::Debug)]
|
300 - | pub enum EmptyInputAndEmptyOutputError {
|
322 + | pub /* OperationErrorGenerator.kt:81 */ enum EmptyInputAndEmptyOutputError {
|
323 + | /* OperationErrorGenerator.kt:88 */
|
301 324 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
302 325 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
303 326 | variable wildcard pattern and check `.code()`:
|
304 327 | \
|
305 328 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
306 329 | \
|
307 330 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EmptyInputAndEmptyOutputError) for what information is available for the error.")]
|
308 331 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
332 + | /* OperationErrorGenerator.kt:81 */
|
309 333 | }
|
334 + | /* OperationErrorGenerator.kt:218 */
|
310 335 | impl EmptyInputAndEmptyOutputError {
|
336 + | /* OperationErrorGenerator.kt:219 */
|
311 337 | /// Creates the `EmptyInputAndEmptyOutputError::Unhandled` variant from any error type.
|
312 338 | pub fn unhandled(
|
313 339 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
314 340 | ) -> Self {
|
315 341 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
316 342 | source: err.into(),
|
317 343 | meta: ::std::default::Default::default(),
|
318 344 | })
|
319 345 | }
|
320 346 |
|
321 347 | /// Creates the `EmptyInputAndEmptyOutputError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
322 348 | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
323 349 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
324 350 | source: err.clone().into(),
|
325 351 | meta: err,
|
326 352 | })
|
327 353 | }
|
328 - | ///
|
354 + | /// /* OperationErrorGenerator.kt:236 */
|
329 355 | /// Returns error metadata, which includes the error code, message,
|
330 356 | /// request ID, and potentially additional information.
|
331 357 | ///
|
358 + | /* OperationErrorGenerator.kt:242 */
|
332 359 | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
360 + | /* OperationErrorGenerator.kt:243 */
|
333 361 | match self {
|
334 - | Self::Unhandled(e) => &e.meta,
|
362 + | /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
|
363 + | /* OperationErrorGenerator.kt:243 */
|
335 364 | }
|
365 + | /* OperationErrorGenerator.kt:242 */
|
336 366 | }
|
367 + | /* OperationErrorGenerator.kt:218 */
|
337 368 | }
|
369 + | /* OperationErrorGenerator.kt:269 */
|
338 370 | impl ::std::error::Error for EmptyInputAndEmptyOutputError {
|
371 + | /* OperationErrorGenerator.kt:270 */
|
339 372 | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
373 + | /* OperationErrorGenerator.kt:318 */
|
340 374 | match self {
|
341 - | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
375 + | /* OperationErrorGenerator.kt:326 */
|
376 + | Self::Unhandled(_inner) => {
|
377 + | /* OperationErrorGenerator.kt:279 */
|
378 + | ::std::option::Option::Some(&*_inner.source)
|
379 + | /* OperationErrorGenerator.kt:326 */
|
380 + | } /* OperationErrorGenerator.kt:318 */
|
342 381 | }
|
382 + | /* OperationErrorGenerator.kt:270 */
|
343 383 | }
|
384 + | /* OperationErrorGenerator.kt:269 */
|
344 385 | }
|
386 + | /* OperationErrorGenerator.kt:133 */
|
345 387 | impl ::std::fmt::Display for EmptyInputAndEmptyOutputError {
|
388 + | /* OperationErrorGenerator.kt:134 */
|
346 389 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
390 + | /* OperationErrorGenerator.kt:318 */
|
347 391 | match self {
|
392 + | /* OperationErrorGenerator.kt:326 */
|
348 393 | Self::Unhandled(_inner) => {
|
394 + | /* OperationErrorGenerator.kt:139 */
|
349 395 | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
350 396 | write!(f, "unhandled error ({code})")
|
351 397 | } else {
|
352 398 | f.write_str("unhandled error")
|
353 399 | }
|
400 + | /* OperationErrorGenerator.kt:326 */
|
401 + | } /* OperationErrorGenerator.kt:318 */
|
354 402 | }
|
403 + | /* OperationErrorGenerator.kt:134 */
|
355 404 | }
|
356 - | }
|
405 + | /* OperationErrorGenerator.kt:133 */
|
357 406 | }
|
407 + | /* OperationErrorGenerator.kt:182 */
|
358 408 | impl ::aws_smithy_types::retry::ProvideErrorKind for EmptyInputAndEmptyOutputError {
|
409 + | /* OperationErrorGenerator.kt:186 */
|
359 410 | fn code(&self) -> ::std::option::Option<&str> {
|
411 + | /* OperationErrorGenerator.kt:187 */
|
360 412 | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
413 + | /* OperationErrorGenerator.kt:186 */
|
361 414 | }
|
415 + | /* OperationErrorGenerator.kt:190 */
|
362 416 | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
417 + | /* OperationErrorGenerator.kt:197 */
|
363 418 | ::std::option::Option::None
|
419 + | /* OperationErrorGenerator.kt:190 */
|
364 420 | }
|
421 + | /* OperationErrorGenerator.kt:182 */
|
365 422 | }
|
423 + | /* OperationErrorGenerator.kt:163 */
|
366 424 | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EmptyInputAndEmptyOutputError {
|
425 + | /* OperationErrorGenerator.kt:164 */
|
367 426 | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
427 + | /* OperationErrorGenerator.kt:318 */
|
368 428 | match self {
|
369 - | Self::Unhandled(_inner) => &_inner.meta,
|
429 + | /* OperationErrorGenerator.kt:326 */
|
430 + | Self::Unhandled(_inner) => {
|
431 + | /* OperationErrorGenerator.kt:168 */
|
432 + | &_inner.meta
|
433 + | /* OperationErrorGenerator.kt:326 */
|
434 + | } /* OperationErrorGenerator.kt:318 */
|
370 435 | }
|
436 + | /* OperationErrorGenerator.kt:164 */
|
371 437 | }
|
438 + | /* OperationErrorGenerator.kt:163 */
|
372 439 | }
|
440 + | /* OperationErrorGenerator.kt:109 */
|
373 441 | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EmptyInputAndEmptyOutputError {
|
442 + | /* OperationErrorGenerator.kt:110 */
|
374 443 | fn create_unhandled_error(
|
375 444 | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
376 445 | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
377 446 | ) -> Self {
|
447 + | /* OperationErrorGenerator.kt:121 */
|
378 448 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
379 449 | source,
|
380 450 | meta: meta.unwrap_or_default(),
|
381 451 | })
|
452 + | /* OperationErrorGenerator.kt:110 */
|
382 453 | }
|
454 + | /* OperationErrorGenerator.kt:109 */
|
383 455 | }
|
384 456 |
|
457 + | /* CodegenDelegator.kt:255 */
|
385 458 | pub use crate::operation::empty_input_and_empty_output::_empty_input_and_empty_output_output::EmptyInputAndEmptyOutputOutput;
|
386 459 |
|
460 + | /* CodegenDelegator.kt:255 */
|
387 461 | pub use crate::operation::empty_input_and_empty_output::_empty_input_and_empty_output_input::EmptyInputAndEmptyOutputInput;
|
388 462 |
|
463 + | /* RustModule.kt:172 */
|
389 464 | mod _empty_input_and_empty_output_input;
|
390 465 |
|
466 + | /* RustModule.kt:172 */
|
391 467 | mod _empty_input_and_empty_output_output;
|
392 468 |
|
393 - | /// Builders
|
469 + | /// /* CodegenDelegator.kt:51 */Builders
|
394 470 | pub mod builders;
|