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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Represents the subnet associated with a DAX cluster. This parameter refers to subnets defined in Amazon Virtual Private Cloud (Amazon VPC) and used with DAX.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Subnet {
/// <p>The system-assigned identifier for the subnet.</p>
pub subnet_identifier: ::std::option::Option<::std::string::String>,
/// <p>The Availability Zone (AZ) for the subnet.</p>
pub subnet_availability_zone: ::std::option::Option<::std::string::String>,
/// <p>The network types supported by this subnet. Returns an array of strings that can include <code>ipv4</code>, <code>ipv6</code>, or both, indicating whether the subnet supports IPv4 only, IPv6 only, or dual-stack deployments.</p>
pub supported_network_types: ::std::option::Option<::std::vec::Vec<crate::types::NetworkType>>,
}
impl Subnet {
/// <p>The system-assigned identifier for the subnet.</p>
pub fn subnet_identifier(&self) -> ::std::option::Option<&str> {
self.subnet_identifier.as_deref()
}
/// <p>The Availability Zone (AZ) for the subnet.</p>
pub fn subnet_availability_zone(&self) -> ::std::option::Option<&str> {
self.subnet_availability_zone.as_deref()
}
/// <p>The network types supported by this subnet. Returns an array of strings that can include <code>ipv4</code>, <code>ipv6</code>, or both, indicating whether the subnet supports IPv4 only, IPv6 only, or dual-stack deployments.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.supported_network_types.is_none()`.
pub fn supported_network_types(&self) -> &[crate::types::NetworkType] {
self.supported_network_types.as_deref().unwrap_or_default()
}
}
impl Subnet {
/// Creates a new builder-style object to manufacture [`Subnet`](crate::types::Subnet).
pub fn builder() -> crate::types::builders::SubnetBuilder {
crate::types::builders::SubnetBuilder::default()
}
}
/// A builder for [`Subnet`](crate::types::Subnet).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SubnetBuilder {
pub(crate) subnet_identifier: ::std::option::Option<::std::string::String>,
pub(crate) subnet_availability_zone: ::std::option::Option<::std::string::String>,
pub(crate) supported_network_types: ::std::option::Option<::std::vec::Vec<crate::types::NetworkType>>,
}
impl SubnetBuilder {
/// <p>The system-assigned identifier for the subnet.</p>
pub fn subnet_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.subnet_identifier = ::std::option::Option::Some(input.into());
self
}
/// <p>The system-assigned identifier for the subnet.</p>
pub fn set_subnet_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.subnet_identifier = input;
self
}
/// <p>The system-assigned identifier for the subnet.</p>
pub fn get_subnet_identifier(&self) -> &::std::option::Option<::std::string::String> {
&self.subnet_identifier
}
/// <p>The Availability Zone (AZ) for the subnet.</p>
pub fn subnet_availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.subnet_availability_zone = ::std::option::Option::Some(input.into());
self
}
/// <p>The Availability Zone (AZ) for the subnet.</p>
pub fn set_subnet_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.subnet_availability_zone = input;
self
}
/// <p>The Availability Zone (AZ) for the subnet.</p>
pub fn get_subnet_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
&self.subnet_availability_zone
}
/// Appends an item to `supported_network_types`.
///
/// To override the contents of this collection use [`set_supported_network_types`](Self::set_supported_network_types).
///
/// <p>The network types supported by this subnet. Returns an array of strings that can include <code>ipv4</code>, <code>ipv6</code>, or both, indicating whether the subnet supports IPv4 only, IPv6 only, or dual-stack deployments.</p>
pub fn supported_network_types(mut self, input: crate::types::NetworkType) -> Self {
let mut v = self.supported_network_types.unwrap_or_default();
v.push(input);
self.supported_network_types = ::std::option::Option::Some(v);
self
}
/// <p>The network types supported by this subnet. Returns an array of strings that can include <code>ipv4</code>, <code>ipv6</code>, or both, indicating whether the subnet supports IPv4 only, IPv6 only, or dual-stack deployments.</p>
pub fn set_supported_network_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::NetworkType>>) -> Self {
self.supported_network_types = input;
self
}
/// <p>The network types supported by this subnet. Returns an array of strings that can include <code>ipv4</code>, <code>ipv6</code>, or both, indicating whether the subnet supports IPv4 only, IPv6 only, or dual-stack deployments.</p>
pub fn get_supported_network_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::NetworkType>> {
&self.supported_network_types
}
/// Consumes the builder and constructs a [`Subnet`](crate::types::Subnet).
pub fn build(self) -> crate::types::Subnet {
crate::types::Subnet {
subnet_identifier: self.subnet_identifier,
subnet_availability_zone: self.subnet_availability_zone,
supported_network_types: self.supported_network_types,
}
}
}