Skip to main content

aws_sdk_ec2/types/
_scheduled_instances_network_interface.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes a network interface for a Scheduled Instance.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ScheduledInstancesNetworkInterface {
7    /// <p>Indicates whether to assign a public IPv4 address to instances launched in a VPC. The public IPv4 address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is <code>true</code>.</p>
8    /// <p>Amazon Web Services charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the <i>Public IPv4 Address</i> tab on the <a href="http://aws.amazon.com/vpc/pricing/">Amazon VPC pricing page</a>.</p>
9    pub associate_public_ip_address: ::std::option::Option<bool>,
10    /// <p>Indicates whether to delete the interface when the instance is terminated.</p>
11    pub delete_on_termination: ::std::option::Option<bool>,
12    /// <p>The description.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>The index of the device for the network interface attachment.</p>
15    pub device_index: ::std::option::Option<i32>,
16    /// <p>The IDs of the security groups.</p>
17    pub groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
18    /// <p>The number of IPv6 addresses to assign to the network interface. The IPv6 addresses are automatically selected from the subnet range.</p>
19    pub ipv6_address_count: ::std::option::Option<i32>,
20    /// <p>The specific IPv6 addresses from the subnet range.</p>
21    pub ipv6_addresses: ::std::option::Option<::std::vec::Vec<crate::types::ScheduledInstancesIpv6Address>>,
22    /// <p>The ID of the network interface.</p>
23    pub network_interface_id: ::std::option::Option<::std::string::String>,
24    /// <p>The IPv4 address of the network interface within the subnet.</p>
25    pub private_ip_address: ::std::option::Option<::std::string::String>,
26    /// <p>The private IPv4 addresses.</p>
27    pub private_ip_address_configs: ::std::option::Option<::std::vec::Vec<crate::types::ScheduledInstancesPrivateIpAddressConfig>>,
28    /// <p>The number of secondary private IPv4 addresses.</p>
29    pub secondary_private_ip_address_count: ::std::option::Option<i32>,
30    /// <p>The ID of the subnet.</p>
31    pub subnet_id: ::std::option::Option<::std::string::String>,
32}
33impl ScheduledInstancesNetworkInterface {
34    /// <p>Indicates whether to assign a public IPv4 address to instances launched in a VPC. The public IPv4 address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is <code>true</code>.</p>
35    /// <p>Amazon Web Services charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the <i>Public IPv4 Address</i> tab on the <a href="http://aws.amazon.com/vpc/pricing/">Amazon VPC pricing page</a>.</p>
36    pub fn associate_public_ip_address(&self) -> ::std::option::Option<bool> {
37        self.associate_public_ip_address
38    }
39    /// <p>Indicates whether to delete the interface when the instance is terminated.</p>
40    pub fn delete_on_termination(&self) -> ::std::option::Option<bool> {
41        self.delete_on_termination
42    }
43    /// <p>The description.</p>
44    pub fn description(&self) -> ::std::option::Option<&str> {
45        self.description.as_deref()
46    }
47    /// <p>The index of the device for the network interface attachment.</p>
48    pub fn device_index(&self) -> ::std::option::Option<i32> {
49        self.device_index
50    }
51    /// <p>The IDs of the security groups.</p>
52    ///
53    /// 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()`.
54    pub fn groups(&self) -> &[::std::string::String] {
55        self.groups.as_deref().unwrap_or_default()
56    }
57    /// <p>The number of IPv6 addresses to assign to the network interface. The IPv6 addresses are automatically selected from the subnet range.</p>
58    pub fn ipv6_address_count(&self) -> ::std::option::Option<i32> {
59        self.ipv6_address_count
60    }
61    /// <p>The specific IPv6 addresses from the subnet range.</p>
62    ///
63    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.ipv6_addresses.is_none()`.
64    pub fn ipv6_addresses(&self) -> &[crate::types::ScheduledInstancesIpv6Address] {
65        self.ipv6_addresses.as_deref().unwrap_or_default()
66    }
67    /// <p>The ID of the network interface.</p>
68    pub fn network_interface_id(&self) -> ::std::option::Option<&str> {
69        self.network_interface_id.as_deref()
70    }
71    /// <p>The IPv4 address of the network interface within the subnet.</p>
72    pub fn private_ip_address(&self) -> ::std::option::Option<&str> {
73        self.private_ip_address.as_deref()
74    }
75    /// <p>The private IPv4 addresses.</p>
76    ///
77    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.private_ip_address_configs.is_none()`.
78    pub fn private_ip_address_configs(&self) -> &[crate::types::ScheduledInstancesPrivateIpAddressConfig] {
79        self.private_ip_address_configs.as_deref().unwrap_or_default()
80    }
81    /// <p>The number of secondary private IPv4 addresses.</p>
82    pub fn secondary_private_ip_address_count(&self) -> ::std::option::Option<i32> {
83        self.secondary_private_ip_address_count
84    }
85    /// <p>The ID of the subnet.</p>
86    pub fn subnet_id(&self) -> ::std::option::Option<&str> {
87        self.subnet_id.as_deref()
88    }
89}
90impl ScheduledInstancesNetworkInterface {
91    /// Creates a new builder-style object to manufacture [`ScheduledInstancesNetworkInterface`](crate::types::ScheduledInstancesNetworkInterface).
92    pub fn builder() -> crate::types::builders::ScheduledInstancesNetworkInterfaceBuilder {
93        crate::types::builders::ScheduledInstancesNetworkInterfaceBuilder::default()
94    }
95}
96
97/// A builder for [`ScheduledInstancesNetworkInterface`](crate::types::ScheduledInstancesNetworkInterface).
98#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
99#[non_exhaustive]
100pub struct ScheduledInstancesNetworkInterfaceBuilder {
101    pub(crate) associate_public_ip_address: ::std::option::Option<bool>,
102    pub(crate) delete_on_termination: ::std::option::Option<bool>,
103    pub(crate) description: ::std::option::Option<::std::string::String>,
104    pub(crate) device_index: ::std::option::Option<i32>,
105    pub(crate) groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
106    pub(crate) ipv6_address_count: ::std::option::Option<i32>,
107    pub(crate) ipv6_addresses: ::std::option::Option<::std::vec::Vec<crate::types::ScheduledInstancesIpv6Address>>,
108    pub(crate) network_interface_id: ::std::option::Option<::std::string::String>,
109    pub(crate) private_ip_address: ::std::option::Option<::std::string::String>,
110    pub(crate) private_ip_address_configs: ::std::option::Option<::std::vec::Vec<crate::types::ScheduledInstancesPrivateIpAddressConfig>>,
111    pub(crate) secondary_private_ip_address_count: ::std::option::Option<i32>,
112    pub(crate) subnet_id: ::std::option::Option<::std::string::String>,
113}
114impl ScheduledInstancesNetworkInterfaceBuilder {
115    /// <p>Indicates whether to assign a public IPv4 address to instances launched in a VPC. The public IPv4 address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is <code>true</code>.</p>
116    /// <p>Amazon Web Services charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the <i>Public IPv4 Address</i> tab on the <a href="http://aws.amazon.com/vpc/pricing/">Amazon VPC pricing page</a>.</p>
117    pub fn associate_public_ip_address(mut self, input: bool) -> Self {
118        self.associate_public_ip_address = ::std::option::Option::Some(input);
119        self
120    }
121    /// <p>Indicates whether to assign a public IPv4 address to instances launched in a VPC. The public IPv4 address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is <code>true</code>.</p>
122    /// <p>Amazon Web Services charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the <i>Public IPv4 Address</i> tab on the <a href="http://aws.amazon.com/vpc/pricing/">Amazon VPC pricing page</a>.</p>
123    pub fn set_associate_public_ip_address(mut self, input: ::std::option::Option<bool>) -> Self {
124        self.associate_public_ip_address = input;
125        self
126    }
127    /// <p>Indicates whether to assign a public IPv4 address to instances launched in a VPC. The public IPv4 address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is <code>true</code>.</p>
128    /// <p>Amazon Web Services charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the <i>Public IPv4 Address</i> tab on the <a href="http://aws.amazon.com/vpc/pricing/">Amazon VPC pricing page</a>.</p>
129    pub fn get_associate_public_ip_address(&self) -> &::std::option::Option<bool> {
130        &self.associate_public_ip_address
131    }
132    /// <p>Indicates whether to delete the interface when the instance is terminated.</p>
133    pub fn delete_on_termination(mut self, input: bool) -> Self {
134        self.delete_on_termination = ::std::option::Option::Some(input);
135        self
136    }
137    /// <p>Indicates whether to delete the interface when the instance is terminated.</p>
138    pub fn set_delete_on_termination(mut self, input: ::std::option::Option<bool>) -> Self {
139        self.delete_on_termination = input;
140        self
141    }
142    /// <p>Indicates whether to delete the interface when the instance is terminated.</p>
143    pub fn get_delete_on_termination(&self) -> &::std::option::Option<bool> {
144        &self.delete_on_termination
145    }
146    /// <p>The description.</p>
147    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.description = ::std::option::Option::Some(input.into());
149        self
150    }
151    /// <p>The description.</p>
152    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.description = input;
154        self
155    }
156    /// <p>The description.</p>
157    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
158        &self.description
159    }
160    /// <p>The index of the device for the network interface attachment.</p>
161    pub fn device_index(mut self, input: i32) -> Self {
162        self.device_index = ::std::option::Option::Some(input);
163        self
164    }
165    /// <p>The index of the device for the network interface attachment.</p>
166    pub fn set_device_index(mut self, input: ::std::option::Option<i32>) -> Self {
167        self.device_index = input;
168        self
169    }
170    /// <p>The index of the device for the network interface attachment.</p>
171    pub fn get_device_index(&self) -> &::std::option::Option<i32> {
172        &self.device_index
173    }
174    /// Appends an item to `groups`.
175    ///
176    /// To override the contents of this collection use [`set_groups`](Self::set_groups).
177    ///
178    /// <p>The IDs of the security groups.</p>
179    pub fn groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180        let mut v = self.groups.unwrap_or_default();
181        v.push(input.into());
182        self.groups = ::std::option::Option::Some(v);
183        self
184    }
185    /// <p>The IDs of the security groups.</p>
186    pub fn set_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
187        self.groups = input;
188        self
189    }
190    /// <p>The IDs of the security groups.</p>
191    pub fn get_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
192        &self.groups
193    }
194    /// <p>The number of IPv6 addresses to assign to the network interface. The IPv6 addresses are automatically selected from the subnet range.</p>
195    pub fn ipv6_address_count(mut self, input: i32) -> Self {
196        self.ipv6_address_count = ::std::option::Option::Some(input);
197        self
198    }
199    /// <p>The number of IPv6 addresses to assign to the network interface. The IPv6 addresses are automatically selected from the subnet range.</p>
200    pub fn set_ipv6_address_count(mut self, input: ::std::option::Option<i32>) -> Self {
201        self.ipv6_address_count = input;
202        self
203    }
204    /// <p>The number of IPv6 addresses to assign to the network interface. The IPv6 addresses are automatically selected from the subnet range.</p>
205    pub fn get_ipv6_address_count(&self) -> &::std::option::Option<i32> {
206        &self.ipv6_address_count
207    }
208    /// Appends an item to `ipv6_addresses`.
209    ///
210    /// To override the contents of this collection use [`set_ipv6_addresses`](Self::set_ipv6_addresses).
211    ///
212    /// <p>The specific IPv6 addresses from the subnet range.</p>
213    pub fn ipv6_addresses(mut self, input: crate::types::ScheduledInstancesIpv6Address) -> Self {
214        let mut v = self.ipv6_addresses.unwrap_or_default();
215        v.push(input);
216        self.ipv6_addresses = ::std::option::Option::Some(v);
217        self
218    }
219    /// <p>The specific IPv6 addresses from the subnet range.</p>
220    pub fn set_ipv6_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ScheduledInstancesIpv6Address>>) -> Self {
221        self.ipv6_addresses = input;
222        self
223    }
224    /// <p>The specific IPv6 addresses from the subnet range.</p>
225    pub fn get_ipv6_addresses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ScheduledInstancesIpv6Address>> {
226        &self.ipv6_addresses
227    }
228    /// <p>The ID of the network interface.</p>
229    pub fn network_interface_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230        self.network_interface_id = ::std::option::Option::Some(input.into());
231        self
232    }
233    /// <p>The ID of the network interface.</p>
234    pub fn set_network_interface_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235        self.network_interface_id = input;
236        self
237    }
238    /// <p>The ID of the network interface.</p>
239    pub fn get_network_interface_id(&self) -> &::std::option::Option<::std::string::String> {
240        &self.network_interface_id
241    }
242    /// <p>The IPv4 address of the network interface within the subnet.</p>
243    pub fn private_ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
244        self.private_ip_address = ::std::option::Option::Some(input.into());
245        self
246    }
247    /// <p>The IPv4 address of the network interface within the subnet.</p>
248    pub fn set_private_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
249        self.private_ip_address = input;
250        self
251    }
252    /// <p>The IPv4 address of the network interface within the subnet.</p>
253    pub fn get_private_ip_address(&self) -> &::std::option::Option<::std::string::String> {
254        &self.private_ip_address
255    }
256    /// Appends an item to `private_ip_address_configs`.
257    ///
258    /// To override the contents of this collection use [`set_private_ip_address_configs`](Self::set_private_ip_address_configs).
259    ///
260    /// <p>The private IPv4 addresses.</p>
261    pub fn private_ip_address_configs(mut self, input: crate::types::ScheduledInstancesPrivateIpAddressConfig) -> Self {
262        let mut v = self.private_ip_address_configs.unwrap_or_default();
263        v.push(input);
264        self.private_ip_address_configs = ::std::option::Option::Some(v);
265        self
266    }
267    /// <p>The private IPv4 addresses.</p>
268    pub fn set_private_ip_address_configs(
269        mut self,
270        input: ::std::option::Option<::std::vec::Vec<crate::types::ScheduledInstancesPrivateIpAddressConfig>>,
271    ) -> Self {
272        self.private_ip_address_configs = input;
273        self
274    }
275    /// <p>The private IPv4 addresses.</p>
276    pub fn get_private_ip_address_configs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ScheduledInstancesPrivateIpAddressConfig>> {
277        &self.private_ip_address_configs
278    }
279    /// <p>The number of secondary private IPv4 addresses.</p>
280    pub fn secondary_private_ip_address_count(mut self, input: i32) -> Self {
281        self.secondary_private_ip_address_count = ::std::option::Option::Some(input);
282        self
283    }
284    /// <p>The number of secondary private IPv4 addresses.</p>
285    pub fn set_secondary_private_ip_address_count(mut self, input: ::std::option::Option<i32>) -> Self {
286        self.secondary_private_ip_address_count = input;
287        self
288    }
289    /// <p>The number of secondary private IPv4 addresses.</p>
290    pub fn get_secondary_private_ip_address_count(&self) -> &::std::option::Option<i32> {
291        &self.secondary_private_ip_address_count
292    }
293    /// <p>The ID of the subnet.</p>
294    pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
295        self.subnet_id = ::std::option::Option::Some(input.into());
296        self
297    }
298    /// <p>The ID of the subnet.</p>
299    pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
300        self.subnet_id = input;
301        self
302    }
303    /// <p>The ID of the subnet.</p>
304    pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
305        &self.subnet_id
306    }
307    /// Consumes the builder and constructs a [`ScheduledInstancesNetworkInterface`](crate::types::ScheduledInstancesNetworkInterface).
308    pub fn build(self) -> crate::types::ScheduledInstancesNetworkInterface {
309        crate::types::ScheduledInstancesNetworkInterface {
310            associate_public_ip_address: self.associate_public_ip_address,
311            delete_on_termination: self.delete_on_termination,
312            description: self.description,
313            device_index: self.device_index,
314            groups: self.groups,
315            ipv6_address_count: self.ipv6_address_count,
316            ipv6_addresses: self.ipv6_addresses,
317            network_interface_id: self.network_interface_id,
318            private_ip_address: self.private_ip_address,
319            private_ip_address_configs: self.private_ip_address_configs,
320            secondary_private_ip_address_count: self.secondary_private_ip_address_count,
321            subnet_id: self.subnet_id,
322        }
323    }
324}