213 213 |
|
214 214 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PutRolePolicyEndpointParamsInterceptor {
|
215 215 | fn name(&self) -> &'static str {
|
216 216 | "PutRolePolicyEndpointParamsInterceptor"
|
217 217 | }
|
218 218 |
|
219 219 | fn read_before_execution(
|
220 220 | &self,
|
221 221 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
222 222 | '_,
|
223 223 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
224 224 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
225 225 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
226 226 | >,
|
227 227 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
228 228 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
229 229 | let _input = context
|
230 230 | .input()
|
231 231 | .downcast_ref::<PutRolePolicyInput>()
|
232 232 | .ok_or("failed to downcast to PutRolePolicyInput")?;
|
233 233 |
|
234 234 | let params = crate::config::endpoint::Params::builder()
|
235 235 | .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
|
236 236 | .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
|
237 237 | .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
|
238 238 | .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
|
239 239 | .build()
|
240 240 | .map_err(|err| {
|
241 241 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
242 242 | })?;
|
243 + |
|
243 244 | cfg.interceptor_state()
|
244 245 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
246 + |
|
245 247 | ::std::result::Result::Ok(())
|
246 248 | }
|
247 249 | }
|
248 250 |
|
249 251 | // The get_* functions below are generated from JMESPath expressions in the
|
250 252 | // operationContextParams trait. They target the operation's input shape.
|
251 253 |
|
252 254 | /// Error type for the `PutRolePolicyError` operation.
|
253 255 | #[non_exhaustive]
|
254 256 | #[derive(::std::fmt::Debug)]
|
255 257 | pub enum PutRolePolicyError {
|
256 258 | /// <p>The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded.</p>
|
257 259 | LimitExceededException(crate::types::error::LimitExceededException),
|
258 260 | /// <p>The request was rejected because the policy document was malformed. The error message describes the specific error.</p>
|
259 261 | MalformedPolicyDocumentException(crate::types::error::MalformedPolicyDocumentException),
|
260 262 | /// <p>The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.</p>
|
261 263 | NoSuchEntityException(crate::types::error::NoSuchEntityException),
|
262 264 | /// <p>The request processing has failed because of an unknown error, exception or failure.</p>
|
263 265 | ServiceFailureException(crate::types::error::ServiceFailureException),
|
264 266 | /// <p>The request was rejected because service-linked roles are protected Amazon Web Services resources. Only the service that depends on the service-linked role can modify or delete the role on your behalf. The error message includes the name of the service that depends on this service-linked role. You must request the change through that service.</p>
|
265 267 | UnmodifiableEntityException(crate::types::error::UnmodifiableEntityException),
|
266 268 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
267 269 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
268 270 | variable wildcard pattern and check `.code()`:
|
269 271 | \
|
270 272 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
271 273 | \
|
272 274 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-PutRolePolicyError) for what information is available for the error.")]
|
273 275 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
274 276 | }
|