1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | pub use crate::operation::get_bucket_location::_get_bucket_location_input::GetBucketLocationInputBuilder;
|
3 3 |
|
4 4 | pub use crate::operation::get_bucket_location::_get_bucket_location_output::GetBucketLocationOutputBuilder;
|
5 5 |
|
6 6 | impl crate::operation::get_bucket_location::builders::GetBucketLocationInputBuilder {
|
7 7 | /// Sends a request with this input using the given client.
|
8 8 | pub async fn send_with(
|
9 9 | self,
|
10 10 | client: &crate::Client,
|
11 11 | ) -> ::std::result::Result<
|
12 12 | crate::operation::get_bucket_location::GetBucketLocationOutput,
|
13 13 | ::aws_smithy_runtime_api::client::result::SdkError<
|
14 14 | crate::operation::get_bucket_location::GetBucketLocationError,
|
15 15 | ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
16 16 | >,
|
17 17 | > {
|
18 18 | let mut fluent_builder = client.get_bucket_location();
|
19 19 | fluent_builder.inner = self;
|
20 20 | fluent_builder.send().await
|
21 21 | }
|
22 22 | }
|
23 23 | /// Fluent builder constructing a request to `GetBucketLocation`.
|
24 24 | ///
|
25 - | /// <note>
|
26 - | /// <p>This operation is not supported for directory buckets.</p>
|
25 + | /// <important>
|
26 + | /// <p>Using the <code>GetBucketLocation</code> operation is no longer a best practice. To return the Region that a bucket resides in, we recommend that you use the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html">HeadBucket</a> operation instead. For backward compatibility, Amazon S3 continues to support the <code>GetBucketLocation</code> operation.</p>
|
27 + | /// </important>
|
28 + | /// <p>Returns the Region the bucket resides in. You set the bucket's Region using the <code>LocationConstraint</code> request parameter in a <code>CreateBucket</code> request. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html">CreateBucket</a>.</p><note>
|
29 + | /// <p>In a bucket's home Region, calls to the <code>GetBucketLocation</code> operation are governed by the bucket's policy. In other Regions, the bucket policy doesn't apply, which means that cross-account access won't be authorized. However, calls to the <code>HeadBucket</code> operation always return the bucket’s location through an HTTP response header, whether access to the bucket is authorized or not. Therefore, we recommend using the <code>HeadBucket</code> operation for bucket Region discovery and to avoid using the <code>GetBucketLocation</code> operation.</p>
|
27 30 | /// </note>
|
28 - | /// <p>Returns the Region the bucket resides in. You set the bucket's Region using the <code>LocationConstraint</code> request parameter in a <code>CreateBucket</code> request. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html">CreateBucket</a>.</p>
|
29 31 | /// <p>When you use this API operation with an access point, provide the alias of the access point in place of the bucket name.</p>
|
30 32 | /// <p>When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code <code>InvalidAccessPointAliasError</code> is returned. For more information about <code>InvalidAccessPointAliasError</code>, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList">List of Error Codes</a>.</p><note>
|
31 - | /// <p>We recommend that you use <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html">HeadBucket</a> to return the Region that a bucket resides in. For backward compatibility, Amazon S3 continues to support GetBucketLocation.</p>
|
33 + | /// <p>This operation is not supported for directory buckets.</p>
|
32 34 | /// </note>
|
33 35 | /// <p>The following operations are related to <code>GetBucketLocation</code>:</p>
|
34 36 | /// <ul>
|
35 37 | /// <li>
|
36 38 | /// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html">GetObject</a></p></li>
|
37 39 | /// <li>
|
38 40 | /// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html">CreateBucket</a></p></li>
|
39 - | /// </ul>
|
41 + | /// </ul><important>
|
42 + | /// <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>
|
43 + | /// </important>
|
40 44 | #[derive(::std::clone::Clone, ::std::fmt::Debug)]
|
41 45 | pub struct GetBucketLocationFluentBuilder {
|
42 46 | handle: ::std::sync::Arc<crate::client::Handle>,
|
43 47 | inner: crate::operation::get_bucket_location::builders::GetBucketLocationInputBuilder,
|
44 48 | config_override: ::std::option::Option<crate::config::Builder>,
|
45 49 | }
|
46 50 | impl
|
47 51 | crate::client::customize::internal::CustomizableSend<
|
48 52 | crate::operation::get_bucket_location::GetBucketLocationOutput,
|
49 53 | crate::operation::get_bucket_location::GetBucketLocationError,
|
50 54 | > for GetBucketLocationFluentBuilder
|
51 55 | {
|
52 56 | fn send(
|
53 57 | self,
|
54 58 | config_override: crate::config::Builder,
|
55 59 | ) -> crate::client::customize::internal::BoxFuture<
|
56 60 | crate::client::customize::internal::SendResult<
|
57 61 | crate::operation::get_bucket_location::GetBucketLocationOutput,
|
58 62 | crate::operation::get_bucket_location::GetBucketLocationError,
|
59 63 | >,
|
60 64 | > {
|
61 65 | ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
|
62 66 | }
|
63 67 | }
|
64 68 | impl GetBucketLocationFluentBuilder {
|
65 69 | /// Creates a new `GetBucketLocationFluentBuilder`.
|
66 70 | pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
|
67 71 | Self {
|
68 72 | handle,
|
69 73 | inner: ::std::default::Default::default(),
|