aws-sdk-directconnect 1.106.0

AWS SDK for AWS Direct Connect
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::allocate_hosted_connection::_allocate_hosted_connection_input::AllocateHostedConnectionInputBuilder;

pub use crate::operation::allocate_hosted_connection::_allocate_hosted_connection_output::AllocateHostedConnectionOutputBuilder;

impl crate::operation::allocate_hosted_connection::builders::AllocateHostedConnectionInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::allocate_hosted_connection::AllocateHostedConnectionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::allocate_hosted_connection::AllocateHostedConnectionError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.allocate_hosted_connection();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `AllocateHostedConnection`.
///
/// <p>Creates a hosted connection on the specified interconnect or a link aggregation group (LAG) of interconnects.</p>
/// <p>Allocates a VLAN number and a specified amount of capacity (bandwidth) for use by a hosted connection on the specified interconnect or LAG of interconnects. Amazon Web Services polices the hosted connection for the specified capacity and the Direct Connect Partner must also police the hosted connection for the specified capacity.</p><note>
/// <p>Intended for use by Direct Connect Partners only.</p>
/// </note>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct AllocateHostedConnectionFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::allocate_hosted_connection::builders::AllocateHostedConnectionInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::allocate_hosted_connection::AllocateHostedConnectionOutput,
        crate::operation::allocate_hosted_connection::AllocateHostedConnectionError,
    > for AllocateHostedConnectionFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::allocate_hosted_connection::AllocateHostedConnectionOutput,
            crate::operation::allocate_hosted_connection::AllocateHostedConnectionError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl AllocateHostedConnectionFluentBuilder {
    /// Creates a new `AllocateHostedConnectionFluentBuilder`.
    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 AllocateHostedConnection as a reference.
    pub fn as_input(&self) -> &crate::operation::allocate_hosted_connection::builders::AllocateHostedConnectionInputBuilder {
        &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::allocate_hosted_connection::AllocateHostedConnectionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::allocate_hosted_connection::AllocateHostedConnectionError,
            ::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::allocate_hosted_connection::AllocateHostedConnection::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::allocate_hosted_connection::AllocateHostedConnection::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::allocate_hosted_connection::AllocateHostedConnectionOutput,
        crate::operation::allocate_hosted_connection::AllocateHostedConnectionError,
        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 ID of the interconnect or LAG.</p>
    pub fn connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.connection_id(input.into());
        self
    }
    /// <p>The ID of the interconnect or LAG.</p>
    pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_connection_id(input);
        self
    }
    /// <p>The ID of the interconnect or LAG.</p>
    pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_connection_id()
    }
    /// <p>The ID of the Amazon Web Services account ID of the customer for the connection.</p>
    pub fn owner_account(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.owner_account(input.into());
        self
    }
    /// <p>The ID of the Amazon Web Services account ID of the customer for the connection.</p>
    pub fn set_owner_account(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_owner_account(input);
        self
    }
    /// <p>The ID of the Amazon Web Services account ID of the customer for the connection.</p>
    pub fn get_owner_account(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_owner_account()
    }
    /// <p>The bandwidth of the connection. The possible values are 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps, 10Gbps, and 25Gbps. Note that only those Direct Connect Partners who have met specific requirements are allowed to create a 1Gbps, 2Gbps, 5Gbps, 10Gbps, or 25Gbps hosted connection.</p>
    pub fn bandwidth(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.bandwidth(input.into());
        self
    }
    /// <p>The bandwidth of the connection. The possible values are 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps, 10Gbps, and 25Gbps. Note that only those Direct Connect Partners who have met specific requirements are allowed to create a 1Gbps, 2Gbps, 5Gbps, 10Gbps, or 25Gbps hosted connection.</p>
    pub fn set_bandwidth(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_bandwidth(input);
        self
    }
    /// <p>The bandwidth of the connection. The possible values are 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps, 10Gbps, and 25Gbps. Note that only those Direct Connect Partners who have met specific requirements are allowed to create a 1Gbps, 2Gbps, 5Gbps, 10Gbps, or 25Gbps hosted connection.</p>
    pub fn get_bandwidth(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_bandwidth()
    }
    /// <p>The name of the hosted connection.</p>
    pub fn connection_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.connection_name(input.into());
        self
    }
    /// <p>The name of the hosted connection.</p>
    pub fn set_connection_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_connection_name(input);
        self
    }
    /// <p>The name of the hosted connection.</p>
    pub fn get_connection_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_connection_name()
    }
    /// <p>The dedicated VLAN provisioned to the hosted connection.</p>
    pub fn vlan(mut self, input: i32) -> Self {
        self.inner = self.inner.vlan(input);
        self
    }
    /// <p>The dedicated VLAN provisioned to the hosted connection.</p>
    pub fn set_vlan(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_vlan(input);
        self
    }
    /// <p>The dedicated VLAN provisioned to the hosted connection.</p>
    pub fn get_vlan(&self) -> &::std::option::Option<i32> {
        self.inner.get_vlan()
    }
    ///
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags associated with the connection.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        self.inner = self.inner.tags(input);
        self
    }
    /// <p>The tags associated with the connection.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <p>The tags associated with the connection.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        self.inner.get_tags()
    }
}