aws_sdk_inspector/types/
_network_interface.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct NetworkInterface {
7 pub network_interface_id: ::std::option::Option<::std::string::String>,
9 pub subnet_id: ::std::option::Option<::std::string::String>,
11 pub vpc_id: ::std::option::Option<::std::string::String>,
13 pub private_dns_name: ::std::option::Option<::std::string::String>,
15 pub private_ip_address: ::std::option::Option<::std::string::String>,
17 pub private_ip_addresses: ::std::option::Option<::std::vec::Vec<crate::types::PrivateIp>>,
19 pub public_dns_name: ::std::option::Option<::std::string::String>,
21 pub public_ip: ::std::option::Option<::std::string::String>,
23 pub ipv6_addresses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
25 pub security_groups: ::std::option::Option<::std::vec::Vec<crate::types::SecurityGroup>>,
27}
28impl NetworkInterface {
29 pub fn network_interface_id(&self) -> ::std::option::Option<&str> {
31 self.network_interface_id.as_deref()
32 }
33 pub fn subnet_id(&self) -> ::std::option::Option<&str> {
35 self.subnet_id.as_deref()
36 }
37 pub fn vpc_id(&self) -> ::std::option::Option<&str> {
39 self.vpc_id.as_deref()
40 }
41 pub fn private_dns_name(&self) -> ::std::option::Option<&str> {
43 self.private_dns_name.as_deref()
44 }
45 pub fn private_ip_address(&self) -> ::std::option::Option<&str> {
47 self.private_ip_address.as_deref()
48 }
49 pub fn private_ip_addresses(&self) -> &[crate::types::PrivateIp] {
53 self.private_ip_addresses.as_deref().unwrap_or_default()
54 }
55 pub fn public_dns_name(&self) -> ::std::option::Option<&str> {
57 self.public_dns_name.as_deref()
58 }
59 pub fn public_ip(&self) -> ::std::option::Option<&str> {
61 self.public_ip.as_deref()
62 }
63 pub fn ipv6_addresses(&self) -> &[::std::string::String] {
67 self.ipv6_addresses.as_deref().unwrap_or_default()
68 }
69 pub fn security_groups(&self) -> &[crate::types::SecurityGroup] {
73 self.security_groups.as_deref().unwrap_or_default()
74 }
75}
76impl NetworkInterface {
77 pub fn builder() -> crate::types::builders::NetworkInterfaceBuilder {
79 crate::types::builders::NetworkInterfaceBuilder::default()
80 }
81}
82
83#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
85#[non_exhaustive]
86pub struct NetworkInterfaceBuilder {
87 pub(crate) network_interface_id: ::std::option::Option<::std::string::String>,
88 pub(crate) subnet_id: ::std::option::Option<::std::string::String>,
89 pub(crate) vpc_id: ::std::option::Option<::std::string::String>,
90 pub(crate) private_dns_name: ::std::option::Option<::std::string::String>,
91 pub(crate) private_ip_address: ::std::option::Option<::std::string::String>,
92 pub(crate) private_ip_addresses: ::std::option::Option<::std::vec::Vec<crate::types::PrivateIp>>,
93 pub(crate) public_dns_name: ::std::option::Option<::std::string::String>,
94 pub(crate) public_ip: ::std::option::Option<::std::string::String>,
95 pub(crate) ipv6_addresses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
96 pub(crate) security_groups: ::std::option::Option<::std::vec::Vec<crate::types::SecurityGroup>>,
97}
98impl NetworkInterfaceBuilder {
99 pub fn network_interface_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101 self.network_interface_id = ::std::option::Option::Some(input.into());
102 self
103 }
104 pub fn set_network_interface_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106 self.network_interface_id = input;
107 self
108 }
109 pub fn get_network_interface_id(&self) -> &::std::option::Option<::std::string::String> {
111 &self.network_interface_id
112 }
113 pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.subnet_id = ::std::option::Option::Some(input.into());
116 self
117 }
118 pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.subnet_id = input;
121 self
122 }
123 pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
125 &self.subnet_id
126 }
127 pub fn vpc_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129 self.vpc_id = ::std::option::Option::Some(input.into());
130 self
131 }
132 pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134 self.vpc_id = input;
135 self
136 }
137 pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
139 &self.vpc_id
140 }
141 pub fn private_dns_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143 self.private_dns_name = ::std::option::Option::Some(input.into());
144 self
145 }
146 pub fn set_private_dns_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148 self.private_dns_name = input;
149 self
150 }
151 pub fn get_private_dns_name(&self) -> &::std::option::Option<::std::string::String> {
153 &self.private_dns_name
154 }
155 pub fn private_ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157 self.private_ip_address = ::std::option::Option::Some(input.into());
158 self
159 }
160 pub fn set_private_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162 self.private_ip_address = input;
163 self
164 }
165 pub fn get_private_ip_address(&self) -> &::std::option::Option<::std::string::String> {
167 &self.private_ip_address
168 }
169 pub fn private_ip_addresses(mut self, input: crate::types::PrivateIp) -> Self {
175 let mut v = self.private_ip_addresses.unwrap_or_default();
176 v.push(input);
177 self.private_ip_addresses = ::std::option::Option::Some(v);
178 self
179 }
180 pub fn set_private_ip_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PrivateIp>>) -> Self {
182 self.private_ip_addresses = input;
183 self
184 }
185 pub fn get_private_ip_addresses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PrivateIp>> {
187 &self.private_ip_addresses
188 }
189 pub fn public_dns_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191 self.public_dns_name = ::std::option::Option::Some(input.into());
192 self
193 }
194 pub fn set_public_dns_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196 self.public_dns_name = input;
197 self
198 }
199 pub fn get_public_dns_name(&self) -> &::std::option::Option<::std::string::String> {
201 &self.public_dns_name
202 }
203 pub fn public_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205 self.public_ip = ::std::option::Option::Some(input.into());
206 self
207 }
208 pub fn set_public_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210 self.public_ip = input;
211 self
212 }
213 pub fn get_public_ip(&self) -> &::std::option::Option<::std::string::String> {
215 &self.public_ip
216 }
217 pub fn ipv6_addresses(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
223 let mut v = self.ipv6_addresses.unwrap_or_default();
224 v.push(input.into());
225 self.ipv6_addresses = ::std::option::Option::Some(v);
226 self
227 }
228 pub fn set_ipv6_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
230 self.ipv6_addresses = input;
231 self
232 }
233 pub fn get_ipv6_addresses(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
235 &self.ipv6_addresses
236 }
237 pub fn security_groups(mut self, input: crate::types::SecurityGroup) -> Self {
243 let mut v = self.security_groups.unwrap_or_default();
244 v.push(input);
245 self.security_groups = ::std::option::Option::Some(v);
246 self
247 }
248 pub fn set_security_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SecurityGroup>>) -> Self {
250 self.security_groups = input;
251 self
252 }
253 pub fn get_security_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SecurityGroup>> {
255 &self.security_groups
256 }
257 pub fn build(self) -> crate::types::NetworkInterface {
259 crate::types::NetworkInterface {
260 network_interface_id: self.network_interface_id,
261 subnet_id: self.subnet_id,
262 vpc_id: self.vpc_id,
263 private_dns_name: self.private_dns_name,
264 private_ip_address: self.private_ip_address,
265 private_ip_addresses: self.private_ip_addresses,
266 public_dns_name: self.public_dns_name,
267 public_ip: self.public_ip,
268 ipv6_addresses: self.ipv6_addresses,
269 security_groups: self.security_groups,
270 }
271 }
272}