224 224 |
|
225 225 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PublishVersionEndpointParamsInterceptor {
|
226 226 | fn name(&self) -> &'static str {
|
227 227 | "PublishVersionEndpointParamsInterceptor"
|
228 228 | }
|
229 229 |
|
230 230 | fn read_before_execution(
|
231 231 | &self,
|
232 232 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
233 233 | '_,
|
234 234 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
235 235 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
236 236 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
237 237 | >,
|
238 238 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
239 239 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
240 240 | let _input = context
|
241 241 | .input()
|
242 242 | .downcast_ref::<PublishVersionInput>()
|
243 243 | .ok_or("failed to downcast to PublishVersionInput")?;
|
244 244 |
|
245 245 | let params = crate::config::endpoint::Params::builder()
|
246 246 | .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
|
247 247 | .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
|
248 248 | .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
|
249 249 | .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
|
250 250 | .build()
|
251 251 | .map_err(|err| {
|
252 252 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
253 253 | })?;
|
254 + |
|
254 255 | cfg.interceptor_state()
|
255 256 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
257 + |
|
256 258 | ::std::result::Result::Ok(())
|
257 259 | }
|
258 260 | }
|
259 261 |
|
260 262 | // The get_* functions below are generated from JMESPath expressions in the
|
261 263 | // operationContextParams trait. They target the operation's input shape.
|
262 264 |
|
263 265 | /// Error type for the `PublishVersionError` operation.
|
264 266 | #[non_exhaustive]
|
265 267 | #[derive(::std::fmt::Debug)]
|
266 268 | pub enum PublishVersionError {
|
267 269 | /// <p>Your Amazon Web Services account has exceeded its maximum total code size. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html">Lambda quotas</a>.</p>
|
268 270 | CodeStorageExceededException(crate::types::error::CodeStorageExceededException),
|
269 271 | /// <p>One of the parameters in the request is not valid.</p>
|
270 272 | InvalidParameterValueException(crate::types::error::InvalidParameterValueException),
|
271 273 | /// <p>The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the <code>GetFunction</code> or the <code>GetAlias</code> API operation to retrieve the latest RevisionId for your resource.</p>
|
272 274 | PreconditionFailedException(crate::types::error::PreconditionFailedException),
|
273 275 | /// <p>The resource already exists, or another operation is in progress.</p>
|
274 276 | ResourceConflictException(crate::types::error::ResourceConflictException),
|
275 277 | /// <p>The resource specified in the request does not exist.</p>
|
276 278 | ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
|
277 279 | /// <p>The Lambda service encountered an internal error.</p>
|
278 280 | ServiceException(crate::types::error::ServiceException),
|
279 281 | /// <p>The request throughput limit was exceeded. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#api-requests">Lambda quotas</a>.</p>
|
280 282 | TooManyRequestsException(crate::types::error::TooManyRequestsException),
|
281 283 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
282 284 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
283 285 | variable wildcard pattern and check `.code()`:
|
284 286 | \
|
285 287 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|