aws_sdk_ec2/operation/describe_network_interface_attribute/
_describe_network_interface_attribute_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeNetworkInterfaceAttributeOutput {
7 pub attachment: ::std::option::Option<crate::types::NetworkInterfaceAttachment>,
9 pub description: ::std::option::Option<crate::types::AttributeValue>,
11 pub groups: ::std::option::Option<::std::vec::Vec<crate::types::GroupIdentifier>>,
13 pub network_interface_id: ::std::option::Option<::std::string::String>,
15 pub source_dest_check: ::std::option::Option<crate::types::AttributeBooleanValue>,
17 pub associate_public_ip_address: ::std::option::Option<bool>,
19 _request_id: Option<String>,
20}
21impl DescribeNetworkInterfaceAttributeOutput {
22 pub fn attachment(&self) -> ::std::option::Option<&crate::types::NetworkInterfaceAttachment> {
24 self.attachment.as_ref()
25 }
26 pub fn description(&self) -> ::std::option::Option<&crate::types::AttributeValue> {
28 self.description.as_ref()
29 }
30 pub fn groups(&self) -> &[crate::types::GroupIdentifier] {
34 self.groups.as_deref().unwrap_or_default()
35 }
36 pub fn network_interface_id(&self) -> ::std::option::Option<&str> {
38 self.network_interface_id.as_deref()
39 }
40 pub fn source_dest_check(&self) -> ::std::option::Option<&crate::types::AttributeBooleanValue> {
42 self.source_dest_check.as_ref()
43 }
44 pub fn associate_public_ip_address(&self) -> ::std::option::Option<bool> {
46 self.associate_public_ip_address
47 }
48}
49impl ::aws_types::request_id::RequestId for DescribeNetworkInterfaceAttributeOutput {
50 fn request_id(&self) -> Option<&str> {
51 self._request_id.as_deref()
52 }
53}
54impl DescribeNetworkInterfaceAttributeOutput {
55 pub fn builder() -> crate::operation::describe_network_interface_attribute::builders::DescribeNetworkInterfaceAttributeOutputBuilder {
57 crate::operation::describe_network_interface_attribute::builders::DescribeNetworkInterfaceAttributeOutputBuilder::default()
58 }
59}
60
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
63#[non_exhaustive]
64pub struct DescribeNetworkInterfaceAttributeOutputBuilder {
65 pub(crate) attachment: ::std::option::Option<crate::types::NetworkInterfaceAttachment>,
66 pub(crate) description: ::std::option::Option<crate::types::AttributeValue>,
67 pub(crate) groups: ::std::option::Option<::std::vec::Vec<crate::types::GroupIdentifier>>,
68 pub(crate) network_interface_id: ::std::option::Option<::std::string::String>,
69 pub(crate) source_dest_check: ::std::option::Option<crate::types::AttributeBooleanValue>,
70 pub(crate) associate_public_ip_address: ::std::option::Option<bool>,
71 _request_id: Option<String>,
72}
73impl DescribeNetworkInterfaceAttributeOutputBuilder {
74 pub fn attachment(mut self, input: crate::types::NetworkInterfaceAttachment) -> Self {
76 self.attachment = ::std::option::Option::Some(input);
77 self
78 }
79 pub fn set_attachment(mut self, input: ::std::option::Option<crate::types::NetworkInterfaceAttachment>) -> Self {
81 self.attachment = input;
82 self
83 }
84 pub fn get_attachment(&self) -> &::std::option::Option<crate::types::NetworkInterfaceAttachment> {
86 &self.attachment
87 }
88 pub fn description(mut self, input: crate::types::AttributeValue) -> Self {
90 self.description = ::std::option::Option::Some(input);
91 self
92 }
93 pub fn set_description(mut self, input: ::std::option::Option<crate::types::AttributeValue>) -> Self {
95 self.description = input;
96 self
97 }
98 pub fn get_description(&self) -> &::std::option::Option<crate::types::AttributeValue> {
100 &self.description
101 }
102 pub fn groups(mut self, input: crate::types::GroupIdentifier) -> Self {
108 let mut v = self.groups.unwrap_or_default();
109 v.push(input);
110 self.groups = ::std::option::Option::Some(v);
111 self
112 }
113 pub fn set_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GroupIdentifier>>) -> Self {
115 self.groups = input;
116 self
117 }
118 pub fn get_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GroupIdentifier>> {
120 &self.groups
121 }
122 pub fn network_interface_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124 self.network_interface_id = ::std::option::Option::Some(input.into());
125 self
126 }
127 pub fn set_network_interface_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129 self.network_interface_id = input;
130 self
131 }
132 pub fn get_network_interface_id(&self) -> &::std::option::Option<::std::string::String> {
134 &self.network_interface_id
135 }
136 pub fn source_dest_check(mut self, input: crate::types::AttributeBooleanValue) -> Self {
138 self.source_dest_check = ::std::option::Option::Some(input);
139 self
140 }
141 pub fn set_source_dest_check(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
143 self.source_dest_check = input;
144 self
145 }
146 pub fn get_source_dest_check(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
148 &self.source_dest_check
149 }
150 pub fn associate_public_ip_address(mut self, input: bool) -> Self {
152 self.associate_public_ip_address = ::std::option::Option::Some(input);
153 self
154 }
155 pub fn set_associate_public_ip_address(mut self, input: ::std::option::Option<bool>) -> Self {
157 self.associate_public_ip_address = input;
158 self
159 }
160 pub fn get_associate_public_ip_address(&self) -> &::std::option::Option<bool> {
162 &self.associate_public_ip_address
163 }
164 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
165 self._request_id = Some(request_id.into());
166 self
167 }
168
169 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
170 self._request_id = request_id;
171 self
172 }
173 pub fn build(self) -> crate::operation::describe_network_interface_attribute::DescribeNetworkInterfaceAttributeOutput {
175 crate::operation::describe_network_interface_attribute::DescribeNetworkInterfaceAttributeOutput {
176 attachment: self.attachment,
177 description: self.description,
178 groups: self.groups,
179 network_interface_id: self.network_interface_id,
180 source_dest_check: self.source_dest_check,
181 associate_public_ip_address: self.associate_public_ip_address,
182 _request_id: self._request_id,
183 }
184 }
185}