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