aws_sdk_directconnect/operation/update_connection/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_connection::_update_connection_output::UpdateConnectionOutputBuilder;
3
4pub use crate::operation::update_connection::_update_connection_input::UpdateConnectionInputBuilder;
5
6impl crate::operation::update_connection::builders::UpdateConnectionInputBuilder {
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_connection::UpdateConnectionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_connection::UpdateConnectionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_connection();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateConnection`.
24///
25/// <p>Updates the Direct Connect dedicated connection configuration.</p>
26/// <p>You can update the following parameters for a connection:</p>
27/// <ul>
28/// <li>
29/// <p>The connection name</p></li>
30/// <li>
31/// <p>The connection's MAC Security (MACsec) encryption mode.</p></li>
32/// </ul>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct UpdateConnectionFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::update_connection::builders::UpdateConnectionInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::update_connection::UpdateConnectionOutput,
42        crate::operation::update_connection::UpdateConnectionError,
43    > for UpdateConnectionFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::update_connection::UpdateConnectionOutput,
51            crate::operation::update_connection::UpdateConnectionError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl UpdateConnectionFluentBuilder {
58    /// Creates a new `UpdateConnectionFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the UpdateConnection as a reference.
67    pub fn as_input(&self) -> &crate::operation::update_connection::builders::UpdateConnectionInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::update_connection::UpdateConnectionOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::update_connection::UpdateConnectionError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::update_connection::UpdateConnection::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::update_connection::UpdateConnection::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::update_connection::UpdateConnectionOutput,
104        crate::operation::update_connection::UpdateConnectionError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// <p>The ID of the dedicated connection.</p>
119    /// <p>You can use <code>DescribeConnections</code> to retrieve the connection ID.</p>
120    pub fn connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.connection_id(input.into());
122        self
123    }
124    /// <p>The ID of the dedicated connection.</p>
125    /// <p>You can use <code>DescribeConnections</code> to retrieve the connection ID.</p>
126    pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_connection_id(input);
128        self
129    }
130    /// <p>The ID of the dedicated connection.</p>
131    /// <p>You can use <code>DescribeConnections</code> to retrieve the connection ID.</p>
132    pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
133        self.inner.get_connection_id()
134    }
135    /// <p>The name of the connection.</p>
136    pub fn connection_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.inner = self.inner.connection_name(input.into());
138        self
139    }
140    /// <p>The name of the connection.</p>
141    pub fn set_connection_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.inner = self.inner.set_connection_name(input);
143        self
144    }
145    /// <p>The name of the connection.</p>
146    pub fn get_connection_name(&self) -> &::std::option::Option<::std::string::String> {
147        self.inner.get_connection_name()
148    }
149    /// <p>The connection MAC Security (MACsec) encryption mode.</p>
150    /// <p>The valid values are <code>no_encrypt</code>, <code>should_encrypt</code>, and <code>must_encrypt</code>.</p>
151    pub fn encryption_mode(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152        self.inner = self.inner.encryption_mode(input.into());
153        self
154    }
155    /// <p>The connection MAC Security (MACsec) encryption mode.</p>
156    /// <p>The valid values are <code>no_encrypt</code>, <code>should_encrypt</code>, and <code>must_encrypt</code>.</p>
157    pub fn set_encryption_mode(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.inner = self.inner.set_encryption_mode(input);
159        self
160    }
161    /// <p>The connection MAC Security (MACsec) encryption mode.</p>
162    /// <p>The valid values are <code>no_encrypt</code>, <code>should_encrypt</code>, and <code>must_encrypt</code>.</p>
163    pub fn get_encryption_mode(&self) -> &::std::option::Option<::std::string::String> {
164        self.inner.get_encryption_mode()
165    }
166}