1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AssociateAddressInput {
/// <p>The allocation ID. This is required.</p>
pub allocation_id: ::std::option::Option<::std::string::String>,
/// <p>The ID of the instance. The instance must have exactly one attached network interface. You can specify either the instance ID or the network interface ID, but not both.</p>
pub instance_id: ::std::option::Option<::std::string::String>,
/// <p>Deprecated.</p>
pub public_ip: ::std::option::Option<::std::string::String>,
/// <p>Reassociation is automatic, but you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.</p>
pub allow_reassociation: ::std::option::Option<bool>,
/// <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>
pub dry_run: ::std::option::Option<bool>,
/// <p>The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.</p>
/// <p>You can specify either the instance ID or the network interface ID, but not both.</p>
pub network_interface_id: ::std::option::Option<::std::string::String>,
/// <p>The primary or secondary private IP address to associate with the Elastic IP address. If no private IP address is specified, the Elastic IP address is associated with the primary private IP address.</p>
pub private_ip_address: ::std::option::Option<::std::string::String>,
}
impl AssociateAddressInput {
/// <p>The allocation ID. This is required.</p>
pub fn allocation_id(&self) -> ::std::option::Option<&str> {
self.allocation_id.as_deref()
}
/// <p>The ID of the instance. The instance must have exactly one attached network interface. You can specify either the instance ID or the network interface ID, but not both.</p>
pub fn instance_id(&self) -> ::std::option::Option<&str> {
self.instance_id.as_deref()
}
/// <p>Deprecated.</p>
pub fn public_ip(&self) -> ::std::option::Option<&str> {
self.public_ip.as_deref()
}
/// <p>Reassociation is automatic, but you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.</p>
pub fn allow_reassociation(&self) -> ::std::option::Option<bool> {
self.allow_reassociation
}
/// <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>
pub fn dry_run(&self) -> ::std::option::Option<bool> {
self.dry_run
}
/// <p>The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.</p>
/// <p>You can specify either the instance ID or the network interface ID, but not both.</p>
pub fn network_interface_id(&self) -> ::std::option::Option<&str> {
self.network_interface_id.as_deref()
}
/// <p>The primary or secondary private IP address to associate with the Elastic IP address. If no private IP address is specified, the Elastic IP address is associated with the primary private IP address.</p>
pub fn private_ip_address(&self) -> ::std::option::Option<&str> {
self.private_ip_address.as_deref()
}
}
impl AssociateAddressInput {
/// Creates a new builder-style object to manufacture [`AssociateAddressInput`](crate::operation::associate_address::AssociateAddressInput).
pub fn builder() -> crate::operation::associate_address::builders::AssociateAddressInputBuilder {
crate::operation::associate_address::builders::AssociateAddressInputBuilder::default()
}
}
/// A builder for [`AssociateAddressInput`](crate::operation::associate_address::AssociateAddressInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct AssociateAddressInputBuilder {
pub(crate) allocation_id: ::std::option::Option<::std::string::String>,
pub(crate) instance_id: ::std::option::Option<::std::string::String>,
pub(crate) public_ip: ::std::option::Option<::std::string::String>,
pub(crate) allow_reassociation: ::std::option::Option<bool>,
pub(crate) dry_run: ::std::option::Option<bool>,
pub(crate) network_interface_id: ::std::option::Option<::std::string::String>,
pub(crate) private_ip_address: ::std::option::Option<::std::string::String>,
}
impl AssociateAddressInputBuilder {
/// <p>The allocation ID. This is required.</p>
pub fn allocation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.allocation_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The allocation ID. This is required.</p>
pub fn set_allocation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.allocation_id = input;
self
}
/// <p>The allocation ID. This is required.</p>
pub fn get_allocation_id(&self) -> &::std::option::Option<::std::string::String> {
&self.allocation_id
}
/// <p>The ID of the instance. The instance must have exactly one attached network interface. You can specify either the instance ID or the network interface ID, but not both.</p>
pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.instance_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the instance. The instance must have exactly one attached network interface. You can specify either the instance ID or the network interface ID, but not both.</p>
pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.instance_id = input;
self
}
/// <p>The ID of the instance. The instance must have exactly one attached network interface. You can specify either the instance ID or the network interface ID, but not both.</p>
pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
&self.instance_id
}
/// <p>Deprecated.</p>
pub fn public_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.public_ip = ::std::option::Option::Some(input.into());
self
}
/// <p>Deprecated.</p>
pub fn set_public_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.public_ip = input;
self
}
/// <p>Deprecated.</p>
pub fn get_public_ip(&self) -> &::std::option::Option<::std::string::String> {
&self.public_ip
}
/// <p>Reassociation is automatic, but you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.</p>
pub fn allow_reassociation(mut self, input: bool) -> Self {
self.allow_reassociation = ::std::option::Option::Some(input);
self
}
/// <p>Reassociation is automatic, but you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.</p>
pub fn set_allow_reassociation(mut self, input: ::std::option::Option<bool>) -> Self {
self.allow_reassociation = input;
self
}
/// <p>Reassociation is automatic, but you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.</p>
pub fn get_allow_reassociation(&self) -> &::std::option::Option<bool> {
&self.allow_reassociation
}
/// <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>
pub fn dry_run(mut self, input: bool) -> Self {
self.dry_run = ::std::option::Option::Some(input);
self
}
/// <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>
pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
self.dry_run = input;
self
}
/// <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>
pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
&self.dry_run
}
/// <p>The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.</p>
/// <p>You can specify either the instance ID or the network interface ID, but not both.</p>
pub fn network_interface_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.network_interface_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.</p>
/// <p>You can specify either the instance ID or the network interface ID, but not both.</p>
pub fn set_network_interface_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.network_interface_id = input;
self
}
/// <p>The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.</p>
/// <p>You can specify either the instance ID or the network interface ID, but not both.</p>
pub fn get_network_interface_id(&self) -> &::std::option::Option<::std::string::String> {
&self.network_interface_id
}
/// <p>The primary or secondary private IP address to associate with the Elastic IP address. If no private IP address is specified, the Elastic IP address is associated with the primary private IP address.</p>
pub fn private_ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.private_ip_address = ::std::option::Option::Some(input.into());
self
}
/// <p>The primary or secondary private IP address to associate with the Elastic IP address. If no private IP address is specified, the Elastic IP address is associated with the primary private IP address.</p>
pub fn set_private_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.private_ip_address = input;
self
}
/// <p>The primary or secondary private IP address to associate with the Elastic IP address. If no private IP address is specified, the Elastic IP address is associated with the primary private IP address.</p>
pub fn get_private_ip_address(&self) -> &::std::option::Option<::std::string::String> {
&self.private_ip_address
}
/// Consumes the builder and constructs a [`AssociateAddressInput`](crate::operation::associate_address::AssociateAddressInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::associate_address::AssociateAddressInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::associate_address::AssociateAddressInput {
allocation_id: self.allocation_id,
instance_id: self.instance_id,
public_ip: self.public_ip,
allow_reassociation: self.allow_reassociation,
dry_run: self.dry_run,
network_interface_id: self.network_interface_id,
private_ip_address: self.private_ip_address,
})
}
}