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>
38#[derive(::std::clone::Clone, ::std::fmt::Debug)]
39pub struct GetBucketFluentBuilder {
40 handle: ::std::sync::Arc<crate::client::Handle>,
41 inner: crate::operation::get_bucket::builders::GetBucketInputBuilder,
42 config_override: ::std::option::Option<crate::config::Builder>,
43}
44impl crate::client::customize::internal::CustomizableSend<crate::operation::get_bucket::GetBucketOutput, crate::operation::get_bucket::GetBucketError>
45 for GetBucketFluentBuilder
46{
47 fn send(
48 self,
49 config_override: crate::config::Builder,
50 ) -> crate::client::customize::internal::BoxFuture<
51 crate::client::customize::internal::SendResult<crate::operation::get_bucket::GetBucketOutput, crate::operation::get_bucket::GetBucketError>,
52 > {
53 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54 }
55}
56impl GetBucketFluentBuilder {
57 /// Creates a new `GetBucketFluentBuilder`.
58 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59 Self {
60 handle,
61 inner: ::std::default::Default::default(),
62 config_override: ::std::option::Option::None,
63 }
64 }
65 /// Access the GetBucket as a reference.
66 pub fn as_input(&self) -> &crate::operation::get_bucket::builders::GetBucketInputBuilder {
67 &self.inner
68 }
69 /// Sends the request and returns the response.
70 ///
71 /// If an error occurs, an `SdkError` will be returned with additional details that
72 /// can be matched against.
73 ///
74 /// By default, any retryable failures will be retried twice. Retry behavior
75 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76 /// set when configuring the client.
77 pub async fn send(
78 self,
79 ) -> ::std::result::Result<
80 crate::operation::get_bucket::GetBucketOutput,
81 ::aws_smithy_runtime_api::client::result::SdkError<
82 crate::operation::get_bucket::GetBucketError,
83 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84 >,
85 > {
86 let input = self
87 .inner
88 .build()
89 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90 let runtime_plugins = crate::operation::get_bucket::GetBucket::operation_runtime_plugins(
91 self.handle.runtime_plugins.clone(),
92 &self.handle.conf,
93 self.config_override,
94 );
95 crate::operation::get_bucket::GetBucket::orchestrate(&runtime_plugins, input).await
96 }
97
98 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99 pub fn customize(
100 self,
101 ) -> crate::client::customize::CustomizableOperation<
102 crate::operation::get_bucket::GetBucketOutput,
103 crate::operation::get_bucket::GetBucketError,
104 Self,
105 > {
106 crate::client::customize::CustomizableOperation::new(self)
107 }
108 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109 self.set_config_override(::std::option::Option::Some(config_override.into()));
110 self
111 }
112
113 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114 self.config_override = config_override;
115 self
116 }
117 /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
118 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.inner = self.inner.account_id(input.into());
120 self
121 }
122 /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
123 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.inner = self.inner.set_account_id(input);
125 self
126 }
127 /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
128 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
129 self.inner.get_account_id()
130 }
131 /// <p>Specifies the bucket.</p>
132 /// <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>
133 /// <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>
134 /// :
135 /// <account-id>
136 /// :outpost/
137 /// <outpost-id>
138 /// /bucket/
139 /// <my-bucket-name></my-bucket-name>
140 /// </outpost-id>
141 /// </account-id>
142 /// </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>
143 pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 self.inner = self.inner.bucket(input.into());
145 self
146 }
147 /// <p>Specifies the bucket.</p>
148 /// <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>
149 /// <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>
150 /// :
151 /// <account-id>
152 /// :outpost/
153 /// <outpost-id>
154 /// /bucket/
155 /// <my-bucket-name></my-bucket-name>
156 /// </outpost-id>
157 /// </account-id>
158 /// </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>
159 pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160 self.inner = self.inner.set_bucket(input);
161 self
162 }
163 /// <p>Specifies the bucket.</p>
164 /// <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>
165 /// <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>
166 /// :
167 /// <account-id>
168 /// :outpost/
169 /// <outpost-id>
170 /// /bucket/
171 /// <my-bucket-name></my-bucket-name>
172 /// </outpost-id>
173 /// </account-id>
174 /// </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>
175 pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
176 self.inner.get_bucket()
177 }
178}