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 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::modify_subnet_attribute::_modify_subnet_attribute_output::ModifySubnetAttributeOutputBuilder;
pub use crate::operation::modify_subnet_attribute::_modify_subnet_attribute_input::ModifySubnetAttributeInputBuilder;
impl ModifySubnetAttributeInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::modify_subnet_attribute::ModifySubnetAttributeOutput,
::aws_smithy_http::result::SdkError<
crate::operation::modify_subnet_attribute::ModifySubnetAttributeError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.modify_subnet_attribute();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `ModifySubnetAttribute`.
///
/// <p>Modifies a subnet attribute. You can only modify one attribute at a time.</p>
/// <p>Use this action to modify subnets on Amazon Web Services Outposts.</p>
/// <ul>
/// <li> <p>To modify a subnet on an Outpost rack, set both <code>MapCustomerOwnedIpOnLaunch</code> and <code>CustomerOwnedIpv4Pool</code>. These two parameters act as a single attribute.</p> </li>
/// <li> <p>To modify a subnet on an Outpost server, set either <code>EnableLniAtDeviceIndex</code> or <code>DisableLniAtDeviceIndex</code>.</p> </li>
/// </ul>
/// <p>For more information about Amazon Web Services Outposts, see the following:</p>
/// <ul>
/// <li> <p> <a href="https://docs.aws.amazon.com/outposts/latest/userguide/how-servers-work.html">Outpost servers</a> </p> </li>
/// <li> <p> <a href="https://docs.aws.amazon.com/outposts/latest/userguide/how-racks-work.html">Outpost racks</a> </p> </li>
/// </ul>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ModifySubnetAttributeFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::modify_subnet_attribute::builders::ModifySubnetAttributeInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl ModifySubnetAttributeFluentBuilder {
/// Creates a new `ModifySubnetAttribute`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the ModifySubnetAttribute as a reference.
pub fn as_input(&self) -> &crate::operation::modify_subnet_attribute::builders::ModifySubnetAttributeInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::modify_subnet_attribute::ModifySubnetAttributeOutput,
::aws_smithy_http::result::SdkError<
crate::operation::modify_subnet_attribute::ModifySubnetAttributeError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self.inner.build().map_err(::aws_smithy_http::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::modify_subnet_attribute::ModifySubnetAttribute::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::modify_subnet_attribute::ModifySubnetAttribute::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being
/// sent.
// TODO(enableNewSmithyRuntimeCleanup): Remove `async` and `Result` once we switch to orchestrator
pub async fn customize(
self,
) -> ::std::result::Result<
crate::client::customize::orchestrator::CustomizableOperation<
crate::operation::modify_subnet_attribute::ModifySubnetAttributeOutput,
crate::operation::modify_subnet_attribute::ModifySubnetAttributeError,
>,
::aws_smithy_http::result::SdkError<crate::operation::modify_subnet_attribute::ModifySubnetAttributeError>,
> {
::std::result::Result::Ok(crate::client::customize::orchestrator::CustomizableOperation {
customizable_send: ::std::boxed::Box::new(move |config_override| {
::std::boxed::Box::pin(async { self.config_override(config_override).send().await })
}),
config_override: None,
interceptors: vec![],
runtime_plugins: vec![],
})
}
pub(crate) fn config_override(mut self, config_override: impl Into<crate::config::Builder>) -> Self {
self.set_config_override(Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>Specify <code>true</code> to indicate that network interfaces created in the specified subnet should be assigned an IPv6 address. This includes a network interface that's created when launching an instance into the subnet (the instance therefore receives an IPv6 address). </p>
/// <p>If you enable the IPv6 addressing feature for your subnet, your network interface or instance only receives an IPv6 address if it's created using version <code>2016-11-15</code> or later of the Amazon EC2 API.</p>
pub fn assign_ipv6_address_on_creation(mut self, input: crate::types::AttributeBooleanValue) -> Self {
self.inner = self.inner.assign_ipv6_address_on_creation(input);
self
}
/// <p>Specify <code>true</code> to indicate that network interfaces created in the specified subnet should be assigned an IPv6 address. This includes a network interface that's created when launching an instance into the subnet (the instance therefore receives an IPv6 address). </p>
/// <p>If you enable the IPv6 addressing feature for your subnet, your network interface or instance only receives an IPv6 address if it's created using version <code>2016-11-15</code> or later of the Amazon EC2 API.</p>
pub fn set_assign_ipv6_address_on_creation(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
self.inner = self.inner.set_assign_ipv6_address_on_creation(input);
self
}
/// <p>Specify <code>true</code> to indicate that network interfaces created in the specified subnet should be assigned an IPv6 address. This includes a network interface that's created when launching an instance into the subnet (the instance therefore receives an IPv6 address). </p>
/// <p>If you enable the IPv6 addressing feature for your subnet, your network interface or instance only receives an IPv6 address if it's created using version <code>2016-11-15</code> or later of the Amazon EC2 API.</p>
pub fn get_assign_ipv6_address_on_creation(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
self.inner.get_assign_ipv6_address_on_creation()
}
/// <p>Specify <code>true</code> to indicate that network interfaces attached to instances created in the specified subnet should be assigned a public IPv4 address.</p>
pub fn map_public_ip_on_launch(mut self, input: crate::types::AttributeBooleanValue) -> Self {
self.inner = self.inner.map_public_ip_on_launch(input);
self
}
/// <p>Specify <code>true</code> to indicate that network interfaces attached to instances created in the specified subnet should be assigned a public IPv4 address.</p>
pub fn set_map_public_ip_on_launch(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
self.inner = self.inner.set_map_public_ip_on_launch(input);
self
}
/// <p>Specify <code>true</code> to indicate that network interfaces attached to instances created in the specified subnet should be assigned a public IPv4 address.</p>
pub fn get_map_public_ip_on_launch(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
self.inner.get_map_public_ip_on_launch()
}
/// <p>The ID of the subnet.</p>
pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.subnet_id(input.into());
self
}
/// <p>The ID of the subnet.</p>
pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_subnet_id(input);
self
}
/// <p>The ID of the subnet.</p>
pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_subnet_id()
}
/// <p>Specify <code>true</code> to indicate that network interfaces attached to instances created in the specified subnet should be assigned a customer-owned IPv4 address.</p>
/// <p>When this value is <code>true</code>, you must specify the customer-owned IP pool using <code>CustomerOwnedIpv4Pool</code>.</p>
pub fn map_customer_owned_ip_on_launch(mut self, input: crate::types::AttributeBooleanValue) -> Self {
self.inner = self.inner.map_customer_owned_ip_on_launch(input);
self
}
/// <p>Specify <code>true</code> to indicate that network interfaces attached to instances created in the specified subnet should be assigned a customer-owned IPv4 address.</p>
/// <p>When this value is <code>true</code>, you must specify the customer-owned IP pool using <code>CustomerOwnedIpv4Pool</code>.</p>
pub fn set_map_customer_owned_ip_on_launch(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
self.inner = self.inner.set_map_customer_owned_ip_on_launch(input);
self
}
/// <p>Specify <code>true</code> to indicate that network interfaces attached to instances created in the specified subnet should be assigned a customer-owned IPv4 address.</p>
/// <p>When this value is <code>true</code>, you must specify the customer-owned IP pool using <code>CustomerOwnedIpv4Pool</code>.</p>
pub fn get_map_customer_owned_ip_on_launch(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
self.inner.get_map_customer_owned_ip_on_launch()
}
/// <p>The customer-owned IPv4 address pool associated with the subnet.</p>
/// <p>You must set this value when you specify <code>true</code> for <code>MapCustomerOwnedIpOnLaunch</code>.</p>
pub fn customer_owned_ipv4_pool(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.customer_owned_ipv4_pool(input.into());
self
}
/// <p>The customer-owned IPv4 address pool associated with the subnet.</p>
/// <p>You must set this value when you specify <code>true</code> for <code>MapCustomerOwnedIpOnLaunch</code>.</p>
pub fn set_customer_owned_ipv4_pool(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_customer_owned_ipv4_pool(input);
self
}
/// <p>The customer-owned IPv4 address pool associated with the subnet.</p>
/// <p>You must set this value when you specify <code>true</code> for <code>MapCustomerOwnedIpOnLaunch</code>.</p>
pub fn get_customer_owned_ipv4_pool(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_customer_owned_ipv4_pool()
}
/// <p>Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.</p>
pub fn enable_dns64(mut self, input: crate::types::AttributeBooleanValue) -> Self {
self.inner = self.inner.enable_dns64(input);
self
}
/// <p>Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.</p>
pub fn set_enable_dns64(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
self.inner = self.inner.set_enable_dns64(input);
self
}
/// <p>Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.</p>
pub fn get_enable_dns64(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
self.inner.get_enable_dns64()
}
/// <p>The type of hostname to assign to instances in the subnet at launch. For IPv4-only and dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be based on the instance IPv4 address (ip-name) or the instance ID (resource-name). For IPv6 only subnets, an instance DNS name must be based on the instance ID (resource-name).</p>
pub fn private_dns_hostname_type_on_launch(mut self, input: crate::types::HostnameType) -> Self {
self.inner = self.inner.private_dns_hostname_type_on_launch(input);
self
}
/// <p>The type of hostname to assign to instances in the subnet at launch. For IPv4-only and dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be based on the instance IPv4 address (ip-name) or the instance ID (resource-name). For IPv6 only subnets, an instance DNS name must be based on the instance ID (resource-name).</p>
pub fn set_private_dns_hostname_type_on_launch(mut self, input: ::std::option::Option<crate::types::HostnameType>) -> Self {
self.inner = self.inner.set_private_dns_hostname_type_on_launch(input);
self
}
/// <p>The type of hostname to assign to instances in the subnet at launch. For IPv4-only and dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be based on the instance IPv4 address (ip-name) or the instance ID (resource-name). For IPv6 only subnets, an instance DNS name must be based on the instance ID (resource-name).</p>
pub fn get_private_dns_hostname_type_on_launch(&self) -> &::std::option::Option<crate::types::HostnameType> {
self.inner.get_private_dns_hostname_type_on_launch()
}
/// <p>Indicates whether to respond to DNS queries for instance hostnames with DNS A records.</p>
pub fn enable_resource_name_dns_a_record_on_launch(mut self, input: crate::types::AttributeBooleanValue) -> Self {
self.inner = self.inner.enable_resource_name_dns_a_record_on_launch(input);
self
}
/// <p>Indicates whether to respond to DNS queries for instance hostnames with DNS A records.</p>
pub fn set_enable_resource_name_dns_a_record_on_launch(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
self.inner = self.inner.set_enable_resource_name_dns_a_record_on_launch(input);
self
}
/// <p>Indicates whether to respond to DNS queries for instance hostnames with DNS A records.</p>
pub fn get_enable_resource_name_dns_a_record_on_launch(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
self.inner.get_enable_resource_name_dns_a_record_on_launch()
}
/// <p>Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.</p>
pub fn enable_resource_name_dns_aaaa_record_on_launch(mut self, input: crate::types::AttributeBooleanValue) -> Self {
self.inner = self.inner.enable_resource_name_dns_aaaa_record_on_launch(input);
self
}
/// <p>Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.</p>
pub fn set_enable_resource_name_dns_aaaa_record_on_launch(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
self.inner = self.inner.set_enable_resource_name_dns_aaaa_record_on_launch(input);
self
}
/// <p>Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.</p>
pub fn get_enable_resource_name_dns_aaaa_record_on_launch(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
self.inner.get_enable_resource_name_dns_aaaa_record_on_launch()
}
/// <p> Indicates the device position for local network interfaces in this subnet. For example, <code>1</code> indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0). </p>
pub fn enable_lni_at_device_index(mut self, input: i32) -> Self {
self.inner = self.inner.enable_lni_at_device_index(input);
self
}
/// <p> Indicates the device position for local network interfaces in this subnet. For example, <code>1</code> indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0). </p>
pub fn set_enable_lni_at_device_index(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_enable_lni_at_device_index(input);
self
}
/// <p> Indicates the device position for local network interfaces in this subnet. For example, <code>1</code> indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0). </p>
pub fn get_enable_lni_at_device_index(&self) -> &::std::option::Option<i32> {
self.inner.get_enable_lni_at_device_index()
}
/// <p> Specify <code>true</code> to indicate that local network interfaces at the current position should be disabled. </p>
pub fn disable_lni_at_device_index(mut self, input: crate::types::AttributeBooleanValue) -> Self {
self.inner = self.inner.disable_lni_at_device_index(input);
self
}
/// <p> Specify <code>true</code> to indicate that local network interfaces at the current position should be disabled. </p>
pub fn set_disable_lni_at_device_index(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
self.inner = self.inner.set_disable_lni_at_device_index(input);
self
}
/// <p> Specify <code>true</code> to indicate that local network interfaces at the current position should be disabled. </p>
pub fn get_disable_lni_at_device_index(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
self.inner.get_disable_lni_at_device_index()
}
}