aws-sdk-worklink 0.27.0

AWS SDK for Amazon WorkLink
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_fleet::_create_fleet_output::CreateFleetOutputBuilder;

pub use crate::operation::create_fleet::_create_fleet_input::CreateFleetInputBuilder;

/// Fluent builder constructing a request to `CreateFleet`.
///
/// <p>Creates a fleet. A fleet consists of resources and the configuration that delivers associated websites to authorized users who download and set up the Amazon WorkLink app.</p>
#[deprecated(
    note = "Amazon WorkLink is no longer supported. This will be removed in a future version of the SDK."
)]
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct CreateFleetFluentBuilder {
    handle: std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_fleet::builders::CreateFleetInputBuilder,
}
impl CreateFleetFluentBuilder {
    /// Creates a new `CreateFleet`.
    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::create_fleet::CreateFleet,
            aws_http::retry::AwsResponseRetryClassifier,
        >,
        aws_smithy_http::result::SdkError<crate::operation::create_fleet::CreateFleetError>,
    > {
        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::create_fleet::CreateFleetOutput,
        aws_smithy_http::result::SdkError<crate::operation::create_fleet::CreateFleetError>,
    > {
        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 unique name for the fleet.</p>
    pub fn fleet_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.fleet_name(input.into());
        self
    }
    /// <p>A unique name for the fleet.</p>
    pub fn set_fleet_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.inner = self.inner.set_fleet_name(input);
        self
    }
    /// <p>The fleet name to display.</p>
    pub fn display_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.display_name(input.into());
        self
    }
    /// <p>The fleet name to display.</p>
    pub fn set_display_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.inner = self.inner.set_display_name(input);
        self
    }
    /// <p>The option to optimize for better performance by routing traffic through the closest AWS Region to users, which may be outside of your home Region.</p>
    pub fn optimize_for_end_user_location(mut self, input: bool) -> Self {
        self.inner = self.inner.optimize_for_end_user_location(input);
        self
    }
    /// <p>The option to optimize for better performance by routing traffic through the closest AWS Region to users, which may be outside of your home Region.</p>
    pub fn set_optimize_for_end_user_location(mut self, input: std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_optimize_for_end_user_location(input);
        self
    }
    /// Adds a key-value pair to `Tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p> The tags to add to the resource. A tag is a key-value pair.</p>
    pub fn tags(
        mut self,
        k: impl Into<std::string::String>,
        v: impl Into<std::string::String>,
    ) -> Self {
        self.inner = self.inner.tags(k.into(), v.into());
        self
    }
    /// <p> The tags to add to the resource. A tag is a key-value pair.</p>
    pub fn set_tags(
        mut self,
        input: std::option::Option<
            std::collections::HashMap<std::string::String, std::string::String>,
        >,
    ) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
}