227 227 |
|
228 228 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InvokeModelEndpointParamsInterceptor {
|
229 229 | fn name(&self) -> &'static str {
|
230 230 | "InvokeModelEndpointParamsInterceptor"
|
231 231 | }
|
232 232 |
|
233 233 | fn read_before_execution(
|
234 234 | &self,
|
235 235 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
236 236 | '_,
|
237 237 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
238 238 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
239 239 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
240 240 | >,
|
241 241 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
242 242 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
243 243 | let _input = context
|
244 244 | .input()
|
245 245 | .downcast_ref::<InvokeModelInput>()
|
246 246 | .ok_or("failed to downcast to InvokeModelInput")?;
|
247 247 |
|
248 248 | let params = crate::config::endpoint::Params::builder()
|
249 249 | .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
|
250 250 | .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
|
251 251 | .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
|
252 252 | .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
|
253 253 | .build()
|
254 254 | .map_err(|err| {
|
255 255 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
256 256 | })?;
|
257 + |
|
257 258 | cfg.interceptor_state()
|
258 259 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
260 + |
|
259 261 | ::std::result::Result::Ok(())
|
260 262 | }
|
261 263 | }
|
262 264 |
|
263 265 | // The get_* functions below are generated from JMESPath expressions in the
|
264 266 | // operationContextParams trait. They target the operation's input shape.
|
265 267 |
|
266 268 | /// Error type for the `InvokeModelError` operation.
|
267 269 | #[non_exhaustive]
|
268 270 | #[derive(::std::fmt::Debug)]
|
269 271 | pub enum InvokeModelError {
|
270 272 | /// <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied">AccessDeniedException</a> in the Amazon Bedrock User Guide</p>
|
271 273 | AccessDeniedException(crate::types::error::AccessDeniedException),
|
272 274 | /// <p>An internal server error occurred. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
|
273 275 | InternalServerException(crate::types::error::InternalServerException),
|
274 276 | /// <p>The request failed due to an error while processing the model.</p>
|
275 277 | ModelErrorException(crate::types::error::ModelErrorException),
|
276 278 | /// <p>The model specified in the request is not ready to serve inference requests. The AWS SDK will automatically retry the operation up to 5 times. For information about configuring automatic retries, see <a href="https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html">Retry behavior</a> in the <i>AWS SDKs and Tools</i> reference guide.</p>
|
277 279 | ModelNotReadyException(crate::types::error::ModelNotReadyException),
|
278 280 | /// <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
|
279 281 | ModelTimeoutException(crate::types::error::ModelTimeoutException),
|
280 282 | /// <p>The specified resource ARN was not found. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-resource-not-found">ResourceNotFound</a> in the Amazon Bedrock User Guide</p>
|
281 283 | ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
|
282 284 | /// <p>Your request exceeds the service quota for your account. You can view your quotas at <a href="https://docs.aws.amazon.com/servicequotas/latest/userguide/gs-request-quota.html">Viewing service quotas</a>. You can resubmit your request later.</p>
|
283 285 | ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
|
284 286 | /// <p>The service isn't currently available. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable">ServiceUnavailable</a> in the Amazon Bedrock User Guide</p>
|
285 287 | ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
|
286 288 | /// <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide</p>
|
287 289 | ThrottlingException(crate::types::error::ThrottlingException),
|
288 290 | /// <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error">ValidationError</a> in the Amazon Bedrock User Guide</p>
|