aws_sdk_s3control/operation/get_storage_lens_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_storage_lens_configuration::_get_storage_lens_configuration_output::GetStorageLensConfigurationOutputBuilder;
3
4pub use crate::operation::get_storage_lens_configuration::_get_storage_lens_configuration_input::GetStorageLensConfigurationInputBuilder;
5
6impl crate::operation::get_storage_lens_configuration::builders::GetStorageLensConfigurationInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::get_storage_lens_configuration::GetStorageLensConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_storage_lens_configuration::GetStorageLensConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_storage_lens_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetStorageLensConfiguration`.
24///
25/// <note>
26/// <p>This operation is not supported by directory buckets.</p>
27/// </note>
28/// <p>Gets the Amazon S3 Storage Lens configuration. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Assessing your storage activity and usage with Amazon S3 Storage Lens </a> in the <i>Amazon S3 User Guide</i>. For a complete list of S3 Storage Lens metrics, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_metrics_glossary.html">S3 Storage Lens metrics glossary</a> in the <i>Amazon S3 User Guide</i>.</p><note>
29/// <p>To use this action, you must have permission to perform the <code>s3:GetStorageLensConfiguration</code> action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon S3 User Guide</i>.</p>
30/// </note> <important>
31/// <p>You must URL encode any signed header values that contain spaces. For example, if your header value is <code>my file.txt</code>, containing two spaces after <code>my</code>, you must URL encode this value to <code>my%20%20file.txt</code>.</p>
32/// </important>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct GetStorageLensConfigurationFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::get_storage_lens_configuration::builders::GetStorageLensConfigurationInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::get_storage_lens_configuration::GetStorageLensConfigurationOutput,
42        crate::operation::get_storage_lens_configuration::GetStorageLensConfigurationError,
43    > for GetStorageLensConfigurationFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::get_storage_lens_configuration::GetStorageLensConfigurationOutput,
51            crate::operation::get_storage_lens_configuration::GetStorageLensConfigurationError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl GetStorageLensConfigurationFluentBuilder {
58    /// Creates a new `GetStorageLensConfigurationFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the GetStorageLensConfiguration as a reference.
67    pub fn as_input(&self) -> &crate::operation::get_storage_lens_configuration::builders::GetStorageLensConfigurationInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::get_storage_lens_configuration::GetStorageLensConfigurationOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::get_storage_lens_configuration::GetStorageLensConfigurationError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::get_storage_lens_configuration::GetStorageLensConfiguration::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::get_storage_lens_configuration::GetStorageLensConfiguration::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::get_storage_lens_configuration::GetStorageLensConfigurationOutput,
104        crate::operation::get_storage_lens_configuration::GetStorageLensConfigurationError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// <p>The ID of the Amazon S3 Storage Lens configuration.</p>
119    pub fn config_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.config_id(input.into());
121        self
122    }
123    /// <p>The ID of the Amazon S3 Storage Lens configuration.</p>
124    pub fn set_config_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_config_id(input);
126        self
127    }
128    /// <p>The ID of the Amazon S3 Storage Lens configuration.</p>
129    pub fn get_config_id(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_config_id()
131    }
132    /// <p>The account ID of the requester.</p>
133    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.account_id(input.into());
135        self
136    }
137    /// <p>The account ID of the requester.</p>
138    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_account_id(input);
140        self
141    }
142    /// <p>The account ID of the requester.</p>
143    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_account_id()
145    }
146}