Skip to main content

aws_sdk_secretsmanager/operation/
batch_get_secret_value.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `BatchGetSecretValue`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct BatchGetSecretValue;
6impl BatchGetSecretValue {
7    /// Creates a new `BatchGetSecretValue`
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> =
13        crate::operation::batch_get_secret_value::BatchGetSecretValueInput::SCHEMA;
14    /// The schema for this operation's output shape.
15    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
16        crate::operation::batch_get_secret_value::BatchGetSecretValueOutput::SCHEMA;
17    pub(crate) async fn orchestrate(
18        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
19        input: crate::operation::batch_get_secret_value::BatchGetSecretValueInput,
20    ) -> ::std::result::Result<
21        crate::operation::batch_get_secret_value::BatchGetSecretValueOutput,
22        ::aws_smithy_runtime_api::client::result::SdkError<
23            crate::operation::batch_get_secret_value::BatchGetSecretValueError,
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::batch_get_secret_value::BatchGetSecretValueError>()
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::batch_get_secret_value::BatchGetSecretValueOutput>()
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::batch_get_secret_value::BatchGetSecretValueInput,
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(
61            "Secrets Manager",
62            "BatchGetSecretValue",
63            input,
64            runtime_plugins,
65            stop_point,
66        )
67        // Create a parent span for the entire operation. Includes a random, internal-only,
68        // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
69        .instrument(::tracing::debug_span!(
70            "Secrets Manager.BatchGetSecretValue",
71            "rpc.service" = "Secrets Manager",
72            "rpc.method" = "BatchGetSecretValue",
73            "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
74            "rpc.system" = "aws-api",
75        ))
76        .await
77    }
78
79    pub(crate) fn operation_runtime_plugins(
80        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
81        client_config: &crate::config::Config,
82        config_override: ::std::option::Option<crate::config::Builder>,
83    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
84        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
85
86        if let ::std::option::Option::Some(config_override) = config_override {
87            for plugin in config_override.runtime_plugins.iter().cloned() {
88                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
89            }
90            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
91                config_override,
92                client_config.config.clone(),
93                &client_config.runtime_components,
94            ));
95        }
96        runtime_plugins
97    }
98}
99/// Per-operation error registry. Contains an entry for every modeled
100/// error this operation can throw.
101///
102/// Used by the schema-serde error path as the operation-scoped lookup
103/// for registry-backed error reification: an error code that does not
104/// match one of the operation's modeled errors directly is resolved
105/// against this registry first, then widened to the service-wide error
106/// registry.
107pub(crate) mod error_registry {
108    pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
109        ::aws_smithy_schema::registry::TypeRegistry::builder()
110                            .insert_error_shape(
111                        crate::types::error::DecryptionFailure::SCHEMA,
112                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
113                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::DecryptionFailure::deserialize(d)?))
114                        },
115                        |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> {
116                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::DecryptionFailure::deserialize(d)?))
117                        },
118                    )
119.insert_error_shape(
120                        crate::types::error::InternalServiceError::SCHEMA,
121                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
122                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InternalServiceError::deserialize(d)?))
123                        },
124                        |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> {
125                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InternalServiceError::deserialize(d)?))
126                        },
127                    )
128.insert_error_shape(
129                        crate::types::error::InvalidNextTokenException::SCHEMA,
130                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
131                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidNextTokenException::deserialize(d)?))
132                        },
133                        |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> {
134                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidNextTokenException::deserialize(d)?))
135                        },
136                    )
137.insert_error_shape(
138                        crate::types::error::InvalidParameterException::SCHEMA,
139                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
140                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidParameterException::deserialize(d)?))
141                        },
142                        |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> {
143                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidParameterException::deserialize(d)?))
144                        },
145                    )
146.insert_error_shape(
147                        crate::types::error::InvalidRequestException::SCHEMA,
148                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
149                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidRequestException::deserialize(d)?))
150                        },
151                        |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> {
152                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidRequestException::deserialize(d)?))
153                        },
154                    )
155.insert_error_shape(
156                        crate::types::error::ResourceNotFoundException::SCHEMA,
157                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
158                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::ResourceNotFoundException::deserialize(d)?))
159                        },
160                        |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> {
161                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::ResourceNotFoundException::deserialize(d)?))
162                        },
163                    )
164                            .build()
165    });
166}
167impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for BatchGetSecretValue {
168    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
169        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("BatchGetSecretValue");
170
171        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
172            BatchGetSecretValueRequestSerializer,
173        ));
174        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
175            BatchGetSecretValueResponseDeserializer,
176        ));
177
178        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
179            crate::config::auth::Params::builder()
180                .operation_name("BatchGetSecretValue")
181                .build()
182                .expect("required fields set"),
183        ));
184
185        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
186        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
187            "BatchGetSecretValue",
188            "Secrets Manager",
189        ));
190        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
191        signing_options.double_uri_encode = true;
192        signing_options.content_sha256_header = false;
193        signing_options.normalize_uri_path = true;
194        signing_options.payload_override = None;
195
196        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
197            signing_options,
198            ..::std::default::Default::default()
199        });
200
201        ::std::option::Option::Some(cfg.freeze())
202    }
203
204    fn runtime_components(
205        &self,
206        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
207    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
208        #[allow(unused_mut)]
209        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("BatchGetSecretValue")
210            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
211                BatchGetSecretValueTelemetryInputCaptureInterceptor,
212            ))
213            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
214                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
215            ))
216            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
217                BatchGetSecretValueEndpointParamsInterceptor,
218            ))
219            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
220                crate::operation::batch_get_secret_value::BatchGetSecretValueError,
221            >::new())
222            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
223                crate::operation::batch_get_secret_value::BatchGetSecretValueError,
224            >::new())
225            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
226                crate::operation::batch_get_secret_value::BatchGetSecretValueError,
227            >::new())
228            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
229                crate::operation::batch_get_secret_value::BatchGetSecretValueError,
230            >::new());
231
232        ::std::borrow::Cow::Owned(rcb)
233    }
234}
235
236#[derive(Debug)]
237struct BatchGetSecretValueTelemetryInputCaptureInterceptor;
238
239#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
240impl ::aws_smithy_runtime_api::client::interceptors::Intercept for BatchGetSecretValueTelemetryInputCaptureInterceptor {
241    fn name(&self) -> &'static str {
242        "BatchGetSecretValueTelemetryInputCaptureInterceptor"
243    }
244
245    fn read_before_execution(
246        &self,
247        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
248            '_,
249            ::aws_smithy_runtime_api::client::interceptors::context::Input,
250            ::aws_smithy_runtime_api::client::interceptors::context::Output,
251            ::aws_smithy_runtime_api::client::interceptors::context::Error,
252        >,
253        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
254    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
255        // Nothing to do unless the customer opted in by naming members to record.
256        let ::std::option::Option::Some(requested) = cfg
257            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
258            .filter(|r| !r.is_empty())
259        else {
260            return ::std::result::Result::Ok(());
261        };
262
263        let ::std::option::Option::Some(input) = context.input().downcast_ref::<BatchGetSecretValueInput>() else {
264            // A mismatched input is not this interceptor's concern; skip quietly.
265            return ::std::result::Result::Ok(());
266        };
267
268        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
269        if requested.should_capture("NextToken") {
270            if let ::std::option::Option::Some(value) = input.next_token.as_deref() {
271                captured.insert("NextToken", value);
272            }
273        }
274
275        cfg.interceptor_state().store_put(captured);
276        ::std::result::Result::Ok(())
277    }
278}
279#[derive(Debug)]
280struct BatchGetSecretValueResponseDeserializer;
281impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for BatchGetSecretValueResponseDeserializer {
282    fn deserialize_nonstreaming_with_config(
283        &self,
284        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
285        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
286    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
287        let (success, status) = (response.status().is_success(), response.status().as_u16());
288        // Load body and headers BEFORE BeforeParseResponse so customizations
289        // (e.g., S3's `body_is_error` check that detects errors returned with
290        // HTTP 200) can inspect them. The legacy non-streaming path also
291        // loads `body` before firing this hook.
292        #[allow(unused_variables)]
293        let body = response.body().bytes().expect("body loaded");
294        let headers = response.headers();
295        #[allow(unused_mut)]
296        let mut force_error = false;
297        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
298        if !success && status != 200 || force_error {
299            let protocol = _cfg
300                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
301                .expect("a SharedClientProtocol is required");
302            #[allow(unused_mut)]
303            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
304                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
305            })?;
306            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
307            let generic = generic_builder.build();
308            let error_code = match generic.code() {
309                ::std::option::Option::Some(code) => code,
310                ::std::option::Option::None => {
311                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
312                        ::aws_smithy_runtime_api::box_error::BoxError::from(
313                            crate::operation::batch_get_secret_value::BatchGetSecretValueError::unhandled(generic),
314                        ),
315                    ))
316                }
317            };
318            let _error_message = generic.message().map(|msg| msg.to_owned());
319            let err = match error_code {
320                "DecryptionFailure" => crate::operation::batch_get_secret_value::BatchGetSecretValueError::DecryptionFailure({
321                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
322                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
323                            e,
324                        ))
325                    })?;
326                    let mut tmp = <crate::types::error::builders::DecryptionFailureBuilder>::default();
327                    tmp.deserialize_members(&mut *deser).map_err(|e| {
328                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
329                            e,
330                        ))
331                    })?;
332                    if tmp.message.is_none() {
333                        tmp.message = _error_message;
334                    }
335                    let tmp = tmp.meta(generic);
336                    tmp.build()
337                }),
338                "InternalServiceError" => crate::operation::batch_get_secret_value::BatchGetSecretValueError::InternalServiceError({
339                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
340                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
341                            e,
342                        ))
343                    })?;
344                    let mut tmp = <crate::types::error::builders::InternalServiceErrorBuilder>::default();
345                    tmp.deserialize_members(&mut *deser).map_err(|e| {
346                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
347                            e,
348                        ))
349                    })?;
350                    if tmp.message.is_none() {
351                        tmp.message = _error_message;
352                    }
353                    let tmp = tmp.meta(generic);
354                    tmp.build()
355                }),
356                "InvalidNextTokenException" => crate::operation::batch_get_secret_value::BatchGetSecretValueError::InvalidNextTokenException({
357                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
358                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
359                            e,
360                        ))
361                    })?;
362                    let mut tmp = <crate::types::error::builders::InvalidNextTokenExceptionBuilder>::default();
363                    tmp.deserialize_members(&mut *deser).map_err(|e| {
364                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
365                            e,
366                        ))
367                    })?;
368                    if tmp.message.is_none() {
369                        tmp.message = _error_message;
370                    }
371                    let tmp = tmp.meta(generic);
372                    tmp.build()
373                }),
374                "InvalidParameterException" => crate::operation::batch_get_secret_value::BatchGetSecretValueError::InvalidParameterException({
375                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
376                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
377                            e,
378                        ))
379                    })?;
380                    let mut tmp = <crate::types::error::builders::InvalidParameterExceptionBuilder>::default();
381                    tmp.deserialize_members(&mut *deser).map_err(|e| {
382                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
383                            e,
384                        ))
385                    })?;
386                    if tmp.message.is_none() {
387                        tmp.message = _error_message;
388                    }
389                    let tmp = tmp.meta(generic);
390                    tmp.build()
391                }),
392                "InvalidRequestException" => crate::operation::batch_get_secret_value::BatchGetSecretValueError::InvalidRequestException({
393                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
394                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
395                            e,
396                        ))
397                    })?;
398                    let mut tmp = <crate::types::error::builders::InvalidRequestExceptionBuilder>::default();
399                    tmp.deserialize_members(&mut *deser).map_err(|e| {
400                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
401                            e,
402                        ))
403                    })?;
404                    if tmp.message.is_none() {
405                        tmp.message = _error_message;
406                    }
407                    let tmp = tmp.meta(generic);
408                    tmp.build()
409                }),
410                "ResourceNotFoundException" => crate::operation::batch_get_secret_value::BatchGetSecretValueError::ResourceNotFoundException({
411                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
412                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
413                            e,
414                        ))
415                    })?;
416                    let mut tmp = <crate::types::error::builders::ResourceNotFoundExceptionBuilder>::default();
417                    tmp.deserialize_members(&mut *deser).map_err(|e| {
418                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
419                            e,
420                        ))
421                    })?;
422                    if tmp.message.is_none() {
423                        tmp.message = _error_message;
424                    }
425                    let tmp = tmp.meta(generic);
426                    tmp.build()
427                }),
428                _ => {
429                    // Registry-backed, operation-scoped reification of an error whose
430                    // code this operation does not model directly: the operation's own
431                    // error registry is consulted first, then the lookup widens to the
432                    // service-wide error registry. On a hit, the reified error is attached
433                    // as the source of the returned unhandled error while its metadata
434                    // (code, message, request id) is preserved; on a miss the generic
435                    // error is returned unchanged.
436                    match protocol
437                        .deserialize_error_response(response, _cfg)
438                        .ok()
439                        .and_then(|mut deser| {
440                            ::aws_smithy_schema::registry::reify_error(
441                                crate::operation::batch_get_secret_value::error_registry::REGISTRY
442                                    .or(&crate::error_type_registry::REGISTRY),
443                                error_code,
444                                &mut *deser,
445                            )
446                        }) {
447                        ::std::option::Option::Some(source) => <crate::operation::batch_get_secret_value::BatchGetSecretValueError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
448                        ::std::option::Option::None => crate::operation::batch_get_secret_value::BatchGetSecretValueError::generic(generic),
449                    }
450                }
451            };
452            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
453                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
454            ))
455        } else {
456            let protocol = _cfg
457                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
458                .expect("a SharedClientProtocol is required");
459            let mut deser = protocol
460                .deserialize_response(response, BatchGetSecretValue::OUTPUT_SCHEMA, _cfg)
461                .map_err(|e| {
462                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
463                })?;
464            // `headers` is already in scope from the top of the function; alias it as
465            // `_response_headers` so MutateOutput customizations have a stable name to
466            // read from.
467            let _response_headers = headers;
468            // `mut` is required because `deserialize_members` and the `MutateOutput`
469            // builder setters take `&mut self`. Marked `allow(unused_mut)` because an
470            // empty output has no members and no customizations to run.
471            #[allow(unused_mut)]
472            let mut output = <crate::operation::batch_get_secret_value::builders::BatchGetSecretValueOutputBuilder>::default();
473            output.deserialize_members(&mut *deser).map_err(|e| {
474                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
475            })?;
476            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
477            let output = output.build();
478            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
479        }
480    }
481}
482#[derive(Debug)]
483struct BatchGetSecretValueRequestSerializer;
484impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for BatchGetSecretValueRequestSerializer {
485    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
486    fn serialize_input(
487        &self,
488        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
489        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
490    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
491        let input = input
492            .downcast::<crate::operation::batch_get_secret_value::BatchGetSecretValueInput>()
493            .expect("correct type");
494
495        let protocol = _cfg
496            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
497            .expect("a SharedClientProtocol is required");
498        let mut request = protocol
499            .serialize_request(&input, BatchGetSecretValue::INPUT_SCHEMA, "/", _cfg)
500            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
501
502        return ::std::result::Result::Ok(request);
503    }
504}
505#[derive(Debug)]
506struct BatchGetSecretValueEndpointParamsInterceptor;
507
508#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
509impl ::aws_smithy_runtime_api::client::interceptors::Intercept for BatchGetSecretValueEndpointParamsInterceptor {
510    fn name(&self) -> &'static str {
511        "BatchGetSecretValueEndpointParamsInterceptor"
512    }
513
514    fn read_before_execution(
515        &self,
516        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
517            '_,
518            ::aws_smithy_runtime_api::client::interceptors::context::Input,
519            ::aws_smithy_runtime_api::client::interceptors::context::Output,
520            ::aws_smithy_runtime_api::client::interceptors::context::Error,
521        >,
522        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
523    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
524        let _input = context
525            .input()
526            .downcast_ref::<BatchGetSecretValueInput>()
527            .ok_or("failed to downcast to BatchGetSecretValueInput")?;
528
529        let params = crate::config::endpoint::Params::builder()
530            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
531            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
532            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
533            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
534            .build()
535            .map_err(|err| {
536                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
537            })?;
538        cfg.interceptor_state()
539            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
540        ::std::result::Result::Ok(())
541    }
542}
543
544// The get_* functions below are generated from JMESPath expressions in the
545// operationContextParams trait. They target the operation's input shape.
546
547/// Error type for the `BatchGetSecretValueError` operation.
548#[non_exhaustive]
549#[derive(::std::fmt::Debug)]
550pub enum BatchGetSecretValueError {
551    /// <p>Secrets Manager can't decrypt the protected secret text using the provided KMS key.</p>
552    DecryptionFailure(crate::types::error::DecryptionFailure),
553    /// <p>An error occurred on the server side.</p>
554    InternalServiceError(crate::types::error::InternalServiceError),
555    /// <p>The <code>NextToken</code> value is invalid.</p>
556    InvalidNextTokenException(crate::types::error::InvalidNextTokenException),
557    /// <p>The parameter name or value is invalid.</p>
558    InvalidParameterException(crate::types::error::InvalidParameterException),
559    /// <p>A parameter value is not valid for the current state of the resource.</p>
560    /// <p>Possible causes:</p>
561    /// <ul>
562    /// <li>
563    /// <p>The secret is scheduled for deletion.</p></li>
564    /// <li>
565    /// <p>You tried to enable rotation on a secret that doesn't already have a Lambda function ARN configured and you didn't include such an ARN as a parameter in this call.</p></li>
566    /// <li>
567    /// <p>The secret is managed by another service, and you must use that service to update it. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html">Secrets managed by other Amazon Web Services services</a>.</p></li>
568    /// </ul>
569    InvalidRequestException(crate::types::error::InvalidRequestException),
570    /// <p>Secrets Manager can't find the resource that you asked for.</p>
571    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
572    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
573    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
574    variable wildcard pattern and check `.code()`:
575     \
576    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
577     \
578    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-BatchGetSecretValueError) for what information is available for the error.")]
579    Unhandled(crate::error::sealed_unhandled::Unhandled),
580}
581impl BatchGetSecretValueError {
582    /// Creates the `BatchGetSecretValueError::Unhandled` variant from any error type.
583    pub fn unhandled(
584        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
585    ) -> Self {
586        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
587            source: err.into(),
588            meta: ::std::default::Default::default(),
589        })
590    }
591
592    /// Creates the `BatchGetSecretValueError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
593    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
594        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
595            source: err.clone().into(),
596            meta: err,
597        })
598    }
599    ///
600    /// Returns error metadata, which includes the error code, message,
601    /// request ID, and potentially additional information.
602    ///
603    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
604        match self {
605            Self::DecryptionFailure(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
606            Self::InternalServiceError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
607            Self::InvalidNextTokenException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
608            Self::InvalidParameterException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
609            Self::InvalidRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
610            Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
611            Self::Unhandled(e) => &e.meta,
612        }
613    }
614    /// Returns `true` if the error kind is `BatchGetSecretValueError::DecryptionFailure`.
615    pub fn is_decryption_failure(&self) -> bool {
616        matches!(self, Self::DecryptionFailure(_))
617    }
618    /// Returns `true` if the error kind is `BatchGetSecretValueError::InternalServiceError`.
619    pub fn is_internal_service_error(&self) -> bool {
620        matches!(self, Self::InternalServiceError(_))
621    }
622    /// Returns `true` if the error kind is `BatchGetSecretValueError::InvalidNextTokenException`.
623    pub fn is_invalid_next_token_exception(&self) -> bool {
624        matches!(self, Self::InvalidNextTokenException(_))
625    }
626    /// Returns `true` if the error kind is `BatchGetSecretValueError::InvalidParameterException`.
627    pub fn is_invalid_parameter_exception(&self) -> bool {
628        matches!(self, Self::InvalidParameterException(_))
629    }
630    /// Returns `true` if the error kind is `BatchGetSecretValueError::InvalidRequestException`.
631    pub fn is_invalid_request_exception(&self) -> bool {
632        matches!(self, Self::InvalidRequestException(_))
633    }
634    /// Returns `true` if the error kind is `BatchGetSecretValueError::ResourceNotFoundException`.
635    pub fn is_resource_not_found_exception(&self) -> bool {
636        matches!(self, Self::ResourceNotFoundException(_))
637    }
638}
639impl ::std::error::Error for BatchGetSecretValueError {
640    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
641        match self {
642            Self::DecryptionFailure(_inner) => ::std::option::Option::Some(_inner),
643            Self::InternalServiceError(_inner) => ::std::option::Option::Some(_inner),
644            Self::InvalidNextTokenException(_inner) => ::std::option::Option::Some(_inner),
645            Self::InvalidParameterException(_inner) => ::std::option::Option::Some(_inner),
646            Self::InvalidRequestException(_inner) => ::std::option::Option::Some(_inner),
647            Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
648            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
649        }
650    }
651}
652impl ::std::fmt::Display for BatchGetSecretValueError {
653    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
654        match self {
655            Self::DecryptionFailure(_inner) => _inner.fmt(f),
656            Self::InternalServiceError(_inner) => _inner.fmt(f),
657            Self::InvalidNextTokenException(_inner) => _inner.fmt(f),
658            Self::InvalidParameterException(_inner) => _inner.fmt(f),
659            Self::InvalidRequestException(_inner) => _inner.fmt(f),
660            Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
661            Self::Unhandled(_inner) => {
662                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
663                    write!(f, "unhandled error ({code})")
664                } else {
665                    f.write_str("unhandled error")
666                }
667            }
668        }
669    }
670}
671impl ::aws_smithy_types::retry::ProvideErrorKind for BatchGetSecretValueError {
672    fn code(&self) -> ::std::option::Option<&str> {
673        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
674    }
675    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
676        ::std::option::Option::None
677    }
678}
679impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for BatchGetSecretValueError {
680    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
681        match self {
682            Self::DecryptionFailure(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
683            Self::InternalServiceError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
684            Self::InvalidNextTokenException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
685            Self::InvalidParameterException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
686            Self::InvalidRequestException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
687            Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
688            Self::Unhandled(_inner) => &_inner.meta,
689        }
690    }
691}
692impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for BatchGetSecretValueError {
693    fn create_unhandled_error(
694        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
695        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
696    ) -> Self {
697        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
698            source,
699            meta: meta.unwrap_or_default(),
700        })
701    }
702}
703impl ::aws_types::request_id::RequestId for crate::operation::batch_get_secret_value::BatchGetSecretValueError {
704    fn request_id(&self) -> Option<&str> {
705        self.meta().request_id()
706    }
707}
708
709pub use crate::operation::batch_get_secret_value::_batch_get_secret_value_input::BatchGetSecretValueInput;
710
711pub use crate::operation::batch_get_secret_value::_batch_get_secret_value_output::BatchGetSecretValueOutput;
712
713mod _batch_get_secret_value_input;
714
715mod _batch_get_secret_value_output;
716
717/// Builders
718pub mod builders;
719
720/// Paginator for this operation
721pub mod paginator;