aws_sdk_autoscaling/operation/attach_traffic_sources/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::attach_traffic_sources::_attach_traffic_sources_output::AttachTrafficSourcesOutputBuilder;
3
4pub use crate::operation::attach_traffic_sources::_attach_traffic_sources_input::AttachTrafficSourcesInputBuilder;
5
6impl crate::operation::attach_traffic_sources::builders::AttachTrafficSourcesInputBuilder {
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::attach_traffic_sources::AttachTrafficSourcesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::attach_traffic_sources::AttachTrafficSourcesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.attach_traffic_sources();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `AttachTrafficSources`.
24///
25/// <p>Attaches one or more traffic sources to the specified Auto Scaling group.</p>
26/// <p>You can use any of the following as traffic sources for an Auto Scaling group:</p>
27/// <ul>
28/// <li>
29/// <p>Application Load Balancer</p></li>
30/// <li>
31/// <p>Classic Load Balancer</p></li>
32/// <li>
33/// <p>Gateway Load Balancer</p></li>
34/// <li>
35/// <p>Network Load Balancer</p></li>
36/// <li>
37/// <p>VPC Lattice</p></li>
38/// </ul>
39/// <p>This operation is additive and does not detach existing traffic sources from the Auto Scaling group.</p>
40/// <p>After the operation completes, use the <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeTrafficSources.html">DescribeTrafficSources</a> API to return details about the state of the attachments between traffic sources and your Auto Scaling group. To detach a traffic source from the Auto Scaling group, call the <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DetachTrafficSources.html">DetachTrafficSources</a> API.</p>
41#[derive(::std::clone::Clone, ::std::fmt::Debug)]
42pub struct AttachTrafficSourcesFluentBuilder {
43    handle: ::std::sync::Arc<crate::client::Handle>,
44    inner: crate::operation::attach_traffic_sources::builders::AttachTrafficSourcesInputBuilder,
45    config_override: ::std::option::Option<crate::config::Builder>,
46}
47impl
48    crate::client::customize::internal::CustomizableSend<
49        crate::operation::attach_traffic_sources::AttachTrafficSourcesOutput,
50        crate::operation::attach_traffic_sources::AttachTrafficSourcesError,
51    > for AttachTrafficSourcesFluentBuilder
52{
53    fn send(
54        self,
55        config_override: crate::config::Builder,
56    ) -> crate::client::customize::internal::BoxFuture<
57        crate::client::customize::internal::SendResult<
58            crate::operation::attach_traffic_sources::AttachTrafficSourcesOutput,
59            crate::operation::attach_traffic_sources::AttachTrafficSourcesError,
60        >,
61    > {
62        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
63    }
64}
65impl AttachTrafficSourcesFluentBuilder {
66    /// Creates a new `AttachTrafficSourcesFluentBuilder`.
67    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
68        Self {
69            handle,
70            inner: ::std::default::Default::default(),
71            config_override: ::std::option::Option::None,
72        }
73    }
74    /// Access the AttachTrafficSources as a reference.
75    pub fn as_input(&self) -> &crate::operation::attach_traffic_sources::builders::AttachTrafficSourcesInputBuilder {
76        &self.inner
77    }
78    /// Sends the request and returns the response.
79    ///
80    /// If an error occurs, an `SdkError` will be returned with additional details that
81    /// can be matched against.
82    ///
83    /// By default, any retryable failures will be retried twice. Retry behavior
84    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
85    /// set when configuring the client.
86    pub async fn send(
87        self,
88    ) -> ::std::result::Result<
89        crate::operation::attach_traffic_sources::AttachTrafficSourcesOutput,
90        ::aws_smithy_runtime_api::client::result::SdkError<
91            crate::operation::attach_traffic_sources::AttachTrafficSourcesError,
92            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
93        >,
94    > {
95        let input = self
96            .inner
97            .build()
98            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
99        let runtime_plugins = crate::operation::attach_traffic_sources::AttachTrafficSources::operation_runtime_plugins(
100            self.handle.runtime_plugins.clone(),
101            &self.handle.conf,
102            self.config_override,
103        );
104        crate::operation::attach_traffic_sources::AttachTrafficSources::orchestrate(&runtime_plugins, input).await
105    }
106
107    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
108    pub fn customize(
109        self,
110    ) -> crate::client::customize::CustomizableOperation<
111        crate::operation::attach_traffic_sources::AttachTrafficSourcesOutput,
112        crate::operation::attach_traffic_sources::AttachTrafficSourcesError,
113        Self,
114    > {
115        crate::client::customize::CustomizableOperation::new(self)
116    }
117    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
118        self.set_config_override(::std::option::Option::Some(config_override.into()));
119        self
120    }
121
122    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
123        self.config_override = config_override;
124        self
125    }
126    /// <p>The name of the Auto Scaling group.</p>
127    pub fn auto_scaling_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.auto_scaling_group_name(input.into());
129        self
130    }
131    /// <p>The name of the Auto Scaling group.</p>
132    pub fn set_auto_scaling_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_auto_scaling_group_name(input);
134        self
135    }
136    /// <p>The name of the Auto Scaling group.</p>
137    pub fn get_auto_scaling_group_name(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_auto_scaling_group_name()
139    }
140    ///
141    /// Appends an item to `TrafficSources`.
142    ///
143    /// To override the contents of this collection use [`set_traffic_sources`](Self::set_traffic_sources).
144    ///
145    /// <p>The unique identifiers of one or more traffic sources. You can specify up to 10 traffic sources.</p>
146    pub fn traffic_sources(mut self, input: crate::types::TrafficSourceIdentifier) -> Self {
147        self.inner = self.inner.traffic_sources(input);
148        self
149    }
150    /// <p>The unique identifiers of one or more traffic sources. You can specify up to 10 traffic sources.</p>
151    pub fn set_traffic_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TrafficSourceIdentifier>>) -> Self {
152        self.inner = self.inner.set_traffic_sources(input);
153        self
154    }
155    /// <p>The unique identifiers of one or more traffic sources. You can specify up to 10 traffic sources.</p>
156    pub fn get_traffic_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TrafficSourceIdentifier>> {
157        self.inner.get_traffic_sources()
158    }
159    /// <p>If you enable zonal shift with cross-zone disabled load balancers, capacity could become imbalanced across Availability Zones. To skip the validation, specify <code>true</code>. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-zonal-shift.html">Auto Scaling group zonal shift</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>
160    pub fn skip_zonal_shift_validation(mut self, input: bool) -> Self {
161        self.inner = self.inner.skip_zonal_shift_validation(input);
162        self
163    }
164    /// <p>If you enable zonal shift with cross-zone disabled load balancers, capacity could become imbalanced across Availability Zones. To skip the validation, specify <code>true</code>. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-zonal-shift.html">Auto Scaling group zonal shift</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>
165    pub fn set_skip_zonal_shift_validation(mut self, input: ::std::option::Option<bool>) -> Self {
166        self.inner = self.inner.set_skip_zonal_shift_validation(input);
167        self
168    }
169    /// <p>If you enable zonal shift with cross-zone disabled load balancers, capacity could become imbalanced across Availability Zones. To skip the validation, specify <code>true</code>. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-zonal-shift.html">Auto Scaling group zonal shift</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>
170    pub fn get_skip_zonal_shift_validation(&self) -> &::std::option::Option<bool> {
171        self.inner.get_skip_zonal_shift_validation()
172    }
173}