aws_sdk_s3/operation/get_bucket_logging/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_bucket_logging::_get_bucket_logging_output::GetBucketLoggingOutputBuilder;
3
4pub use crate::operation::get_bucket_logging::_get_bucket_logging_input::GetBucketLoggingInputBuilder;
5
6impl crate::operation::get_bucket_logging::builders::GetBucketLoggingInputBuilder {
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_bucket_logging::GetBucketLoggingOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_bucket_logging::GetBucketLoggingError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_bucket_logging();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetBucketLogging`.
24///
25/// <important>
26/// <p>End of support notice: Beginning November 21, 2025, Amazon S3 will stop returning <code>DisplayName</code>. Update your applications to use canonical IDs (unique identifier for Amazon Web Services accounts), Amazon Web Services account ID (12 digit identifier) or IAM ARNs (full resource naming) as a direct replacement of <code>DisplayName</code>.</p>
27/// <p>This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region.</p>
28/// </important> <note>
29/// <p>This operation is not supported for directory buckets.</p>
30/// </note>
31/// <p>Returns the logging status of a bucket and the permissions users have to view and modify that status.</p>
32/// <p>The following operations are related to <code>GetBucketLogging</code>:</p>
33/// <ul>
34/// <li>
35/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html">CreateBucket</a></p></li>
36/// <li>
37/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLogging.html">PutBucketLogging</a></p></li>
38/// </ul><important>
39/// <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>
40/// </important>
41#[derive(::std::clone::Clone, ::std::fmt::Debug)]
42pub struct GetBucketLoggingFluentBuilder {
43    handle: ::std::sync::Arc<crate::client::Handle>,
44    inner: crate::operation::get_bucket_logging::builders::GetBucketLoggingInputBuilder,
45    config_override: ::std::option::Option<crate::config::Builder>,
46}
47impl
48    crate::client::customize::internal::CustomizableSend<
49        crate::operation::get_bucket_logging::GetBucketLoggingOutput,
50        crate::operation::get_bucket_logging::GetBucketLoggingError,
51    > for GetBucketLoggingFluentBuilder
52{
53    fn send(
54        self,
55        config_override: crate::config::Builder,
56    ) -> crate::client::customize::internal::BoxFuture<
57        crate::client::customize::internal::SendResult<
58            crate::operation::get_bucket_logging::GetBucketLoggingOutput,
59            crate::operation::get_bucket_logging::GetBucketLoggingError,
60        >,
61    > {
62        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
63    }
64}
65impl GetBucketLoggingFluentBuilder {
66    /// Creates a new `GetBucketLoggingFluentBuilder`.
67    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
68        Self {
69            handle,
70            inner: ::std::default::Default::default(),
71            config_override: ::std::option::Option::None,
72        }
73    }
74    /// Access the GetBucketLogging as a reference.
75    pub fn as_input(&self) -> &crate::operation::get_bucket_logging::builders::GetBucketLoggingInputBuilder {
76        &self.inner
77    }
78    /// Sends the request and returns the response.
79    ///
80    /// If an error occurs, an `SdkError` will be returned with additional details that
81    /// can be matched against.
82    ///
83    /// By default, any retryable failures will be retried twice. Retry behavior
84    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
85    /// set when configuring the client.
86    pub async fn send(
87        self,
88    ) -> ::std::result::Result<
89        crate::operation::get_bucket_logging::GetBucketLoggingOutput,
90        ::aws_smithy_runtime_api::client::result::SdkError<
91            crate::operation::get_bucket_logging::GetBucketLoggingError,
92            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
93        >,
94    > {
95        let input = self
96            .inner
97            .build()
98            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
99        let runtime_plugins = crate::operation::get_bucket_logging::GetBucketLogging::operation_runtime_plugins(
100            self.handle.runtime_plugins.clone(),
101            &self.handle.conf,
102            self.config_override,
103        );
104        crate::operation::get_bucket_logging::GetBucketLogging::orchestrate(&runtime_plugins, input).await
105    }
106
107    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
108    pub fn customize(
109        self,
110    ) -> crate::client::customize::CustomizableOperation<
111        crate::operation::get_bucket_logging::GetBucketLoggingOutput,
112        crate::operation::get_bucket_logging::GetBucketLoggingError,
113        Self,
114    > {
115        crate::client::customize::CustomizableOperation::new(self)
116    }
117    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
118        self.set_config_override(::std::option::Option::Some(config_override.into()));
119        self
120    }
121
122    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
123        self.config_override = config_override;
124        self
125    }
126    /// <p>The bucket name for which to get the logging information.</p>
127    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.bucket(input.into());
129        self
130    }
131    /// <p>The bucket name for which to get the logging information.</p>
132    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_bucket(input);
134        self
135    }
136    /// <p>The bucket name for which to get the logging information.</p>
137    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_bucket()
139    }
140    /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
141    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.inner = self.inner.expected_bucket_owner(input.into());
143        self
144    }
145    /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
146    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_expected_bucket_owner(input);
148        self
149    }
150    /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
151    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
152        self.inner.get_expected_bucket_owner()
153    }
154}