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><important>
66/// <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>
67/// </important>
68#[derive(::std::clone::Clone, ::std::fmt::Debug)]
69pub struct AbortMultipartUploadFluentBuilder {
70    handle: ::std::sync::Arc<crate::client::Handle>,
71    inner: crate::operation::abort_multipart_upload::builders::AbortMultipartUploadInputBuilder,
72    config_override: ::std::option::Option<crate::config::Builder>,
73}
74impl
75    crate::client::customize::internal::CustomizableSend<
76        crate::operation::abort_multipart_upload::AbortMultipartUploadOutput,
77        crate::operation::abort_multipart_upload::AbortMultipartUploadError,
78    > for AbortMultipartUploadFluentBuilder
79{
80    fn send(
81        self,
82        config_override: crate::config::Builder,
83    ) -> crate::client::customize::internal::BoxFuture<
84        crate::client::customize::internal::SendResult<
85            crate::operation::abort_multipart_upload::AbortMultipartUploadOutput,
86            crate::operation::abort_multipart_upload::AbortMultipartUploadError,
87        >,
88    > {
89        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
90    }
91}
92impl AbortMultipartUploadFluentBuilder {
93    /// Creates a new `AbortMultipartUploadFluentBuilder`.
94    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
95        Self {
96            handle,
97            inner: ::std::default::Default::default(),
98            config_override: ::std::option::Option::None,
99        }
100    }
101    /// Access the AbortMultipartUpload as a reference.
102    pub fn as_input(&self) -> &crate::operation::abort_multipart_upload::builders::AbortMultipartUploadInputBuilder {
103        &self.inner
104    }
105    /// Sends the request and returns the response.
106    ///
107    /// If an error occurs, an `SdkError` will be returned with additional details that
108    /// can be matched against.
109    ///
110    /// By default, any retryable failures will be retried twice. Retry behavior
111    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
112    /// set when configuring the client.
113    pub async fn send(
114        self,
115    ) -> ::std::result::Result<
116        crate::operation::abort_multipart_upload::AbortMultipartUploadOutput,
117        ::aws_smithy_runtime_api::client::result::SdkError<
118            crate::operation::abort_multipart_upload::AbortMultipartUploadError,
119            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
120        >,
121    > {
122        let input = self
123            .inner
124            .build()
125            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
126        let runtime_plugins = crate::operation::abort_multipart_upload::AbortMultipartUpload::operation_runtime_plugins(
127            self.handle.runtime_plugins.clone(),
128            &self.handle.conf,
129            self.config_override,
130        );
131        crate::operation::abort_multipart_upload::AbortMultipartUpload::orchestrate(&runtime_plugins, input).await
132    }
133
134    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
135    pub fn customize(
136        self,
137    ) -> crate::client::customize::CustomizableOperation<
138        crate::operation::abort_multipart_upload::AbortMultipartUploadOutput,
139        crate::operation::abort_multipart_upload::AbortMultipartUploadError,
140        Self,
141    > {
142        crate::client::customize::CustomizableOperation::new(self)
143    }
144    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
145        self.set_config_override(::std::option::Option::Some(config_override.into()));
146        self
147    }
148
149    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
150        self.config_override = config_override;
151        self
152    }
153    /// <p>The bucket name to which the upload was taking place.</p>
154    /// <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>
155    /// <p><b>Access points</b> - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. 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>
156    /// <p>Object Lambda access points are not supported by directory buckets.</p>
157    /// </note>
158    /// <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>
159    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.inner = self.inner.bucket(input.into());
161        self
162    }
163    /// <p>The bucket name to which the upload was taking place.</p>
164    /// <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>
165    /// <p><b>Access points</b> - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. 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>
166    /// <p>Object Lambda access points are not supported by directory buckets.</p>
167    /// </note>
168    /// <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>
169    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_bucket(input);
171        self
172    }
173    /// <p>The bucket name to which the upload was taking place.</p>
174    /// <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>
175    /// <p><b>Access points</b> - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. 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>
176    /// <p>Object Lambda access points are not supported by directory buckets.</p>
177    /// </note>
178    /// <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>
179    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
180        self.inner.get_bucket()
181    }
182    /// <p>Key of the object for which the multipart upload was initiated.</p>
183    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.inner = self.inner.key(input.into());
185        self
186    }
187    /// <p>Key of the object for which the multipart upload was initiated.</p>
188    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189        self.inner = self.inner.set_key(input);
190        self
191    }
192    /// <p>Key of the object for which the multipart upload was initiated.</p>
193    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
194        self.inner.get_key()
195    }
196    /// <p>Upload ID that identifies the multipart upload.</p>
197    pub fn upload_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198        self.inner = self.inner.upload_id(input.into());
199        self
200    }
201    /// <p>Upload ID that identifies the multipart upload.</p>
202    pub fn set_upload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203        self.inner = self.inner.set_upload_id(input);
204        self
205    }
206    /// <p>Upload ID that identifies the multipart upload.</p>
207    pub fn get_upload_id(&self) -> &::std::option::Option<::std::string::String> {
208        self.inner.get_upload_id()
209    }
210    /// <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>
211    /// <p>This functionality is not supported for directory buckets.</p>
212    /// </note>
213    pub fn request_payer(mut self, input: crate::types::RequestPayer) -> Self {
214        self.inner = self.inner.request_payer(input);
215        self
216    }
217    /// <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>
218    /// <p>This functionality is not supported for directory buckets.</p>
219    /// </note>
220    pub fn set_request_payer(mut self, input: ::std::option::Option<crate::types::RequestPayer>) -> Self {
221        self.inner = self.inner.set_request_payer(input);
222        self
223    }
224    /// <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>
225    /// <p>This functionality is not supported for directory buckets.</p>
226    /// </note>
227    pub fn get_request_payer(&self) -> &::std::option::Option<crate::types::RequestPayer> {
228        self.inner.get_request_payer()
229    }
230    /// <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>
231    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232        self.inner = self.inner.expected_bucket_owner(input.into());
233        self
234    }
235    /// <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>
236    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
237        self.inner = self.inner.set_expected_bucket_owner(input);
238        self
239    }
240    /// <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>
241    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
242        self.inner.get_expected_bucket_owner()
243    }
244    /// <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>
245    /// <p>This functionality is only supported for directory buckets.</p>
246    /// </note>
247    pub fn if_match_initiated_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
248        self.inner = self.inner.if_match_initiated_time(input);
249        self
250    }
251    /// <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>
252    /// <p>This functionality is only supported for directory buckets.</p>
253    /// </note>
254    pub fn set_if_match_initiated_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
255        self.inner = self.inner.set_if_match_initiated_time(input);
256        self
257    }
258    /// <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>
259    /// <p>This functionality is only supported for directory buckets.</p>
260    /// </note>
261    pub fn get_if_match_initiated_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
262        self.inner.get_if_match_initiated_time()
263    }
264}