aws-sdk-snowball 0.32.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_address::_create_address_output::CreateAddressOutputBuilder;

pub use crate::operation::create_address::_create_address_input::CreateAddressInputBuilder;

impl CreateAddressInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_address::CreateAddressOutput,
        ::aws_smithy_http::result::SdkError<
            crate::operation::create_address::CreateAddressError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_address();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateAddress`.
///
/// <p>Creates an address for a Snow device to be shipped to. In most regions, addresses are validated at the time of creation. The address you provide must be located within the serviceable area of your region. If the address is invalid or unsupported, then an exception is thrown.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateAddressFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_address::builders::CreateAddressInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_address::CreateAddressOutput,
        crate::operation::create_address::CreateAddressError,
    > for CreateAddressFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_address::CreateAddressOutput,
            crate::operation::create_address::CreateAddressError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateAddressFluentBuilder {
    /// Creates a new `CreateAddress`.
    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 CreateAddress as a reference.
    pub fn as_input(&self) -> &crate::operation::create_address::builders::CreateAddressInputBuilder {
        &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::create_address::CreateAddressOutput,
        ::aws_smithy_http::result::SdkError<
            crate::operation::create_address::CreateAddressError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self.inner.build().map_err(::aws_smithy_http::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::create_address::CreateAddress::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_address::CreateAddress::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being
    /// sent.
    // TODO(enableNewSmithyRuntimeCleanup): Remove `async` and `Result` once we switch to orchestrator
    pub async fn customize(
        self,
    ) -> ::std::result::Result<
        crate::client::customize::orchestrator::CustomizableOperation<
            crate::operation::create_address::CreateAddressOutput,
            crate::operation::create_address::CreateAddressError,
            Self,
        >,
        ::aws_smithy_http::result::SdkError<crate::operation::create_address::CreateAddressError>,
    > {
        ::std::result::Result::Ok(crate::client::customize::orchestrator::CustomizableOperation::new(self))
    }
    pub(crate) fn config_override(mut self, config_override: impl Into<crate::config::Builder>) -> Self {
        self.set_config_override(Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The address that you want the Snow device shipped to.</p>
    pub fn address(mut self, input: crate::types::Address) -> Self {
        self.inner = self.inner.address(input);
        self
    }
    /// <p>The address that you want the Snow device shipped to.</p>
    pub fn set_address(mut self, input: ::std::option::Option<crate::types::Address>) -> Self {
        self.inner = self.inner.set_address(input);
        self
    }
    /// <p>The address that you want the Snow device shipped to.</p>
    pub fn get_address(&self) -> &::std::option::Option<crate::types::Address> {
        self.inner.get_address()
    }
}