aws-sdk-ec2 1.224.0

AWS SDK for Amazon Elastic Compute Cloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::advertise_byoip_cidr::_advertise_byoip_cidr_input::AdvertiseByoipCidrInputBuilder;

pub use crate::operation::advertise_byoip_cidr::_advertise_byoip_cidr_output::AdvertiseByoipCidrOutputBuilder;

impl crate::operation::advertise_byoip_cidr::builders::AdvertiseByoipCidrInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::advertise_byoip_cidr::AdvertiseByoipCidrOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::advertise_byoip_cidr::AdvertiseByoipCidrError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.advertise_byoip_cidr();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `AdvertiseByoipCidr`.
///
/// <p>Advertises an IPv4 or IPv6 address range that is provisioned for use with your Amazon Web Services resources through bring your own IP addresses (BYOIP).</p>
/// <p>You can perform this operation at most once every 10 seconds, even if you specify different address ranges each time.</p>
/// <p>We recommend that you stop advertising the BYOIP CIDR from other locations when you advertise it from Amazon Web Services. To minimize down time, you can configure your Amazon Web Services resources to use an address from a BYOIP CIDR before it is advertised, and then simultaneously stop advertising it from the current location and start advertising it through Amazon Web Services.</p>
/// <p>It can take a few minutes before traffic to the specified addresses starts routing to Amazon Web Services because of BGP propagation delays.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct AdvertiseByoipCidrFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::advertise_byoip_cidr::builders::AdvertiseByoipCidrInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::advertise_byoip_cidr::AdvertiseByoipCidrOutput,
        crate::operation::advertise_byoip_cidr::AdvertiseByoipCidrError,
    > for AdvertiseByoipCidrFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::advertise_byoip_cidr::AdvertiseByoipCidrOutput,
            crate::operation::advertise_byoip_cidr::AdvertiseByoipCidrError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl AdvertiseByoipCidrFluentBuilder {
    /// Creates a new `AdvertiseByoipCidrFluentBuilder`.
    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 AdvertiseByoipCidr as a reference.
    pub fn as_input(&self) -> &crate::operation::advertise_byoip_cidr::builders::AdvertiseByoipCidrInputBuilder {
        &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::advertise_byoip_cidr::AdvertiseByoipCidrOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::advertise_byoip_cidr::AdvertiseByoipCidrError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::advertise_byoip_cidr::AdvertiseByoipCidr::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::advertise_byoip_cidr::AdvertiseByoipCidr::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::advertise_byoip_cidr::AdvertiseByoipCidrOutput,
        crate::operation::advertise_byoip_cidr::AdvertiseByoipCidrError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The address range, in CIDR notation. This must be the exact range that you provisioned. You can't advertise only a portion of the provisioned range.</p>
    pub fn cidr(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.cidr(input.into());
        self
    }
    /// <p>The address range, in CIDR notation. This must be the exact range that you provisioned. You can't advertise only a portion of the provisioned range.</p>
    pub fn set_cidr(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_cidr(input);
        self
    }
    /// <p>The address range, in CIDR notation. This must be the exact range that you provisioned. You can't advertise only a portion of the provisioned range.</p>
    pub fn get_cidr(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_cidr()
    }
    /// <p>The public 2-byte or 4-byte ASN that you want to advertise.</p>
    pub fn asn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.asn(input.into());
        self
    }
    /// <p>The public 2-byte or 4-byte ASN that you want to advertise.</p>
    pub fn set_asn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_asn(input);
        self
    }
    /// <p>The public 2-byte or 4-byte ASN that you want to advertise.</p>
    pub fn get_asn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_asn()
    }
    /// <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.inner = self.inner.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 set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_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.inner.get_dry_run()
    }
    /// <p>If you have <a href="https://docs.aws.amazon.com/local-zones/latest/ug/how-local-zones-work.html">Local Zones</a> enabled, you can choose a network border group for Local Zones when you provision and advertise a BYOIPv4 CIDR. Choose the network border group carefully as the EIP and the Amazon Web Services resource it is associated with must reside in the same network border group.</p>
    /// <p>You can provision BYOIP address ranges to and advertise them in the following Local Zone network border groups:</p>
    /// <ul>
    /// <li>
    /// <p>us-east-1-dfw-2</p></li>
    /// <li>
    /// <p>us-west-2-lax-1</p></li>
    /// <li>
    /// <p>us-west-2-phx-2</p></li>
    /// </ul><note>
    /// <p>You cannot provision or advertise BYOIPv6 address ranges in Local Zones at this time.</p>
    /// </note>
    pub fn network_border_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.network_border_group(input.into());
        self
    }
    /// <p>If you have <a href="https://docs.aws.amazon.com/local-zones/latest/ug/how-local-zones-work.html">Local Zones</a> enabled, you can choose a network border group for Local Zones when you provision and advertise a BYOIPv4 CIDR. Choose the network border group carefully as the EIP and the Amazon Web Services resource it is associated with must reside in the same network border group.</p>
    /// <p>You can provision BYOIP address ranges to and advertise them in the following Local Zone network border groups:</p>
    /// <ul>
    /// <li>
    /// <p>us-east-1-dfw-2</p></li>
    /// <li>
    /// <p>us-west-2-lax-1</p></li>
    /// <li>
    /// <p>us-west-2-phx-2</p></li>
    /// </ul><note>
    /// <p>You cannot provision or advertise BYOIPv6 address ranges in Local Zones at this time.</p>
    /// </note>
    pub fn set_network_border_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_network_border_group(input);
        self
    }
    /// <p>If you have <a href="https://docs.aws.amazon.com/local-zones/latest/ug/how-local-zones-work.html">Local Zones</a> enabled, you can choose a network border group for Local Zones when you provision and advertise a BYOIPv4 CIDR. Choose the network border group carefully as the EIP and the Amazon Web Services resource it is associated with must reside in the same network border group.</p>
    /// <p>You can provision BYOIP address ranges to and advertise them in the following Local Zone network border groups:</p>
    /// <ul>
    /// <li>
    /// <p>us-east-1-dfw-2</p></li>
    /// <li>
    /// <p>us-west-2-lax-1</p></li>
    /// <li>
    /// <p>us-west-2-phx-2</p></li>
    /// </ul><note>
    /// <p>You cannot provision or advertise BYOIPv6 address ranges in Local Zones at this time.</p>
    /// </note>
    pub fn get_network_border_group(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_network_border_group()
    }
}