aws_sdk_s3control/operation/get_bucket/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_bucket::_get_bucket_output::GetBucketOutputBuilder;
3
4pub use crate::operation::get_bucket::_get_bucket_input::GetBucketInputBuilder;
5
6impl crate::operation::get_bucket::builders::GetBucketInputBuilder {
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::GetBucketOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::get_bucket::GetBucketError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.get_bucket();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `GetBucket`.
24///
25/// <p>Gets an Amazon S3 on Outposts bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html"> Using Amazon S3 on Outposts</a> in the <i>Amazon S3 User Guide</i>.</p>
26/// <p>If you are using an identity other than the root user of the Amazon Web Services account that owns the Outposts bucket, the calling identity must have the <code>s3-outposts:GetBucket</code> permissions on the specified Outposts bucket and belong to the Outposts bucket owner's account in order to use this action. Only users from Outposts bucket owner account with the right permissions can perform actions on an Outposts bucket.</p>
27/// <p>If you don't have <code>s3-outposts:GetBucket</code> permissions or you're not using an identity that belongs to the bucket owner's account, Amazon S3 returns a <code>403 Access Denied</code> error.</p>
28/// <p>The following actions are related to <code>GetBucket</code> for Amazon S3 on Outposts:</p>
29/// <p>All Amazon S3 on Outposts REST API requests for this action require an additional parameter of <code>x-amz-outpost-id</code> to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the <code>x-amz-outpost-id</code> derived by using the access point ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucket.html#API_control_GetBucket_Examples">Examples</a> section.</p>
30/// <ul>
31/// <li>
32/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html">PutObject</a></p></li>
33/// <li>
34/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html">CreateBucket</a></p></li>
35/// <li>
36/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucket.html">DeleteBucket</a></p></li>
37/// </ul><important>
38/// <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>
39/// </important>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct GetBucketFluentBuilder {
42 handle: ::std::sync::Arc<crate::client::Handle>,
43 inner: crate::operation::get_bucket::builders::GetBucketInputBuilder,
44 config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl crate::client::customize::internal::CustomizableSend<crate::operation::get_bucket::GetBucketOutput, crate::operation::get_bucket::GetBucketError>
47 for GetBucketFluentBuilder
48{
49 fn send(
50 self,
51 config_override: crate::config::Builder,
52 ) -> crate::client::customize::internal::BoxFuture<
53 crate::client::customize::internal::SendResult<crate::operation::get_bucket::GetBucketOutput, crate::operation::get_bucket::GetBucketError>,
54 > {
55 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56 }
57}
58impl GetBucketFluentBuilder {
59 /// Creates a new `GetBucketFluentBuilder`.
60 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61 Self {
62 handle,
63 inner: ::std::default::Default::default(),
64 config_override: ::std::option::Option::None,
65 }
66 }
67 /// Access the GetBucket as a reference.
68 pub fn as_input(&self) -> &crate::operation::get_bucket::builders::GetBucketInputBuilder {
69 &self.inner
70 }
71 /// Sends the request and returns the response.
72 ///
73 /// If an error occurs, an `SdkError` will be returned with additional details that
74 /// can be matched against.
75 ///
76 /// By default, any retryable failures will be retried twice. Retry behavior
77 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78 /// set when configuring the client.
79 pub async fn send(
80 self,
81 ) -> ::std::result::Result<
82 crate::operation::get_bucket::GetBucketOutput,
83 ::aws_smithy_runtime_api::client::result::SdkError<
84 crate::operation::get_bucket::GetBucketError,
85 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86 >,
87 > {
88 let input = self
89 .inner
90 .build()
91 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92 let runtime_plugins = crate::operation::get_bucket::GetBucket::operation_runtime_plugins(
93 self.handle.runtime_plugins.clone(),
94 &self.handle.conf,
95 self.config_override,
96 );
97 crate::operation::get_bucket::GetBucket::orchestrate(&runtime_plugins, input).await
98 }
99
100 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101 pub fn customize(
102 self,
103 ) -> crate::client::customize::CustomizableOperation<
104 crate::operation::get_bucket::GetBucketOutput,
105 crate::operation::get_bucket::GetBucketError,
106 Self,
107 > {
108 crate::client::customize::CustomizableOperation::new(self)
109 }
110 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111 self.set_config_override(::std::option::Option::Some(config_override.into()));
112 self
113 }
114
115 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116 self.config_override = config_override;
117 self
118 }
119 /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
120 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.inner = self.inner.account_id(input.into());
122 self
123 }
124 /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
125 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.inner = self.inner.set_account_id(input);
127 self
128 }
129 /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
130 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
131 self.inner.get_account_id()
132 }
133 /// <p>Specifies the bucket.</p>
134 /// <p>For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.</p>
135 /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format <code>arn:aws:s3-outposts:<region>
136 /// :
137 /// <account-id>
138 /// :outpost/
139 /// <outpost-id>
140 /// /bucket/
141 /// <my-bucket-name></my-bucket-name>
142 /// </outpost-id>
143 /// </account-id>
144 /// </region></code>. For example, to access the bucket <code>reports</code> through Outpost <code>my-outpost</code> owned by account <code>123456789012</code> in Region <code>us-west-2</code>, use the URL encoding of <code>arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports</code>. The value must be URL encoded.</p>
145 pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 self.inner = self.inner.bucket(input.into());
147 self
148 }
149 /// <p>Specifies the bucket.</p>
150 /// <p>For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.</p>
151 /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format <code>arn:aws:s3-outposts:<region>
152 /// :
153 /// <account-id>
154 /// :outpost/
155 /// <outpost-id>
156 /// /bucket/
157 /// <my-bucket-name></my-bucket-name>
158 /// </outpost-id>
159 /// </account-id>
160 /// </region></code>. For example, to access the bucket <code>reports</code> through Outpost <code>my-outpost</code> owned by account <code>123456789012</code> in Region <code>us-west-2</code>, use the URL encoding of <code>arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports</code>. The value must be URL encoded.</p>
161 pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162 self.inner = self.inner.set_bucket(input);
163 self
164 }
165 /// <p>Specifies the bucket.</p>
166 /// <p>For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.</p>
167 /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format <code>arn:aws:s3-outposts:<region>
168 /// :
169 /// <account-id>
170 /// :outpost/
171 /// <outpost-id>
172 /// /bucket/
173 /// <my-bucket-name></my-bucket-name>
174 /// </outpost-id>
175 /// </account-id>
176 /// </region></code>. For example, to access the bucket <code>reports</code> through Outpost <code>my-outpost</code> owned by account <code>123456789012</code> in Region <code>us-west-2</code>, use the URL encoding of <code>arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports</code>. The value must be URL encoded.</p>
177 pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
178 self.inner.get_bucket()
179 }
180}