1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct GetRandomPassword;
6impl GetRandomPassword {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::get_random_password::GetRandomPasswordInput::SCHEMA;
13 pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::get_random_password::GetRandomPasswordOutput::SCHEMA;
15 pub(crate) async fn orchestrate(
16 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17 input: crate::operation::get_random_password::GetRandomPasswordInput,
18 ) -> ::std::result::Result<
19 crate::operation::get_random_password::GetRandomPasswordOutput,
20 ::aws_smithy_runtime_api::client::result::SdkError<
21 crate::operation::get_random_password::GetRandomPasswordError,
22 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
23 >,
24 > {
25 let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
26 ::aws_smithy_runtime_api::client::interceptors::context::Error,
27 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
28 >| {
29 err.map_service_error(|err| {
30 err.downcast::<crate::operation::get_random_password::GetRandomPasswordError>()
31 .expect("correct error type")
32 })
33 };
34 let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
35 .await
36 .map_err(map_err)?;
37 let output = context.finalize().map_err(map_err)?;
38 ::std::result::Result::Ok(
39 output
40 .downcast::<crate::operation::get_random_password::GetRandomPasswordOutput>()
41 .expect("correct output type"),
42 )
43 }
44
45 pub(crate) async fn orchestrate_with_stop_point(
46 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
47 input: crate::operation::get_random_password::GetRandomPasswordInput,
48 stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
49 ) -> ::std::result::Result<
50 ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
51 ::aws_smithy_runtime_api::client::result::SdkError<
52 ::aws_smithy_runtime_api::client::interceptors::context::Error,
53 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
54 >,
55 > {
56 let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
57 use ::tracing::Instrument;
58 ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("Secrets Manager", "GetRandomPassword", input, runtime_plugins, stop_point)
59 .instrument(::tracing::debug_span!(
62 "Secrets Manager.GetRandomPassword",
63 "rpc.service" = "Secrets Manager",
64 "rpc.method" = "GetRandomPassword",
65 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
66 "rpc.system" = "aws-api",
67 ))
68 .await
69 }
70
71 pub(crate) fn operation_runtime_plugins(
72 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
73 client_config: &crate::config::Config,
74 config_override: ::std::option::Option<crate::config::Builder>,
75 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
76 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
77
78 if let ::std::option::Option::Some(config_override) = config_override {
79 for plugin in config_override.runtime_plugins.iter().cloned() {
80 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
81 }
82 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
83 config_override,
84 client_config.config.clone(),
85 &client_config.runtime_components,
86 ));
87 }
88 runtime_plugins
89 }
90}
91pub(crate) mod error_registry {
100 pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
101 ::aws_smithy_schema::registry::TypeRegistry::builder()
102 .insert_error_shape(
103 crate::types::error::InternalServiceError::SCHEMA,
104 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
105 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InternalServiceError::deserialize(d)?))
106 },
107 |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> {
108 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InternalServiceError::deserialize(d)?))
109 },
110 )
111.insert_error_shape(
112 crate::types::error::InvalidParameterException::SCHEMA,
113 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
114 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidParameterException::deserialize(d)?))
115 },
116 |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> {
117 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidParameterException::deserialize(d)?))
118 },
119 )
120.insert_error_shape(
121 crate::types::error::InvalidRequestException::SCHEMA,
122 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
123 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidRequestException::deserialize(d)?))
124 },
125 |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> {
126 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidRequestException::deserialize(d)?))
127 },
128 )
129 .build()
130 });
131}
132impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetRandomPassword {
133 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
134 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetRandomPassword");
135
136 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
137 GetRandomPasswordRequestSerializer,
138 ));
139 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
140 GetRandomPasswordResponseDeserializer,
141 ));
142
143 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
144 crate::config::auth::Params::builder()
145 .operation_name("GetRandomPassword")
146 .build()
147 .expect("required fields set"),
148 ));
149
150 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
151 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
152 "GetRandomPassword",
153 "Secrets Manager",
154 ));
155 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
156 signing_options.double_uri_encode = true;
157 signing_options.content_sha256_header = false;
158 signing_options.normalize_uri_path = true;
159 signing_options.payload_override = None;
160
161 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
162 signing_options,
163 ..::std::default::Default::default()
164 });
165
166 ::std::option::Option::Some(cfg.freeze())
167 }
168
169 fn runtime_components(
170 &self,
171 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
172 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
173 #[allow(unused_mut)]
174 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetRandomPassword")
175 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
176 GetRandomPasswordTelemetryInputCaptureInterceptor,
177 ))
178 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
179 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
180 ))
181 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
182 GetRandomPasswordEndpointParamsInterceptor,
183 ))
184 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
185 crate::operation::get_random_password::GetRandomPasswordError,
186 >::new())
187 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
188 crate::operation::get_random_password::GetRandomPasswordError,
189 >::new())
190 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
191 crate::operation::get_random_password::GetRandomPasswordError,
192 >::new())
193 .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
194 crate::operation::get_random_password::GetRandomPasswordError,
195 >::new());
196
197 ::std::borrow::Cow::Owned(rcb)
198 }
199}
200
201#[derive(Debug)]
202struct GetRandomPasswordTelemetryInputCaptureInterceptor;
203
204#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
205impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetRandomPasswordTelemetryInputCaptureInterceptor {
206 fn name(&self) -> &'static str {
207 "GetRandomPasswordTelemetryInputCaptureInterceptor"
208 }
209
210 fn read_before_execution(
211 &self,
212 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
213 '_,
214 ::aws_smithy_runtime_api::client::interceptors::context::Input,
215 ::aws_smithy_runtime_api::client::interceptors::context::Output,
216 ::aws_smithy_runtime_api::client::interceptors::context::Error,
217 >,
218 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
219 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
220 let ::std::option::Option::Some(requested) = cfg
222 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
223 .filter(|r| !r.is_empty())
224 else {
225 return ::std::result::Result::Ok(());
226 };
227
228 let ::std::option::Option::Some(input) = context.input().downcast_ref::<GetRandomPasswordInput>() else {
229 return ::std::result::Result::Ok(());
231 };
232
233 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
234 if requested.should_capture("ExcludeCharacters") {
235 if let ::std::option::Option::Some(value) = input.exclude_characters.as_deref() {
236 captured.insert("ExcludeCharacters", value);
237 }
238 }
239
240 cfg.interceptor_state().store_put(captured);
241 ::std::result::Result::Ok(())
242 }
243}
244#[derive(Debug)]
245struct GetRandomPasswordResponseDeserializer;
246impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetRandomPasswordResponseDeserializer {
247 fn deserialize_nonstreaming_with_config(
248 &self,
249 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
250 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
251 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
252 let (success, status) = (response.status().is_success(), response.status().as_u16());
253 #[allow(unused_variables)]
258 let body = response.body().bytes().expect("body loaded");
259 let headers = response.headers();
260 #[allow(unused_mut)]
261 let mut force_error = false;
262 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
263 if !success && status != 200 || force_error {
264 let protocol = _cfg
265 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
266 .expect("a SharedClientProtocol is required");
267 #[allow(unused_mut)]
268 let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
269 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
270 })?;
271 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
272 let generic = generic_builder.build();
273 let error_code = match generic.code() {
274 ::std::option::Option::Some(code) => code,
275 ::std::option::Option::None => {
276 return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
277 ::aws_smithy_runtime_api::box_error::BoxError::from(
278 crate::operation::get_random_password::GetRandomPasswordError::unhandled(generic),
279 ),
280 ))
281 }
282 };
283 let _error_message = generic.message().map(|msg| msg.to_owned());
284 let err = match error_code {
285 "InternalServiceError" => crate::operation::get_random_password::GetRandomPasswordError::InternalServiceError({
286 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
287 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
288 e,
289 ))
290 })?;
291 let mut tmp = <crate::types::error::builders::InternalServiceErrorBuilder>::default();
292 tmp.deserialize_members(&mut *deser).map_err(|e| {
293 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
294 e,
295 ))
296 })?;
297 if tmp.message.is_none() {
298 tmp.message = _error_message;
299 }
300 let tmp = tmp.meta(generic);
301 tmp.build()
302 }),
303 "InvalidParameterException" => crate::operation::get_random_password::GetRandomPasswordError::InvalidParameterException({
304 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
305 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
306 e,
307 ))
308 })?;
309 let mut tmp = <crate::types::error::builders::InvalidParameterExceptionBuilder>::default();
310 tmp.deserialize_members(&mut *deser).map_err(|e| {
311 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
312 e,
313 ))
314 })?;
315 if tmp.message.is_none() {
316 tmp.message = _error_message;
317 }
318 let tmp = tmp.meta(generic);
319 tmp.build()
320 }),
321 "InvalidRequestException" => crate::operation::get_random_password::GetRandomPasswordError::InvalidRequestException({
322 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
323 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
324 e,
325 ))
326 })?;
327 let mut tmp = <crate::types::error::builders::InvalidRequestExceptionBuilder>::default();
328 tmp.deserialize_members(&mut *deser).map_err(|e| {
329 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
330 e,
331 ))
332 })?;
333 if tmp.message.is_none() {
334 tmp.message = _error_message;
335 }
336 let tmp = tmp.meta(generic);
337 tmp.build()
338 }),
339 _ => {
340 match protocol
348 .deserialize_error_response(response, _cfg)
349 .ok()
350 .and_then(|mut deser| {
351 ::aws_smithy_schema::registry::reify_error(
352 crate::operation::get_random_password::error_registry::REGISTRY
353 .or(&crate::error_type_registry::REGISTRY),
354 error_code,
355 &mut *deser,
356 )
357 }) {
358 ::std::option::Option::Some(source) => <crate::operation::get_random_password::GetRandomPasswordError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
359 ::std::option::Option::None => crate::operation::get_random_password::GetRandomPasswordError::generic(generic),
360 }
361 }
362 };
363 ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
364 ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
365 ))
366 } else {
367 let protocol = _cfg
368 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
369 .expect("a SharedClientProtocol is required");
370 let mut deser = protocol
371 .deserialize_response(response, GetRandomPassword::OUTPUT_SCHEMA, _cfg)
372 .map_err(|e| {
373 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
374 })?;
375 let _response_headers = headers;
379 #[allow(unused_mut)]
383 let mut output = <crate::operation::get_random_password::builders::GetRandomPasswordOutputBuilder>::default();
384 output.deserialize_members(&mut *deser).map_err(|e| {
385 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
386 })?;
387 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
388 let output = output.build();
389 ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
390 }
391 }
392}
393#[derive(Debug)]
394struct GetRandomPasswordRequestSerializer;
395impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetRandomPasswordRequestSerializer {
396 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
397 fn serialize_input(
398 &self,
399 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
400 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
401 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
402 let input = input
403 .downcast::<crate::operation::get_random_password::GetRandomPasswordInput>()
404 .expect("correct type");
405
406 let protocol = _cfg
407 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
408 .expect("a SharedClientProtocol is required");
409 let mut request = protocol
410 .serialize_request(&input, GetRandomPassword::INPUT_SCHEMA, "/", _cfg)
411 .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
412
413 return ::std::result::Result::Ok(request);
414 }
415}
416#[derive(Debug)]
417struct GetRandomPasswordEndpointParamsInterceptor;
418
419#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
420impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetRandomPasswordEndpointParamsInterceptor {
421 fn name(&self) -> &'static str {
422 "GetRandomPasswordEndpointParamsInterceptor"
423 }
424
425 fn read_before_execution(
426 &self,
427 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
428 '_,
429 ::aws_smithy_runtime_api::client::interceptors::context::Input,
430 ::aws_smithy_runtime_api::client::interceptors::context::Output,
431 ::aws_smithy_runtime_api::client::interceptors::context::Error,
432 >,
433 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
434 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
435 let _input = context
436 .input()
437 .downcast_ref::<GetRandomPasswordInput>()
438 .ok_or("failed to downcast to GetRandomPasswordInput")?;
439
440 let params = crate::config::endpoint::Params::builder()
441 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
442 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
443 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
444 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
445 .build()
446 .map_err(|err| {
447 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
448 })?;
449 cfg.interceptor_state()
450 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
451 ::std::result::Result::Ok(())
452 }
453}
454
455#[non_exhaustive]
460#[derive(::std::fmt::Debug)]
461pub enum GetRandomPasswordError {
462 InternalServiceError(crate::types::error::InternalServiceError),
464 InvalidParameterException(crate::types::error::InvalidParameterException),
466 InvalidRequestException(crate::types::error::InvalidRequestException),
477 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
479 variable wildcard pattern and check `.code()`:
480 \
481 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
482 \
483 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetRandomPasswordError) for what information is available for the error.")]
484 Unhandled(crate::error::sealed_unhandled::Unhandled),
485}
486impl GetRandomPasswordError {
487 pub fn unhandled(
489 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
490 ) -> Self {
491 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
492 source: err.into(),
493 meta: ::std::default::Default::default(),
494 })
495 }
496
497 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
499 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
500 source: err.clone().into(),
501 meta: err,
502 })
503 }
504 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
509 match self {
510 Self::InternalServiceError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
511 Self::InvalidParameterException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
512 Self::InvalidRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
513 Self::Unhandled(e) => &e.meta,
514 }
515 }
516 pub fn is_internal_service_error(&self) -> bool {
518 matches!(self, Self::InternalServiceError(_))
519 }
520 pub fn is_invalid_parameter_exception(&self) -> bool {
522 matches!(self, Self::InvalidParameterException(_))
523 }
524 pub fn is_invalid_request_exception(&self) -> bool {
526 matches!(self, Self::InvalidRequestException(_))
527 }
528}
529impl ::std::error::Error for GetRandomPasswordError {
530 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
531 match self {
532 Self::InternalServiceError(_inner) => ::std::option::Option::Some(_inner),
533 Self::InvalidParameterException(_inner) => ::std::option::Option::Some(_inner),
534 Self::InvalidRequestException(_inner) => ::std::option::Option::Some(_inner),
535 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
536 }
537 }
538}
539impl ::std::fmt::Display for GetRandomPasswordError {
540 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
541 match self {
542 Self::InternalServiceError(_inner) => _inner.fmt(f),
543 Self::InvalidParameterException(_inner) => _inner.fmt(f),
544 Self::InvalidRequestException(_inner) => _inner.fmt(f),
545 Self::Unhandled(_inner) => {
546 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
547 write!(f, "unhandled error ({code})")
548 } else {
549 f.write_str("unhandled error")
550 }
551 }
552 }
553 }
554}
555impl ::aws_smithy_types::retry::ProvideErrorKind for GetRandomPasswordError {
556 fn code(&self) -> ::std::option::Option<&str> {
557 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
558 }
559 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
560 ::std::option::Option::None
561 }
562}
563impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetRandomPasswordError {
564 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
565 match self {
566 Self::InternalServiceError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
567 Self::InvalidParameterException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
568 Self::InvalidRequestException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
569 Self::Unhandled(_inner) => &_inner.meta,
570 }
571 }
572}
573impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetRandomPasswordError {
574 fn create_unhandled_error(
575 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
576 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
577 ) -> Self {
578 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
579 source,
580 meta: meta.unwrap_or_default(),
581 })
582 }
583}
584impl ::aws_types::request_id::RequestId for crate::operation::get_random_password::GetRandomPasswordError {
585 fn request_id(&self) -> Option<&str> {
586 self.meta().request_id()
587 }
588}
589
590pub use crate::operation::get_random_password::_get_random_password_input::GetRandomPasswordInput;
591
592pub use crate::operation::get_random_password::_get_random_password_output::GetRandomPasswordOutput;
593
594mod _get_random_password_input;
595
596mod _get_random_password_output;
597
598pub mod builders;