Skip to main content

aws_sdk_globalaccelerator/types/
_custom_routing_accelerator.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Attributes of a custom routing accelerator.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CustomRoutingAccelerator {
7    /// <p>The Amazon Resource Name (ARN) of the custom routing accelerator.</p>
8    pub accelerator_arn: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the accelerator. The name must contain only alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.</p>
10    pub name: ::std::option::Option<::std::string::String>,
11    /// <p>The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.</p>
12    pub ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
13    /// <p>Indicates whether the accelerator is enabled. The value is true or false. The default value is true.</p>
14    /// <p>If the value is set to true, the accelerator cannot be deleted. If set to false, accelerator can be deleted.</p>
15    pub enabled: ::std::option::Option<bool>,
16    /// <p>The static IP addresses that Global Accelerator associates with the accelerator.</p>
17    pub ip_sets: ::std::option::Option<::std::vec::Vec<crate::types::IpSet>>,
18    /// <p>The Domain Name System (DNS) name that Global Accelerator creates that points to an accelerator's static IPv4 addresses.</p>
19    /// <p>The naming convention for the DNS name is the following: A lowercase letter a, followed by a 16-bit random hex string, followed by .awsglobalaccelerator.com. For example: a1234567890abcdef.awsglobalaccelerator.com.</p>
20    /// <p>If you have a dual-stack accelerator, you also have a second DNS name, <code>DualStackDnsName</code>, that points to both the A record and the AAAA record for all four static addresses for the accelerator: two IPv4 addresses and two IPv6 addresses.</p>
21    /// <p>For more information about the default DNS name, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/dns-addressing-custom-domains.dns-addressing.html"> Support for DNS addressing in Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.</p>
22    pub dns_name: ::std::option::Option<::std::string::String>,
23    /// <p>Describes the deployment status of the accelerator.</p>
24    pub status: ::std::option::Option<crate::types::CustomRoutingAcceleratorStatus>,
25    /// <p>The date and time that the accelerator was created.</p>
26    pub created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
27    /// <p>The date and time that the accelerator was last modified.</p>
28    pub last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
29}
30impl CustomRoutingAccelerator {
31    /// <p>The Amazon Resource Name (ARN) of the custom routing accelerator.</p>
32    pub fn accelerator_arn(&self) -> ::std::option::Option<&str> {
33        self.accelerator_arn.as_deref()
34    }
35    /// <p>The name of the accelerator. The name must contain only alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.</p>
36    pub fn name(&self) -> ::std::option::Option<&str> {
37        self.name.as_deref()
38    }
39    /// <p>The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.</p>
40    pub fn ip_address_type(&self) -> ::std::option::Option<&crate::types::IpAddressType> {
41        self.ip_address_type.as_ref()
42    }
43    /// <p>Indicates whether the accelerator is enabled. The value is true or false. The default value is true.</p>
44    /// <p>If the value is set to true, the accelerator cannot be deleted. If set to false, accelerator can be deleted.</p>
45    pub fn enabled(&self) -> ::std::option::Option<bool> {
46        self.enabled
47    }
48    /// <p>The static IP addresses that Global Accelerator associates with the accelerator.</p>
49    ///
50    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.ip_sets.is_none()`.
51    pub fn ip_sets(&self) -> &[crate::types::IpSet] {
52        self.ip_sets.as_deref().unwrap_or_default()
53    }
54    /// <p>The Domain Name System (DNS) name that Global Accelerator creates that points to an accelerator's static IPv4 addresses.</p>
55    /// <p>The naming convention for the DNS name is the following: A lowercase letter a, followed by a 16-bit random hex string, followed by .awsglobalaccelerator.com. For example: a1234567890abcdef.awsglobalaccelerator.com.</p>
56    /// <p>If you have a dual-stack accelerator, you also have a second DNS name, <code>DualStackDnsName</code>, that points to both the A record and the AAAA record for all four static addresses for the accelerator: two IPv4 addresses and two IPv6 addresses.</p>
57    /// <p>For more information about the default DNS name, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/dns-addressing-custom-domains.dns-addressing.html"> Support for DNS addressing in Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.</p>
58    pub fn dns_name(&self) -> ::std::option::Option<&str> {
59        self.dns_name.as_deref()
60    }
61    /// <p>Describes the deployment status of the accelerator.</p>
62    pub fn status(&self) -> ::std::option::Option<&crate::types::CustomRoutingAcceleratorStatus> {
63        self.status.as_ref()
64    }
65    /// <p>The date and time that the accelerator was created.</p>
66    pub fn created_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
67        self.created_time.as_ref()
68    }
69    /// <p>The date and time that the accelerator was last modified.</p>
70    pub fn last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
71        self.last_modified_time.as_ref()
72    }
73}
74impl CustomRoutingAccelerator {
75    /// Creates a new builder-style object to manufacture [`CustomRoutingAccelerator`](crate::types::CustomRoutingAccelerator).
76    pub fn builder() -> crate::types::builders::CustomRoutingAcceleratorBuilder {
77        crate::types::builders::CustomRoutingAcceleratorBuilder::default()
78    }
79}
80
81/// A builder for [`CustomRoutingAccelerator`](crate::types::CustomRoutingAccelerator).
82#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
83#[non_exhaustive]
84pub struct CustomRoutingAcceleratorBuilder {
85    pub(crate) accelerator_arn: ::std::option::Option<::std::string::String>,
86    pub(crate) name: ::std::option::Option<::std::string::String>,
87    pub(crate) ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
88    pub(crate) enabled: ::std::option::Option<bool>,
89    pub(crate) ip_sets: ::std::option::Option<::std::vec::Vec<crate::types::IpSet>>,
90    pub(crate) dns_name: ::std::option::Option<::std::string::String>,
91    pub(crate) status: ::std::option::Option<crate::types::CustomRoutingAcceleratorStatus>,
92    pub(crate) created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
93    pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
94}
95impl CustomRoutingAcceleratorBuilder {
96    /// <p>The Amazon Resource Name (ARN) of the custom routing accelerator.</p>
97    pub fn accelerator_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98        self.accelerator_arn = ::std::option::Option::Some(input.into());
99        self
100    }
101    /// <p>The Amazon Resource Name (ARN) of the custom routing accelerator.</p>
102    pub fn set_accelerator_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.accelerator_arn = input;
104        self
105    }
106    /// <p>The Amazon Resource Name (ARN) of the custom routing accelerator.</p>
107    pub fn get_accelerator_arn(&self) -> &::std::option::Option<::std::string::String> {
108        &self.accelerator_arn
109    }
110    /// <p>The name of the accelerator. The name must contain only alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.</p>
111    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
112        self.name = ::std::option::Option::Some(input.into());
113        self
114    }
115    /// <p>The name of the accelerator. The name must contain only alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.</p>
116    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117        self.name = input;
118        self
119    }
120    /// <p>The name of the accelerator. The name must contain only alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.</p>
121    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
122        &self.name
123    }
124    /// <p>The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.</p>
125    pub fn ip_address_type(mut self, input: crate::types::IpAddressType) -> Self {
126        self.ip_address_type = ::std::option::Option::Some(input);
127        self
128    }
129    /// <p>The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.</p>
130    pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::IpAddressType>) -> Self {
131        self.ip_address_type = input;
132        self
133    }
134    /// <p>The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.</p>
135    pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::IpAddressType> {
136        &self.ip_address_type
137    }
138    /// <p>Indicates whether the accelerator is enabled. The value is true or false. The default value is true.</p>
139    /// <p>If the value is set to true, the accelerator cannot be deleted. If set to false, accelerator can be deleted.</p>
140    pub fn enabled(mut self, input: bool) -> Self {
141        self.enabled = ::std::option::Option::Some(input);
142        self
143    }
144    /// <p>Indicates whether the accelerator is enabled. The value is true or false. The default value is true.</p>
145    /// <p>If the value is set to true, the accelerator cannot be deleted. If set to false, accelerator can be deleted.</p>
146    pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
147        self.enabled = input;
148        self
149    }
150    /// <p>Indicates whether the accelerator is enabled. The value is true or false. The default value is true.</p>
151    /// <p>If the value is set to true, the accelerator cannot be deleted. If set to false, accelerator can be deleted.</p>
152    pub fn get_enabled(&self) -> &::std::option::Option<bool> {
153        &self.enabled
154    }
155    /// Appends an item to `ip_sets`.
156    ///
157    /// To override the contents of this collection use [`set_ip_sets`](Self::set_ip_sets).
158    ///
159    /// <p>The static IP addresses that Global Accelerator associates with the accelerator.</p>
160    pub fn ip_sets(mut self, input: crate::types::IpSet) -> Self {
161        let mut v = self.ip_sets.unwrap_or_default();
162        v.push(input);
163        self.ip_sets = ::std::option::Option::Some(v);
164        self
165    }
166    /// <p>The static IP addresses that Global Accelerator associates with the accelerator.</p>
167    pub fn set_ip_sets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IpSet>>) -> Self {
168        self.ip_sets = input;
169        self
170    }
171    /// <p>The static IP addresses that Global Accelerator associates with the accelerator.</p>
172    pub fn get_ip_sets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IpSet>> {
173        &self.ip_sets
174    }
175    /// <p>The Domain Name System (DNS) name that Global Accelerator creates that points to an accelerator's static IPv4 addresses.</p>
176    /// <p>The naming convention for the DNS name is the following: A lowercase letter a, followed by a 16-bit random hex string, followed by .awsglobalaccelerator.com. For example: a1234567890abcdef.awsglobalaccelerator.com.</p>
177    /// <p>If you have a dual-stack accelerator, you also have a second DNS name, <code>DualStackDnsName</code>, that points to both the A record and the AAAA record for all four static addresses for the accelerator: two IPv4 addresses and two IPv6 addresses.</p>
178    /// <p>For more information about the default DNS name, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/dns-addressing-custom-domains.dns-addressing.html"> Support for DNS addressing in Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.</p>
179    pub fn dns_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180        self.dns_name = ::std::option::Option::Some(input.into());
181        self
182    }
183    /// <p>The Domain Name System (DNS) name that Global Accelerator creates that points to an accelerator's static IPv4 addresses.</p>
184    /// <p>The naming convention for the DNS name is the following: A lowercase letter a, followed by a 16-bit random hex string, followed by .awsglobalaccelerator.com. For example: a1234567890abcdef.awsglobalaccelerator.com.</p>
185    /// <p>If you have a dual-stack accelerator, you also have a second DNS name, <code>DualStackDnsName</code>, that points to both the A record and the AAAA record for all four static addresses for the accelerator: two IPv4 addresses and two IPv6 addresses.</p>
186    /// <p>For more information about the default DNS name, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/dns-addressing-custom-domains.dns-addressing.html"> Support for DNS addressing in Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.</p>
187    pub fn set_dns_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.dns_name = input;
189        self
190    }
191    /// <p>The Domain Name System (DNS) name that Global Accelerator creates that points to an accelerator's static IPv4 addresses.</p>
192    /// <p>The naming convention for the DNS name is the following: A lowercase letter a, followed by a 16-bit random hex string, followed by .awsglobalaccelerator.com. For example: a1234567890abcdef.awsglobalaccelerator.com.</p>
193    /// <p>If you have a dual-stack accelerator, you also have a second DNS name, <code>DualStackDnsName</code>, that points to both the A record and the AAAA record for all four static addresses for the accelerator: two IPv4 addresses and two IPv6 addresses.</p>
194    /// <p>For more information about the default DNS name, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/dns-addressing-custom-domains.dns-addressing.html"> Support for DNS addressing in Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.</p>
195    pub fn get_dns_name(&self) -> &::std::option::Option<::std::string::String> {
196        &self.dns_name
197    }
198    /// <p>Describes the deployment status of the accelerator.</p>
199    pub fn status(mut self, input: crate::types::CustomRoutingAcceleratorStatus) -> Self {
200        self.status = ::std::option::Option::Some(input);
201        self
202    }
203    /// <p>Describes the deployment status of the accelerator.</p>
204    pub fn set_status(mut self, input: ::std::option::Option<crate::types::CustomRoutingAcceleratorStatus>) -> Self {
205        self.status = input;
206        self
207    }
208    /// <p>Describes the deployment status of the accelerator.</p>
209    pub fn get_status(&self) -> &::std::option::Option<crate::types::CustomRoutingAcceleratorStatus> {
210        &self.status
211    }
212    /// <p>The date and time that the accelerator was created.</p>
213    pub fn created_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
214        self.created_time = ::std::option::Option::Some(input);
215        self
216    }
217    /// <p>The date and time that the accelerator was created.</p>
218    pub fn set_created_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
219        self.created_time = input;
220        self
221    }
222    /// <p>The date and time that the accelerator was created.</p>
223    pub fn get_created_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
224        &self.created_time
225    }
226    /// <p>The date and time that the accelerator was last modified.</p>
227    pub fn last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
228        self.last_modified_time = ::std::option::Option::Some(input);
229        self
230    }
231    /// <p>The date and time that the accelerator was last modified.</p>
232    pub fn set_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
233        self.last_modified_time = input;
234        self
235    }
236    /// <p>The date and time that the accelerator was last modified.</p>
237    pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
238        &self.last_modified_time
239    }
240    /// Consumes the builder and constructs a [`CustomRoutingAccelerator`](crate::types::CustomRoutingAccelerator).
241    pub fn build(self) -> crate::types::CustomRoutingAccelerator {
242        crate::types::CustomRoutingAccelerator {
243            accelerator_arn: self.accelerator_arn,
244            name: self.name,
245            ip_address_type: self.ip_address_type,
246            enabled: self.enabled,
247            ip_sets: self.ip_sets,
248            dns_name: self.dns_name,
249            status: self.status,
250            created_time: self.created_time,
251            last_modified_time: self.last_modified_time,
252        }
253    }
254}