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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The settings for a gateway, including its networks.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Gateway {
/// <p>The range of IP addresses that contribute content or initiate output requests for flows communicating with this gateway. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.</p>
pub egress_cidr_blocks: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The Amazon Resource Name (ARN) of the gateway.</p>
pub gateway_arn: ::std::option::Option<::std::string::String>,
/// <p>Messages with information about the gateway.</p>
pub gateway_messages: ::std::option::Option<::std::vec::Vec<crate::types::MessageDetail>>,
/// <p>The current status of the gateway.</p>
pub gateway_state: ::std::option::Option<crate::types::GatewayState>,
/// <p>The name of the gateway. This name can not be modified after the gateway is created.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The list of networks in the gateway.</p>
pub networks: ::std::option::Option<::std::vec::Vec<crate::types::GatewayNetwork>>,
}
impl Gateway {
/// <p>The range of IP addresses that contribute content or initiate output requests for flows communicating with this gateway. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.</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 `.egress_cidr_blocks.is_none()`.
pub fn egress_cidr_blocks(&self) -> &[::std::string::String] {
self.egress_cidr_blocks.as_deref().unwrap_or_default()
}
/// <p>The Amazon Resource Name (ARN) of the gateway.</p>
pub fn gateway_arn(&self) -> ::std::option::Option<&str> {
self.gateway_arn.as_deref()
}
/// <p>Messages with information about the gateway.</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 `.gateway_messages.is_none()`.
pub fn gateway_messages(&self) -> &[crate::types::MessageDetail] {
self.gateway_messages.as_deref().unwrap_or_default()
}
/// <p>The current status of the gateway.</p>
pub fn gateway_state(&self) -> ::std::option::Option<&crate::types::GatewayState> {
self.gateway_state.as_ref()
}
/// <p>The name of the gateway. This name can not be modified after the gateway is created.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The list of networks in the gateway.</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 `.networks.is_none()`.
pub fn networks(&self) -> &[crate::types::GatewayNetwork] {
self.networks.as_deref().unwrap_or_default()
}
}
impl Gateway {
/// Creates a new builder-style object to manufacture [`Gateway`](crate::types::Gateway).
pub fn builder() -> crate::types::builders::GatewayBuilder {
crate::types::builders::GatewayBuilder::default()
}
}
/// A builder for [`Gateway`](crate::types::Gateway).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GatewayBuilder {
pub(crate) egress_cidr_blocks: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) gateway_arn: ::std::option::Option<::std::string::String>,
pub(crate) gateway_messages: ::std::option::Option<::std::vec::Vec<crate::types::MessageDetail>>,
pub(crate) gateway_state: ::std::option::Option<crate::types::GatewayState>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) networks: ::std::option::Option<::std::vec::Vec<crate::types::GatewayNetwork>>,
}
impl GatewayBuilder {
/// Appends an item to `egress_cidr_blocks`.
///
/// To override the contents of this collection use [`set_egress_cidr_blocks`](Self::set_egress_cidr_blocks).
///
/// <p>The range of IP addresses that contribute content or initiate output requests for flows communicating with this gateway. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.</p>
pub fn egress_cidr_blocks(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.egress_cidr_blocks.unwrap_or_default();
v.push(input.into());
self.egress_cidr_blocks = ::std::option::Option::Some(v);
self
}
/// <p>The range of IP addresses that contribute content or initiate output requests for flows communicating with this gateway. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.</p>
pub fn set_egress_cidr_blocks(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.egress_cidr_blocks = input;
self
}
/// <p>The range of IP addresses that contribute content or initiate output requests for flows communicating with this gateway. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.</p>
pub fn get_egress_cidr_blocks(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.egress_cidr_blocks
}
/// <p>The Amazon Resource Name (ARN) of the gateway.</p>
/// This field is required.
pub fn gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.gateway_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the gateway.</p>
pub fn set_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.gateway_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the gateway.</p>
pub fn get_gateway_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.gateway_arn
}
/// Appends an item to `gateway_messages`.
///
/// To override the contents of this collection use [`set_gateway_messages`](Self::set_gateway_messages).
///
/// <p>Messages with information about the gateway.</p>
pub fn gateway_messages(mut self, input: crate::types::MessageDetail) -> Self {
let mut v = self.gateway_messages.unwrap_or_default();
v.push(input);
self.gateway_messages = ::std::option::Option::Some(v);
self
}
/// <p>Messages with information about the gateway.</p>
pub fn set_gateway_messages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MessageDetail>>) -> Self {
self.gateway_messages = input;
self
}
/// <p>Messages with information about the gateway.</p>
pub fn get_gateway_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MessageDetail>> {
&self.gateway_messages
}
/// <p>The current status of the gateway.</p>
pub fn gateway_state(mut self, input: crate::types::GatewayState) -> Self {
self.gateway_state = ::std::option::Option::Some(input);
self
}
/// <p>The current status of the gateway.</p>
pub fn set_gateway_state(mut self, input: ::std::option::Option<crate::types::GatewayState>) -> Self {
self.gateway_state = input;
self
}
/// <p>The current status of the gateway.</p>
pub fn get_gateway_state(&self) -> &::std::option::Option<crate::types::GatewayState> {
&self.gateway_state
}
/// <p>The name of the gateway. This name can not be modified after the gateway is created.</p>
/// This field is required.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the gateway. This name can not be modified after the gateway is created.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the gateway. This name can not be modified after the gateway is created.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// Appends an item to `networks`.
///
/// To override the contents of this collection use [`set_networks`](Self::set_networks).
///
/// <p>The list of networks in the gateway.</p>
pub fn networks(mut self, input: crate::types::GatewayNetwork) -> Self {
let mut v = self.networks.unwrap_or_default();
v.push(input);
self.networks = ::std::option::Option::Some(v);
self
}
/// <p>The list of networks in the gateway.</p>
pub fn set_networks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GatewayNetwork>>) -> Self {
self.networks = input;
self
}
/// <p>The list of networks in the gateway.</p>
pub fn get_networks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GatewayNetwork>> {
&self.networks
}
/// Consumes the builder and constructs a [`Gateway`](crate::types::Gateway).
pub fn build(self) -> crate::types::Gateway {
crate::types::Gateway {
egress_cidr_blocks: self.egress_cidr_blocks,
gateway_arn: self.gateway_arn,
gateway_messages: self.gateway_messages,
gateway_state: self.gateway_state,
name: self.name,
networks: self.networks,
}
}
}