aws-sdk-snowball 0.27.0

AWS SDK for Amazon Import/Export Snowball
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_long_term_pricing::_create_long_term_pricing_output::CreateLongTermPricingOutputBuilder;

pub use crate::operation::create_long_term_pricing::_create_long_term_pricing_input::CreateLongTermPricingInputBuilder;

/// Fluent builder constructing a request to `CreateLongTermPricing`.
///
/// <p>Creates a job with the long-term usage option for a device. The long-term usage is a 1-year or 3-year long-term pricing type for the device. You are billed upfront, and Amazon Web Services provides discounts for long-term pricing. </p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct CreateLongTermPricingFluentBuilder {
    handle: std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_long_term_pricing::builders::CreateLongTermPricingInputBuilder,
}
impl CreateLongTermPricingFluentBuilder {
    /// Creates a new `CreateLongTermPricing`.
    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_long_term_pricing::CreateLongTermPricing,
            aws_http::retry::AwsResponseRetryClassifier,
        >,
        aws_smithy_http::result::SdkError<
            crate::operation::create_long_term_pricing::CreateLongTermPricingError,
        >,
    > {
        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_long_term_pricing::CreateLongTermPricingOutput,
        aws_smithy_http::result::SdkError<
            crate::operation::create_long_term_pricing::CreateLongTermPricingError,
        >,
    > {
        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>The type of long-term pricing option you want for the device, either 1-year or 3-year long-term pricing.</p>
    pub fn long_term_pricing_type(mut self, input: crate::types::LongTermPricingType) -> Self {
        self.inner = self.inner.long_term_pricing_type(input);
        self
    }
    /// <p>The type of long-term pricing option you want for the device, either 1-year or 3-year long-term pricing.</p>
    pub fn set_long_term_pricing_type(
        mut self,
        input: std::option::Option<crate::types::LongTermPricingType>,
    ) -> Self {
        self.inner = self.inner.set_long_term_pricing_type(input);
        self
    }
    /// <p>Specifies whether the current long-term pricing type for the device should be renewed.</p>
    pub fn is_long_term_pricing_auto_renew(mut self, input: bool) -> Self {
        self.inner = self.inner.is_long_term_pricing_auto_renew(input);
        self
    }
    /// <p>Specifies whether the current long-term pricing type for the device should be renewed.</p>
    pub fn set_is_long_term_pricing_auto_renew(mut self, input: std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_is_long_term_pricing_auto_renew(input);
        self
    }
    /// <p>The type of Snow Family devices to use for the long-term pricing job.</p>
    pub fn snowball_type(mut self, input: crate::types::SnowballType) -> Self {
        self.inner = self.inner.snowball_type(input);
        self
    }
    /// <p>The type of Snow Family devices to use for the long-term pricing job.</p>
    pub fn set_snowball_type(
        mut self,
        input: std::option::Option<crate::types::SnowballType>,
    ) -> Self {
        self.inner = self.inner.set_snowball_type(input);
        self
    }
}