aws_sdk_globalaccelerator/operation/update_accelerator/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_accelerator::_update_accelerator_output::UpdateAcceleratorOutputBuilder;
3
4pub use crate::operation::update_accelerator::_update_accelerator_input::UpdateAcceleratorInputBuilder;
5
6impl crate::operation::update_accelerator::builders::UpdateAcceleratorInputBuilder {
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::update_accelerator::UpdateAcceleratorOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_accelerator::UpdateAcceleratorError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_accelerator();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateAccelerator`.
24///
25/// <p>Update an accelerator to make changes, such as the following:</p>
26/// <ul>
27/// <li>
28/// <p>Change the name of the accelerator.</p></li>
29/// <li>
30/// <p>Disable the accelerator so that it no longer accepts or routes traffic, or so that you can delete it.</p></li>
31/// <li>
32/// <p>Enable the accelerator, if it is disabled.</p></li>
33/// <li>
34/// <p>Change the IP address type to dual-stack if it is IPv4, or change the IP address type to IPv4 if it's dual-stack.</p></li>
35/// </ul>
36/// <p>Be aware that static IP addresses remain assigned to your accelerator for as long as it exists, even if you disable the accelerator and it no longer accepts or routes traffic. However, when you delete the accelerator, you lose the static IP addresses that are assigned to it, so you can no longer route traffic by using them.</p><important>
37/// <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>
38/// </important>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct UpdateAcceleratorFluentBuilder {
41    handle: ::std::sync::Arc<crate::client::Handle>,
42    inner: crate::operation::update_accelerator::builders::UpdateAcceleratorInputBuilder,
43    config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46    crate::client::customize::internal::CustomizableSend<
47        crate::operation::update_accelerator::UpdateAcceleratorOutput,
48        crate::operation::update_accelerator::UpdateAcceleratorError,
49    > for UpdateAcceleratorFluentBuilder
50{
51    fn send(
52        self,
53        config_override: crate::config::Builder,
54    ) -> crate::client::customize::internal::BoxFuture<
55        crate::client::customize::internal::SendResult<
56            crate::operation::update_accelerator::UpdateAcceleratorOutput,
57            crate::operation::update_accelerator::UpdateAcceleratorError,
58        >,
59    > {
60        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61    }
62}
63impl UpdateAcceleratorFluentBuilder {
64    /// Creates a new `UpdateAcceleratorFluentBuilder`.
65    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
66        Self {
67            handle,
68            inner: ::std::default::Default::default(),
69            config_override: ::std::option::Option::None,
70        }
71    }
72    /// Access the UpdateAccelerator as a reference.
73    pub fn as_input(&self) -> &crate::operation::update_accelerator::builders::UpdateAcceleratorInputBuilder {
74        &self.inner
75    }
76    /// Sends the request and returns the response.
77    ///
78    /// If an error occurs, an `SdkError` will be returned with additional details that
79    /// can be matched against.
80    ///
81    /// By default, any retryable failures will be retried twice. Retry behavior
82    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
83    /// set when configuring the client.
84    pub async fn send(
85        self,
86    ) -> ::std::result::Result<
87        crate::operation::update_accelerator::UpdateAcceleratorOutput,
88        ::aws_smithy_runtime_api::client::result::SdkError<
89            crate::operation::update_accelerator::UpdateAcceleratorError,
90            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
91        >,
92    > {
93        let input = self
94            .inner
95            .build()
96            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
97        let runtime_plugins = crate::operation::update_accelerator::UpdateAccelerator::operation_runtime_plugins(
98            self.handle.runtime_plugins.clone(),
99            &self.handle.conf,
100            self.config_override,
101        );
102        crate::operation::update_accelerator::UpdateAccelerator::orchestrate(&runtime_plugins, input).await
103    }
104
105    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
106    pub fn customize(
107        self,
108    ) -> crate::client::customize::CustomizableOperation<
109        crate::operation::update_accelerator::UpdateAcceleratorOutput,
110        crate::operation::update_accelerator::UpdateAcceleratorError,
111        Self,
112    > {
113        crate::client::customize::CustomizableOperation::new(self)
114    }
115    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
116        self.set_config_override(::std::option::Option::Some(config_override.into()));
117        self
118    }
119
120    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
121        self.config_override = config_override;
122        self
123    }
124    /// <p>The Amazon Resource Name (ARN) of the accelerator to update.</p>
125    pub fn accelerator_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.accelerator_arn(input.into());
127        self
128    }
129    /// <p>The Amazon Resource Name (ARN) of the accelerator to update.</p>
130    pub fn set_accelerator_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_accelerator_arn(input);
132        self
133    }
134    /// <p>The Amazon Resource Name (ARN) of the accelerator to update.</p>
135    pub fn get_accelerator_arn(&self) -> &::std::option::Option<::std::string::String> {
136        self.inner.get_accelerator_arn()
137    }
138    /// <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>
139    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.name(input.into());
141        self
142    }
143    /// <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>
144    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.inner = self.inner.set_name(input);
146        self
147    }
148    /// <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>
149    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_name()
151    }
152    /// <p>The IP address type that an accelerator supports. For a standard accelerator, the value can be IPV4 or DUAL_STACK.</p>
153    pub fn ip_address_type(mut self, input: crate::types::IpAddressType) -> Self {
154        self.inner = self.inner.ip_address_type(input);
155        self
156    }
157    /// <p>The IP address type that an accelerator supports. For a standard accelerator, the value can be IPV4 or DUAL_STACK.</p>
158    pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::IpAddressType>) -> Self {
159        self.inner = self.inner.set_ip_address_type(input);
160        self
161    }
162    /// <p>The IP address type that an accelerator supports. For a standard accelerator, the value can be IPV4 or DUAL_STACK.</p>
163    pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::IpAddressType> {
164        self.inner.get_ip_address_type()
165    }
166    ///
167    /// Appends an item to `IpAddresses`.
168    ///
169    /// To override the contents of this collection use [`set_ip_addresses`](Self::set_ip_addresses).
170    ///
171    /// <p>The IP addresses for an accelerator.</p>
172    pub fn ip_addresses(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.inner = self.inner.ip_addresses(input.into());
174        self
175    }
176    /// <p>The IP addresses for an accelerator.</p>
177    pub fn set_ip_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
178        self.inner = self.inner.set_ip_addresses(input);
179        self
180    }
181    /// <p>The IP addresses for an accelerator.</p>
182    pub fn get_ip_addresses(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
183        self.inner.get_ip_addresses()
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, the accelerator cannot be deleted. If set to false, the accelerator can be deleted.</p>
187    pub fn enabled(mut self, input: bool) -> Self {
188        self.inner = self.inner.enabled(input);
189        self
190    }
191    /// <p>Indicates whether an accelerator is enabled. The value is true or false. The default value is true.</p>
192    /// <p>If the value is set to true, the accelerator cannot be deleted. If set to false, the accelerator can be deleted.</p>
193    pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
194        self.inner = self.inner.set_enabled(input);
195        self
196    }
197    /// <p>Indicates whether an accelerator is enabled. The value is true or false. The default value is true.</p>
198    /// <p>If the value is set to true, the accelerator cannot be deleted. If set to false, the accelerator can be deleted.</p>
199    pub fn get_enabled(&self) -> &::std::option::Option<bool> {
200        self.inner.get_enabled()
201    }
202}