Skip to main content

aws_sdk_globalaccelerator/operation/create_custom_routing_accelerator/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_custom_routing_accelerator::_create_custom_routing_accelerator_input::CreateCustomRoutingAcceleratorInputBuilder;
3
4pub use crate::operation::create_custom_routing_accelerator::_create_custom_routing_accelerator_output::CreateCustomRoutingAcceleratorOutputBuilder;
5
6impl crate::operation::create_custom_routing_accelerator::builders::CreateCustomRoutingAcceleratorInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_custom_routing_accelerator::CreateCustomRoutingAcceleratorOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_custom_routing_accelerator::CreateCustomRoutingAcceleratorError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_custom_routing_accelerator();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateCustomRoutingAccelerator`.
24///
25/// <p>Create a custom routing accelerator. A custom routing accelerator directs traffic to one of possibly thousands of Amazon EC2 instance destinations running in a single or multiple virtual private clouds (VPC) subnet endpoints.</p>
26/// <p>Be aware that, by default, all destination EC2 instances in a VPC subnet endpoint cannot receive traffic. To enable all destinations to receive traffic, or to specify individual port mappings that can receive traffic, see the <a href="https://docs.aws.amazon.com/global-accelerator/latest/api/API_AllowCustomRoutingTraffic.html"> AllowCustomRoutingTraffic</a> operation.</p><important>
27/// <p>Global Accelerator is a global service that supports endpoints in multiple Amazon Web Services Regions but you must specify the US West (Oregon) Region to create, update, or otherwise work with accelerators. That is, for example, specify <code>--region us-west-2</code> on Amazon Web Services CLI commands.</p>
28/// </important>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateCustomRoutingAcceleratorFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::create_custom_routing_accelerator::builders::CreateCustomRoutingAcceleratorInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::create_custom_routing_accelerator::CreateCustomRoutingAcceleratorOutput,
38        crate::operation::create_custom_routing_accelerator::CreateCustomRoutingAcceleratorError,
39    > for CreateCustomRoutingAcceleratorFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::create_custom_routing_accelerator::CreateCustomRoutingAcceleratorOutput,
47            crate::operation::create_custom_routing_accelerator::CreateCustomRoutingAcceleratorError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl CreateCustomRoutingAcceleratorFluentBuilder {
54    /// Creates a new `CreateCustomRoutingAcceleratorFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the CreateCustomRoutingAccelerator as a reference.
63    pub fn as_input(&self) -> &crate::operation::create_custom_routing_accelerator::builders::CreateCustomRoutingAcceleratorInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::create_custom_routing_accelerator::CreateCustomRoutingAcceleratorOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::create_custom_routing_accelerator::CreateCustomRoutingAcceleratorError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::create_custom_routing_accelerator::CreateCustomRoutingAccelerator::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::create_custom_routing_accelerator::CreateCustomRoutingAccelerator::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::create_custom_routing_accelerator::CreateCustomRoutingAcceleratorOutput,
100        crate::operation::create_custom_routing_accelerator::CreateCustomRoutingAcceleratorError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The name of a custom routing accelerator. The name can have a maximum of 64 characters, must contain only alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.</p>
115    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.name(input.into());
117        self
118    }
119    /// <p>The name of a custom routing accelerator. The name can have a maximum of 64 characters, must contain only alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.</p>
120    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_name(input);
122        self
123    }
124    /// <p>The name of a custom routing accelerator. The name can have a maximum of 64 characters, must contain only alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.</p>
125    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_name()
127    }
128    /// <p>The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.</p>
129    pub fn ip_address_type(mut self, input: crate::types::IpAddressType) -> Self {
130        self.inner = self.inner.ip_address_type(input);
131        self
132    }
133    /// <p>The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.</p>
134    pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::IpAddressType>) -> Self {
135        self.inner = self.inner.set_ip_address_type(input);
136        self
137    }
138    /// <p>The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.</p>
139    pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::IpAddressType> {
140        self.inner.get_ip_address_type()
141    }
142    ///
143    /// Appends an item to `IpAddresses`.
144    ///
145    /// To override the contents of this collection use [`set_ip_addresses`](Self::set_ip_addresses).
146    ///
147    /// <p>Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose an IPv4 address from your own pool to use for the accelerator's static IPv4 address when you create an accelerator.</p>
148    /// <p>After you bring an address range to Amazon Web Services, it appears in your account as an address pool. When you create an accelerator, you can assign one IPv4 address from your range to it. Global Accelerator assigns you a second static IPv4 address from an Amazon IP address range. If you bring two IPv4 address ranges to Amazon Web Services, you can assign one IPv4 address from each range to your accelerator. This restriction is because Global Accelerator assigns each address range to a different network zone, for high availability.</p>
149    /// <p>You can specify one or two addresses, separated by a space. Do not include the /32 suffix.</p>
150    /// <p>Note that you can't update IP addresses for an existing accelerator. To change them, you must create a new accelerator with the new addresses.</p>
151    /// <p>For more information, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html">Bring your own IP addresses (BYOIP)</a> in the <i>Global Accelerator Developer Guide</i>.</p>
152    pub fn ip_addresses(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.inner = self.inner.ip_addresses(input.into());
154        self
155    }
156    /// <p>Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose an IPv4 address from your own pool to use for the accelerator's static IPv4 address when you create an accelerator.</p>
157    /// <p>After you bring an address range to Amazon Web Services, it appears in your account as an address pool. When you create an accelerator, you can assign one IPv4 address from your range to it. Global Accelerator assigns you a second static IPv4 address from an Amazon IP address range. If you bring two IPv4 address ranges to Amazon Web Services, you can assign one IPv4 address from each range to your accelerator. This restriction is because Global Accelerator assigns each address range to a different network zone, for high availability.</p>
158    /// <p>You can specify one or two addresses, separated by a space. Do not include the /32 suffix.</p>
159    /// <p>Note that you can't update IP addresses for an existing accelerator. To change them, you must create a new accelerator with the new addresses.</p>
160    /// <p>For more information, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html">Bring your own IP addresses (BYOIP)</a> in the <i>Global Accelerator Developer Guide</i>.</p>
161    pub fn set_ip_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
162        self.inner = self.inner.set_ip_addresses(input);
163        self
164    }
165    /// <p>Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose an IPv4 address from your own pool to use for the accelerator's static IPv4 address when you create an accelerator.</p>
166    /// <p>After you bring an address range to Amazon Web Services, it appears in your account as an address pool. When you create an accelerator, you can assign one IPv4 address from your range to it. Global Accelerator assigns you a second static IPv4 address from an Amazon IP address range. If you bring two IPv4 address ranges to Amazon Web Services, you can assign one IPv4 address from each range to your accelerator. This restriction is because Global Accelerator assigns each address range to a different network zone, for high availability.</p>
167    /// <p>You can specify one or two addresses, separated by a space. Do not include the /32 suffix.</p>
168    /// <p>Note that you can't update IP addresses for an existing accelerator. To change them, you must create a new accelerator with the new addresses.</p>
169    /// <p>For more information, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html">Bring your own IP addresses (BYOIP)</a> in the <i>Global Accelerator Developer Guide</i>.</p>
170    pub fn get_ip_addresses(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
171        self.inner.get_ip_addresses()
172    }
173    /// <p>Indicates whether an accelerator is enabled. The value is true or false. The default value is true.</p>
174    /// <p>If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be deleted.</p>
175    pub fn enabled(mut self, input: bool) -> Self {
176        self.inner = self.inner.enabled(input);
177        self
178    }
179    /// <p>Indicates whether an accelerator is enabled. The value is true or false. The default value is true.</p>
180    /// <p>If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be deleted.</p>
181    pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
182        self.inner = self.inner.set_enabled(input);
183        self
184    }
185    /// <p>Indicates whether an accelerator is enabled. The value is true or false. The default value is true.</p>
186    /// <p>If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be deleted.</p>
187    pub fn get_enabled(&self) -> &::std::option::Option<bool> {
188        self.inner.get_enabled()
189    }
190    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the request.</p>
191    pub fn idempotency_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192        self.inner = self.inner.idempotency_token(input.into());
193        self
194    }
195    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the request.</p>
196    pub fn set_idempotency_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197        self.inner = self.inner.set_idempotency_token(input);
198        self
199    }
200    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the request.</p>
201    pub fn get_idempotency_token(&self) -> &::std::option::Option<::std::string::String> {
202        self.inner.get_idempotency_token()
203    }
204    ///
205    /// Appends an item to `Tags`.
206    ///
207    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
208    ///
209    /// <p>Create tags for an accelerator.</p>
210    /// <p>For more information, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html">Tagging in Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.</p>
211    pub fn tags(mut self, input: crate::types::Tag) -> Self {
212        self.inner = self.inner.tags(input);
213        self
214    }
215    /// <p>Create tags for an accelerator.</p>
216    /// <p>For more information, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html">Tagging in Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.</p>
217    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
218        self.inner = self.inner.set_tags(input);
219        self
220    }
221    /// <p>Create tags for an accelerator.</p>
222    /// <p>For more information, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html">Tagging in Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.</p>
223    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
224        self.inner.get_tags()
225    }
226}