aws_sdk_networkmanager/types/_network_resource.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes a network resource.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct NetworkResource {
7 /// <p>The ARN of the gateway.</p>
8 pub registered_gateway_arn: ::std::option::Option<::std::string::String>,
9 /// <p>The ID of a core network.</p>
10 pub core_network_id: ::std::option::Option<::std::string::String>,
11 /// <p>The Amazon Web Services Region.</p>
12 pub aws_region: ::std::option::Option<::std::string::String>,
13 /// <p>The Amazon Web Services account ID.</p>
14 pub account_id: ::std::option::Option<::std::string::String>,
15 /// <p>The resource type.</p>
16 /// <p>The following are the supported resource types for Direct Connect:</p>
17 /// <ul>
18 /// <li>
19 /// <p><code>dxcon</code></p></li>
20 /// <li>
21 /// <p><code>dx-gateway</code></p></li>
22 /// <li>
23 /// <p><code>dx-vif</code></p></li>
24 /// </ul>
25 /// <p>The following are the supported resource types for Network Manager:</p>
26 /// <ul>
27 /// <li>
28 /// <p><code>attachment</code></p></li>
29 /// <li>
30 /// <p><code>connect-peer</code></p></li>
31 /// <li>
32 /// <p><code>connection</code></p></li>
33 /// <li>
34 /// <p><code>core-network</code></p></li>
35 /// <li>
36 /// <p><code>device</code></p></li>
37 /// <li>
38 /// <p><code>link</code></p></li>
39 /// <li>
40 /// <p><code>peering</code></p></li>
41 /// <li>
42 /// <p><code>site</code></p></li>
43 /// </ul>
44 /// <p>The following are the supported resource types for Amazon VPC:</p>
45 /// <ul>
46 /// <li>
47 /// <p><code>customer-gateway</code></p></li>
48 /// <li>
49 /// <p><code>transit-gateway</code></p></li>
50 /// <li>
51 /// <p><code>transit-gateway-attachment</code></p></li>
52 /// <li>
53 /// <p><code>transit-gateway-connect-peer</code></p></li>
54 /// <li>
55 /// <p><code>transit-gateway-route-table</code></p></li>
56 /// <li>
57 /// <p><code>vpn-connection</code></p></li>
58 /// </ul>
59 pub resource_type: ::std::option::Option<::std::string::String>,
60 /// <p>The ID of the resource.</p>
61 pub resource_id: ::std::option::Option<::std::string::String>,
62 /// <p>The ARN of the resource.</p>
63 pub resource_arn: ::std::option::Option<::std::string::String>,
64 /// <p>Information about the resource, in JSON format. Network Manager gets this information by describing the resource using its Describe API call.</p>
65 pub definition: ::std::option::Option<::std::string::String>,
66 /// <p>The time that the resource definition was retrieved.</p>
67 pub definition_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
68 /// <p>The tags.</p>
69 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
70 /// <p>The resource metadata.</p>
71 pub metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
72}
73impl NetworkResource {
74 /// <p>The ARN of the gateway.</p>
75 pub fn registered_gateway_arn(&self) -> ::std::option::Option<&str> {
76 self.registered_gateway_arn.as_deref()
77 }
78 /// <p>The ID of a core network.</p>
79 pub fn core_network_id(&self) -> ::std::option::Option<&str> {
80 self.core_network_id.as_deref()
81 }
82 /// <p>The Amazon Web Services Region.</p>
83 pub fn aws_region(&self) -> ::std::option::Option<&str> {
84 self.aws_region.as_deref()
85 }
86 /// <p>The Amazon Web Services account ID.</p>
87 pub fn account_id(&self) -> ::std::option::Option<&str> {
88 self.account_id.as_deref()
89 }
90 /// <p>The resource type.</p>
91 /// <p>The following are the supported resource types for Direct Connect:</p>
92 /// <ul>
93 /// <li>
94 /// <p><code>dxcon</code></p></li>
95 /// <li>
96 /// <p><code>dx-gateway</code></p></li>
97 /// <li>
98 /// <p><code>dx-vif</code></p></li>
99 /// </ul>
100 /// <p>The following are the supported resource types for Network Manager:</p>
101 /// <ul>
102 /// <li>
103 /// <p><code>attachment</code></p></li>
104 /// <li>
105 /// <p><code>connect-peer</code></p></li>
106 /// <li>
107 /// <p><code>connection</code></p></li>
108 /// <li>
109 /// <p><code>core-network</code></p></li>
110 /// <li>
111 /// <p><code>device</code></p></li>
112 /// <li>
113 /// <p><code>link</code></p></li>
114 /// <li>
115 /// <p><code>peering</code></p></li>
116 /// <li>
117 /// <p><code>site</code></p></li>
118 /// </ul>
119 /// <p>The following are the supported resource types for Amazon VPC:</p>
120 /// <ul>
121 /// <li>
122 /// <p><code>customer-gateway</code></p></li>
123 /// <li>
124 /// <p><code>transit-gateway</code></p></li>
125 /// <li>
126 /// <p><code>transit-gateway-attachment</code></p></li>
127 /// <li>
128 /// <p><code>transit-gateway-connect-peer</code></p></li>
129 /// <li>
130 /// <p><code>transit-gateway-route-table</code></p></li>
131 /// <li>
132 /// <p><code>vpn-connection</code></p></li>
133 /// </ul>
134 pub fn resource_type(&self) -> ::std::option::Option<&str> {
135 self.resource_type.as_deref()
136 }
137 /// <p>The ID of the resource.</p>
138 pub fn resource_id(&self) -> ::std::option::Option<&str> {
139 self.resource_id.as_deref()
140 }
141 /// <p>The ARN of the resource.</p>
142 pub fn resource_arn(&self) -> ::std::option::Option<&str> {
143 self.resource_arn.as_deref()
144 }
145 /// <p>Information about the resource, in JSON format. Network Manager gets this information by describing the resource using its Describe API call.</p>
146 pub fn definition(&self) -> ::std::option::Option<&str> {
147 self.definition.as_deref()
148 }
149 /// <p>The time that the resource definition was retrieved.</p>
150 pub fn definition_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
151 self.definition_timestamp.as_ref()
152 }
153 /// <p>The tags.</p>
154 ///
155 /// 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()`.
156 pub fn tags(&self) -> &[crate::types::Tag] {
157 self.tags.as_deref().unwrap_or_default()
158 }
159 /// <p>The resource metadata.</p>
160 pub fn metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
161 self.metadata.as_ref()
162 }
163}
164impl NetworkResource {
165 /// Creates a new builder-style object to manufacture [`NetworkResource`](crate::types::NetworkResource).
166 pub fn builder() -> crate::types::builders::NetworkResourceBuilder {
167 crate::types::builders::NetworkResourceBuilder::default()
168 }
169}
170
171/// A builder for [`NetworkResource`](crate::types::NetworkResource).
172#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
173#[non_exhaustive]
174pub struct NetworkResourceBuilder {
175 pub(crate) registered_gateway_arn: ::std::option::Option<::std::string::String>,
176 pub(crate) core_network_id: ::std::option::Option<::std::string::String>,
177 pub(crate) aws_region: ::std::option::Option<::std::string::String>,
178 pub(crate) account_id: ::std::option::Option<::std::string::String>,
179 pub(crate) resource_type: ::std::option::Option<::std::string::String>,
180 pub(crate) resource_id: ::std::option::Option<::std::string::String>,
181 pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
182 pub(crate) definition: ::std::option::Option<::std::string::String>,
183 pub(crate) definition_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
184 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
185 pub(crate) metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
186}
187impl NetworkResourceBuilder {
188 /// <p>The ARN of the gateway.</p>
189 pub fn registered_gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190 self.registered_gateway_arn = ::std::option::Option::Some(input.into());
191 self
192 }
193 /// <p>The ARN of the gateway.</p>
194 pub fn set_registered_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195 self.registered_gateway_arn = input;
196 self
197 }
198 /// <p>The ARN of the gateway.</p>
199 pub fn get_registered_gateway_arn(&self) -> &::std::option::Option<::std::string::String> {
200 &self.registered_gateway_arn
201 }
202 /// <p>The ID of a core network.</p>
203 pub fn core_network_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
204 self.core_network_id = ::std::option::Option::Some(input.into());
205 self
206 }
207 /// <p>The ID of a core network.</p>
208 pub fn set_core_network_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209 self.core_network_id = input;
210 self
211 }
212 /// <p>The ID of a core network.</p>
213 pub fn get_core_network_id(&self) -> &::std::option::Option<::std::string::String> {
214 &self.core_network_id
215 }
216 /// <p>The Amazon Web Services Region.</p>
217 pub fn aws_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218 self.aws_region = ::std::option::Option::Some(input.into());
219 self
220 }
221 /// <p>The Amazon Web Services Region.</p>
222 pub fn set_aws_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
223 self.aws_region = input;
224 self
225 }
226 /// <p>The Amazon Web Services Region.</p>
227 pub fn get_aws_region(&self) -> &::std::option::Option<::std::string::String> {
228 &self.aws_region
229 }
230 /// <p>The Amazon Web Services account ID.</p>
231 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232 self.account_id = ::std::option::Option::Some(input.into());
233 self
234 }
235 /// <p>The Amazon Web Services account ID.</p>
236 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
237 self.account_id = input;
238 self
239 }
240 /// <p>The Amazon Web Services account ID.</p>
241 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
242 &self.account_id
243 }
244 /// <p>The resource type.</p>
245 /// <p>The following are the supported resource types for Direct Connect:</p>
246 /// <ul>
247 /// <li>
248 /// <p><code>dxcon</code></p></li>
249 /// <li>
250 /// <p><code>dx-gateway</code></p></li>
251 /// <li>
252 /// <p><code>dx-vif</code></p></li>
253 /// </ul>
254 /// <p>The following are the supported resource types for Network Manager:</p>
255 /// <ul>
256 /// <li>
257 /// <p><code>attachment</code></p></li>
258 /// <li>
259 /// <p><code>connect-peer</code></p></li>
260 /// <li>
261 /// <p><code>connection</code></p></li>
262 /// <li>
263 /// <p><code>core-network</code></p></li>
264 /// <li>
265 /// <p><code>device</code></p></li>
266 /// <li>
267 /// <p><code>link</code></p></li>
268 /// <li>
269 /// <p><code>peering</code></p></li>
270 /// <li>
271 /// <p><code>site</code></p></li>
272 /// </ul>
273 /// <p>The following are the supported resource types for Amazon VPC:</p>
274 /// <ul>
275 /// <li>
276 /// <p><code>customer-gateway</code></p></li>
277 /// <li>
278 /// <p><code>transit-gateway</code></p></li>
279 /// <li>
280 /// <p><code>transit-gateway-attachment</code></p></li>
281 /// <li>
282 /// <p><code>transit-gateway-connect-peer</code></p></li>
283 /// <li>
284 /// <p><code>transit-gateway-route-table</code></p></li>
285 /// <li>
286 /// <p><code>vpn-connection</code></p></li>
287 /// </ul>
288 pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
289 self.resource_type = ::std::option::Option::Some(input.into());
290 self
291 }
292 /// <p>The resource type.</p>
293 /// <p>The following are the supported resource types for Direct Connect:</p>
294 /// <ul>
295 /// <li>
296 /// <p><code>dxcon</code></p></li>
297 /// <li>
298 /// <p><code>dx-gateway</code></p></li>
299 /// <li>
300 /// <p><code>dx-vif</code></p></li>
301 /// </ul>
302 /// <p>The following are the supported resource types for Network Manager:</p>
303 /// <ul>
304 /// <li>
305 /// <p><code>attachment</code></p></li>
306 /// <li>
307 /// <p><code>connect-peer</code></p></li>
308 /// <li>
309 /// <p><code>connection</code></p></li>
310 /// <li>
311 /// <p><code>core-network</code></p></li>
312 /// <li>
313 /// <p><code>device</code></p></li>
314 /// <li>
315 /// <p><code>link</code></p></li>
316 /// <li>
317 /// <p><code>peering</code></p></li>
318 /// <li>
319 /// <p><code>site</code></p></li>
320 /// </ul>
321 /// <p>The following are the supported resource types for Amazon VPC:</p>
322 /// <ul>
323 /// <li>
324 /// <p><code>customer-gateway</code></p></li>
325 /// <li>
326 /// <p><code>transit-gateway</code></p></li>
327 /// <li>
328 /// <p><code>transit-gateway-attachment</code></p></li>
329 /// <li>
330 /// <p><code>transit-gateway-connect-peer</code></p></li>
331 /// <li>
332 /// <p><code>transit-gateway-route-table</code></p></li>
333 /// <li>
334 /// <p><code>vpn-connection</code></p></li>
335 /// </ul>
336 pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
337 self.resource_type = input;
338 self
339 }
340 /// <p>The resource type.</p>
341 /// <p>The following are the supported resource types for Direct Connect:</p>
342 /// <ul>
343 /// <li>
344 /// <p><code>dxcon</code></p></li>
345 /// <li>
346 /// <p><code>dx-gateway</code></p></li>
347 /// <li>
348 /// <p><code>dx-vif</code></p></li>
349 /// </ul>
350 /// <p>The following are the supported resource types for Network Manager:</p>
351 /// <ul>
352 /// <li>
353 /// <p><code>attachment</code></p></li>
354 /// <li>
355 /// <p><code>connect-peer</code></p></li>
356 /// <li>
357 /// <p><code>connection</code></p></li>
358 /// <li>
359 /// <p><code>core-network</code></p></li>
360 /// <li>
361 /// <p><code>device</code></p></li>
362 /// <li>
363 /// <p><code>link</code></p></li>
364 /// <li>
365 /// <p><code>peering</code></p></li>
366 /// <li>
367 /// <p><code>site</code></p></li>
368 /// </ul>
369 /// <p>The following are the supported resource types for Amazon VPC:</p>
370 /// <ul>
371 /// <li>
372 /// <p><code>customer-gateway</code></p></li>
373 /// <li>
374 /// <p><code>transit-gateway</code></p></li>
375 /// <li>
376 /// <p><code>transit-gateway-attachment</code></p></li>
377 /// <li>
378 /// <p><code>transit-gateway-connect-peer</code></p></li>
379 /// <li>
380 /// <p><code>transit-gateway-route-table</code></p></li>
381 /// <li>
382 /// <p><code>vpn-connection</code></p></li>
383 /// </ul>
384 pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> {
385 &self.resource_type
386 }
387 /// <p>The ID of the resource.</p>
388 pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
389 self.resource_id = ::std::option::Option::Some(input.into());
390 self
391 }
392 /// <p>The ID of the resource.</p>
393 pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
394 self.resource_id = input;
395 self
396 }
397 /// <p>The ID of the resource.</p>
398 pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
399 &self.resource_id
400 }
401 /// <p>The ARN of the resource.</p>
402 pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
403 self.resource_arn = ::std::option::Option::Some(input.into());
404 self
405 }
406 /// <p>The ARN of the resource.</p>
407 pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
408 self.resource_arn = input;
409 self
410 }
411 /// <p>The ARN of the resource.</p>
412 pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
413 &self.resource_arn
414 }
415 /// <p>Information about the resource, in JSON format. Network Manager gets this information by describing the resource using its Describe API call.</p>
416 pub fn definition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
417 self.definition = ::std::option::Option::Some(input.into());
418 self
419 }
420 /// <p>Information about the resource, in JSON format. Network Manager gets this information by describing the resource using its Describe API call.</p>
421 pub fn set_definition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
422 self.definition = input;
423 self
424 }
425 /// <p>Information about the resource, in JSON format. Network Manager gets this information by describing the resource using its Describe API call.</p>
426 pub fn get_definition(&self) -> &::std::option::Option<::std::string::String> {
427 &self.definition
428 }
429 /// <p>The time that the resource definition was retrieved.</p>
430 pub fn definition_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
431 self.definition_timestamp = ::std::option::Option::Some(input);
432 self
433 }
434 /// <p>The time that the resource definition was retrieved.</p>
435 pub fn set_definition_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
436 self.definition_timestamp = input;
437 self
438 }
439 /// <p>The time that the resource definition was retrieved.</p>
440 pub fn get_definition_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
441 &self.definition_timestamp
442 }
443 /// Appends an item to `tags`.
444 ///
445 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
446 ///
447 /// <p>The tags.</p>
448 pub fn tags(mut self, input: crate::types::Tag) -> Self {
449 let mut v = self.tags.unwrap_or_default();
450 v.push(input);
451 self.tags = ::std::option::Option::Some(v);
452 self
453 }
454 /// <p>The tags.</p>
455 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
456 self.tags = input;
457 self
458 }
459 /// <p>The tags.</p>
460 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
461 &self.tags
462 }
463 /// Adds a key-value pair to `metadata`.
464 ///
465 /// To override the contents of this collection use [`set_metadata`](Self::set_metadata).
466 ///
467 /// <p>The resource metadata.</p>
468 pub fn metadata(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
469 let mut hash_map = self.metadata.unwrap_or_default();
470 hash_map.insert(k.into(), v.into());
471 self.metadata = ::std::option::Option::Some(hash_map);
472 self
473 }
474 /// <p>The resource metadata.</p>
475 pub fn set_metadata(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
476 self.metadata = input;
477 self
478 }
479 /// <p>The resource metadata.</p>
480 pub fn get_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
481 &self.metadata
482 }
483 /// Consumes the builder and constructs a [`NetworkResource`](crate::types::NetworkResource).
484 pub fn build(self) -> crate::types::NetworkResource {
485 crate::types::NetworkResource {
486 registered_gateway_arn: self.registered_gateway_arn,
487 core_network_id: self.core_network_id,
488 aws_region: self.aws_region,
489 account_id: self.account_id,
490 resource_type: self.resource_type,
491 resource_id: self.resource_id,
492 resource_arn: self.resource_arn,
493 definition: self.definition,
494 definition_timestamp: self.definition_timestamp,
495 tags: self.tags,
496 metadata: self.metadata,
497 }
498 }
499}