aws_sdk_s3/config/endpoint/
internals.rs

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