Skip to main content

aws_sdk_glue/operation/
get_resource_policies.rs

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