aws-sdk-iotsecuretunneling 0.26.0

AWS SDK for AWS IoT Secure Tunneling
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::open_tunnel::_open_tunnel_output::OpenTunnelOutputBuilder;

pub use crate::operation::open_tunnel::_open_tunnel_input::OpenTunnelInputBuilder;

/// Fluent builder constructing a request to `OpenTunnel`.
///
/// <p>Creates a new tunnel, and returns two client access tokens for clients to use to connect to the IoT Secure Tunneling proxy server.</p>
/// <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">OpenTunnel</a> action.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct OpenTunnelFluentBuilder {
    handle: std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::open_tunnel::builders::OpenTunnelInputBuilder,
}
impl OpenTunnelFluentBuilder {
    /// Creates a new `OpenTunnel`.
    pub(crate) fn new(handle: std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: Default::default(),
        }
    }

    /// Consume this builder, creating a customizable operation that can be modified before being
    /// sent. The operation's inner [http::Request] can be modified as well.
    pub async fn customize(
        self,
    ) -> std::result::Result<
        crate::client::customize::CustomizableOperation<
            crate::operation::open_tunnel::OpenTunnel,
            aws_http::retry::AwsResponseRetryClassifier,
        >,
        aws_smithy_http::result::SdkError<crate::operation::open_tunnel::OpenTunnelError>,
    > {
        let handle = self.handle.clone();
        let operation = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        Ok(crate::client::customize::CustomizableOperation { handle, operation })
    }

    /// 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::open_tunnel::OpenTunnelOutput,
        aws_smithy_http::result::SdkError<crate::operation::open_tunnel::OpenTunnelError>,
    > {
        let op = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&self.handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        self.handle.client.call(op).await
    }
    /// <p>A short text description of the tunnel. </p>
    pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>A short text description of the tunnel. </p>
    pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>A collection of tag metadata.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        self.inner = self.inner.tags(input);
        self
    }
    /// <p>A collection of tag metadata.</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 destination configuration for the OpenTunnel request.</p>
    pub fn destination_config(mut self, input: crate::types::DestinationConfig) -> Self {
        self.inner = self.inner.destination_config(input);
        self
    }
    /// <p>The destination configuration for the OpenTunnel request.</p>
    pub fn set_destination_config(
        mut self,
        input: std::option::Option<crate::types::DestinationConfig>,
    ) -> Self {
        self.inner = self.inner.set_destination_config(input);
        self
    }
    /// <p>Timeout configuration for a tunnel.</p>
    pub fn timeout_config(mut self, input: crate::types::TimeoutConfig) -> Self {
        self.inner = self.inner.timeout_config(input);
        self
    }
    /// <p>Timeout configuration for a tunnel.</p>
    pub fn set_timeout_config(
        mut self,
        input: std::option::Option<crate::types::TimeoutConfig>,
    ) -> Self {
        self.inner = self.inner.set_timeout_config(input);
        self
    }
}