216 216 |
|
217 217 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ImportKeyMaterialEndpointParamsInterceptor {
|
218 218 | fn name(&self) -> &'static str {
|
219 219 | "ImportKeyMaterialEndpointParamsInterceptor"
|
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::<ImportKeyMaterialInput>()
|
235 235 | .ok_or("failed to downcast to ImportKeyMaterialInput")?;
|
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 `ImportKeyMaterialError` operation.
|
256 258 | #[non_exhaustive]
|
257 259 | #[derive(::std::fmt::Debug)]
|
258 260 | pub enum ImportKeyMaterialError {
|
259 261 | /// <p>The system timed out while trying to fulfill the request. You can retry the request.</p>
|
260 262 | DependencyTimeoutException(crate::types::error::DependencyTimeoutException),
|
261 263 | /// <p>The request was rejected because the specified import token is expired. Use <code>GetParametersForImport</code> to get a new import token and public key, use the new public key to encrypt the key material, and then try the request again.</p>
|
262 264 | ExpiredImportTokenException(crate::types::error::ExpiredImportTokenException),
|
263 265 | /// <p>The request was rejected because the key material in the request is, expired, invalid, or is not the same key material that was previously imported into this KMS key.</p>
|
264 266 | IncorrectKeyMaterialException(crate::types::error::IncorrectKeyMaterialException),
|
265 267 | /// <p>The request was rejected because a specified ARN, or an ARN in a key policy, is not valid.</p>
|
266 268 | InvalidArnException(crate::types::error::InvalidArnException),
|
267 269 | /// <p>From the <code>Decrypt</code> or <code>ReEncrypt</code> operation, the request was rejected because the specified ciphertext, or additional authenticated data incorporated into the ciphertext, such as the encryption context, is corrupted, missing, or otherwise invalid.</p>
|
268 270 | /// <p>From the <code>ImportKeyMaterial</code> operation, the request was rejected because KMS could not decrypt the encrypted (wrapped) key material.</p>
|
269 271 | InvalidCiphertextException(crate::types::error::InvalidCiphertextException),
|
270 272 | /// <p>The request was rejected because the provided import token is invalid or is associated with a different KMS key.</p>
|
271 273 | InvalidImportTokenException(crate::types::error::InvalidImportTokenException),
|
272 274 | /// <p>The request was rejected because an internal exception occurred. The request can be retried.</p>
|
273 275 | KmsInternalException(crate::types::error::KmsInternalException),
|
274 276 | /// <p>The request was rejected because the state of the specified resource is not valid for this request.</p>
|
275 277 | /// <p>This exceptions means one of the following:</p>
|
276 278 | /// <ul>
|
277 279 | /// <li>
|