aws_sdk_s3control/config/
endpoint.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use ::aws_smithy_runtime_api::client::endpoint::EndpointFuture;
3pub use ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver;
4pub use ::aws_smithy_types::endpoint::Endpoint;
5
6#[cfg(test)]
7mod test {
8
9    /// Vanilla outposts without ARN region + access point ARN@us-west-2
10    #[test]
11    fn test_1() {
12        let params = crate::config::endpoint::Params::builder()
13            .access_point_name("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
14            .account_id("123456789012".to_string())
15            .region("us-west-2".to_string())
16            .requires_account_id(true)
17            .use_dual_stack(false)
18            .use_fips(false)
19            .build()
20            .expect("invalid params");
21        let resolver = crate::config::endpoint::DefaultResolver::new();
22        let endpoint = resolver.resolve_endpoint(&params);
23        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-west-2.amazonaws.com");
24        assert_eq!(
25            endpoint,
26            ::aws_smithy_types::endpoint::Endpoint::builder()
27                .url("https://s3-outposts.us-west-2.amazonaws.com")
28                .header("x-amz-account-id", "123456789012")
29                .header("x-amz-outpost-id", "op-01234567890123456")
30                .property(
31                    "authSchemes",
32                    vec![{
33                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
34                        out.insert("name".to_string(), "sigv4".to_string().into());
35                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
36                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
37                        out.insert("disableDoubleEncoding".to_string(), true.into());
38                        out
39                    }
40                    .into()]
41                )
42                .build()
43        );
44    }
45
46    /// Vanilla outposts with ARN region + access point ARN@us-west-2
47    #[test]
48    fn test_2() {
49        let params = crate::config::endpoint::Params::builder()
50            .access_point_name("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
51            .account_id("123456789012".to_string())
52            .region("us-west-2".to_string())
53            .requires_account_id(true)
54            .use_dual_stack(false)
55            .use_fips(false)
56            .build()
57            .expect("invalid params");
58        let resolver = crate::config::endpoint::DefaultResolver::new();
59        let endpoint = resolver.resolve_endpoint(&params);
60        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-east-1.amazonaws.com");
61        assert_eq!(
62            endpoint,
63            ::aws_smithy_types::endpoint::Endpoint::builder()
64                .url("https://s3-outposts.us-east-1.amazonaws.com")
65                .header("x-amz-account-id", "123456789012")
66                .header("x-amz-outpost-id", "op-01234567890123456")
67                .property(
68                    "authSchemes",
69                    vec![{
70                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
71                        out.insert("name".to_string(), "sigv4".to_string().into());
72                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
73                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
74                        out.insert("disableDoubleEncoding".to_string(), true.into());
75                        out
76                    }
77                    .into()]
78                )
79                .build()
80        );
81    }
82
83    /// accept an access point ARN@us-west-2
84    #[test]
85    fn test_3() {
86        let params = crate::config::endpoint::Params::builder()
87            .access_point_name("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
88            .account_id("123456789012".to_string())
89            .region("us-west-2".to_string())
90            .requires_account_id(true)
91            .use_dual_stack(false)
92            .use_fips(false)
93            .build()
94            .expect("invalid params");
95        let resolver = crate::config::endpoint::DefaultResolver::new();
96        let endpoint = resolver.resolve_endpoint(&params);
97        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-west-2.amazonaws.com");
98        assert_eq!(
99            endpoint,
100            ::aws_smithy_types::endpoint::Endpoint::builder()
101                .url("https://s3-outposts.us-west-2.amazonaws.com")
102                .header("x-amz-account-id", "123456789012")
103                .header("x-amz-outpost-id", "op-01234567890123456")
104                .property(
105                    "authSchemes",
106                    vec![{
107                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
108                        out.insert("name".to_string(), "sigv4".to_string().into());
109                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
110                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
111                        out.insert("disableDoubleEncoding".to_string(), true.into());
112                        out
113                    }
114                    .into()]
115                )
116                .build()
117        );
118    }
119
120    /// vanilla outposts china@cn-north-1
121    #[test]
122    fn test_4() {
123        let params = crate::config::endpoint::Params::builder()
124            .access_point_name("arn:aws-cn:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
125            .account_id("123456789012".to_string())
126            .region("cn-north-1".to_string())
127            .requires_account_id(true)
128            .use_dual_stack(false)
129            .use_fips(false)
130            .build()
131            .expect("invalid params");
132        let resolver = crate::config::endpoint::DefaultResolver::new();
133        let endpoint = resolver.resolve_endpoint(&params);
134        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.cn-north-1.amazonaws.com.cn");
135        assert_eq!(
136            endpoint,
137            ::aws_smithy_types::endpoint::Endpoint::builder()
138                .url("https://s3-outposts.cn-north-1.amazonaws.com.cn")
139                .header("x-amz-account-id", "123456789012")
140                .header("x-amz-outpost-id", "op-01234567890123456")
141                .property(
142                    "authSchemes",
143                    vec![{
144                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
145                        out.insert("name".to_string(), "sigv4".to_string().into());
146                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
147                        out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
148                        out.insert("disableDoubleEncoding".to_string(), true.into());
149                        out
150                    }
151                    .into()]
152                )
153                .build()
154        );
155    }
156
157    /// gov region@us-west-2
158    #[test]
159    fn test_5() {
160        let params = crate::config::endpoint::Params::builder()
161            .access_point_name("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
162            .account_id("123456789012".to_string())
163            .region("us-west-2".to_string())
164            .requires_account_id(true)
165            .use_dual_stack(false)
166            .use_fips(false)
167            .build()
168            .expect("invalid params");
169        let resolver = crate::config::endpoint::DefaultResolver::new();
170        let endpoint = resolver.resolve_endpoint(&params);
171        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-west-2.amazonaws.com");
172        assert_eq!(
173            endpoint,
174            ::aws_smithy_types::endpoint::Endpoint::builder()
175                .url("https://s3-outposts.us-west-2.amazonaws.com")
176                .header("x-amz-account-id", "123456789012")
177                .header("x-amz-outpost-id", "op-01234567890123456")
178                .property(
179                    "authSchemes",
180                    vec![{
181                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
182                        out.insert("name".to_string(), "sigv4".to_string().into());
183                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
184                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
185                        out.insert("disableDoubleEncoding".to_string(), true.into());
186                        out
187                    }
188                    .into()]
189                )
190                .build()
191        );
192    }
193
194    /// gov cloud with fips@us-west-2
195    #[test]
196    fn test_6() {
197        let params = crate::config::endpoint::Params::builder()
198            .access_point_name("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
199            .account_id("123456789012".to_string())
200            .region("us-west-2".to_string())
201            .requires_account_id(true)
202            .use_dual_stack(false)
203            .use_fips(true)
204            .build()
205            .expect("invalid params");
206        let resolver = crate::config::endpoint::DefaultResolver::new();
207        let endpoint = resolver.resolve_endpoint(&params);
208        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.us-west-2.amazonaws.com");
209        assert_eq!(
210            endpoint,
211            ::aws_smithy_types::endpoint::Endpoint::builder()
212                .url("https://s3-outposts-fips.us-west-2.amazonaws.com")
213                .header("x-amz-account-id", "123456789012")
214                .header("x-amz-outpost-id", "op-01234567890123456")
215                .property(
216                    "authSchemes",
217                    vec![{
218                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
219                        out.insert("name".to_string(), "sigv4".to_string().into());
220                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
221                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
222                        out.insert("disableDoubleEncoding".to_string(), true.into());
223                        out
224                    }
225                    .into()]
226                )
227                .build()
228        );
229    }
230
231    /// govcloud with fips + arn region@us-gov-west-1
232    #[test]
233    fn test_7() {
234        let params = crate::config::endpoint::Params::builder()
235            .access_point_name(
236                "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string(),
237            )
238            .account_id("123456789012".to_string())
239            .region("us-gov-west-1".to_string())
240            .requires_account_id(true)
241            .use_dual_stack(false)
242            .use_fips(true)
243            .build()
244            .expect("invalid params");
245        let resolver = crate::config::endpoint::DefaultResolver::new();
246        let endpoint = resolver.resolve_endpoint(&params);
247        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.us-gov-east-1.amazonaws.com");
248        assert_eq!(
249            endpoint,
250            ::aws_smithy_types::endpoint::Endpoint::builder()
251                .url("https://s3-outposts-fips.us-gov-east-1.amazonaws.com")
252                .header("x-amz-account-id", "123456789012")
253                .header("x-amz-outpost-id", "op-01234567890123456")
254                .property(
255                    "authSchemes",
256                    vec![{
257                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
258                        out.insert("name".to_string(), "sigv4".to_string().into());
259                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
260                        out.insert("signingRegion".to_string(), "us-gov-east-1".to_string().into());
261                        out.insert("disableDoubleEncoding".to_string(), true.into());
262                        out
263                    }
264                    .into()]
265                )
266                .build()
267        );
268    }
269
270    /// gov region@cn-north-1
271    #[test]
272    fn test_8() {
273        let params = crate::config::endpoint::Params::builder()
274            .access_point_name("arn:aws-cn:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
275            .account_id("123456789012".to_string())
276            .region("cn-north-1".to_string())
277            .requires_account_id(true)
278            .use_dual_stack(false)
279            .use_fips(false)
280            .build()
281            .expect("invalid params");
282        let resolver = crate::config::endpoint::DefaultResolver::new();
283        let endpoint = resolver.resolve_endpoint(&params);
284        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.cn-north-1.amazonaws.com.cn");
285        assert_eq!(
286            endpoint,
287            ::aws_smithy_types::endpoint::Endpoint::builder()
288                .url("https://s3-outposts.cn-north-1.amazonaws.com.cn")
289                .header("x-amz-account-id", "123456789012")
290                .header("x-amz-outpost-id", "op-01234567890123456")
291                .property(
292                    "authSchemes",
293                    vec![{
294                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
295                        out.insert("name".to_string(), "sigv4".to_string().into());
296                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
297                        out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
298                        out.insert("disableDoubleEncoding".to_string(), true.into());
299                        out
300                    }
301                    .into()]
302                )
303                .build()
304        );
305    }
306
307    /// gov cloud with fips@cn-north-1
308    #[test]
309    fn test_9() {
310        let params = crate::config::endpoint::Params::builder()
311            .access_point_name("arn:aws-cn:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
312            .account_id("123456789012".to_string())
313            .region("cn-north-1".to_string())
314            .requires_account_id(true)
315            .use_dual_stack(false)
316            .use_fips(true)
317            .build()
318            .expect("invalid params");
319        let resolver = crate::config::endpoint::DefaultResolver::new();
320        let endpoint = resolver.resolve_endpoint(&params);
321        let error = endpoint.expect_err("expected error: Partition does not support FIPS [gov cloud with fips@cn-north-1]");
322        assert_eq!(format!("{}", error), "Partition does not support FIPS")
323    }
324
325    /// govcloud with fips + arn region@us-gov-west-1
326    #[test]
327    fn test_10() {
328        let params = crate::config::endpoint::Params::builder()
329            .access_point_name(
330                "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string(),
331            )
332            .account_id("123456789012".to_string())
333            .region("us-gov-west-1".to_string())
334            .requires_account_id(true)
335            .use_dual_stack(false)
336            .use_fips(true)
337            .build()
338            .expect("invalid params");
339        let resolver = crate::config::endpoint::DefaultResolver::new();
340        let endpoint = resolver.resolve_endpoint(&params);
341        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.us-gov-east-1.amazonaws.com");
342        assert_eq!(
343            endpoint,
344            ::aws_smithy_types::endpoint::Endpoint::builder()
345                .url("https://s3-outposts-fips.us-gov-east-1.amazonaws.com")
346                .header("x-amz-account-id", "123456789012")
347                .header("x-amz-outpost-id", "op-01234567890123456")
348                .property(
349                    "authSchemes",
350                    vec![{
351                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
352                        out.insert("name".to_string(), "sigv4".to_string().into());
353                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
354                        out.insert("signingRegion".to_string(), "us-gov-east-1".to_string().into());
355                        out.insert("disableDoubleEncoding".to_string(), true.into());
356                        out
357                    }
358                    .into()]
359                )
360                .build()
361        );
362    }
363
364    /// gov region@af-south-1
365    #[test]
366    fn test_11() {
367        let params = crate::config::endpoint::Params::builder()
368            .access_point_name("arn:aws:s3-outposts:af-south-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
369            .account_id("123456789012".to_string())
370            .region("af-south-1".to_string())
371            .requires_account_id(true)
372            .use_dual_stack(false)
373            .use_fips(false)
374            .build()
375            .expect("invalid params");
376        let resolver = crate::config::endpoint::DefaultResolver::new();
377        let endpoint = resolver.resolve_endpoint(&params);
378        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.af-south-1.amazonaws.com");
379        assert_eq!(
380            endpoint,
381            ::aws_smithy_types::endpoint::Endpoint::builder()
382                .url("https://s3-outposts.af-south-1.amazonaws.com")
383                .header("x-amz-account-id", "123456789012")
384                .header("x-amz-outpost-id", "op-01234567890123456")
385                .property(
386                    "authSchemes",
387                    vec![{
388                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
389                        out.insert("name".to_string(), "sigv4".to_string().into());
390                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
391                        out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
392                        out.insert("disableDoubleEncoding".to_string(), true.into());
393                        out
394                    }
395                    .into()]
396                )
397                .build()
398        );
399    }
400
401    /// gov cloud with fips@af-south-1
402    #[test]
403    fn test_12() {
404        let params = crate::config::endpoint::Params::builder()
405            .access_point_name("arn:aws:s3-outposts:af-south-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
406            .account_id("123456789012".to_string())
407            .region("af-south-1".to_string())
408            .requires_account_id(true)
409            .use_dual_stack(false)
410            .use_fips(true)
411            .build()
412            .expect("invalid params");
413        let resolver = crate::config::endpoint::DefaultResolver::new();
414        let endpoint = resolver.resolve_endpoint(&params);
415        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.af-south-1.amazonaws.com");
416        assert_eq!(
417            endpoint,
418            ::aws_smithy_types::endpoint::Endpoint::builder()
419                .url("https://s3-outposts-fips.af-south-1.amazonaws.com")
420                .header("x-amz-account-id", "123456789012")
421                .header("x-amz-outpost-id", "op-01234567890123456")
422                .property(
423                    "authSchemes",
424                    vec![{
425                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
426                        out.insert("name".to_string(), "sigv4".to_string().into());
427                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
428                        out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
429                        out.insert("disableDoubleEncoding".to_string(), true.into());
430                        out
431                    }
432                    .into()]
433                )
434                .build()
435        );
436    }
437
438    /// govcloud with fips + arn region@us-gov-west-1
439    #[test]
440    fn test_13() {
441        let params = crate::config::endpoint::Params::builder()
442            .access_point_name(
443                "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string(),
444            )
445            .account_id("123456789012".to_string())
446            .region("us-gov-west-1".to_string())
447            .requires_account_id(true)
448            .use_dual_stack(false)
449            .use_fips(true)
450            .build()
451            .expect("invalid params");
452        let resolver = crate::config::endpoint::DefaultResolver::new();
453        let endpoint = resolver.resolve_endpoint(&params);
454        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.us-gov-east-1.amazonaws.com");
455        assert_eq!(
456            endpoint,
457            ::aws_smithy_types::endpoint::Endpoint::builder()
458                .url("https://s3-outposts-fips.us-gov-east-1.amazonaws.com")
459                .header("x-amz-account-id", "123456789012")
460                .header("x-amz-outpost-id", "op-01234567890123456")
461                .property(
462                    "authSchemes",
463                    vec![{
464                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
465                        out.insert("name".to_string(), "sigv4".to_string().into());
466                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
467                        out.insert("signingRegion".to_string(), "us-gov-east-1".to_string().into());
468                        out.insert("disableDoubleEncoding".to_string(), true.into());
469                        out
470                    }
471                    .into()]
472                )
473                .build()
474        );
475    }
476
477    /// CreateBucket + OutpostId = outposts endpoint@us-east-2
478    #[test]
479    fn test_14() {
480        let params = crate::config::endpoint::Params::builder()
481            .bucket("blah".to_string())
482            .outpost_id("123".to_string())
483            .region("us-east-2".to_string())
484            .requires_account_id(false)
485            .use_dual_stack(false)
486            .use_fips(false)
487            .build()
488            .expect("invalid params");
489        let resolver = crate::config::endpoint::DefaultResolver::new();
490        let endpoint = resolver.resolve_endpoint(&params);
491        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-east-2.amazonaws.com");
492        assert_eq!(
493            endpoint,
494            ::aws_smithy_types::endpoint::Endpoint::builder()
495                .url("https://s3-outposts.us-east-2.amazonaws.com")
496                .property(
497                    "authSchemes",
498                    vec![{
499                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
500                        out.insert("name".to_string(), "sigv4".to_string().into());
501                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
502                        out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
503                        out.insert("disableDoubleEncoding".to_string(), true.into());
504                        out
505                    }
506                    .into()]
507                )
508                .build()
509        );
510    }
511
512    /// CreateBucket + OutpostId with fips = outposts endpoint@us-east-2
513    #[test]
514    fn test_15() {
515        let params = crate::config::endpoint::Params::builder()
516            .bucket("blah".to_string())
517            .outpost_id("123".to_string())
518            .region("us-east-2".to_string())
519            .requires_account_id(false)
520            .use_dual_stack(false)
521            .use_fips(true)
522            .build()
523            .expect("invalid params");
524        let resolver = crate::config::endpoint::DefaultResolver::new();
525        let endpoint = resolver.resolve_endpoint(&params);
526        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.us-east-2.amazonaws.com");
527        assert_eq!(
528            endpoint,
529            ::aws_smithy_types::endpoint::Endpoint::builder()
530                .url("https://s3-outposts-fips.us-east-2.amazonaws.com")
531                .property(
532                    "authSchemes",
533                    vec![{
534                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
535                        out.insert("name".to_string(), "sigv4".to_string().into());
536                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
537                        out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
538                        out.insert("disableDoubleEncoding".to_string(), true.into());
539                        out
540                    }
541                    .into()]
542                )
543                .build()
544        );
545    }
546
547    /// CreateBucket without OutpostId = regular endpoint@us-east-2
548    #[test]
549    fn test_16() {
550        let params = crate::config::endpoint::Params::builder()
551            .bucket("blah".to_string())
552            .region("us-east-2".to_string())
553            .requires_account_id(false)
554            .use_dual_stack(false)
555            .use_fips(false)
556            .build()
557            .expect("invalid params");
558        let resolver = crate::config::endpoint::DefaultResolver::new();
559        let endpoint = resolver.resolve_endpoint(&params);
560        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-control.us-east-2.amazonaws.com");
561        assert_eq!(
562            endpoint,
563            ::aws_smithy_types::endpoint::Endpoint::builder()
564                .url("https://s3-control.us-east-2.amazonaws.com")
565                .property(
566                    "authSchemes",
567                    vec![{
568                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
569                        out.insert("name".to_string(), "sigv4".to_string().into());
570                        out.insert("signingName".to_string(), "s3".to_string().into());
571                        out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
572                        out.insert("disableDoubleEncoding".to_string(), true.into());
573                        out
574                    }
575                    .into()]
576                )
577                .build()
578        );
579    }
580
581    /// ListRegionalBuckets + OutpostId = outposts endpoint@us-east-2
582    #[test]
583    fn test_17() {
584        let params = crate::config::endpoint::Params::builder()
585            .account_id("123456789012".to_string())
586            .outpost_id("op-123".to_string())
587            .region("us-east-2".to_string())
588            .requires_account_id(true)
589            .use_dual_stack(false)
590            .use_fips(false)
591            .build()
592            .expect("invalid params");
593        let resolver = crate::config::endpoint::DefaultResolver::new();
594        let endpoint = resolver.resolve_endpoint(&params);
595        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-east-2.amazonaws.com");
596        assert_eq!(
597            endpoint,
598            ::aws_smithy_types::endpoint::Endpoint::builder()
599                .url("https://s3-outposts.us-east-2.amazonaws.com")
600                .property(
601                    "authSchemes",
602                    vec![{
603                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
604                        out.insert("name".to_string(), "sigv4".to_string().into());
605                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
606                        out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
607                        out.insert("disableDoubleEncoding".to_string(), true.into());
608                        out
609                    }
610                    .into()]
611                )
612                .build()
613        );
614    }
615
616    /// ListRegionalBuckets without OutpostId = regular endpoint@us-east-2
617    #[test]
618    fn test_18() {
619        let params = crate::config::endpoint::Params::builder()
620            .account_id("123456789012".to_string())
621            .region("us-east-2".to_string())
622            .requires_account_id(true)
623            .use_dual_stack(false)
624            .use_fips(false)
625            .build()
626            .expect("invalid params");
627        let resolver = crate::config::endpoint::DefaultResolver::new();
628        let endpoint = resolver.resolve_endpoint(&params);
629        let endpoint = endpoint.expect("Expected valid endpoint: https://123456789012.s3-control.us-east-2.amazonaws.com");
630        assert_eq!(
631            endpoint,
632            ::aws_smithy_types::endpoint::Endpoint::builder()
633                .url("https://123456789012.s3-control.us-east-2.amazonaws.com")
634                .property(
635                    "authSchemes",
636                    vec![{
637                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
638                        out.insert("name".to_string(), "sigv4".to_string().into());
639                        out.insert("signingName".to_string(), "s3".to_string().into());
640                        out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
641                        out.insert("disableDoubleEncoding".to_string(), true.into());
642                        out
643                    }
644                    .into()]
645                )
646                .build()
647        );
648    }
649
650    /// ListRegionalBucket + OutpostId with fips = outposts endpoint@us-east-2
651    #[test]
652    fn test_19() {
653        let params = crate::config::endpoint::Params::builder()
654            .account_id("123456789012".to_string())
655            .outpost_id("op-123".to_string())
656            .region("us-east-2".to_string())
657            .requires_account_id(true)
658            .use_dual_stack(false)
659            .use_fips(true)
660            .build()
661            .expect("invalid params");
662        let resolver = crate::config::endpoint::DefaultResolver::new();
663        let endpoint = resolver.resolve_endpoint(&params);
664        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.us-east-2.amazonaws.com");
665        assert_eq!(
666            endpoint,
667            ::aws_smithy_types::endpoint::Endpoint::builder()
668                .url("https://s3-outposts-fips.us-east-2.amazonaws.com")
669                .property(
670                    "authSchemes",
671                    vec![{
672                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
673                        out.insert("name".to_string(), "sigv4".to_string().into());
674                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
675                        out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
676                        out.insert("disableDoubleEncoding".to_string(), true.into());
677                        out
678                    }
679                    .into()]
680                )
681                .build()
682        );
683    }
684
685    /// outpost access points support dualstack@us-west-2
686    #[test]
687    fn test_20() {
688        let params = crate::config::endpoint::Params::builder()
689            .access_point_name("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
690            .account_id("123456789012".to_string())
691            .region("us-west-2".to_string())
692            .requires_account_id(true)
693            .use_dual_stack(true)
694            .use_fips(false)
695            .build()
696            .expect("invalid params");
697        let resolver = crate::config::endpoint::DefaultResolver::new();
698        let endpoint = resolver.resolve_endpoint(&params);
699        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-west-2.api.aws");
700        assert_eq!(
701            endpoint,
702            ::aws_smithy_types::endpoint::Endpoint::builder()
703                .url("https://s3-outposts.us-west-2.api.aws")
704                .header("x-amz-account-id", "123456789012")
705                .header("x-amz-outpost-id", "op-01234567890123456")
706                .property(
707                    "authSchemes",
708                    vec![{
709                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
710                        out.insert("name".to_string(), "sigv4".to_string().into());
711                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
712                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
713                        out.insert("disableDoubleEncoding".to_string(), true.into());
714                        out
715                    }
716                    .into()]
717                )
718                .build()
719        );
720    }
721
722    /// outpost access points support dualstack@af-south-1
723    #[test]
724    fn test_21() {
725        let params = crate::config::endpoint::Params::builder()
726            .access_point_name("arn:aws:s3-outposts:af-south-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
727            .account_id("123456789012".to_string())
728            .region("af-south-1".to_string())
729            .requires_account_id(true)
730            .use_dual_stack(true)
731            .use_fips(false)
732            .build()
733            .expect("invalid params");
734        let resolver = crate::config::endpoint::DefaultResolver::new();
735        let endpoint = resolver.resolve_endpoint(&params);
736        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.af-south-1.api.aws");
737        assert_eq!(
738            endpoint,
739            ::aws_smithy_types::endpoint::Endpoint::builder()
740                .url("https://s3-outposts.af-south-1.api.aws")
741                .header("x-amz-account-id", "123456789012")
742                .header("x-amz-outpost-id", "op-01234567890123456")
743                .property(
744                    "authSchemes",
745                    vec![{
746                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
747                        out.insert("name".to_string(), "sigv4".to_string().into());
748                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
749                        out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
750                        out.insert("disableDoubleEncoding".to_string(), true.into());
751                        out
752                    }
753                    .into()]
754                )
755                .build()
756        );
757    }
758
759    /// outpost access points support fips + dualstack@af-south-1
760    #[test]
761    fn test_22() {
762        let params = crate::config::endpoint::Params::builder()
763            .access_point_name("arn:aws:s3-outposts:af-south-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
764            .account_id("123456789012".to_string())
765            .region("af-south-1".to_string())
766            .requires_account_id(true)
767            .use_dual_stack(true)
768            .use_fips(true)
769            .build()
770            .expect("invalid params");
771        let resolver = crate::config::endpoint::DefaultResolver::new();
772        let endpoint = resolver.resolve_endpoint(&params);
773        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.af-south-1.api.aws");
774        assert_eq!(
775            endpoint,
776            ::aws_smithy_types::endpoint::Endpoint::builder()
777                .url("https://s3-outposts-fips.af-south-1.api.aws")
778                .header("x-amz-account-id", "123456789012")
779                .header("x-amz-outpost-id", "op-01234567890123456")
780                .property(
781                    "authSchemes",
782                    vec![{
783                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
784                        out.insert("name".to_string(), "sigv4".to_string().into());
785                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
786                        out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
787                        out.insert("disableDoubleEncoding".to_string(), true.into());
788                        out
789                    }
790                    .into()]
791                )
792                .build()
793        );
794    }
795
796    /// invalid ARN: must be include outpost ID@us-west-2
797    #[test]
798    fn test_23() {
799        let params = crate::config::endpoint::Params::builder()
800            .access_point_name("arn:aws:s3-outposts:us-west-2:123456789012:outpost".to_string())
801            .account_id("123456789012".to_string())
802            .region("us-west-2".to_string())
803            .requires_account_id(true)
804            .use_dual_stack(false)
805            .use_fips(false)
806            .build()
807            .expect("invalid params");
808        let resolver = crate::config::endpoint::DefaultResolver::new();
809        let endpoint = resolver.resolve_endpoint(&params);
810        let error =
811            endpoint.expect_err("expected error: Invalid ARN: The Outpost Id was not set [invalid ARN: must be include outpost ID@us-west-2]");
812        assert_eq!(format!("{}", error), "Invalid ARN: The Outpost Id was not set")
813    }
814
815    /// invalid ARN: must specify access point@us-west-2
816    #[test]
817    fn test_24() {
818        let params = crate::config::endpoint::Params::builder()
819            .access_point_name("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456".to_string())
820            .region("us-west-2".to_string())
821            .requires_account_id(true)
822            .use_dual_stack(false)
823            .use_fips(false)
824            .build()
825            .expect("invalid params");
826        let resolver = crate::config::endpoint::DefaultResolver::new();
827        let endpoint = resolver.resolve_endpoint(&params);
828        let error =
829            endpoint.expect_err("expected error: Invalid ARN: Expected a 4-component resource [invalid ARN: must specify access point@us-west-2]");
830        assert_eq!(format!("{}", error), "Invalid ARN: Expected a 4-component resource")
831    }
832
833    /// invalid ARN@us-west-2
834    #[test]
835    fn test_25() {
836        let params = crate::config::endpoint::Params::builder()
837            .access_point_name("arn:aws:s3-outposts:us-west-2:123456789012:outpost:myaccesspoint".to_string())
838            .region("us-west-2".to_string())
839            .requires_account_id(true)
840            .use_dual_stack(false)
841            .use_fips(false)
842            .build()
843            .expect("invalid params");
844        let resolver = crate::config::endpoint::DefaultResolver::new();
845        let endpoint = resolver.resolve_endpoint(&params);
846        let error = endpoint.expect_err("expected error: Invalid ARN: Expected a 4-component resource [invalid ARN@us-west-2]");
847        assert_eq!(format!("{}", error), "Invalid ARN: Expected a 4-component resource")
848    }
849
850    /// when set, AccountId drives AP construction@us-west-2
851    #[test]
852    fn test_26() {
853        let params = crate::config::endpoint::Params::builder()
854            .access_point_name("myaccesspoint".to_string())
855            .account_id("myid-1234".to_string())
856            .region("us-west-2".to_string())
857            .requires_account_id(true)
858            .use_dual_stack(false)
859            .use_fips(false)
860            .build()
861            .expect("invalid params");
862        let resolver = crate::config::endpoint::DefaultResolver::new();
863        let endpoint = resolver.resolve_endpoint(&params);
864        let endpoint = endpoint.expect("Expected valid endpoint: https://myid-1234.s3-control.us-west-2.amazonaws.com");
865        assert_eq!(
866            endpoint,
867            ::aws_smithy_types::endpoint::Endpoint::builder()
868                .url("https://myid-1234.s3-control.us-west-2.amazonaws.com")
869                .property(
870                    "authSchemes",
871                    vec![{
872                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
873                        out.insert("name".to_string(), "sigv4".to_string().into());
874                        out.insert("signingName".to_string(), "s3".to_string().into());
875                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
876                        out.insert("disableDoubleEncoding".to_string(), true.into());
877                        out
878                    }
879                    .into()]
880                )
881                .build()
882        );
883    }
884
885    /// Account ID set inline and in ARN but they both match@us-west-2
886    #[test]
887    fn test_27() {
888        let params = crate::config::endpoint::Params::builder()
889            .access_point_name("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
890            .account_id("123456789012".to_string())
891            .region("us-west-2".to_string())
892            .requires_account_id(true)
893            .use_arn_region(false)
894            .use_dual_stack(false)
895            .use_fips(false)
896            .build()
897            .expect("invalid params");
898        let resolver = crate::config::endpoint::DefaultResolver::new();
899        let endpoint = resolver.resolve_endpoint(&params);
900        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-west-2.amazonaws.com");
901        assert_eq!(
902            endpoint,
903            ::aws_smithy_types::endpoint::Endpoint::builder()
904                .url("https://s3-outposts.us-west-2.amazonaws.com")
905                .header("x-amz-account-id", "123456789012")
906                .header("x-amz-outpost-id", "op-01234567890123456")
907                .property(
908                    "authSchemes",
909                    vec![{
910                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
911                        out.insert("name".to_string(), "sigv4".to_string().into());
912                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
913                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
914                        out.insert("disableDoubleEncoding".to_string(), true.into());
915                        out
916                    }
917                    .into()]
918                )
919                .build()
920        );
921    }
922
923    /// Account ID set inline and in ARN and they do not match@us-west-2
924    #[test]
925    fn test_28() {
926        let params = crate::config::endpoint::Params::builder()
927            .access_point_name("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
928            .account_id("999999999999".to_string())
929            .region("us-west-2".to_string())
930            .requires_account_id(true)
931            .use_arn_region(false)
932            .use_dual_stack(false)
933            .use_fips(false)
934            .build()
935            .expect("invalid params");
936        let resolver = crate::config::endpoint::DefaultResolver::new();
937        let endpoint = resolver.resolve_endpoint(&params);
938        let error = endpoint.expect_err("expected error: Invalid ARN: the accountId specified in the ARN (`123456789012`) does not match the parameter (`999999999999`) [Account ID set inline and in ARN and they do not match@us-west-2]");
939        assert_eq!(
940            format!("{}", error),
941            "Invalid ARN: the accountId specified in the ARN (`123456789012`) does not match the parameter (`999999999999`)"
942        )
943    }
944
945    /// get access point prefixed with account id using endpoint url@us-west-2
946    #[test]
947    fn test_29() {
948        let params = crate::config::endpoint::Params::builder()
949            .access_point_name("apname".to_string())
950            .account_id("123456789012".to_string())
951            .endpoint("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string())
952            .region("us-west-2".to_string())
953            .requires_account_id(true)
954            .use_dual_stack(false)
955            .use_fips(false)
956            .build()
957            .expect("invalid params");
958        let resolver = crate::config::endpoint::DefaultResolver::new();
959        let endpoint = resolver.resolve_endpoint(&params);
960        let endpoint = endpoint.expect("Expected valid endpoint: https://123456789012.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com");
961        assert_eq!(
962            endpoint,
963            ::aws_smithy_types::endpoint::Endpoint::builder()
964                .url("https://123456789012.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com")
965                .property(
966                    "authSchemes",
967                    vec![{
968                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
969                        out.insert("name".to_string(), "sigv4".to_string().into());
970                        out.insert("signingName".to_string(), "s3".to_string().into());
971                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
972                        out.insert("disableDoubleEncoding".to_string(), true.into());
973                        out
974                    }
975                    .into()]
976                )
977                .build()
978        );
979    }
980
981    /// endpoint url with s3-outposts@us-west-2
982    #[test]
983    fn test_30() {
984        let params = crate::config::endpoint::Params::builder()
985            .access_point_name("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
986            .account_id("123456789012".to_string())
987            .endpoint("https://beta.example.com".to_string())
988            .region("us-west-2".to_string())
989            .requires_account_id(true)
990            .use_dual_stack(false)
991            .use_fips(false)
992            .build()
993            .expect("invalid params");
994        let resolver = crate::config::endpoint::DefaultResolver::new();
995        let endpoint = resolver.resolve_endpoint(&params);
996        let endpoint = endpoint.expect("Expected valid endpoint: https://beta.example.com");
997        assert_eq!(
998            endpoint,
999            ::aws_smithy_types::endpoint::Endpoint::builder()
1000                .url("https://beta.example.com")
1001                .header("x-amz-account-id", "123456789012")
1002                .header("x-amz-outpost-id", "op-01234567890123456")
1003                .property(
1004                    "authSchemes",
1005                    vec![{
1006                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1007                        out.insert("name".to_string(), "sigv4".to_string().into());
1008                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1009                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
1010                        out.insert("disableDoubleEncoding".to_string(), true.into());
1011                        out
1012                    }
1013                    .into()]
1014                )
1015                .build()
1016        );
1017    }
1018
1019    /// access point name with a bucket arn@us-west-2
1020    #[test]
1021    fn test_31() {
1022        let params = crate::config::endpoint::Params::builder()
1023            .access_point_name("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1024            .endpoint("beta.example.com".to_string())
1025            .region("us-west-2".to_string())
1026            .requires_account_id(true)
1027            .use_dual_stack(false)
1028            .use_fips(false)
1029            .build()
1030            .expect("invalid params");
1031        let resolver = crate::config::endpoint::DefaultResolver::new();
1032        let endpoint = resolver.resolve_endpoint(&params);
1033        let error = endpoint
1034            .expect_err("expected error: Expected an outpost type `accesspoint`, found `bucket` [access point name with a bucket arn@us-west-2]");
1035        assert_eq!(format!("{}", error), "Expected an outpost type `accesspoint`, found `bucket`")
1036    }
1037
1038    /// bucket arn with access point name@us-west-2
1039    #[test]
1040    fn test_32() {
1041        let params = crate::config::endpoint::Params::builder()
1042            .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
1043            .endpoint("beta.example.com".to_string())
1044            .region("us-west-2".to_string())
1045            .requires_account_id(true)
1046            .use_dual_stack(false)
1047            .use_fips(false)
1048            .build()
1049            .expect("invalid params");
1050        let resolver = crate::config::endpoint::DefaultResolver::new();
1051        let endpoint = resolver.resolve_endpoint(&params);
1052        let error = endpoint.expect_err(
1053            "expected error: Invalid ARN: Expected an outpost type `bucket`, found `accesspoint` [bucket arn with access point name@us-west-2]",
1054        );
1055        assert_eq!(
1056            format!("{}", error),
1057            "Invalid ARN: Expected an outpost type `bucket`, found `accesspoint`"
1058        )
1059    }
1060
1061    /// create bucket with outposts@us-west-2
1062    #[test]
1063    fn test_33() {
1064        let params = crate::config::endpoint::Params::builder()
1065            .bucket("bucketname".to_string())
1066            .endpoint("https://beta.example.com".to_string())
1067            .outpost_id("op-123".to_string())
1068            .region("us-west-2".to_string())
1069            .requires_account_id(false)
1070            .use_dual_stack(false)
1071            .use_fips(false)
1072            .build()
1073            .expect("invalid params");
1074        let resolver = crate::config::endpoint::DefaultResolver::new();
1075        let endpoint = resolver.resolve_endpoint(&params);
1076        let endpoint = endpoint.expect("Expected valid endpoint: https://beta.example.com");
1077        assert_eq!(
1078            endpoint,
1079            ::aws_smithy_types::endpoint::Endpoint::builder()
1080                .url("https://beta.example.com")
1081                .property(
1082                    "authSchemes",
1083                    vec![{
1084                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1085                        out.insert("name".to_string(), "sigv4".to_string().into());
1086                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1087                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
1088                        out.insert("disableDoubleEncoding".to_string(), true.into());
1089                        out
1090                    }
1091                    .into()]
1092                )
1093                .build()
1094        );
1095    }
1096
1097    /// get bucket with endpoint_url@us-west-2
1098    #[test]
1099    fn test_34() {
1100        let params = crate::config::endpoint::Params::builder()
1101            .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1102            .endpoint("https://beta.example.com".to_string())
1103            .region("us-west-2".to_string())
1104            .requires_account_id(true)
1105            .use_dual_stack(false)
1106            .use_fips(false)
1107            .build()
1108            .expect("invalid params");
1109        let resolver = crate::config::endpoint::DefaultResolver::new();
1110        let endpoint = resolver.resolve_endpoint(&params);
1111        let endpoint = endpoint.expect("Expected valid endpoint: https://beta.example.com");
1112        assert_eq!(
1113            endpoint,
1114            ::aws_smithy_types::endpoint::Endpoint::builder()
1115                .url("https://beta.example.com")
1116                .header("x-amz-account-id", "123456789012")
1117                .header("x-amz-outpost-id", "op-01234567890123456")
1118                .property(
1119                    "authSchemes",
1120                    vec![{
1121                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1122                        out.insert("name".to_string(), "sigv4".to_string().into());
1123                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1124                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
1125                        out.insert("disableDoubleEncoding".to_string(), true.into());
1126                        out
1127                    }
1128                    .into()]
1129                )
1130                .build()
1131        );
1132    }
1133
1134    /// ListRegionalBucket + OutpostId endpoint url@us-east-2
1135    #[test]
1136    fn test_35() {
1137        let params = crate::config::endpoint::Params::builder()
1138            .account_id("123456789012".to_string())
1139            .endpoint("https://beta.example.com".to_string())
1140            .outpost_id("op-123".to_string())
1141            .region("us-east-2".to_string())
1142            .requires_account_id(true)
1143            .use_dual_stack(false)
1144            .use_fips(false)
1145            .build()
1146            .expect("invalid params");
1147        let resolver = crate::config::endpoint::DefaultResolver::new();
1148        let endpoint = resolver.resolve_endpoint(&params);
1149        let endpoint = endpoint.expect("Expected valid endpoint: https://beta.example.com");
1150        assert_eq!(
1151            endpoint,
1152            ::aws_smithy_types::endpoint::Endpoint::builder()
1153                .url("https://beta.example.com")
1154                .property(
1155                    "authSchemes",
1156                    vec![{
1157                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1158                        out.insert("name".to_string(), "sigv4".to_string().into());
1159                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1160                        out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
1161                        out.insert("disableDoubleEncoding".to_string(), true.into());
1162                        out
1163                    }
1164                    .into()]
1165                )
1166                .build()
1167        );
1168    }
1169
1170    /// ListRegionalBucket + OutpostId + fips + endpoint url@us-east-2
1171    #[test]
1172    fn test_36() {
1173        let params = crate::config::endpoint::Params::builder()
1174            .account_id("123456789012".to_string())
1175            .endpoint("https://beta.example.com".to_string())
1176            .outpost_id("op-123".to_string())
1177            .region("us-east-2".to_string())
1178            .requires_account_id(true)
1179            .use_dual_stack(false)
1180            .use_fips(true)
1181            .build()
1182            .expect("invalid params");
1183        let resolver = crate::config::endpoint::DefaultResolver::new();
1184        let endpoint = resolver.resolve_endpoint(&params);
1185        let endpoint = endpoint.expect("Expected valid endpoint: https://beta.example.com");
1186        assert_eq!(
1187            endpoint,
1188            ::aws_smithy_types::endpoint::Endpoint::builder()
1189                .url("https://beta.example.com")
1190                .property(
1191                    "authSchemes",
1192                    vec![{
1193                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1194                        out.insert("name".to_string(), "sigv4".to_string().into());
1195                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1196                        out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
1197                        out.insert("disableDoubleEncoding".to_string(), true.into());
1198                        out
1199                    }
1200                    .into()]
1201                )
1202                .build()
1203        );
1204    }
1205
1206    /// ListRegionalBucket + OutpostId + fips + dualstack@us-east-2
1207    #[test]
1208    fn test_37() {
1209        let params = crate::config::endpoint::Params::builder()
1210            .account_id("123456789012".to_string())
1211            .outpost_id("op-123".to_string())
1212            .region("us-east-2".to_string())
1213            .requires_account_id(true)
1214            .use_dual_stack(true)
1215            .use_fips(true)
1216            .build()
1217            .expect("invalid params");
1218        let resolver = crate::config::endpoint::DefaultResolver::new();
1219        let endpoint = resolver.resolve_endpoint(&params);
1220        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.us-east-2.api.aws");
1221        assert_eq!(
1222            endpoint,
1223            ::aws_smithy_types::endpoint::Endpoint::builder()
1224                .url("https://s3-outposts-fips.us-east-2.api.aws")
1225                .property(
1226                    "authSchemes",
1227                    vec![{
1228                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1229                        out.insert("name".to_string(), "sigv4".to_string().into());
1230                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1231                        out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
1232                        out.insert("disableDoubleEncoding".to_string(), true.into());
1233                        out
1234                    }
1235                    .into()]
1236                )
1237                .build()
1238        );
1239    }
1240
1241    /// CreateBucket + OutpostId endpoint url@us-east-2
1242    #[test]
1243    fn test_38() {
1244        let params = crate::config::endpoint::Params::builder()
1245            .bucket("blah".to_string())
1246            .endpoint("https://beta.example.com".to_string())
1247            .outpost_id("123".to_string())
1248            .region("us-east-2".to_string())
1249            .requires_account_id(false)
1250            .use_dual_stack(false)
1251            .use_fips(true)
1252            .build()
1253            .expect("invalid params");
1254        let resolver = crate::config::endpoint::DefaultResolver::new();
1255        let endpoint = resolver.resolve_endpoint(&params);
1256        let endpoint = endpoint.expect("Expected valid endpoint: https://beta.example.com");
1257        assert_eq!(
1258            endpoint,
1259            ::aws_smithy_types::endpoint::Endpoint::builder()
1260                .url("https://beta.example.com")
1261                .property(
1262                    "authSchemes",
1263                    vec![{
1264                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1265                        out.insert("name".to_string(), "sigv4".to_string().into());
1266                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1267                        out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
1268                        out.insert("disableDoubleEncoding".to_string(), true.into());
1269                        out
1270                    }
1271                    .into()]
1272                )
1273                .build()
1274        );
1275    }
1276
1277    /// dualstack cannot be used with outposts when an endpoint URL is set@us-west-2.
1278    #[test]
1279    fn test_39() {
1280        let params = crate::config::endpoint::Params::builder()
1281            .access_point_name("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
1282            .endpoint("https://s3-outposts.us-west-2.api.aws".to_string())
1283            .region("us-west-2".to_string())
1284            .requires_account_id(true)
1285            .use_dual_stack(true)
1286            .use_fips(false)
1287            .build()
1288            .expect("invalid params");
1289        let resolver = crate::config::endpoint::DefaultResolver::new();
1290        let endpoint = resolver.resolve_endpoint(&params);
1291        let error = endpoint.expect_err("expected error: Invalid Configuration: DualStack and custom endpoint are not supported [dualstack cannot be used with outposts when an endpoint URL is set@us-west-2.]");
1292        assert_eq!(
1293            format!("{}", error),
1294            "Invalid Configuration: DualStack and custom endpoint are not supported"
1295        )
1296    }
1297
1298    /// vanilla bucket arn requires account id@us-west-2
1299    #[test]
1300    fn test_40() {
1301        let params = crate::config::endpoint::Params::builder()
1302            .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1303            .region("us-west-2".to_string())
1304            .requires_account_id(true)
1305            .use_dual_stack(false)
1306            .use_fips(false)
1307            .build()
1308            .expect("invalid params");
1309        let resolver = crate::config::endpoint::DefaultResolver::new();
1310        let endpoint = resolver.resolve_endpoint(&params);
1311        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-west-2.amazonaws.com");
1312        assert_eq!(
1313            endpoint,
1314            ::aws_smithy_types::endpoint::Endpoint::builder()
1315                .url("https://s3-outposts.us-west-2.amazonaws.com")
1316                .header("x-amz-account-id", "123456789012")
1317                .header("x-amz-outpost-id", "op-01234567890123456")
1318                .property(
1319                    "authSchemes",
1320                    vec![{
1321                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1322                        out.insert("name".to_string(), "sigv4".to_string().into());
1323                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1324                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
1325                        out.insert("disableDoubleEncoding".to_string(), true.into());
1326                        out
1327                    }
1328                    .into()]
1329                )
1330                .build()
1331        );
1332    }
1333
1334    /// bucket arn with UseArnRegion = true (arn region supercedes client configured region)@us-west-2
1335    #[test]
1336    fn test_41() {
1337        let params = crate::config::endpoint::Params::builder()
1338            .bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1339            .region("us-west-2".to_string())
1340            .requires_account_id(true)
1341            .use_dual_stack(false)
1342            .use_fips(false)
1343            .build()
1344            .expect("invalid params");
1345        let resolver = crate::config::endpoint::DefaultResolver::new();
1346        let endpoint = resolver.resolve_endpoint(&params);
1347        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-east-1.amazonaws.com");
1348        assert_eq!(
1349            endpoint,
1350            ::aws_smithy_types::endpoint::Endpoint::builder()
1351                .url("https://s3-outposts.us-east-1.amazonaws.com")
1352                .header("x-amz-account-id", "123456789012")
1353                .header("x-amz-outpost-id", "op-01234567890123456")
1354                .property(
1355                    "authSchemes",
1356                    vec![{
1357                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1358                        out.insert("name".to_string(), "sigv4".to_string().into());
1359                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1360                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
1361                        out.insert("disableDoubleEncoding".to_string(), true.into());
1362                        out
1363                    }
1364                    .into()]
1365                )
1366                .build()
1367        );
1368    }
1369
1370    /// bucket ARN in gov partition (non-fips)@us-gov-east-1
1371    #[test]
1372    fn test_42() {
1373        let params = crate::config::endpoint::Params::builder()
1374            .bucket("arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1375            .region("us-gov-east-1".to_string())
1376            .requires_account_id(true)
1377            .use_dual_stack(false)
1378            .use_fips(false)
1379            .build()
1380            .expect("invalid params");
1381        let resolver = crate::config::endpoint::DefaultResolver::new();
1382        let endpoint = resolver.resolve_endpoint(&params);
1383        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-gov-east-1.amazonaws.com");
1384        assert_eq!(
1385            endpoint,
1386            ::aws_smithy_types::endpoint::Endpoint::builder()
1387                .url("https://s3-outposts.us-gov-east-1.amazonaws.com")
1388                .header("x-amz-account-id", "123456789012")
1389                .header("x-amz-outpost-id", "op-01234567890123456")
1390                .property(
1391                    "authSchemes",
1392                    vec![{
1393                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1394                        out.insert("name".to_string(), "sigv4".to_string().into());
1395                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1396                        out.insert("signingRegion".to_string(), "us-gov-east-1".to_string().into());
1397                        out.insert("disableDoubleEncoding".to_string(), true.into());
1398                        out
1399                    }
1400                    .into()]
1401                )
1402                .build()
1403        );
1404    }
1405
1406    /// bucket ARN in gov partition with FIPS@us-gov-west-1
1407    #[test]
1408    fn test_43() {
1409        let params = crate::config::endpoint::Params::builder()
1410            .bucket("arn:aws-us-gov:s3-outposts:us-gov-west-1:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1411            .region("us-gov-west-1".to_string())
1412            .requires_account_id(true)
1413            .use_dual_stack(false)
1414            .use_fips(true)
1415            .build()
1416            .expect("invalid params");
1417        let resolver = crate::config::endpoint::DefaultResolver::new();
1418        let endpoint = resolver.resolve_endpoint(&params);
1419        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.us-gov-west-1.amazonaws.com");
1420        assert_eq!(
1421            endpoint,
1422            ::aws_smithy_types::endpoint::Endpoint::builder()
1423                .url("https://s3-outposts-fips.us-gov-west-1.amazonaws.com")
1424                .header("x-amz-account-id", "123456789012")
1425                .header("x-amz-outpost-id", "op-01234567890123456")
1426                .property(
1427                    "authSchemes",
1428                    vec![{
1429                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1430                        out.insert("name".to_string(), "sigv4".to_string().into());
1431                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1432                        out.insert("signingRegion".to_string(), "us-gov-west-1".to_string().into());
1433                        out.insert("disableDoubleEncoding".to_string(), true.into());
1434                        out
1435                    }
1436                    .into()]
1437                )
1438                .build()
1439        );
1440    }
1441
1442    /// bucket ARN in aws partition with FIPS@us-east-2
1443    #[test]
1444    fn test_44() {
1445        let params = crate::config::endpoint::Params::builder()
1446            .bucket("arn:aws:s3-outposts:us-east-2:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1447            .region("us-east-2".to_string())
1448            .requires_account_id(true)
1449            .use_dual_stack(false)
1450            .use_fips(true)
1451            .build()
1452            .expect("invalid params");
1453        let resolver = crate::config::endpoint::DefaultResolver::new();
1454        let endpoint = resolver.resolve_endpoint(&params);
1455        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.us-east-2.amazonaws.com");
1456        assert_eq!(
1457            endpoint,
1458            ::aws_smithy_types::endpoint::Endpoint::builder()
1459                .url("https://s3-outposts-fips.us-east-2.amazonaws.com")
1460                .header("x-amz-account-id", "123456789012")
1461                .header("x-amz-outpost-id", "op-01234567890123456")
1462                .property(
1463                    "authSchemes",
1464                    vec![{
1465                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1466                        out.insert("name".to_string(), "sigv4".to_string().into());
1467                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1468                        out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
1469                        out.insert("disableDoubleEncoding".to_string(), true.into());
1470                        out
1471                    }
1472                    .into()]
1473                )
1474                .build()
1475        );
1476    }
1477
1478    /// bucket ARN in aws partition with fips + dualstack@us-east-2
1479    #[test]
1480    fn test_45() {
1481        let params = crate::config::endpoint::Params::builder()
1482            .bucket("arn:aws:s3-outposts:us-east-2:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1483            .region("us-east-2".to_string())
1484            .requires_account_id(true)
1485            .use_dual_stack(true)
1486            .use_fips(true)
1487            .build()
1488            .expect("invalid params");
1489        let resolver = crate::config::endpoint::DefaultResolver::new();
1490        let endpoint = resolver.resolve_endpoint(&params);
1491        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.us-east-2.api.aws");
1492        assert_eq!(
1493            endpoint,
1494            ::aws_smithy_types::endpoint::Endpoint::builder()
1495                .url("https://s3-outposts-fips.us-east-2.api.aws")
1496                .header("x-amz-account-id", "123456789012")
1497                .header("x-amz-outpost-id", "op-01234567890123456")
1498                .property(
1499                    "authSchemes",
1500                    vec![{
1501                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1502                        out.insert("name".to_string(), "sigv4".to_string().into());
1503                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1504                        out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
1505                        out.insert("disableDoubleEncoding".to_string(), true.into());
1506                        out
1507                    }
1508                    .into()]
1509                )
1510                .build()
1511        );
1512    }
1513
1514    /// vanilla bucket arn requires account id@cn-north-1
1515    #[test]
1516    fn test_46() {
1517        let params = crate::config::endpoint::Params::builder()
1518            .bucket("arn:aws-cn:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1519            .region("cn-north-1".to_string())
1520            .requires_account_id(true)
1521            .use_dual_stack(false)
1522            .use_fips(false)
1523            .build()
1524            .expect("invalid params");
1525        let resolver = crate::config::endpoint::DefaultResolver::new();
1526        let endpoint = resolver.resolve_endpoint(&params);
1527        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.cn-north-1.amazonaws.com.cn");
1528        assert_eq!(
1529            endpoint,
1530            ::aws_smithy_types::endpoint::Endpoint::builder()
1531                .url("https://s3-outposts.cn-north-1.amazonaws.com.cn")
1532                .header("x-amz-account-id", "123456789012")
1533                .header("x-amz-outpost-id", "op-01234567890123456")
1534                .property(
1535                    "authSchemes",
1536                    vec![{
1537                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1538                        out.insert("name".to_string(), "sigv4".to_string().into());
1539                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1540                        out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
1541                        out.insert("disableDoubleEncoding".to_string(), true.into());
1542                        out
1543                    }
1544                    .into()]
1545                )
1546                .build()
1547        );
1548    }
1549
1550    /// bucket arn with UseArnRegion = true (arn region supercedes client configured region)@us-west-2
1551    #[test]
1552    fn test_47() {
1553        let params = crate::config::endpoint::Params::builder()
1554            .bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1555            .region("us-west-2".to_string())
1556            .requires_account_id(true)
1557            .use_dual_stack(false)
1558            .use_fips(false)
1559            .build()
1560            .expect("invalid params");
1561        let resolver = crate::config::endpoint::DefaultResolver::new();
1562        let endpoint = resolver.resolve_endpoint(&params);
1563        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-east-1.amazonaws.com");
1564        assert_eq!(
1565            endpoint,
1566            ::aws_smithy_types::endpoint::Endpoint::builder()
1567                .url("https://s3-outposts.us-east-1.amazonaws.com")
1568                .header("x-amz-account-id", "123456789012")
1569                .header("x-amz-outpost-id", "op-01234567890123456")
1570                .property(
1571                    "authSchemes",
1572                    vec![{
1573                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1574                        out.insert("name".to_string(), "sigv4".to_string().into());
1575                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1576                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
1577                        out.insert("disableDoubleEncoding".to_string(), true.into());
1578                        out
1579                    }
1580                    .into()]
1581                )
1582                .build()
1583        );
1584    }
1585
1586    /// bucket ARN in gov partition (non-fips)@us-gov-east-1
1587    #[test]
1588    fn test_48() {
1589        let params = crate::config::endpoint::Params::builder()
1590            .bucket("arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1591            .region("us-gov-east-1".to_string())
1592            .requires_account_id(true)
1593            .use_dual_stack(false)
1594            .use_fips(false)
1595            .build()
1596            .expect("invalid params");
1597        let resolver = crate::config::endpoint::DefaultResolver::new();
1598        let endpoint = resolver.resolve_endpoint(&params);
1599        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-gov-east-1.amazonaws.com");
1600        assert_eq!(
1601            endpoint,
1602            ::aws_smithy_types::endpoint::Endpoint::builder()
1603                .url("https://s3-outposts.us-gov-east-1.amazonaws.com")
1604                .header("x-amz-account-id", "123456789012")
1605                .header("x-amz-outpost-id", "op-01234567890123456")
1606                .property(
1607                    "authSchemes",
1608                    vec![{
1609                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1610                        out.insert("name".to_string(), "sigv4".to_string().into());
1611                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1612                        out.insert("signingRegion".to_string(), "us-gov-east-1".to_string().into());
1613                        out.insert("disableDoubleEncoding".to_string(), true.into());
1614                        out
1615                    }
1616                    .into()]
1617                )
1618                .build()
1619        );
1620    }
1621
1622    /// bucket ARN in gov partition with FIPS@us-gov-west-1
1623    #[test]
1624    fn test_49() {
1625        let params = crate::config::endpoint::Params::builder()
1626            .bucket("arn:aws-us-gov:s3-outposts:us-gov-west-1:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1627            .region("us-gov-west-1".to_string())
1628            .requires_account_id(true)
1629            .use_dual_stack(false)
1630            .use_fips(true)
1631            .build()
1632            .expect("invalid params");
1633        let resolver = crate::config::endpoint::DefaultResolver::new();
1634        let endpoint = resolver.resolve_endpoint(&params);
1635        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.us-gov-west-1.amazonaws.com");
1636        assert_eq!(
1637            endpoint,
1638            ::aws_smithy_types::endpoint::Endpoint::builder()
1639                .url("https://s3-outposts-fips.us-gov-west-1.amazonaws.com")
1640                .header("x-amz-account-id", "123456789012")
1641                .header("x-amz-outpost-id", "op-01234567890123456")
1642                .property(
1643                    "authSchemes",
1644                    vec![{
1645                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1646                        out.insert("name".to_string(), "sigv4".to_string().into());
1647                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1648                        out.insert("signingRegion".to_string(), "us-gov-west-1".to_string().into());
1649                        out.insert("disableDoubleEncoding".to_string(), true.into());
1650                        out
1651                    }
1652                    .into()]
1653                )
1654                .build()
1655        );
1656    }
1657
1658    /// bucket ARN in aws partition with FIPS@us-east-2
1659    #[test]
1660    fn test_50() {
1661        let params = crate::config::endpoint::Params::builder()
1662            .bucket("arn:aws:s3-outposts:us-east-2:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1663            .region("us-east-2".to_string())
1664            .requires_account_id(true)
1665            .use_dual_stack(false)
1666            .use_fips(true)
1667            .build()
1668            .expect("invalid params");
1669        let resolver = crate::config::endpoint::DefaultResolver::new();
1670        let endpoint = resolver.resolve_endpoint(&params);
1671        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.us-east-2.amazonaws.com");
1672        assert_eq!(
1673            endpoint,
1674            ::aws_smithy_types::endpoint::Endpoint::builder()
1675                .url("https://s3-outposts-fips.us-east-2.amazonaws.com")
1676                .header("x-amz-account-id", "123456789012")
1677                .header("x-amz-outpost-id", "op-01234567890123456")
1678                .property(
1679                    "authSchemes",
1680                    vec![{
1681                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1682                        out.insert("name".to_string(), "sigv4".to_string().into());
1683                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1684                        out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
1685                        out.insert("disableDoubleEncoding".to_string(), true.into());
1686                        out
1687                    }
1688                    .into()]
1689                )
1690                .build()
1691        );
1692    }
1693
1694    /// Outposts support dualstack @us-west-2
1695    #[test]
1696    fn test_51() {
1697        let params = crate::config::endpoint::Params::builder()
1698            .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1699            .region("us-west-2".to_string())
1700            .requires_account_id(true)
1701            .use_dual_stack(true)
1702            .use_fips(false)
1703            .build()
1704            .expect("invalid params");
1705        let resolver = crate::config::endpoint::DefaultResolver::new();
1706        let endpoint = resolver.resolve_endpoint(&params);
1707        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-west-2.api.aws");
1708        assert_eq!(
1709            endpoint,
1710            ::aws_smithy_types::endpoint::Endpoint::builder()
1711                .url("https://s3-outposts.us-west-2.api.aws")
1712                .header("x-amz-account-id", "123456789012")
1713                .header("x-amz-outpost-id", "op-01234567890123456")
1714                .property(
1715                    "authSchemes",
1716                    vec![{
1717                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1718                        out.insert("name".to_string(), "sigv4".to_string().into());
1719                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1720                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
1721                        out.insert("disableDoubleEncoding".to_string(), true.into());
1722                        out
1723                    }
1724                    .into()]
1725                )
1726                .build()
1727        );
1728    }
1729
1730    /// vanilla bucket arn requires account id@af-south-1
1731    #[test]
1732    fn test_52() {
1733        let params = crate::config::endpoint::Params::builder()
1734            .bucket("arn:aws:s3-outposts:af-south-1:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1735            .region("af-south-1".to_string())
1736            .requires_account_id(true)
1737            .use_dual_stack(false)
1738            .use_fips(false)
1739            .build()
1740            .expect("invalid params");
1741        let resolver = crate::config::endpoint::DefaultResolver::new();
1742        let endpoint = resolver.resolve_endpoint(&params);
1743        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.af-south-1.amazonaws.com");
1744        assert_eq!(
1745            endpoint,
1746            ::aws_smithy_types::endpoint::Endpoint::builder()
1747                .url("https://s3-outposts.af-south-1.amazonaws.com")
1748                .header("x-amz-account-id", "123456789012")
1749                .header("x-amz-outpost-id", "op-01234567890123456")
1750                .property(
1751                    "authSchemes",
1752                    vec![{
1753                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1754                        out.insert("name".to_string(), "sigv4".to_string().into());
1755                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1756                        out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
1757                        out.insert("disableDoubleEncoding".to_string(), true.into());
1758                        out
1759                    }
1760                    .into()]
1761                )
1762                .build()
1763        );
1764    }
1765
1766    /// bucket arn with UseArnRegion = true (arn region supercedes client configured region)@us-west-2
1767    #[test]
1768    fn test_53() {
1769        let params = crate::config::endpoint::Params::builder()
1770            .bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1771            .region("us-west-2".to_string())
1772            .requires_account_id(true)
1773            .use_dual_stack(false)
1774            .use_fips(false)
1775            .build()
1776            .expect("invalid params");
1777        let resolver = crate::config::endpoint::DefaultResolver::new();
1778        let endpoint = resolver.resolve_endpoint(&params);
1779        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-east-1.amazonaws.com");
1780        assert_eq!(
1781            endpoint,
1782            ::aws_smithy_types::endpoint::Endpoint::builder()
1783                .url("https://s3-outposts.us-east-1.amazonaws.com")
1784                .header("x-amz-account-id", "123456789012")
1785                .header("x-amz-outpost-id", "op-01234567890123456")
1786                .property(
1787                    "authSchemes",
1788                    vec![{
1789                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1790                        out.insert("name".to_string(), "sigv4".to_string().into());
1791                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1792                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
1793                        out.insert("disableDoubleEncoding".to_string(), true.into());
1794                        out
1795                    }
1796                    .into()]
1797                )
1798                .build()
1799        );
1800    }
1801
1802    /// bucket ARN in gov partition (non-fips)@us-gov-east-1
1803    #[test]
1804    fn test_54() {
1805        let params = crate::config::endpoint::Params::builder()
1806            .bucket("arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1807            .region("us-gov-east-1".to_string())
1808            .requires_account_id(true)
1809            .use_dual_stack(false)
1810            .use_fips(false)
1811            .build()
1812            .expect("invalid params");
1813        let resolver = crate::config::endpoint::DefaultResolver::new();
1814        let endpoint = resolver.resolve_endpoint(&params);
1815        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-gov-east-1.amazonaws.com");
1816        assert_eq!(
1817            endpoint,
1818            ::aws_smithy_types::endpoint::Endpoint::builder()
1819                .url("https://s3-outposts.us-gov-east-1.amazonaws.com")
1820                .header("x-amz-account-id", "123456789012")
1821                .header("x-amz-outpost-id", "op-01234567890123456")
1822                .property(
1823                    "authSchemes",
1824                    vec![{
1825                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1826                        out.insert("name".to_string(), "sigv4".to_string().into());
1827                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1828                        out.insert("signingRegion".to_string(), "us-gov-east-1".to_string().into());
1829                        out.insert("disableDoubleEncoding".to_string(), true.into());
1830                        out
1831                    }
1832                    .into()]
1833                )
1834                .build()
1835        );
1836    }
1837
1838    /// bucket ARN in gov partition with FIPS@us-gov-west-1
1839    #[test]
1840    fn test_55() {
1841        let params = crate::config::endpoint::Params::builder()
1842            .bucket("arn:aws-us-gov:s3-outposts:us-gov-west-1:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1843            .region("us-gov-west-1".to_string())
1844            .requires_account_id(true)
1845            .use_dual_stack(false)
1846            .use_fips(true)
1847            .build()
1848            .expect("invalid params");
1849        let resolver = crate::config::endpoint::DefaultResolver::new();
1850        let endpoint = resolver.resolve_endpoint(&params);
1851        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.us-gov-west-1.amazonaws.com");
1852        assert_eq!(
1853            endpoint,
1854            ::aws_smithy_types::endpoint::Endpoint::builder()
1855                .url("https://s3-outposts-fips.us-gov-west-1.amazonaws.com")
1856                .header("x-amz-account-id", "123456789012")
1857                .header("x-amz-outpost-id", "op-01234567890123456")
1858                .property(
1859                    "authSchemes",
1860                    vec![{
1861                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1862                        out.insert("name".to_string(), "sigv4".to_string().into());
1863                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1864                        out.insert("signingRegion".to_string(), "us-gov-west-1".to_string().into());
1865                        out.insert("disableDoubleEncoding".to_string(), true.into());
1866                        out
1867                    }
1868                    .into()]
1869                )
1870                .build()
1871        );
1872    }
1873
1874    /// bucket ARN in aws partition with FIPS@us-east-2
1875    #[test]
1876    fn test_56() {
1877        let params = crate::config::endpoint::Params::builder()
1878            .bucket("arn:aws:s3-outposts:us-east-2:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
1879            .region("us-east-2".to_string())
1880            .requires_account_id(true)
1881            .use_dual_stack(false)
1882            .use_fips(true)
1883            .build()
1884            .expect("invalid params");
1885        let resolver = crate::config::endpoint::DefaultResolver::new();
1886        let endpoint = resolver.resolve_endpoint(&params);
1887        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts-fips.us-east-2.amazonaws.com");
1888        assert_eq!(
1889            endpoint,
1890            ::aws_smithy_types::endpoint::Endpoint::builder()
1891                .url("https://s3-outposts-fips.us-east-2.amazonaws.com")
1892                .header("x-amz-account-id", "123456789012")
1893                .header("x-amz-outpost-id", "op-01234567890123456")
1894                .property(
1895                    "authSchemes",
1896                    vec![{
1897                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
1898                        out.insert("name".to_string(), "sigv4".to_string().into());
1899                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
1900                        out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
1901                        out.insert("disableDoubleEncoding".to_string(), true.into());
1902                        out
1903                    }
1904                    .into()]
1905                )
1906                .build()
1907        );
1908    }
1909
1910    /// Invalid ARN: missing outpost id and bucket@us-west-2
1911    #[test]
1912    fn test_57() {
1913        let params = crate::config::endpoint::Params::builder()
1914            .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost".to_string())
1915            .region("us-west-2".to_string())
1916            .requires_account_id(true)
1917            .use_dual_stack(false)
1918            .use_fips(false)
1919            .build()
1920            .expect("invalid params");
1921        let resolver = crate::config::endpoint::DefaultResolver::new();
1922        let endpoint = resolver.resolve_endpoint(&params);
1923        let error =
1924            endpoint.expect_err("expected error: Invalid ARN: The Outpost Id was not set [Invalid ARN: missing outpost id and bucket@us-west-2]");
1925        assert_eq!(format!("{}", error), "Invalid ARN: The Outpost Id was not set")
1926    }
1927
1928    /// Invalid ARN: missing bucket@us-west-2
1929    #[test]
1930    fn test_58() {
1931        let params = crate::config::endpoint::Params::builder()
1932            .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456".to_string())
1933            .region("us-west-2".to_string())
1934            .requires_account_id(true)
1935            .use_dual_stack(false)
1936            .use_fips(false)
1937            .build()
1938            .expect("invalid params");
1939        let resolver = crate::config::endpoint::DefaultResolver::new();
1940        let endpoint = resolver.resolve_endpoint(&params);
1941        let error = endpoint.expect_err("expected error: Invalid ARN: Expected a 4-component resource [Invalid ARN: missing bucket@us-west-2]");
1942        assert_eq!(format!("{}", error), "Invalid ARN: Expected a 4-component resource")
1943    }
1944
1945    /// Invalid ARN: missing outpost and bucket ids@us-west-2
1946    #[test]
1947    fn test_59() {
1948        let params = crate::config::endpoint::Params::builder()
1949            .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost:bucket".to_string())
1950            .region("us-west-2".to_string())
1951            .requires_account_id(true)
1952            .use_dual_stack(false)
1953            .use_fips(false)
1954            .build()
1955            .expect("invalid params");
1956        let resolver = crate::config::endpoint::DefaultResolver::new();
1957        let endpoint = resolver.resolve_endpoint(&params);
1958        let error = endpoint
1959            .expect_err("expected error: Invalid ARN: Expected a 4-component resource [Invalid ARN: missing outpost and bucket ids@us-west-2]");
1960        assert_eq!(format!("{}", error), "Invalid ARN: Expected a 4-component resource")
1961    }
1962
1963    /// Invalid ARN: missing bucket id@us-west-2
1964    #[test]
1965    fn test_60() {
1966        let params = crate::config::endpoint::Params::builder()
1967            .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket".to_string())
1968            .region("us-west-2".to_string())
1969            .requires_account_id(true)
1970            .use_dual_stack(false)
1971            .use_fips(false)
1972            .build()
1973            .expect("invalid params");
1974        let resolver = crate::config::endpoint::DefaultResolver::new();
1975        let endpoint = resolver.resolve_endpoint(&params);
1976        let error = endpoint.expect_err("expected error: Invalid ARN: expected a bucket name [Invalid ARN: missing bucket id@us-west-2]");
1977        assert_eq!(format!("{}", error), "Invalid ARN: expected a bucket name")
1978    }
1979
1980    /// account id inserted into hostname@us-west-2
1981    #[test]
1982    fn test_61() {
1983        let params = crate::config::endpoint::Params::builder()
1984            .account_id("1234567890".to_string())
1985            .region("us-west-2".to_string())
1986            .requires_account_id(true)
1987            .use_dual_stack(false)
1988            .use_fips(false)
1989            .build()
1990            .expect("invalid params");
1991        let resolver = crate::config::endpoint::DefaultResolver::new();
1992        let endpoint = resolver.resolve_endpoint(&params);
1993        let endpoint = endpoint.expect("Expected valid endpoint: https://1234567890.s3-control.us-west-2.amazonaws.com");
1994        assert_eq!(
1995            endpoint,
1996            ::aws_smithy_types::endpoint::Endpoint::builder()
1997                .url("https://1234567890.s3-control.us-west-2.amazonaws.com")
1998                .property(
1999                    "authSchemes",
2000                    vec![{
2001                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2002                        out.insert("name".to_string(), "sigv4".to_string().into());
2003                        out.insert("signingName".to_string(), "s3".to_string().into());
2004                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
2005                        out.insert("disableDoubleEncoding".to_string(), true.into());
2006                        out
2007                    }
2008                    .into()]
2009                )
2010                .build()
2011        );
2012    }
2013
2014    /// account id prefix with dualstack@us-east-1
2015    #[test]
2016    fn test_62() {
2017        let params = crate::config::endpoint::Params::builder()
2018            .account_id("1234567890".to_string())
2019            .region("us-east-1".to_string())
2020            .requires_account_id(true)
2021            .use_dual_stack(true)
2022            .use_fips(false)
2023            .build()
2024            .expect("invalid params");
2025        let resolver = crate::config::endpoint::DefaultResolver::new();
2026        let endpoint = resolver.resolve_endpoint(&params);
2027        let endpoint = endpoint.expect("Expected valid endpoint: https://1234567890.s3-control.dualstack.us-east-1.amazonaws.com");
2028        assert_eq!(
2029            endpoint,
2030            ::aws_smithy_types::endpoint::Endpoint::builder()
2031                .url("https://1234567890.s3-control.dualstack.us-east-1.amazonaws.com")
2032                .property(
2033                    "authSchemes",
2034                    vec![{
2035                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2036                        out.insert("name".to_string(), "sigv4".to_string().into());
2037                        out.insert("signingName".to_string(), "s3".to_string().into());
2038                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
2039                        out.insert("disableDoubleEncoding".to_string(), true.into());
2040                        out
2041                    }
2042                    .into()]
2043                )
2044                .build()
2045        );
2046    }
2047
2048    /// account id prefix with fips@us-east-1
2049    #[test]
2050    fn test_63() {
2051        let params = crate::config::endpoint::Params::builder()
2052            .account_id("1234567890".to_string())
2053            .region("us-east-1".to_string())
2054            .requires_account_id(true)
2055            .use_dual_stack(false)
2056            .use_fips(true)
2057            .build()
2058            .expect("invalid params");
2059        let resolver = crate::config::endpoint::DefaultResolver::new();
2060        let endpoint = resolver.resolve_endpoint(&params);
2061        let endpoint = endpoint.expect("Expected valid endpoint: https://1234567890.s3-control-fips.us-east-1.amazonaws.com");
2062        assert_eq!(
2063            endpoint,
2064            ::aws_smithy_types::endpoint::Endpoint::builder()
2065                .url("https://1234567890.s3-control-fips.us-east-1.amazonaws.com")
2066                .property(
2067                    "authSchemes",
2068                    vec![{
2069                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2070                        out.insert("name".to_string(), "sigv4".to_string().into());
2071                        out.insert("signingName".to_string(), "s3".to_string().into());
2072                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
2073                        out.insert("disableDoubleEncoding".to_string(), true.into());
2074                        out
2075                    }
2076                    .into()]
2077                )
2078                .build()
2079        );
2080    }
2081
2082    /// custom account id prefix with fips@us-east-1
2083    #[test]
2084    fn test_64() {
2085        let params = crate::config::endpoint::Params::builder()
2086            .account_id("123456789012".to_string())
2087            .region("us-east-1".to_string())
2088            .requires_account_id(true)
2089            .use_dual_stack(false)
2090            .use_fips(true)
2091            .build()
2092            .expect("invalid params");
2093        let resolver = crate::config::endpoint::DefaultResolver::new();
2094        let endpoint = resolver.resolve_endpoint(&params);
2095        let endpoint = endpoint.expect("Expected valid endpoint: https://123456789012.s3-control-fips.us-east-1.amazonaws.com");
2096        assert_eq!(
2097            endpoint,
2098            ::aws_smithy_types::endpoint::Endpoint::builder()
2099                .url("https://123456789012.s3-control-fips.us-east-1.amazonaws.com")
2100                .property(
2101                    "authSchemes",
2102                    vec![{
2103                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2104                        out.insert("name".to_string(), "sigv4".to_string().into());
2105                        out.insert("signingName".to_string(), "s3".to_string().into());
2106                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
2107                        out.insert("disableDoubleEncoding".to_string(), true.into());
2108                        out
2109                    }
2110                    .into()]
2111                )
2112                .build()
2113        );
2114    }
2115
2116    /// standard url @ us-east-1
2117    #[test]
2118    fn test_65() {
2119        let params = crate::config::endpoint::Params::builder()
2120            .region("us-east-1".to_string())
2121            .build()
2122            .expect("invalid params");
2123        let resolver = crate::config::endpoint::DefaultResolver::new();
2124        let endpoint = resolver.resolve_endpoint(&params);
2125        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-control.us-east-1.amazonaws.com");
2126        assert_eq!(
2127            endpoint,
2128            ::aws_smithy_types::endpoint::Endpoint::builder()
2129                .url("https://s3-control.us-east-1.amazonaws.com")
2130                .property(
2131                    "authSchemes",
2132                    vec![{
2133                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2134                        out.insert("name".to_string(), "sigv4".to_string().into());
2135                        out.insert("signingName".to_string(), "s3".to_string().into());
2136                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
2137                        out.insert("disableDoubleEncoding".to_string(), true.into());
2138                        out
2139                    }
2140                    .into()]
2141                )
2142                .build()
2143        );
2144    }
2145
2146    /// fips url @ us-east-1
2147    #[test]
2148    fn test_66() {
2149        let params = crate::config::endpoint::Params::builder()
2150            .region("us-east-1".to_string())
2151            .use_fips(true)
2152            .build()
2153            .expect("invalid params");
2154        let resolver = crate::config::endpoint::DefaultResolver::new();
2155        let endpoint = resolver.resolve_endpoint(&params);
2156        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-control-fips.us-east-1.amazonaws.com");
2157        assert_eq!(
2158            endpoint,
2159            ::aws_smithy_types::endpoint::Endpoint::builder()
2160                .url("https://s3-control-fips.us-east-1.amazonaws.com")
2161                .property(
2162                    "authSchemes",
2163                    vec![{
2164                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2165                        out.insert("name".to_string(), "sigv4".to_string().into());
2166                        out.insert("signingName".to_string(), "s3".to_string().into());
2167                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
2168                        out.insert("disableDoubleEncoding".to_string(), true.into());
2169                        out
2170                    }
2171                    .into()]
2172                )
2173                .build()
2174        );
2175    }
2176
2177    /// dualstack url @ us-east-1
2178    #[test]
2179    fn test_67() {
2180        let params = crate::config::endpoint::Params::builder()
2181            .region("us-east-1".to_string())
2182            .use_dual_stack(true)
2183            .build()
2184            .expect("invalid params");
2185        let resolver = crate::config::endpoint::DefaultResolver::new();
2186        let endpoint = resolver.resolve_endpoint(&params);
2187        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-control.dualstack.us-east-1.amazonaws.com");
2188        assert_eq!(
2189            endpoint,
2190            ::aws_smithy_types::endpoint::Endpoint::builder()
2191                .url("https://s3-control.dualstack.us-east-1.amazonaws.com")
2192                .property(
2193                    "authSchemes",
2194                    vec![{
2195                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2196                        out.insert("name".to_string(), "sigv4".to_string().into());
2197                        out.insert("signingName".to_string(), "s3".to_string().into());
2198                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
2199                        out.insert("disableDoubleEncoding".to_string(), true.into());
2200                        out
2201                    }
2202                    .into()]
2203                )
2204                .build()
2205        );
2206    }
2207
2208    /// fips,dualstack url @ us-east-1
2209    #[test]
2210    fn test_68() {
2211        let params = crate::config::endpoint::Params::builder()
2212            .region("us-east-1".to_string())
2213            .use_dual_stack(true)
2214            .use_fips(true)
2215            .build()
2216            .expect("invalid params");
2217        let resolver = crate::config::endpoint::DefaultResolver::new();
2218        let endpoint = resolver.resolve_endpoint(&params);
2219        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-control-fips.dualstack.us-east-1.amazonaws.com");
2220        assert_eq!(
2221            endpoint,
2222            ::aws_smithy_types::endpoint::Endpoint::builder()
2223                .url("https://s3-control-fips.dualstack.us-east-1.amazonaws.com")
2224                .property(
2225                    "authSchemes",
2226                    vec![{
2227                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2228                        out.insert("name".to_string(), "sigv4".to_string().into());
2229                        out.insert("signingName".to_string(), "s3".to_string().into());
2230                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
2231                        out.insert("disableDoubleEncoding".to_string(), true.into());
2232                        out
2233                    }
2234                    .into()]
2235                )
2236                .build()
2237        );
2238    }
2239
2240    /// standard url @ cn-north-1
2241    #[test]
2242    fn test_69() {
2243        let params = crate::config::endpoint::Params::builder()
2244            .region("cn-north-1".to_string())
2245            .build()
2246            .expect("invalid params");
2247        let resolver = crate::config::endpoint::DefaultResolver::new();
2248        let endpoint = resolver.resolve_endpoint(&params);
2249        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-control.cn-north-1.amazonaws.com.cn");
2250        assert_eq!(
2251            endpoint,
2252            ::aws_smithy_types::endpoint::Endpoint::builder()
2253                .url("https://s3-control.cn-north-1.amazonaws.com.cn")
2254                .property(
2255                    "authSchemes",
2256                    vec![{
2257                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2258                        out.insert("name".to_string(), "sigv4".to_string().into());
2259                        out.insert("signingName".to_string(), "s3".to_string().into());
2260                        out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
2261                        out.insert("disableDoubleEncoding".to_string(), true.into());
2262                        out
2263                    }
2264                    .into()]
2265                )
2266                .build()
2267        );
2268    }
2269
2270    /// fips @ cn-north-1
2271    #[test]
2272    fn test_70() {
2273        let params = crate::config::endpoint::Params::builder()
2274            .region("cn-north-1".to_string())
2275            .use_dual_stack(true)
2276            .use_fips(true)
2277            .build()
2278            .expect("invalid params");
2279        let resolver = crate::config::endpoint::DefaultResolver::new();
2280        let endpoint = resolver.resolve_endpoint(&params);
2281        let error = endpoint.expect_err("expected error: Partition does not support FIPS [fips @ cn-north-1]");
2282        assert_eq!(format!("{}", error), "Partition does not support FIPS")
2283    }
2284
2285    /// custom account id prefix @us-east-1
2286    #[test]
2287    fn test_71() {
2288        let params = crate::config::endpoint::Params::builder()
2289            .account_id("123456789012".to_string())
2290            .region("us-east-1".to_string())
2291            .requires_account_id(true)
2292            .use_dual_stack(false)
2293            .use_fips(false)
2294            .build()
2295            .expect("invalid params");
2296        let resolver = crate::config::endpoint::DefaultResolver::new();
2297        let endpoint = resolver.resolve_endpoint(&params);
2298        let endpoint = endpoint.expect("Expected valid endpoint: https://123456789012.s3-control.us-east-1.amazonaws.com");
2299        assert_eq!(
2300            endpoint,
2301            ::aws_smithy_types::endpoint::Endpoint::builder()
2302                .url("https://123456789012.s3-control.us-east-1.amazonaws.com")
2303                .property(
2304                    "authSchemes",
2305                    vec![{
2306                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2307                        out.insert("name".to_string(), "sigv4".to_string().into());
2308                        out.insert("signingName".to_string(), "s3".to_string().into());
2309                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
2310                        out.insert("disableDoubleEncoding".to_string(), true.into());
2311                        out
2312                    }
2313                    .into()]
2314                )
2315                .build()
2316        );
2317    }
2318
2319    /// invalid account id prefix @us-east-1
2320    #[test]
2321    fn test_72() {
2322        let params = crate::config::endpoint::Params::builder()
2323            .account_id("/?invalid&not-host*label".to_string())
2324            .region("us-east-1".to_string())
2325            .requires_account_id(true)
2326            .use_dual_stack(false)
2327            .use_fips(false)
2328            .build()
2329            .expect("invalid params");
2330        let resolver = crate::config::endpoint::DefaultResolver::new();
2331        let endpoint = resolver.resolve_endpoint(&params);
2332        let error = endpoint.expect_err("expected error: AccountId must only contain a-z, A-Z, 0-9 and `-`. [invalid account id prefix @us-east-1]");
2333        assert_eq!(format!("{}", error), "AccountId must only contain a-z, A-Z, 0-9 and `-`.")
2334    }
2335
2336    /// custom account id prefix with fips@us-east-1
2337    #[test]
2338    fn test_73() {
2339        let params = crate::config::endpoint::Params::builder()
2340            .account_id("123456789012".to_string())
2341            .region("us-east-1".to_string())
2342            .requires_account_id(true)
2343            .use_dual_stack(false)
2344            .use_fips(true)
2345            .build()
2346            .expect("invalid params");
2347        let resolver = crate::config::endpoint::DefaultResolver::new();
2348        let endpoint = resolver.resolve_endpoint(&params);
2349        let endpoint = endpoint.expect("Expected valid endpoint: https://123456789012.s3-control-fips.us-east-1.amazonaws.com");
2350        assert_eq!(
2351            endpoint,
2352            ::aws_smithy_types::endpoint::Endpoint::builder()
2353                .url("https://123456789012.s3-control-fips.us-east-1.amazonaws.com")
2354                .property(
2355                    "authSchemes",
2356                    vec![{
2357                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2358                        out.insert("name".to_string(), "sigv4".to_string().into());
2359                        out.insert("signingName".to_string(), "s3".to_string().into());
2360                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
2361                        out.insert("disableDoubleEncoding".to_string(), true.into());
2362                        out
2363                    }
2364                    .into()]
2365                )
2366                .build()
2367        );
2368    }
2369
2370    /// custom account id prefix with dualstack,fips@us-east-1
2371    #[test]
2372    fn test_74() {
2373        let params = crate::config::endpoint::Params::builder()
2374            .account_id("123456789012".to_string())
2375            .region("us-east-1".to_string())
2376            .requires_account_id(true)
2377            .use_dual_stack(true)
2378            .use_fips(true)
2379            .build()
2380            .expect("invalid params");
2381        let resolver = crate::config::endpoint::DefaultResolver::new();
2382        let endpoint = resolver.resolve_endpoint(&params);
2383        let endpoint = endpoint.expect("Expected valid endpoint: https://123456789012.s3-control-fips.dualstack.us-east-1.amazonaws.com");
2384        assert_eq!(
2385            endpoint,
2386            ::aws_smithy_types::endpoint::Endpoint::builder()
2387                .url("https://123456789012.s3-control-fips.dualstack.us-east-1.amazonaws.com")
2388                .property(
2389                    "authSchemes",
2390                    vec![{
2391                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2392                        out.insert("name".to_string(), "sigv4".to_string().into());
2393                        out.insert("signingName".to_string(), "s3".to_string().into());
2394                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
2395                        out.insert("disableDoubleEncoding".to_string(), true.into());
2396                        out
2397                    }
2398                    .into()]
2399                )
2400                .build()
2401        );
2402    }
2403
2404    /// custom account id with custom endpoint
2405    #[test]
2406    fn test_75() {
2407        let params = crate::config::endpoint::Params::builder()
2408            .account_id("123456789012".to_string())
2409            .region("us-east-1".to_string())
2410            .requires_account_id(true)
2411            .endpoint("https://example.com".to_string())
2412            .build()
2413            .expect("invalid params");
2414        let resolver = crate::config::endpoint::DefaultResolver::new();
2415        let endpoint = resolver.resolve_endpoint(&params);
2416        let endpoint = endpoint.expect("Expected valid endpoint: https://123456789012.example.com");
2417        assert_eq!(
2418            endpoint,
2419            ::aws_smithy_types::endpoint::Endpoint::builder()
2420                .url("https://123456789012.example.com")
2421                .property(
2422                    "authSchemes",
2423                    vec![{
2424                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2425                        out.insert("name".to_string(), "sigv4".to_string().into());
2426                        out.insert("signingName".to_string(), "s3".to_string().into());
2427                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
2428                        out.insert("disableDoubleEncoding".to_string(), true.into());
2429                        out
2430                    }
2431                    .into()]
2432                )
2433                .build()
2434        );
2435    }
2436
2437    /// RequiresAccountId with AccountId unset
2438    #[test]
2439    fn test_76() {
2440        let params = crate::config::endpoint::Params::builder()
2441            .region("us-east-1".to_string())
2442            .requires_account_id(true)
2443            .build()
2444            .expect("invalid params");
2445        let resolver = crate::config::endpoint::DefaultResolver::new();
2446        let endpoint = resolver.resolve_endpoint(&params);
2447        let error = endpoint.expect_err("expected error: AccountId is required but not set [RequiresAccountId with AccountId unset]");
2448        assert_eq!(format!("{}", error), "AccountId is required but not set")
2449    }
2450
2451    /// RequiresAccountId with AccountId unset and custom endpoint
2452    #[test]
2453    fn test_77() {
2454        let params = crate::config::endpoint::Params::builder()
2455            .region("us-east-1".to_string())
2456            .endpoint("https://beta.example.com".to_string())
2457            .requires_account_id(true)
2458            .build()
2459            .expect("invalid params");
2460        let resolver = crate::config::endpoint::DefaultResolver::new();
2461        let endpoint = resolver.resolve_endpoint(&params);
2462        let error =
2463            endpoint.expect_err("expected error: AccountId is required but not set [RequiresAccountId with AccountId unset and custom endpoint]");
2464        assert_eq!(format!("{}", error), "AccountId is required but not set")
2465    }
2466
2467    /// RequiresAccountId with invalid AccountId and custom endpoint
2468    #[test]
2469    fn test_78() {
2470        let params = crate::config::endpoint::Params::builder()
2471            .region("us-east-1".to_string())
2472            .endpoint("https://beta.example.com".to_string())
2473            .account_id("/?invalid&not-host*label".to_string())
2474            .requires_account_id(true)
2475            .build()
2476            .expect("invalid params");
2477        let resolver = crate::config::endpoint::DefaultResolver::new();
2478        let endpoint = resolver.resolve_endpoint(&params);
2479        let error = endpoint.expect_err(
2480            "expected error: AccountId must only contain a-z, A-Z, 0-9 and `-`. [RequiresAccountId with invalid AccountId and custom endpoint]",
2481        );
2482        assert_eq!(format!("{}", error), "AccountId must only contain a-z, A-Z, 0-9 and `-`.")
2483    }
2484
2485    /// account id with custom endpoint, fips
2486    #[test]
2487    fn test_79() {
2488        let params = crate::config::endpoint::Params::builder()
2489            .account_id("123456789012".to_string())
2490            .region("us-east-1".to_string())
2491            .requires_account_id(true)
2492            .endpoint("https://example.com".to_string())
2493            .use_fips(true)
2494            .build()
2495            .expect("invalid params");
2496        let resolver = crate::config::endpoint::DefaultResolver::new();
2497        let endpoint = resolver.resolve_endpoint(&params);
2498        let endpoint = endpoint.expect("Expected valid endpoint: https://123456789012.example.com");
2499        assert_eq!(
2500            endpoint,
2501            ::aws_smithy_types::endpoint::Endpoint::builder()
2502                .url("https://123456789012.example.com")
2503                .property(
2504                    "authSchemes",
2505                    vec![{
2506                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2507                        out.insert("name".to_string(), "sigv4".to_string().into());
2508                        out.insert("signingName".to_string(), "s3".to_string().into());
2509                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
2510                        out.insert("disableDoubleEncoding".to_string(), true.into());
2511                        out
2512                    }
2513                    .into()]
2514                )
2515                .build()
2516        );
2517    }
2518
2519    /// custom endpoint, fips
2520    #[test]
2521    fn test_80() {
2522        let params = crate::config::endpoint::Params::builder()
2523            .region("us-east-1".to_string())
2524            .endpoint("https://example.com".to_string())
2525            .use_fips(true)
2526            .build()
2527            .expect("invalid params");
2528        let resolver = crate::config::endpoint::DefaultResolver::new();
2529        let endpoint = resolver.resolve_endpoint(&params);
2530        let endpoint = endpoint.expect("Expected valid endpoint: https://example.com");
2531        assert_eq!(
2532            endpoint,
2533            ::aws_smithy_types::endpoint::Endpoint::builder()
2534                .url("https://example.com")
2535                .property(
2536                    "authSchemes",
2537                    vec![{
2538                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2539                        out.insert("name".to_string(), "sigv4".to_string().into());
2540                        out.insert("signingName".to_string(), "s3".to_string().into());
2541                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
2542                        out.insert("disableDoubleEncoding".to_string(), true.into());
2543                        out
2544                    }
2545                    .into()]
2546                )
2547                .build()
2548        );
2549    }
2550
2551    /// custom endpoint, fips
2552    #[test]
2553    fn test_81() {
2554        let params = crate::config::endpoint::Params::builder()
2555            .region("us-east-1".to_string())
2556            .endpoint("https://example.com".to_string())
2557            .use_fips(true)
2558            .build()
2559            .expect("invalid params");
2560        let resolver = crate::config::endpoint::DefaultResolver::new();
2561        let endpoint = resolver.resolve_endpoint(&params);
2562        let endpoint = endpoint.expect("Expected valid endpoint: https://example.com");
2563        assert_eq!(
2564            endpoint,
2565            ::aws_smithy_types::endpoint::Endpoint::builder()
2566                .url("https://example.com")
2567                .property(
2568                    "authSchemes",
2569                    vec![{
2570                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2571                        out.insert("name".to_string(), "sigv4".to_string().into());
2572                        out.insert("signingName".to_string(), "s3".to_string().into());
2573                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
2574                        out.insert("disableDoubleEncoding".to_string(), true.into());
2575                        out
2576                    }
2577                    .into()]
2578                )
2579                .build()
2580        );
2581    }
2582
2583    /// custom endpoint, DualStack
2584    #[test]
2585    fn test_82() {
2586        let params = crate::config::endpoint::Params::builder()
2587            .region("us-east-1".to_string())
2588            .endpoint("https://example.com".to_string())
2589            .use_fips(false)
2590            .use_dual_stack(true)
2591            .build()
2592            .expect("invalid params");
2593        let resolver = crate::config::endpoint::DefaultResolver::new();
2594        let endpoint = resolver.resolve_endpoint(&params);
2595        let error = endpoint
2596            .expect_err("expected error: Invalid Configuration: DualStack and custom endpoint are not supported [custom endpoint, DualStack]");
2597        assert_eq!(
2598            format!("{}", error),
2599            "Invalid Configuration: DualStack and custom endpoint are not supported"
2600        )
2601    }
2602
2603    /// region not set
2604    #[test]
2605    fn test_83() {
2606        let params = crate::config::endpoint::Params::builder().build().expect("invalid params");
2607        let resolver = crate::config::endpoint::DefaultResolver::new();
2608        let endpoint = resolver.resolve_endpoint(&params);
2609        let error = endpoint.expect_err("expected error: Region must be set [region not set]");
2610        assert_eq!(format!("{}", error), "Region must be set")
2611    }
2612
2613    /// invalid partition
2614    #[test]
2615    fn test_84() {
2616        let params = crate::config::endpoint::Params::builder()
2617            .region("invalid-region 42".to_string())
2618            .build()
2619            .expect("invalid params");
2620        let resolver = crate::config::endpoint::DefaultResolver::new();
2621        let endpoint = resolver.resolve_endpoint(&params);
2622        let error = endpoint.expect_err("expected error: Invalid region: region was not a valid DNS name. [invalid partition]");
2623        assert_eq!(format!("{}", error), "Invalid region: region was not a valid DNS name.")
2624    }
2625
2626    /// ListRegionalBuckets + OutpostId without accountId set.
2627    #[test]
2628    fn test_85() {
2629        let params = crate::config::endpoint::Params::builder()
2630            .outpost_id("op-123".to_string())
2631            .region("us-east-2".to_string())
2632            .requires_account_id(true)
2633            .use_dual_stack(false)
2634            .use_fips(false)
2635            .build()
2636            .expect("invalid params");
2637        let resolver = crate::config::endpoint::DefaultResolver::new();
2638        let endpoint = resolver.resolve_endpoint(&params);
2639        let error = endpoint.expect_err("expected error: AccountId is required but not set [ListRegionalBuckets + OutpostId without accountId set.]");
2640        assert_eq!(format!("{}", error), "AccountId is required but not set")
2641    }
2642
2643    /// ListRegionalBuckets + OutpostId with invalid accountId set.
2644    #[test]
2645    fn test_86() {
2646        let params = crate::config::endpoint::Params::builder()
2647            .account_id("/?invalid&not-host*label".to_string())
2648            .outpost_id("op-123".to_string())
2649            .region("us-east-2".to_string())
2650            .requires_account_id(true)
2651            .use_dual_stack(false)
2652            .use_fips(false)
2653            .build()
2654            .expect("invalid params");
2655        let resolver = crate::config::endpoint::DefaultResolver::new();
2656        let endpoint = resolver.resolve_endpoint(&params);
2657        let error = endpoint.expect_err(
2658            "expected error: AccountId must only contain a-z, A-Z, 0-9 and `-`. [ListRegionalBuckets + OutpostId with invalid accountId set.]",
2659        );
2660        assert_eq!(format!("{}", error), "AccountId must only contain a-z, A-Z, 0-9 and `-`.")
2661    }
2662
2663    /// accesspoint set but missing accountId
2664    #[test]
2665    fn test_87() {
2666        let params = crate::config::endpoint::Params::builder()
2667            .access_point_name("myaccesspoint".to_string())
2668            .region("us-west-2".to_string())
2669            .requires_account_id(true)
2670            .use_dual_stack(false)
2671            .use_fips(false)
2672            .build()
2673            .expect("invalid params");
2674        let resolver = crate::config::endpoint::DefaultResolver::new();
2675        let endpoint = resolver.resolve_endpoint(&params);
2676        let error = endpoint.expect_err("expected error: AccountId is required but not set [accesspoint set but missing accountId]");
2677        assert_eq!(format!("{}", error), "AccountId is required but not set")
2678    }
2679
2680    /// outpost accesspoint ARN with missing accountId
2681    #[test]
2682    fn test_88() {
2683        let params = crate::config::endpoint::Params::builder()
2684            .access_point_name("arn:aws:s3-outposts:us-west-2::outpost:op-01234567890123456:outpost:op1".to_string())
2685            .region("us-west-2".to_string())
2686            .requires_account_id(true)
2687            .use_dual_stack(false)
2688            .use_fips(false)
2689            .build()
2690            .expect("invalid params");
2691        let resolver = crate::config::endpoint::DefaultResolver::new();
2692        let endpoint = resolver.resolve_endpoint(&params);
2693        let error = endpoint.expect_err("expected error: Invalid ARN: missing account ID [outpost accesspoint ARN with missing accountId]");
2694        assert_eq!(format!("{}", error), "Invalid ARN: missing account ID")
2695    }
2696
2697    /// bucket ARN with missing accountId
2698    #[test]
2699    fn test_89() {
2700        let params = crate::config::endpoint::Params::builder()
2701            .access_point_name("arn:aws:s3-outposts:us-west-2::outpost:op-01234567890123456:bucket:mybucket".to_string())
2702            .region("us-west-2".to_string())
2703            .requires_account_id(true)
2704            .use_dual_stack(false)
2705            .use_fips(false)
2706            .build()
2707            .expect("invalid params");
2708        let resolver = crate::config::endpoint::DefaultResolver::new();
2709        let endpoint = resolver.resolve_endpoint(&params);
2710        let error = endpoint.expect_err("expected error: Invalid ARN: missing account ID [bucket ARN with missing accountId]");
2711        assert_eq!(format!("{}", error), "Invalid ARN: missing account ID")
2712    }
2713
2714    /// endpoint url with accesspoint (non-arn)
2715    #[test]
2716    fn test_90() {
2717        let params = crate::config::endpoint::Params::builder()
2718            .access_point_name("apname".to_string())
2719            .endpoint("https://beta.example.com".to_string())
2720            .account_id("123456789012".to_string())
2721            .region("us-west-2".to_string())
2722            .requires_account_id(true)
2723            .use_dual_stack(false)
2724            .use_fips(false)
2725            .build()
2726            .expect("invalid params");
2727        let resolver = crate::config::endpoint::DefaultResolver::new();
2728        let endpoint = resolver.resolve_endpoint(&params);
2729        let endpoint = endpoint.expect("Expected valid endpoint: https://123456789012.beta.example.com");
2730        assert_eq!(
2731            endpoint,
2732            ::aws_smithy_types::endpoint::Endpoint::builder()
2733                .url("https://123456789012.beta.example.com")
2734                .property(
2735                    "authSchemes",
2736                    vec![{
2737                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2738                        out.insert("name".to_string(), "sigv4".to_string().into());
2739                        out.insert("signingName".to_string(), "s3".to_string().into());
2740                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
2741                        out.insert("disableDoubleEncoding".to_string(), true.into());
2742                        out
2743                    }
2744                    .into()]
2745                )
2746                .build()
2747        );
2748    }
2749
2750    /// access point name with an accesspoint arn@us-west-2
2751    #[test]
2752    fn test_91() {
2753        let params = crate::config::endpoint::Params::builder()
2754            .access_point_name("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
2755            .endpoint("https://beta.example.com".to_string())
2756            .region("us-west-2".to_string())
2757            .requires_account_id(true)
2758            .use_dual_stack(false)
2759            .use_fips(false)
2760            .build()
2761            .expect("invalid params");
2762        let resolver = crate::config::endpoint::DefaultResolver::new();
2763        let endpoint = resolver.resolve_endpoint(&params);
2764        let endpoint = endpoint.expect("Expected valid endpoint: https://beta.example.com");
2765        assert_eq!(
2766            endpoint,
2767            ::aws_smithy_types::endpoint::Endpoint::builder()
2768                .url("https://beta.example.com")
2769                .header("x-amz-account-id", "123456789012")
2770                .header("x-amz-outpost-id", "op-01234567890123456")
2771                .property(
2772                    "authSchemes",
2773                    vec![{
2774                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2775                        out.insert("name".to_string(), "sigv4".to_string().into());
2776                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
2777                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
2778                        out.insert("disableDoubleEncoding".to_string(), true.into());
2779                        out
2780                    }
2781                    .into()]
2782                )
2783                .build()
2784        );
2785    }
2786
2787    /// DualStack + Custom endpoint is not supported(non-arn)
2788    #[test]
2789    fn test_92() {
2790        let params = crate::config::endpoint::Params::builder()
2791            .access_point_name("apname".to_string())
2792            .endpoint("https://beta.example.com".to_string())
2793            .account_id("123456789012".to_string())
2794            .region("us-west-2".to_string())
2795            .requires_account_id(true)
2796            .use_dual_stack(true)
2797            .use_fips(false)
2798            .build()
2799            .expect("invalid params");
2800        let resolver = crate::config::endpoint::DefaultResolver::new();
2801        let endpoint = resolver.resolve_endpoint(&params);
2802        let error = endpoint.expect_err("expected error: Invalid Configuration: DualStack and custom endpoint are not supported [DualStack + Custom endpoint is not supported(non-arn)]");
2803        assert_eq!(
2804            format!("{}", error),
2805            "Invalid Configuration: DualStack and custom endpoint are not supported"
2806        )
2807    }
2808
2809    /// get bucket with custom endpoint and dualstack is not supported@us-west-2
2810    #[test]
2811    fn test_93() {
2812        let params = crate::config::endpoint::Params::builder()
2813            .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
2814            .endpoint("https://s3-outposts.us-west-2.api.aws".to_string())
2815            .region("us-west-2".to_string())
2816            .requires_account_id(true)
2817            .use_dual_stack(true)
2818            .use_fips(false)
2819            .build()
2820            .expect("invalid params");
2821        let resolver = crate::config::endpoint::DefaultResolver::new();
2822        let endpoint = resolver.resolve_endpoint(&params);
2823        let error = endpoint.expect_err("expected error: Invalid Configuration: DualStack and custom endpoint are not supported [get bucket with custom endpoint and dualstack is not supported@us-west-2]");
2824        assert_eq!(
2825            format!("{}", error),
2826            "Invalid Configuration: DualStack and custom endpoint are not supported"
2827        )
2828    }
2829
2830    /// ListRegionalBuckets + OutpostId with fips in CN.
2831    #[test]
2832    fn test_94() {
2833        let params = crate::config::endpoint::Params::builder()
2834            .account_id("012345678912".to_string())
2835            .outpost_id("op-123".to_string())
2836            .region("cn-north-1".to_string())
2837            .requires_account_id(true)
2838            .use_dual_stack(false)
2839            .use_fips(true)
2840            .build()
2841            .expect("invalid params");
2842        let resolver = crate::config::endpoint::DefaultResolver::new();
2843        let endpoint = resolver.resolve_endpoint(&params);
2844        let error = endpoint.expect_err("expected error: Partition does not support FIPS [ListRegionalBuckets + OutpostId with fips in CN.]");
2845        assert_eq!(format!("{}", error), "Partition does not support FIPS")
2846    }
2847
2848    /// ListRegionalBuckets + invalid OutpostId.
2849    #[test]
2850    fn test_95() {
2851        let params = crate::config::endpoint::Params::builder()
2852            .account_id("012345678912".to_string())
2853            .outpost_id("?outpost/invalid+".to_string())
2854            .region("us-west-1".to_string())
2855            .requires_account_id(true)
2856            .use_dual_stack(false)
2857            .use_fips(false)
2858            .build()
2859            .expect("invalid params");
2860        let resolver = crate::config::endpoint::DefaultResolver::new();
2861        let endpoint = resolver.resolve_endpoint(&params);
2862        let error =
2863            endpoint.expect_err("expected error: OutpostId must only contain a-z, A-Z, 0-9 and `-`. [ListRegionalBuckets + invalid OutpostId.]");
2864        assert_eq!(format!("{}", error), "OutpostId must only contain a-z, A-Z, 0-9 and `-`.")
2865    }
2866
2867    /// bucket ARN with mismatched accountId
2868    #[test]
2869    fn test_96() {
2870        let params = crate::config::endpoint::Params::builder()
2871            .bucket("arn:aws:s3-outposts:us-west-2:999999:outpost:op-01234567890123456:bucket:mybucket".to_string())
2872            .account_id("012345678912".to_string())
2873            .region("us-west-2".to_string())
2874            .requires_account_id(true)
2875            .use_dual_stack(false)
2876            .use_fips(false)
2877            .build()
2878            .expect("invalid params");
2879        let resolver = crate::config::endpoint::DefaultResolver::new();
2880        let endpoint = resolver.resolve_endpoint(&params);
2881        let error = endpoint.expect_err("expected error: Invalid ARN: the accountId specified in the ARN (`999999`) does not match the parameter (`012345678912`) [bucket ARN with mismatched accountId]");
2882        assert_eq!(
2883            format!("{}", error),
2884            "Invalid ARN: the accountId specified in the ARN (`999999`) does not match the parameter (`012345678912`)"
2885        )
2886    }
2887
2888    /// OutpostId with invalid region
2889    #[test]
2890    fn test_97() {
2891        let params = crate::config::endpoint::Params::builder()
2892            .outpost_id("op-123".to_string())
2893            .region("invalid-region 42".to_string())
2894            .account_id("0123456".to_string())
2895            .requires_account_id(true)
2896            .use_dual_stack(false)
2897            .use_fips(false)
2898            .build()
2899            .expect("invalid params");
2900        let resolver = crate::config::endpoint::DefaultResolver::new();
2901        let endpoint = resolver.resolve_endpoint(&params);
2902        let error = endpoint.expect_err("expected error: Invalid region: region was not a valid DNS name. [OutpostId with invalid region]");
2903        assert_eq!(format!("{}", error), "Invalid region: region was not a valid DNS name.")
2904    }
2905
2906    /// OutpostId with RequireAccountId unset
2907    #[test]
2908    fn test_98() {
2909        let params = crate::config::endpoint::Params::builder()
2910            .outpost_id("op-123".to_string())
2911            .region("us-west-2".to_string())
2912            .use_dual_stack(false)
2913            .use_fips(false)
2914            .build()
2915            .expect("invalid params");
2916        let resolver = crate::config::endpoint::DefaultResolver::new();
2917        let endpoint = resolver.resolve_endpoint(&params);
2918        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-west-2.amazonaws.com");
2919        assert_eq!(
2920            endpoint,
2921            ::aws_smithy_types::endpoint::Endpoint::builder()
2922                .url("https://s3-outposts.us-west-2.amazonaws.com")
2923                .property(
2924                    "authSchemes",
2925                    vec![{
2926                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
2927                        out.insert("name".to_string(), "sigv4".to_string().into());
2928                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
2929                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
2930                        out.insert("disableDoubleEncoding".to_string(), true.into());
2931                        out
2932                    }
2933                    .into()]
2934                )
2935                .build()
2936        );
2937    }
2938
2939    /// Outpost Accesspoint ARN with arn region and client region mismatch with UseArnRegion=false
2940    #[test]
2941    fn test_99() {
2942        let params = crate::config::endpoint::Params::builder()
2943            .access_point_name("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
2944            .account_id("123456789012".to_string())
2945            .region("us-west-2".to_string())
2946            .requires_account_id(true)
2947            .use_arn_region(false)
2948            .use_dual_stack(false)
2949            .use_fips(false)
2950            .build()
2951            .expect("invalid params");
2952        let resolver = crate::config::endpoint::DefaultResolver::new();
2953        let endpoint = resolver.resolve_endpoint(&params);
2954        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` [Outpost Accesspoint ARN with arn region and client region mismatch with UseArnRegion=false]");
2955        assert_eq!(
2956            format!("{}", error),
2957            "Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false`"
2958        )
2959    }
2960
2961    /// Outpost Bucket ARN with arn region and client region mismatch with UseArnRegion=false
2962    #[test]
2963    fn test_100() {
2964        let params = crate::config::endpoint::Params::builder()
2965            .bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
2966            .endpoint("https://beta.example.com".to_string())
2967            .region("us-west-2".to_string())
2968            .requires_account_id(true)
2969            .use_arn_region(false)
2970            .use_dual_stack(false)
2971            .use_fips(false)
2972            .build()
2973            .expect("invalid params");
2974        let resolver = crate::config::endpoint::DefaultResolver::new();
2975        let endpoint = resolver.resolve_endpoint(&params);
2976        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` [Outpost Bucket ARN with arn region and client region mismatch with UseArnRegion=false]");
2977        assert_eq!(
2978            format!("{}", error),
2979            "Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false`"
2980        )
2981    }
2982
2983    /// Accesspoint ARN with region mismatch and UseArnRegion unset
2984    #[test]
2985    fn test_101() {
2986        let params = crate::config::endpoint::Params::builder()
2987            .access_point_name("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
2988            .account_id("123456789012".to_string())
2989            .region("us-west-2".to_string())
2990            .requires_account_id(true)
2991            .use_dual_stack(false)
2992            .use_fips(false)
2993            .build()
2994            .expect("invalid params");
2995        let resolver = crate::config::endpoint::DefaultResolver::new();
2996        let endpoint = resolver.resolve_endpoint(&params);
2997        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-east-1.amazonaws.com");
2998        assert_eq!(
2999            endpoint,
3000            ::aws_smithy_types::endpoint::Endpoint::builder()
3001                .url("https://s3-outposts.us-east-1.amazonaws.com")
3002                .header("x-amz-account-id", "123456789012")
3003                .header("x-amz-outpost-id", "op-01234567890123456")
3004                .property(
3005                    "authSchemes",
3006                    vec![{
3007                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3008                        out.insert("name".to_string(), "sigv4".to_string().into());
3009                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
3010                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
3011                        out.insert("disableDoubleEncoding".to_string(), true.into());
3012                        out
3013                    }
3014                    .into()]
3015                )
3016                .build()
3017        );
3018    }
3019
3020    /// Bucket ARN with region mismatch and UseArnRegion unset
3021    #[test]
3022    fn test_102() {
3023        let params = crate::config::endpoint::Params::builder()
3024            .bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
3025            .region("us-west-2".to_string())
3026            .requires_account_id(true)
3027            .use_dual_stack(false)
3028            .use_fips(false)
3029            .build()
3030            .expect("invalid params");
3031        let resolver = crate::config::endpoint::DefaultResolver::new();
3032        let endpoint = resolver.resolve_endpoint(&params);
3033        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-east-1.amazonaws.com");
3034        assert_eq!(
3035            endpoint,
3036            ::aws_smithy_types::endpoint::Endpoint::builder()
3037                .url("https://s3-outposts.us-east-1.amazonaws.com")
3038                .header("x-amz-account-id", "123456789012")
3039                .header("x-amz-outpost-id", "op-01234567890123456")
3040                .property(
3041                    "authSchemes",
3042                    vec![{
3043                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3044                        out.insert("name".to_string(), "sigv4".to_string().into());
3045                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
3046                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
3047                        out.insert("disableDoubleEncoding".to_string(), true.into());
3048                        out
3049                    }
3050                    .into()]
3051                )
3052                .build()
3053        );
3054    }
3055
3056    /// Outpost Bucket ARN with partition mismatch with UseArnRegion=true
3057    #[test]
3058    fn test_103() {
3059        let params = crate::config::endpoint::Params::builder()
3060            .bucket("arn:aws:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
3061            .region("us-west-2".to_string())
3062            .requires_account_id(true)
3063            .use_arn_region(true)
3064            .use_dual_stack(false)
3065            .use_fips(false)
3066            .build()
3067            .expect("invalid params");
3068        let resolver = crate::config::endpoint::DefaultResolver::new();
3069        let endpoint = resolver.resolve_endpoint(&params);
3070        let error = endpoint.expect_err("expected error: Client was configured for partition `aws` but ARN has `aws-cn` [Outpost Bucket ARN with partition mismatch with UseArnRegion=true]");
3071        assert_eq!(format!("{}", error), "Client was configured for partition `aws` but ARN has `aws-cn`")
3072    }
3073
3074    /// Accesspoint ARN with partition mismatch and UseArnRegion=true
3075    #[test]
3076    fn test_104() {
3077        let params = crate::config::endpoint::Params::builder()
3078            .access_point_name("arn:aws:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
3079            .account_id("123456789012".to_string())
3080            .region("us-west-2".to_string())
3081            .requires_account_id(true)
3082            .use_dual_stack(false)
3083            .use_arn_region(true)
3084            .use_fips(false)
3085            .build()
3086            .expect("invalid params");
3087        let resolver = crate::config::endpoint::DefaultResolver::new();
3088        let endpoint = resolver.resolve_endpoint(&params);
3089        let error = endpoint.expect_err("expected error: Client was configured for partition `aws` but ARN has `aws-cn` [Accesspoint ARN with partition mismatch and UseArnRegion=true]");
3090        assert_eq!(format!("{}", error), "Client was configured for partition `aws` but ARN has `aws-cn`")
3091    }
3092
3093    /// Accesspoint ARN with region mismatch, UseArnRegion=false and custom endpoint
3094    #[test]
3095    fn test_105() {
3096        let params = crate::config::endpoint::Params::builder()
3097            .access_point_name("arn:aws:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
3098            .region("us-west-2".to_string())
3099            .endpoint("https://example.com".to_string())
3100            .requires_account_id(true)
3101            .use_dual_stack(false)
3102            .use_arn_region(false)
3103            .use_fips(false)
3104            .build()
3105            .expect("invalid params");
3106        let resolver = crate::config::endpoint::DefaultResolver::new();
3107        let endpoint = resolver.resolve_endpoint(&params);
3108        let error = endpoint.expect_err("expected error: Invalid configuration: region from ARN `cn-north-1` does not match client region `us-west-2` and UseArnRegion is `false` [Accesspoint ARN with region mismatch, UseArnRegion=false and custom endpoint]");
3109        assert_eq!(
3110            format!("{}", error),
3111            "Invalid configuration: region from ARN `cn-north-1` does not match client region `us-west-2` and UseArnRegion is `false`"
3112        )
3113    }
3114
3115    /// outpost bucket arn@us-west-2
3116    #[test]
3117    fn test_106() {
3118        let params = crate::config::endpoint::Params::builder()
3119            .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
3120            .region("us-west-2".to_string())
3121            .requires_account_id(true)
3122            .use_dual_stack(false)
3123            .use_fips(false)
3124            .build()
3125            .expect("invalid params");
3126        let resolver = crate::config::endpoint::DefaultResolver::new();
3127        let endpoint = resolver.resolve_endpoint(&params);
3128        let endpoint = endpoint.expect("Expected valid endpoint: https://s3-outposts.us-west-2.amazonaws.com");
3129        assert_eq!(
3130            endpoint,
3131            ::aws_smithy_types::endpoint::Endpoint::builder()
3132                .url("https://s3-outposts.us-west-2.amazonaws.com")
3133                .header("x-amz-account-id", "123456789012")
3134                .header("x-amz-outpost-id", "op-01234567890123456")
3135                .property(
3136                    "authSchemes",
3137                    vec![{
3138                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3139                        out.insert("name".to_string(), "sigv4".to_string().into());
3140                        out.insert("signingName".to_string(), "s3-outposts".to_string().into());
3141                        out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
3142                        out.insert("disableDoubleEncoding".to_string(), true.into());
3143                        out
3144                    }
3145                    .into()]
3146                )
3147                .build()
3148        );
3149    }
3150
3151    /// S3 Snow Control with bucket
3152    #[test]
3153    fn test_107() {
3154        let params = crate::config::endpoint::Params::builder()
3155            .region("snow".to_string())
3156            .bucket("bucketName".to_string())
3157            .endpoint("https://10.0.1.12:433".to_string())
3158            .use_fips(false)
3159            .use_dual_stack(false)
3160            .build()
3161            .expect("invalid params");
3162        let resolver = crate::config::endpoint::DefaultResolver::new();
3163        let endpoint = resolver.resolve_endpoint(&params);
3164        let endpoint = endpoint.expect("Expected valid endpoint: https://10.0.1.12:433");
3165        assert_eq!(
3166            endpoint,
3167            ::aws_smithy_types::endpoint::Endpoint::builder()
3168                .url("https://10.0.1.12:433")
3169                .property(
3170                    "authSchemes",
3171                    vec![{
3172                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3173                        out.insert("name".to_string(), "sigv4".to_string().into());
3174                        out.insert("signingName".to_string(), "s3".to_string().into());
3175                        out.insert("signingRegion".to_string(), "snow".to_string().into());
3176                        out.insert("disableDoubleEncoding".to_string(), true.into());
3177                        out
3178                    }
3179                    .into()]
3180                )
3181                .build()
3182        );
3183    }
3184
3185    /// S3 Snow Control without bucket
3186    #[test]
3187    fn test_108() {
3188        let params = crate::config::endpoint::Params::builder()
3189            .region("snow".to_string())
3190            .endpoint("https://10.0.1.12:433".to_string())
3191            .use_fips(false)
3192            .use_dual_stack(false)
3193            .build()
3194            .expect("invalid params");
3195        let resolver = crate::config::endpoint::DefaultResolver::new();
3196        let endpoint = resolver.resolve_endpoint(&params);
3197        let endpoint = endpoint.expect("Expected valid endpoint: https://10.0.1.12:433");
3198        assert_eq!(
3199            endpoint,
3200            ::aws_smithy_types::endpoint::Endpoint::builder()
3201                .url("https://10.0.1.12:433")
3202                .property(
3203                    "authSchemes",
3204                    vec![{
3205                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3206                        out.insert("name".to_string(), "sigv4".to_string().into());
3207                        out.insert("signingName".to_string(), "s3".to_string().into());
3208                        out.insert("signingRegion".to_string(), "snow".to_string().into());
3209                        out.insert("disableDoubleEncoding".to_string(), true.into());
3210                        out
3211                    }
3212                    .into()]
3213                )
3214                .build()
3215        );
3216    }
3217
3218    /// S3 Snow Control with bucket and without port
3219    #[test]
3220    fn test_109() {
3221        let params = crate::config::endpoint::Params::builder()
3222            .region("snow".to_string())
3223            .bucket("bucketName".to_string())
3224            .endpoint("https://10.0.1.12".to_string())
3225            .use_fips(false)
3226            .use_dual_stack(false)
3227            .build()
3228            .expect("invalid params");
3229        let resolver = crate::config::endpoint::DefaultResolver::new();
3230        let endpoint = resolver.resolve_endpoint(&params);
3231        let endpoint = endpoint.expect("Expected valid endpoint: https://10.0.1.12");
3232        assert_eq!(
3233            endpoint,
3234            ::aws_smithy_types::endpoint::Endpoint::builder()
3235                .url("https://10.0.1.12")
3236                .property(
3237                    "authSchemes",
3238                    vec![{
3239                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3240                        out.insert("name".to_string(), "sigv4".to_string().into());
3241                        out.insert("signingName".to_string(), "s3".to_string().into());
3242                        out.insert("signingRegion".to_string(), "snow".to_string().into());
3243                        out.insert("disableDoubleEncoding".to_string(), true.into());
3244                        out
3245                    }
3246                    .into()]
3247                )
3248                .build()
3249        );
3250    }
3251
3252    /// S3 Snow Control with bucket and with DNS
3253    #[test]
3254    fn test_110() {
3255        let params = crate::config::endpoint::Params::builder()
3256            .region("snow".to_string())
3257            .bucket("bucketName".to_string())
3258            .endpoint("http://s3snow.com".to_string())
3259            .use_fips(false)
3260            .use_dual_stack(false)
3261            .build()
3262            .expect("invalid params");
3263        let resolver = crate::config::endpoint::DefaultResolver::new();
3264        let endpoint = resolver.resolve_endpoint(&params);
3265        let endpoint = endpoint.expect("Expected valid endpoint: http://s3snow.com");
3266        assert_eq!(
3267            endpoint,
3268            ::aws_smithy_types::endpoint::Endpoint::builder()
3269                .url("http://s3snow.com")
3270                .property(
3271                    "authSchemes",
3272                    vec![{
3273                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3274                        out.insert("name".to_string(), "sigv4".to_string().into());
3275                        out.insert("signingName".to_string(), "s3".to_string().into());
3276                        out.insert("signingRegion".to_string(), "snow".to_string().into());
3277                        out.insert("disableDoubleEncoding".to_string(), true.into());
3278                        out
3279                    }
3280                    .into()]
3281                )
3282                .build()
3283        );
3284    }
3285
3286    /// S3 Snow Control with FIPS enabled
3287    #[test]
3288    fn test_111() {
3289        let params = crate::config::endpoint::Params::builder()
3290            .region("snow".to_string())
3291            .bucket("bucketName".to_string())
3292            .endpoint("https://10.0.1.12:433".to_string())
3293            .use_fips(true)
3294            .use_dual_stack(false)
3295            .build()
3296            .expect("invalid params");
3297        let resolver = crate::config::endpoint::DefaultResolver::new();
3298        let endpoint = resolver.resolve_endpoint(&params);
3299        let error = endpoint.expect_err("expected error: S3 Snow does not support FIPS [S3 Snow Control with FIPS enabled]");
3300        assert_eq!(format!("{}", error), "S3 Snow does not support FIPS")
3301    }
3302
3303    /// S3 Snow Control with Dualstack enabled
3304    #[test]
3305    fn test_112() {
3306        let params = crate::config::endpoint::Params::builder()
3307            .region("snow".to_string())
3308            .bucket("bucketName".to_string())
3309            .endpoint("https://10.0.1.12:433".to_string())
3310            .use_fips(false)
3311            .use_dual_stack(true)
3312            .build()
3313            .expect("invalid params");
3314        let resolver = crate::config::endpoint::DefaultResolver::new();
3315        let endpoint = resolver.resolve_endpoint(&params);
3316        let error = endpoint.expect_err("expected error: S3 Snow does not support DualStack [S3 Snow Control with Dualstack enabled]");
3317        assert_eq!(format!("{}", error), "S3 Snow does not support DualStack")
3318    }
3319
3320    /// Tagging on express bucket routed to s3express-control
3321    #[test]
3322    fn test_113() {
3323        let params = crate::config::endpoint::Params::builder()
3324            .resource_arn("arn:aws:s3express:us-east-1:871317572157:bucket/crachlintest--use1-az4--x-s3".to_string())
3325            .account_id("871317572157".to_string())
3326            .region("us-east-1".to_string())
3327            .requires_account_id(true)
3328            .use_dual_stack(false)
3329            .use_fips(false)
3330            .build()
3331            .expect("invalid params");
3332        let resolver = crate::config::endpoint::DefaultResolver::new();
3333        let endpoint = resolver.resolve_endpoint(&params);
3334        let endpoint = endpoint.expect("Expected valid endpoint: https://s3express-control.us-east-1.amazonaws.com");
3335        assert_eq!(
3336            endpoint,
3337            ::aws_smithy_types::endpoint::Endpoint::builder()
3338                .url("https://s3express-control.us-east-1.amazonaws.com")
3339                .property(
3340                    "authSchemes",
3341                    vec![{
3342                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3343                        out.insert("name".to_string(), "sigv4".to_string().into());
3344                        out.insert("signingName".to_string(), "s3express".to_string().into());
3345                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
3346                        out.insert("disableDoubleEncoding".to_string(), true.into());
3347                        out
3348                    }
3349                    .into()]
3350                )
3351                .build()
3352        );
3353    }
3354
3355    /// Tagging on express ap routed to s3express-control
3356    #[test]
3357    fn test_114() {
3358        let params = crate::config::endpoint::Params::builder()
3359            .resource_arn("arn:aws:s3express:us-east-1:871317572157:accesspoint/crachlintest--use1-az4--xa-s3".to_string())
3360            .account_id("871317572157".to_string())
3361            .region("us-east-1".to_string())
3362            .requires_account_id(true)
3363            .use_dual_stack(false)
3364            .use_fips(false)
3365            .build()
3366            .expect("invalid params");
3367        let resolver = crate::config::endpoint::DefaultResolver::new();
3368        let endpoint = resolver.resolve_endpoint(&params);
3369        let endpoint = endpoint.expect("Expected valid endpoint: https://s3express-control.us-east-1.amazonaws.com");
3370        assert_eq!(
3371            endpoint,
3372            ::aws_smithy_types::endpoint::Endpoint::builder()
3373                .url("https://s3express-control.us-east-1.amazonaws.com")
3374                .property(
3375                    "authSchemes",
3376                    vec![{
3377                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3378                        out.insert("name".to_string(), "sigv4".to_string().into());
3379                        out.insert("signingName".to_string(), "s3express".to_string().into());
3380                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
3381                        out.insert("disableDoubleEncoding".to_string(), true.into());
3382                        out
3383                    }
3384                    .into()]
3385                )
3386                .build()
3387        );
3388    }
3389
3390    /// Tagging on express bucket routed to s3express-control FIPS when FIPS enabled
3391    #[test]
3392    fn test_115() {
3393        let params = crate::config::endpoint::Params::builder()
3394            .resource_arn("arn:aws:s3express:us-east-1:871317572157:bucket/crachlintest--use1-az4--x-s3".to_string())
3395            .account_id("871317572157".to_string())
3396            .region("us-east-1".to_string())
3397            .requires_account_id(true)
3398            .use_dual_stack(false)
3399            .use_fips(true)
3400            .build()
3401            .expect("invalid params");
3402        let resolver = crate::config::endpoint::DefaultResolver::new();
3403        let endpoint = resolver.resolve_endpoint(&params);
3404        let endpoint = endpoint.expect("Expected valid endpoint: https://s3express-control-fips.us-east-1.amazonaws.com");
3405        assert_eq!(
3406            endpoint,
3407            ::aws_smithy_types::endpoint::Endpoint::builder()
3408                .url("https://s3express-control-fips.us-east-1.amazonaws.com")
3409                .property(
3410                    "authSchemes",
3411                    vec![{
3412                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3413                        out.insert("name".to_string(), "sigv4".to_string().into());
3414                        out.insert("signingName".to_string(), "s3express".to_string().into());
3415                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
3416                        out.insert("disableDoubleEncoding".to_string(), true.into());
3417                        out
3418                    }
3419                    .into()]
3420                )
3421                .build()
3422        );
3423    }
3424
3425    /// Tagging on express bucket cn routed to s3express-control china endpoint
3426    #[test]
3427    fn test_116() {
3428        let params = crate::config::endpoint::Params::builder()
3429            .resource_arn("arn:aws-cn:s3express:cn-north-1:871317572157:bucket/crachlintest--use1-az4--x-s3".to_string())
3430            .account_id("871317572157".to_string())
3431            .region("cn-north-1".to_string())
3432            .requires_account_id(true)
3433            .use_dual_stack(false)
3434            .use_fips(false)
3435            .build()
3436            .expect("invalid params");
3437        let resolver = crate::config::endpoint::DefaultResolver::new();
3438        let endpoint = resolver.resolve_endpoint(&params);
3439        let endpoint = endpoint.expect("Expected valid endpoint: https://s3express-control.cn-north-1.amazonaws.com.cn");
3440        assert_eq!(
3441            endpoint,
3442            ::aws_smithy_types::endpoint::Endpoint::builder()
3443                .url("https://s3express-control.cn-north-1.amazonaws.com.cn")
3444                .property(
3445                    "authSchemes",
3446                    vec![{
3447                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3448                        out.insert("name".to_string(), "sigv4".to_string().into());
3449                        out.insert("signingName".to_string(), "s3express".to_string().into());
3450                        out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
3451                        out.insert("disableDoubleEncoding".to_string(), true.into());
3452                        out
3453                    }
3454                    .into()]
3455                )
3456                .build()
3457        );
3458    }
3459
3460    /// Tagging on express bucket cn routed to s3express-control china endpoint with FIPS
3461    #[test]
3462    fn test_117() {
3463        let params = crate::config::endpoint::Params::builder()
3464            .resource_arn("arn:aws-cn:s3express:cn-north-1:871317572157:bucket/crachlintest--use1-az4--x-s3".to_string())
3465            .account_id("871317572157".to_string())
3466            .region("cn-north-1".to_string())
3467            .requires_account_id(true)
3468            .use_dual_stack(false)
3469            .use_fips(true)
3470            .build()
3471            .expect("invalid params");
3472        let resolver = crate::config::endpoint::DefaultResolver::new();
3473        let endpoint = resolver.resolve_endpoint(&params);
3474        let error = endpoint.expect_err(
3475            "expected error: Partition does not support FIPS [Tagging on express bucket cn routed to s3express-control china endpoint with FIPS]",
3476        );
3477        assert_eq!(format!("{}", error), "Partition does not support FIPS")
3478    }
3479
3480    /// Tagging on express bucket with custom endpoint routed to custom endpoint
3481    #[test]
3482    fn test_118() {
3483        let params = crate::config::endpoint::Params::builder()
3484            .resource_arn("arn:aws:s3express:us-east-1:871317572157:bucket/crachlintest--use1-az4--x-s3".to_string())
3485            .endpoint("https://my-endpoint.express-control.s3.aws.dev".to_string())
3486            .account_id("871317572157".to_string())
3487            .region("us-east-1".to_string())
3488            .requires_account_id(true)
3489            .use_dual_stack(false)
3490            .use_fips(false)
3491            .build()
3492            .expect("invalid params");
3493        let resolver = crate::config::endpoint::DefaultResolver::new();
3494        let endpoint = resolver.resolve_endpoint(&params);
3495        let endpoint = endpoint.expect("Expected valid endpoint: https://my-endpoint.express-control.s3.aws.dev");
3496        assert_eq!(
3497            endpoint,
3498            ::aws_smithy_types::endpoint::Endpoint::builder()
3499                .url("https://my-endpoint.express-control.s3.aws.dev")
3500                .property(
3501                    "authSchemes",
3502                    vec![{
3503                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3504                        out.insert("name".to_string(), "sigv4".to_string().into());
3505                        out.insert("signingName".to_string(), "s3express".to_string().into());
3506                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
3507                        out.insert("disableDoubleEncoding".to_string(), true.into());
3508                        out
3509                    }
3510                    .into()]
3511                )
3512                .build()
3513        );
3514    }
3515
3516    /// Tagging on express access point with custom endpoint routed to custom endpoint
3517    #[test]
3518    fn test_119() {
3519        let params = crate::config::endpoint::Params::builder()
3520            .resource_arn("arn:aws:s3express:us-east-1:871317572157:accesspoint/crachlintest--use1-az4--xa-s3".to_string())
3521            .endpoint("https://my-endpoint.express-control.s3.aws.dev".to_string())
3522            .account_id("871317572157".to_string())
3523            .region("us-east-1".to_string())
3524            .requires_account_id(true)
3525            .use_dual_stack(false)
3526            .use_fips(false)
3527            .build()
3528            .expect("invalid params");
3529        let resolver = crate::config::endpoint::DefaultResolver::new();
3530        let endpoint = resolver.resolve_endpoint(&params);
3531        let endpoint = endpoint.expect("Expected valid endpoint: https://my-endpoint.express-control.s3.aws.dev");
3532        assert_eq!(
3533            endpoint,
3534            ::aws_smithy_types::endpoint::Endpoint::builder()
3535                .url("https://my-endpoint.express-control.s3.aws.dev")
3536                .property(
3537                    "authSchemes",
3538                    vec![{
3539                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3540                        out.insert("name".to_string(), "sigv4".to_string().into());
3541                        out.insert("signingName".to_string(), "s3express".to_string().into());
3542                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
3543                        out.insert("disableDoubleEncoding".to_string(), true.into());
3544                        out
3545                    }
3546                    .into()]
3547                )
3548                .build()
3549        );
3550    }
3551
3552    /// Tagging on express bucket with dualstack and custom endpoint fails
3553    #[test]
3554    fn test_120() {
3555        let params = crate::config::endpoint::Params::builder()
3556            .resource_arn("arn:aws:s3express:us-east-1:871317572157:bucket/crachlintest--use1-az4--x-s3".to_string())
3557            .endpoint("https://my-endpoint.express-control.s3.aws.dev".to_string())
3558            .account_id("871317572157".to_string())
3559            .region("us-east-1".to_string())
3560            .requires_account_id(true)
3561            .use_dual_stack(true)
3562            .use_fips(false)
3563            .build()
3564            .expect("invalid params");
3565        let resolver = crate::config::endpoint::DefaultResolver::new();
3566        let endpoint = resolver.resolve_endpoint(&params);
3567        let error = endpoint.expect_err("expected error: Invalid Configuration: DualStack and custom endpoint are not supported [Tagging on express bucket with dualstack and custom endpoint fails]");
3568        assert_eq!(
3569            format!("{}", error),
3570            "Invalid Configuration: DualStack and custom endpoint are not supported"
3571        )
3572    }
3573
3574    /// Access Point APIs on express bucket routed to s3express-control
3575    #[test]
3576    fn test_121() {
3577        let params = crate::config::endpoint::Params::builder()
3578            .account_id("871317572157".to_string())
3579            .access_point_name("myaccesspoint--abcd-ab1--xa-s3".to_string())
3580            .region("us-east-1".to_string())
3581            .requires_account_id(true)
3582            .use_dual_stack(false)
3583            .use_fips(false)
3584            .build()
3585            .expect("invalid params");
3586        let resolver = crate::config::endpoint::DefaultResolver::new();
3587        let endpoint = resolver.resolve_endpoint(&params);
3588        let endpoint = endpoint.expect("Expected valid endpoint: https://s3express-control.us-east-1.amazonaws.com");
3589        assert_eq!(
3590            endpoint,
3591            ::aws_smithy_types::endpoint::Endpoint::builder()
3592                .url("https://s3express-control.us-east-1.amazonaws.com")
3593                .property(
3594                    "authSchemes",
3595                    vec![{
3596                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3597                        out.insert("name".to_string(), "sigv4".to_string().into());
3598                        out.insert("signingName".to_string(), "s3express".to_string().into());
3599                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
3600                        out.insert("disableDoubleEncoding".to_string(), true.into());
3601                        out
3602                    }
3603                    .into()]
3604                )
3605                .build()
3606        );
3607    }
3608
3609    /// Access Point APIs on express bucket routed to s3express-control for List
3610    #[test]
3611    fn test_122() {
3612        let params = crate::config::endpoint::Params::builder()
3613            .account_id("871317572157".to_string())
3614            .region("us-east-1".to_string())
3615            .use_s3_express_control_endpoint(true)
3616            .requires_account_id(true)
3617            .use_dual_stack(false)
3618            .use_fips(false)
3619            .build()
3620            .expect("invalid params");
3621        let resolver = crate::config::endpoint::DefaultResolver::new();
3622        let endpoint = resolver.resolve_endpoint(&params);
3623        let endpoint = endpoint.expect("Expected valid endpoint: https://s3express-control.us-east-1.amazonaws.com");
3624        assert_eq!(
3625            endpoint,
3626            ::aws_smithy_types::endpoint::Endpoint::builder()
3627                .url("https://s3express-control.us-east-1.amazonaws.com")
3628                .property(
3629                    "authSchemes",
3630                    vec![{
3631                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3632                        out.insert("name".to_string(), "sigv4".to_string().into());
3633                        out.insert("signingName".to_string(), "s3express".to_string().into());
3634                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
3635                        out.insert("disableDoubleEncoding".to_string(), true.into());
3636                        out
3637                    }
3638                    .into()]
3639                )
3640                .build()
3641        );
3642    }
3643
3644    /// Access Point APIs on express bucket routed to s3express-control for FIPS
3645    #[test]
3646    fn test_123() {
3647        let params = crate::config::endpoint::Params::builder()
3648            .account_id("871317572157".to_string())
3649            .access_point_name("myaccesspoint--abcd-ab1--xa-s3".to_string())
3650            .region("us-east-1".to_string())
3651            .requires_account_id(true)
3652            .use_dual_stack(false)
3653            .use_fips(true)
3654            .build()
3655            .expect("invalid params");
3656        let resolver = crate::config::endpoint::DefaultResolver::new();
3657        let endpoint = resolver.resolve_endpoint(&params);
3658        let endpoint = endpoint.expect("Expected valid endpoint: https://s3express-control-fips.us-east-1.amazonaws.com");
3659        assert_eq!(
3660            endpoint,
3661            ::aws_smithy_types::endpoint::Endpoint::builder()
3662                .url("https://s3express-control-fips.us-east-1.amazonaws.com")
3663                .property(
3664                    "authSchemes",
3665                    vec![{
3666                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3667                        out.insert("name".to_string(), "sigv4".to_string().into());
3668                        out.insert("signingName".to_string(), "s3express".to_string().into());
3669                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
3670                        out.insert("disableDoubleEncoding".to_string(), true.into());
3671                        out
3672                    }
3673                    .into()]
3674                )
3675                .build()
3676        );
3677    }
3678
3679    /// Access Point APIs on express bucket routed to s3express-control for FIPS for List
3680    #[test]
3681    fn test_124() {
3682        let params = crate::config::endpoint::Params::builder()
3683            .account_id("871317572157".to_string())
3684            .region("us-east-1".to_string())
3685            .use_s3_express_control_endpoint(true)
3686            .requires_account_id(true)
3687            .use_dual_stack(false)
3688            .use_fips(true)
3689            .build()
3690            .expect("invalid params");
3691        let resolver = crate::config::endpoint::DefaultResolver::new();
3692        let endpoint = resolver.resolve_endpoint(&params);
3693        let endpoint = endpoint.expect("Expected valid endpoint: https://s3express-control-fips.us-east-1.amazonaws.com");
3694        assert_eq!(
3695            endpoint,
3696            ::aws_smithy_types::endpoint::Endpoint::builder()
3697                .url("https://s3express-control-fips.us-east-1.amazonaws.com")
3698                .property(
3699                    "authSchemes",
3700                    vec![{
3701                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3702                        out.insert("name".to_string(), "sigv4".to_string().into());
3703                        out.insert("signingName".to_string(), "s3express".to_string().into());
3704                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
3705                        out.insert("disableDoubleEncoding".to_string(), true.into());
3706                        out
3707                    }
3708                    .into()]
3709                )
3710                .build()
3711        );
3712    }
3713
3714    /// Access Point APIs on express bucket routed to s3express-control for china region
3715    #[test]
3716    fn test_125() {
3717        let params = crate::config::endpoint::Params::builder()
3718            .access_point_name("myaccesspoint--abcd-ab1--xa-s3".to_string())
3719            .account_id("871317572157".to_string())
3720            .region("cn-north-1".to_string())
3721            .requires_account_id(true)
3722            .use_dual_stack(false)
3723            .use_fips(false)
3724            .build()
3725            .expect("invalid params");
3726        let resolver = crate::config::endpoint::DefaultResolver::new();
3727        let endpoint = resolver.resolve_endpoint(&params);
3728        let endpoint = endpoint.expect("Expected valid endpoint: https://s3express-control.cn-north-1.amazonaws.com.cn");
3729        assert_eq!(
3730            endpoint,
3731            ::aws_smithy_types::endpoint::Endpoint::builder()
3732                .url("https://s3express-control.cn-north-1.amazonaws.com.cn")
3733                .property(
3734                    "authSchemes",
3735                    vec![{
3736                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3737                        out.insert("name".to_string(), "sigv4".to_string().into());
3738                        out.insert("signingName".to_string(), "s3express".to_string().into());
3739                        out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
3740                        out.insert("disableDoubleEncoding".to_string(), true.into());
3741                        out
3742                    }
3743                    .into()]
3744                )
3745                .build()
3746        );
3747    }
3748
3749    /// Access Point APIs on express bucket routed to s3express-control for china region for List
3750    #[test]
3751    fn test_126() {
3752        let params = crate::config::endpoint::Params::builder()
3753            .account_id("871317572157".to_string())
3754            .region("cn-north-1".to_string())
3755            .use_s3_express_control_endpoint(true)
3756            .requires_account_id(true)
3757            .use_dual_stack(false)
3758            .use_fips(false)
3759            .build()
3760            .expect("invalid params");
3761        let resolver = crate::config::endpoint::DefaultResolver::new();
3762        let endpoint = resolver.resolve_endpoint(&params);
3763        let endpoint = endpoint.expect("Expected valid endpoint: https://s3express-control.cn-north-1.amazonaws.com.cn");
3764        assert_eq!(
3765            endpoint,
3766            ::aws_smithy_types::endpoint::Endpoint::builder()
3767                .url("https://s3express-control.cn-north-1.amazonaws.com.cn")
3768                .property(
3769                    "authSchemes",
3770                    vec![{
3771                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3772                        out.insert("name".to_string(), "sigv4".to_string().into());
3773                        out.insert("signingName".to_string(), "s3express".to_string().into());
3774                        out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
3775                        out.insert("disableDoubleEncoding".to_string(), true.into());
3776                        out
3777                    }
3778                    .into()]
3779                )
3780                .build()
3781        );
3782    }
3783
3784    /// Error when Access Point APIs on express bucket routed to s3express-control for china and FIPS
3785    #[test]
3786    fn test_127() {
3787        let params = crate::config::endpoint::Params::builder()
3788            .account_id("871317572157".to_string())
3789            .region("cn-north-1".to_string())
3790            .requires_account_id(true)
3791            .use_dual_stack(false)
3792            .use_fips(true)
3793            .build()
3794            .expect("invalid params");
3795        let resolver = crate::config::endpoint::DefaultResolver::new();
3796        let endpoint = resolver.resolve_endpoint(&params);
3797        let error = endpoint.expect_err("expected error: Partition does not support FIPS [Error when Access Point APIs on express bucket routed to s3express-control for china and FIPS]");
3798        assert_eq!(format!("{}", error), "Partition does not support FIPS")
3799    }
3800
3801    /// Error Access Point APIs on express bucket routed to s3express-control invalid zone
3802    #[test]
3803    fn test_128() {
3804        let params = crate::config::endpoint::Params::builder()
3805            .access_point_name("myaccesspoint-garbage-zone--xa-s3".to_string())
3806            .account_id("871317572157".to_string())
3807            .region("us-east-1".to_string())
3808            .requires_account_id(true)
3809            .use_dual_stack(false)
3810            .use_fips(false)
3811            .build()
3812            .expect("invalid params");
3813        let resolver = crate::config::endpoint::DefaultResolver::new();
3814        let endpoint = resolver.resolve_endpoint(&params);
3815        let error = endpoint.expect_err("expected error: Unrecognized S3Express Access Point name format. [Error Access Point APIs on express bucket routed to s3express-control invalid zone]");
3816        assert_eq!(format!("{}", error), "Unrecognized S3Express Access Point name format.")
3817    }
3818
3819    /// Access Point APIs on express bucket routed to custom endpoint if provided
3820    #[test]
3821    fn test_129() {
3822        let params = crate::config::endpoint::Params::builder()
3823            .account_id("871317572157".to_string())
3824            .access_point_name("myaccesspoint--abcd-ab1--xa-s3".to_string())
3825            .endpoint("https://my-endpoint.express-control.s3.aws.dev".to_string())
3826            .region("us-east-1".to_string())
3827            .requires_account_id(true)
3828            .use_dual_stack(false)
3829            .use_fips(false)
3830            .build()
3831            .expect("invalid params");
3832        let resolver = crate::config::endpoint::DefaultResolver::new();
3833        let endpoint = resolver.resolve_endpoint(&params);
3834        let endpoint = endpoint.expect("Expected valid endpoint: https://my-endpoint.express-control.s3.aws.dev");
3835        assert_eq!(
3836            endpoint,
3837            ::aws_smithy_types::endpoint::Endpoint::builder()
3838                .url("https://my-endpoint.express-control.s3.aws.dev")
3839                .property(
3840                    "authSchemes",
3841                    vec![{
3842                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3843                        out.insert("name".to_string(), "sigv4".to_string().into());
3844                        out.insert("signingName".to_string(), "s3express".to_string().into());
3845                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
3846                        out.insert("disableDoubleEncoding".to_string(), true.into());
3847                        out
3848                    }
3849                    .into()]
3850                )
3851                .build()
3852        );
3853    }
3854
3855    /// Access Point APIs on express bucket routed to custom endpoint if provided for List
3856    #[test]
3857    fn test_130() {
3858        let params = crate::config::endpoint::Params::builder()
3859            .account_id("871317572157".to_string())
3860            .region("us-east-1".to_string())
3861            .use_s3_express_control_endpoint(true)
3862            .endpoint("https://my-endpoint.express-control.s3.aws.dev".to_string())
3863            .requires_account_id(true)
3864            .use_dual_stack(false)
3865            .use_fips(false)
3866            .build()
3867            .expect("invalid params");
3868        let resolver = crate::config::endpoint::DefaultResolver::new();
3869        let endpoint = resolver.resolve_endpoint(&params);
3870        let endpoint = endpoint.expect("Expected valid endpoint: https://my-endpoint.express-control.s3.aws.dev");
3871        assert_eq!(
3872            endpoint,
3873            ::aws_smithy_types::endpoint::Endpoint::builder()
3874                .url("https://my-endpoint.express-control.s3.aws.dev")
3875                .property(
3876                    "authSchemes",
3877                    vec![{
3878                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
3879                        out.insert("name".to_string(), "sigv4".to_string().into());
3880                        out.insert("signingName".to_string(), "s3express".to_string().into());
3881                        out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
3882                        out.insert("disableDoubleEncoding".to_string(), true.into());
3883                        out
3884                    }
3885                    .into()]
3886                )
3887                .build()
3888        );
3889    }
3890
3891    /// Error on Access Point APIs on express bucket for dual stack
3892    #[test]
3893    fn test_131() {
3894        let params = crate::config::endpoint::Params::builder()
3895            .account_id("871317572157".to_string())
3896            .access_point_name("myaccesspoint--abcd-ab1--xa-s3".to_string())
3897            .region("us-east-1".to_string())
3898            .requires_account_id(true)
3899            .use_dual_stack(true)
3900            .use_fips(false)
3901            .build()
3902            .expect("invalid params");
3903        let resolver = crate::config::endpoint::DefaultResolver::new();
3904        let endpoint = resolver.resolve_endpoint(&params);
3905        let error = endpoint
3906            .expect_err("expected error: S3Express does not support Dual-stack. [Error on Access Point APIs on express bucket for dual stack]");
3907        assert_eq!(format!("{}", error), "S3Express does not support Dual-stack.")
3908    }
3909
3910    /// Error Access Point APIs on express bucket for dual stack for List
3911    #[test]
3912    fn test_132() {
3913        let params = crate::config::endpoint::Params::builder()
3914            .account_id("871317572157".to_string())
3915            .region("us-east-1".to_string())
3916            .use_s3_express_control_endpoint(true)
3917            .requires_account_id(true)
3918            .use_dual_stack(true)
3919            .use_fips(false)
3920            .build()
3921            .expect("invalid params");
3922        let resolver = crate::config::endpoint::DefaultResolver::new();
3923        let endpoint = resolver.resolve_endpoint(&params);
3924        let error = endpoint
3925            .expect_err("expected error: S3Express does not support Dual-stack. [Error Access Point APIs on express bucket for dual stack for List]");
3926        assert_eq!(format!("{}", error), "S3Express does not support Dual-stack.")
3927    }
3928
3929    /// Error on Access Point APIs on express bucket for custom endpoint and dual stack
3930    #[test]
3931    fn test_133() {
3932        let params = crate::config::endpoint::Params::builder()
3933            .account_id("871317572157".to_string())
3934            .access_point_name("myaccesspoint--abcd-ab1--xa-s3".to_string())
3935            .endpoint("https://my-endpoint.express-control.s3.aws.dev".to_string())
3936            .region("us-east-1".to_string())
3937            .requires_account_id(true)
3938            .use_dual_stack(true)
3939            .use_fips(false)
3940            .build()
3941            .expect("invalid params");
3942        let resolver = crate::config::endpoint::DefaultResolver::new();
3943        let endpoint = resolver.resolve_endpoint(&params);
3944        let error = endpoint.expect_err("expected error: Invalid Configuration: DualStack and custom endpoint are not supported [Error on Access Point APIs on express bucket for custom endpoint and dual stack]");
3945        assert_eq!(
3946            format!("{}", error),
3947            "Invalid Configuration: DualStack and custom endpoint are not supported"
3948        )
3949    }
3950
3951    /// Error Access Point APIs on express bucket for custom endpoint and dual stack for List
3952    #[test]
3953    fn test_134() {
3954        let params = crate::config::endpoint::Params::builder()
3955            .account_id("871317572157".to_string())
3956            .region("us-east-1".to_string())
3957            .use_s3_express_control_endpoint(true)
3958            .endpoint("https://my-endpoint.express-control.s3.aws.dev".to_string())
3959            .requires_account_id(true)
3960            .use_dual_stack(true)
3961            .use_fips(false)
3962            .build()
3963            .expect("invalid params");
3964        let resolver = crate::config::endpoint::DefaultResolver::new();
3965        let endpoint = resolver.resolve_endpoint(&params);
3966        let error = endpoint.expect_err("expected error: Invalid Configuration: DualStack and custom endpoint are not supported [Error Access Point APIs on express bucket for custom endpoint and dual stack for List]");
3967        assert_eq!(
3968            format!("{}", error),
3969            "Invalid Configuration: DualStack and custom endpoint are not supported"
3970        )
3971    }
3972}
3973
3974/// Endpoint resolver trait specific to AWS S3 Control
3975pub trait ResolveEndpoint: ::std::marker::Send + ::std::marker::Sync + ::std::fmt::Debug {
3976    /// Resolve an endpoint with the given parameters
3977    fn resolve_endpoint<'a>(&'a self, params: &'a crate::config::endpoint::Params) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a>;
3978
3979    /// Convert this service-specific resolver into a `SharedEndpointResolver`
3980    ///
3981    /// The resulting resolver will downcast `EndpointResolverParams` into `crate::config::endpoint::Params`.
3982    fn into_shared_resolver(self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver
3983    where
3984        Self: Sized + 'static,
3985    {
3986        ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver::new(DowncastParams(self))
3987    }
3988}
3989
3990#[derive(Debug)]
3991struct DowncastParams<T>(T);
3992impl<T> ::aws_smithy_runtime_api::client::endpoint::ResolveEndpoint for DowncastParams<T>
3993where
3994    T: ResolveEndpoint,
3995{
3996    fn resolve_endpoint<'a>(
3997        &'a self,
3998        params: &'a ::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams,
3999    ) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a> {
4000        let ep = match params.get::<crate::config::endpoint::Params>() {
4001            Some(params) => self.0.resolve_endpoint(params),
4002            None => ::aws_smithy_runtime_api::client::endpoint::EndpointFuture::ready(Err("params of expected type was not present".into())),
4003        };
4004        ep
4005    }
4006}
4007
4008/// The default endpoint resolver
4009#[derive(Debug, Default)]
4010pub struct DefaultResolver {
4011    partition_resolver: crate::endpoint_lib::partition::PartitionResolver,
4012}
4013
4014impl DefaultResolver {
4015    /// Create a new endpoint resolver with default settings
4016    pub fn new() -> Self {
4017        Self {
4018            partition_resolver: crate::endpoint_lib::DEFAULT_PARTITION_RESOLVER.clone(),
4019        }
4020    }
4021
4022    fn resolve_endpoint(
4023        &self,
4024        params: &crate::config::endpoint::Params,
4025    ) -> ::std::result::Result<::aws_smithy_types::endpoint::Endpoint, ::aws_smithy_runtime_api::box_error::BoxError> {
4026        let mut diagnostic_collector = crate::endpoint_lib::diagnostic::DiagnosticCollector::new();
4027        Ok(
4028            crate::config::endpoint::internals::resolve_endpoint(params, &mut diagnostic_collector, &self.partition_resolver)
4029                .map_err(|err| err.with_source(diagnostic_collector.take_last_error()))?,
4030        )
4031    }
4032}
4033
4034impl crate::config::endpoint::ResolveEndpoint for DefaultResolver {
4035    fn resolve_endpoint(&self, params: &crate::config::endpoint::Params) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'_> {
4036        ::aws_smithy_runtime_api::client::endpoint::EndpointFuture::ready(self.resolve_endpoint(params))
4037    }
4038}
4039
4040#[non_exhaustive]
4041#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
4042/// Configuration parameters for resolving the correct endpoint
4043pub struct Params {
4044    /// The AWS region used to dispatch the request.
4045    pub(crate) region: ::std::option::Option<::std::string::String>,
4046    /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
4047    pub(crate) use_fips: bool,
4048    /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
4049    pub(crate) use_dual_stack: bool,
4050    /// Override the endpoint used to send this request
4051    pub(crate) endpoint: ::std::option::Option<::std::string::String>,
4052    /// The Account ID used to send the request. This is an optional parameter that will be set automatically for operations that require it.
4053    pub(crate) account_id: ::std::option::Option<::std::string::String>,
4054    /// Internal parameter for operations that require account id host prefix.
4055    pub(crate) requires_account_id: ::std::option::Option<bool>,
4056    /// The Outpost ID.  Some operations have an optional OutpostId which should be used in endpoint construction.
4057    pub(crate) outpost_id: ::std::option::Option<::std::string::String>,
4058    /// The S3 bucket used to send the request. This is an optional parameter that will be set automatically for operations that are scoped to an S3 bucket.
4059    pub(crate) bucket: ::std::option::Option<::std::string::String>,
4060    /// The S3 AccessPointName used to send the request. This is an optional parameter that will be set automatically for operations that are scoped to an S3 AccessPoint.
4061    pub(crate) access_point_name: ::std::option::Option<::std::string::String>,
4062    /// When an Access Point ARN is provided and this flag is enabled, the SDK MUST use the ARN's region when constructing the endpoint instead of the client's configured region.
4063    pub(crate) use_arn_region: ::std::option::Option<bool>,
4064    /// The resource ARN included in the request.  Only set on TagResource, UntagResourceand ListTagsForResource
4065    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
4066    /// Internal parameter to indicate whether S3Express operation should use control plane, (ex. ListDirectoryAccessPoints)
4067    pub(crate) use_s3_express_control_endpoint: ::std::option::Option<bool>,
4068}
4069impl Params {
4070    /// Create a builder for [`Params`]
4071    pub fn builder() -> crate::config::endpoint::ParamsBuilder {
4072        crate::config::endpoint::ParamsBuilder::default()
4073    }
4074    /// The AWS region used to dispatch the request.
4075    pub fn region(&self) -> ::std::option::Option<&str> {
4076        self.region.as_deref()
4077    }
4078    /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
4079    pub fn use_fips(&self) -> ::std::option::Option<bool> {
4080        Some(self.use_fips)
4081    }
4082    /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
4083    pub fn use_dual_stack(&self) -> ::std::option::Option<bool> {
4084        Some(self.use_dual_stack)
4085    }
4086    /// Override the endpoint used to send this request
4087    pub fn endpoint(&self) -> ::std::option::Option<&str> {
4088        self.endpoint.as_deref()
4089    }
4090    /// The Account ID used to send the request. This is an optional parameter that will be set automatically for operations that require it.
4091    pub fn account_id(&self) -> ::std::option::Option<&str> {
4092        self.account_id.as_deref()
4093    }
4094    /// Internal parameter for operations that require account id host prefix.
4095    pub fn requires_account_id(&self) -> ::std::option::Option<bool> {
4096        self.requires_account_id
4097    }
4098    /// The Outpost ID.  Some operations have an optional OutpostId which should be used in endpoint construction.
4099    pub fn outpost_id(&self) -> ::std::option::Option<&str> {
4100        self.outpost_id.as_deref()
4101    }
4102    /// The S3 bucket used to send the request. This is an optional parameter that will be set automatically for operations that are scoped to an S3 bucket.
4103    pub fn bucket(&self) -> ::std::option::Option<&str> {
4104        self.bucket.as_deref()
4105    }
4106    /// The S3 AccessPointName used to send the request. This is an optional parameter that will be set automatically for operations that are scoped to an S3 AccessPoint.
4107    pub fn access_point_name(&self) -> ::std::option::Option<&str> {
4108        self.access_point_name.as_deref()
4109    }
4110    /// When an Access Point ARN is provided and this flag is enabled, the SDK MUST use the ARN's region when constructing the endpoint instead of the client's configured region.
4111    pub fn use_arn_region(&self) -> ::std::option::Option<bool> {
4112        self.use_arn_region
4113    }
4114    /// The resource ARN included in the request.  Only set on TagResource, UntagResourceand ListTagsForResource
4115    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
4116        self.resource_arn.as_deref()
4117    }
4118    /// Internal parameter to indicate whether S3Express operation should use control plane, (ex. ListDirectoryAccessPoints)
4119    pub fn use_s3_express_control_endpoint(&self) -> ::std::option::Option<bool> {
4120        self.use_s3_express_control_endpoint
4121    }
4122}
4123
4124/// Builder for [`Params`]
4125#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
4126pub struct ParamsBuilder {
4127    region: ::std::option::Option<::std::string::String>,
4128    use_fips: ::std::option::Option<bool>,
4129    use_dual_stack: ::std::option::Option<bool>,
4130    endpoint: ::std::option::Option<::std::string::String>,
4131    account_id: ::std::option::Option<::std::string::String>,
4132    requires_account_id: ::std::option::Option<bool>,
4133    outpost_id: ::std::option::Option<::std::string::String>,
4134    bucket: ::std::option::Option<::std::string::String>,
4135    access_point_name: ::std::option::Option<::std::string::String>,
4136    use_arn_region: ::std::option::Option<bool>,
4137    resource_arn: ::std::option::Option<::std::string::String>,
4138    use_s3_express_control_endpoint: ::std::option::Option<bool>,
4139}
4140impl ParamsBuilder {
4141    /// Consume this builder, creating [`Params`].
4142    pub fn build(self) -> ::std::result::Result<crate::config::endpoint::Params, crate::config::endpoint::InvalidParams> {
4143        Ok(
4144            #[allow(clippy::unnecessary_lazy_evaluations)]
4145            crate::config::endpoint::Params {
4146                region: self.region,
4147                use_fips: self
4148                    .use_fips
4149                    .or_else(|| Some(false))
4150                    .ok_or_else(|| crate::config::endpoint::InvalidParams::missing("use_fips"))?,
4151                use_dual_stack: self
4152                    .use_dual_stack
4153                    .or_else(|| Some(false))
4154                    .ok_or_else(|| crate::config::endpoint::InvalidParams::missing("use_dual_stack"))?,
4155                endpoint: self.endpoint,
4156                account_id: self.account_id,
4157                requires_account_id: self.requires_account_id,
4158                outpost_id: self.outpost_id,
4159                bucket: self.bucket,
4160                access_point_name: self.access_point_name,
4161                use_arn_region: self.use_arn_region,
4162                resource_arn: self.resource_arn,
4163                use_s3_express_control_endpoint: self.use_s3_express_control_endpoint,
4164            },
4165        )
4166    }
4167    /// Sets the value for region
4168    ///
4169    /// The AWS region used to dispatch the request.
4170    pub fn region(mut self, value: impl Into<::std::string::String>) -> Self {
4171        self.region = Some(value.into());
4172        self
4173    }
4174
4175    /// Sets the value for region
4176    ///
4177    /// The AWS region used to dispatch the request.
4178    pub fn set_region(mut self, param: Option<::std::string::String>) -> Self {
4179        self.region = param;
4180        self
4181    }
4182    /// Sets the value for use_fips
4183    ///
4184    /// When unset, this parameter has a default value of `false`.
4185    /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
4186    pub fn use_fips(mut self, value: impl Into<bool>) -> Self {
4187        self.use_fips = Some(value.into());
4188        self
4189    }
4190
4191    /// Sets the value for use_fips
4192    ///
4193    /// When unset, this parameter has a default value of `false`.
4194    /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
4195    pub fn set_use_fips(mut self, param: Option<bool>) -> Self {
4196        self.use_fips = param;
4197        self
4198    }
4199    /// Sets the value for use_dual_stack
4200    ///
4201    /// When unset, this parameter has a default value of `false`.
4202    /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
4203    pub fn use_dual_stack(mut self, value: impl Into<bool>) -> Self {
4204        self.use_dual_stack = Some(value.into());
4205        self
4206    }
4207
4208    /// Sets the value for use_dual_stack
4209    ///
4210    /// When unset, this parameter has a default value of `false`.
4211    /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
4212    pub fn set_use_dual_stack(mut self, param: Option<bool>) -> Self {
4213        self.use_dual_stack = param;
4214        self
4215    }
4216    /// Sets the value for endpoint
4217    ///
4218    /// Override the endpoint used to send this request
4219    pub fn endpoint(mut self, value: impl Into<::std::string::String>) -> Self {
4220        self.endpoint = Some(value.into());
4221        self
4222    }
4223
4224    /// Sets the value for endpoint
4225    ///
4226    /// Override the endpoint used to send this request
4227    pub fn set_endpoint(mut self, param: Option<::std::string::String>) -> Self {
4228        self.endpoint = param;
4229        self
4230    }
4231    /// Sets the value for account_id
4232    ///
4233    /// The Account ID used to send the request. This is an optional parameter that will be set automatically for operations that require it.
4234    pub fn account_id(mut self, value: impl Into<::std::string::String>) -> Self {
4235        self.account_id = Some(value.into());
4236        self
4237    }
4238
4239    /// Sets the value for account_id
4240    ///
4241    /// The Account ID used to send the request. This is an optional parameter that will be set automatically for operations that require it.
4242    pub fn set_account_id(mut self, param: Option<::std::string::String>) -> Self {
4243        self.account_id = param;
4244        self
4245    }
4246    /// Sets the value for requires_account_id
4247    ///
4248    /// Internal parameter for operations that require account id host prefix.
4249    pub fn requires_account_id(mut self, value: impl Into<bool>) -> Self {
4250        self.requires_account_id = Some(value.into());
4251        self
4252    }
4253
4254    /// Sets the value for requires_account_id
4255    ///
4256    /// Internal parameter for operations that require account id host prefix.
4257    pub fn set_requires_account_id(mut self, param: Option<bool>) -> Self {
4258        self.requires_account_id = param;
4259        self
4260    }
4261    /// Sets the value for outpost_id
4262    ///
4263    /// The Outpost ID.  Some operations have an optional OutpostId which should be used in endpoint construction.
4264    pub fn outpost_id(mut self, value: impl Into<::std::string::String>) -> Self {
4265        self.outpost_id = Some(value.into());
4266        self
4267    }
4268
4269    /// Sets the value for outpost_id
4270    ///
4271    /// The Outpost ID.  Some operations have an optional OutpostId which should be used in endpoint construction.
4272    pub fn set_outpost_id(mut self, param: Option<::std::string::String>) -> Self {
4273        self.outpost_id = param;
4274        self
4275    }
4276    /// Sets the value for bucket
4277    ///
4278    /// The S3 bucket used to send the request. This is an optional parameter that will be set automatically for operations that are scoped to an S3 bucket.
4279    pub fn bucket(mut self, value: impl Into<::std::string::String>) -> Self {
4280        self.bucket = Some(value.into());
4281        self
4282    }
4283
4284    /// Sets the value for bucket
4285    ///
4286    /// The S3 bucket used to send the request. This is an optional parameter that will be set automatically for operations that are scoped to an S3 bucket.
4287    pub fn set_bucket(mut self, param: Option<::std::string::String>) -> Self {
4288        self.bucket = param;
4289        self
4290    }
4291    /// Sets the value for access_point_name
4292    ///
4293    /// The S3 AccessPointName used to send the request. This is an optional parameter that will be set automatically for operations that are scoped to an S3 AccessPoint.
4294    pub fn access_point_name(mut self, value: impl Into<::std::string::String>) -> Self {
4295        self.access_point_name = Some(value.into());
4296        self
4297    }
4298
4299    /// Sets the value for access_point_name
4300    ///
4301    /// The S3 AccessPointName used to send the request. This is an optional parameter that will be set automatically for operations that are scoped to an S3 AccessPoint.
4302    pub fn set_access_point_name(mut self, param: Option<::std::string::String>) -> Self {
4303        self.access_point_name = param;
4304        self
4305    }
4306    /// Sets the value for use_arn_region
4307    ///
4308    /// When an Access Point ARN is provided and this flag is enabled, the SDK MUST use the ARN's region when constructing the endpoint instead of the client's configured region.
4309    pub fn use_arn_region(mut self, value: impl Into<bool>) -> Self {
4310        self.use_arn_region = Some(value.into());
4311        self
4312    }
4313
4314    /// Sets the value for use_arn_region
4315    ///
4316    /// When an Access Point ARN is provided and this flag is enabled, the SDK MUST use the ARN's region when constructing the endpoint instead of the client's configured region.
4317    pub fn set_use_arn_region(mut self, param: Option<bool>) -> Self {
4318        self.use_arn_region = param;
4319        self
4320    }
4321    /// Sets the value for resource_arn
4322    ///
4323    /// The resource ARN included in the request.  Only set on TagResource, UntagResourceand ListTagsForResource
4324    pub fn resource_arn(mut self, value: impl Into<::std::string::String>) -> Self {
4325        self.resource_arn = Some(value.into());
4326        self
4327    }
4328
4329    /// Sets the value for resource_arn
4330    ///
4331    /// The resource ARN included in the request.  Only set on TagResource, UntagResourceand ListTagsForResource
4332    pub fn set_resource_arn(mut self, param: Option<::std::string::String>) -> Self {
4333        self.resource_arn = param;
4334        self
4335    }
4336    /// Sets the value for use_s3_express_control_endpoint
4337    ///
4338    /// Internal parameter to indicate whether S3Express operation should use control plane, (ex. ListDirectoryAccessPoints)
4339    pub fn use_s3_express_control_endpoint(mut self, value: impl Into<bool>) -> Self {
4340        self.use_s3_express_control_endpoint = Some(value.into());
4341        self
4342    }
4343
4344    /// Sets the value for use_s3_express_control_endpoint
4345    ///
4346    /// Internal parameter to indicate whether S3Express operation should use control plane, (ex. ListDirectoryAccessPoints)
4347    pub fn set_use_s3_express_control_endpoint(mut self, param: Option<bool>) -> Self {
4348        self.use_s3_express_control_endpoint = param;
4349        self
4350    }
4351}
4352
4353/// An error that occurred during endpoint resolution
4354#[derive(Debug)]
4355pub struct InvalidParams {
4356    field: std::borrow::Cow<'static, str>,
4357    kind: InvalidParamsErrorKind,
4358}
4359
4360/// The kind of invalid parameter error
4361#[derive(Debug)]
4362enum InvalidParamsErrorKind {
4363    MissingField,
4364    InvalidValue { message: &'static str },
4365}
4366
4367impl InvalidParams {
4368    #[allow(dead_code)]
4369    fn missing(field: &'static str) -> Self {
4370        Self {
4371            field: field.into(),
4372            kind: InvalidParamsErrorKind::MissingField,
4373        }
4374    }
4375
4376    #[allow(dead_code)]
4377    fn invalid_value(field: &'static str, message: &'static str) -> Self {
4378        Self {
4379            field: field.into(),
4380            kind: InvalidParamsErrorKind::InvalidValue { message },
4381        }
4382    }
4383}
4384
4385impl std::fmt::Display for InvalidParams {
4386    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4387        match self.kind {
4388            InvalidParamsErrorKind::MissingField => write!(f, "a required field was missing: `{}`", self.field),
4389            InvalidParamsErrorKind::InvalidValue { message } => write!(f, "invalid value for field: `{}` - {}", self.field, message),
4390        }
4391    }
4392}
4393
4394impl std::error::Error for InvalidParams {}
4395
4396mod internals;