aws_sdk_ec2/operation/describe_network_interface_attribute/
_describe_network_interface_attribute_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the output of DescribeNetworkInterfaceAttribute.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeNetworkInterfaceAttributeOutput {
7    /// <p>The attachment (if any) of the network interface.</p>
8    pub attachment: ::std::option::Option<crate::types::NetworkInterfaceAttachment>,
9    /// <p>The description of the network interface.</p>
10    pub description: ::std::option::Option<crate::types::AttributeValue>,
11    /// <p>The security groups associated with the network interface.</p>
12    pub groups: ::std::option::Option<::std::vec::Vec<crate::types::GroupIdentifier>>,
13    /// <p>The ID of the network interface.</p>
14    pub network_interface_id: ::std::option::Option<::std::string::String>,
15    /// <p>Indicates whether source/destination checking is enabled.</p>
16    pub source_dest_check: ::std::option::Option<crate::types::AttributeBooleanValue>,
17    /// <p>Indicates whether to assign a public IPv4 address to a network interface. This option can be enabled for any network interface but will only apply to the primary network interface (eth0).</p>
18    pub associate_public_ip_address: ::std::option::Option<bool>,
19    _request_id: Option<String>,
20}
21impl DescribeNetworkInterfaceAttributeOutput {
22    /// <p>The attachment (if any) of the network interface.</p>
23    pub fn attachment(&self) -> ::std::option::Option<&crate::types::NetworkInterfaceAttachment> {
24        self.attachment.as_ref()
25    }
26    /// <p>The description of the network interface.</p>
27    pub fn description(&self) -> ::std::option::Option<&crate::types::AttributeValue> {
28        self.description.as_ref()
29    }
30    /// <p>The security groups associated with the network interface.</p>
31    ///
32    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.groups.is_none()`.
33    pub fn groups(&self) -> &[crate::types::GroupIdentifier] {
34        self.groups.as_deref().unwrap_or_default()
35    }
36    /// <p>The ID of the network interface.</p>
37    pub fn network_interface_id(&self) -> ::std::option::Option<&str> {
38        self.network_interface_id.as_deref()
39    }
40    /// <p>Indicates whether source/destination checking is enabled.</p>
41    pub fn source_dest_check(&self) -> ::std::option::Option<&crate::types::AttributeBooleanValue> {
42        self.source_dest_check.as_ref()
43    }
44    /// <p>Indicates whether to assign a public IPv4 address to a network interface. This option can be enabled for any network interface but will only apply to the primary network interface (eth0).</p>
45    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    /// Creates a new builder-style object to manufacture [`DescribeNetworkInterfaceAttributeOutput`](crate::operation::describe_network_interface_attribute::DescribeNetworkInterfaceAttributeOutput).
56    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/// A builder for [`DescribeNetworkInterfaceAttributeOutput`](crate::operation::describe_network_interface_attribute::DescribeNetworkInterfaceAttributeOutput).
62#[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    /// <p>The attachment (if any) of the network interface.</p>
75    pub fn attachment(mut self, input: crate::types::NetworkInterfaceAttachment) -> Self {
76        self.attachment = ::std::option::Option::Some(input);
77        self
78    }
79    /// <p>The attachment (if any) of the network interface.</p>
80    pub fn set_attachment(mut self, input: ::std::option::Option<crate::types::NetworkInterfaceAttachment>) -> Self {
81        self.attachment = input;
82        self
83    }
84    /// <p>The attachment (if any) of the network interface.</p>
85    pub fn get_attachment(&self) -> &::std::option::Option<crate::types::NetworkInterfaceAttachment> {
86        &self.attachment
87    }
88    /// <p>The description of the network interface.</p>
89    pub fn description(mut self, input: crate::types::AttributeValue) -> Self {
90        self.description = ::std::option::Option::Some(input);
91        self
92    }
93    /// <p>The description of the network interface.</p>
94    pub fn set_description(mut self, input: ::std::option::Option<crate::types::AttributeValue>) -> Self {
95        self.description = input;
96        self
97    }
98    /// <p>The description of the network interface.</p>
99    pub fn get_description(&self) -> &::std::option::Option<crate::types::AttributeValue> {
100        &self.description
101    }
102    /// Appends an item to `groups`.
103    ///
104    /// To override the contents of this collection use [`set_groups`](Self::set_groups).
105    ///
106    /// <p>The security groups associated with the network interface.</p>
107    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    /// <p>The security groups associated with the network interface.</p>
114    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    /// <p>The security groups associated with the network interface.</p>
119    pub fn get_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GroupIdentifier>> {
120        &self.groups
121    }
122    /// <p>The ID of the network interface.</p>
123    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    /// <p>The ID of the network interface.</p>
128    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    /// <p>The ID of the network interface.</p>
133    pub fn get_network_interface_id(&self) -> &::std::option::Option<::std::string::String> {
134        &self.network_interface_id
135    }
136    /// <p>Indicates whether source/destination checking is enabled.</p>
137    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    /// <p>Indicates whether source/destination checking is enabled.</p>
142    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    /// <p>Indicates whether source/destination checking is enabled.</p>
147    pub fn get_source_dest_check(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
148        &self.source_dest_check
149    }
150    /// <p>Indicates whether to assign a public IPv4 address to a network interface. This option can be enabled for any network interface but will only apply to the primary network interface (eth0).</p>
151    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    /// <p>Indicates whether to assign a public IPv4 address to a network interface. This option can be enabled for any network interface but will only apply to the primary network interface (eth0).</p>
156    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    /// <p>Indicates whether to assign a public IPv4 address to a network interface. This option can be enabled for any network interface but will only apply to the primary network interface (eth0).</p>
161    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    /// Consumes the builder and constructs a [`DescribeNetworkInterfaceAttributeOutput`](crate::operation::describe_network_interface_attribute::DescribeNetworkInterfaceAttributeOutput).
174    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}