216 216 |
|
217 217 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetTaskProtectionEndpointParamsInterceptor {
|
218 218 | fn name(&self) -> &'static str {
|
219 219 | "GetTaskProtectionEndpointParamsInterceptor"
|
220 220 | }
|
221 221 |
|
222 222 | fn read_before_execution(
|
223 223 | &self,
|
224 224 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
225 225 | '_,
|
226 226 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
227 227 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
228 228 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
229 229 | >,
|
230 230 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
231 231 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
232 232 | let _input = context
|
233 233 | .input()
|
234 234 | .downcast_ref::<GetTaskProtectionInput>()
|
235 235 | .ok_or("failed to downcast to GetTaskProtectionInput")?;
|
236 236 |
|
237 237 | let params = crate::config::endpoint::Params::builder()
|
238 238 | .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
|
239 239 | .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
|
240 240 | .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
|
241 241 | .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
|
242 242 | .build()
|
243 243 | .map_err(|err| {
|
244 244 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
245 245 | })?;
|
246 + |
|
246 247 | cfg.interceptor_state()
|
247 248 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
249 + |
|
248 250 | ::std::result::Result::Ok(())
|
249 251 | }
|
250 252 | }
|
251 253 |
|
252 254 | // The get_* functions below are generated from JMESPath expressions in the
|
253 255 | // operationContextParams trait. They target the operation's input shape.
|
254 256 |
|
255 257 | /// Error type for the `GetTaskProtectionError` operation.
|
256 258 | #[non_exhaustive]
|
257 259 | #[derive(::std::fmt::Debug)]
|
258 260 | pub enum GetTaskProtectionError {
|
259 261 | /// <p>You don't have authorization to perform the requested action.</p>
|
260 262 | AccessDeniedException(crate::types::error::AccessDeniedException),
|
261 263 | /// <p>These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.</p>
|
262 264 | ClientException(crate::types::error::ClientException),
|
263 265 | /// <p>The specified cluster wasn't found. You can view your available clusters with <code>ListClusters</code>. Amazon ECS clusters are Region specific.</p>
|
264 266 | ClusterNotFoundException(crate::types::error::ClusterNotFoundException),
|
265 267 | /// <p>The specified parameter isn't valid. Review the available parameters for the API request.</p>
|
266 268 | InvalidParameterException(crate::types::error::InvalidParameterException),
|
267 269 | /// <p>The specified resource wasn't found.</p>
|
268 270 | ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
|
269 271 | /// <p>These errors are usually caused by a server issue.</p>
|
270 272 | ServerException(crate::types::error::ServerException),
|
271 273 | /// <p>The specified task isn't supported in this Region.</p>
|
272 274 | UnsupportedFeatureException(crate::types::error::UnsupportedFeatureException),
|
273 275 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
274 276 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
275 277 | variable wildcard pattern and check `.code()`:
|
276 278 | \
|
277 279 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|