1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct GetParametersForImport;
6impl GetParametersForImport {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
13 crate::operation::get_parameters_for_import::GetParametersForImportInput::SCHEMA;
14 pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
16 crate::operation::get_parameters_for_import::GetParametersForImportOutput::SCHEMA;
17 pub(crate) async fn orchestrate(
18 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
19 input: crate::operation::get_parameters_for_import::GetParametersForImportInput,
20 ) -> ::std::result::Result<
21 crate::operation::get_parameters_for_import::GetParametersForImportOutput,
22 ::aws_smithy_runtime_api::client::result::SdkError<
23 crate::operation::get_parameters_for_import::GetParametersForImportError,
24 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
25 >,
26 > {
27 let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
28 ::aws_smithy_runtime_api::client::interceptors::context::Error,
29 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
30 >| {
31 err.map_service_error(|err| {
32 err.downcast::<crate::operation::get_parameters_for_import::GetParametersForImportError>()
33 .expect("correct error type")
34 })
35 };
36 let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
37 .await
38 .map_err(map_err)?;
39 let output = context.finalize().map_err(map_err)?;
40 ::std::result::Result::Ok(
41 output
42 .downcast::<crate::operation::get_parameters_for_import::GetParametersForImportOutput>()
43 .expect("correct output type"),
44 )
45 }
46
47 pub(crate) async fn orchestrate_with_stop_point(
48 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
49 input: crate::operation::get_parameters_for_import::GetParametersForImportInput,
50 stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
51 ) -> ::std::result::Result<
52 ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
53 ::aws_smithy_runtime_api::client::result::SdkError<
54 ::aws_smithy_runtime_api::client::interceptors::context::Error,
55 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
56 >,
57 > {
58 let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
59 use ::tracing::Instrument;
60 ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("KMS", "GetParametersForImport", input, runtime_plugins, stop_point)
61 .instrument(::tracing::debug_span!(
64 "KMS.GetParametersForImport",
65 "rpc.service" = "KMS",
66 "rpc.method" = "GetParametersForImport",
67 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
68 "rpc.system" = "aws-api",
69 ))
70 .await
71 }
72
73 pub(crate) fn operation_runtime_plugins(
74 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
75 client_config: &crate::config::Config,
76 config_override: ::std::option::Option<crate::config::Builder>,
77 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
78 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
79
80 if let ::std::option::Option::Some(config_override) = config_override {
81 for plugin in config_override.runtime_plugins.iter().cloned() {
82 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
83 }
84 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
85 config_override,
86 client_config.config.clone(),
87 &client_config.runtime_components,
88 ));
89 }
90 runtime_plugins
91 }
92}
93pub(crate) mod error_registry {
102 pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
103 ::aws_smithy_schema::registry::TypeRegistry::builder()
104 .insert_error_shape(
105 crate::types::error::DependencyTimeoutException::SCHEMA,
106 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
107 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::DependencyTimeoutException::deserialize(d)?))
108 },
109 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
110 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::DependencyTimeoutException::deserialize(d)?))
111 },
112 )
113.insert_error_shape(
114 crate::types::error::InvalidArnException::SCHEMA,
115 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
116 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidArnException::deserialize(d)?))
117 },
118 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
119 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidArnException::deserialize(d)?))
120 },
121 )
122.insert_error_shape(
123 crate::types::error::KmsInternalException::SCHEMA,
124 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
125 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::KmsInternalException::deserialize(d)?))
126 },
127 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
128 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::KmsInternalException::deserialize(d)?))
129 },
130 )
131.insert_error_shape(
132 crate::types::error::KmsInvalidStateException::SCHEMA,
133 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
134 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::KmsInvalidStateException::deserialize(d)?))
135 },
136 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
137 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::KmsInvalidStateException::deserialize(d)?))
138 },
139 )
140.insert_error_shape(
141 crate::types::error::NotFoundException::SCHEMA,
142 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
143 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::NotFoundException::deserialize(d)?))
144 },
145 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
146 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::NotFoundException::deserialize(d)?))
147 },
148 )
149.insert_error_shape(
150 crate::types::error::UnsupportedOperationException::SCHEMA,
151 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
152 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::UnsupportedOperationException::deserialize(d)?))
153 },
154 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
155 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::UnsupportedOperationException::deserialize(d)?))
156 },
157 )
158 .build()
159 });
160}
161impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetParametersForImport {
162 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
163 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetParametersForImport");
164
165 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
166 GetParametersForImportRequestSerializer,
167 ));
168 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
169 GetParametersForImportResponseDeserializer,
170 ));
171
172 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
173 crate::config::auth::Params::builder()
174 .operation_name("GetParametersForImport")
175 .build()
176 .expect("required fields set"),
177 ));
178
179 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
180 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
181 "GetParametersForImport",
182 "KMS",
183 ));
184 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
185 signing_options.double_uri_encode = true;
186 signing_options.content_sha256_header = false;
187 signing_options.normalize_uri_path = true;
188 signing_options.payload_override = None;
189
190 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
191 signing_options,
192 ..::std::default::Default::default()
193 });
194
195 ::std::option::Option::Some(cfg.freeze())
196 }
197
198 fn runtime_components(
199 &self,
200 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
201 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
202 #[allow(unused_mut)]
203 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetParametersForImport")
204 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
205 GetParametersForImportTelemetryInputCaptureInterceptor,
206 ))
207 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
208 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
209 ))
210 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
211 GetParametersForImportEndpointParamsInterceptor,
212 ))
213 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
214 crate::operation::get_parameters_for_import::GetParametersForImportError,
215 >::new())
216 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
217 crate::operation::get_parameters_for_import::GetParametersForImportError,
218 >::new())
219 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
220 crate::operation::get_parameters_for_import::GetParametersForImportError,
221 >::new())
222 .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
223 crate::operation::get_parameters_for_import::GetParametersForImportError,
224 >::new());
225
226 ::std::borrow::Cow::Owned(rcb)
227 }
228}
229
230#[derive(Debug)]
231struct GetParametersForImportTelemetryInputCaptureInterceptor;
232
233#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
234impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetParametersForImportTelemetryInputCaptureInterceptor {
235 fn name(&self) -> &'static str {
236 "GetParametersForImportTelemetryInputCaptureInterceptor"
237 }
238
239 fn read_before_execution(
240 &self,
241 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
242 '_,
243 ::aws_smithy_runtime_api::client::interceptors::context::Input,
244 ::aws_smithy_runtime_api::client::interceptors::context::Output,
245 ::aws_smithy_runtime_api::client::interceptors::context::Error,
246 >,
247 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
248 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
249 let ::std::option::Option::Some(requested) = cfg
251 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
252 .filter(|r| !r.is_empty())
253 else {
254 return ::std::result::Result::Ok(());
255 };
256
257 let ::std::option::Option::Some(input) = context.input().downcast_ref::<GetParametersForImportInput>() else {
258 return ::std::result::Result::Ok(());
260 };
261
262 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
263 if requested.should_capture("KeyId") {
264 if let ::std::option::Option::Some(value) = input.key_id.as_deref() {
265 captured.insert("KeyId", value);
266 }
267 }
268
269 cfg.interceptor_state().store_put(captured);
270 ::std::result::Result::Ok(())
271 }
272}
273#[derive(Debug)]
274struct GetParametersForImportResponseDeserializer;
275impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetParametersForImportResponseDeserializer {
276 fn deserialize_nonstreaming_with_config(
277 &self,
278 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
279 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
280 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
281 let (success, status) = (response.status().is_success(), response.status().as_u16());
282 #[allow(unused_variables)]
287 let body = response.body().bytes().expect("body loaded");
288 let headers = response.headers();
289 #[allow(unused_mut)]
290 let mut force_error = false;
291 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
292 if !success && status != 200 || force_error {
293 let protocol = _cfg
294 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
295 .expect("a SharedClientProtocol is required");
296 #[allow(unused_mut)]
297 let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
298 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
299 })?;
300 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
301 let generic = generic_builder.build();
302 let error_code = match generic.code() {
303 ::std::option::Option::Some(code) => code,
304 ::std::option::Option::None => {
305 return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
306 ::aws_smithy_runtime_api::box_error::BoxError::from(
307 crate::operation::get_parameters_for_import::GetParametersForImportError::unhandled(generic),
308 ),
309 ))
310 }
311 };
312 let _error_message = generic.message().map(|msg| msg.to_owned());
313 let err = match error_code {
314 "DependencyTimeoutException" => {
315 crate::operation::get_parameters_for_import::GetParametersForImportError::DependencyTimeoutException({
316 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
317 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
318 ::aws_smithy_runtime_api::box_error::BoxError::from(e),
319 )
320 })?;
321 let mut tmp = <crate::types::error::builders::DependencyTimeoutExceptionBuilder>::default();
322 tmp.deserialize_members(&mut *deser).map_err(|e| {
323 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
324 ::aws_smithy_runtime_api::box_error::BoxError::from(e),
325 )
326 })?;
327 if tmp.message.is_none() {
328 tmp.message = _error_message;
329 }
330 let tmp = tmp.meta(generic);
331 tmp.build()
332 })
333 }
334 "InvalidArnException" => crate::operation::get_parameters_for_import::GetParametersForImportError::InvalidArnException({
335 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
336 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
337 e,
338 ))
339 })?;
340 let mut tmp = <crate::types::error::builders::InvalidArnExceptionBuilder>::default();
341 tmp.deserialize_members(&mut *deser).map_err(|e| {
342 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
343 e,
344 ))
345 })?;
346 if tmp.message.is_none() {
347 tmp.message = _error_message;
348 }
349 let tmp = tmp.meta(generic);
350 tmp.build()
351 }),
352 "KMSInternalException" => crate::operation::get_parameters_for_import::GetParametersForImportError::KmsInternalException({
353 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
354 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
355 e,
356 ))
357 })?;
358 let mut tmp = <crate::types::error::builders::KmsInternalExceptionBuilder>::default();
359 tmp.deserialize_members(&mut *deser).map_err(|e| {
360 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
361 e,
362 ))
363 })?;
364 if tmp.message.is_none() {
365 tmp.message = _error_message;
366 }
367 let tmp = tmp.meta(generic);
368 tmp.build()
369 }),
370 "KMSInvalidStateException" => crate::operation::get_parameters_for_import::GetParametersForImportError::KmsInvalidStateException({
371 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
372 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
373 e,
374 ))
375 })?;
376 let mut tmp = <crate::types::error::builders::KmsInvalidStateExceptionBuilder>::default();
377 tmp.deserialize_members(&mut *deser).map_err(|e| {
378 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
379 e,
380 ))
381 })?;
382 if tmp.message.is_none() {
383 tmp.message = _error_message;
384 }
385 let tmp = tmp.meta(generic);
386 tmp.build()
387 }),
388 "NotFoundException" => crate::operation::get_parameters_for_import::GetParametersForImportError::NotFoundException({
389 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
390 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
391 e,
392 ))
393 })?;
394 let mut tmp = <crate::types::error::builders::NotFoundExceptionBuilder>::default();
395 tmp.deserialize_members(&mut *deser).map_err(|e| {
396 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
397 e,
398 ))
399 })?;
400 if tmp.message.is_none() {
401 tmp.message = _error_message;
402 }
403 let tmp = tmp.meta(generic);
404 tmp.build()
405 }),
406 "UnsupportedOperationException" => {
407 crate::operation::get_parameters_for_import::GetParametersForImportError::UnsupportedOperationException({
408 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
409 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
410 ::aws_smithy_runtime_api::box_error::BoxError::from(e),
411 )
412 })?;
413 let mut tmp = <crate::types::error::builders::UnsupportedOperationExceptionBuilder>::default();
414 tmp.deserialize_members(&mut *deser).map_err(|e| {
415 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
416 ::aws_smithy_runtime_api::box_error::BoxError::from(e),
417 )
418 })?;
419 if tmp.message.is_none() {
420 tmp.message = _error_message;
421 }
422 let tmp = tmp.meta(generic);
423 tmp.build()
424 })
425 }
426 _ => {
427 match protocol
435 .deserialize_error_response(response, _cfg)
436 .ok()
437 .and_then(|mut deser| {
438 ::aws_smithy_schema::registry::reify_error(
439 crate::operation::get_parameters_for_import::error_registry::REGISTRY
440 .or(&crate::error_type_registry::REGISTRY),
441 error_code,
442 &mut *deser,
443 )
444 }) {
445 ::std::option::Option::Some(source) => <crate::operation::get_parameters_for_import::GetParametersForImportError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
446 ::std::option::Option::None => crate::operation::get_parameters_for_import::GetParametersForImportError::generic(generic),
447 }
448 }
449 };
450 ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
451 ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
452 ))
453 } else {
454 let protocol = _cfg
455 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
456 .expect("a SharedClientProtocol is required");
457 let mut deser = protocol
458 .deserialize_response(response, GetParametersForImport::OUTPUT_SCHEMA, _cfg)
459 .map_err(|e| {
460 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
461 })?;
462 let _response_headers = headers;
466 #[allow(unused_mut)]
470 let mut output = <crate::operation::get_parameters_for_import::builders::GetParametersForImportOutputBuilder>::default();
471 output.deserialize_members(&mut *deser).map_err(|e| {
472 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
473 })?;
474 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
475 let output = output.build();
476 ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
477 }
478 }
479}
480#[derive(Debug)]
481struct GetParametersForImportRequestSerializer;
482impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetParametersForImportRequestSerializer {
483 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
484 fn serialize_input(
485 &self,
486 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
487 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
488 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
489 let input = input
490 .downcast::<crate::operation::get_parameters_for_import::GetParametersForImportInput>()
491 .expect("correct type");
492
493 let protocol = _cfg
494 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
495 .expect("a SharedClientProtocol is required");
496 let mut request = protocol
497 .serialize_request(&input, GetParametersForImport::INPUT_SCHEMA, "/", _cfg)
498 .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
499
500 return ::std::result::Result::Ok(request);
501 }
502}
503#[derive(Debug)]
504struct GetParametersForImportEndpointParamsInterceptor;
505
506#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
507impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetParametersForImportEndpointParamsInterceptor {
508 fn name(&self) -> &'static str {
509 "GetParametersForImportEndpointParamsInterceptor"
510 }
511
512 fn read_before_execution(
513 &self,
514 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
515 '_,
516 ::aws_smithy_runtime_api::client::interceptors::context::Input,
517 ::aws_smithy_runtime_api::client::interceptors::context::Output,
518 ::aws_smithy_runtime_api::client::interceptors::context::Error,
519 >,
520 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
521 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
522 let _input = context
523 .input()
524 .downcast_ref::<GetParametersForImportInput>()
525 .ok_or("failed to downcast to GetParametersForImportInput")?;
526
527 let params = crate::config::endpoint::Params::builder()
528 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
529 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
530 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
531 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
532 .build()
533 .map_err(|err| {
534 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
535 })?;
536 cfg.interceptor_state()
537 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
538 ::std::result::Result::Ok(())
539 }
540}
541
542#[non_exhaustive]
547#[derive(::std::fmt::Debug)]
548pub enum GetParametersForImportError {
549 DependencyTimeoutException(crate::types::error::DependencyTimeoutException),
551 InvalidArnException(crate::types::error::InvalidArnException),
553 KmsInternalException(crate::types::error::KmsInternalException),
555 KmsInvalidStateException(crate::types::error::KmsInvalidStateException),
565 NotFoundException(crate::types::error::NotFoundException),
567 UnsupportedOperationException(crate::types::error::UnsupportedOperationException),
569 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
571 variable wildcard pattern and check `.code()`:
572 \
573 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
574 \
575 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetParametersForImportError) for what information is available for the error.")]
576 Unhandled(crate::error::sealed_unhandled::Unhandled),
577}
578impl GetParametersForImportError {
579 pub fn unhandled(
581 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
582 ) -> Self {
583 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
584 source: err.into(),
585 meta: ::std::default::Default::default(),
586 })
587 }
588
589 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
591 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
592 source: err.clone().into(),
593 meta: err,
594 })
595 }
596 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
601 match self {
602 Self::DependencyTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
603 Self::InvalidArnException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
604 Self::KmsInternalException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
605 Self::KmsInvalidStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
606 Self::NotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
607 Self::UnsupportedOperationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
608 Self::Unhandled(e) => &e.meta,
609 }
610 }
611 pub fn is_dependency_timeout_exception(&self) -> bool {
613 matches!(self, Self::DependencyTimeoutException(_))
614 }
615 pub fn is_invalid_arn_exception(&self) -> bool {
617 matches!(self, Self::InvalidArnException(_))
618 }
619 pub fn is_kms_internal_exception(&self) -> bool {
621 matches!(self, Self::KmsInternalException(_))
622 }
623 pub fn is_kms_invalid_state_exception(&self) -> bool {
625 matches!(self, Self::KmsInvalidStateException(_))
626 }
627 pub fn is_not_found_exception(&self) -> bool {
629 matches!(self, Self::NotFoundException(_))
630 }
631 pub fn is_unsupported_operation_exception(&self) -> bool {
633 matches!(self, Self::UnsupportedOperationException(_))
634 }
635}
636impl ::std::error::Error for GetParametersForImportError {
637 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
638 match self {
639 Self::DependencyTimeoutException(_inner) => ::std::option::Option::Some(_inner),
640 Self::InvalidArnException(_inner) => ::std::option::Option::Some(_inner),
641 Self::KmsInternalException(_inner) => ::std::option::Option::Some(_inner),
642 Self::KmsInvalidStateException(_inner) => ::std::option::Option::Some(_inner),
643 Self::NotFoundException(_inner) => ::std::option::Option::Some(_inner),
644 Self::UnsupportedOperationException(_inner) => ::std::option::Option::Some(_inner),
645 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
646 }
647 }
648}
649impl ::std::fmt::Display for GetParametersForImportError {
650 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
651 match self {
652 Self::DependencyTimeoutException(_inner) => _inner.fmt(f),
653 Self::InvalidArnException(_inner) => _inner.fmt(f),
654 Self::KmsInternalException(_inner) => _inner.fmt(f),
655 Self::KmsInvalidStateException(_inner) => _inner.fmt(f),
656 Self::NotFoundException(_inner) => _inner.fmt(f),
657 Self::UnsupportedOperationException(_inner) => _inner.fmt(f),
658 Self::Unhandled(_inner) => {
659 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
660 write!(f, "unhandled error ({code})")
661 } else {
662 f.write_str("unhandled error")
663 }
664 }
665 }
666 }
667}
668impl ::aws_smithy_types::retry::ProvideErrorKind for GetParametersForImportError {
669 fn code(&self) -> ::std::option::Option<&str> {
670 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
671 }
672 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
673 ::std::option::Option::None
674 }
675}
676impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetParametersForImportError {
677 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
678 match self {
679 Self::DependencyTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
680 Self::InvalidArnException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
681 Self::KmsInternalException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
682 Self::KmsInvalidStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
683 Self::NotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
684 Self::UnsupportedOperationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
685 Self::Unhandled(_inner) => &_inner.meta,
686 }
687 }
688}
689impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetParametersForImportError {
690 fn create_unhandled_error(
691 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
692 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
693 ) -> Self {
694 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
695 source,
696 meta: meta.unwrap_or_default(),
697 })
698 }
699}
700impl ::aws_types::request_id::RequestId for crate::operation::get_parameters_for_import::GetParametersForImportError {
701 fn request_id(&self) -> Option<&str> {
702 self.meta().request_id()
703 }
704}
705
706pub use crate::operation::get_parameters_for_import::_get_parameters_for_import_input::GetParametersForImportInput;
707
708pub use crate::operation::get_parameters_for_import::_get_parameters_for_import_output::GetParametersForImportOutput;
709
710mod _get_parameters_for_import_input;
711
712mod _get_parameters_for_import_output;
713
714pub mod builders;