Skip to main content

aws_sdk_kms/operation/
list_keys.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `ListKeys`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct ListKeys;
6impl ListKeys {
7    /// Creates a new `ListKeys`
8    pub fn new() -> Self {
9        Self
10    }
11    /// The schema for this operation's input shape.
12    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::list_keys::ListKeysInput::SCHEMA;
13    /// The schema for this operation's output shape.
14    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::list_keys::ListKeysOutput::SCHEMA;
15    pub(crate) async fn orchestrate(
16        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17        input: crate::operation::list_keys::ListKeysInput,
18    ) -> ::std::result::Result<
19        crate::operation::list_keys::ListKeysOutput,
20        ::aws_smithy_runtime_api::client::result::SdkError<
21            crate::operation::list_keys::ListKeysError,
22            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
23        >,
24    > {
25        let map_err =
26            |err: ::aws_smithy_runtime_api::client::result::SdkError<
27                ::aws_smithy_runtime_api::client::interceptors::context::Error,
28                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
29            >| { err.map_service_error(|err| err.downcast::<crate::operation::list_keys::ListKeysError>().expect("correct error type")) };
30        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
31            .await
32            .map_err(map_err)?;
33        let output = context.finalize().map_err(map_err)?;
34        ::std::result::Result::Ok(
35            output
36                .downcast::<crate::operation::list_keys::ListKeysOutput>()
37                .expect("correct output type"),
38        )
39    }
40
41    pub(crate) async fn orchestrate_with_stop_point(
42        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
43        input: crate::operation::list_keys::ListKeysInput,
44        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
45    ) -> ::std::result::Result<
46        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
47        ::aws_smithy_runtime_api::client::result::SdkError<
48            ::aws_smithy_runtime_api::client::interceptors::context::Error,
49            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
50        >,
51    > {
52        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
53        use ::tracing::Instrument;
54        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("KMS", "ListKeys", input, runtime_plugins, stop_point)
55            // Create a parent span for the entire operation. Includes a random, internal-only,
56            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
57            .instrument(::tracing::debug_span!(
58                "KMS.ListKeys",
59                "rpc.service" = "KMS",
60                "rpc.method" = "ListKeys",
61                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
62                "rpc.system" = "aws-api",
63            ))
64            .await
65    }
66
67    pub(crate) fn operation_runtime_plugins(
68        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
69        client_config: &crate::config::Config,
70        config_override: ::std::option::Option<crate::config::Builder>,
71    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
72        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
73
74        if let ::std::option::Option::Some(config_override) = config_override {
75            for plugin in config_override.runtime_plugins.iter().cloned() {
76                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
77            }
78            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
79                config_override,
80                client_config.config.clone(),
81                &client_config.runtime_components,
82            ));
83        }
84        runtime_plugins
85    }
86}
87/// Per-operation error registry. Contains an entry for every modeled
88/// error this operation can throw.
89///
90/// Used by the schema-serde error path as the operation-scoped lookup
91/// for registry-backed error reification: an error code that does not
92/// match one of the operation's modeled errors directly is resolved
93/// against this registry first, then widened to the service-wide error
94/// registry.
95pub(crate) mod error_registry {
96    pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
97        ::aws_smithy_schema::registry::TypeRegistry::builder()
98                            .insert_error_shape(
99                        crate::types::error::DependencyTimeoutException::SCHEMA,
100                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
101                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::DependencyTimeoutException::deserialize(d)?))
102                        },
103                        |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> {
104                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::DependencyTimeoutException::deserialize(d)?))
105                        },
106                    )
107.insert_error_shape(
108                        crate::types::error::InvalidMarkerException::SCHEMA,
109                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
110                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidMarkerException::deserialize(d)?))
111                        },
112                        |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> {
113                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidMarkerException::deserialize(d)?))
114                        },
115                    )
116.insert_error_shape(
117                        crate::types::error::KmsInternalException::SCHEMA,
118                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
119                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::KmsInternalException::deserialize(d)?))
120                        },
121                        |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> {
122                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::KmsInternalException::deserialize(d)?))
123                        },
124                    )
125                            .build()
126    });
127}
128impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListKeys {
129    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
130        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListKeys");
131
132        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
133            ListKeysRequestSerializer,
134        ));
135        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
136            ListKeysResponseDeserializer,
137        ));
138
139        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
140            crate::config::auth::Params::builder()
141                .operation_name("ListKeys")
142                .build()
143                .expect("required fields set"),
144        ));
145
146        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("ListKeys", "KMS"));
147        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
148        signing_options.double_uri_encode = true;
149        signing_options.content_sha256_header = false;
150        signing_options.normalize_uri_path = true;
151        signing_options.payload_override = None;
152
153        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
154            signing_options,
155            ..::std::default::Default::default()
156        });
157
158        ::std::option::Option::Some(cfg.freeze())
159    }
160
161    fn runtime_components(
162        &self,
163        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
164    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
165        #[allow(unused_mut)]
166        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListKeys")
167            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
168                ListKeysTelemetryInputCaptureInterceptor,
169            ))
170            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
171                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
172            ))
173            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
174                ListKeysEndpointParamsInterceptor,
175            ))
176            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
177                crate::operation::list_keys::ListKeysError,
178            >::new())
179            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
180                crate::operation::list_keys::ListKeysError,
181            >::new())
182            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
183                crate::operation::list_keys::ListKeysError,
184            >::new())
185            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
186                crate::operation::list_keys::ListKeysError,
187            >::new());
188
189        ::std::borrow::Cow::Owned(rcb)
190    }
191}
192
193#[derive(Debug)]
194struct ListKeysTelemetryInputCaptureInterceptor;
195
196#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
197impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListKeysTelemetryInputCaptureInterceptor {
198    fn name(&self) -> &'static str {
199        "ListKeysTelemetryInputCaptureInterceptor"
200    }
201
202    fn read_before_execution(
203        &self,
204        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
205            '_,
206            ::aws_smithy_runtime_api::client::interceptors::context::Input,
207            ::aws_smithy_runtime_api::client::interceptors::context::Output,
208            ::aws_smithy_runtime_api::client::interceptors::context::Error,
209        >,
210        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
211    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
212        // Nothing to do unless the customer opted in by naming members to record.
213        let ::std::option::Option::Some(requested) = cfg
214            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
215            .filter(|r| !r.is_empty())
216        else {
217            return ::std::result::Result::Ok(());
218        };
219
220        let ::std::option::Option::Some(input) = context.input().downcast_ref::<ListKeysInput>() else {
221            // A mismatched input is not this interceptor's concern; skip quietly.
222            return ::std::result::Result::Ok(());
223        };
224
225        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
226        if requested.should_capture("Marker") {
227            if let ::std::option::Option::Some(value) = input.marker.as_deref() {
228                captured.insert("Marker", value);
229            }
230        }
231
232        cfg.interceptor_state().store_put(captured);
233        ::std::result::Result::Ok(())
234    }
235}
236#[derive(Debug)]
237struct ListKeysResponseDeserializer;
238impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListKeysResponseDeserializer {
239    fn deserialize_nonstreaming_with_config(
240        &self,
241        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
242        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
243    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
244        let (success, status) = (response.status().is_success(), response.status().as_u16());
245        // Load body and headers BEFORE BeforeParseResponse so customizations
246        // (e.g., S3's `body_is_error` check that detects errors returned with
247        // HTTP 200) can inspect them. The legacy non-streaming path also
248        // loads `body` before firing this hook.
249        #[allow(unused_variables)]
250        let body = response.body().bytes().expect("body loaded");
251        let headers = response.headers();
252        #[allow(unused_mut)]
253        let mut force_error = false;
254        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
255        if !success && status != 200 || force_error {
256            let protocol = _cfg
257                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
258                .expect("a SharedClientProtocol is required");
259            #[allow(unused_mut)]
260            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
261                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
262            })?;
263            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
264            let generic = generic_builder.build();
265            let error_code = match generic.code() {
266                ::std::option::Option::Some(code) => code,
267                ::std::option::Option::None => {
268                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
269                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::list_keys::ListKeysError::unhandled(generic)),
270                    ))
271                }
272            };
273            let _error_message = generic.message().map(|msg| msg.to_owned());
274            let err = match error_code {
275                "DependencyTimeoutException" => crate::operation::list_keys::ListKeysError::DependencyTimeoutException({
276                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
277                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
278                            e,
279                        ))
280                    })?;
281                    let mut tmp = <crate::types::error::builders::DependencyTimeoutExceptionBuilder>::default();
282                    tmp.deserialize_members(&mut *deser).map_err(|e| {
283                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
284                            e,
285                        ))
286                    })?;
287                    if tmp.message.is_none() {
288                        tmp.message = _error_message;
289                    }
290                    let tmp = tmp.meta(generic);
291                    tmp.build()
292                }),
293                "InvalidMarkerException" => crate::operation::list_keys::ListKeysError::InvalidMarkerException({
294                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
295                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
296                            e,
297                        ))
298                    })?;
299                    let mut tmp = <crate::types::error::builders::InvalidMarkerExceptionBuilder>::default();
300                    tmp.deserialize_members(&mut *deser).map_err(|e| {
301                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
302                            e,
303                        ))
304                    })?;
305                    if tmp.message.is_none() {
306                        tmp.message = _error_message;
307                    }
308                    let tmp = tmp.meta(generic);
309                    tmp.build()
310                }),
311                "KMSInternalException" => crate::operation::list_keys::ListKeysError::KmsInternalException({
312                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
313                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
314                            e,
315                        ))
316                    })?;
317                    let mut tmp = <crate::types::error::builders::KmsInternalExceptionBuilder>::default();
318                    tmp.deserialize_members(&mut *deser).map_err(|e| {
319                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
320                            e,
321                        ))
322                    })?;
323                    if tmp.message.is_none() {
324                        tmp.message = _error_message;
325                    }
326                    let tmp = tmp.meta(generic);
327                    tmp.build()
328                }),
329                _ => {
330                    // Registry-backed, operation-scoped reification of an error whose
331                    // code this operation does not model directly: the operation's own
332                    // error registry is consulted first, then the lookup widens to the
333                    // service-wide error registry. On a hit, the reified error is attached
334                    // as the source of the returned unhandled error while its metadata
335                    // (code, message, request id) is preserved; on a miss the generic
336                    // error is returned unchanged.
337                    match protocol
338                        .deserialize_error_response(response, _cfg)
339                        .ok()
340                        .and_then(|mut deser| {
341                            ::aws_smithy_schema::registry::reify_error(
342                                crate::operation::list_keys::error_registry::REGISTRY
343                                    .or(&crate::error_type_registry::REGISTRY),
344                                error_code,
345                                &mut *deser,
346                            )
347                        }) {
348                        ::std::option::Option::Some(source) => <crate::operation::list_keys::ListKeysError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
349                        ::std::option::Option::None => crate::operation::list_keys::ListKeysError::generic(generic),
350                    }
351                }
352            };
353            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
354                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
355            ))
356        } else {
357            let protocol = _cfg
358                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
359                .expect("a SharedClientProtocol is required");
360            let mut deser = protocol.deserialize_response(response, ListKeys::OUTPUT_SCHEMA, _cfg).map_err(|e| {
361                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
362            })?;
363            // `headers` is already in scope from the top of the function; alias it as
364            // `_response_headers` so MutateOutput customizations have a stable name to
365            // read from.
366            let _response_headers = headers;
367            // `mut` is required because `deserialize_members` and the `MutateOutput`
368            // builder setters take `&mut self`. Marked `allow(unused_mut)` because an
369            // empty output has no members and no customizations to run.
370            #[allow(unused_mut)]
371            let mut output = <crate::operation::list_keys::builders::ListKeysOutputBuilder>::default();
372            output.deserialize_members(&mut *deser).map_err(|e| {
373                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
374            })?;
375            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
376            let output = output.build();
377            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
378        }
379    }
380}
381#[derive(Debug)]
382struct ListKeysRequestSerializer;
383impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListKeysRequestSerializer {
384    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
385    fn serialize_input(
386        &self,
387        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
388        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
389    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
390        let input = input.downcast::<crate::operation::list_keys::ListKeysInput>().expect("correct type");
391
392        let protocol = _cfg
393            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
394            .expect("a SharedClientProtocol is required");
395        let mut request = protocol
396            .serialize_request(&input, ListKeys::INPUT_SCHEMA, "/", _cfg)
397            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
398
399        return ::std::result::Result::Ok(request);
400    }
401}
402#[derive(Debug)]
403struct ListKeysEndpointParamsInterceptor;
404
405#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
406impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListKeysEndpointParamsInterceptor {
407    fn name(&self) -> &'static str {
408        "ListKeysEndpointParamsInterceptor"
409    }
410
411    fn read_before_execution(
412        &self,
413        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
414            '_,
415            ::aws_smithy_runtime_api::client::interceptors::context::Input,
416            ::aws_smithy_runtime_api::client::interceptors::context::Output,
417            ::aws_smithy_runtime_api::client::interceptors::context::Error,
418        >,
419        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
420    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
421        let _input = context
422            .input()
423            .downcast_ref::<ListKeysInput>()
424            .ok_or("failed to downcast to ListKeysInput")?;
425
426        let params = crate::config::endpoint::Params::builder()
427            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
428            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
429            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
430            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
431            .build()
432            .map_err(|err| {
433                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
434            })?;
435        cfg.interceptor_state()
436            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
437        ::std::result::Result::Ok(())
438    }
439}
440
441// The get_* functions below are generated from JMESPath expressions in the
442// operationContextParams trait. They target the operation's input shape.
443
444/// Error type for the `ListKeysError` operation.
445#[non_exhaustive]
446#[derive(::std::fmt::Debug)]
447pub enum ListKeysError {
448    /// <p>The system timed out while trying to fulfill the request. You can retry the request.</p>
449    DependencyTimeoutException(crate::types::error::DependencyTimeoutException),
450    /// <p>The request was rejected because the marker that specifies where pagination should next begin is not valid.</p>
451    InvalidMarkerException(crate::types::error::InvalidMarkerException),
452    /// <p>The request was rejected because an internal exception occurred. The request can be retried.</p>
453    KmsInternalException(crate::types::error::KmsInternalException),
454    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
455    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
456    variable wildcard pattern and check `.code()`:
457     \
458    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
459     \
460    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListKeysError) for what information is available for the error.")]
461    Unhandled(crate::error::sealed_unhandled::Unhandled),
462}
463impl ListKeysError {
464    /// Creates the `ListKeysError::Unhandled` variant from any error type.
465    pub fn unhandled(
466        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
467    ) -> Self {
468        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
469            source: err.into(),
470            meta: ::std::default::Default::default(),
471        })
472    }
473
474    /// Creates the `ListKeysError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
475    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
476        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
477            source: err.clone().into(),
478            meta: err,
479        })
480    }
481    ///
482    /// Returns error metadata, which includes the error code, message,
483    /// request ID, and potentially additional information.
484    ///
485    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
486        match self {
487            Self::DependencyTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
488            Self::InvalidMarkerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
489            Self::KmsInternalException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
490            Self::Unhandled(e) => &e.meta,
491        }
492    }
493    /// Returns `true` if the error kind is `ListKeysError::DependencyTimeoutException`.
494    pub fn is_dependency_timeout_exception(&self) -> bool {
495        matches!(self, Self::DependencyTimeoutException(_))
496    }
497    /// Returns `true` if the error kind is `ListKeysError::InvalidMarkerException`.
498    pub fn is_invalid_marker_exception(&self) -> bool {
499        matches!(self, Self::InvalidMarkerException(_))
500    }
501    /// Returns `true` if the error kind is `ListKeysError::KmsInternalException`.
502    pub fn is_kms_internal_exception(&self) -> bool {
503        matches!(self, Self::KmsInternalException(_))
504    }
505}
506impl ::std::error::Error for ListKeysError {
507    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
508        match self {
509            Self::DependencyTimeoutException(_inner) => ::std::option::Option::Some(_inner),
510            Self::InvalidMarkerException(_inner) => ::std::option::Option::Some(_inner),
511            Self::KmsInternalException(_inner) => ::std::option::Option::Some(_inner),
512            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
513        }
514    }
515}
516impl ::std::fmt::Display for ListKeysError {
517    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
518        match self {
519            Self::DependencyTimeoutException(_inner) => _inner.fmt(f),
520            Self::InvalidMarkerException(_inner) => _inner.fmt(f),
521            Self::KmsInternalException(_inner) => _inner.fmt(f),
522            Self::Unhandled(_inner) => {
523                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
524                    write!(f, "unhandled error ({code})")
525                } else {
526                    f.write_str("unhandled error")
527                }
528            }
529        }
530    }
531}
532impl ::aws_smithy_types::retry::ProvideErrorKind for ListKeysError {
533    fn code(&self) -> ::std::option::Option<&str> {
534        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
535    }
536    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
537        ::std::option::Option::None
538    }
539}
540impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListKeysError {
541    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
542        match self {
543            Self::DependencyTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
544            Self::InvalidMarkerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
545            Self::KmsInternalException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
546            Self::Unhandled(_inner) => &_inner.meta,
547        }
548    }
549}
550impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListKeysError {
551    fn create_unhandled_error(
552        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
553        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
554    ) -> Self {
555        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
556            source,
557            meta: meta.unwrap_or_default(),
558        })
559    }
560}
561impl ::aws_types::request_id::RequestId for crate::operation::list_keys::ListKeysError {
562    fn request_id(&self) -> Option<&str> {
563        self.meta().request_id()
564    }
565}
566
567pub use crate::operation::list_keys::_list_keys_input::ListKeysInput;
568
569pub use crate::operation::list_keys::_list_keys_output::ListKeysOutput;
570
571mod _list_keys_input;
572
573mod _list_keys_output;
574
575/// Builders
576pub mod builders;
577
578/// Paginator for this operation
579pub mod paginator;