#[cfg(test)]
mod test {
#[test]
fn test_1() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("a b".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid region: region was not a valid DNS name. [region is not a valid DNS-suffix]");
assert_eq!(
format!("{}", error),
"Invalid region: region was not a valid DNS name."
)
}
#[test]
fn test_2() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.bucket("arn:aws:not-s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: The ARN was not for the S3 service, found: not-s3 [Invalid access point ARN: Not S3]");
assert_eq!(
format!("{}", error),
"Invalid ARN: The ARN was not for the S3 service, found: not-s3"
)
}
#[test]
fn test_3() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.bucket(
"arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint:more-data".to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: The ARN may only contain a single resource component after `accesspoint`. [Invalid access point ARN: invalid resource]");
assert_eq!(format!("{}", error), "Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.")
}
#[test]
fn test_4() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided [Invalid access point ARN: invalid no ap name]");
assert_eq!(format!("{}", error), "Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided")
}
#[test]
fn test_5() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.bucket("arn:aws:s3:us-west-2:123456_789012:accesspoint:apname".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `123456_789012` [Invalid access point ARN: AccountId is invalid]");
assert_eq!(format!("{}", error), "Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `123456_789012`")
}
#[test]
fn test_6() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:ap_name".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `ap_name` [Invalid access point ARN: access point name is invalid]");
assert_eq!(format!("{}", error), "Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `ap_name`")
}
#[test]
fn test_7() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.disable_access_points(false)
.bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_8() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("cn-north-1".to_string())
.use_fips(true)
.use_dual_stack(false)
.accelerate(false)
.bucket("arn:aws:s3:cn-north-1:123456789012:accesspoint:myendpoint".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Partition does not support FIPS [Access points: partition does not support FIPS]");
assert_eq!(format!("{}", error), "Partition does not support FIPS")
}
#[test]
fn test_9() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.disable_access_points(false)
.bucket("arn:aws:s3:us-west -2:123456789012:accesspoint:myendpoint".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid region in ARN: `us-west -2` (invalid DNS name) [Bucket region is invalid]");
assert_eq!(
format!("{}", error),
"Invalid region in ARN: `us-west -2` (invalid DNS name)"
)
}
#[test]
fn test_10() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.disable_access_points(true)
.bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Access points are not supported for this operation [Access points when Access points explicitly disabled (used for CreateBucket)]");
assert_eq!(
format!("{}", error),
"Access points are not supported for this operation"
)
}
#[test]
fn test_11() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.disable_access_points(true)
.bucket("arn:aws:s3:us-west-2:123456789012:".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: `arn:aws:s3:us-west-2:123456789012:` was not a valid ARN [missing arn type]");
assert_eq!(
format!("{}", error),
"Invalid ARN: `arn:aws:s3:us-west-2:123456789012:` was not a valid ARN"
)
}
#[test]
fn test_12() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.endpoint("https://beta.example.com".to_string())
.region("cn-north-1".to_string())
.use_dual_stack(true)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: DualStack cannot be combined with a Host override (PrivateLink) [SDK::Host + access point + Dualstack is an error]");
assert_eq!(
format!("{}", error),
"DualStack cannot be combined with a Host override (PrivateLink)"
)
}
#[test]
fn test_13() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_fips(true)
.use_dual_stack(true)
.accelerate(false)
.disable_access_points(false)
.bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint-fips.dualstack.us-west-2.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://myendpoint-123456789012.s3-accesspoint-fips.dualstack.us-west-2.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})])
.build());
}
#[test]
fn test_14() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_fips(false)
.use_dual_stack(true)
.accelerate(false)
.disable_access_points(false)
.bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint.dualstack.us-west-2.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://myendpoint-123456789012.s3-accesspoint.dualstack.us-west-2.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})])
.build());
}
#[test]
fn test_15() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap".to_string())
.region("us-east-1".to_string())
.disable_multi_region_access_points(false)
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://mfzwi23gnjvgw.mrap.accesspoint.s3-global.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://mfzwi23gnjvgw.mrap.accesspoint.s3-global.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4a".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert(
"signingRegionSet".to_string(),
vec![aws_smithy_types::Document::from("*".to_string())].into(),
);
out
})]
)
.build()
);
}
#[test]
fn test_16() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap".to_string())
.region("us-east-1".to_string())
.disable_multi_region_access_points(false)
.use_fips(true)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err(
"expected error: S3 MRAP does not support FIPS [MRAP does not support FIPS]",
);
assert_eq!(format!("{}", error), "S3 MRAP does not support FIPS")
}
#[test]
fn test_17() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap".to_string())
.region("us-east-1".to_string())
.disable_multi_region_access_points(false)
.use_fips(false)
.use_dual_stack(true)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err(
"expected error: S3 MRAP does not support dual-stack [MRAP does not support DualStack]",
);
assert_eq!(format!("{}", error), "S3 MRAP does not support dual-stack")
}
#[test]
fn test_18() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap".to_string())
.region("us-east-1".to_string())
.disable_multi_region_access_points(false)
.use_fips(false)
.use_dual_stack(false)
.accelerate(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: S3 MRAP does not support S3 Accelerate [MRAP does not support S3 Accelerate]");
assert_eq!(
format!("{}", error),
"S3 MRAP does not support S3 Accelerate"
)
}
#[test]
fn test_19() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap".to_string())
.region("us-east-1".to_string())
.disable_multi_region_access_points(true)
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid configuration: Multi-Region Access Point ARNs are disabled. [MRAP explicitly disabled]");
assert_eq!(
format!("{}", error),
"Invalid configuration: Multi-Region Access Point ARNs are disabled."
)
}
#[test]
fn test_20() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("bucketname".to_string())
.region("us-west-2".to_string())
.force_path_style(true)
.use_fips(false)
.accelerate(false)
.use_dual_stack(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://s3.dualstack.us-west-2.amazonaws.com/bucketname",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.dualstack.us-west-2.amazonaws.com/bucketname")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_21() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("bucketname".to_string())
.region("us-west-2".to_string())
.force_path_style(true)
.use_fips(false)
.accelerate(false)
.use_dual_stack(true)
.endpoint("https://abc.com".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Cannot set dual-stack in combination with a custom endpoint. [Dual-stack endpoint + SDK::Host is error]");
assert_eq!(
format!("{}", error),
"Cannot set dual-stack in combination with a custom endpoint."
)
}
#[test]
fn test_22() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap".to_string())
.force_path_style(true)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Path-style addressing cannot be used with ARN buckets [path style + ARN bucket]");
assert_eq!(
format!("{}", error),
"Path-style addressing cannot be used with ARN buckets"
)
}
#[test]
fn test_23() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("99_ab".to_string())
.region("us-west-2".to_string())
.use_dual_stack(true)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3.dualstack.us-west-2.amazonaws.com/99_ab");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.dualstack.us-west-2.amazonaws.com/99_ab")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_24() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("99_ab".to_string())
.region("us-west-2".to_string())
.use_dual_stack(true)
.use_fips(false)
.endpoint("http://abc.com".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Cannot set dual-stack in combination with a custom endpoint. [implicit path style bucket + dualstack]");
assert_eq!(
format!("{}", error),
"Cannot set dual-stack in combination with a custom endpoint."
)
}
#[test]
fn test_25() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("example.com#".to_string())
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3.us-west-2.amazonaws.com/example.com%23");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.us-west-2.amazonaws.com/example.com%23")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_26() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("bucket name".to_string())
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3.us-west-2.amazonaws.com/bucket%20name");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.us-west-2.amazonaws.com/bucket%20name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_27() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("99_ab".to_string())
.endpoint(
"http://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: http://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/99_ab");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("http://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/99_ab")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_28() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucketname".to_string())
.endpoint(
"http://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/foo".to_string(),
)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: http://bucketname.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/foo");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("http://bucketname.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/foo")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_29() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("99_ab".to_string())
.endpoint(
"https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/99_ab");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/99_ab")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_30() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucketname".to_string())
.endpoint("abcde://nota#url".to_string())
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Custom endpoint `abcde://nota#url` was not a valid URI [invalid Endpoint override]");
assert_eq!(
format!("{}", error),
"Custom endpoint `abcde://nota#url` was not a valid URI"
)
}
#[test]
fn test_31() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucketname".to_string())
.endpoint("https://123.123.0.1".to_string())
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://123.123.0.1/bucketname");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://123.123.0.1/bucketname")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_32() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3:us-east-1:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.use_arn_region(false)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false` [vanilla access point arn with region mismatch and UseArnRegion=false]");
assert_eq!(format!("{}", error), "Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false`")
}
#[test]
fn test_33() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.region("us-east-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_34() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.use_arn_region(true)
.region("us-east-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_35() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("bucket.name".to_string())
.region("us-east-1".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3.us-east-1.amazonaws.com/bucket.name");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.us-east-1.amazonaws.com/bucket.name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_36() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("aaa".to_string())
.region("us-east-1".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint =
endpoint.expect("Expected valid endpoint: https://aaa.s3.us-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://aaa.s3.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_37() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("aa".to_string())
.region("us-east-1".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint =
endpoint.expect("Expected valid endpoint: https://s3.us-east-1.amazonaws.com/aa");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.us-east-1.amazonaws.com/aa")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_38() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("BucketName".to_string())
.region("us-east-1".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3.us-east-1.amazonaws.com/BucketName");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.us-east-1.amazonaws.com/BucketName")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_39() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("bucket.name".to_string())
.region("us-east-1".to_string())
.endpoint("http://example.com".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: http://bucket.name.example.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("http://bucket.name.example.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_40() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("bucket-name".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err(
"expected error: A region must be set when sending requests to S3. [no region set]",
);
assert_eq!(
format!("{}", error),
"A region must be set when sending requests to S3."
)
}
#[test]
fn test_41() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_global_endpoint(true)
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://s3.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_42() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_global_endpoint(true)
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint =
endpoint.expect("Expected valid endpoint: https://s3.us-west-2.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.us-west-2.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_43() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("cn-north-1".to_string())
.use_global_endpoint(true)
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint =
endpoint.expect("Expected valid endpoint: https://s3.cn-north-1.amazonaws.com.cn");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.cn-north-1.amazonaws.com.cn")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_44() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_global_endpoint(true)
.use_fips(true)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint =
endpoint.expect("Expected valid endpoint: https://s3-fips.us-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3-fips.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_45() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_global_endpoint(true)
.use_fips(false)
.use_dual_stack(true)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3.dualstack.us-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.dualstack.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_46() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_global_endpoint(true)
.use_fips(true)
.use_dual_stack(true)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3-fips.dualstack.us-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3-fips.dualstack.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_47() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.endpoint("https://example.com".to_string())
.use_global_endpoint(true)
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://example.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://example.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_48() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.endpoint("https://example.com".to_string())
.use_global_endpoint(true)
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://example.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://example.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_49() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_global_endpoint(true)
.use_fips(false)
.use_dual_stack(false)
.accelerate(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://s3.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_50() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://s3.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_51() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.use_fips(true)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint =
endpoint.expect("Expected valid endpoint: https://s3-fips.us-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3-fips.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_52() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.use_fips(false)
.use_dual_stack(true)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3.dualstack.us-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.dualstack.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_53() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.use_fips(true)
.use_dual_stack(true)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3-fips.dualstack.us-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3-fips.dualstack.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_54() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://s3.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_55() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.endpoint("https://example.com".to_string())
.use_global_endpoint(false)
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://example.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://example.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_56() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.bucket("bucket-name".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint =
endpoint.expect("Expected valid endpoint: https://bucket-name.s3.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_57() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.bucket("bucket-name".to_string())
.use_fips(true)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://bucket-name.s3-fips.us-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3-fips.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_58() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.bucket("bucket-name".to_string())
.use_fips(false)
.use_dual_stack(true)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://bucket-name.s3.dualstack.us-east-1.amazonaws.com",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3.dualstack.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_59() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.bucket("bucket-name".to_string())
.use_fips(true)
.use_dual_stack(true)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-fips.dualstack.us-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3-fips.dualstack.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_60() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.bucket("bucket-name".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://bucket-name.s3-accelerate.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3-accelerate.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_61() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.endpoint("https://example.com".to_string())
.bucket("bucket-name".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.example.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.example.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_62() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_global_endpoint(true)
.bucket("bucket-name".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint =
endpoint.expect("Expected valid endpoint: https://bucket-name.s3.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_63() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_global_endpoint(true)
.bucket("bucket-name".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://bucket-name.s3.us-west-2.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3.us-west-2.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_64() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_global_endpoint(true)
.bucket("bucket-name".to_string())
.use_fips(true)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://bucket-name.s3-fips.us-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3-fips.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_65() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_global_endpoint(true)
.bucket("bucket-name".to_string())
.use_fips(false)
.use_dual_stack(true)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://bucket-name.s3.dualstack.us-east-1.amazonaws.com",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3.dualstack.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_66() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_global_endpoint(true)
.bucket("bucket-name".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://bucket-name.s3-accelerate.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3-accelerate.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_67() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.endpoint("https://example.com".to_string())
.use_global_endpoint(true)
.bucket("bucket-name".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.example.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.example.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_68() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.bucket("bucket-name".to_string())
.force_path_style(true)
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint =
endpoint.expect("Expected valid endpoint: https://s3.amazonaws.com/bucket-name");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.amazonaws.com/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_69() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.bucket("bucket-name".to_string())
.force_path_style(true)
.use_fips(true)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3-fips.us-east-1.amazonaws.com/bucket-name");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3-fips.us-east-1.amazonaws.com/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_70() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.bucket("bucket-name".to_string())
.force_path_style(true)
.use_fips(false)
.use_dual_stack(true)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://s3.dualstack.us-east-1.amazonaws.com/bucket-name",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.dualstack.us-east-1.amazonaws.com/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_71() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.endpoint("https://example.com".to_string())
.bucket("bucket-name".to_string())
.force_path_style(true)
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://example.com/bucket-name");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://example.com/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_72() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.bucket("bucket-name".to_string())
.use_global_endpoint(true)
.force_path_style(true)
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint =
endpoint.expect("Expected valid endpoint: https://s3.amazonaws.com/bucket-name");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.amazonaws.com/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_73() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.bucket("bucket-name".to_string())
.use_global_endpoint(true)
.force_path_style(true)
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3.us-west-2.amazonaws.com/bucket-name");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.us-west-2.amazonaws.com/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_74() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.bucket("bucket-name".to_string())
.use_global_endpoint(true)
.force_path_style(true)
.use_fips(false)
.use_dual_stack(true)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://s3.dualstack.us-east-1.amazonaws.com/bucket-name",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.dualstack.us-east-1.amazonaws.com/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_75() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.bucket("bucket-name".to_string())
.endpoint("https://example.com".to_string())
.use_global_endpoint(true)
.force_path_style(true)
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://example.com/bucket-name");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://example.com/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_76() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.use_arn_region(true)
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-01234567890123456/accesspoint/reports".to_string())
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://reports-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://reports-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3-outposts".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_77() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.bucket("arn:aws-cn:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap".to_string())
.region("us-west-1".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Client was configured for partition `aws` but bucket referred to partition `aws-cn` [cross partition MRAP ARN is an error]");
assert_eq!(
format!("{}", error),
"Client was configured for partition `aws` but bucket referred to partition `aws-cn`"
)
}
#[test]
fn test_78() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.endpoint("http://beta.example.com:1234".to_string())
.region("us-west-2".to_string())
.bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: http://myendpoint-123456789012.beta.example.com:1234",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("http://myendpoint-123456789012.beta.example.com:1234")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_79() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
.endpoint("http://beta.example.com:1234/path".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: http://myendpoint-123456789012.beta.example.com:1234/path",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("http://myendpoint-123456789012.beta.example.com:1234/path")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_80() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://bucket-name.s3.us-west-2.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3.us-west-2.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_81() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("us-west-2".to_string())
.use_dual_stack(true)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://bucket-name.s3.dualstack.us-west-2.amazonaws.com",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3.dualstack.us-west-2.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_82() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("us-west-2".to_string())
.use_dual_stack(true)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://bucket-name.s3-accelerate.dualstack.amazonaws.com",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3-accelerate.dualstack.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_83() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://bucket-name.s3-accelerate.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3-accelerate.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_84() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://bucket-name.s3-fips.us-west-2.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3-fips.us-west-2.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_85() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("us-west-2".to_string())
.use_dual_stack(true)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-fips.dualstack.us-west-2.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3-fips.dualstack.us-west-2.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_86() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Accelerate cannot be used with FIPS [accelerate + fips = error@us-west-2]");
assert_eq!(format!("{}", error), "Accelerate cannot be used with FIPS")
}
#[test]
fn test_87() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://bucket-name.s3.cn-north-1.amazonaws.com.cn");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3.cn-north-1.amazonaws.com.cn")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_88() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("cn-north-1".to_string())
.use_dual_stack(true)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://bucket-name.s3.dualstack.cn-north-1.amazonaws.com.cn",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3.dualstack.cn-north-1.amazonaws.com.cn")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_89() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: S3 Accelerate cannot be used in this region [accelerate (dualstack=false)@cn-north-1]");
assert_eq!(
format!("{}", error),
"S3 Accelerate cannot be used in this region"
)
}
#[test]
fn test_90() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Partition does not support FIPS [virtual addressing + fips@cn-north-1]");
assert_eq!(format!("{}", error), "Partition does not support FIPS")
}
#[test]
fn test_91() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://bucket-name.s3.af-south-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3.af-south-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_92() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("af-south-1".to_string())
.use_dual_stack(true)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://bucket-name.s3.dualstack.af-south-1.amazonaws.com",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3.dualstack.af-south-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_93() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("af-south-1".to_string())
.use_dual_stack(true)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://bucket-name.s3-accelerate.dualstack.amazonaws.com",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3-accelerate.dualstack.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_94() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://bucket-name.s3-accelerate.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3-accelerate.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_95() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://bucket-name.s3-fips.af-south-1.amazonaws.com",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3-fips.af-south-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_96() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("af-south-1".to_string())
.use_dual_stack(true)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-fips.dualstack.af-south-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://bucket-name.s3-fips.dualstack.af-south-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_97() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("bucket-name".to_string())
.force_path_style(false)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Accelerate cannot be used with FIPS [accelerate + fips = error@af-south-1]");
assert_eq!(format!("{}", error), "Accelerate cannot be used with FIPS")
}
#[test]
fn test_98() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(true)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3.us-west-2.amazonaws.com/bucket-name");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.us-west-2.amazonaws.com/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_99() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket.with.dots".to_string())
.region("us-gov-west-1".to_string())
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://s3-fips.us-gov-west-1.amazonaws.com/bucket.with.dots",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3-fips.us-gov-west-1.amazonaws.com/bucket.with.dots")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert(
"signingRegion".to_string(),
"us-gov-west-1".to_string().into(),
);
out
})]
)
.build()
);
}
#[test]
fn test_100() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("bucket-name".to_string())
.force_path_style(true)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Path-style addressing cannot be used with S3 Accelerate [path style + accelerate = error@us-west-2]");
assert_eq!(
format!("{}", error),
"Path-style addressing cannot be used with S3 Accelerate"
)
}
#[test]
fn test_101() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(true)
.region("us-west-2".to_string())
.use_dual_stack(true)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://s3.dualstack.us-west-2.amazonaws.com/bucket-name",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.dualstack.us-west-2.amazonaws.com/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_102() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:PARTITION:s3-outposts:REGION:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
.force_path_style(true)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Path-style addressing cannot be used with ARN buckets [path style + arn is error@us-west-2]");
assert_eq!(
format!("{}", error),
"Path-style addressing cannot be used with ARN buckets"
)
}
#[test]
fn test_103() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("99a_b".to_string())
.force_path_style(true)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint =
endpoint.expect("Expected valid endpoint: https://s3.us-west-2.amazonaws.com/99a_b");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.us-west-2.amazonaws.com/99a_b")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_104() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("99a_b".to_string())
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint =
endpoint.expect("Expected valid endpoint: https://s3.us-west-2.amazonaws.com/99a_b");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.us-west-2.amazonaws.com/99a_b")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_105() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(true)
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3.cn-north-1.amazonaws.com.cn/bucket-name");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.cn-north-1.amazonaws.com.cn/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_106() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(true)
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://s3-fips.cn-north-1.amazonaws.com.cn/bucket-name",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3-fips.cn-north-1.amazonaws.com.cn/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_107() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("bucket-name".to_string())
.force_path_style(true)
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Path-style addressing cannot be used with S3 Accelerate [path style + accelerate = error@cn-north-1]");
assert_eq!(
format!("{}", error),
"Path-style addressing cannot be used with S3 Accelerate"
)
}
#[test]
fn test_108() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(true)
.region("cn-north-1".to_string())
.use_dual_stack(true)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://s3.dualstack.cn-north-1.amazonaws.com.cn/bucket-name",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.dualstack.cn-north-1.amazonaws.com.cn/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_109() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:PARTITION:s3-outposts:REGION:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
.force_path_style(true)
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Path-style addressing cannot be used with ARN buckets [path style + arn is error@cn-north-1]");
assert_eq!(
format!("{}", error),
"Path-style addressing cannot be used with ARN buckets"
)
}
#[test]
fn test_110() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("99a_b".to_string())
.force_path_style(true)
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3.cn-north-1.amazonaws.com.cn/99a_b");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.cn-north-1.amazonaws.com.cn/99a_b")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_111() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("99a_b".to_string())
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3.cn-north-1.amazonaws.com.cn/99a_b");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.cn-north-1.amazonaws.com.cn/99a_b")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_112() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(true)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3.af-south-1.amazonaws.com/bucket-name");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.af-south-1.amazonaws.com/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_113() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(true)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://s3-fips.af-south-1.amazonaws.com/bucket-name",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3-fips.af-south-1.amazonaws.com/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_114() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("bucket-name".to_string())
.force_path_style(true)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Path-style addressing cannot be used with S3 Accelerate [path style + accelerate = error@af-south-1]");
assert_eq!(
format!("{}", error),
"Path-style addressing cannot be used with S3 Accelerate"
)
}
#[test]
fn test_115() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(true)
.region("af-south-1".to_string())
.use_dual_stack(true)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://s3.dualstack.af-south-1.amazonaws.com/bucket-name",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.dualstack.af-south-1.amazonaws.com/bucket-name")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_116() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:PARTITION:s3-outposts:REGION:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
.force_path_style(true)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Path-style addressing cannot be used with ARN buckets [path style + arn is error@af-south-1]");
assert_eq!(
format!("{}", error),
"Path-style addressing cannot be used with ARN buckets"
)
}
#[test]
fn test_117() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("99a_b".to_string())
.force_path_style(true)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint =
endpoint.expect("Expected valid endpoint: https://s3.af-south-1.amazonaws.com/99a_b");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.af-south-1.amazonaws.com/99a_b")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_118() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("99a_b".to_string())
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint =
endpoint.expect("Expected valid endpoint: https://s3.af-south-1.amazonaws.com/99a_b");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3.af-south-1.amazonaws.com/99a_b")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_119() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.endpoint(
"http://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: http://bucket-name.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url(
"http://bucket-name.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com"
)
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_120() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(true)
.endpoint(
"https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})])
.build());
}
#[test]
fn test_121() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.endpoint(
"https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate [SDK::Host + FIPS@us-west-2]");
assert_eq!(
format!("{}", error),
"Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate"
)
}
#[test]
fn test_122() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.endpoint(
"https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("us-west-2".to_string())
.use_dual_stack(true)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate [SDK::Host + DualStack@us-west-2]");
assert_eq!(
format!("{}", error),
"Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate"
)
}
#[test]
fn test_123() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("bucket-name".to_string())
.force_path_style(false)
.endpoint(
"http://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate [SDK::HOST + accelerate@us-west-2]");
assert_eq!(
format!("{}", error),
"Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate"
)
}
#[test]
fn test_124() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.endpoint("https://beta.example.com".to_string())
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://myendpoint-123456789012.beta.example.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://myendpoint-123456789012.beta.example.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_125() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.endpoint(
"https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://bucket-name.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_126() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(true)
.endpoint(
"https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_127() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.endpoint(
"https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err(
"expected error: Partition does not support FIPS [SDK::Host + FIPS@cn-north-1]",
);
assert_eq!(format!("{}", error), "Partition does not support FIPS")
}
#[test]
fn test_128() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.endpoint(
"https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("cn-north-1".to_string())
.use_dual_stack(true)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate [SDK::Host + DualStack@cn-north-1]");
assert_eq!(
format!("{}", error),
"Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate"
)
}
#[test]
fn test_129() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("bucket-name".to_string())
.force_path_style(false)
.endpoint(
"https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: S3 Accelerate cannot be used in this region [SDK::HOST + accelerate@cn-north-1]");
assert_eq!(
format!("{}", error),
"S3 Accelerate cannot be used in this region"
)
}
#[test]
fn test_130() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.endpoint("https://beta.example.com".to_string())
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://myendpoint-123456789012.beta.example.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://myendpoint-123456789012.beta.example.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_131() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.endpoint(
"https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://bucket-name.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_132() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(true)
.endpoint(
"https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_133() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.endpoint(
"https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate [SDK::Host + FIPS@af-south-1]");
assert_eq!(
format!("{}", error),
"Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate"
)
}
#[test]
fn test_134() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("bucket-name".to_string())
.force_path_style(false)
.endpoint(
"https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("af-south-1".to_string())
.use_dual_stack(true)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate [SDK::Host + DualStack@af-south-1]");
assert_eq!(
format!("{}", error),
"Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate"
)
}
#[test]
fn test_135() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("bucket-name".to_string())
.force_path_style(false)
.endpoint(
"https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string(),
)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate [SDK::HOST + accelerate@af-south-1]");
assert_eq!(
format!("{}", error),
"Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate"
)
}
#[test]
fn test_136() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3:af-south-1:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.endpoint("https://beta.example.com".to_string())
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://myendpoint-123456789012.beta.example.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://myendpoint-123456789012.beta.example.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_137() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_138() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint-fips.us-west-2.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://myendpoint-123456789012.s3-accesspoint-fips.us-west-2.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_139() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Access Points do not support S3 Accelerate [access point arn + accelerate = error@us-west-2]");
assert_eq!(
format!("{}", error),
"Access Points do not support S3 Accelerate"
)
}
#[test]
fn test_140() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.region("us-west-2".to_string())
.use_dual_stack(true)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint-fips.dualstack.us-west-2.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://myendpoint-123456789012.s3-accesspoint-fips.dualstack.us-west-2.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})])
.build());
}
#[test]
fn test_141() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint.cn-north-1.amazonaws.com.cn");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://myendpoint-123456789012.s3-accesspoint.cn-north-1.amazonaws.com.cn")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_142() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err(
"expected error: Partition does not support FIPS [access point arn + FIPS@cn-north-1]",
);
assert_eq!(format!("{}", error), "Partition does not support FIPS")
}
#[test]
fn test_143() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.region("cn-north-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Access Points do not support S3 Accelerate [access point arn + accelerate = error@cn-north-1]");
assert_eq!(
format!("{}", error),
"Access Points do not support S3 Accelerate"
)
}
#[test]
fn test_144() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.region("cn-north-1".to_string())
.use_dual_stack(true)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Partition does not support FIPS [access point arn + FIPS + DualStack@cn-north-1]");
assert_eq!(format!("{}", error), "Partition does not support FIPS")
}
#[test]
fn test_145() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3:af-south-1:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint.af-south-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://myendpoint-123456789012.s3-accesspoint.af-south-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_146() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3:af-south-1:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint-fips.af-south-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://myendpoint-123456789012.s3-accesspoint-fips.af-south-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_147() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.bucket("arn:aws:s3:af-south-1:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.region("af-south-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Access Points do not support S3 Accelerate [access point arn + accelerate = error@af-south-1]");
assert_eq!(
format!("{}", error),
"Access Points do not support S3 Accelerate"
)
}
#[test]
fn test_148() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3:af-south-1:123456789012:accesspoint:myendpoint".to_string())
.force_path_style(false)
.region("af-south-1".to_string())
.use_dual_stack(true)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint-fips.dualstack.af-south-1.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://myendpoint-123456789012.s3-accesspoint-fips.dualstack.af-south-1.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3".to_string().into());
out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_149() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost/op-01234567890123456/accesspoint/reports".to_string())
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://reports-123456789012.op-01234567890123456.s3-outposts.us-west-2.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://reports-123456789012.op-01234567890123456.s3-outposts.us-west-2.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3-outposts".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})])
.build());
}
#[test]
fn test_150() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost/op-01234567890123456/accesspoint/reports".to_string())
.endpoint("https://example.amazonaws.com".to_string())
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://reports-123456789012.op-01234567890123456.example.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://reports-123456789012.op-01234567890123456.example.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3-outposts".to_string().into());
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_151() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
.force_path_style(false)
.use_arn_region(false)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false` [outposts arn with region mismatch and UseArnRegion=false]");
assert_eq!(format!("{}", error), "Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false`")
}
#[test]
fn test_152() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
.endpoint("https://example.com".to_string())
.force_path_style(false)
.use_arn_region(false)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false` [outposts arn with region mismatch, custom region and UseArnRegion=false]");
assert_eq!(format!("{}", error), "Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false`")
}
#[test]
fn test_153() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
.force_path_style(false)
.use_arn_region(true)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://myaccesspoint-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://myaccesspoint-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3-outposts".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_154() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
.force_path_style(false)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://myaccesspoint-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://myaccesspoint-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3-outposts".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_155() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket("arn:aws:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
.force_path_style(false)
.use_arn_region(true)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Client was configured for partition `aws` but ARN (`arn:aws:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint`) has `aws-cn` [outposts arn with partition mismatch and UseArnRegion=true]");
assert_eq!(format!("{}", error), "Client was configured for partition `aws` but ARN (`arn:aws:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint`) has `aws-cn`")
}
#[test]
fn test_156() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_global_endpoint(true)
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-01234567890123456/accesspoint/reports".to_string())
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://reports-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://reports-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3-outposts".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_157() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_fips(false)
.use_dual_stack(true)
.accelerate(false)
.bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost/op-01234567890123456/accesspoint/reports".to_string())
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: S3 Outposts does not support Dual-stack [S3 outposts does not support dualstack]");
assert_eq!(
format!("{}", error),
"S3 Outposts does not support Dual-stack"
)
}
#[test]
fn test_158() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_fips(true)
.use_dual_stack(false)
.accelerate(false)
.bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost/op-01234567890123456/accesspoint/reports".to_string())
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err(
"expected error: S3 Outposts does not support FIPS [S3 outposts does not support fips]",
);
assert_eq!(format!("{}", error), "S3 Outposts does not support FIPS")
}
#[test]
fn test_159() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(true)
.bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost/op-01234567890123456/accesspoint/reports".to_string())
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: S3 Outposts does not support S3 Accelerate [S3 outposts does not support accelerate]");
assert_eq!(
format!("{}", error),
"S3 Outposts does not support S3 Accelerate"
)
}
#[test]
fn test_160() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:mybucket:object:foo".to_string())
.build().expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid Arn: Outpost Access Point ARN contains sub resources [validates against subresource]");
assert_eq!(
format!("{}", error),
"Invalid Arn: Outpost Access Point ARN contains sub resources"
)
}
#[test]
fn test_161() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(false)
.bucket(
"arn:aws:s3-object-lambda:us-east-1:123456789012:accesspoint/mybanner".to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert(
"signingName".to_string(),
"s3-object-lambda".to_string().into(),
);
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_162() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(false)
.bucket(
"arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint/mybanner".to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda.us-west-2.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://mybanner-123456789012.s3-object-lambda.us-west-2.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert(
"signingName".to_string(),
"s3-object-lambda".to_string().into(),
);
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_163() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(false)
.bucket(
"arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint:mybanner".to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda.us-west-2.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://mybanner-123456789012.s3-object-lambda.us-west-2.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert(
"signingName".to_string(),
"s3-object-lambda".to_string().into(),
);
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_164() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(true)
.bucket(
"arn:aws:s3-object-lambda:us-east-1:123456789012:accesspoint/mybanner".to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert(
"signingName".to_string(),
"s3-object-lambda".to_string().into(),
);
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_165() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("s3-external-1".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(true)
.bucket(
"arn:aws:s3-object-lambda:us-east-1:123456789012:accesspoint/mybanner".to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert(
"signingName".to_string(),
"s3-object-lambda".to_string().into(),
);
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_166() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("s3-external-1".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(false)
.bucket(
"arn:aws:s3-object-lambda:us-east-1:123456789012:accesspoint/mybanner".to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid configuration: region from ARN `us-east-1` does not match client region `s3-external-1` and UseArnRegion is `false` [object lambda @us-east-1, client region s3-external-1, useArnRegion=false]");
assert_eq!(format!("{}", error), "Invalid configuration: region from ARN `us-east-1` does not match client region `s3-external-1` and UseArnRegion is `false`")
}
#[test]
fn test_167() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(true)
.bucket(
"arn:aws:s3-object-lambda:us-east-1:123456789012:accesspoint/mybanner".to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert(
"signingName".to_string(),
"s3-object-lambda".to_string().into(),
);
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_168() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(false)
.bucket(
"arn:aws:s3-object-lambda:us-east-1:123456789012:accesspoint/mybanner".to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid configuration: region from ARN `us-east-1` does not match client region `aws-global` and UseArnRegion is `false` [object lambda @us-east-1, client region aws-global, useArnRegion=false]");
assert_eq!(format!("{}", error), "Invalid configuration: region from ARN `us-east-1` does not match client region `aws-global` and UseArnRegion is `false`")
}
#[test]
fn test_169() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("aws-global".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(true)
.bucket(
"arn:aws-cn:s3-object-lambda:cn-north-1:123456789012:accesspoint/mybanner"
.to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Client was configured for partition `aws` but ARN (`arn:aws-cn:s3-object-lambda:cn-north-1:123456789012:accesspoint/mybanner`) has `aws-cn` [object lambda @cn-north-1, client region us-west-2 (cross partition), useArnRegion=true]");
assert_eq!(format!("{}", error), "Client was configured for partition `aws` but ARN (`arn:aws-cn:s3-object-lambda:cn-north-1:123456789012:accesspoint/mybanner`) has `aws-cn`")
}
#[test]
fn test_170() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(true)
.accelerate(false)
.use_arn_region(false)
.bucket(
"arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint/mybanner".to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: S3 Object Lambda does not support Dual-stack [object lambda with dualstack]");
assert_eq!(
format!("{}", error),
"S3 Object Lambda does not support Dual-stack"
)
}
#[test]
fn test_171() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-gov-east-1".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(false)
.bucket(
"arn:aws-us-gov:s3-object-lambda:us-gov-east-1:123456789012:accesspoint/mybanner"
.to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda.us-gov-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://mybanner-123456789012.s3-object-lambda.us-gov-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert(
"signingName".to_string(),
"s3-object-lambda".to_string().into(),
);
out.insert(
"signingRegion".to_string(),
"us-gov-east-1".to_string().into(),
);
out
})]
)
.build()
);
}
#[test]
fn test_172() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-gov-east-1".to_string())
.use_fips(true)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(false)
.bucket(
"arn:aws-us-gov:s3-object-lambda:us-gov-east-1:123456789012:accesspoint/mybanner"
.to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda-fips.us-gov-east-1.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://mybanner-123456789012.s3-object-lambda-fips.us-gov-east-1.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3-object-lambda".to_string().into());
out.insert("signingRegion".to_string(), "us-gov-east-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_173() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("cn-north-1".to_string())
.use_fips(true)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(false)
.bucket(
"arn:aws-cn:s3-object-lambda:cn-north-1:123456789012:accesspoint/mybanner"
.to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Partition does not support FIPS [object lambda @cn-north-1, with fips]");
assert_eq!(format!("{}", error), "Partition does not support FIPS")
}
#[test]
fn test_174() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(true)
.use_arn_region(false)
.bucket(
"arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint/mybanner".to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: S3 Object Lambda does not support S3 Accelerate [object lambda with accelerate]");
assert_eq!(
format!("{}", error),
"S3 Object Lambda does not support S3 Accelerate"
)
}
#[test]
fn test_175() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(false)
.bucket("arn:aws:sqs:us-west-2:123456789012:someresource".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: Unrecognized format: arn:aws:sqs:us-west-2:123456789012:someresource (type: someresource) [object lambda with invalid arn - bad service and someresource]");
assert_eq!(format!("{}", error), "Invalid ARN: Unrecognized format: arn:aws:sqs:us-west-2:123456789012:someresource (type: someresource)")
}
#[test]
fn test_176() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(false)
.bucket(
"arn:aws:s3-object-lambda:us-west-2:123456789012:bucket_name:mybucket".to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `bucket_name` [object lambda with invalid arn - invalid resource]");
assert_eq!(format!("{}", error), "Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `bucket_name`")
}
#[test]
fn test_177() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(false)
.bucket("arn:aws:s3-object-lambda::123456789012:accesspoint/mybanner".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: bucket ARN is missing a region [object lambda with invalid arn - missing region]");
assert_eq!(
format!("{}", error),
"Invalid ARN: bucket ARN is missing a region"
)
}
#[test]
fn test_178() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(true)
.bucket("arn:aws:s3-object-lambda:us-west-2::accesspoint/mybanner".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: Missing account id [object lambda with invalid arn - missing account-id]");
assert_eq!(format!("{}", error), "Invalid ARN: Missing account id")
}
#[test]
fn test_179() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(true)
.bucket(
"arn:aws:s3-object-lambda:us-west-2:123.45678.9012:accesspoint:mybucket"
.to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `123.45678.9012` [object lambda with invalid arn - account id contains invalid characters]");
assert_eq!(format!("{}", error), "Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `123.45678.9012`")
}
#[test]
fn test_180() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(true)
.bucket("arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided [object lambda with invalid arn - missing access point name]");
assert_eq!(format!("{}", error), "Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided")
}
#[test]
fn test_181() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(true)
.bucket("arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint:*".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `*` [object lambda with invalid arn - access point name contains invalid character: *]");
assert_eq!(
format!("{}", error),
"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `*`"
)
}
#[test]
fn test_182() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(true)
.bucket(
"arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint:my.bucket".to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `my.bucket` [object lambda with invalid arn - access point name contains invalid character: .]");
assert_eq!(format!("{}", error), "Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `my.bucket`")
}
#[test]
fn test_183() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(true)
.bucket(
"arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint:mybucket:object:foo"
.to_string(),
)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: The ARN may only contain a single resource component after `accesspoint`. [object lambda with invalid arn - access point name contains sub resources]");
assert_eq!(format!("{}", error), "Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.")
}
#[test]
fn test_184() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-2".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.use_arn_region(false)
.bucket(
"arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint/mybanner".to_string(),
)
.endpoint("https://my-endpoint.com".to_string())
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://mybanner-123456789012.my-endpoint.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://mybanner-123456789012.my-endpoint.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert(
"signingName".to_string(),
"s3-object-lambda".to_string().into(),
);
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_185() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.bucket(
"arn:aws:s3-object-lambda:us-east-1:123456789012:accesspoint/mybanner".to_string(),
)
.force_path_style(false)
.use_arn_region(false)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false` [object lambda arn with region mismatch and UseArnRegion=false]");
assert_eq!(format!("{}", error), "Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false`")
}
#[test]
fn test_186() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.use_object_lambda_endpoint(true)
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3-object-lambda.us-west-2.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3-object-lambda.us-west-2.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert(
"signingName".to_string(),
"s3-object-lambda".to_string().into(),
);
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_187() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.use_object_lambda_endpoint(true)
.endpoint("https://my-endpoint.com".to_string())
.region("us-west-2".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://my-endpoint.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://my-endpoint.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert(
"signingName".to_string(),
"s3-object-lambda".to_string().into(),
);
out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_188() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.use_object_lambda_endpoint(true)
.region("us-east-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint
.expect("Expected valid endpoint: https://s3-object-lambda.us-east-1.amazonaws.com");
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3-object-lambda.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert(
"signingName".to_string(),
"s3-object-lambda".to_string().into(),
);
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_189() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.use_object_lambda_endpoint(true)
.region("us-east-1".to_string())
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://s3-object-lambda-fips.us-east-1.amazonaws.com",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3-object-lambda-fips.us-east-1.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert(
"signingName".to_string(),
"s3-object-lambda".to_string().into(),
);
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})]
)
.build()
);
}
#[test]
fn test_190() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.use_object_lambda_endpoint(true)
.region("us-east-1".to_string())
.use_dual_stack(true)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: S3 Object Lambda does not support Dual-stack [WriteGetObjectResponse with dualstack]");
assert_eq!(
format!("{}", error),
"S3 Object Lambda does not support Dual-stack"
)
}
#[test]
fn test_191() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(true)
.use_object_lambda_endpoint(true)
.region("us-east-1".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: S3 Object Lambda does not support S3 Accelerate [WriteGetObjectResponse with accelerate]");
assert_eq!(
format!("{}", error),
"S3 Object Lambda does not support S3 Accelerate"
)
}
#[test]
fn test_192() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.region("cn-north-1".to_string())
.use_object_lambda_endpoint(true)
.use_dual_stack(false)
.use_fips(true)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Partition does not support FIPS [WriteGetObjectResponse with fips in CN]");
assert_eq!(format!("{}", error), "Partition does not support FIPS")
}
#[test]
fn test_193() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.use_object_lambda_endpoint(true)
.region("not a valid DNS name".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid region: region was not a valid DNS name. [WriteGetObjectResponse with invalid partition]");
assert_eq!(
format!("{}", error),
"Invalid region: region was not a valid DNS name."
)
}
#[test]
fn test_194() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.accelerate(false)
.use_object_lambda_endpoint(true)
.region("us-east.special".to_string())
.use_dual_stack(false)
.use_fips(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect(
"Expected valid endpoint: https://s3-object-lambda.us-east.special.amazonaws.com",
);
assert_eq!(
endpoint,
aws_smithy_types::endpoint::Endpoint::builder()
.url("https://s3-object-lambda.us-east.special.amazonaws.com")
.property(
"authSchemes",
vec![aws_smithy_types::Document::from({
let mut out =
std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert(
"signingName".to_string(),
"s3-object-lambda".to_string().into(),
);
out.insert(
"signingRegion".to_string(),
"us-east.special".to_string().into(),
);
out
})]
)
.build()
);
}
#[test]
fn test_195() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-west-1".to_string())
.bucket("test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.op-0b1d075431d83bebd.s3-outposts.us-west-1.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.op-0b1d075431d83bebd.s3-outposts.us-west-1.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3-outposts".to_string().into());
out.insert("signingRegion".to_string(), "us-west-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_196() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("ap-east-1".to_string())
.bucket("test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.op-0b1d075431d83bebd.s3-outposts.ap-east-1.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.op-0b1d075431d83bebd.s3-outposts.ap-east-1.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3-outposts".to_string().into());
out.insert("signingRegion".to_string(), "ap-east-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_197() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.bucket("test-accessp-e0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://test-accessp-e0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.ec2.s3-outposts.us-east-1.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://test-accessp-e0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.ec2.s3-outposts.us-east-1.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3-outposts".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_198() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("me-south-1".to_string())
.bucket("test-accessp-e0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://test-accessp-e0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.ec2.s3-outposts.me-south-1.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://test-accessp-e0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.ec2.s3-outposts.me-south-1.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3-outposts".to_string().into());
out.insert("signingRegion".to_string(), "me-south-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_199() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.bucket("test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kbeta0--op-s3".to_string())
.endpoint("https://example.amazonaws.com".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kbeta0--op-s3.op-0b1d075431d83bebd.example.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kbeta0--op-s3.op-0b1d075431d83bebd.example.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3-outposts".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_200() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.bucket("161743052723-e00000136899934034jeahy1t8gpzpbwjj8kb7beta0--op-s3".to_string())
.endpoint("https://example.amazonaws.com".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let endpoint = endpoint.expect("Expected valid endpoint: https://161743052723-e00000136899934034jeahy1t8gpzpbwjj8kb7beta0--op-s3.ec2.example.amazonaws.com");
assert_eq!(endpoint, aws_smithy_types::endpoint::Endpoint::builder().url("https://161743052723-e00000136899934034jeahy1t8gpzpbwjj8kb7beta0--op-s3.ec2.example.amazonaws.com")
.property("authSchemes", vec![aws_smithy_types::Document::from( {
let mut out = std::collections::HashMap::<String, aws_smithy_types::Document>::new();
out.insert("disableDoubleEncoding".to_string(), true.into());
out.insert("name".to_string(), "sigv4".to_string().into());
out.insert("signingName".to_string(), "s3-outposts".to_string().into());
out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
out
})])
.build());
}
#[test]
fn test_201() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.bucket("test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kbeta0--op-s3".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Expected a endpoint to be specified but no endpoint was found [S3 Outposts Abba - No endpoint set for beta]");
assert_eq!(
format!("{}", error),
"Expected a endpoint to be specified but no endpoint was found"
)
}
#[test]
fn test_202() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.bucket("test-accessp-h0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Unrecognized hardware type: \"Expected hardware type o or e but got h\" [S3 Outposts Abba Invalid hardware type]");
assert_eq!(
format!("{}", error),
"Unrecognized hardware type: \"Expected hardware type o or e but got h\""
)
}
#[test]
fn test_203() {
use aws_smithy_http::endpoint::ResolveEndpoint;
let params = crate::endpoint::Params::builder()
.region("us-east-1".to_string())
.bucket("test-accessp-o00000754%1d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3".to_string())
.use_fips(false)
.use_dual_stack(false)
.accelerate(false)
.build()
.expect("invalid params");
let resolver = crate::endpoint::DefaultResolver::new();
let endpoint = resolver.resolve_endpoint(¶ms);
let error = endpoint.expect_err("expected error: Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`. [S3 Outposts Abba Special character in Outpost Arn]");
assert_eq!(
format!("{}", error),
"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`."
)
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Params {
pub(crate) bucket: std::option::Option<std::string::String>,
pub(crate) region: std::option::Option<std::string::String>,
pub(crate) use_fips: bool,
pub(crate) use_dual_stack: bool,
pub(crate) endpoint: std::option::Option<std::string::String>,
pub(crate) force_path_style: std::option::Option<bool>,
pub(crate) accelerate: bool,
pub(crate) use_global_endpoint: bool,
pub(crate) use_object_lambda_endpoint: std::option::Option<bool>,
pub(crate) disable_access_points: std::option::Option<bool>,
pub(crate) disable_multi_region_access_points: bool,
pub(crate) use_arn_region: std::option::Option<bool>,
}
impl Params {
pub fn builder() -> crate::endpoint::ParamsBuilder {
crate::endpoint::ParamsBuilder::default()
}
pub fn bucket(&self) -> std::option::Option<&str> {
self.bucket.as_deref()
}
pub fn region(&self) -> std::option::Option<&str> {
self.region.as_deref()
}
pub fn use_fips(&self) -> std::option::Option<bool> {
Some(self.use_fips)
}
pub fn use_dual_stack(&self) -> std::option::Option<bool> {
Some(self.use_dual_stack)
}
pub fn endpoint(&self) -> std::option::Option<&str> {
self.endpoint.as_deref()
}
pub fn force_path_style(&self) -> std::option::Option<bool> {
self.force_path_style
}
pub fn accelerate(&self) -> std::option::Option<bool> {
Some(self.accelerate)
}
pub fn use_global_endpoint(&self) -> std::option::Option<bool> {
Some(self.use_global_endpoint)
}
pub fn use_object_lambda_endpoint(&self) -> std::option::Option<bool> {
self.use_object_lambda_endpoint
}
pub fn disable_access_points(&self) -> std::option::Option<bool> {
self.disable_access_points
}
pub fn disable_multi_region_access_points(&self) -> std::option::Option<bool> {
Some(self.disable_multi_region_access_points)
}
pub fn use_arn_region(&self) -> std::option::Option<bool> {
self.use_arn_region
}
}
#[derive(Default)]
pub struct DefaultResolver {
partition_resolver: crate::endpoint_lib::partition::PartitionResolver,
}
impl DefaultResolver {
pub fn new() -> Self {
Self { partition_resolver: crate::endpoint_lib::partition::PartitionResolver::new_from_json(b"{\"version\":\"1.1\",\"partitions\":[{\"id\":\"aws\",\"regionRegex\":\"^(us|eu|ap|sa|ca|me|af)-\\\\w+-\\\\d+$\",\"regions\":{\"af-south-1\":{},\"ap-east-1\":{},\"ap-northeast-1\":{},\"ap-northeast-2\":{},\"ap-northeast-3\":{},\"ap-south-1\":{},\"ap-southeast-1\":{},\"ap-southeast-2\":{},\"ap-southeast-3\":{},\"ca-central-1\":{},\"eu-central-1\":{},\"eu-north-1\":{},\"eu-south-1\":{},\"eu-west-1\":{},\"eu-west-2\":{},\"eu-west-3\":{},\"me-central-1\":{},\"me-south-1\":{},\"sa-east-1\":{},\"us-east-1\":{},\"us-east-2\":{},\"us-west-1\":{},\"us-west-2\":{},\"aws-global\":{}},\"outputs\":{\"name\":\"aws\",\"dnsSuffix\":\"amazonaws.com\",\"dualStackDnsSuffix\":\"api.aws\",\"supportsFIPS\":true,\"supportsDualStack\":true}},{\"id\":\"aws-us-gov\",\"regionRegex\":\"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{\"us-gov-west-1\":{},\"us-gov-east-1\":{},\"aws-us-gov-global\":{}},\"outputs\":{\"name\":\"aws-us-gov\",\"dnsSuffix\":\"amazonaws.com\",\"dualStackDnsSuffix\":\"api.aws\",\"supportsFIPS\":true,\"supportsDualStack\":true}},{\"id\":\"aws-cn\",\"regionRegex\":\"^cn\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{\"cn-north-1\":{},\"cn-northwest-1\":{},\"aws-cn-global\":{}},\"outputs\":{\"name\":\"aws-cn\",\"dnsSuffix\":\"amazonaws.com.cn\",\"dualStackDnsSuffix\":\"api.amazonwebservices.com.cn\",\"supportsFIPS\":true,\"supportsDualStack\":true}},{\"id\":\"aws-iso\",\"regionRegex\":\"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$\",\"outputs\":{\"name\":\"aws-iso\",\"dnsSuffix\":\"c2s.ic.gov\",\"supportsFIPS\":true,\"supportsDualStack\":false,\"dualStackDnsSuffix\":\"c2s.ic.gov\"},\"regions\":{\"us-iso-east-1\":{},\"us-iso-west-1\":{},\"aws-iso-global\":{}}},{\"id\":\"aws-iso-b\",\"regionRegex\":\"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$\",\"outputs\":{\"name\":\"aws-iso-b\",\"dnsSuffix\":\"sc2s.sgov.gov\",\"supportsFIPS\":true,\"supportsDualStack\":false,\"dualStackDnsSuffix\":\"sc2s.sgov.gov\"},\"regions\":{\"us-isob-east-1\":{},\"aws-iso-b-global\":{}}}]}").expect("valid JSON") }
}
}
impl aws_smithy_http::endpoint::ResolveEndpoint<crate::endpoint::Params> for DefaultResolver {
fn resolve_endpoint(&self, params: &Params) -> aws_smithy_http::endpoint::Result {
let mut diagnostic_collector = crate::endpoint_lib::diagnostic::DiagnosticCollector::new();
crate::endpoint::internals::resolve_endpoint(
params,
&mut diagnostic_collector,
&self.partition_resolver,
)
.map_err(|err| err.with_source(diagnostic_collector.take_last_error()))
}
}
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct ParamsBuilder {
bucket: std::option::Option<std::string::String>,
region: std::option::Option<std::string::String>,
use_fips: std::option::Option<bool>,
use_dual_stack: std::option::Option<bool>,
endpoint: std::option::Option<std::string::String>,
force_path_style: std::option::Option<bool>,
accelerate: std::option::Option<bool>,
use_global_endpoint: std::option::Option<bool>,
use_object_lambda_endpoint: std::option::Option<bool>,
disable_access_points: std::option::Option<bool>,
disable_multi_region_access_points: std::option::Option<bool>,
use_arn_region: std::option::Option<bool>,
}
impl ParamsBuilder {
pub fn build(self) -> Result<crate::endpoint::Params, crate::endpoint::InvalidParams> {
Ok(
#[allow(clippy::unnecessary_lazy_evaluations)]
crate::endpoint::Params {
bucket: self.bucket,
region: self.region,
use_fips: self
.use_fips
.or_else(|| Some(false))
.ok_or_else(|| crate::endpoint::InvalidParams::missing("use_fips"))?,
use_dual_stack: self
.use_dual_stack
.or_else(|| Some(false))
.ok_or_else(|| crate::endpoint::InvalidParams::missing("use_dual_stack"))?,
endpoint: self.endpoint,
force_path_style: self.force_path_style,
accelerate: self
.accelerate
.or_else(|| Some(false))
.ok_or_else(|| crate::endpoint::InvalidParams::missing("accelerate"))?,
use_global_endpoint: self
.use_global_endpoint
.or_else(|| Some(false))
.ok_or_else(|| {
crate::endpoint::InvalidParams::missing("use_global_endpoint")
})?,
use_object_lambda_endpoint: self.use_object_lambda_endpoint,
disable_access_points: self.disable_access_points,
disable_multi_region_access_points: self
.disable_multi_region_access_points
.or_else(|| Some(false))
.ok_or_else(|| {
crate::endpoint::InvalidParams::missing(
"disable_multi_region_access_points",
)
})?,
use_arn_region: self.use_arn_region,
},
)
}
pub fn bucket(mut self, value: impl Into<std::string::String>) -> Self {
self.bucket = Some(value.into());
self
}
pub fn set_bucket(mut self, param: Option<std::string::String>) -> Self {
self.bucket = param;
self
}
pub fn region(mut self, value: impl Into<std::string::String>) -> Self {
self.region = Some(value.into());
self
}
pub fn set_region(mut self, param: Option<std::string::String>) -> Self {
self.region = param;
self
}
pub fn use_fips(mut self, value: impl Into<bool>) -> Self {
self.use_fips = Some(value.into());
self
}
pub fn set_use_fips(mut self, param: Option<bool>) -> Self {
self.use_fips = param;
self
}
pub fn use_dual_stack(mut self, value: impl Into<bool>) -> Self {
self.use_dual_stack = Some(value.into());
self
}
pub fn set_use_dual_stack(mut self, param: Option<bool>) -> Self {
self.use_dual_stack = param;
self
}
pub fn endpoint(mut self, value: impl Into<std::string::String>) -> Self {
self.endpoint = Some(value.into());
self
}
pub fn set_endpoint(mut self, param: Option<std::string::String>) -> Self {
self.endpoint = param;
self
}
pub fn force_path_style(mut self, value: impl Into<bool>) -> Self {
self.force_path_style = Some(value.into());
self
}
pub fn set_force_path_style(mut self, param: Option<bool>) -> Self {
self.force_path_style = param;
self
}
pub fn accelerate(mut self, value: impl Into<bool>) -> Self {
self.accelerate = Some(value.into());
self
}
pub fn set_accelerate(mut self, param: Option<bool>) -> Self {
self.accelerate = param;
self
}
pub fn use_global_endpoint(mut self, value: impl Into<bool>) -> Self {
self.use_global_endpoint = Some(value.into());
self
}
pub fn set_use_global_endpoint(mut self, param: Option<bool>) -> Self {
self.use_global_endpoint = param;
self
}
pub fn use_object_lambda_endpoint(mut self, value: impl Into<bool>) -> Self {
self.use_object_lambda_endpoint = Some(value.into());
self
}
pub fn set_use_object_lambda_endpoint(mut self, param: Option<bool>) -> Self {
self.use_object_lambda_endpoint = param;
self
}
pub fn disable_access_points(mut self, value: impl Into<bool>) -> Self {
self.disable_access_points = Some(value.into());
self
}
pub fn set_disable_access_points(mut self, param: Option<bool>) -> Self {
self.disable_access_points = param;
self
}
pub fn disable_multi_region_access_points(mut self, value: impl Into<bool>) -> Self {
self.disable_multi_region_access_points = Some(value.into());
self
}
pub fn set_disable_multi_region_access_points(mut self, param: Option<bool>) -> Self {
self.disable_multi_region_access_points = param;
self
}
pub fn use_arn_region(mut self, value: impl Into<bool>) -> Self {
self.use_arn_region = Some(value.into());
self
}
pub fn set_use_arn_region(mut self, param: Option<bool>) -> Self {
self.use_arn_region = param;
self
}
}
#[derive(Debug)]
pub struct InvalidParams {
field: std::borrow::Cow<'static, str>,
}
impl InvalidParams {
#[allow(dead_code)]
fn missing(field: &'static str) -> Self {
Self {
field: field.into(),
}
}
}
impl std::fmt::Display for InvalidParams {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "a required field was missing: `{}`", self.field)
}
}
impl std::error::Error for InvalidParams {}
mod internals;