226 226 |
|
227 227 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateTokenWithIAMEndpointParamsInterceptor {
|
228 228 | fn name(&self) -> &'static str {
|
229 229 | "CreateTokenWithIAMEndpointParamsInterceptor"
|
230 230 | }
|
231 231 |
|
232 232 | fn read_before_execution(
|
233 233 | &self,
|
234 234 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
235 235 | '_,
|
236 236 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
237 237 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
238 238 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
239 239 | >,
|
240 240 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
241 241 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
242 242 | let _input = context
|
243 243 | .input()
|
244 244 | .downcast_ref::<CreateTokenWithIamInput>()
|
245 245 | .ok_or("failed to downcast to CreateTokenWithIamInput")?;
|
246 246 |
|
247 247 | let params = crate::config::endpoint::Params::builder()
|
248 248 | .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
|
249 249 | .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
|
250 250 | .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
|
251 251 | .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
|
252 252 | .build()
|
253 253 | .map_err(|err| {
|
254 254 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
255 255 | })?;
|
256 + |
|
256 257 | cfg.interceptor_state()
|
257 258 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
259 + |
|
258 260 | ::std::result::Result::Ok(())
|
259 261 | }
|
260 262 | }
|
261 263 |
|
262 264 | // The get_* functions below are generated from JMESPath expressions in the
|
263 265 | // operationContextParams trait. They target the operation's input shape.
|
264 266 |
|
265 267 | /// Error type for the `CreateTokenWithIAMError` operation.
|
266 268 | #[non_exhaustive]
|
267 269 | #[derive(::std::fmt::Debug)]
|
268 270 | pub enum CreateTokenWithIAMError {
|
269 271 | /// <p>You do not have sufficient access to perform this action.</p>
|
270 272 | AccessDeniedException(crate::types::error::AccessDeniedException),
|
271 273 | /// <p>Indicates that a request to authorize a client with an access user session token is pending.</p>
|
272 274 | AuthorizationPendingException(crate::types::error::AuthorizationPendingException),
|
273 275 | /// <p>Indicates that the token issued by the service is expired and is no longer valid.</p>
|
274 276 | ExpiredTokenException(crate::types::error::ExpiredTokenException),
|
275 277 | /// <p>Indicates that an error from the service occurred while trying to process a request.</p>
|
276 278 | InternalServerException(crate::types::error::InternalServerException),
|
277 279 | /// <p>Indicates that the <code>clientId</code> or <code>clientSecret</code> in the request is invalid. For example, this can occur when a client sends an incorrect <code>clientId</code> or an expired <code>clientSecret</code>.</p>
|
278 280 | InvalidClientException(crate::types::error::InvalidClientException),
|
279 281 | /// <p>Indicates that a request contains an invalid grant. This can occur if a client makes a <code>CreateToken</code> request with an invalid grant type.</p>
|
280 282 | InvalidGrantException(crate::types::error::InvalidGrantException),
|
281 283 | /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter might be missing or out of range.</p>
|
282 284 | InvalidRequestException(crate::types::error::InvalidRequestException),
|
283 285 | /// <p>Indicates that a token provided as input to the request was issued by and is only usable by calling IAM Identity Center endpoints in another region.</p>
|
284 286 | InvalidRequestRegionException(crate::types::error::InvalidRequestRegionException),
|
285 287 | /// <p>Indicates that the scope provided in the request is invalid.</p>
|
286 288 | InvalidScopeException(crate::types::error::InvalidScopeException),
|
287 289 | /// <p>Indicates that the client is making the request too frequently and is more than the service can handle.</p>
|