aws_sdk_globalaccelerator/operation/create_accelerator/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_accelerator::_create_accelerator_output::CreateAcceleratorOutputBuilder;
3
4pub use crate::operation::create_accelerator::_create_accelerator_input::CreateAcceleratorInputBuilder;
5
6impl crate::operation::create_accelerator::builders::CreateAcceleratorInputBuilder {
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_accelerator::CreateAcceleratorOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_accelerator::CreateAcceleratorError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_accelerator();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateAccelerator`.
24///
25/// <p>Create an accelerator. An accelerator includes one or more listeners that process inbound connections and direct traffic to one or more endpoint groups, each of which includes endpoints, such as Network Load Balancers.</p><important>
26/// <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>
27/// </important>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateAcceleratorFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::create_accelerator::builders::CreateAcceleratorInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::create_accelerator::CreateAcceleratorOutput,
37        crate::operation::create_accelerator::CreateAcceleratorError,
38    > for CreateAcceleratorFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::create_accelerator::CreateAcceleratorOutput,
46            crate::operation::create_accelerator::CreateAcceleratorError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl CreateAcceleratorFluentBuilder {
53    /// Creates a new `CreateAcceleratorFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the CreateAccelerator as a reference.
62    pub fn as_input(&self) -> &crate::operation::create_accelerator::builders::CreateAcceleratorInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::create_accelerator::CreateAcceleratorOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::create_accelerator::CreateAcceleratorError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::create_accelerator::CreateAccelerator::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::create_accelerator::CreateAccelerator::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::create_accelerator::CreateAcceleratorOutput,
99        crate::operation::create_accelerator::CreateAcceleratorError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>The name of the accelerator. The name can have a maximum of 64 characters, must contain only alphanumeric characters, periods (.), or hyphens (-), and must not begin or end with a hyphen or period.</p>
114    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.name(input.into());
116        self
117    }
118    /// <p>The name of the accelerator. The name can have a maximum of 64 characters, must contain only alphanumeric characters, periods (.), or hyphens (-), and must not begin or end with a hyphen or period.</p>
119    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_name(input);
121        self
122    }
123    /// <p>The name of the accelerator. The name can have a maximum of 64 characters, must contain only alphanumeric characters, periods (.), or hyphens (-), and must not begin or end with a hyphen or period.</p>
124    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_name()
126    }
127    /// <p>The IP address type that an accelerator supports. For a standard accelerator, the value can be IPV4 or DUAL_STACK.</p>
128    pub fn ip_address_type(mut self, input: crate::types::IpAddressType) -> Self {
129        self.inner = self.inner.ip_address_type(input);
130        self
131    }
132    /// <p>The IP address type that an accelerator supports. For a standard accelerator, the value can be IPV4 or DUAL_STACK.</p>
133    pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::IpAddressType>) -> Self {
134        self.inner = self.inner.set_ip_address_type(input);
135        self
136    }
137    /// <p>The IP address type that an accelerator supports. For a standard accelerator, the value can be IPV4 or DUAL_STACK.</p>
138    pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::IpAddressType> {
139        self.inner.get_ip_address_type()
140    }
141    ///
142    /// Appends an item to `IpAddresses`.
143    ///
144    /// To override the contents of this collection use [`set_ip_addresses`](Self::set_ip_addresses).
145    ///
146    /// <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>
147    /// <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>
148    /// <p>You can specify one or two addresses, separated by a space. Do not include the /32 suffix.</p>
149    /// <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>
150    /// <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>
151    pub fn ip_addresses(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152        self.inner = self.inner.ip_addresses(input.into());
153        self
154    }
155    /// <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>
156    /// <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>
157    /// <p>You can specify one or two addresses, separated by a space. Do not include the /32 suffix.</p>
158    /// <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>
159    /// <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>
160    pub fn set_ip_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
161        self.inner = self.inner.set_ip_addresses(input);
162        self
163    }
164    /// <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>
165    /// <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>
166    /// <p>You can specify one or two addresses, separated by a space. Do not include the /32 suffix.</p>
167    /// <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>
168    /// <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>
169    pub fn get_ip_addresses(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
170        self.inner.get_ip_addresses()
171    }
172    /// <p>Indicates whether an accelerator is enabled. The value is true or false. The default value is true.</p>
173    /// <p>If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be deleted.</p>
174    pub fn enabled(mut self, input: bool) -> Self {
175        self.inner = self.inner.enabled(input);
176        self
177    }
178    /// <p>Indicates whether an accelerator is enabled. The value is true or false. The default value is true.</p>
179    /// <p>If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be deleted.</p>
180    pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
181        self.inner = self.inner.set_enabled(input);
182        self
183    }
184    /// <p>Indicates whether an accelerator is enabled. The value is true or false. The default value is true.</p>
185    /// <p>If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be deleted.</p>
186    pub fn get_enabled(&self) -> &::std::option::Option<bool> {
187        self.inner.get_enabled()
188    }
189    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of an accelerator.</p>
190    pub fn idempotency_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.inner = self.inner.idempotency_token(input.into());
192        self
193    }
194    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of an accelerator.</p>
195    pub fn set_idempotency_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.inner = self.inner.set_idempotency_token(input);
197        self
198    }
199    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of an accelerator.</p>
200    pub fn get_idempotency_token(&self) -> &::std::option::Option<::std::string::String> {
201        self.inner.get_idempotency_token()
202    }
203    ///
204    /// Appends an item to `Tags`.
205    ///
206    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
207    ///
208    /// <p>Create tags for an accelerator.</p>
209    /// <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>
210    pub fn tags(mut self, input: crate::types::Tag) -> Self {
211        self.inner = self.inner.tags(input);
212        self
213    }
214    /// <p>Create tags for an accelerator.</p>
215    /// <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>
216    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
217        self.inner = self.inner.set_tags(input);
218        self
219    }
220    /// <p>Create tags for an accelerator.</p>
221    /// <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>
222    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
223        self.inner.get_tags()
224    }
225}