5 5 | clippy::nonminimal_bool,
|
6 6 | clippy::comparison_to_empty,
|
7 7 | clippy::redundant_pattern_matching,
|
8 8 | clippy::useless_asref
|
9 9 | )]
|
10 10 | pub(super) fn resolve_endpoint(
|
11 11 | _params: &crate::config::endpoint::Params,
|
12 12 | _diagnostic_collector: &mut crate::endpoint_lib::diagnostic::DiagnosticCollector,
|
13 13 | partition_resolver: &crate::endpoint_lib::partition::PartitionResolver,
|
14 14 | ) -> ::aws_smithy_http::endpoint::Result {
|
15 15 | #[allow(unused_variables)]
|
16 16 | let region = &_params.region;
|
17 17 | #[allow(unused_variables)]
|
18 18 | let use_dual_stack = &_params.use_dual_stack;
|
19 19 | #[allow(unused_variables)]
|
20 20 | let use_fips = &_params.use_fips;
|
21 21 | #[allow(unused_variables)]
|
22 22 | let endpoint = &_params.endpoint;
|
23 23 | #[allow(unused_variables)]
|
24 24 | if let Some(endpoint) = endpoint {
|
25 25 | if (*use_fips) == (true) {
|
26 26 | return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
|
27 27 | "Invalid Configuration: FIPS and custom endpoint are not supported".to_string(),
|
28 28 | ));
|
29 29 | }
|
30 30 | if (*use_dual_stack) == (true) {
|
31 31 | return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
|
32 32 | "Invalid Configuration: Dualstack and custom endpoint are not supported".to_string(),
|
33 33 | ));
|
34 34 | }
|
35 - | return Ok(::aws_smithy_types::endpoint::Endpoint::builder().url(endpoint.to_owned()).build());
|
35 + | return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
|
36 + | .url(endpoint.to_owned())
|
37 + | .property("is_custom_endpoint", true)
|
38 + | .build());
|
36 39 | }
|
37 40 | #[allow(unused_variables)]
|
38 41 | if let Some(region) = region {
|
39 42 | #[allow(unused_variables)]
|
40 43 | if let Some(partition_result) = partition_resolver.resolve_partition(region.as_ref() as &str, _diagnostic_collector) {
|
41 44 | if (*use_fips) == (true) {
|
42 45 | if (*use_dual_stack) == (true) {
|
43 46 | if (true) == (partition_result.supports_fips()) {
|
44 47 | if (true) == (partition_result.supports_dual_stack()) {
|
45 48 | return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
|
46 49 | .url({
|
47 50 | let mut out = String::new();
|
48 51 | out.push_str("https://transcribestreaming-fips.");
|
49 52 | #[allow(clippy::needless_borrow)]
|
50 53 | out.push_str(®ion.as_ref() as &str);
|
51 54 | out.push('.');
|
52 55 | #[allow(clippy::needless_borrow)]
|
53 56 | out.push_str(&partition_result.dual_stack_dns_suffix());
|
54 57 | out
|
55 58 | })
|
56 59 | .build());
|
57 60 | }
|
58 61 | }
|
59 62 | return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
|
60 63 | "FIPS and DualStack are enabled, but this partition does not support one or both".to_string(),
|
61 64 | ));
|
62 65 | }
|
63 66 | }
|
64 67 | if (*use_fips) == (true) {
|
65 68 | if (partition_result.supports_fips()) == (true) {
|