aws_sdk_s3control/operation/create_access_point/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_access_point::_create_access_point_output::CreateAccessPointOutputBuilder;
3
4pub use crate::operation::create_access_point::_create_access_point_input::CreateAccessPointInputBuilder;
5
6impl crate::operation::create_access_point::builders::CreateAccessPointInputBuilder {
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::create_access_point::CreateAccessPointOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_access_point::CreateAccessPointError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_access_point();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateAccessPoint`.
24///
25/// <p>Creates an access point and associates it to a specified bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html">Managing access to shared datasets with access points</a> or <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-directory-buckets.html">Managing access to shared datasets in directory buckets with access points</a> in the <i>Amazon S3 User Guide</i>.</p>
26/// <p>To create an access point and attach it to a volume on an Amazon FSx file system, see <a href="https://docs.aws.amazon.com/fsx/latest/APIReference/API_CreateAndAttachS3AccessPoint.html">CreateAndAttachS3AccessPoint</a> in the <i>Amazon FSx API Reference</i>.</p>
27/// <p></p><note>
28/// <p>S3 on Outposts only supports VPC-style access points.</p>
29/// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html"> Accessing Amazon S3 on Outposts using virtual private cloud (VPC) only access points</a> in the <i>Amazon S3 User Guide</i>.</p>
30/// </note>
31/// <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_CreateAccessPoint.html#API_control_CreateAccessPoint_Examples">Examples</a> section.</p>
32/// <p></p>
33/// <p>The following actions are related to <code>CreateAccessPoint</code>:</p>
34/// <ul>
35/// <li>
36/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPoint.html">GetAccessPoint</a></p></li>
37/// <li>
38/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPoint.html">DeleteAccessPoint</a></p></li>
39/// <li>
40/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPoints.html">ListAccessPoints</a></p></li>
41/// <li>
42/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPointsForDirectoryBuckets.html">ListAccessPointsForDirectoryBuckets</a></p></li>
43/// </ul><important>
44/// <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>
45/// </important>
46#[derive(::std::clone::Clone, ::std::fmt::Debug)]
47pub struct CreateAccessPointFluentBuilder {
48 handle: ::std::sync::Arc<crate::client::Handle>,
49 inner: crate::operation::create_access_point::builders::CreateAccessPointInputBuilder,
50 config_override: ::std::option::Option<crate::config::Builder>,
51}
52impl
53 crate::client::customize::internal::CustomizableSend<
54 crate::operation::create_access_point::CreateAccessPointOutput,
55 crate::operation::create_access_point::CreateAccessPointError,
56 > for CreateAccessPointFluentBuilder
57{
58 fn send(
59 self,
60 config_override: crate::config::Builder,
61 ) -> crate::client::customize::internal::BoxFuture<
62 crate::client::customize::internal::SendResult<
63 crate::operation::create_access_point::CreateAccessPointOutput,
64 crate::operation::create_access_point::CreateAccessPointError,
65 >,
66 > {
67 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
68 }
69}
70impl CreateAccessPointFluentBuilder {
71 /// Creates a new `CreateAccessPointFluentBuilder`.
72 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
73 Self {
74 handle,
75 inner: ::std::default::Default::default(),
76 config_override: ::std::option::Option::None,
77 }
78 }
79 /// Access the CreateAccessPoint as a reference.
80 pub fn as_input(&self) -> &crate::operation::create_access_point::builders::CreateAccessPointInputBuilder {
81 &self.inner
82 }
83 /// Sends the request and returns the response.
84 ///
85 /// If an error occurs, an `SdkError` will be returned with additional details that
86 /// can be matched against.
87 ///
88 /// By default, any retryable failures will be retried twice. Retry behavior
89 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
90 /// set when configuring the client.
91 pub async fn send(
92 self,
93 ) -> ::std::result::Result<
94 crate::operation::create_access_point::CreateAccessPointOutput,
95 ::aws_smithy_runtime_api::client::result::SdkError<
96 crate::operation::create_access_point::CreateAccessPointError,
97 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
98 >,
99 > {
100 let input = self
101 .inner
102 .build()
103 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
104 let runtime_plugins = crate::operation::create_access_point::CreateAccessPoint::operation_runtime_plugins(
105 self.handle.runtime_plugins.clone(),
106 &self.handle.conf,
107 self.config_override,
108 );
109 crate::operation::create_access_point::CreateAccessPoint::orchestrate(&runtime_plugins, input).await
110 }
111
112 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
113 pub fn customize(
114 self,
115 ) -> crate::client::customize::CustomizableOperation<
116 crate::operation::create_access_point::CreateAccessPointOutput,
117 crate::operation::create_access_point::CreateAccessPointError,
118 Self,
119 > {
120 crate::client::customize::CustomizableOperation::new(self)
121 }
122 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
123 self.set_config_override(::std::option::Option::Some(config_override.into()));
124 self
125 }
126
127 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
128 self.config_override = config_override;
129 self
130 }
131 /// <p>The Amazon Web Services account ID for the account that owns the specified access point.</p>
132 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.inner = self.inner.account_id(input.into());
134 self
135 }
136 /// <p>The Amazon Web Services account ID for the account that owns the specified access point.</p>
137 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138 self.inner = self.inner.set_account_id(input);
139 self
140 }
141 /// <p>The Amazon Web Services account ID for the account that owns the specified access point.</p>
142 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
143 self.inner.get_account_id()
144 }
145 /// <p>The name you want to assign to this access point.</p>
146 /// <p>For directory buckets, the access point name must consist of a base name that you provide and suffix that includes the <code>ZoneID</code> (Amazon Web Services Availability Zone or Local Zone) of your bucket location, followed by <code>--xa-s3</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-directory-buckets.html">Managing access to shared datasets in directory buckets with access points</a> in the <i>Amazon S3 User Guide</i>.</p>
147 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148 self.inner = self.inner.name(input.into());
149 self
150 }
151 /// <p>The name you want to assign to this access point.</p>
152 /// <p>For directory buckets, the access point name must consist of a base name that you provide and suffix that includes the <code>ZoneID</code> (Amazon Web Services Availability Zone or Local Zone) of your bucket location, followed by <code>--xa-s3</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-directory-buckets.html">Managing access to shared datasets in directory buckets with access points</a> in the <i>Amazon S3 User Guide</i>.</p>
153 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154 self.inner = self.inner.set_name(input);
155 self
156 }
157 /// <p>The name you want to assign to this access point.</p>
158 /// <p>For directory buckets, the access point name must consist of a base name that you provide and suffix that includes the <code>ZoneID</code> (Amazon Web Services Availability Zone or Local Zone) of your bucket location, followed by <code>--xa-s3</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-directory-buckets.html">Managing access to shared datasets in directory buckets with access points</a> in the <i>Amazon S3 User Guide</i>.</p>
159 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
160 self.inner.get_name()
161 }
162 /// <p>The name of the bucket that you want to associate this access point with.</p>
163 /// <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>
164 /// <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>
165 /// :
166 /// <account-id>
167 /// :outpost/
168 /// <outpost-id>
169 /// /bucket/
170 /// <my-bucket-name></my-bucket-name>
171 /// </outpost-id>
172 /// </account-id>
173 /// </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>
174 pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175 self.inner = self.inner.bucket(input.into());
176 self
177 }
178 /// <p>The name of the bucket that you want to associate this access point with.</p>
179 /// <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>
180 /// <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>
181 /// :
182 /// <account-id>
183 /// :outpost/
184 /// <outpost-id>
185 /// /bucket/
186 /// <my-bucket-name></my-bucket-name>
187 /// </outpost-id>
188 /// </account-id>
189 /// </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>
190 pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191 self.inner = self.inner.set_bucket(input);
192 self
193 }
194 /// <p>The name of the bucket that you want to associate this access point with.</p>
195 /// <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>
196 /// <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>
197 /// :
198 /// <account-id>
199 /// :outpost/
200 /// <outpost-id>
201 /// /bucket/
202 /// <my-bucket-name></my-bucket-name>
203 /// </outpost-id>
204 /// </account-id>
205 /// </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>
206 pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
207 self.inner.get_bucket()
208 }
209 /// <p>If you include this field, Amazon S3 restricts access to this access point to requests from the specified virtual private cloud (VPC).</p><note>
210 /// <p>This is required for creating an access point for Amazon S3 on Outposts buckets.</p>
211 /// </note>
212 pub fn vpc_configuration(mut self, input: crate::types::VpcConfiguration) -> Self {
213 self.inner = self.inner.vpc_configuration(input);
214 self
215 }
216 /// <p>If you include this field, Amazon S3 restricts access to this access point to requests from the specified virtual private cloud (VPC).</p><note>
217 /// <p>This is required for creating an access point for Amazon S3 on Outposts buckets.</p>
218 /// </note>
219 pub fn set_vpc_configuration(mut self, input: ::std::option::Option<crate::types::VpcConfiguration>) -> Self {
220 self.inner = self.inner.set_vpc_configuration(input);
221 self
222 }
223 /// <p>If you include this field, Amazon S3 restricts access to this access point to requests from the specified virtual private cloud (VPC).</p><note>
224 /// <p>This is required for creating an access point for Amazon S3 on Outposts buckets.</p>
225 /// </note>
226 pub fn get_vpc_configuration(&self) -> &::std::option::Option<crate::types::VpcConfiguration> {
227 self.inner.get_vpc_configuration()
228 }
229 /// <p>The <code>PublicAccessBlock</code> configuration that you want to apply to the access point.</p>
230 pub fn public_access_block_configuration(mut self, input: crate::types::PublicAccessBlockConfiguration) -> Self {
231 self.inner = self.inner.public_access_block_configuration(input);
232 self
233 }
234 /// <p>The <code>PublicAccessBlock</code> configuration that you want to apply to the access point.</p>
235 pub fn set_public_access_block_configuration(mut self, input: ::std::option::Option<crate::types::PublicAccessBlockConfiguration>) -> Self {
236 self.inner = self.inner.set_public_access_block_configuration(input);
237 self
238 }
239 /// <p>The <code>PublicAccessBlock</code> configuration that you want to apply to the access point.</p>
240 pub fn get_public_access_block_configuration(&self) -> &::std::option::Option<crate::types::PublicAccessBlockConfiguration> {
241 self.inner.get_public_access_block_configuration()
242 }
243 /// <p>The Amazon Web Services account ID associated with the S3 bucket associated with this access point.</p>
244 /// <p>For same account access point when your bucket and access point belong to the same account owner, the <code>BucketAccountId</code> is not required. For cross-account access point when your bucket and access point are not in the same account, the <code>BucketAccountId</code> is required.</p>
245 pub fn bucket_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
246 self.inner = self.inner.bucket_account_id(input.into());
247 self
248 }
249 /// <p>The Amazon Web Services account ID associated with the S3 bucket associated with this access point.</p>
250 /// <p>For same account access point when your bucket and access point belong to the same account owner, the <code>BucketAccountId</code> is not required. For cross-account access point when your bucket and access point are not in the same account, the <code>BucketAccountId</code> is required.</p>
251 pub fn set_bucket_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
252 self.inner = self.inner.set_bucket_account_id(input);
253 self
254 }
255 /// <p>The Amazon Web Services account ID associated with the S3 bucket associated with this access point.</p>
256 /// <p>For same account access point when your bucket and access point belong to the same account owner, the <code>BucketAccountId</code> is not required. For cross-account access point when your bucket and access point are not in the same account, the <code>BucketAccountId</code> is required.</p>
257 pub fn get_bucket_account_id(&self) -> &::std::option::Option<::std::string::String> {
258 self.inner.get_bucket_account_id()
259 }
260 /// <p>For directory buckets, you can filter access control to specific prefixes, API operations, or a combination of both. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-directory-buckets.html">Managing access to shared datasets in directory buckets with access points</a> in the <i>Amazon S3 User Guide</i>.</p><note>
261 /// <p>Scope is only supported for access points attached to directory buckets.</p>
262 /// </note>
263 pub fn scope(mut self, input: crate::types::Scope) -> Self {
264 self.inner = self.inner.scope(input);
265 self
266 }
267 /// <p>For directory buckets, you can filter access control to specific prefixes, API operations, or a combination of both. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-directory-buckets.html">Managing access to shared datasets in directory buckets with access points</a> in the <i>Amazon S3 User Guide</i>.</p><note>
268 /// <p>Scope is only supported for access points attached to directory buckets.</p>
269 /// </note>
270 pub fn set_scope(mut self, input: ::std::option::Option<crate::types::Scope>) -> Self {
271 self.inner = self.inner.set_scope(input);
272 self
273 }
274 /// <p>For directory buckets, you can filter access control to specific prefixes, API operations, or a combination of both. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-directory-buckets.html">Managing access to shared datasets in directory buckets with access points</a> in the <i>Amazon S3 User Guide</i>.</p><note>
275 /// <p>Scope is only supported for access points attached to directory buckets.</p>
276 /// </note>
277 pub fn get_scope(&self) -> &::std::option::Option<crate::types::Scope> {
278 self.inner.get_scope()
279 }
280 ///
281 /// Appends an item to `Tags`.
282 ///
283 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
284 ///
285 /// <p>An array of tags that you can apply to an access point. Tags are key-value pairs of metadata used to control access to your access points. For more information about tags, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/tagging.html">Using tags with Amazon S3</a>. For information about tagging access points, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/tagging.html#using-tags-for-abac">Using tags for attribute-based access control (ABAC)</a>.</p><note>
286 /// <ul>
287 /// <li>
288 /// <p>You must have the <code>s3:TagResource</code> permission to create an access point with tags for a general purpose bucket.</p></li>
289 /// <li>
290 /// <p>You must have the <code>s3express:TagResource</code> permission to create an access point with tags for a directory bucket.</p></li>
291 /// </ul>
292 /// </note>
293 pub fn tags(mut self, input: crate::types::Tag) -> Self {
294 self.inner = self.inner.tags(input);
295 self
296 }
297 /// <p>An array of tags that you can apply to an access point. Tags are key-value pairs of metadata used to control access to your access points. For more information about tags, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/tagging.html">Using tags with Amazon S3</a>. For information about tagging access points, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/tagging.html#using-tags-for-abac">Using tags for attribute-based access control (ABAC)</a>.</p><note>
298 /// <ul>
299 /// <li>
300 /// <p>You must have the <code>s3:TagResource</code> permission to create an access point with tags for a general purpose bucket.</p></li>
301 /// <li>
302 /// <p>You must have the <code>s3express:TagResource</code> permission to create an access point with tags for a directory bucket.</p></li>
303 /// </ul>
304 /// </note>
305 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
306 self.inner = self.inner.set_tags(input);
307 self
308 }
309 /// <p>An array of tags that you can apply to an access point. Tags are key-value pairs of metadata used to control access to your access points. For more information about tags, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/tagging.html">Using tags with Amazon S3</a>. For information about tagging access points, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/tagging.html#using-tags-for-abac">Using tags for attribute-based access control (ABAC)</a>.</p><note>
310 /// <ul>
311 /// <li>
312 /// <p>You must have the <code>s3:TagResource</code> permission to create an access point with tags for a general purpose bucket.</p></li>
313 /// <li>
314 /// <p>You must have the <code>s3express:TagResource</code> permission to create an access point with tags for a directory bucket.</p></li>
315 /// </ul>
316 /// </note>
317 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
318 self.inner.get_tags()
319 }
320}