1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Defines the logical topology that an AWS Interconnect Connection is created upon.</p>
/// <p>Specifically, an Environment defines the partner The remote Cloud Service Provider of this resource. or The remote Last Mile Provider of this resource. and the region or location specification to which an AWS Interconnect Connection can be made.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Environment {
/// <p>The provider on the remote side of this <code>Connection</code>.</p>
pub provider: ::std::option::Option<crate::types::Provider>,
/// <p>The provider specific location on the remote side of this <code>Connection</code>.</p>
pub location: ::std::string::String,
/// <p>The identifier of this <code>Environment</code></p>
pub environment_id: ::std::string::String,
/// <p>The state of the <code>Environment</code>. Possible values:</p>
/// <ul>
/// <li>
/// <p><code>available</code>: The environment is available and new <code>Connection</code> objects can be requested.</p></li>
/// <li>
/// <p><code>limited</code>: The environment is available, but overall capacity is limited. The set of available bandwidths</p></li>
/// <li>
/// <p><code>unavailable</code>: The environment is currently unavailable.</p></li>
/// </ul>
pub state: crate::types::EnvironmentState,
/// <p>The sets of bandwidths that are available and supported on this environment.</p>
pub bandwidths: ::std::option::Option<crate::types::Bandwidths>,
/// <p>The specific product type of <code>Connection</code> objects provided by this <code>Environment</code>.</p>
pub r#type: ::std::string::String,
/// <p>An HTTPS URL on the remote partner portal where the Activation Key should be brought to complete the creation process.</p>
pub activation_page_url: ::std::option::Option<::std::string::String>,
/// <p>The type of identifying information that should be supplied to the <code>remoteAccount</code> parameter of a <code>CreateConnection</code> call for this specific Environment.</p>
pub remote_identifier_type: ::std::option::Option<crate::types::RemoteAccountIdentifierType>,
}
impl Environment {
/// <p>The provider on the remote side of this <code>Connection</code>.</p>
pub fn provider(&self) -> ::std::option::Option<&crate::types::Provider> {
self.provider.as_ref()
}
/// <p>The provider specific location on the remote side of this <code>Connection</code>.</p>
pub fn location(&self) -> &str {
use std::ops::Deref;
self.location.deref()
}
/// <p>The identifier of this <code>Environment</code></p>
pub fn environment_id(&self) -> &str {
use std::ops::Deref;
self.environment_id.deref()
}
/// <p>The state of the <code>Environment</code>. Possible values:</p>
/// <ul>
/// <li>
/// <p><code>available</code>: The environment is available and new <code>Connection</code> objects can be requested.</p></li>
/// <li>
/// <p><code>limited</code>: The environment is available, but overall capacity is limited. The set of available bandwidths</p></li>
/// <li>
/// <p><code>unavailable</code>: The environment is currently unavailable.</p></li>
/// </ul>
pub fn state(&self) -> &crate::types::EnvironmentState {
&self.state
}
/// <p>The sets of bandwidths that are available and supported on this environment.</p>
pub fn bandwidths(&self) -> ::std::option::Option<&crate::types::Bandwidths> {
self.bandwidths.as_ref()
}
/// <p>The specific product type of <code>Connection</code> objects provided by this <code>Environment</code>.</p>
pub fn r#type(&self) -> &str {
use std::ops::Deref;
self.r#type.deref()
}
/// <p>An HTTPS URL on the remote partner portal where the Activation Key should be brought to complete the creation process.</p>
pub fn activation_page_url(&self) -> ::std::option::Option<&str> {
self.activation_page_url.as_deref()
}
/// <p>The type of identifying information that should be supplied to the <code>remoteAccount</code> parameter of a <code>CreateConnection</code> call for this specific Environment.</p>
pub fn remote_identifier_type(&self) -> ::std::option::Option<&crate::types::RemoteAccountIdentifierType> {
self.remote_identifier_type.as_ref()
}
}
impl Environment {
/// Creates a new builder-style object to manufacture [`Environment`](crate::types::Environment).
pub fn builder() -> crate::types::builders::EnvironmentBuilder {
crate::types::builders::EnvironmentBuilder::default()
}
}
/// A builder for [`Environment`](crate::types::Environment).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EnvironmentBuilder {
pub(crate) provider: ::std::option::Option<crate::types::Provider>,
pub(crate) location: ::std::option::Option<::std::string::String>,
pub(crate) environment_id: ::std::option::Option<::std::string::String>,
pub(crate) state: ::std::option::Option<crate::types::EnvironmentState>,
pub(crate) bandwidths: ::std::option::Option<crate::types::Bandwidths>,
pub(crate) r#type: ::std::option::Option<::std::string::String>,
pub(crate) activation_page_url: ::std::option::Option<::std::string::String>,
pub(crate) remote_identifier_type: ::std::option::Option<crate::types::RemoteAccountIdentifierType>,
}
impl EnvironmentBuilder {
/// <p>The provider on the remote side of this <code>Connection</code>.</p>
/// This field is required.
pub fn provider(mut self, input: crate::types::Provider) -> Self {
self.provider = ::std::option::Option::Some(input);
self
}
/// <p>The provider on the remote side of this <code>Connection</code>.</p>
pub fn set_provider(mut self, input: ::std::option::Option<crate::types::Provider>) -> Self {
self.provider = input;
self
}
/// <p>The provider on the remote side of this <code>Connection</code>.</p>
pub fn get_provider(&self) -> &::std::option::Option<crate::types::Provider> {
&self.provider
}
/// <p>The provider specific location on the remote side of this <code>Connection</code>.</p>
/// This field is required.
pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.location = ::std::option::Option::Some(input.into());
self
}
/// <p>The provider specific location on the remote side of this <code>Connection</code>.</p>
pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.location = input;
self
}
/// <p>The provider specific location on the remote side of this <code>Connection</code>.</p>
pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
&self.location
}
/// <p>The identifier of this <code>Environment</code></p>
/// This field is required.
pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.environment_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier of this <code>Environment</code></p>
pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.environment_id = input;
self
}
/// <p>The identifier of this <code>Environment</code></p>
pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
&self.environment_id
}
/// <p>The state of the <code>Environment</code>. Possible values:</p>
/// <ul>
/// <li>
/// <p><code>available</code>: The environment is available and new <code>Connection</code> objects can be requested.</p></li>
/// <li>
/// <p><code>limited</code>: The environment is available, but overall capacity is limited. The set of available bandwidths</p></li>
/// <li>
/// <p><code>unavailable</code>: The environment is currently unavailable.</p></li>
/// </ul>
/// This field is required.
pub fn state(mut self, input: crate::types::EnvironmentState) -> Self {
self.state = ::std::option::Option::Some(input);
self
}
/// <p>The state of the <code>Environment</code>. Possible values:</p>
/// <ul>
/// <li>
/// <p><code>available</code>: The environment is available and new <code>Connection</code> objects can be requested.</p></li>
/// <li>
/// <p><code>limited</code>: The environment is available, but overall capacity is limited. The set of available bandwidths</p></li>
/// <li>
/// <p><code>unavailable</code>: The environment is currently unavailable.</p></li>
/// </ul>
pub fn set_state(mut self, input: ::std::option::Option<crate::types::EnvironmentState>) -> Self {
self.state = input;
self
}
/// <p>The state of the <code>Environment</code>. Possible values:</p>
/// <ul>
/// <li>
/// <p><code>available</code>: The environment is available and new <code>Connection</code> objects can be requested.</p></li>
/// <li>
/// <p><code>limited</code>: The environment is available, but overall capacity is limited. The set of available bandwidths</p></li>
/// <li>
/// <p><code>unavailable</code>: The environment is currently unavailable.</p></li>
/// </ul>
pub fn get_state(&self) -> &::std::option::Option<crate::types::EnvironmentState> {
&self.state
}
/// <p>The sets of bandwidths that are available and supported on this environment.</p>
/// This field is required.
pub fn bandwidths(mut self, input: crate::types::Bandwidths) -> Self {
self.bandwidths = ::std::option::Option::Some(input);
self
}
/// <p>The sets of bandwidths that are available and supported on this environment.</p>
pub fn set_bandwidths(mut self, input: ::std::option::Option<crate::types::Bandwidths>) -> Self {
self.bandwidths = input;
self
}
/// <p>The sets of bandwidths that are available and supported on this environment.</p>
pub fn get_bandwidths(&self) -> &::std::option::Option<crate::types::Bandwidths> {
&self.bandwidths
}
/// <p>The specific product type of <code>Connection</code> objects provided by this <code>Environment</code>.</p>
/// This field is required.
pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.r#type = ::std::option::Option::Some(input.into());
self
}
/// <p>The specific product type of <code>Connection</code> objects provided by this <code>Environment</code>.</p>
pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.r#type = input;
self
}
/// <p>The specific product type of <code>Connection</code> objects provided by this <code>Environment</code>.</p>
pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
&self.r#type
}
/// <p>An HTTPS URL on the remote partner portal where the Activation Key should be brought to complete the creation process.</p>
pub fn activation_page_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.activation_page_url = ::std::option::Option::Some(input.into());
self
}
/// <p>An HTTPS URL on the remote partner portal where the Activation Key should be brought to complete the creation process.</p>
pub fn set_activation_page_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.activation_page_url = input;
self
}
/// <p>An HTTPS URL on the remote partner portal where the Activation Key should be brought to complete the creation process.</p>
pub fn get_activation_page_url(&self) -> &::std::option::Option<::std::string::String> {
&self.activation_page_url
}
/// <p>The type of identifying information that should be supplied to the <code>remoteAccount</code> parameter of a <code>CreateConnection</code> call for this specific Environment.</p>
pub fn remote_identifier_type(mut self, input: crate::types::RemoteAccountIdentifierType) -> Self {
self.remote_identifier_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of identifying information that should be supplied to the <code>remoteAccount</code> parameter of a <code>CreateConnection</code> call for this specific Environment.</p>
pub fn set_remote_identifier_type(mut self, input: ::std::option::Option<crate::types::RemoteAccountIdentifierType>) -> Self {
self.remote_identifier_type = input;
self
}
/// <p>The type of identifying information that should be supplied to the <code>remoteAccount</code> parameter of a <code>CreateConnection</code> call for this specific Environment.</p>
pub fn get_remote_identifier_type(&self) -> &::std::option::Option<crate::types::RemoteAccountIdentifierType> {
&self.remote_identifier_type
}
/// Consumes the builder and constructs a [`Environment`](crate::types::Environment).
/// This method will fail if any of the following fields are not set:
/// - [`location`](crate::types::builders::EnvironmentBuilder::location)
/// - [`environment_id`](crate::types::builders::EnvironmentBuilder::environment_id)
/// - [`state`](crate::types::builders::EnvironmentBuilder::state)
/// - [`r#type`](crate::types::builders::EnvironmentBuilder::type)
pub fn build(self) -> ::std::result::Result<crate::types::Environment, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Environment {
provider: self.provider,
location: self.location.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"location",
"location was not specified but it is required when building Environment",
)
})?,
environment_id: self.environment_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"environment_id",
"environment_id was not specified but it is required when building Environment",
)
})?,
state: self.state.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"state",
"state was not specified but it is required when building Environment",
)
})?,
bandwidths: self.bandwidths,
r#type: self.r#type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"r#type",
"r#type was not specified but it is required when building Environment",
)
})?,
activation_page_url: self.activation_page_url,
remote_identifier_type: self.remote_identifier_type,
})
}
}