aws_sdk_directconnect/operation/update_lag/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_lag::_update_lag_output::UpdateLagOutputBuilder;
3
4pub use crate::operation::update_lag::_update_lag_input::UpdateLagInputBuilder;
5
6impl crate::operation::update_lag::builders::UpdateLagInputBuilder {
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_lag::UpdateLagOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_lag::UpdateLagError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_lag();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateLag`.
24///
25/// <p>Updates the attributes of the specified link aggregation group (LAG).</p>
26/// <p>You can update the following LAG attributes:</p>
27/// <ul>
28/// <li>
29/// <p>The name of the LAG.</p></li>
30/// <li>
31/// <p>The value for the minimum number of connections that must be operational for the LAG itself to be operational.</p></li>
32/// <li>
33/// <p>The LAG's MACsec encryption mode.</p>
34/// <p>Amazon Web Services assigns this value to each connection which is part of the LAG.</p></li>
35/// <li>
36/// <p>The tags</p></li>
37/// </ul><note>
38/// <p>If you adjust the threshold value for the minimum number of operational connections, ensure that the new value does not cause the LAG to fall below the threshold and become non-operational.</p>
39/// </note>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct UpdateLagFluentBuilder {
42    handle: ::std::sync::Arc<crate::client::Handle>,
43    inner: crate::operation::update_lag::builders::UpdateLagInputBuilder,
44    config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl crate::client::customize::internal::CustomizableSend<crate::operation::update_lag::UpdateLagOutput, crate::operation::update_lag::UpdateLagError>
47    for UpdateLagFluentBuilder
48{
49    fn send(
50        self,
51        config_override: crate::config::Builder,
52    ) -> crate::client::customize::internal::BoxFuture<
53        crate::client::customize::internal::SendResult<crate::operation::update_lag::UpdateLagOutput, crate::operation::update_lag::UpdateLagError>,
54    > {
55        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56    }
57}
58impl UpdateLagFluentBuilder {
59    /// Creates a new `UpdateLagFluentBuilder`.
60    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61        Self {
62            handle,
63            inner: ::std::default::Default::default(),
64            config_override: ::std::option::Option::None,
65        }
66    }
67    /// Access the UpdateLag as a reference.
68    pub fn as_input(&self) -> &crate::operation::update_lag::builders::UpdateLagInputBuilder {
69        &self.inner
70    }
71    /// Sends the request and returns the response.
72    ///
73    /// If an error occurs, an `SdkError` will be returned with additional details that
74    /// can be matched against.
75    ///
76    /// By default, any retryable failures will be retried twice. Retry behavior
77    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78    /// set when configuring the client.
79    pub async fn send(
80        self,
81    ) -> ::std::result::Result<
82        crate::operation::update_lag::UpdateLagOutput,
83        ::aws_smithy_runtime_api::client::result::SdkError<
84            crate::operation::update_lag::UpdateLagError,
85            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86        >,
87    > {
88        let input = self
89            .inner
90            .build()
91            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92        let runtime_plugins = crate::operation::update_lag::UpdateLag::operation_runtime_plugins(
93            self.handle.runtime_plugins.clone(),
94            &self.handle.conf,
95            self.config_override,
96        );
97        crate::operation::update_lag::UpdateLag::orchestrate(&runtime_plugins, input).await
98    }
99
100    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101    pub fn customize(
102        self,
103    ) -> crate::client::customize::CustomizableOperation<
104        crate::operation::update_lag::UpdateLagOutput,
105        crate::operation::update_lag::UpdateLagError,
106        Self,
107    > {
108        crate::client::customize::CustomizableOperation::new(self)
109    }
110    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111        self.set_config_override(::std::option::Option::Some(config_override.into()));
112        self
113    }
114
115    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116        self.config_override = config_override;
117        self
118    }
119    /// <p>The ID of the LAG.</p>
120    pub fn lag_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.lag_id(input.into());
122        self
123    }
124    /// <p>The ID of the LAG.</p>
125    pub fn set_lag_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_lag_id(input);
127        self
128    }
129    /// <p>The ID of the LAG.</p>
130    pub fn get_lag_id(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_lag_id()
132    }
133    /// <p>The name of the LAG.</p>
134    pub fn lag_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.lag_name(input.into());
136        self
137    }
138    /// <p>The name of the LAG.</p>
139    pub fn set_lag_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_lag_name(input);
141        self
142    }
143    /// <p>The name of the LAG.</p>
144    pub fn get_lag_name(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_lag_name()
146    }
147    /// <p>The minimum number of physical connections that must be operational for the LAG itself to be operational.</p>
148    pub fn minimum_links(mut self, input: i32) -> Self {
149        self.inner = self.inner.minimum_links(input);
150        self
151    }
152    /// <p>The minimum number of physical connections that must be operational for the LAG itself to be operational.</p>
153    pub fn set_minimum_links(mut self, input: ::std::option::Option<i32>) -> Self {
154        self.inner = self.inner.set_minimum_links(input);
155        self
156    }
157    /// <p>The minimum number of physical connections that must be operational for the LAG itself to be operational.</p>
158    pub fn get_minimum_links(&self) -> &::std::option::Option<i32> {
159        self.inner.get_minimum_links()
160    }
161    /// <p>The LAG MAC Security (MACsec) encryption mode.</p>
162    /// <p>Amazon Web Services applies the value to all connections which are part of the LAG.</p>
163    pub fn encryption_mode(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.inner = self.inner.encryption_mode(input.into());
165        self
166    }
167    /// <p>The LAG MAC Security (MACsec) encryption mode.</p>
168    /// <p>Amazon Web Services applies the value to all connections which are part of the LAG.</p>
169    pub fn set_encryption_mode(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_encryption_mode(input);
171        self
172    }
173    /// <p>The LAG MAC Security (MACsec) encryption mode.</p>
174    /// <p>Amazon Web Services applies the value to all connections which are part of the LAG.</p>
175    pub fn get_encryption_mode(&self) -> &::std::option::Option<::std::string::String> {
176        self.inner.get_encryption_mode()
177    }
178}