aws_sdk_directconnect/operation/update_connection/
_update_connection_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateConnectionInput {
6    /// <p>The ID of the connection.</p>
7    /// <p>You can use <code>DescribeConnections</code> to retrieve the connection ID.</p>
8    pub connection_id: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the connection.</p>
10    pub connection_name: ::std::option::Option<::std::string::String>,
11    /// <p>The connection MAC Security (MACsec) encryption mode.</p>
12    /// <p>The valid values are <code>no_encrypt</code>, <code>should_encrypt</code>, and <code>must_encrypt</code>.</p>
13    pub encryption_mode: ::std::option::Option<::std::string::String>,
14}
15impl UpdateConnectionInput {
16    /// <p>The ID of the connection.</p>
17    /// <p>You can use <code>DescribeConnections</code> to retrieve the connection ID.</p>
18    pub fn connection_id(&self) -> ::std::option::Option<&str> {
19        self.connection_id.as_deref()
20    }
21    /// <p>The name of the connection.</p>
22    pub fn connection_name(&self) -> ::std::option::Option<&str> {
23        self.connection_name.as_deref()
24    }
25    /// <p>The connection MAC Security (MACsec) encryption mode.</p>
26    /// <p>The valid values are <code>no_encrypt</code>, <code>should_encrypt</code>, and <code>must_encrypt</code>.</p>
27    pub fn encryption_mode(&self) -> ::std::option::Option<&str> {
28        self.encryption_mode.as_deref()
29    }
30}
31impl UpdateConnectionInput {
32    /// Creates a new builder-style object to manufacture [`UpdateConnectionInput`](crate::operation::update_connection::UpdateConnectionInput).
33    pub fn builder() -> crate::operation::update_connection::builders::UpdateConnectionInputBuilder {
34        crate::operation::update_connection::builders::UpdateConnectionInputBuilder::default()
35    }
36}
37
38/// A builder for [`UpdateConnectionInput`](crate::operation::update_connection::UpdateConnectionInput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct UpdateConnectionInputBuilder {
42    pub(crate) connection_id: ::std::option::Option<::std::string::String>,
43    pub(crate) connection_name: ::std::option::Option<::std::string::String>,
44    pub(crate) encryption_mode: ::std::option::Option<::std::string::String>,
45}
46impl UpdateConnectionInputBuilder {
47    /// <p>The ID of the connection.</p>
48    /// <p>You can use <code>DescribeConnections</code> to retrieve the connection ID.</p>
49    /// This field is required.
50    pub fn connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
51        self.connection_id = ::std::option::Option::Some(input.into());
52        self
53    }
54    /// <p>The ID of the connection.</p>
55    /// <p>You can use <code>DescribeConnections</code> to retrieve the connection ID.</p>
56    pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57        self.connection_id = input;
58        self
59    }
60    /// <p>The ID of the connection.</p>
61    /// <p>You can use <code>DescribeConnections</code> to retrieve the connection ID.</p>
62    pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
63        &self.connection_id
64    }
65    /// <p>The name of the connection.</p>
66    pub fn connection_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.connection_name = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The name of the connection.</p>
71    pub fn set_connection_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.connection_name = input;
73        self
74    }
75    /// <p>The name of the connection.</p>
76    pub fn get_connection_name(&self) -> &::std::option::Option<::std::string::String> {
77        &self.connection_name
78    }
79    /// <p>The connection MAC Security (MACsec) encryption mode.</p>
80    /// <p>The valid values are <code>no_encrypt</code>, <code>should_encrypt</code>, and <code>must_encrypt</code>.</p>
81    pub fn encryption_mode(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.encryption_mode = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The connection MAC Security (MACsec) encryption mode.</p>
86    /// <p>The valid values are <code>no_encrypt</code>, <code>should_encrypt</code>, and <code>must_encrypt</code>.</p>
87    pub fn set_encryption_mode(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.encryption_mode = input;
89        self
90    }
91    /// <p>The connection MAC Security (MACsec) encryption mode.</p>
92    /// <p>The valid values are <code>no_encrypt</code>, <code>should_encrypt</code>, and <code>must_encrypt</code>.</p>
93    pub fn get_encryption_mode(&self) -> &::std::option::Option<::std::string::String> {
94        &self.encryption_mode
95    }
96    /// Consumes the builder and constructs a [`UpdateConnectionInput`](crate::operation::update_connection::UpdateConnectionInput).
97    pub fn build(
98        self,
99    ) -> ::std::result::Result<crate::operation::update_connection::UpdateConnectionInput, ::aws_smithy_types::error::operation::BuildError> {
100        ::std::result::Result::Ok(crate::operation::update_connection::UpdateConnectionInput {
101            connection_id: self.connection_id,
102            connection_name: self.connection_name,
103            encryption_mode: self.encryption_mode,
104        })
105    }
106}