aws_sdk_ec2/operation/allocate_address/
_allocate_address_output.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 AllocateAddressOutput {
6    /// <p>The ID that represents the allocation of the Elastic IP address.</p>
7    pub allocation_id: ::std::option::Option<::std::string::String>,
8    /// <p>The ID of an address pool that you own.</p>
9    pub public_ipv4_pool: ::std::option::Option<::std::string::String>,
10    /// <p>The set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses.</p>
11    pub network_border_group: ::std::option::Option<::std::string::String>,
12    /// <p>The network (<code>vpc</code>).</p>
13    pub domain: ::std::option::Option<crate::types::DomainType>,
14    /// <p>The customer-owned IP address.</p>
15    pub customer_owned_ip: ::std::option::Option<::std::string::String>,
16    /// <p>The ID of the customer-owned address pool.</p>
17    pub customer_owned_ipv4_pool: ::std::option::Option<::std::string::String>,
18    /// <p>The carrier IP address. Available only for network interfaces that reside in a subnet in a Wavelength Zone.</p>
19    pub carrier_ip: ::std::option::Option<::std::string::String>,
20    /// <p>The Amazon-owned IP address. Not available when using an address pool that you own.</p>
21    pub public_ip: ::std::option::Option<::std::string::String>,
22    _request_id: Option<String>,
23}
24impl AllocateAddressOutput {
25    /// <p>The ID that represents the allocation of the Elastic IP address.</p>
26    pub fn allocation_id(&self) -> ::std::option::Option<&str> {
27        self.allocation_id.as_deref()
28    }
29    /// <p>The ID of an address pool that you own.</p>
30    pub fn public_ipv4_pool(&self) -> ::std::option::Option<&str> {
31        self.public_ipv4_pool.as_deref()
32    }
33    /// <p>The set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses.</p>
34    pub fn network_border_group(&self) -> ::std::option::Option<&str> {
35        self.network_border_group.as_deref()
36    }
37    /// <p>The network (<code>vpc</code>).</p>
38    pub fn domain(&self) -> ::std::option::Option<&crate::types::DomainType> {
39        self.domain.as_ref()
40    }
41    /// <p>The customer-owned IP address.</p>
42    pub fn customer_owned_ip(&self) -> ::std::option::Option<&str> {
43        self.customer_owned_ip.as_deref()
44    }
45    /// <p>The ID of the customer-owned address pool.</p>
46    pub fn customer_owned_ipv4_pool(&self) -> ::std::option::Option<&str> {
47        self.customer_owned_ipv4_pool.as_deref()
48    }
49    /// <p>The carrier IP address. Available only for network interfaces that reside in a subnet in a Wavelength Zone.</p>
50    pub fn carrier_ip(&self) -> ::std::option::Option<&str> {
51        self.carrier_ip.as_deref()
52    }
53    /// <p>The Amazon-owned IP address. Not available when using an address pool that you own.</p>
54    pub fn public_ip(&self) -> ::std::option::Option<&str> {
55        self.public_ip.as_deref()
56    }
57}
58impl ::aws_types::request_id::RequestId for AllocateAddressOutput {
59    fn request_id(&self) -> Option<&str> {
60        self._request_id.as_deref()
61    }
62}
63impl AllocateAddressOutput {
64    /// Creates a new builder-style object to manufacture [`AllocateAddressOutput`](crate::operation::allocate_address::AllocateAddressOutput).
65    pub fn builder() -> crate::operation::allocate_address::builders::AllocateAddressOutputBuilder {
66        crate::operation::allocate_address::builders::AllocateAddressOutputBuilder::default()
67    }
68}
69
70/// A builder for [`AllocateAddressOutput`](crate::operation::allocate_address::AllocateAddressOutput).
71#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
72#[non_exhaustive]
73pub struct AllocateAddressOutputBuilder {
74    pub(crate) allocation_id: ::std::option::Option<::std::string::String>,
75    pub(crate) public_ipv4_pool: ::std::option::Option<::std::string::String>,
76    pub(crate) network_border_group: ::std::option::Option<::std::string::String>,
77    pub(crate) domain: ::std::option::Option<crate::types::DomainType>,
78    pub(crate) customer_owned_ip: ::std::option::Option<::std::string::String>,
79    pub(crate) customer_owned_ipv4_pool: ::std::option::Option<::std::string::String>,
80    pub(crate) carrier_ip: ::std::option::Option<::std::string::String>,
81    pub(crate) public_ip: ::std::option::Option<::std::string::String>,
82    _request_id: Option<String>,
83}
84impl AllocateAddressOutputBuilder {
85    /// <p>The ID that represents the allocation of the Elastic IP address.</p>
86    pub fn allocation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.allocation_id = ::std::option::Option::Some(input.into());
88        self
89    }
90    /// <p>The ID that represents the allocation of the Elastic IP address.</p>
91    pub fn set_allocation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92        self.allocation_id = input;
93        self
94    }
95    /// <p>The ID that represents the allocation of the Elastic IP address.</p>
96    pub fn get_allocation_id(&self) -> &::std::option::Option<::std::string::String> {
97        &self.allocation_id
98    }
99    /// <p>The ID of an address pool that you own.</p>
100    pub fn public_ipv4_pool(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101        self.public_ipv4_pool = ::std::option::Option::Some(input.into());
102        self
103    }
104    /// <p>The ID of an address pool that you own.</p>
105    pub fn set_public_ipv4_pool(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106        self.public_ipv4_pool = input;
107        self
108    }
109    /// <p>The ID of an address pool that you own.</p>
110    pub fn get_public_ipv4_pool(&self) -> &::std::option::Option<::std::string::String> {
111        &self.public_ipv4_pool
112    }
113    /// <p>The set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses.</p>
114    pub fn network_border_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.network_border_group = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// <p>The set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses.</p>
119    pub fn set_network_border_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.network_border_group = input;
121        self
122    }
123    /// <p>The set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses.</p>
124    pub fn get_network_border_group(&self) -> &::std::option::Option<::std::string::String> {
125        &self.network_border_group
126    }
127    /// <p>The network (<code>vpc</code>).</p>
128    pub fn domain(mut self, input: crate::types::DomainType) -> Self {
129        self.domain = ::std::option::Option::Some(input);
130        self
131    }
132    /// <p>The network (<code>vpc</code>).</p>
133    pub fn set_domain(mut self, input: ::std::option::Option<crate::types::DomainType>) -> Self {
134        self.domain = input;
135        self
136    }
137    /// <p>The network (<code>vpc</code>).</p>
138    pub fn get_domain(&self) -> &::std::option::Option<crate::types::DomainType> {
139        &self.domain
140    }
141    /// <p>The customer-owned IP address.</p>
142    pub fn customer_owned_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.customer_owned_ip = ::std::option::Option::Some(input.into());
144        self
145    }
146    /// <p>The customer-owned IP address.</p>
147    pub fn set_customer_owned_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.customer_owned_ip = input;
149        self
150    }
151    /// <p>The customer-owned IP address.</p>
152    pub fn get_customer_owned_ip(&self) -> &::std::option::Option<::std::string::String> {
153        &self.customer_owned_ip
154    }
155    /// <p>The ID of the customer-owned address pool.</p>
156    pub fn customer_owned_ipv4_pool(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.customer_owned_ipv4_pool = ::std::option::Option::Some(input.into());
158        self
159    }
160    /// <p>The ID of the customer-owned address pool.</p>
161    pub fn set_customer_owned_ipv4_pool(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.customer_owned_ipv4_pool = input;
163        self
164    }
165    /// <p>The ID of the customer-owned address pool.</p>
166    pub fn get_customer_owned_ipv4_pool(&self) -> &::std::option::Option<::std::string::String> {
167        &self.customer_owned_ipv4_pool
168    }
169    /// <p>The carrier IP address. Available only for network interfaces that reside in a subnet in a Wavelength Zone.</p>
170    pub fn carrier_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.carrier_ip = ::std::option::Option::Some(input.into());
172        self
173    }
174    /// <p>The carrier IP address. Available only for network interfaces that reside in a subnet in a Wavelength Zone.</p>
175    pub fn set_carrier_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.carrier_ip = input;
177        self
178    }
179    /// <p>The carrier IP address. Available only for network interfaces that reside in a subnet in a Wavelength Zone.</p>
180    pub fn get_carrier_ip(&self) -> &::std::option::Option<::std::string::String> {
181        &self.carrier_ip
182    }
183    /// <p>The Amazon-owned IP address. Not available when using an address pool that you own.</p>
184    pub fn public_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.public_ip = ::std::option::Option::Some(input.into());
186        self
187    }
188    /// <p>The Amazon-owned IP address. Not available when using an address pool that you own.</p>
189    pub fn set_public_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.public_ip = input;
191        self
192    }
193    /// <p>The Amazon-owned IP address. Not available when using an address pool that you own.</p>
194    pub fn get_public_ip(&self) -> &::std::option::Option<::std::string::String> {
195        &self.public_ip
196    }
197    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
198        self._request_id = Some(request_id.into());
199        self
200    }
201
202    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
203        self._request_id = request_id;
204        self
205    }
206    /// Consumes the builder and constructs a [`AllocateAddressOutput`](crate::operation::allocate_address::AllocateAddressOutput).
207    pub fn build(self) -> crate::operation::allocate_address::AllocateAddressOutput {
208        crate::operation::allocate_address::AllocateAddressOutput {
209            allocation_id: self.allocation_id,
210            public_ipv4_pool: self.public_ipv4_pool,
211            network_border_group: self.network_border_group,
212            domain: self.domain,
213            customer_owned_ip: self.customer_owned_ip,
214            customer_owned_ipv4_pool: self.customer_owned_ipv4_pool,
215            carrier_ip: self.carrier_ip,
216            public_ip: self.public_ip,
217            _request_id: self._request_id,
218        }
219    }
220}