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>
44#[derive(::std::clone::Clone, ::std::fmt::Debug)]
45pub struct CreateAccessPointFluentBuilder {
46 handle: ::std::sync::Arc<crate::client::Handle>,
47 inner: crate::operation::create_access_point::builders::CreateAccessPointInputBuilder,
48 config_override: ::std::option::Option<crate::config::Builder>,
49}
50impl
51 crate::client::customize::internal::CustomizableSend<
52 crate::operation::create_access_point::CreateAccessPointOutput,
53 crate::operation::create_access_point::CreateAccessPointError,
54 > for CreateAccessPointFluentBuilder
55{
56 fn send(
57 self,
58 config_override: crate::config::Builder,
59 ) -> crate::client::customize::internal::BoxFuture<
60 crate::client::customize::internal::SendResult<
61 crate::operation::create_access_point::CreateAccessPointOutput,
62 crate::operation::create_access_point::CreateAccessPointError,
63 >,
64 > {
65 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
66 }
67}
68impl CreateAccessPointFluentBuilder {
69 /// Creates a new `CreateAccessPointFluentBuilder`.
70 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
71 Self {
72 handle,
73 inner: ::std::default::Default::default(),
74 config_override: ::std::option::Option::None,
75 }
76 }
77 /// Access the CreateAccessPoint as a reference.
78 pub fn as_input(&self) -> &crate::operation::create_access_point::builders::CreateAccessPointInputBuilder {
79 &self.inner
80 }
81 /// Sends the request and returns the response.
82 ///
83 /// If an error occurs, an `SdkError` will be returned with additional details that
84 /// can be matched against.
85 ///
86 /// By default, any retryable failures will be retried twice. Retry behavior
87 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
88 /// set when configuring the client.
89 pub async fn send(
90 self,
91 ) -> ::std::result::Result<
92 crate::operation::create_access_point::CreateAccessPointOutput,
93 ::aws_smithy_runtime_api::client::result::SdkError<
94 crate::operation::create_access_point::CreateAccessPointError,
95 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
96 >,
97 > {
98 let input = self
99 .inner
100 .build()
101 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
102 let runtime_plugins = crate::operation::create_access_point::CreateAccessPoint::operation_runtime_plugins(
103 self.handle.runtime_plugins.clone(),
104 &self.handle.conf,
105 self.config_override,
106 );
107 crate::operation::create_access_point::CreateAccessPoint::orchestrate(&runtime_plugins, input).await
108 }
109
110 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
111 pub fn customize(
112 self,
113 ) -> crate::client::customize::CustomizableOperation<
114 crate::operation::create_access_point::CreateAccessPointOutput,
115 crate::operation::create_access_point::CreateAccessPointError,
116 Self,
117 > {
118 crate::client::customize::CustomizableOperation::new(self)
119 }
120 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
121 self.set_config_override(::std::option::Option::Some(config_override.into()));
122 self
123 }
124
125 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
126 self.config_override = config_override;
127 self
128 }
129 /// <p>The Amazon Web Services account ID for the account that owns the specified access point.</p>
130 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131 self.inner = self.inner.account_id(input.into());
132 self
133 }
134 /// <p>The Amazon Web Services account ID for the account that owns the specified access point.</p>
135 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.inner = self.inner.set_account_id(input);
137 self
138 }
139 /// <p>The Amazon Web Services account ID for the account that owns the specified access point.</p>
140 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
141 self.inner.get_account_id()
142 }
143 /// <p>The name you want to assign to this access point.</p>
144 /// <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>
145 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 self.inner = self.inner.name(input.into());
147 self
148 }
149 /// <p>The name you want to assign to this access point.</p>
150 /// <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>
151 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152 self.inner = self.inner.set_name(input);
153 self
154 }
155 /// <p>The name you want to assign to this access point.</p>
156 /// <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>
157 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
158 self.inner.get_name()
159 }
160 /// <p>The name of the bucket that you want to associate this access point with.</p>
161 /// <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>
162 /// <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>
163 /// :
164 /// <account-id>
165 /// :outpost/
166 /// <outpost-id>
167 /// /bucket/
168 /// <my-bucket-name></my-bucket-name>
169 /// </outpost-id>
170 /// </account-id>
171 /// </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>
172 pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173 self.inner = self.inner.bucket(input.into());
174 self
175 }
176 /// <p>The name of the bucket that you want to associate this access point with.</p>
177 /// <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>
178 /// <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>
179 /// :
180 /// <account-id>
181 /// :outpost/
182 /// <outpost-id>
183 /// /bucket/
184 /// <my-bucket-name></my-bucket-name>
185 /// </outpost-id>
186 /// </account-id>
187 /// </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>
188 pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189 self.inner = self.inner.set_bucket(input);
190 self
191 }
192 /// <p>The name of the bucket that you want to associate this access point with.</p>
193 /// <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>
194 /// <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>
195 /// :
196 /// <account-id>
197 /// :outpost/
198 /// <outpost-id>
199 /// /bucket/
200 /// <my-bucket-name></my-bucket-name>
201 /// </outpost-id>
202 /// </account-id>
203 /// </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>
204 pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
205 self.inner.get_bucket()
206 }
207 /// <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>
208 /// <p>This is required for creating an access point for Amazon S3 on Outposts buckets.</p>
209 /// </note>
210 pub fn vpc_configuration(mut self, input: crate::types::VpcConfiguration) -> Self {
211 self.inner = self.inner.vpc_configuration(input);
212 self
213 }
214 /// <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>
215 /// <p>This is required for creating an access point for Amazon S3 on Outposts buckets.</p>
216 /// </note>
217 pub fn set_vpc_configuration(mut self, input: ::std::option::Option<crate::types::VpcConfiguration>) -> Self {
218 self.inner = self.inner.set_vpc_configuration(input);
219 self
220 }
221 /// <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>
222 /// <p>This is required for creating an access point for Amazon S3 on Outposts buckets.</p>
223 /// </note>
224 pub fn get_vpc_configuration(&self) -> &::std::option::Option<crate::types::VpcConfiguration> {
225 self.inner.get_vpc_configuration()
226 }
227 /// <p>The <code>PublicAccessBlock</code> configuration that you want to apply to the access point.</p>
228 pub fn public_access_block_configuration(mut self, input: crate::types::PublicAccessBlockConfiguration) -> Self {
229 self.inner = self.inner.public_access_block_configuration(input);
230 self
231 }
232 /// <p>The <code>PublicAccessBlock</code> configuration that you want to apply to the access point.</p>
233 pub fn set_public_access_block_configuration(mut self, input: ::std::option::Option<crate::types::PublicAccessBlockConfiguration>) -> Self {
234 self.inner = self.inner.set_public_access_block_configuration(input);
235 self
236 }
237 /// <p>The <code>PublicAccessBlock</code> configuration that you want to apply to the access point.</p>
238 pub fn get_public_access_block_configuration(&self) -> &::std::option::Option<crate::types::PublicAccessBlockConfiguration> {
239 self.inner.get_public_access_block_configuration()
240 }
241 /// <p>The Amazon Web Services account ID associated with the S3 bucket associated with this access point.</p>
242 /// <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>
243 pub fn bucket_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
244 self.inner = self.inner.bucket_account_id(input.into());
245 self
246 }
247 /// <p>The Amazon Web Services account ID associated with the S3 bucket associated with this access point.</p>
248 /// <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>
249 pub fn set_bucket_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250 self.inner = self.inner.set_bucket_account_id(input);
251 self
252 }
253 /// <p>The Amazon Web Services account ID associated with the S3 bucket associated with this access point.</p>
254 /// <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>
255 pub fn get_bucket_account_id(&self) -> &::std::option::Option<::std::string::String> {
256 self.inner.get_bucket_account_id()
257 }
258 /// <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>
259 /// <p>Scope is only supported for access points attached to directory buckets.</p>
260 /// </note>
261 pub fn scope(mut self, input: crate::types::Scope) -> Self {
262 self.inner = self.inner.scope(input);
263 self
264 }
265 /// <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>
266 /// <p>Scope is only supported for access points attached to directory buckets.</p>
267 /// </note>
268 pub fn set_scope(mut self, input: ::std::option::Option<crate::types::Scope>) -> Self {
269 self.inner = self.inner.set_scope(input);
270 self
271 }
272 /// <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>
273 /// <p>Scope is only supported for access points attached to directory buckets.</p>
274 /// </note>
275 pub fn get_scope(&self) -> &::std::option::Option<crate::types::Scope> {
276 self.inner.get_scope()
277 }
278 ///
279 /// Appends an item to `Tags`.
280 ///
281 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
282 ///
283 /// <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>
284 pub fn tags(mut self, input: crate::types::Tag) -> Self {
285 self.inner = self.inner.tags(input);
286 self
287 }
288 /// <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>
289 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
290 self.inner = self.inner.set_tags(input);
291 self
292 }
293 /// <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>
294 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
295 self.inner.get_tags()
296 }
297}