aws_sdk_directconnect/operation/create_connection/
_create_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 CreateConnectionInput {
6    /// <p>The location of the connection.</p>
7    pub location: ::std::option::Option<::std::string::String>,
8    /// <p>The bandwidth of the connection.</p>
9    pub bandwidth: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the connection.</p>
11    pub connection_name: ::std::option::Option<::std::string::String>,
12    /// <p>The ID of the LAG.</p>
13    pub lag_id: ::std::option::Option<::std::string::String>,
14    /// <p>The tags to associate with the lag.</p>
15    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16    /// <p>The name of the service provider associated with the requested connection.</p>
17    pub provider_name: ::std::option::Option<::std::string::String>,
18    /// <p>Indicates whether you want the connection to support MAC Security (MACsec).</p>
19    /// <p>MAC Security (MACsec) is unavailable on hosted connections. For information about MAC Security (MACsec) prerequisites, see <a href="https://docs.aws.amazon.com/directconnect/latest/UserGuide/MACSec.html">MAC Security in Direct Connect</a> in the <i>Direct Connect User Guide</i>.</p>
20    pub request_mac_sec: ::std::option::Option<bool>,
21}
22impl CreateConnectionInput {
23    /// <p>The location of the connection.</p>
24    pub fn location(&self) -> ::std::option::Option<&str> {
25        self.location.as_deref()
26    }
27    /// <p>The bandwidth of the connection.</p>
28    pub fn bandwidth(&self) -> ::std::option::Option<&str> {
29        self.bandwidth.as_deref()
30    }
31    /// <p>The name of the connection.</p>
32    pub fn connection_name(&self) -> ::std::option::Option<&str> {
33        self.connection_name.as_deref()
34    }
35    /// <p>The ID of the LAG.</p>
36    pub fn lag_id(&self) -> ::std::option::Option<&str> {
37        self.lag_id.as_deref()
38    }
39    /// <p>The tags to associate with the lag.</p>
40    ///
41    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
42    pub fn tags(&self) -> &[crate::types::Tag] {
43        self.tags.as_deref().unwrap_or_default()
44    }
45    /// <p>The name of the service provider associated with the requested connection.</p>
46    pub fn provider_name(&self) -> ::std::option::Option<&str> {
47        self.provider_name.as_deref()
48    }
49    /// <p>Indicates whether you want the connection to support MAC Security (MACsec).</p>
50    /// <p>MAC Security (MACsec) is unavailable on hosted connections. For information about MAC Security (MACsec) prerequisites, see <a href="https://docs.aws.amazon.com/directconnect/latest/UserGuide/MACSec.html">MAC Security in Direct Connect</a> in the <i>Direct Connect User Guide</i>.</p>
51    pub fn request_mac_sec(&self) -> ::std::option::Option<bool> {
52        self.request_mac_sec
53    }
54}
55impl CreateConnectionInput {
56    /// Creates a new builder-style object to manufacture [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
57    pub fn builder() -> crate::operation::create_connection::builders::CreateConnectionInputBuilder {
58        crate::operation::create_connection::builders::CreateConnectionInputBuilder::default()
59    }
60}
61
62/// A builder for [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
63#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
64#[non_exhaustive]
65pub struct CreateConnectionInputBuilder {
66    pub(crate) location: ::std::option::Option<::std::string::String>,
67    pub(crate) bandwidth: ::std::option::Option<::std::string::String>,
68    pub(crate) connection_name: ::std::option::Option<::std::string::String>,
69    pub(crate) lag_id: ::std::option::Option<::std::string::String>,
70    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
71    pub(crate) provider_name: ::std::option::Option<::std::string::String>,
72    pub(crate) request_mac_sec: ::std::option::Option<bool>,
73}
74impl CreateConnectionInputBuilder {
75    /// <p>The location of the connection.</p>
76    /// This field is required.
77    pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.location = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The location of the connection.</p>
82    pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.location = input;
84        self
85    }
86    /// <p>The location of the connection.</p>
87    pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
88        &self.location
89    }
90    /// <p>The bandwidth of the connection.</p>
91    /// This field is required.
92    pub fn bandwidth(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93        self.bandwidth = ::std::option::Option::Some(input.into());
94        self
95    }
96    /// <p>The bandwidth of the connection.</p>
97    pub fn set_bandwidth(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98        self.bandwidth = input;
99        self
100    }
101    /// <p>The bandwidth of the connection.</p>
102    pub fn get_bandwidth(&self) -> &::std::option::Option<::std::string::String> {
103        &self.bandwidth
104    }
105    /// <p>The name of the connection.</p>
106    /// This field is required.
107    pub fn connection_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108        self.connection_name = ::std::option::Option::Some(input.into());
109        self
110    }
111    /// <p>The name of the connection.</p>
112    pub fn set_connection_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.connection_name = input;
114        self
115    }
116    /// <p>The name of the connection.</p>
117    pub fn get_connection_name(&self) -> &::std::option::Option<::std::string::String> {
118        &self.connection_name
119    }
120    /// <p>The ID of the LAG.</p>
121    pub fn lag_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.lag_id = ::std::option::Option::Some(input.into());
123        self
124    }
125    /// <p>The ID of the LAG.</p>
126    pub fn set_lag_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.lag_id = input;
128        self
129    }
130    /// <p>The ID of the LAG.</p>
131    pub fn get_lag_id(&self) -> &::std::option::Option<::std::string::String> {
132        &self.lag_id
133    }
134    /// Appends an item to `tags`.
135    ///
136    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
137    ///
138    /// <p>The tags to associate with the lag.</p>
139    pub fn tags(mut self, input: crate::types::Tag) -> Self {
140        let mut v = self.tags.unwrap_or_default();
141        v.push(input);
142        self.tags = ::std::option::Option::Some(v);
143        self
144    }
145    /// <p>The tags to associate with the lag.</p>
146    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
147        self.tags = input;
148        self
149    }
150    /// <p>The tags to associate with the lag.</p>
151    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
152        &self.tags
153    }
154    /// <p>The name of the service provider associated with the requested connection.</p>
155    pub fn provider_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156        self.provider_name = ::std::option::Option::Some(input.into());
157        self
158    }
159    /// <p>The name of the service provider associated with the requested connection.</p>
160    pub fn set_provider_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161        self.provider_name = input;
162        self
163    }
164    /// <p>The name of the service provider associated with the requested connection.</p>
165    pub fn get_provider_name(&self) -> &::std::option::Option<::std::string::String> {
166        &self.provider_name
167    }
168    /// <p>Indicates whether you want the connection to support MAC Security (MACsec).</p>
169    /// <p>MAC Security (MACsec) is unavailable on hosted connections. For information about MAC Security (MACsec) prerequisites, see <a href="https://docs.aws.amazon.com/directconnect/latest/UserGuide/MACSec.html">MAC Security in Direct Connect</a> in the <i>Direct Connect User Guide</i>.</p>
170    pub fn request_mac_sec(mut self, input: bool) -> Self {
171        self.request_mac_sec = ::std::option::Option::Some(input);
172        self
173    }
174    /// <p>Indicates whether you want the connection to support MAC Security (MACsec).</p>
175    /// <p>MAC Security (MACsec) is unavailable on hosted connections. For information about MAC Security (MACsec) prerequisites, see <a href="https://docs.aws.amazon.com/directconnect/latest/UserGuide/MACSec.html">MAC Security in Direct Connect</a> in the <i>Direct Connect User Guide</i>.</p>
176    pub fn set_request_mac_sec(mut self, input: ::std::option::Option<bool>) -> Self {
177        self.request_mac_sec = input;
178        self
179    }
180    /// <p>Indicates whether you want the connection to support MAC Security (MACsec).</p>
181    /// <p>MAC Security (MACsec) is unavailable on hosted connections. For information about MAC Security (MACsec) prerequisites, see <a href="https://docs.aws.amazon.com/directconnect/latest/UserGuide/MACSec.html">MAC Security in Direct Connect</a> in the <i>Direct Connect User Guide</i>.</p>
182    pub fn get_request_mac_sec(&self) -> &::std::option::Option<bool> {
183        &self.request_mac_sec
184    }
185    /// Consumes the builder and constructs a [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
186    pub fn build(
187        self,
188    ) -> ::std::result::Result<crate::operation::create_connection::CreateConnectionInput, ::aws_smithy_types::error::operation::BuildError> {
189        ::std::result::Result::Ok(crate::operation::create_connection::CreateConnectionInput {
190            location: self.location,
191            bandwidth: self.bandwidth,
192            connection_name: self.connection_name,
193            lag_id: self.lag_id,
194            tags: self.tags,
195            provider_name: self.provider_name,
196            request_mac_sec: self.request_mac_sec,
197        })
198    }
199}