aws_sdk_directconnect/operation/create_lag/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_lag::_create_lag_output::CreateLagOutputBuilder;
3
4pub use crate::operation::create_lag::_create_lag_input::CreateLagInputBuilder;
5
6impl crate::operation::create_lag::builders::CreateLagInputBuilder {
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_lag::CreateLagOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_lag::CreateLagError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_lag();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateLag`.
24///
25/// <p>Creates a link aggregation group (LAG) with the specified number of bundled physical dedicated connections between the customer network and a specific Direct Connect location. A LAG is a logical interface that uses the Link Aggregation Control Protocol (LACP) to aggregate multiple interfaces, enabling you to treat them as a single interface.</p>
26/// <p>All connections in a LAG must use the same bandwidth (either 1Gbps, 10Gbps, 100Gbps, or 400Gbps) and must terminate at the same Direct Connect endpoint.</p>
27/// <p>You can have up to 10 dedicated connections per location. Regardless of this limit, if you request more connections for the LAG than Direct Connect can allocate on a single endpoint, no LAG is created..</p>
28/// <p>You can specify an existing physical dedicated connection or interconnect to include in the LAG (which counts towards the total number of connections). Doing so interrupts the current physical dedicated connection, and re-establishes them as a member of the LAG. The LAG will be created on the same Direct Connect endpoint to which the dedicated connection terminates. Any virtual interfaces associated with the dedicated connection are automatically disassociated and re-associated with the LAG. The connection ID does not change.</p>
29/// <p>If the Amazon Web Services account used to create a LAG is a registered Direct Connect Partner, the LAG is automatically enabled to host sub-connections. For a LAG owned by a partner, any associated virtual interfaces cannot be directly configured.</p>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct CreateLagFluentBuilder {
32 handle: ::std::sync::Arc<crate::client::Handle>,
33 inner: crate::operation::create_lag::builders::CreateLagInputBuilder,
34 config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl crate::client::customize::internal::CustomizableSend<crate::operation::create_lag::CreateLagOutput, crate::operation::create_lag::CreateLagError>
37 for CreateLagFluentBuilder
38{
39 fn send(
40 self,
41 config_override: crate::config::Builder,
42 ) -> crate::client::customize::internal::BoxFuture<
43 crate::client::customize::internal::SendResult<crate::operation::create_lag::CreateLagOutput, crate::operation::create_lag::CreateLagError>,
44 > {
45 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
46 }
47}
48impl CreateLagFluentBuilder {
49 /// Creates a new `CreateLagFluentBuilder`.
50 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
51 Self {
52 handle,
53 inner: ::std::default::Default::default(),
54 config_override: ::std::option::Option::None,
55 }
56 }
57 /// Access the CreateLag as a reference.
58 pub fn as_input(&self) -> &crate::operation::create_lag::builders::CreateLagInputBuilder {
59 &self.inner
60 }
61 /// Sends the request and returns the response.
62 ///
63 /// If an error occurs, an `SdkError` will be returned with additional details that
64 /// can be matched against.
65 ///
66 /// By default, any retryable failures will be retried twice. Retry behavior
67 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
68 /// set when configuring the client.
69 pub async fn send(
70 self,
71 ) -> ::std::result::Result<
72 crate::operation::create_lag::CreateLagOutput,
73 ::aws_smithy_runtime_api::client::result::SdkError<
74 crate::operation::create_lag::CreateLagError,
75 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
76 >,
77 > {
78 let input = self
79 .inner
80 .build()
81 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
82 let runtime_plugins = crate::operation::create_lag::CreateLag::operation_runtime_plugins(
83 self.handle.runtime_plugins.clone(),
84 &self.handle.conf,
85 self.config_override,
86 );
87 crate::operation::create_lag::CreateLag::orchestrate(&runtime_plugins, input).await
88 }
89
90 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
91 pub fn customize(
92 self,
93 ) -> crate::client::customize::CustomizableOperation<
94 crate::operation::create_lag::CreateLagOutput,
95 crate::operation::create_lag::CreateLagError,
96 Self,
97 > {
98 crate::client::customize::CustomizableOperation::new(self)
99 }
100 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
101 self.set_config_override(::std::option::Option::Some(config_override.into()));
102 self
103 }
104
105 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
106 self.config_override = config_override;
107 self
108 }
109 /// <p>The number of physical dedicated connections initially provisioned and bundled by the LAG. You can have a maximum of four connections when the port speed is 1Gbps or 10Gbps, or two when the port speed is 100Gbps or 400Gbps.</p>
110 pub fn number_of_connections(mut self, input: i32) -> Self {
111 self.inner = self.inner.number_of_connections(input);
112 self
113 }
114 /// <p>The number of physical dedicated connections initially provisioned and bundled by the LAG. You can have a maximum of four connections when the port speed is 1Gbps or 10Gbps, or two when the port speed is 100Gbps or 400Gbps.</p>
115 pub fn set_number_of_connections(mut self, input: ::std::option::Option<i32>) -> Self {
116 self.inner = self.inner.set_number_of_connections(input);
117 self
118 }
119 /// <p>The number of physical dedicated connections initially provisioned and bundled by the LAG. You can have a maximum of four connections when the port speed is 1Gbps or 10Gbps, or two when the port speed is 100Gbps or 400Gbps.</p>
120 pub fn get_number_of_connections(&self) -> &::std::option::Option<i32> {
121 self.inner.get_number_of_connections()
122 }
123 /// <p>The location for the LAG.</p>
124 pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125 self.inner = self.inner.location(input.into());
126 self
127 }
128 /// <p>The location for the LAG.</p>
129 pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130 self.inner = self.inner.set_location(input);
131 self
132 }
133 /// <p>The location for the LAG.</p>
134 pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
135 self.inner.get_location()
136 }
137 /// <p>The bandwidth of the individual physical dedicated connections bundled by the LAG. The possible values are 1Gbps,10Gbps, 100Gbps, and 400Gbps.</p>
138 pub fn connections_bandwidth(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139 self.inner = self.inner.connections_bandwidth(input.into());
140 self
141 }
142 /// <p>The bandwidth of the individual physical dedicated connections bundled by the LAG. The possible values are 1Gbps,10Gbps, 100Gbps, and 400Gbps.</p>
143 pub fn set_connections_bandwidth(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144 self.inner = self.inner.set_connections_bandwidth(input);
145 self
146 }
147 /// <p>The bandwidth of the individual physical dedicated connections bundled by the LAG. The possible values are 1Gbps,10Gbps, 100Gbps, and 400Gbps.</p>
148 pub fn get_connections_bandwidth(&self) -> &::std::option::Option<::std::string::String> {
149 self.inner.get_connections_bandwidth()
150 }
151 /// <p>The name of the LAG.</p>
152 pub fn lag_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153 self.inner = self.inner.lag_name(input.into());
154 self
155 }
156 /// <p>The name of the LAG.</p>
157 pub fn set_lag_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158 self.inner = self.inner.set_lag_name(input);
159 self
160 }
161 /// <p>The name of the LAG.</p>
162 pub fn get_lag_name(&self) -> &::std::option::Option<::std::string::String> {
163 self.inner.get_lag_name()
164 }
165 /// <p>The ID of an existing dedicated connection to migrate to the LAG.</p>
166 pub fn connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167 self.inner = self.inner.connection_id(input.into());
168 self
169 }
170 /// <p>The ID of an existing dedicated connection to migrate to the LAG.</p>
171 pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172 self.inner = self.inner.set_connection_id(input);
173 self
174 }
175 /// <p>The ID of an existing dedicated connection to migrate to the LAG.</p>
176 pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
177 self.inner.get_connection_id()
178 }
179 ///
180 /// Appends an item to `tags`.
181 ///
182 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
183 ///
184 /// <p>The tags to associate with the LAG.</p>
185 pub fn tags(mut self, input: crate::types::Tag) -> Self {
186 self.inner = self.inner.tags(input);
187 self
188 }
189 /// <p>The tags to associate with the LAG.</p>
190 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
191 self.inner = self.inner.set_tags(input);
192 self
193 }
194 /// <p>The tags to associate with the LAG.</p>
195 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
196 self.inner.get_tags()
197 }
198 ///
199 /// Appends an item to `childConnectionTags`.
200 ///
201 /// To override the contents of this collection use [`set_child_connection_tags`](Self::set_child_connection_tags).
202 ///
203 /// <p>The tags to associate with the automtically created LAGs.</p>
204 pub fn child_connection_tags(mut self, input: crate::types::Tag) -> Self {
205 self.inner = self.inner.child_connection_tags(input);
206 self
207 }
208 /// <p>The tags to associate with the automtically created LAGs.</p>
209 pub fn set_child_connection_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
210 self.inner = self.inner.set_child_connection_tags(input);
211 self
212 }
213 /// <p>The tags to associate with the automtically created LAGs.</p>
214 pub fn get_child_connection_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
215 self.inner.get_child_connection_tags()
216 }
217 /// <p>The name of the service provider associated with the LAG.</p>
218 pub fn provider_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
219 self.inner = self.inner.provider_name(input.into());
220 self
221 }
222 /// <p>The name of the service provider associated with the LAG.</p>
223 pub fn set_provider_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
224 self.inner = self.inner.set_provider_name(input);
225 self
226 }
227 /// <p>The name of the service provider associated with the LAG.</p>
228 pub fn get_provider_name(&self) -> &::std::option::Option<::std::string::String> {
229 self.inner.get_provider_name()
230 }
231 /// <p>Indicates whether the connection will support MAC Security (MACsec).</p><note>
232 /// <p>All connections in the LAG must be capable of supporting MAC Security (MACsec). For information about MAC Security (MACsec) prerequisties, see <a href="https://docs.aws.amazon.com/directconnect/latest/UserGuide/direct-connect-mac-sec-getting-started.html#mac-sec-prerequisites">MACsec prerequisties</a> in the <i>Direct Connect User Guide</i>.</p>
233 /// </note>
234 pub fn request_mac_sec(mut self, input: bool) -> Self {
235 self.inner = self.inner.request_mac_sec(input);
236 self
237 }
238 /// <p>Indicates whether the connection will support MAC Security (MACsec).</p><note>
239 /// <p>All connections in the LAG must be capable of supporting MAC Security (MACsec). For information about MAC Security (MACsec) prerequisties, see <a href="https://docs.aws.amazon.com/directconnect/latest/UserGuide/direct-connect-mac-sec-getting-started.html#mac-sec-prerequisites">MACsec prerequisties</a> in the <i>Direct Connect User Guide</i>.</p>
240 /// </note>
241 pub fn set_request_mac_sec(mut self, input: ::std::option::Option<bool>) -> Self {
242 self.inner = self.inner.set_request_mac_sec(input);
243 self
244 }
245 /// <p>Indicates whether the connection will support MAC Security (MACsec).</p><note>
246 /// <p>All connections in the LAG must be capable of supporting MAC Security (MACsec). For information about MAC Security (MACsec) prerequisties, see <a href="https://docs.aws.amazon.com/directconnect/latest/UserGuide/direct-connect-mac-sec-getting-started.html#mac-sec-prerequisites">MACsec prerequisties</a> in the <i>Direct Connect User Guide</i>.</p>
247 /// </note>
248 pub fn get_request_mac_sec(&self) -> &::std::option::Option<bool> {
249 self.inner.get_request_mac_sec()
250 }
251}