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