AWS SDK

AWS SDK

rev. eb19c4c7998eaae1210cb747286b497c3425236c

Files changed:

tmp-codegen-diff/aws-sdk/sdk/qldbsession/src/config/auth.rs

@@ -0,1 +0,149 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Auth scheme resolver trait specific to Amazon QLDB Session
           3  +
pub trait ResolveAuthScheme: ::std::marker::Send + ::std::marker::Sync + ::std::fmt::Debug {
           4  +
    /// Resolve a priority list of auth scheme options with the given parameters
           5  +
    fn resolve_auth_scheme<'a>(
           6  +
        &'a self,
           7  +
        params: &'a crate::config::auth::Params,
           8  +
        cfg: &'a ::aws_smithy_types::config_bag::ConfigBag,
           9  +
        runtime_components: &'a ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents,
          10  +
    ) -> ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture<'a>;
          11  +
          12  +
    /// Convert this service-specific resolver into a `SharedAuthSchemeOptionResolver`
          13  +
    fn into_shared_resolver(self) -> ::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver
          14  +
    where
          15  +
        Self: ::std::marker::Sized + 'static,
          16  +
    {
          17  +
        ::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver::new(DowncastParams(self))
          18  +
    }
          19  +
}
          20  +
          21  +
#[derive(Debug)]
          22  +
struct DowncastParams<T>(T);
          23  +
impl<T> ::aws_smithy_runtime_api::client::auth::ResolveAuthSchemeOptions for DowncastParams<T>
          24  +
where
          25  +
    T: ResolveAuthScheme,
          26  +
{
          27  +
    fn resolve_auth_scheme_options_v2<'a>(
          28  +
        &'a self,
          29  +
        params: &'a ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams,
          30  +
        cfg: &'a ::aws_smithy_types::config_bag::ConfigBag,
          31  +
        runtime_components: &'a ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents,
          32  +
    ) -> ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture<'a> {
          33  +
        match params.get::<crate::config::auth::Params>() {
          34  +
            ::std::option::Option::Some(concrete_params) => self.0.resolve_auth_scheme(concrete_params, cfg, runtime_components),
          35  +
            ::std::option::Option::None => ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture::ready(::std::result::Result::Err(
          36  +
                "params of expected type was not present".into(),
          37  +
            )),
          38  +
        }
          39  +
    }
          40  +
}
          41  +
          42  +
/// The default auth scheme resolver
          43  +
#[derive(Debug)]
          44  +
#[allow(dead_code)]
          45  +
pub struct DefaultAuthSchemeResolver {
          46  +
    service_defaults: Vec<::aws_smithy_runtime_api::client::auth::AuthSchemeOption>,
          47  +
    operation_overrides: ::std::collections::HashMap<&'static str, Vec<::aws_smithy_runtime_api::client::auth::AuthSchemeOption>>,
          48  +
}
          49  +
          50  +
// TODO(https://github.com/smithy-lang/smithy-rs/issues/4177): Remove `allow(...)` once the issue is addressed.
          51  +
// When generating code for tests (e.g., `codegen-client-test`), this manual implementation
          52  +
// of the `Default` trait may appear as if it could be derived automatically.
          53  +
// However, that is not the case in production.
          54  +
#[allow(clippy::derivable_impls)]
          55  +
impl Default for DefaultAuthSchemeResolver {
          56  +
    fn default() -> Self {
          57  +
        Self {
          58  +
            service_defaults: vec![::aws_smithy_runtime_api::client::auth::AuthSchemeOption::builder()
          59  +
                .scheme_id(::aws_runtime::auth::sigv4::SCHEME_ID)
          60  +
                .build()
          61  +
                .expect("required fields set")],
          62  +
            operation_overrides: ::std::collections::HashMap::new(),
          63  +
        }
          64  +
    }
          65  +
}
          66  +
          67  +
impl crate::config::auth::ResolveAuthScheme for DefaultAuthSchemeResolver {
          68  +
    fn resolve_auth_scheme<'a>(
          69  +
        &'a self,
          70  +
        params: &'a crate::config::auth::Params,
          71  +
        _cfg: &'a ::aws_smithy_types::config_bag::ConfigBag,
          72  +
        _runtime_components: &'a ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents,
          73  +
    ) -> ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture<'a> {
          74  +
        let operation_name = params.operation_name();
          75  +
          76  +
        let modeled_auth_options = match self.operation_overrides.get(operation_name) {
          77  +
            Some(overrides) => overrides,
          78  +
            None => &self.service_defaults,
          79  +
        };
          80  +
          81  +
        let _fut = ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture::ready(Ok(modeled_auth_options.clone()));
          82  +
          83  +
        _fut
          84  +
    }
          85  +
}
          86  +
          87  +
/// Configuration parameters for resolving the correct auth scheme
          88  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
          89  +
pub struct Params {
          90  +
    operation_name: ::std::borrow::Cow<'static, str>,
          91  +
}
          92  +
impl Params {
          93  +
    /// Create a builder for [`Params`]
          94  +
    pub fn builder() -> crate::config::auth::ParamsBuilder {
          95  +
        crate::config::auth::ParamsBuilder::default()
          96  +
    }
          97  +
          98  +
    /// Return the operation name for [`Params`]
          99  +
    pub fn operation_name(&self) -> &str {
         100  +
        self.operation_name.as_ref()
         101  +
    }
         102  +
}
         103  +
         104  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         105  +
/// Builder for [`Params`]
         106  +
pub struct ParamsBuilder {
         107  +
    operation_name: ::std::option::Option<::std::borrow::Cow<'static, str>>,
         108  +
}
         109  +
impl ParamsBuilder {
         110  +
    /// Set the operation name for the builder
         111  +
    pub fn operation_name(self, operation_name: impl Into<::std::borrow::Cow<'static, str>>) -> Self {
         112  +
        self.set_operation_name(::std::option::Option::Some(operation_name.into()))
         113  +
    }
         114  +
         115  +
    /// Set the operation name for the builder
         116  +
    pub fn set_operation_name(mut self, operation_name: ::std::option::Option<::std::borrow::Cow<'static, str>>) -> Self {
         117  +
        self.operation_name = operation_name;
         118  +
        self
         119  +
    }
         120  +
    /// Consume this builder, create [`Params`]."
         121  +
    ///
         122  +
    /// Return [`BuildError`] if any of the required fields are unset.
         123  +
    ///
         124  +
    pub fn build(self) -> ::std::result::Result<crate::config::auth::Params, crate::config::auth::BuildError> {
         125  +
        ::std::result::Result::Ok(crate::config::auth::Params {
         126  +
            operation_name: self.operation_name.ok_or_else(|| BuildError::missing("operation_name"))?,
         127  +
        })
         128  +
    }
         129  +
}
         130  +
         131  +
/// An error that occurred while constructing `config::auth::Params`
         132  +
#[derive(Debug)]
         133  +
pub struct BuildError {
         134  +
    field: ::std::borrow::Cow<'static, str>,
         135  +
}
         136  +
         137  +
impl BuildError {
         138  +
    fn missing(field: &'static str) -> Self {
         139  +
        Self { field: field.into() }
         140  +
    }
         141  +
}
         142  +
         143  +
impl std::fmt::Display for BuildError {
         144  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         145  +
        write!(f, "a required field was missing: `{}`", self.field)
         146  +
    }
         147  +
}
         148  +
         149  +
impl std::error::Error for BuildError {}

tmp-codegen-diff/aws-sdk/sdk/qldbsession/src/config/endpoint.rs

@@ -0,1 +0,868 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use ::aws_smithy_runtime_api::client::endpoint::EndpointFuture;
           3  +
pub use ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver;
           4  +
pub use ::aws_smithy_types::endpoint::Endpoint;
           5  +
           6  +
#[cfg(test)]
           7  +
mod test {
           8  +
           9  +
    /// For region ap-northeast-1 with FIPS disabled and DualStack disabled
          10  +
    #[test]
          11  +
    fn test_1() {
          12  +
        let params = crate::config::endpoint::Params::builder()
          13  +
            .region("ap-northeast-1".to_string())
          14  +
            .use_fips(false)
          15  +
            .use_dual_stack(false)
          16  +
            .build()
          17  +
            .expect("invalid params");
          18  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
          19  +
        let endpoint = resolver.resolve_endpoint(&params);
          20  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.ap-northeast-1.amazonaws.com");
          21  +
        assert_eq!(
          22  +
            endpoint,
          23  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
          24  +
                .url("https://session.qldb.ap-northeast-1.amazonaws.com")
          25  +
                .build()
          26  +
        );
          27  +
    }
          28  +
          29  +
    /// For region ap-northeast-2 with FIPS disabled and DualStack disabled
          30  +
    #[test]
          31  +
    fn test_2() {
          32  +
        let params = crate::config::endpoint::Params::builder()
          33  +
            .region("ap-northeast-2".to_string())
          34  +
            .use_fips(false)
          35  +
            .use_dual_stack(false)
          36  +
            .build()
          37  +
            .expect("invalid params");
          38  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
          39  +
        let endpoint = resolver.resolve_endpoint(&params);
          40  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.ap-northeast-2.amazonaws.com");
          41  +
        assert_eq!(
          42  +
            endpoint,
          43  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
          44  +
                .url("https://session.qldb.ap-northeast-2.amazonaws.com")
          45  +
                .build()
          46  +
        );
          47  +
    }
          48  +
          49  +
    /// For region ap-southeast-1 with FIPS disabled and DualStack disabled
          50  +
    #[test]
          51  +
    fn test_3() {
          52  +
        let params = crate::config::endpoint::Params::builder()
          53  +
            .region("ap-southeast-1".to_string())
          54  +
            .use_fips(false)
          55  +
            .use_dual_stack(false)
          56  +
            .build()
          57  +
            .expect("invalid params");
          58  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
          59  +
        let endpoint = resolver.resolve_endpoint(&params);
          60  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.ap-southeast-1.amazonaws.com");
          61  +
        assert_eq!(
          62  +
            endpoint,
          63  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
          64  +
                .url("https://session.qldb.ap-southeast-1.amazonaws.com")
          65  +
                .build()
          66  +
        );
          67  +
    }
          68  +
          69  +
    /// For region ap-southeast-2 with FIPS disabled and DualStack disabled
          70  +
    #[test]
          71  +
    fn test_4() {
          72  +
        let params = crate::config::endpoint::Params::builder()
          73  +
            .region("ap-southeast-2".to_string())
          74  +
            .use_fips(false)
          75  +
            .use_dual_stack(false)
          76  +
            .build()
          77  +
            .expect("invalid params");
          78  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
          79  +
        let endpoint = resolver.resolve_endpoint(&params);
          80  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.ap-southeast-2.amazonaws.com");
          81  +
        assert_eq!(
          82  +
            endpoint,
          83  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
          84  +
                .url("https://session.qldb.ap-southeast-2.amazonaws.com")
          85  +
                .build()
          86  +
        );
          87  +
    }
          88  +
          89  +
    /// For region ca-central-1 with FIPS disabled and DualStack disabled
          90  +
    #[test]
          91  +
    fn test_5() {
          92  +
        let params = crate::config::endpoint::Params::builder()
          93  +
            .region("ca-central-1".to_string())
          94  +
            .use_fips(false)
          95  +
            .use_dual_stack(false)
          96  +
            .build()
          97  +
            .expect("invalid params");
          98  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
          99  +
        let endpoint = resolver.resolve_endpoint(&params);
         100  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.ca-central-1.amazonaws.com");
         101  +
        assert_eq!(
         102  +
            endpoint,
         103  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         104  +
                .url("https://session.qldb.ca-central-1.amazonaws.com")
         105  +
                .build()
         106  +
        );
         107  +
    }
         108  +
         109  +
    /// For region eu-central-1 with FIPS disabled and DualStack disabled
         110  +
    #[test]
         111  +
    fn test_6() {
         112  +
        let params = crate::config::endpoint::Params::builder()
         113  +
            .region("eu-central-1".to_string())
         114  +
            .use_fips(false)
         115  +
            .use_dual_stack(false)
         116  +
            .build()
         117  +
            .expect("invalid params");
         118  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         119  +
        let endpoint = resolver.resolve_endpoint(&params);
         120  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.eu-central-1.amazonaws.com");
         121  +
        assert_eq!(
         122  +
            endpoint,
         123  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         124  +
                .url("https://session.qldb.eu-central-1.amazonaws.com")
         125  +
                .build()
         126  +
        );
         127  +
    }
         128  +
         129  +
    /// For region eu-west-1 with FIPS disabled and DualStack disabled
         130  +
    #[test]
         131  +
    fn test_7() {
         132  +
        let params = crate::config::endpoint::Params::builder()
         133  +
            .region("eu-west-1".to_string())
         134  +
            .use_fips(false)
         135  +
            .use_dual_stack(false)
         136  +
            .build()
         137  +
            .expect("invalid params");
         138  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         139  +
        let endpoint = resolver.resolve_endpoint(&params);
         140  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.eu-west-1.amazonaws.com");
         141  +
        assert_eq!(
         142  +
            endpoint,
         143  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         144  +
                .url("https://session.qldb.eu-west-1.amazonaws.com")
         145  +
                .build()
         146  +
        );
         147  +
    }
         148  +
         149  +
    /// For region eu-west-2 with FIPS disabled and DualStack disabled
         150  +
    #[test]
         151  +
    fn test_8() {
         152  +
        let params = crate::config::endpoint::Params::builder()
         153  +
            .region("eu-west-2".to_string())
         154  +
            .use_fips(false)
         155  +
            .use_dual_stack(false)
         156  +
            .build()
         157  +
            .expect("invalid params");
         158  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         159  +
        let endpoint = resolver.resolve_endpoint(&params);
         160  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.eu-west-2.amazonaws.com");
         161  +
        assert_eq!(
         162  +
            endpoint,
         163  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         164  +
                .url("https://session.qldb.eu-west-2.amazonaws.com")
         165  +
                .build()
         166  +
        );
         167  +
    }
         168  +
         169  +
    /// For region us-east-1 with FIPS disabled and DualStack disabled
         170  +
    #[test]
         171  +
    fn test_9() {
         172  +
        let params = crate::config::endpoint::Params::builder()
         173  +
            .region("us-east-1".to_string())
         174  +
            .use_fips(false)
         175  +
            .use_dual_stack(false)
         176  +
            .build()
         177  +
            .expect("invalid params");
         178  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         179  +
        let endpoint = resolver.resolve_endpoint(&params);
         180  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.us-east-1.amazonaws.com");
         181  +
        assert_eq!(
         182  +
            endpoint,
         183  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         184  +
                .url("https://session.qldb.us-east-1.amazonaws.com")
         185  +
                .build()
         186  +
        );
         187  +
    }
         188  +
         189  +
    /// For region us-east-1 with FIPS enabled and DualStack disabled
         190  +
    #[test]
         191  +
    fn test_10() {
         192  +
        let params = crate::config::endpoint::Params::builder()
         193  +
            .region("us-east-1".to_string())
         194  +
            .use_fips(true)
         195  +
            .use_dual_stack(false)
         196  +
            .build()
         197  +
            .expect("invalid params");
         198  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         199  +
        let endpoint = resolver.resolve_endpoint(&params);
         200  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb-fips.us-east-1.amazonaws.com");
         201  +
        assert_eq!(
         202  +
            endpoint,
         203  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         204  +
                .url("https://session.qldb-fips.us-east-1.amazonaws.com")
         205  +
                .build()
         206  +
        );
         207  +
    }
         208  +
         209  +
    /// For region us-east-2 with FIPS disabled and DualStack disabled
         210  +
    #[test]
         211  +
    fn test_11() {
         212  +
        let params = crate::config::endpoint::Params::builder()
         213  +
            .region("us-east-2".to_string())
         214  +
            .use_fips(false)
         215  +
            .use_dual_stack(false)
         216  +
            .build()
         217  +
            .expect("invalid params");
         218  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         219  +
        let endpoint = resolver.resolve_endpoint(&params);
         220  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.us-east-2.amazonaws.com");
         221  +
        assert_eq!(
         222  +
            endpoint,
         223  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         224  +
                .url("https://session.qldb.us-east-2.amazonaws.com")
         225  +
                .build()
         226  +
        );
         227  +
    }
         228  +
         229  +
    /// For region us-east-2 with FIPS enabled and DualStack disabled
         230  +
    #[test]
         231  +
    fn test_12() {
         232  +
        let params = crate::config::endpoint::Params::builder()
         233  +
            .region("us-east-2".to_string())
         234  +
            .use_fips(true)
         235  +
            .use_dual_stack(false)
         236  +
            .build()
         237  +
            .expect("invalid params");
         238  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         239  +
        let endpoint = resolver.resolve_endpoint(&params);
         240  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb-fips.us-east-2.amazonaws.com");
         241  +
        assert_eq!(
         242  +
            endpoint,
         243  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         244  +
                .url("https://session.qldb-fips.us-east-2.amazonaws.com")
         245  +
                .build()
         246  +
        );
         247  +
    }
         248  +
         249  +
    /// For region us-west-2 with FIPS disabled and DualStack disabled
         250  +
    #[test]
         251  +
    fn test_13() {
         252  +
        let params = crate::config::endpoint::Params::builder()
         253  +
            .region("us-west-2".to_string())
         254  +
            .use_fips(false)
         255  +
            .use_dual_stack(false)
         256  +
            .build()
         257  +
            .expect("invalid params");
         258  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         259  +
        let endpoint = resolver.resolve_endpoint(&params);
         260  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.us-west-2.amazonaws.com");
         261  +
        assert_eq!(
         262  +
            endpoint,
         263  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         264  +
                .url("https://session.qldb.us-west-2.amazonaws.com")
         265  +
                .build()
         266  +
        );
         267  +
    }
         268  +
         269  +
    /// For region us-west-2 with FIPS enabled and DualStack disabled
         270  +
    #[test]
         271  +
    fn test_14() {
         272  +
        let params = crate::config::endpoint::Params::builder()
         273  +
            .region("us-west-2".to_string())
         274  +
            .use_fips(true)
         275  +
            .use_dual_stack(false)
         276  +
            .build()
         277  +
            .expect("invalid params");
         278  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         279  +
        let endpoint = resolver.resolve_endpoint(&params);
         280  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb-fips.us-west-2.amazonaws.com");
         281  +
        assert_eq!(
         282  +
            endpoint,
         283  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         284  +
                .url("https://session.qldb-fips.us-west-2.amazonaws.com")
         285  +
                .build()
         286  +
        );
         287  +
    }
         288  +
         289  +
    /// For region us-east-1 with FIPS enabled and DualStack enabled
         290  +
    #[test]
         291  +
    fn test_15() {
         292  +
        let params = crate::config::endpoint::Params::builder()
         293  +
            .region("us-east-1".to_string())
         294  +
            .use_fips(true)
         295  +
            .use_dual_stack(true)
         296  +
            .build()
         297  +
            .expect("invalid params");
         298  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         299  +
        let endpoint = resolver.resolve_endpoint(&params);
         300  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb-fips.us-east-1.api.aws");
         301  +
        assert_eq!(
         302  +
            endpoint,
         303  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         304  +
                .url("https://session.qldb-fips.us-east-1.api.aws")
         305  +
                .build()
         306  +
        );
         307  +
    }
         308  +
         309  +
    /// For region us-east-1 with FIPS disabled and DualStack enabled
         310  +
    #[test]
         311  +
    fn test_16() {
         312  +
        let params = crate::config::endpoint::Params::builder()
         313  +
            .region("us-east-1".to_string())
         314  +
            .use_fips(false)
         315  +
            .use_dual_stack(true)
         316  +
            .build()
         317  +
            .expect("invalid params");
         318  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         319  +
        let endpoint = resolver.resolve_endpoint(&params);
         320  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.us-east-1.api.aws");
         321  +
        assert_eq!(
         322  +
            endpoint,
         323  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         324  +
                .url("https://session.qldb.us-east-1.api.aws")
         325  +
                .build()
         326  +
        );
         327  +
    }
         328  +
         329  +
    /// For region cn-north-1 with FIPS enabled and DualStack enabled
         330  +
    #[test]
         331  +
    fn test_17() {
         332  +
        let params = crate::config::endpoint::Params::builder()
         333  +
            .region("cn-north-1".to_string())
         334  +
            .use_fips(true)
         335  +
            .use_dual_stack(true)
         336  +
            .build()
         337  +
            .expect("invalid params");
         338  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         339  +
        let endpoint = resolver.resolve_endpoint(&params);
         340  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb-fips.cn-north-1.api.amazonwebservices.com.cn");
         341  +
        assert_eq!(
         342  +
            endpoint,
         343  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         344  +
                .url("https://session.qldb-fips.cn-north-1.api.amazonwebservices.com.cn")
         345  +
                .build()
         346  +
        );
         347  +
    }
         348  +
         349  +
    /// For region cn-north-1 with FIPS enabled and DualStack disabled
         350  +
    #[test]
         351  +
    fn test_18() {
         352  +
        let params = crate::config::endpoint::Params::builder()
         353  +
            .region("cn-north-1".to_string())
         354  +
            .use_fips(true)
         355  +
            .use_dual_stack(false)
         356  +
            .build()
         357  +
            .expect("invalid params");
         358  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         359  +
        let endpoint = resolver.resolve_endpoint(&params);
         360  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb-fips.cn-north-1.amazonaws.com.cn");
         361  +
        assert_eq!(
         362  +
            endpoint,
         363  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         364  +
                .url("https://session.qldb-fips.cn-north-1.amazonaws.com.cn")
         365  +
                .build()
         366  +
        );
         367  +
    }
         368  +
         369  +
    /// For region cn-north-1 with FIPS disabled and DualStack enabled
         370  +
    #[test]
         371  +
    fn test_19() {
         372  +
        let params = crate::config::endpoint::Params::builder()
         373  +
            .region("cn-north-1".to_string())
         374  +
            .use_fips(false)
         375  +
            .use_dual_stack(true)
         376  +
            .build()
         377  +
            .expect("invalid params");
         378  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         379  +
        let endpoint = resolver.resolve_endpoint(&params);
         380  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.cn-north-1.api.amazonwebservices.com.cn");
         381  +
        assert_eq!(
         382  +
            endpoint,
         383  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         384  +
                .url("https://session.qldb.cn-north-1.api.amazonwebservices.com.cn")
         385  +
                .build()
         386  +
        );
         387  +
    }
         388  +
         389  +
    /// For region cn-north-1 with FIPS disabled and DualStack disabled
         390  +
    #[test]
         391  +
    fn test_20() {
         392  +
        let params = crate::config::endpoint::Params::builder()
         393  +
            .region("cn-north-1".to_string())
         394  +
            .use_fips(false)
         395  +
            .use_dual_stack(false)
         396  +
            .build()
         397  +
            .expect("invalid params");
         398  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         399  +
        let endpoint = resolver.resolve_endpoint(&params);
         400  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.cn-north-1.amazonaws.com.cn");
         401  +
        assert_eq!(
         402  +
            endpoint,
         403  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         404  +
                .url("https://session.qldb.cn-north-1.amazonaws.com.cn")
         405  +
                .build()
         406  +
        );
         407  +
    }
         408  +
         409  +
    /// For region us-gov-east-1 with FIPS enabled and DualStack enabled
         410  +
    #[test]
         411  +
    fn test_21() {
         412  +
        let params = crate::config::endpoint::Params::builder()
         413  +
            .region("us-gov-east-1".to_string())
         414  +
            .use_fips(true)
         415  +
            .use_dual_stack(true)
         416  +
            .build()
         417  +
            .expect("invalid params");
         418  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         419  +
        let endpoint = resolver.resolve_endpoint(&params);
         420  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb-fips.us-gov-east-1.api.aws");
         421  +
        assert_eq!(
         422  +
            endpoint,
         423  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         424  +
                .url("https://session.qldb-fips.us-gov-east-1.api.aws")
         425  +
                .build()
         426  +
        );
         427  +
    }
         428  +
         429  +
    /// For region us-gov-east-1 with FIPS enabled and DualStack disabled
         430  +
    #[test]
         431  +
    fn test_22() {
         432  +
        let params = crate::config::endpoint::Params::builder()
         433  +
            .region("us-gov-east-1".to_string())
         434  +
            .use_fips(true)
         435  +
            .use_dual_stack(false)
         436  +
            .build()
         437  +
            .expect("invalid params");
         438  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         439  +
        let endpoint = resolver.resolve_endpoint(&params);
         440  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb-fips.us-gov-east-1.amazonaws.com");
         441  +
        assert_eq!(
         442  +
            endpoint,
         443  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         444  +
                .url("https://session.qldb-fips.us-gov-east-1.amazonaws.com")
         445  +
                .build()
         446  +
        );
         447  +
    }
         448  +
         449  +
    /// For region us-gov-east-1 with FIPS disabled and DualStack enabled
         450  +
    #[test]
         451  +
    fn test_23() {
         452  +
        let params = crate::config::endpoint::Params::builder()
         453  +
            .region("us-gov-east-1".to_string())
         454  +
            .use_fips(false)
         455  +
            .use_dual_stack(true)
         456  +
            .build()
         457  +
            .expect("invalid params");
         458  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         459  +
        let endpoint = resolver.resolve_endpoint(&params);
         460  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.us-gov-east-1.api.aws");
         461  +
        assert_eq!(
         462  +
            endpoint,
         463  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         464  +
                .url("https://session.qldb.us-gov-east-1.api.aws")
         465  +
                .build()
         466  +
        );
         467  +
    }
         468  +
         469  +
    /// For region us-gov-east-1 with FIPS disabled and DualStack disabled
         470  +
    #[test]
         471  +
    fn test_24() {
         472  +
        let params = crate::config::endpoint::Params::builder()
         473  +
            .region("us-gov-east-1".to_string())
         474  +
            .use_fips(false)
         475  +
            .use_dual_stack(false)
         476  +
            .build()
         477  +
            .expect("invalid params");
         478  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         479  +
        let endpoint = resolver.resolve_endpoint(&params);
         480  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.us-gov-east-1.amazonaws.com");
         481  +
        assert_eq!(
         482  +
            endpoint,
         483  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         484  +
                .url("https://session.qldb.us-gov-east-1.amazonaws.com")
         485  +
                .build()
         486  +
        );
         487  +
    }
         488  +
         489  +
    /// For region us-iso-east-1 with FIPS enabled and DualStack disabled
         490  +
    #[test]
         491  +
    fn test_25() {
         492  +
        let params = crate::config::endpoint::Params::builder()
         493  +
            .region("us-iso-east-1".to_string())
         494  +
            .use_fips(true)
         495  +
            .use_dual_stack(false)
         496  +
            .build()
         497  +
            .expect("invalid params");
         498  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         499  +
        let endpoint = resolver.resolve_endpoint(&params);
         500  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb-fips.us-iso-east-1.c2s.ic.gov");
         501  +
        assert_eq!(
         502  +
            endpoint,
         503  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         504  +
                .url("https://session.qldb-fips.us-iso-east-1.c2s.ic.gov")
         505  +
                .build()
         506  +
        );
         507  +
    }
         508  +
         509  +
    /// For region us-iso-east-1 with FIPS disabled and DualStack disabled
         510  +
    #[test]
         511  +
    fn test_26() {
         512  +
        let params = crate::config::endpoint::Params::builder()
         513  +
            .region("us-iso-east-1".to_string())
         514  +
            .use_fips(false)
         515  +
            .use_dual_stack(false)
         516  +
            .build()
         517  +
            .expect("invalid params");
         518  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         519  +
        let endpoint = resolver.resolve_endpoint(&params);
         520  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.us-iso-east-1.c2s.ic.gov");
         521  +
        assert_eq!(
         522  +
            endpoint,
         523  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         524  +
                .url("https://session.qldb.us-iso-east-1.c2s.ic.gov")
         525  +
                .build()
         526  +
        );
         527  +
    }
         528  +
         529  +
    /// For region us-isob-east-1 with FIPS enabled and DualStack disabled
         530  +
    #[test]
         531  +
    fn test_27() {
         532  +
        let params = crate::config::endpoint::Params::builder()
         533  +
            .region("us-isob-east-1".to_string())
         534  +
            .use_fips(true)
         535  +
            .use_dual_stack(false)
         536  +
            .build()
         537  +
            .expect("invalid params");
         538  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         539  +
        let endpoint = resolver.resolve_endpoint(&params);
         540  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb-fips.us-isob-east-1.sc2s.sgov.gov");
         541  +
        assert_eq!(
         542  +
            endpoint,
         543  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         544  +
                .url("https://session.qldb-fips.us-isob-east-1.sc2s.sgov.gov")
         545  +
                .build()
         546  +
        );
         547  +
    }
         548  +
         549  +
    /// For region us-isob-east-1 with FIPS disabled and DualStack disabled
         550  +
    #[test]
         551  +
    fn test_28() {
         552  +
        let params = crate::config::endpoint::Params::builder()
         553  +
            .region("us-isob-east-1".to_string())
         554  +
            .use_fips(false)
         555  +
            .use_dual_stack(false)
         556  +
            .build()
         557  +
            .expect("invalid params");
         558  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         559  +
        let endpoint = resolver.resolve_endpoint(&params);
         560  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://session.qldb.us-isob-east-1.sc2s.sgov.gov");
         561  +
        assert_eq!(
         562  +
            endpoint,
         563  +
            ::aws_smithy_types::endpoint::Endpoint::builder()
         564  +
                .url("https://session.qldb.us-isob-east-1.sc2s.sgov.gov")
         565  +
                .build()
         566  +
        );
         567  +
    }
         568  +
         569  +
    /// For custom endpoint with region set and fips disabled and dualstack disabled
         570  +
    #[test]
         571  +
    fn test_29() {
         572  +
        let params = crate::config::endpoint::Params::builder()
         573  +
            .region("us-east-1".to_string())
         574  +
            .use_fips(false)
         575  +
            .use_dual_stack(false)
         576  +
            .endpoint("https://example.com".to_string())
         577  +
            .build()
         578  +
            .expect("invalid params");
         579  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         580  +
        let endpoint = resolver.resolve_endpoint(&params);
         581  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://example.com");
         582  +
        assert_eq!(
         583  +
            endpoint,
         584  +
            ::aws_smithy_types::endpoint::Endpoint::builder().url("https://example.com").build()
         585  +
        );
         586  +
    }
         587  +
         588  +
    /// For custom endpoint with region not set and fips disabled and dualstack disabled
         589  +
    #[test]
         590  +
    fn test_30() {
         591  +
        let params = crate::config::endpoint::Params::builder()
         592  +
            .use_fips(false)
         593  +
            .use_dual_stack(false)
         594  +
            .endpoint("https://example.com".to_string())
         595  +
            .build()
         596  +
            .expect("invalid params");
         597  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         598  +
        let endpoint = resolver.resolve_endpoint(&params);
         599  +
        let endpoint = endpoint.expect("Expected valid endpoint: https://example.com");
         600  +
        assert_eq!(
         601  +
            endpoint,
         602  +
            ::aws_smithy_types::endpoint::Endpoint::builder().url("https://example.com").build()
         603  +
        );
         604  +
    }
         605  +
         606  +
    /// For custom endpoint with fips enabled and dualstack disabled
         607  +
    #[test]
         608  +
    fn test_31() {
         609  +
        let params = crate::config::endpoint::Params::builder()
         610  +
            .region("us-east-1".to_string())
         611  +
            .use_fips(true)
         612  +
            .use_dual_stack(false)
         613  +
            .endpoint("https://example.com".to_string())
         614  +
            .build()
         615  +
            .expect("invalid params");
         616  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         617  +
        let endpoint = resolver.resolve_endpoint(&params);
         618  +
        let error = endpoint.expect_err("expected error: Invalid Configuration: FIPS and custom endpoint are not supported [For custom endpoint with fips enabled and dualstack disabled]");
         619  +
        assert_eq!(format!("{}", error), "Invalid Configuration: FIPS and custom endpoint are not supported")
         620  +
    }
         621  +
         622  +
    /// For custom endpoint with fips disabled and dualstack enabled
         623  +
    #[test]
         624  +
    fn test_32() {
         625  +
        let params = crate::config::endpoint::Params::builder()
         626  +
            .region("us-east-1".to_string())
         627  +
            .use_fips(false)
         628  +
            .use_dual_stack(true)
         629  +
            .endpoint("https://example.com".to_string())
         630  +
            .build()
         631  +
            .expect("invalid params");
         632  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         633  +
        let endpoint = resolver.resolve_endpoint(&params);
         634  +
        let error = endpoint.expect_err("expected error: Invalid Configuration: Dualstack and custom endpoint are not supported [For custom endpoint with fips disabled and dualstack enabled]");
         635  +
        assert_eq!(
         636  +
            format!("{}", error),
         637  +
            "Invalid Configuration: Dualstack and custom endpoint are not supported"
         638  +
        )
         639  +
    }
         640  +
         641  +
    /// Missing region
         642  +
    #[test]
         643  +
    fn test_33() {
         644  +
        let params = crate::config::endpoint::Params::builder().build().expect("invalid params");
         645  +
        let resolver = crate::config::endpoint::DefaultResolver::new();
         646  +
        let endpoint = resolver.resolve_endpoint(&params);
         647  +
        let error = endpoint.expect_err("expected error: Invalid Configuration: Missing Region [Missing region]");
         648  +
        assert_eq!(format!("{}", error), "Invalid Configuration: Missing Region")
         649  +
    }
         650  +
}
         651  +
         652  +
/// Endpoint resolver trait specific to Amazon QLDB Session
         653  +
pub trait ResolveEndpoint: ::std::marker::Send + ::std::marker::Sync + ::std::fmt::Debug {
         654  +
    /// Resolve an endpoint with the given parameters
         655  +
    fn resolve_endpoint<'a>(&'a self, params: &'a crate::config::endpoint::Params) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a>;
         656  +
         657  +
    /// Convert this service-specific resolver into a `SharedEndpointResolver`
         658  +
    ///
         659  +
    /// The resulting resolver will downcast `EndpointResolverParams` into `crate::config::endpoint::Params`.
         660  +
    fn into_shared_resolver(self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver
         661  +
    where
         662  +
        Self: Sized + 'static,
         663  +
    {
         664  +
        ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver::new(DowncastParams(self))
         665  +
    }
         666  +
}
         667  +
         668  +
#[derive(Debug)]
         669  +
struct DowncastParams<T>(T);
         670  +
impl<T> ::aws_smithy_runtime_api::client::endpoint::ResolveEndpoint for DowncastParams<T>
         671  +
where
         672  +
    T: ResolveEndpoint,
         673  +
{
         674  +
    fn resolve_endpoint<'a>(
         675  +
        &'a self,
         676  +
        params: &'a ::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams,
         677  +
    ) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a> {
         678  +
        let ep = match params.get::<crate::config::endpoint::Params>() {
         679  +
            Some(params) => self.0.resolve_endpoint(params),
         680  +
            None => ::aws_smithy_runtime_api::client::endpoint::EndpointFuture::ready(Err("params of expected type was not present".into())),
         681  +
        };
         682  +
        ep
         683  +
    }
         684  +
}
         685  +
         686  +
/// The default endpoint resolver
         687  +
#[derive(Debug, Default)]
         688  +
pub struct DefaultResolver {
         689  +
    partition_resolver: crate::endpoint_lib::partition::PartitionResolver,
         690  +
}
         691  +
         692  +
impl DefaultResolver {
         693  +
    /// Create a new endpoint resolver with default settings
         694  +
    pub fn new() -> Self {
         695  +
        Self {
         696  +
            partition_resolver: crate::endpoint_lib::DEFAULT_PARTITION_RESOLVER.clone(),
         697  +
        }
         698  +
    }
         699  +
         700  +
    fn resolve_endpoint(
         701  +
        &self,
         702  +
        params: &crate::config::endpoint::Params,
         703  +
    ) -> ::std::result::Result<::aws_smithy_types::endpoint::Endpoint, ::aws_smithy_runtime_api::box_error::BoxError> {
         704  +
        let mut diagnostic_collector = crate::endpoint_lib::diagnostic::DiagnosticCollector::new();
         705  +
        Ok(
         706  +
            crate::config::endpoint::internals::resolve_endpoint(params, &mut diagnostic_collector, &self.partition_resolver)
         707  +
                .map_err(|err| err.with_source(diagnostic_collector.take_last_error()))?,
         708  +
        )
         709  +
    }
         710  +
}
         711  +
         712  +
impl crate::config::endpoint::ResolveEndpoint for DefaultResolver {
         713  +
    fn resolve_endpoint(&self, params: &crate::config::endpoint::Params) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'_> {
         714  +
        ::aws_smithy_runtime_api::client::endpoint::EndpointFuture::ready(self.resolve_endpoint(params))
         715  +
    }
         716  +
}
         717  +
         718  +
#[non_exhaustive]
         719  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
         720  +
/// Configuration parameters for resolving the correct endpoint
         721  +
pub struct Params {
         722  +
    /// The AWS region used to dispatch the request.
         723  +
    pub(crate) region: ::std::option::Option<::std::string::String>,
         724  +
    /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
         725  +
    pub(crate) use_dual_stack: bool,
         726  +
    /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
         727  +
    pub(crate) use_fips: bool,
         728  +
    /// Override the endpoint used to send this request
         729  +
    pub(crate) endpoint: ::std::option::Option<::std::string::String>,
         730  +
}
         731  +
impl Params {
         732  +
    /// Create a builder for [`Params`]
         733  +
    pub fn builder() -> crate::config::endpoint::ParamsBuilder {
         734  +
        crate::config::endpoint::ParamsBuilder::default()
         735  +
    }
         736  +
    /// The AWS region used to dispatch the request.
         737  +
    pub fn region(&self) -> ::std::option::Option<&str> {
         738  +
        self.region.as_deref()
         739  +
    }
         740  +
    /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
         741  +
    pub fn use_dual_stack(&self) -> ::std::option::Option<bool> {
         742  +
        Some(self.use_dual_stack)
         743  +
    }
         744  +
    /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
         745  +
    pub fn use_fips(&self) -> ::std::option::Option<bool> {
         746  +
        Some(self.use_fips)
         747  +
    }
         748  +
    /// Override the endpoint used to send this request
         749  +
    pub fn endpoint(&self) -> ::std::option::Option<&str> {
         750  +
        self.endpoint.as_deref()
         751  +
    }
         752  +
}
         753  +
         754  +
/// Builder for [`Params`]
         755  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         756  +
pub struct ParamsBuilder {
         757  +
    region: ::std::option::Option<::std::string::String>,
         758  +
    use_dual_stack: ::std::option::Option<bool>,
         759  +
    use_fips: ::std::option::Option<bool>,
         760  +
    endpoint: ::std::option::Option<::std::string::String>,
         761  +
}
         762  +
impl ParamsBuilder {
         763  +
    /// Consume this builder, creating [`Params`].
         764  +
    pub fn build(self) -> ::std::result::Result<crate::config::endpoint::Params, crate::config::endpoint::InvalidParams> {
         765  +
        Ok(
         766  +
            #[allow(clippy::unnecessary_lazy_evaluations)]
         767  +
            crate::config::endpoint::Params {
         768  +
                region: self.region,
         769  +
                use_dual_stack: self
         770  +
                    .use_dual_stack
         771  +
                    .or_else(|| Some(false))
         772  +
                    .ok_or_else(|| crate::config::endpoint::InvalidParams::missing("use_dual_stack"))?,
         773  +
                use_fips: self
         774  +
                    .use_fips
         775  +
                    .or_else(|| Some(false))
         776  +
                    .ok_or_else(|| crate::config::endpoint::InvalidParams::missing("use_fips"))?,
         777  +
                endpoint: self.endpoint,
         778  +
            },
         779  +
        )
         780  +
    }
         781  +
    /// Sets the value for region
         782  +
    ///
         783  +
    /// The AWS region used to dispatch the request.
         784  +
    pub fn region(mut self, value: impl Into<::std::string::String>) -> Self {
         785  +
        self.region = Some(value.into());
         786  +
        self
         787  +
    }
         788  +
         789  +
    /// Sets the value for region
         790  +
    ///
         791  +
    /// The AWS region used to dispatch the request.
         792  +
    pub fn set_region(mut self, param: Option<::std::string::String>) -> Self {
         793  +
        self.region = param;
         794  +
        self
         795  +
    }
         796  +
    /// Sets the value for use_dual_stack
         797  +
    ///
         798  +
    /// When unset, this parameter has a default value of `false`.
         799  +
    /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
         800  +
    pub fn use_dual_stack(mut self, value: impl Into<bool>) -> Self {
         801  +
        self.use_dual_stack = Some(value.into());
         802  +
        self
         803  +
    }
         804  +
         805  +
    /// Sets the value for use_dual_stack
         806  +
    ///
         807  +
    /// When unset, this parameter has a default value of `false`.
         808  +
    /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
         809  +
    pub fn set_use_dual_stack(mut self, param: Option<bool>) -> Self {
         810  +
        self.use_dual_stack = param;
         811  +
        self
         812  +
    }
         813  +
    /// Sets the value for use_fips
         814  +
    ///
         815  +
    /// When unset, this parameter has a default value of `false`.
         816  +
    /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
         817  +
    pub fn use_fips(mut self, value: impl Into<bool>) -> Self {
         818  +
        self.use_fips = Some(value.into());
         819  +
        self
         820  +
    }
         821  +
         822  +
    /// Sets the value for use_fips
         823  +
    ///
         824  +
    /// When unset, this parameter has a default value of `false`.
         825  +
    /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
         826  +
    pub fn set_use_fips(mut self, param: Option<bool>) -> Self {
         827  +
        self.use_fips = param;
         828  +
        self
         829  +
    }
         830  +
    /// Sets the value for endpoint
         831  +
    ///
         832  +
    /// Override the endpoint used to send this request
         833  +
    pub fn endpoint(mut self, value: impl Into<::std::string::String>) -> Self {
         834  +
        self.endpoint = Some(value.into());
         835  +
        self
         836  +
    }
         837  +
         838  +
    /// Sets the value for endpoint
         839  +
    ///
         840  +
    /// Override the endpoint used to send this request
         841  +
    pub fn set_endpoint(mut self, param: Option<::std::string::String>) -> Self {
         842  +
        self.endpoint = param;
         843  +
        self
         844  +
    }
         845  +
}
         846  +
         847  +
/// An error that occurred during endpoint resolution
         848  +
#[derive(Debug)]
         849  +
pub struct InvalidParams {
         850  +
    field: std::borrow::Cow<'static, str>,
         851  +
}
         852  +
         853  +
impl InvalidParams {
         854  +
    #[allow(dead_code)]
         855  +
    fn missing(field: &'static str) -> Self {
         856  +
        Self { field: field.into() }
         857  +
    }
         858  +
}
         859  +
         860  +
impl std::fmt::Display for InvalidParams {
         861  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         862  +
        write!(f, "a required field was missing: `{}`", self.field)
         863  +
    }
         864  +
}
         865  +
         866  +
impl std::error::Error for InvalidParams {}
         867  +
         868  +
mod internals;