// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// Macro to generate the tower stack type. Arguments should be in reverse order
macro_rules! stack_type {
                ($first: ty, $($rest:ty),+) => {
                    tower::layer::util::Stack<$first, stack_type!($($rest),+)>
                };
                ($only: ty) => {
                    tower::layer::util::Stack<$only, tower::layer::util::Identity>
                }
            }
// Note: the layers here appear in reverse order
type DefaultMiddlewareStack = stack_type!(
    aws_smithy_http_tower::map_request::MapRequestLayer<
        aws_http::recursion_detection::RecursionDetectionStage,
    >,
    aws_smithy_http_tower::map_request::MapRequestLayer<aws_http::user_agent::UserAgentStage>,
    aws_smithy_http_tower::map_request::MapRequestLayer<aws_endpoint::AwsAuthStage>,
    aws_smithy_http_tower::map_request::MapRequestLayer<
        aws_smithy_http::endpoint::middleware::SmithyEndpointStage,
    >
);
/// Stedi Middleware Stack
#[derive(std::fmt::Debug, Default, Clone)]
#[non_exhaustive]
pub struct DefaultMiddleware;

impl DefaultMiddleware {
    /// Create a new `DefaultMiddleware` stack
    ///
    /// Note: `DefaultMiddleware` holds no state.
    pub fn new() -> Self {
        DefaultMiddleware::default()
    }
}
// define the middleware stack
fn base() -> tower::ServiceBuilder<DefaultMiddlewareStack> {
    let endpoint_stage = aws_smithy_http_tower::map_request::MapRequestLayer::for_mapper(
        aws_smithy_http::endpoint::middleware::SmithyEndpointStage::new(),
    );
    let auth_stage =
        aws_smithy_http_tower::map_request::MapRequestLayer::for_mapper(aws_endpoint::AwsAuthStage);
    let user_agent = aws_smithy_http_tower::map_request::MapRequestLayer::for_mapper(
        aws_http::user_agent::UserAgentStage::new(),
    );
    let recursion_detection = aws_smithy_http_tower::map_request::MapRequestLayer::for_mapper(
        aws_http::recursion_detection::RecursionDetectionStage::new(),
    );
    tower::ServiceBuilder::new()
        .layer(endpoint_stage)
        .layer(auth_stage)
        .layer(user_agent)
        .layer(recursion_detection)
}
impl<S> tower::Layer<S> for DefaultMiddleware {
    type Service = <DefaultMiddlewareStack as tower::Layer<S>>::Service;

    fn layer(&self, inner: S) -> Self::Service {
        base().service(inner)
    }
}
