aws_sdk_s3/operation/get_bucket_encryption/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_bucket_encryption::_get_bucket_encryption_output::GetBucketEncryptionOutputBuilder;
3
4pub use crate::operation::get_bucket_encryption::_get_bucket_encryption_input::GetBucketEncryptionInputBuilder;
5
6impl crate::operation::get_bucket_encryption::builders::GetBucketEncryptionInputBuilder {
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_encryption::GetBucketEncryptionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_bucket_encryption::GetBucketEncryptionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_bucket_encryption();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetBucketEncryption`.
24///
25/// <p>Returns the default encryption configuration for an Amazon S3 bucket. By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3).</p><note>
26/// <ul>
27/// <li>
28/// <p><b>General purpose buckets</b> - For information about the bucket default encryption feature, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html">Amazon S3 Bucket Default Encryption</a> in the <i>Amazon S3 User Guide</i>.</p></li>
29/// <li>
30/// <p><b>Directory buckets</b> - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS. For information about the default encryption configuration in directory buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-bucket-encryption.html">Setting default server-side encryption behavior for directory buckets</a>.</p></li>
31/// </ul>
32/// </note>
33/// <dl>
34/// <dt>
35/// Permissions
36/// </dt>
37/// <dd>
38/// <ul>
39/// <li>
40/// <p><b>General purpose bucket permissions</b> - The <code>s3:GetEncryptionConfiguration</code> permission is required in a policy. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources">Permissions Related to Bucket Operations</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing Access Permissions to Your Amazon S3 Resources</a>.</p></li>
41/// <li>
42/// <p><b>Directory bucket permissions</b> - To grant access to this API operation, you must have the <code>s3express:GetEncryptionConfiguration</code> permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html">Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone</a> in the <i>Amazon S3 User Guide</i>.</p></li>
43/// </ul>
44/// </dd>
45/// <dt>
46/// HTTP Host header syntax
47/// </dt>
48/// <dd>
49/// <p><b>Directory buckets </b> - The HTTP Host header syntax is <code>s3express-control.<i>region-code</i>.amazonaws.com</code>.</p>
50/// </dd>
51/// </dl>
52/// <p>The following operations are related to <code>GetBucketEncryption</code>:</p>
53/// <ul>
54/// <li>
55/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html">PutBucketEncryption</a></p></li>
56/// <li>
57/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html">DeleteBucketEncryption</a></p></li>
58/// </ul>
59#[derive(::std::clone::Clone, ::std::fmt::Debug)]
60pub struct GetBucketEncryptionFluentBuilder {
61    handle: ::std::sync::Arc<crate::client::Handle>,
62    inner: crate::operation::get_bucket_encryption::builders::GetBucketEncryptionInputBuilder,
63    config_override: ::std::option::Option<crate::config::Builder>,
64}
65impl
66    crate::client::customize::internal::CustomizableSend<
67        crate::operation::get_bucket_encryption::GetBucketEncryptionOutput,
68        crate::operation::get_bucket_encryption::GetBucketEncryptionError,
69    > for GetBucketEncryptionFluentBuilder
70{
71    fn send(
72        self,
73        config_override: crate::config::Builder,
74    ) -> crate::client::customize::internal::BoxFuture<
75        crate::client::customize::internal::SendResult<
76            crate::operation::get_bucket_encryption::GetBucketEncryptionOutput,
77            crate::operation::get_bucket_encryption::GetBucketEncryptionError,
78        >,
79    > {
80        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
81    }
82}
83impl GetBucketEncryptionFluentBuilder {
84    /// Creates a new `GetBucketEncryptionFluentBuilder`.
85    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
86        Self {
87            handle,
88            inner: ::std::default::Default::default(),
89            config_override: ::std::option::Option::None,
90        }
91    }
92    /// Access the GetBucketEncryption as a reference.
93    pub fn as_input(&self) -> &crate::operation::get_bucket_encryption::builders::GetBucketEncryptionInputBuilder {
94        &self.inner
95    }
96    /// Sends the request and returns the response.
97    ///
98    /// If an error occurs, an `SdkError` will be returned with additional details that
99    /// can be matched against.
100    ///
101    /// By default, any retryable failures will be retried twice. Retry behavior
102    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
103    /// set when configuring the client.
104    pub async fn send(
105        self,
106    ) -> ::std::result::Result<
107        crate::operation::get_bucket_encryption::GetBucketEncryptionOutput,
108        ::aws_smithy_runtime_api::client::result::SdkError<
109            crate::operation::get_bucket_encryption::GetBucketEncryptionError,
110            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
111        >,
112    > {
113        let input = self
114            .inner
115            .build()
116            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
117        let runtime_plugins = crate::operation::get_bucket_encryption::GetBucketEncryption::operation_runtime_plugins(
118            self.handle.runtime_plugins.clone(),
119            &self.handle.conf,
120            self.config_override,
121        );
122        crate::operation::get_bucket_encryption::GetBucketEncryption::orchestrate(&runtime_plugins, input).await
123    }
124
125    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
126    pub fn customize(
127        self,
128    ) -> crate::client::customize::CustomizableOperation<
129        crate::operation::get_bucket_encryption::GetBucketEncryptionOutput,
130        crate::operation::get_bucket_encryption::GetBucketEncryptionError,
131        Self,
132    > {
133        crate::client::customize::CustomizableOperation::new(self)
134    }
135    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
136        self.set_config_override(::std::option::Option::Some(config_override.into()));
137        self
138    }
139
140    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
141        self.config_override = config_override;
142        self
143    }
144    /// <p>The name of the bucket from which the server-side encryption configuration is retrieved.</p>
145    /// <p><b>Directory buckets </b> - When you use this operation with a directory bucket, you must use path-style requests in the format <code>https://s3express-control.<i>region-code</i>.amazonaws.com/<i>bucket-name</i> </code>. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format <code> <i>bucket-base-name</i>--<i>zone-id</i>--x-s3</code> (for example, <code> <i>DOC-EXAMPLE-BUCKET</i>--<i>usw2-az1</i>--x-s3</code>). For information about bucket naming restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html">Directory bucket naming rules</a> in the <i>Amazon S3 User Guide</i></p>
146    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.bucket(input.into());
148        self
149    }
150    /// <p>The name of the bucket from which the server-side encryption configuration is retrieved.</p>
151    /// <p><b>Directory buckets </b> - When you use this operation with a directory bucket, you must use path-style requests in the format <code>https://s3express-control.<i>region-code</i>.amazonaws.com/<i>bucket-name</i> </code>. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format <code> <i>bucket-base-name</i>--<i>zone-id</i>--x-s3</code> (for example, <code> <i>DOC-EXAMPLE-BUCKET</i>--<i>usw2-az1</i>--x-s3</code>). For information about bucket naming restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html">Directory bucket naming rules</a> in the <i>Amazon S3 User Guide</i></p>
152    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_bucket(input);
154        self
155    }
156    /// <p>The name of the bucket from which the server-side encryption configuration is retrieved.</p>
157    /// <p><b>Directory buckets </b> - When you use this operation with a directory bucket, you must use path-style requests in the format <code>https://s3express-control.<i>region-code</i>.amazonaws.com/<i>bucket-name</i> </code>. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format <code> <i>bucket-base-name</i>--<i>zone-id</i>--x-s3</code> (for example, <code> <i>DOC-EXAMPLE-BUCKET</i>--<i>usw2-az1</i>--x-s3</code>). For information about bucket naming restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html">Directory bucket naming rules</a> in the <i>Amazon S3 User Guide</i></p>
158    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_bucket()
160    }
161    /// <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><note>
162    /// <p>For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code <code>501 Not Implemented</code>.</p>
163    /// </note>
164    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.expected_bucket_owner(input.into());
166        self
167    }
168    /// <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><note>
169    /// <p>For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code <code>501 Not Implemented</code>.</p>
170    /// </note>
171    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.inner = self.inner.set_expected_bucket_owner(input);
173        self
174    }
175    /// <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><note>
176    /// <p>For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code <code>501 Not Implemented</code>.</p>
177    /// </note>
178    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_expected_bucket_owner()
180    }
181}