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