aws-sdk-lightsail 1.108.0

AWS SDK for Amazon Lightsail
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_bucket::_update_bucket_input::UpdateBucketInputBuilder;

pub use crate::operation::update_bucket::_update_bucket_output::UpdateBucketOutputBuilder;

impl crate::operation::update_bucket::builders::UpdateBucketInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::update_bucket::UpdateBucketOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_bucket::UpdateBucketError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_bucket();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateBucket`.
///
/// <p>Updates an existing Amazon Lightsail bucket.</p>
/// <p>Use this action to update the configuration of an existing bucket, such as versioning, public accessibility, and the Amazon Web Services accounts that can access the bucket.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateBucketFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_bucket::builders::UpdateBucketInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_bucket::UpdateBucketOutput,
        crate::operation::update_bucket::UpdateBucketError,
    > for UpdateBucketFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_bucket::UpdateBucketOutput,
            crate::operation::update_bucket::UpdateBucketError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateBucketFluentBuilder {
    /// Creates a new `UpdateBucketFluentBuilder`.
    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 UpdateBucket as a reference.
    pub fn as_input(&self) -> &crate::operation::update_bucket::builders::UpdateBucketInputBuilder {
        &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::update_bucket::UpdateBucketOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_bucket::UpdateBucketError,
            ::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::update_bucket::UpdateBucket::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_bucket::UpdateBucket::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::update_bucket::UpdateBucketOutput,
        crate::operation::update_bucket::UpdateBucketError,
        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 name of the bucket to update.</p>
    pub fn bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.bucket_name(input.into());
        self
    }
    /// <p>The name of the bucket to update.</p>
    pub fn set_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_bucket_name(input);
        self
    }
    /// <p>The name of the bucket to update.</p>
    pub fn get_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_bucket_name()
    }
    /// <p>An object that sets the public accessibility of objects in the specified bucket.</p>
    pub fn access_rules(mut self, input: crate::types::AccessRules) -> Self {
        self.inner = self.inner.access_rules(input);
        self
    }
    /// <p>An object that sets the public accessibility of objects in the specified bucket.</p>
    pub fn set_access_rules(mut self, input: ::std::option::Option<crate::types::AccessRules>) -> Self {
        self.inner = self.inner.set_access_rules(input);
        self
    }
    /// <p>An object that sets the public accessibility of objects in the specified bucket.</p>
    pub fn get_access_rules(&self) -> &::std::option::Option<crate::types::AccessRules> {
        self.inner.get_access_rules()
    }
    /// <p>Specifies whether to enable or suspend versioning of objects in the bucket.</p>
    /// <p>The following options can be specified:</p>
    /// <ul>
    /// <li>
    /// <p><code>Enabled</code> - Enables versioning of objects in the specified bucket.</p></li>
    /// <li>
    /// <p><code>Suspended</code> - Suspends versioning of objects in the specified bucket. Existing object versions are retained.</p></li>
    /// </ul>
    pub fn versioning(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.versioning(input.into());
        self
    }
    /// <p>Specifies whether to enable or suspend versioning of objects in the bucket.</p>
    /// <p>The following options can be specified:</p>
    /// <ul>
    /// <li>
    /// <p><code>Enabled</code> - Enables versioning of objects in the specified bucket.</p></li>
    /// <li>
    /// <p><code>Suspended</code> - Suspends versioning of objects in the specified bucket. Existing object versions are retained.</p></li>
    /// </ul>
    pub fn set_versioning(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_versioning(input);
        self
    }
    /// <p>Specifies whether to enable or suspend versioning of objects in the bucket.</p>
    /// <p>The following options can be specified:</p>
    /// <ul>
    /// <li>
    /// <p><code>Enabled</code> - Enables versioning of objects in the specified bucket.</p></li>
    /// <li>
    /// <p><code>Suspended</code> - Suspends versioning of objects in the specified bucket. Existing object versions are retained.</p></li>
    /// </ul>
    pub fn get_versioning(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_versioning()
    }
    ///
    /// Appends an item to `readonlyAccessAccounts`.
    ///
    /// To override the contents of this collection use [`set_readonly_access_accounts`](Self::set_readonly_access_accounts).
    ///
    /// <p>An array of strings to specify the Amazon Web Services account IDs that can access the bucket.</p>
    /// <p>You can give a maximum of 10 Amazon Web Services accounts access to a bucket.</p>
    pub fn readonly_access_accounts(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.readonly_access_accounts(input.into());
        self
    }
    /// <p>An array of strings to specify the Amazon Web Services account IDs that can access the bucket.</p>
    /// <p>You can give a maximum of 10 Amazon Web Services accounts access to a bucket.</p>
    pub fn set_readonly_access_accounts(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_readonly_access_accounts(input);
        self
    }
    /// <p>An array of strings to specify the Amazon Web Services account IDs that can access the bucket.</p>
    /// <p>You can give a maximum of 10 Amazon Web Services accounts access to a bucket.</p>
    pub fn get_readonly_access_accounts(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_readonly_access_accounts()
    }
    /// <p>An object that describes the access log configuration for the bucket.</p>
    pub fn access_log_config(mut self, input: crate::types::BucketAccessLogConfig) -> Self {
        self.inner = self.inner.access_log_config(input);
        self
    }
    /// <p>An object that describes the access log configuration for the bucket.</p>
    pub fn set_access_log_config(mut self, input: ::std::option::Option<crate::types::BucketAccessLogConfig>) -> Self {
        self.inner = self.inner.set_access_log_config(input);
        self
    }
    /// <p>An object that describes the access log configuration for the bucket.</p>
    pub fn get_access_log_config(&self) -> &::std::option::Option<crate::types::BucketAccessLogConfig> {
        self.inner.get_access_log_config()
    }
    /// <p>Sets the cross-origin resource sharing (CORS) configuration for your bucket. If a CORS configuration exists, it is replaced with the specified configuration. For AWS CLI operations, this parameter can also be passed as a file. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p><note>
    /// <p>CORS information is only returned in a response when you update the CORS policy.</p>
    /// </note>
    pub fn cors(mut self, input: crate::types::BucketCorsConfig) -> Self {
        self.inner = self.inner.cors(input);
        self
    }
    /// <p>Sets the cross-origin resource sharing (CORS) configuration for your bucket. If a CORS configuration exists, it is replaced with the specified configuration. For AWS CLI operations, this parameter can also be passed as a file. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p><note>
    /// <p>CORS information is only returned in a response when you update the CORS policy.</p>
    /// </note>
    pub fn set_cors(mut self, input: ::std::option::Option<crate::types::BucketCorsConfig>) -> Self {
        self.inner = self.inner.set_cors(input);
        self
    }
    /// <p>Sets the cross-origin resource sharing (CORS) configuration for your bucket. If a CORS configuration exists, it is replaced with the specified configuration. For AWS CLI operations, this parameter can also be passed as a file. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p><note>
    /// <p>CORS information is only returned in a response when you update the CORS policy.</p>
    /// </note>
    pub fn get_cors(&self) -> &::std::option::Option<crate::types::BucketCorsConfig> {
        self.inner.get_cors()
    }
}