aws_sdk_s3/operation/abort_multipart_upload/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::abort_multipart_upload::_abort_multipart_upload_output::AbortMultipartUploadOutputBuilder;
3
4pub use crate::operation::abort_multipart_upload::_abort_multipart_upload_input::AbortMultipartUploadInputBuilder;
5
6impl crate::operation::abort_multipart_upload::builders::AbortMultipartUploadInputBuilder {
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::abort_multipart_upload::AbortMultipartUploadOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::abort_multipart_upload::AbortMultipartUploadError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.abort_multipart_upload();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `AbortMultipartUpload`.
24///
25/// <p>This operation aborts a multipart upload. After a multipart upload is aborted, no additional parts can be uploaded using that upload ID. The storage consumed by any previously uploaded parts will be freed. However, if any part uploads are currently in progress, those part uploads might or might not succeed. As a result, it might be necessary to abort a given multipart upload multiple times in order to completely free all storage consumed by all parts.</p>
26/// <p>To verify that all parts have been removed and prevent getting charged for the part storage, you should call the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html">ListParts</a> API operation and ensure that the parts list is empty.</p><note>
27/// <ul>
28/// <li>
29/// <p><b>Directory buckets</b> - If multipart uploads in a directory bucket are in progress, you can't delete the bucket until all the in-progress multipart uploads are aborted or completed. To delete these in-progress multipart uploads, use the <code>ListMultipartUploads</code> operation to list the in-progress multipart uploads in the bucket and use the <code>AbortMultipartUpload</code> operation to abort all the in-progress multipart uploads.</p></li>
30/// <li>
31/// <p><b>Directory buckets</b> - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format <code>https://<i>amzn-s3-demo-bucket</i>.s3express-<i>zone-id</i>.<i>region-code</i>.amazonaws.com/<i>key-name</i> </code>. Path-style requests are not supported. For more information about endpoints in Availability Zones, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/endpoint-directory-buckets-AZ.html">Regional and Zonal endpoints for directory buckets in Availability Zones</a> in the <i>Amazon S3 User Guide</i>. For more information about endpoints in Local Zones, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html">Concepts for directory buckets in Local Zones</a> in the <i>Amazon S3 User Guide</i>.</p></li>
32/// </ul>
33/// </note>
34/// <dl>
35/// <dt>
36/// Permissions
37/// </dt>
38/// <dd>
39/// <ul>
40/// <li>
41/// <p><b>General purpose bucket permissions</b> - For information about permissions required to use the multipart upload, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload and Permissions</a> in the <i>Amazon S3 User Guide</i>.</p></li>
42/// <li>
43/// <p><b>Directory bucket permissions</b> - To grant access to this API operation on a directory bucket, we recommend that you use the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html"> <code>CreateSession</code> </a> API operation for session-based authorization. Specifically, you grant the <code>s3express:CreateSession</code> permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the <code>CreateSession</code> API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another <code>CreateSession</code> API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html"> <code>CreateSession</code> </a>.</p></li>
44/// </ul>
45/// </dd>
46/// <dt>
47/// HTTP Host header syntax
48/// </dt>
49/// <dd>
50/// <p><b>Directory buckets </b> - The HTTP Host header syntax is <code> <i>Bucket-name</i>.s3express-<i>zone-id</i>.<i>region-code</i>.amazonaws.com</code>.</p>
51/// </dd>
52/// </dl>
53/// <p>The following operations are related to <code>AbortMultipartUpload</code>:</p>
54/// <ul>
55/// <li>
56/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html">CreateMultipartUpload</a></p></li>
57/// <li>
58/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html">UploadPart</a></p></li>
59/// <li>
60/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html">CompleteMultipartUpload</a></p></li>
61/// <li>
62/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html">ListParts</a></p></li>
63/// <li>
64/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html">ListMultipartUploads</a></p></li>
65/// </ul>
66#[derive(::std::clone::Clone, ::std::fmt::Debug)]
67pub struct AbortMultipartUploadFluentBuilder {
68    handle: ::std::sync::Arc<crate::client::Handle>,
69    inner: crate::operation::abort_multipart_upload::builders::AbortMultipartUploadInputBuilder,
70    config_override: ::std::option::Option<crate::config::Builder>,
71}
72impl
73    crate::client::customize::internal::CustomizableSend<
74        crate::operation::abort_multipart_upload::AbortMultipartUploadOutput,
75        crate::operation::abort_multipart_upload::AbortMultipartUploadError,
76    > for AbortMultipartUploadFluentBuilder
77{
78    fn send(
79        self,
80        config_override: crate::config::Builder,
81    ) -> crate::client::customize::internal::BoxFuture<
82        crate::client::customize::internal::SendResult<
83            crate::operation::abort_multipart_upload::AbortMultipartUploadOutput,
84            crate::operation::abort_multipart_upload::AbortMultipartUploadError,
85        >,
86    > {
87        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
88    }
89}
90impl AbortMultipartUploadFluentBuilder {
91    /// Creates a new `AbortMultipartUploadFluentBuilder`.
92    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
93        Self {
94            handle,
95            inner: ::std::default::Default::default(),
96            config_override: ::std::option::Option::None,
97        }
98    }
99    /// Access the AbortMultipartUpload as a reference.
100    pub fn as_input(&self) -> &crate::operation::abort_multipart_upload::builders::AbortMultipartUploadInputBuilder {
101        &self.inner
102    }
103    /// Sends the request and returns the response.
104    ///
105    /// If an error occurs, an `SdkError` will be returned with additional details that
106    /// can be matched against.
107    ///
108    /// By default, any retryable failures will be retried twice. Retry behavior
109    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
110    /// set when configuring the client.
111    pub async fn send(
112        self,
113    ) -> ::std::result::Result<
114        crate::operation::abort_multipart_upload::AbortMultipartUploadOutput,
115        ::aws_smithy_runtime_api::client::result::SdkError<
116            crate::operation::abort_multipart_upload::AbortMultipartUploadError,
117            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
118        >,
119    > {
120        let input = self
121            .inner
122            .build()
123            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
124        let runtime_plugins = crate::operation::abort_multipart_upload::AbortMultipartUpload::operation_runtime_plugins(
125            self.handle.runtime_plugins.clone(),
126            &self.handle.conf,
127            self.config_override,
128        );
129        crate::operation::abort_multipart_upload::AbortMultipartUpload::orchestrate(&runtime_plugins, input).await
130    }
131
132    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
133    pub fn customize(
134        self,
135    ) -> crate::client::customize::CustomizableOperation<
136        crate::operation::abort_multipart_upload::AbortMultipartUploadOutput,
137        crate::operation::abort_multipart_upload::AbortMultipartUploadError,
138        Self,
139    > {
140        crate::client::customize::CustomizableOperation::new(self)
141    }
142    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
143        self.set_config_override(::std::option::Option::Some(config_override.into()));
144        self
145    }
146
147    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
148        self.config_override = config_override;
149        self
150    }
151    /// <p>The bucket name to which the upload was taking place.</p>
152    /// <p><b>Directory buckets</b> - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format <code> <i>Bucket-name</i>.s3express-<i>zone-id</i>.<i>region-code</i>.amazonaws.com</code>. Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format <code> <i>bucket-base-name</i>--<i>zone-id</i>--x-s3</code> (for example, <code> <i>amzn-s3-demo-bucket</i>--<i>usw2-az1</i>--x-s3</code>). For information about bucket naming restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html">Directory bucket naming rules</a> in the <i>Amazon S3 User Guide</i>.</p>
153    /// <p><b>Access points</b> - When you use this action with an access point, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form <i>AccessPointName</i>-<i>AccountId</i>.s3-accesspoint.<i>Region</i>.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html">Using access points</a> in the <i>Amazon S3 User Guide</i>.</p><note>
154    /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
155    /// </note>
156    /// <p><b>S3 on Outposts</b> - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form <code> <i>AccessPointName</i>-<i>AccountId</i>.<i>outpostID</i>.s3-outposts.<i>Region</i>.amazonaws.com</code>. When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">What is S3 on Outposts?</a> in the <i>Amazon S3 User Guide</i>.</p>
157    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.bucket(input.into());
159        self
160    }
161    /// <p>The bucket name to which the upload was taking place.</p>
162    /// <p><b>Directory buckets</b> - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format <code> <i>Bucket-name</i>.s3express-<i>zone-id</i>.<i>region-code</i>.amazonaws.com</code>. Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format <code> <i>bucket-base-name</i>--<i>zone-id</i>--x-s3</code> (for example, <code> <i>amzn-s3-demo-bucket</i>--<i>usw2-az1</i>--x-s3</code>). For information about bucket naming restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html">Directory bucket naming rules</a> in the <i>Amazon S3 User Guide</i>.</p>
163    /// <p><b>Access points</b> - When you use this action with an access point, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form <i>AccessPointName</i>-<i>AccountId</i>.s3-accesspoint.<i>Region</i>.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html">Using access points</a> in the <i>Amazon S3 User Guide</i>.</p><note>
164    /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
165    /// </note>
166    /// <p><b>S3 on Outposts</b> - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form <code> <i>AccessPointName</i>-<i>AccountId</i>.<i>outpostID</i>.s3-outposts.<i>Region</i>.amazonaws.com</code>. When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">What is S3 on Outposts?</a> in the <i>Amazon S3 User Guide</i>.</p>
167    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_bucket(input);
169        self
170    }
171    /// <p>The bucket name to which the upload was taking place.</p>
172    /// <p><b>Directory buckets</b> - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format <code> <i>Bucket-name</i>.s3express-<i>zone-id</i>.<i>region-code</i>.amazonaws.com</code>. Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format <code> <i>bucket-base-name</i>--<i>zone-id</i>--x-s3</code> (for example, <code> <i>amzn-s3-demo-bucket</i>--<i>usw2-az1</i>--x-s3</code>). For information about bucket naming restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html">Directory bucket naming rules</a> in the <i>Amazon S3 User Guide</i>.</p>
173    /// <p><b>Access points</b> - When you use this action with an access point, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form <i>AccessPointName</i>-<i>AccountId</i>.s3-accesspoint.<i>Region</i>.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html">Using access points</a> in the <i>Amazon S3 User Guide</i>.</p><note>
174    /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
175    /// </note>
176    /// <p><b>S3 on Outposts</b> - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form <code> <i>AccessPointName</i>-<i>AccountId</i>.<i>outpostID</i>.s3-outposts.<i>Region</i>.amazonaws.com</code>. When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">What is S3 on Outposts?</a> in the <i>Amazon S3 User Guide</i>.</p>
177    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
178        self.inner.get_bucket()
179    }
180    /// <p>Key of the object for which the multipart upload was initiated.</p>
181    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182        self.inner = self.inner.key(input.into());
183        self
184    }
185    /// <p>Key of the object for which the multipart upload was initiated.</p>
186    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187        self.inner = self.inner.set_key(input);
188        self
189    }
190    /// <p>Key of the object for which the multipart upload was initiated.</p>
191    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
192        self.inner.get_key()
193    }
194    /// <p>Upload ID that identifies the multipart upload.</p>
195    pub fn upload_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196        self.inner = self.inner.upload_id(input.into());
197        self
198    }
199    /// <p>Upload ID that identifies the multipart upload.</p>
200    pub fn set_upload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201        self.inner = self.inner.set_upload_id(input);
202        self
203    }
204    /// <p>Upload ID that identifies the multipart upload.</p>
205    pub fn get_upload_id(&self) -> &::std::option::Option<::std::string::String> {
206        self.inner.get_upload_id()
207    }
208    /// <p>Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html">Downloading Objects in Requester Pays Buckets</a> in the <i>Amazon S3 User Guide</i>.</p><note>
209    /// <p>This functionality is not supported for directory buckets.</p>
210    /// </note>
211    pub fn request_payer(mut self, input: crate::types::RequestPayer) -> Self {
212        self.inner = self.inner.request_payer(input);
213        self
214    }
215    /// <p>Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html">Downloading Objects in Requester Pays Buckets</a> in the <i>Amazon S3 User Guide</i>.</p><note>
216    /// <p>This functionality is not supported for directory buckets.</p>
217    /// </note>
218    pub fn set_request_payer(mut self, input: ::std::option::Option<crate::types::RequestPayer>) -> Self {
219        self.inner = self.inner.set_request_payer(input);
220        self
221    }
222    /// <p>Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html">Downloading Objects in Requester Pays Buckets</a> in the <i>Amazon S3 User Guide</i>.</p><note>
223    /// <p>This functionality is not supported for directory buckets.</p>
224    /// </note>
225    pub fn get_request_payer(&self) -> &::std::option::Option<crate::types::RequestPayer> {
226        self.inner.get_request_payer()
227    }
228    /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
229    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230        self.inner = self.inner.expected_bucket_owner(input.into());
231        self
232    }
233    /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
234    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235        self.inner = self.inner.set_expected_bucket_owner(input);
236        self
237    }
238    /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
239    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
240        self.inner.get_expected_bucket_owner()
241    }
242    /// <p>If present, this header aborts an in progress multipart upload only if it was initiated on the provided timestamp. If the initiated timestamp of the multipart upload does not match the provided value, the operation returns a <code>412 Precondition Failed</code> error. If the initiated timestamp matches or if the multipart upload doesn’t exist, the operation returns a <code>204 Success (No Content)</code> response.</p><note>
243    /// <p>This functionality is only supported for directory buckets.</p>
244    /// </note>
245    pub fn if_match_initiated_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
246        self.inner = self.inner.if_match_initiated_time(input);
247        self
248    }
249    /// <p>If present, this header aborts an in progress multipart upload only if it was initiated on the provided timestamp. If the initiated timestamp of the multipart upload does not match the provided value, the operation returns a <code>412 Precondition Failed</code> error. If the initiated timestamp matches or if the multipart upload doesn’t exist, the operation returns a <code>204 Success (No Content)</code> response.</p><note>
250    /// <p>This functionality is only supported for directory buckets.</p>
251    /// </note>
252    pub fn set_if_match_initiated_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
253        self.inner = self.inner.set_if_match_initiated_time(input);
254        self
255    }
256    /// <p>If present, this header aborts an in progress multipart upload only if it was initiated on the provided timestamp. If the initiated timestamp of the multipart upload does not match the provided value, the operation returns a <code>412 Precondition Failed</code> error. If the initiated timestamp matches or if the multipart upload doesn’t exist, the operation returns a <code>204 Success (No Content)</code> response.</p><note>
257    /// <p>This functionality is only supported for directory buckets.</p>
258    /// </note>
259    pub fn get_if_match_initiated_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
260        self.inner.get_if_match_initiated_time()
261    }
262}