aws_sdk_ec2/operation/allocate_address/
_allocate_address_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct AllocateAddressInput {
6    /// <p>The network (<code>vpc</code>).</p>
7    pub domain: ::std::option::Option<crate::types::DomainType>,
8    /// <p>The Elastic IP address to recover or an IPv4 address from an address pool.</p>
9    pub address: ::std::option::Option<::std::string::String>,
10    /// <p>The ID of an address pool that you own. Use this parameter to let Amazon EC2 select an address from the address pool. To specify a specific address from the address pool, use the <code>Address</code> parameter instead.</p>
11    pub public_ipv4_pool: ::std::option::Option<::std::string::String>,
12    /// <p>A unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses. Use this parameter to limit the IP address to this location. IP addresses cannot move between network border groups.</p>
13    pub network_border_group: ::std::option::Option<::std::string::String>,
14    /// <p>The ID of a customer-owned address pool. Use this parameter to let Amazon EC2 select an address from the address pool. Alternatively, specify a specific address from the address pool.</p>
15    pub customer_owned_ipv4_pool: ::std::option::Option<::std::string::String>,
16    /// <p>The tags to assign to the Elastic IP address.</p>
17    pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
18    /// <p>The ID of an IPAM pool which has an Amazon-provided or BYOIP public IPv4 CIDR provisioned to it. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-eip-pool.html">Allocate sequential Elastic IP addresses from an IPAM pool</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
19    pub ipam_pool_id: ::std::option::Option<::std::string::String>,
20    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
21    pub dry_run: ::std::option::Option<bool>,
22}
23impl AllocateAddressInput {
24    /// <p>The network (<code>vpc</code>).</p>
25    pub fn domain(&self) -> ::std::option::Option<&crate::types::DomainType> {
26        self.domain.as_ref()
27    }
28    /// <p>The Elastic IP address to recover or an IPv4 address from an address pool.</p>
29    pub fn address(&self) -> ::std::option::Option<&str> {
30        self.address.as_deref()
31    }
32    /// <p>The ID of an address pool that you own. Use this parameter to let Amazon EC2 select an address from the address pool. To specify a specific address from the address pool, use the <code>Address</code> parameter instead.</p>
33    pub fn public_ipv4_pool(&self) -> ::std::option::Option<&str> {
34        self.public_ipv4_pool.as_deref()
35    }
36    /// <p>A unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses. Use this parameter to limit the IP address to this location. IP addresses cannot move between network border groups.</p>
37    pub fn network_border_group(&self) -> ::std::option::Option<&str> {
38        self.network_border_group.as_deref()
39    }
40    /// <p>The ID of a customer-owned address pool. Use this parameter to let Amazon EC2 select an address from the address pool. Alternatively, specify a specific address from the address pool.</p>
41    pub fn customer_owned_ipv4_pool(&self) -> ::std::option::Option<&str> {
42        self.customer_owned_ipv4_pool.as_deref()
43    }
44    /// <p>The tags to assign to the Elastic IP address.</p>
45    ///
46    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_specifications.is_none()`.
47    pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
48        self.tag_specifications.as_deref().unwrap_or_default()
49    }
50    /// <p>The ID of an IPAM pool which has an Amazon-provided or BYOIP public IPv4 CIDR provisioned to it. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-eip-pool.html">Allocate sequential Elastic IP addresses from an IPAM pool</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
51    pub fn ipam_pool_id(&self) -> ::std::option::Option<&str> {
52        self.ipam_pool_id.as_deref()
53    }
54    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
55    pub fn dry_run(&self) -> ::std::option::Option<bool> {
56        self.dry_run
57    }
58}
59impl AllocateAddressInput {
60    /// Creates a new builder-style object to manufacture [`AllocateAddressInput`](crate::operation::allocate_address::AllocateAddressInput).
61    pub fn builder() -> crate::operation::allocate_address::builders::AllocateAddressInputBuilder {
62        crate::operation::allocate_address::builders::AllocateAddressInputBuilder::default()
63    }
64}
65
66/// A builder for [`AllocateAddressInput`](crate::operation::allocate_address::AllocateAddressInput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct AllocateAddressInputBuilder {
70    pub(crate) domain: ::std::option::Option<crate::types::DomainType>,
71    pub(crate) address: ::std::option::Option<::std::string::String>,
72    pub(crate) public_ipv4_pool: ::std::option::Option<::std::string::String>,
73    pub(crate) network_border_group: ::std::option::Option<::std::string::String>,
74    pub(crate) customer_owned_ipv4_pool: ::std::option::Option<::std::string::String>,
75    pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
76    pub(crate) ipam_pool_id: ::std::option::Option<::std::string::String>,
77    pub(crate) dry_run: ::std::option::Option<bool>,
78}
79impl AllocateAddressInputBuilder {
80    /// <p>The network (<code>vpc</code>).</p>
81    pub fn domain(mut self, input: crate::types::DomainType) -> Self {
82        self.domain = ::std::option::Option::Some(input);
83        self
84    }
85    /// <p>The network (<code>vpc</code>).</p>
86    pub fn set_domain(mut self, input: ::std::option::Option<crate::types::DomainType>) -> Self {
87        self.domain = input;
88        self
89    }
90    /// <p>The network (<code>vpc</code>).</p>
91    pub fn get_domain(&self) -> &::std::option::Option<crate::types::DomainType> {
92        &self.domain
93    }
94    /// <p>The Elastic IP address to recover or an IPv4 address from an address pool.</p>
95    pub fn address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.address = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The Elastic IP address to recover or an IPv4 address from an address pool.</p>
100    pub fn set_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.address = input;
102        self
103    }
104    /// <p>The Elastic IP address to recover or an IPv4 address from an address pool.</p>
105    pub fn get_address(&self) -> &::std::option::Option<::std::string::String> {
106        &self.address
107    }
108    /// <p>The ID of an address pool that you own. Use this parameter to let Amazon EC2 select an address from the address pool. To specify a specific address from the address pool, use the <code>Address</code> parameter instead.</p>
109    pub fn public_ipv4_pool(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.public_ipv4_pool = ::std::option::Option::Some(input.into());
111        self
112    }
113    /// <p>The ID of an address pool that you own. Use this parameter to let Amazon EC2 select an address from the address pool. To specify a specific address from the address pool, use the <code>Address</code> parameter instead.</p>
114    pub fn set_public_ipv4_pool(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.public_ipv4_pool = input;
116        self
117    }
118    /// <p>The ID of an address pool that you own. Use this parameter to let Amazon EC2 select an address from the address pool. To specify a specific address from the address pool, use the <code>Address</code> parameter instead.</p>
119    pub fn get_public_ipv4_pool(&self) -> &::std::option::Option<::std::string::String> {
120        &self.public_ipv4_pool
121    }
122    /// <p>A unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses. Use this parameter to limit the IP address to this location. IP addresses cannot move between network border groups.</p>
123    pub fn network_border_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.network_border_group = ::std::option::Option::Some(input.into());
125        self
126    }
127    /// <p>A unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses. Use this parameter to limit the IP address to this location. IP addresses cannot move between network border groups.</p>
128    pub fn set_network_border_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.network_border_group = input;
130        self
131    }
132    /// <p>A unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses. Use this parameter to limit the IP address to this location. IP addresses cannot move between network border groups.</p>
133    pub fn get_network_border_group(&self) -> &::std::option::Option<::std::string::String> {
134        &self.network_border_group
135    }
136    /// <p>The ID of a customer-owned address pool. Use this parameter to let Amazon EC2 select an address from the address pool. Alternatively, specify a specific address from the address pool.</p>
137    pub fn customer_owned_ipv4_pool(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.customer_owned_ipv4_pool = ::std::option::Option::Some(input.into());
139        self
140    }
141    /// <p>The ID of a customer-owned address pool. Use this parameter to let Amazon EC2 select an address from the address pool. Alternatively, specify a specific address from the address pool.</p>
142    pub fn set_customer_owned_ipv4_pool(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.customer_owned_ipv4_pool = input;
144        self
145    }
146    /// <p>The ID of a customer-owned address pool. Use this parameter to let Amazon EC2 select an address from the address pool. Alternatively, specify a specific address from the address pool.</p>
147    pub fn get_customer_owned_ipv4_pool(&self) -> &::std::option::Option<::std::string::String> {
148        &self.customer_owned_ipv4_pool
149    }
150    /// Appends an item to `tag_specifications`.
151    ///
152    /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
153    ///
154    /// <p>The tags to assign to the Elastic IP address.</p>
155    pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
156        let mut v = self.tag_specifications.unwrap_or_default();
157        v.push(input);
158        self.tag_specifications = ::std::option::Option::Some(v);
159        self
160    }
161    /// <p>The tags to assign to the Elastic IP address.</p>
162    pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
163        self.tag_specifications = input;
164        self
165    }
166    /// <p>The tags to assign to the Elastic IP address.</p>
167    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
168        &self.tag_specifications
169    }
170    /// <p>The ID of an IPAM pool which has an Amazon-provided or BYOIP public IPv4 CIDR provisioned to it. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-eip-pool.html">Allocate sequential Elastic IP addresses from an IPAM pool</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
171    pub fn ipam_pool_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.ipam_pool_id = ::std::option::Option::Some(input.into());
173        self
174    }
175    /// <p>The ID of an IPAM pool which has an Amazon-provided or BYOIP public IPv4 CIDR provisioned to it. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-eip-pool.html">Allocate sequential Elastic IP addresses from an IPAM pool</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
176    pub fn set_ipam_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.ipam_pool_id = input;
178        self
179    }
180    /// <p>The ID of an IPAM pool which has an Amazon-provided or BYOIP public IPv4 CIDR provisioned to it. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-eip-pool.html">Allocate sequential Elastic IP addresses from an IPAM pool</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
181    pub fn get_ipam_pool_id(&self) -> &::std::option::Option<::std::string::String> {
182        &self.ipam_pool_id
183    }
184    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
185    pub fn dry_run(mut self, input: bool) -> Self {
186        self.dry_run = ::std::option::Option::Some(input);
187        self
188    }
189    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
190    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
191        self.dry_run = input;
192        self
193    }
194    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
195    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
196        &self.dry_run
197    }
198    /// Consumes the builder and constructs a [`AllocateAddressInput`](crate::operation::allocate_address::AllocateAddressInput).
199    pub fn build(
200        self,
201    ) -> ::std::result::Result<crate::operation::allocate_address::AllocateAddressInput, ::aws_smithy_types::error::operation::BuildError> {
202        ::std::result::Result::Ok(crate::operation::allocate_address::AllocateAddressInput {
203            domain: self.domain,
204            address: self.address,
205            public_ipv4_pool: self.public_ipv4_pool,
206            network_border_group: self.network_border_group,
207            customer_owned_ipv4_pool: self.customer_owned_ipv4_pool,
208            tag_specifications: self.tag_specifications,
209            ipam_pool_id: self.ipam_pool_id,
210            dry_run: self.dry_run,
211        })
212    }
213}