aws_sdk_codestarnotifications/config/
endpoint.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use ::aws_smithy_runtime_api::client::endpoint::EndpointFuture;
3pub use ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver;
4pub use ::aws_smithy_types::endpoint::Endpoint;
5
6#[cfg(test)]
7mod test {
8
9    /// For region us-east-1 with FIPS enabled and DualStack enabled
10    #[test]
11    fn test_1() {
12        let params = crate::config::endpoint::Params::builder()
13            .region("us-east-1".to_string())
14            .use_fips(true)
15            .use_dual_stack(true)
16            .build()
17            .expect("invalid params");
18        let resolver = crate::config::endpoint::DefaultResolver::new();
19        let endpoint = resolver.resolve_endpoint(&params);
20        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications-fips.us-east-1.api.aws");
21        assert_eq!(
22            endpoint,
23            ::aws_smithy_types::endpoint::Endpoint::builder()
24                .url("https://codestar-notifications-fips.us-east-1.api.aws")
25                .build()
26        );
27    }
28
29    /// For region us-east-1 with FIPS enabled and DualStack disabled
30    #[test]
31    fn test_2() {
32        let params = crate::config::endpoint::Params::builder()
33            .region("us-east-1".to_string())
34            .use_fips(true)
35            .use_dual_stack(false)
36            .build()
37            .expect("invalid params");
38        let resolver = crate::config::endpoint::DefaultResolver::new();
39        let endpoint = resolver.resolve_endpoint(&params);
40        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications-fips.us-east-1.amazonaws.com");
41        assert_eq!(
42            endpoint,
43            ::aws_smithy_types::endpoint::Endpoint::builder()
44                .url("https://codestar-notifications-fips.us-east-1.amazonaws.com")
45                .build()
46        );
47    }
48
49    /// For region us-east-1 with FIPS disabled and DualStack enabled
50    #[test]
51    fn test_3() {
52        let params = crate::config::endpoint::Params::builder()
53            .region("us-east-1".to_string())
54            .use_fips(false)
55            .use_dual_stack(true)
56            .build()
57            .expect("invalid params");
58        let resolver = crate::config::endpoint::DefaultResolver::new();
59        let endpoint = resolver.resolve_endpoint(&params);
60        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications.us-east-1.api.aws");
61        assert_eq!(
62            endpoint,
63            ::aws_smithy_types::endpoint::Endpoint::builder()
64                .url("https://codestar-notifications.us-east-1.api.aws")
65                .build()
66        );
67    }
68
69    /// For region us-east-1 with FIPS disabled and DualStack disabled
70    #[test]
71    fn test_4() {
72        let params = crate::config::endpoint::Params::builder()
73            .region("us-east-1".to_string())
74            .use_fips(false)
75            .use_dual_stack(false)
76            .build()
77            .expect("invalid params");
78        let resolver = crate::config::endpoint::DefaultResolver::new();
79        let endpoint = resolver.resolve_endpoint(&params);
80        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications.us-east-1.amazonaws.com");
81        assert_eq!(
82            endpoint,
83            ::aws_smithy_types::endpoint::Endpoint::builder()
84                .url("https://codestar-notifications.us-east-1.amazonaws.com")
85                .build()
86        );
87    }
88
89    /// For region cn-north-1 with FIPS enabled and DualStack enabled
90    #[test]
91    fn test_5() {
92        let params = crate::config::endpoint::Params::builder()
93            .region("cn-north-1".to_string())
94            .use_fips(true)
95            .use_dual_stack(true)
96            .build()
97            .expect("invalid params");
98        let resolver = crate::config::endpoint::DefaultResolver::new();
99        let endpoint = resolver.resolve_endpoint(&params);
100        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications-fips.cn-north-1.api.amazonwebservices.com.cn");
101        assert_eq!(
102            endpoint,
103            ::aws_smithy_types::endpoint::Endpoint::builder()
104                .url("https://codestar-notifications-fips.cn-north-1.api.amazonwebservices.com.cn")
105                .build()
106        );
107    }
108
109    /// For region cn-north-1 with FIPS enabled and DualStack disabled
110    #[test]
111    fn test_6() {
112        let params = crate::config::endpoint::Params::builder()
113            .region("cn-north-1".to_string())
114            .use_fips(true)
115            .use_dual_stack(false)
116            .build()
117            .expect("invalid params");
118        let resolver = crate::config::endpoint::DefaultResolver::new();
119        let endpoint = resolver.resolve_endpoint(&params);
120        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications-fips.cn-north-1.amazonaws.com.cn");
121        assert_eq!(
122            endpoint,
123            ::aws_smithy_types::endpoint::Endpoint::builder()
124                .url("https://codestar-notifications-fips.cn-north-1.amazonaws.com.cn")
125                .build()
126        );
127    }
128
129    /// For region cn-north-1 with FIPS disabled and DualStack enabled
130    #[test]
131    fn test_7() {
132        let params = crate::config::endpoint::Params::builder()
133            .region("cn-north-1".to_string())
134            .use_fips(false)
135            .use_dual_stack(true)
136            .build()
137            .expect("invalid params");
138        let resolver = crate::config::endpoint::DefaultResolver::new();
139        let endpoint = resolver.resolve_endpoint(&params);
140        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications.cn-north-1.api.amazonwebservices.com.cn");
141        assert_eq!(
142            endpoint,
143            ::aws_smithy_types::endpoint::Endpoint::builder()
144                .url("https://codestar-notifications.cn-north-1.api.amazonwebservices.com.cn")
145                .build()
146        );
147    }
148
149    /// For region cn-north-1 with FIPS disabled and DualStack disabled
150    #[test]
151    fn test_8() {
152        let params = crate::config::endpoint::Params::builder()
153            .region("cn-north-1".to_string())
154            .use_fips(false)
155            .use_dual_stack(false)
156            .build()
157            .expect("invalid params");
158        let resolver = crate::config::endpoint::DefaultResolver::new();
159        let endpoint = resolver.resolve_endpoint(&params);
160        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications.cn-north-1.amazonaws.com.cn");
161        assert_eq!(
162            endpoint,
163            ::aws_smithy_types::endpoint::Endpoint::builder()
164                .url("https://codestar-notifications.cn-north-1.amazonaws.com.cn")
165                .build()
166        );
167    }
168
169    /// For region us-gov-east-1 with FIPS enabled and DualStack enabled
170    #[test]
171    fn test_9() {
172        let params = crate::config::endpoint::Params::builder()
173            .region("us-gov-east-1".to_string())
174            .use_fips(true)
175            .use_dual_stack(true)
176            .build()
177            .expect("invalid params");
178        let resolver = crate::config::endpoint::DefaultResolver::new();
179        let endpoint = resolver.resolve_endpoint(&params);
180        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications-fips.us-gov-east-1.api.aws");
181        assert_eq!(
182            endpoint,
183            ::aws_smithy_types::endpoint::Endpoint::builder()
184                .url("https://codestar-notifications-fips.us-gov-east-1.api.aws")
185                .build()
186        );
187    }
188
189    /// For region us-gov-east-1 with FIPS enabled and DualStack disabled
190    #[test]
191    fn test_10() {
192        let params = crate::config::endpoint::Params::builder()
193            .region("us-gov-east-1".to_string())
194            .use_fips(true)
195            .use_dual_stack(false)
196            .build()
197            .expect("invalid params");
198        let resolver = crate::config::endpoint::DefaultResolver::new();
199        let endpoint = resolver.resolve_endpoint(&params);
200        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications-fips.us-gov-east-1.amazonaws.com");
201        assert_eq!(
202            endpoint,
203            ::aws_smithy_types::endpoint::Endpoint::builder()
204                .url("https://codestar-notifications-fips.us-gov-east-1.amazonaws.com")
205                .build()
206        );
207    }
208
209    /// For region us-gov-east-1 with FIPS disabled and DualStack enabled
210    #[test]
211    fn test_11() {
212        let params = crate::config::endpoint::Params::builder()
213            .region("us-gov-east-1".to_string())
214            .use_fips(false)
215            .use_dual_stack(true)
216            .build()
217            .expect("invalid params");
218        let resolver = crate::config::endpoint::DefaultResolver::new();
219        let endpoint = resolver.resolve_endpoint(&params);
220        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications.us-gov-east-1.api.aws");
221        assert_eq!(
222            endpoint,
223            ::aws_smithy_types::endpoint::Endpoint::builder()
224                .url("https://codestar-notifications.us-gov-east-1.api.aws")
225                .build()
226        );
227    }
228
229    /// For region us-gov-east-1 with FIPS disabled and DualStack disabled
230    #[test]
231    fn test_12() {
232        let params = crate::config::endpoint::Params::builder()
233            .region("us-gov-east-1".to_string())
234            .use_fips(false)
235            .use_dual_stack(false)
236            .build()
237            .expect("invalid params");
238        let resolver = crate::config::endpoint::DefaultResolver::new();
239        let endpoint = resolver.resolve_endpoint(&params);
240        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications.us-gov-east-1.amazonaws.com");
241        assert_eq!(
242            endpoint,
243            ::aws_smithy_types::endpoint::Endpoint::builder()
244                .url("https://codestar-notifications.us-gov-east-1.amazonaws.com")
245                .build()
246        );
247    }
248
249    /// For region us-iso-east-1 with FIPS enabled and DualStack disabled
250    #[test]
251    fn test_13() {
252        let params = crate::config::endpoint::Params::builder()
253            .region("us-iso-east-1".to_string())
254            .use_fips(true)
255            .use_dual_stack(false)
256            .build()
257            .expect("invalid params");
258        let resolver = crate::config::endpoint::DefaultResolver::new();
259        let endpoint = resolver.resolve_endpoint(&params);
260        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications-fips.us-iso-east-1.c2s.ic.gov");
261        assert_eq!(
262            endpoint,
263            ::aws_smithy_types::endpoint::Endpoint::builder()
264                .url("https://codestar-notifications-fips.us-iso-east-1.c2s.ic.gov")
265                .build()
266        );
267    }
268
269    /// For region us-iso-east-1 with FIPS disabled and DualStack disabled
270    #[test]
271    fn test_14() {
272        let params = crate::config::endpoint::Params::builder()
273            .region("us-iso-east-1".to_string())
274            .use_fips(false)
275            .use_dual_stack(false)
276            .build()
277            .expect("invalid params");
278        let resolver = crate::config::endpoint::DefaultResolver::new();
279        let endpoint = resolver.resolve_endpoint(&params);
280        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications.us-iso-east-1.c2s.ic.gov");
281        assert_eq!(
282            endpoint,
283            ::aws_smithy_types::endpoint::Endpoint::builder()
284                .url("https://codestar-notifications.us-iso-east-1.c2s.ic.gov")
285                .build()
286        );
287    }
288
289    /// For region us-isob-east-1 with FIPS enabled and DualStack disabled
290    #[test]
291    fn test_15() {
292        let params = crate::config::endpoint::Params::builder()
293            .region("us-isob-east-1".to_string())
294            .use_fips(true)
295            .use_dual_stack(false)
296            .build()
297            .expect("invalid params");
298        let resolver = crate::config::endpoint::DefaultResolver::new();
299        let endpoint = resolver.resolve_endpoint(&params);
300        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications-fips.us-isob-east-1.sc2s.sgov.gov");
301        assert_eq!(
302            endpoint,
303            ::aws_smithy_types::endpoint::Endpoint::builder()
304                .url("https://codestar-notifications-fips.us-isob-east-1.sc2s.sgov.gov")
305                .build()
306        );
307    }
308
309    /// For region us-isob-east-1 with FIPS disabled and DualStack disabled
310    #[test]
311    fn test_16() {
312        let params = crate::config::endpoint::Params::builder()
313            .region("us-isob-east-1".to_string())
314            .use_fips(false)
315            .use_dual_stack(false)
316            .build()
317            .expect("invalid params");
318        let resolver = crate::config::endpoint::DefaultResolver::new();
319        let endpoint = resolver.resolve_endpoint(&params);
320        let endpoint = endpoint.expect("Expected valid endpoint: https://codestar-notifications.us-isob-east-1.sc2s.sgov.gov");
321        assert_eq!(
322            endpoint,
323            ::aws_smithy_types::endpoint::Endpoint::builder()
324                .url("https://codestar-notifications.us-isob-east-1.sc2s.sgov.gov")
325                .build()
326        );
327    }
328
329    /// For custom endpoint with region set and fips disabled and dualstack disabled
330    #[test]
331    fn test_17() {
332        let params = crate::config::endpoint::Params::builder()
333            .region("us-east-1".to_string())
334            .use_fips(false)
335            .use_dual_stack(false)
336            .endpoint("https://example.com".to_string())
337            .build()
338            .expect("invalid params");
339        let resolver = crate::config::endpoint::DefaultResolver::new();
340        let endpoint = resolver.resolve_endpoint(&params);
341        let endpoint = endpoint.expect("Expected valid endpoint: https://example.com");
342        assert_eq!(
343            endpoint,
344            ::aws_smithy_types::endpoint::Endpoint::builder().url("https://example.com").build()
345        );
346    }
347
348    /// For custom endpoint with region not set and fips disabled and dualstack disabled
349    #[test]
350    fn test_18() {
351        let params = crate::config::endpoint::Params::builder()
352            .use_fips(false)
353            .use_dual_stack(false)
354            .endpoint("https://example.com".to_string())
355            .build()
356            .expect("invalid params");
357        let resolver = crate::config::endpoint::DefaultResolver::new();
358        let endpoint = resolver.resolve_endpoint(&params);
359        let endpoint = endpoint.expect("Expected valid endpoint: https://example.com");
360        assert_eq!(
361            endpoint,
362            ::aws_smithy_types::endpoint::Endpoint::builder().url("https://example.com").build()
363        );
364    }
365
366    /// For custom endpoint with fips enabled and dualstack disabled
367    #[test]
368    fn test_19() {
369        let params = crate::config::endpoint::Params::builder()
370            .region("us-east-1".to_string())
371            .use_fips(true)
372            .use_dual_stack(false)
373            .endpoint("https://example.com".to_string())
374            .build()
375            .expect("invalid params");
376        let resolver = crate::config::endpoint::DefaultResolver::new();
377        let endpoint = resolver.resolve_endpoint(&params);
378        let error = endpoint.expect_err("expected error: Invalid Configuration: FIPS and custom endpoint are not supported [For custom endpoint with fips enabled and dualstack disabled]");
379        assert_eq!(format!("{}", error), "Invalid Configuration: FIPS and custom endpoint are not supported")
380    }
381
382    /// For custom endpoint with fips disabled and dualstack enabled
383    #[test]
384    fn test_20() {
385        let params = crate::config::endpoint::Params::builder()
386            .region("us-east-1".to_string())
387            .use_fips(false)
388            .use_dual_stack(true)
389            .endpoint("https://example.com".to_string())
390            .build()
391            .expect("invalid params");
392        let resolver = crate::config::endpoint::DefaultResolver::new();
393        let endpoint = resolver.resolve_endpoint(&params);
394        let error = endpoint.expect_err("expected error: Invalid Configuration: Dualstack and custom endpoint are not supported [For custom endpoint with fips disabled and dualstack enabled]");
395        assert_eq!(
396            format!("{}", error),
397            "Invalid Configuration: Dualstack and custom endpoint are not supported"
398        )
399    }
400
401    /// Missing region
402    #[test]
403    fn test_21() {
404        let params = crate::config::endpoint::Params::builder().build().expect("invalid params");
405        let resolver = crate::config::endpoint::DefaultResolver::new();
406        let endpoint = resolver.resolve_endpoint(&params);
407        let error = endpoint.expect_err("expected error: Invalid Configuration: Missing Region [Missing region]");
408        assert_eq!(format!("{}", error), "Invalid Configuration: Missing Region")
409    }
410}
411
412/// Endpoint resolver trait specific to AWS CodeStar Notifications
413pub trait ResolveEndpoint: ::std::marker::Send + ::std::marker::Sync + ::std::fmt::Debug {
414    /// Resolve an endpoint with the given parameters
415    fn resolve_endpoint<'a>(&'a self, params: &'a crate::config::endpoint::Params) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a>;
416
417    /// Convert this service-specific resolver into a `SharedEndpointResolver`
418    ///
419    /// The resulting resolver will downcast `EndpointResolverParams` into `crate::config::endpoint::Params`.
420    fn into_shared_resolver(self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver
421    where
422        Self: Sized + 'static,
423    {
424        ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver::new(DowncastParams(self))
425    }
426}
427
428#[derive(Debug)]
429struct DowncastParams<T>(T);
430impl<T> ::aws_smithy_runtime_api::client::endpoint::ResolveEndpoint for DowncastParams<T>
431where
432    T: ResolveEndpoint,
433{
434    fn resolve_endpoint<'a>(
435        &'a self,
436        params: &'a ::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams,
437    ) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a> {
438        let ep = match params.get::<crate::config::endpoint::Params>() {
439            Some(params) => self.0.resolve_endpoint(params),
440            None => ::aws_smithy_runtime_api::client::endpoint::EndpointFuture::ready(Err("params of expected type was not present".into())),
441        };
442        ep
443    }
444}
445
446/// The default endpoint resolver
447#[derive(Debug, Default)]
448pub struct DefaultResolver {
449    partition_resolver: crate::endpoint_lib::partition::PartitionResolver,
450}
451
452impl DefaultResolver {
453    /// Create a new endpoint resolver with default settings
454    pub fn new() -> Self {
455        Self {
456            partition_resolver: crate::endpoint_lib::DEFAULT_PARTITION_RESOLVER.clone(),
457        }
458    }
459
460    fn resolve_endpoint(
461        &self,
462        params: &crate::config::endpoint::Params,
463    ) -> ::std::result::Result<::aws_smithy_types::endpoint::Endpoint, ::aws_smithy_runtime_api::box_error::BoxError> {
464        let mut diagnostic_collector = crate::endpoint_lib::diagnostic::DiagnosticCollector::new();
465        Ok(
466            crate::config::endpoint::internals::resolve_endpoint(params, &mut diagnostic_collector, &self.partition_resolver)
467                .map_err(|err| err.with_source(diagnostic_collector.take_last_error()))?,
468        )
469    }
470}
471
472impl crate::config::endpoint::ResolveEndpoint for DefaultResolver {
473    fn resolve_endpoint(&self, params: &crate::config::endpoint::Params) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture {
474        ::aws_smithy_runtime_api::client::endpoint::EndpointFuture::ready(self.resolve_endpoint(params))
475    }
476}
477
478#[non_exhaustive]
479#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
480/// Configuration parameters for resolving the correct endpoint
481pub struct Params {
482    /// The AWS region used to dispatch the request.
483    pub(crate) region: ::std::option::Option<::std::string::String>,
484    /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
485    pub(crate) use_dual_stack: bool,
486    /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
487    pub(crate) use_fips: bool,
488    /// Override the endpoint used to send this request
489    pub(crate) endpoint: ::std::option::Option<::std::string::String>,
490}
491impl Params {
492    /// Create a builder for [`Params`]
493    pub fn builder() -> crate::config::endpoint::ParamsBuilder {
494        crate::config::endpoint::ParamsBuilder::default()
495    }
496    /// The AWS region used to dispatch the request.
497    pub fn region(&self) -> ::std::option::Option<&str> {
498        self.region.as_deref()
499    }
500    /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
501    pub fn use_dual_stack(&self) -> ::std::option::Option<bool> {
502        Some(self.use_dual_stack)
503    }
504    /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
505    pub fn use_fips(&self) -> ::std::option::Option<bool> {
506        Some(self.use_fips)
507    }
508    /// Override the endpoint used to send this request
509    pub fn endpoint(&self) -> ::std::option::Option<&str> {
510        self.endpoint.as_deref()
511    }
512}
513
514/// Builder for [`Params`]
515#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
516pub struct ParamsBuilder {
517    region: ::std::option::Option<::std::string::String>,
518    use_dual_stack: ::std::option::Option<bool>,
519    use_fips: ::std::option::Option<bool>,
520    endpoint: ::std::option::Option<::std::string::String>,
521}
522impl ParamsBuilder {
523    /// Consume this builder, creating [`Params`].
524    pub fn build(self) -> ::std::result::Result<crate::config::endpoint::Params, crate::config::endpoint::InvalidParams> {
525        Ok(
526            #[allow(clippy::unnecessary_lazy_evaluations)]
527            crate::config::endpoint::Params {
528                region: self.region,
529                use_dual_stack: self
530                    .use_dual_stack
531                    .or_else(|| Some(false))
532                    .ok_or_else(|| crate::config::endpoint::InvalidParams::missing("use_dual_stack"))?,
533                use_fips: self
534                    .use_fips
535                    .or_else(|| Some(false))
536                    .ok_or_else(|| crate::config::endpoint::InvalidParams::missing("use_fips"))?,
537                endpoint: self.endpoint,
538            },
539        )
540    }
541    /// Sets the value for region
542    ///
543    /// The AWS region used to dispatch the request.
544    pub fn region(mut self, value: impl Into<::std::string::String>) -> Self {
545        self.region = Some(value.into());
546        self
547    }
548
549    /// Sets the value for region
550    ///
551    /// The AWS region used to dispatch the request.
552    pub fn set_region(mut self, param: Option<::std::string::String>) -> Self {
553        self.region = param;
554        self
555    }
556    /// Sets the value for use_dual_stack
557    ///
558    /// When unset, this parameter has a default value of `false`.
559    /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
560    pub fn use_dual_stack(mut self, value: impl Into<bool>) -> Self {
561        self.use_dual_stack = Some(value.into());
562        self
563    }
564
565    /// Sets the value for use_dual_stack
566    ///
567    /// When unset, this parameter has a default value of `false`.
568    /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
569    pub fn set_use_dual_stack(mut self, param: Option<bool>) -> Self {
570        self.use_dual_stack = param;
571        self
572    }
573    /// Sets the value for use_fips
574    ///
575    /// When unset, this parameter has a default value of `false`.
576    /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
577    pub fn use_fips(mut self, value: impl Into<bool>) -> Self {
578        self.use_fips = Some(value.into());
579        self
580    }
581
582    /// Sets the value for use_fips
583    ///
584    /// When unset, this parameter has a default value of `false`.
585    /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
586    pub fn set_use_fips(mut self, param: Option<bool>) -> Self {
587        self.use_fips = param;
588        self
589    }
590    /// Sets the value for endpoint
591    ///
592    /// Override the endpoint used to send this request
593    pub fn endpoint(mut self, value: impl Into<::std::string::String>) -> Self {
594        self.endpoint = Some(value.into());
595        self
596    }
597
598    /// Sets the value for endpoint
599    ///
600    /// Override the endpoint used to send this request
601    pub fn set_endpoint(mut self, param: Option<::std::string::String>) -> Self {
602        self.endpoint = param;
603        self
604    }
605}
606
607/// An error that occurred during endpoint resolution
608#[derive(Debug)]
609pub struct InvalidParams {
610    field: std::borrow::Cow<'static, str>,
611}
612
613impl InvalidParams {
614    #[allow(dead_code)]
615    fn missing(field: &'static str) -> Self {
616        Self { field: field.into() }
617    }
618}
619
620impl std::fmt::Display for InvalidParams {
621    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
622        write!(f, "a required field was missing: `{}`", self.field)
623    }
624}
625
626impl std::error::Error for InvalidParams {}
627
628mod internals;