// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(
    clippy::collapsible_if,
    clippy::bool_comparison,
    clippy::nonminimal_bool,
    clippy::comparison_to_empty,
    clippy::redundant_pattern_matching
)]
pub(super) fn resolve_endpoint(
    _params: &crate::endpoint::Params,
    _diagnostic_collector: &mut crate::endpoint_lib::diagnostic::DiagnosticCollector,
) -> aws_smithy_http::endpoint::Result {
    #[allow(unused_variables)]
    let region = &_params.region;
    #[allow(unused_variables)]
    let stage = &_params.stage;
    #[allow(unused_variables)]
    let endpoint = &_params.endpoint;
    #[allow(unused_variables)]
    if let Some(endpoint) = endpoint {
        #[allow(unused_variables)]
        if let Some(url) =
            crate::endpoint_lib::parse_url::parse_url(endpoint, _diagnostic_collector)
        {
            return Ok(aws_smithy_types::endpoint::Endpoint::builder()
                .url(endpoint.to_owned())
                .build());
        }
    }
    #[allow(unused_variables)]
    if let Some(stage) = stage {
        if (stage) == ("preproduction") {
            return Ok(aws_smithy_types::endpoint::Endpoint::builder()
                .url({
                    let mut out = String::new();
                    out.push_str("https://partners.");
                    #[allow(clippy::needless_borrow)]
                    out.push_str(&region);
                    out.push_str(".preproduction.stedi.com/2022-01-01");
                    out
                })
                .build());
        }
    }
    // Fallback to production endpoint and default region
    return Ok(aws_smithy_types::endpoint::Endpoint::builder()
        .url({
            let mut out = String::new();
            out.push_str("https://partners.");
            #[allow(clippy::needless_borrow)]
            out.push_str(&region);
            out.push_str(".stedi.com/2022-01-01");
            out
        })
        .build());
}
