aws_sdk_s3/operation/upload_part/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::upload_part::_upload_part_output::UploadPartOutputBuilder;
3
4pub use crate::operation::upload_part::_upload_part_input::UploadPartInputBuilder;
5
6impl crate::operation::upload_part::builders::UploadPartInputBuilder {
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::upload_part::UploadPartOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::upload_part::UploadPartError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.upload_part();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UploadPart`.
24///
25/// <p>Uploads a part in a multipart upload.</p><note>
26/// <p>In this operation, you provide new data as a part of an object in your request. However, you have an option to specify your existing Amazon S3 object as a data source for the part you are uploading. To upload a part from an existing object, you use the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html">UploadPartCopy</a> operation.</p>
27/// </note>
28/// <p>You must initiate a multipart upload (see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html">CreateMultipartUpload</a>) before you can upload any part. In response to your initiate request, Amazon S3 returns an upload ID, a unique identifier that you must include in your upload part request.</p>
29/// <p>Part numbers can be any number from 1 to 10,000, inclusive. A part number uniquely identifies a part and also defines its position within the object being created. If you upload a new part using the same part number that was used with a previous part, the previously uploaded part is overwritten.</p>
30/// <p>For information about maximum and minimum part sizes and other multipart upload specifications, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html">Multipart upload limits</a> in the <i>Amazon S3 User Guide</i>.</p><note>
31/// <p>After you initiate multipart upload and upload one or more parts, you must either complete or abort multipart upload in order to stop getting charged for storage of the uploaded parts. Only after you either complete or abort multipart upload, Amazon S3 frees up the parts storage and stops charging you for the parts storage.</p>
32/// </note>
33/// <p>For more information on multipart uploads, go to <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html">Multipart Upload Overview</a> in the <i>Amazon S3 User Guide </i>.</p><note>
34/// <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>bucket_name</i>.s3express-<i>az_id</i>.<i>region</i>.amazonaws.com/<i>key-name</i> </code>. Path-style requests are not supported. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html">Regional and Zonal endpoints</a> in the <i>Amazon S3 User Guide</i>.</p>
35/// </note>
36/// <dl>
37/// <dt>
38/// Permissions
39/// </dt>
40/// <dd>
41/// <ul>
42/// <li>
43/// <p><b>General purpose bucket permissions</b> - To perform a multipart upload with encryption using an Key Management Service key, the requester must have permission to the <code>kms:Decrypt</code> and <code>kms:GenerateDataKey</code> actions on the key. The requester must also have permissions for the <code>kms:GenerateDataKey</code> action for the <code>CreateMultipartUpload</code> API. Then, the requester needs permissions for the <code>kms:Decrypt</code> action on the <code>UploadPart</code> and <code>UploadPartCopy</code> APIs.</p>
44/// <p>These permissions are required because Amazon S3 must decrypt and read data from the encrypted file parts before it completes the multipart upload. For more information about KMS permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html">Protecting data using server-side encryption with KMS</a> in the <i>Amazon S3 User Guide</i>. For information about the permissions required to use the multipart upload API, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart upload and permissions</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions">Multipart upload API and permissions</a> in the <i>Amazon S3 User Guide</i>.</p></li>
45/// <li>
46/// <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>
47/// </ul>
48/// </dd>
49/// <dt>
50/// Data integrity
51/// </dt>
52/// <dd>
53/// <p><b>General purpose bucket</b> - To ensure that data is not corrupted traversing the network, specify the <code>Content-MD5</code> header in the upload part request. Amazon S3 checks the part data against the provided MD5 value. If they do not match, Amazon S3 returns an error. If the upload request is signed with Signature Version 4, then Amazon Web Services S3 uses the <code>x-amz-content-sha256</code> header as a checksum instead of <code>Content-MD5</code>. For more information see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html">Authenticating Requests: Using the Authorization Header (Amazon Web Services Signature Version 4)</a>.</p><note>
54/// <p><b>Directory buckets</b> - MD5 is not supported by directory buckets. You can use checksum algorithms to check object integrity.</p>
55/// </note>
56/// </dd>
57/// <dt>
58/// Encryption
59/// </dt>
60/// <dd>
61/// <ul>
62/// <li>
63/// <p><b>General purpose bucket</b> - Server-side encryption is for data encryption at rest. Amazon S3 encrypts your data as it writes it to disks in its data centers and decrypts it when you access it. You have mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS), and Customer-Provided Keys (SSE-C). Amazon S3 encrypts data with server-side encryption using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest using server-side encryption with other key options. The option you use depends on whether you want to use KMS keys (SSE-KMS) or provide your own encryption key (SSE-C).</p>
64/// <p>Server-side encryption is supported by the S3 Multipart Upload operations. Unless you are using a customer-provided encryption key (SSE-C), you don't need to specify the encryption parameters in each UploadPart request. Instead, you only need to specify the server-side encryption parameters in the initial Initiate Multipart request. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html">CreateMultipartUpload</a>.</p>
65/// <p>If you request server-side encryption using a customer-provided encryption key (SSE-C) in your initiate multipart upload request, you must provide identical encryption information in each part upload using the following request headers.</p>
66/// <ul>
67/// <li>
68/// <p>x-amz-server-side-encryption-customer-algorithm</p></li>
69/// <li>
70/// <p>x-amz-server-side-encryption-customer-key</p></li>
71/// <li>
72/// <p>x-amz-server-side-encryption-customer-key-MD5</p></li>
73/// </ul></li>
74/// <li>
75/// <p><b>Directory bucket</b> - For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (<code>AES256</code>) is supported.</p></li>
76/// </ul>
77/// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html">Using Server-Side Encryption</a> in the <i>Amazon S3 User Guide</i>.</p>
78/// </dd>
79/// <dt>
80/// Special errors
81/// </dt>
82/// <dd>
83/// <ul>
84/// <li>
85/// <p>Error Code: <code>NoSuchUpload</code></p>
86/// <ul>
87/// <li>
88/// <p>Description: The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.</p></li>
89/// <li>
90/// <p>HTTP Status Code: 404 Not Found</p></li>
91/// <li>
92/// <p>SOAP Fault Code Prefix: Client</p></li>
93/// </ul></li>
94/// </ul>
95/// </dd>
96/// <dt>
97/// HTTP Host header syntax
98/// </dt>
99/// <dd>
100/// <p><b>Directory buckets </b> - The HTTP Host header syntax is <code> <i>Bucket_name</i>.s3express-<i>az_id</i>.<i>region</i>.amazonaws.com</code>.</p>
101/// </dd>
102/// </dl>
103/// <p>The following operations are related to <code>UploadPart</code>:</p>
104/// <ul>
105/// <li>
106/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html">CreateMultipartUpload</a></p></li>
107/// <li>
108/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html">CompleteMultipartUpload</a></p></li>
109/// <li>
110/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html">AbortMultipartUpload</a></p></li>
111/// <li>
112/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html">ListParts</a></p></li>
113/// <li>
114/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html">ListMultipartUploads</a></p></li>
115/// </ul>
116#[derive(::std::fmt::Debug)]
117pub struct UploadPartFluentBuilder {
118    handle: ::std::sync::Arc<crate::client::Handle>,
119    inner: crate::operation::upload_part::builders::UploadPartInputBuilder,
120    config_override: ::std::option::Option<crate::config::Builder>,
121}
122impl
123    crate::client::customize::internal::CustomizableSend<
124        crate::operation::upload_part::UploadPartOutput,
125        crate::operation::upload_part::UploadPartError,
126    > for UploadPartFluentBuilder
127{
128    fn send(
129        self,
130        config_override: crate::config::Builder,
131    ) -> crate::client::customize::internal::BoxFuture<
132        crate::client::customize::internal::SendResult<
133            crate::operation::upload_part::UploadPartOutput,
134            crate::operation::upload_part::UploadPartError,
135        >,
136    > {
137        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
138    }
139}
140impl UploadPartFluentBuilder {
141    /// Creates a new `UploadPartFluentBuilder`.
142    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
143        Self {
144            handle,
145            inner: ::std::default::Default::default(),
146            config_override: ::std::option::Option::None,
147        }
148    }
149    /// Access the UploadPart as a reference.
150    pub fn as_input(&self) -> &crate::operation::upload_part::builders::UploadPartInputBuilder {
151        &self.inner
152    }
153    /// Sends the request and returns the response.
154    ///
155    /// If an error occurs, an `SdkError` will be returned with additional details that
156    /// can be matched against.
157    ///
158    /// By default, any retryable failures will be retried twice. Retry behavior
159    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
160    /// set when configuring the client.
161    pub async fn send(
162        self,
163    ) -> ::std::result::Result<
164        crate::operation::upload_part::UploadPartOutput,
165        ::aws_smithy_runtime_api::client::result::SdkError<
166            crate::operation::upload_part::UploadPartError,
167            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
168        >,
169    > {
170        let input = self
171            .inner
172            .build()
173            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
174        let runtime_plugins = crate::operation::upload_part::UploadPart::operation_runtime_plugins(
175            self.handle.runtime_plugins.clone(),
176            &self.handle.conf,
177            self.config_override,
178        );
179        crate::operation::upload_part::UploadPart::orchestrate(&runtime_plugins, input).await
180    }
181
182    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
183    pub fn customize(
184        self,
185    ) -> crate::client::customize::CustomizableOperation<
186        crate::operation::upload_part::UploadPartOutput,
187        crate::operation::upload_part::UploadPartError,
188        Self,
189    > {
190        crate::client::customize::CustomizableOperation::new(self)
191    }
192    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
193        self.set_config_override(::std::option::Option::Some(config_override.into()));
194        self
195    }
196
197    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
198        self.config_override = config_override;
199        self
200    }
201    ///
202    /// Creates a presigned request for this operation.
203    ///
204    /// The `presigning_config` provides additional presigning-specific config values, such as the
205    /// amount of time the request should be valid for after creation.
206    ///
207    /// Presigned requests can be given to other users or applications to access a resource or perform
208    /// an operation without having access to the AWS security credentials.
209    ///
210    /// _Important:_ If you're using credentials that can expire, such as those from STS AssumeRole or SSO, then
211    /// the presigned request can only be valid for as long as the credentials used to create it are.
212    ///
213    #[allow(unused_mut)]
214    pub async fn presigned(
215        mut self,
216        presigning_config: crate::presigning::PresigningConfig,
217    ) -> ::std::result::Result<
218        crate::presigning::PresignedRequest,
219        ::aws_smithy_runtime_api::client::result::SdkError<
220            crate::operation::upload_part::UploadPartError,
221            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
222        >,
223    > {
224        let runtime_plugins = crate::operation::upload_part::UploadPart::operation_runtime_plugins(
225            self.handle.runtime_plugins.clone(),
226            &self.handle.conf,
227            self.config_override,
228        )
229        .with_client_plugin(crate::presigning_interceptors::SigV4PresigningRuntimePlugin::new(
230            presigning_config,
231            ::aws_sigv4::http_request::SignableBody::UnsignedPayload,
232        ));
233
234        let input = self
235            .inner
236            .build()
237            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
238        let mut context = crate::operation::upload_part::UploadPart::orchestrate_with_stop_point(
239            &runtime_plugins,
240            input,
241            ::aws_smithy_runtime::client::orchestrator::StopPoint::BeforeTransmit,
242        )
243        .await
244        .map_err(|err| {
245            err.map_service_error(|err| {
246                err.downcast::<crate::operation::upload_part::UploadPartError>()
247                    .expect("correct error type")
248            })
249        })?;
250        let request = context.take_request().expect("request set before transmit");
251        crate::presigning::PresignedRequest::new(request).map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)
252    }
253    /// <p>Object data.</p>
254    pub fn body(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
255        self.inner = self.inner.body(input);
256        self
257    }
258    /// <p>Object data.</p>
259    pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
260        self.inner = self.inner.set_body(input);
261        self
262    }
263    /// <p>Object data.</p>
264    pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
265        self.inner.get_body()
266    }
267    /// <p>The name of the bucket to which the multipart upload was initiated.</p>
268    /// <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>az_id</i>.<i>region</i>.amazonaws.com</code>. Path-style requests are not supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must follow the format <code> <i>bucket_base_name</i>--<i>az-id</i>--x-s3</code> (for example, <code> <i>DOC-EXAMPLE-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>
269    /// <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>
270    /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
271    /// </note>
272    /// <p><b>S3 on Outposts</b> - When you use this action with Amazon 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 through the Amazon Web Services SDKs, you provide the Outposts access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, 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>
273    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
274        self.inner = self.inner.bucket(input.into());
275        self
276    }
277    /// <p>The name of the bucket to which the multipart upload was initiated.</p>
278    /// <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>az_id</i>.<i>region</i>.amazonaws.com</code>. Path-style requests are not supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must follow the format <code> <i>bucket_base_name</i>--<i>az-id</i>--x-s3</code> (for example, <code> <i>DOC-EXAMPLE-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>
279    /// <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>
280    /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
281    /// </note>
282    /// <p><b>S3 on Outposts</b> - When you use this action with Amazon 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 through the Amazon Web Services SDKs, you provide the Outposts access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, 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>
283    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
284        self.inner = self.inner.set_bucket(input);
285        self
286    }
287    /// <p>The name of the bucket to which the multipart upload was initiated.</p>
288    /// <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>az_id</i>.<i>region</i>.amazonaws.com</code>. Path-style requests are not supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must follow the format <code> <i>bucket_base_name</i>--<i>az-id</i>--x-s3</code> (for example, <code> <i>DOC-EXAMPLE-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>
289    /// <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>
290    /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
291    /// </note>
292    /// <p><b>S3 on Outposts</b> - When you use this action with Amazon 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 through the Amazon Web Services SDKs, you provide the Outposts access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, 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>
293    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
294        self.inner.get_bucket()
295    }
296    /// <p>Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically.</p>
297    pub fn content_length(mut self, input: i64) -> Self {
298        self.inner = self.inner.content_length(input);
299        self
300    }
301    /// <p>Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically.</p>
302    pub fn set_content_length(mut self, input: ::std::option::Option<i64>) -> Self {
303        self.inner = self.inner.set_content_length(input);
304        self
305    }
306    /// <p>Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically.</p>
307    pub fn get_content_length(&self) -> &::std::option::Option<i64> {
308        self.inner.get_content_length()
309    }
310    /// <p>The base64-encoded 128-bit MD5 digest of the part data. This parameter is auto-populated when using the command from the CLI. This parameter is required if object lock parameters are specified.</p><note>
311    /// <p>This functionality is not supported for directory buckets.</p>
312    /// </note>
313    pub fn content_md5(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
314        self.inner = self.inner.content_md5(input.into());
315        self
316    }
317    /// <p>The base64-encoded 128-bit MD5 digest of the part data. This parameter is auto-populated when using the command from the CLI. This parameter is required if object lock parameters are specified.</p><note>
318    /// <p>This functionality is not supported for directory buckets.</p>
319    /// </note>
320    pub fn set_content_md5(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
321        self.inner = self.inner.set_content_md5(input);
322        self
323    }
324    /// <p>The base64-encoded 128-bit MD5 digest of the part data. This parameter is auto-populated when using the command from the CLI. This parameter is required if object lock parameters are specified.</p><note>
325    /// <p>This functionality is not supported for directory buckets.</p>
326    /// </note>
327    pub fn get_content_md5(&self) -> &::std::option::Option<::std::string::String> {
328        self.inner.get_content_md5()
329    }
330    /// <p>Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding <code>x-amz-checksum</code> or <code>x-amz-trailer</code> header sent. Otherwise, Amazon S3 fails the request with the HTTP status code <code>400 Bad Request</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
331    /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
332    /// <p>This checksum algorithm must be the same for all parts and it match the checksum value supplied in the <code>CreateMultipartUpload</code> request.</p>
333    pub fn checksum_algorithm(mut self, input: crate::types::ChecksumAlgorithm) -> Self {
334        self.inner = self.inner.checksum_algorithm(input);
335        self
336    }
337    /// <p>Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding <code>x-amz-checksum</code> or <code>x-amz-trailer</code> header sent. Otherwise, Amazon S3 fails the request with the HTTP status code <code>400 Bad Request</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
338    /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
339    /// <p>This checksum algorithm must be the same for all parts and it match the checksum value supplied in the <code>CreateMultipartUpload</code> request.</p>
340    pub fn set_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::ChecksumAlgorithm>) -> Self {
341        self.inner = self.inner.set_checksum_algorithm(input);
342        self
343    }
344    /// <p>Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding <code>x-amz-checksum</code> or <code>x-amz-trailer</code> header sent. Otherwise, Amazon S3 fails the request with the HTTP status code <code>400 Bad Request</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
345    /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
346    /// <p>This checksum algorithm must be the same for all parts and it match the checksum value supplied in the <code>CreateMultipartUpload</code> request.</p>
347    pub fn get_checksum_algorithm(&self) -> &::std::option::Option<crate::types::ChecksumAlgorithm> {
348        self.inner.get_checksum_algorithm()
349    }
350    /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32 checksum of the object. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
351    pub fn checksum_crc32(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
352        self.inner = self.inner.checksum_crc32(input.into());
353        self
354    }
355    /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32 checksum of the object. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
356    pub fn set_checksum_crc32(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
357        self.inner = self.inner.set_checksum_crc32(input);
358        self
359    }
360    /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32 checksum of the object. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
361    pub fn get_checksum_crc32(&self) -> &::std::option::Option<::std::string::String> {
362        self.inner.get_checksum_crc32()
363    }
364    /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32C checksum of the object. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
365    pub fn checksum_crc32_c(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
366        self.inner = self.inner.checksum_crc32_c(input.into());
367        self
368    }
369    /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32C checksum of the object. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
370    pub fn set_checksum_crc32_c(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
371        self.inner = self.inner.set_checksum_crc32_c(input);
372        self
373    }
374    /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32C checksum of the object. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
375    pub fn get_checksum_crc32_c(&self) -> &::std::option::Option<::std::string::String> {
376        self.inner.get_checksum_crc32_c()
377    }
378    /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 160-bit SHA-1 digest of the object. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
379    pub fn checksum_sha1(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
380        self.inner = self.inner.checksum_sha1(input.into());
381        self
382    }
383    /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 160-bit SHA-1 digest of the object. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
384    pub fn set_checksum_sha1(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
385        self.inner = self.inner.set_checksum_sha1(input);
386        self
387    }
388    /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 160-bit SHA-1 digest of the object. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
389    pub fn get_checksum_sha1(&self) -> &::std::option::Option<::std::string::String> {
390        self.inner.get_checksum_sha1()
391    }
392    /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the object. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
393    pub fn checksum_sha256(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
394        self.inner = self.inner.checksum_sha256(input.into());
395        self
396    }
397    /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the object. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
398    pub fn set_checksum_sha256(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
399        self.inner = self.inner.set_checksum_sha256(input);
400        self
401    }
402    /// <p>This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the object. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
403    pub fn get_checksum_sha256(&self) -> &::std::option::Option<::std::string::String> {
404        self.inner.get_checksum_sha256()
405    }
406    /// <p>Object key for which the multipart upload was initiated.</p>
407    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
408        self.inner = self.inner.key(input.into());
409        self
410    }
411    /// <p>Object key for which the multipart upload was initiated.</p>
412    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
413        self.inner = self.inner.set_key(input);
414        self
415    }
416    /// <p>Object key for which the multipart upload was initiated.</p>
417    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
418        self.inner.get_key()
419    }
420    /// <p>Part number of part being uploaded. This is a positive integer between 1 and 10,000.</p>
421    pub fn part_number(mut self, input: i32) -> Self {
422        self.inner = self.inner.part_number(input);
423        self
424    }
425    /// <p>Part number of part being uploaded. This is a positive integer between 1 and 10,000.</p>
426    pub fn set_part_number(mut self, input: ::std::option::Option<i32>) -> Self {
427        self.inner = self.inner.set_part_number(input);
428        self
429    }
430    /// <p>Part number of part being uploaded. This is a positive integer between 1 and 10,000.</p>
431    pub fn get_part_number(&self) -> &::std::option::Option<i32> {
432        self.inner.get_part_number()
433    }
434    /// <p>Upload ID identifying the multipart upload whose part is being uploaded.</p>
435    pub fn upload_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
436        self.inner = self.inner.upload_id(input.into());
437        self
438    }
439    /// <p>Upload ID identifying the multipart upload whose part is being uploaded.</p>
440    pub fn set_upload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
441        self.inner = self.inner.set_upload_id(input);
442        self
443    }
444    /// <p>Upload ID identifying the multipart upload whose part is being uploaded.</p>
445    pub fn get_upload_id(&self) -> &::std::option::Option<::std::string::String> {
446        self.inner.get_upload_id()
447    }
448    /// <p>Specifies the algorithm to use when encrypting the object (for example, AES256).</p><note>
449    /// <p>This functionality is not supported for directory buckets.</p>
450    /// </note>
451    pub fn sse_customer_algorithm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
452        self.inner = self.inner.sse_customer_algorithm(input.into());
453        self
454    }
455    /// <p>Specifies the algorithm to use when encrypting the object (for example, AES256).</p><note>
456    /// <p>This functionality is not supported for directory buckets.</p>
457    /// </note>
458    pub fn set_sse_customer_algorithm(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
459        self.inner = self.inner.set_sse_customer_algorithm(input);
460        self
461    }
462    /// <p>Specifies the algorithm to use when encrypting the object (for example, AES256).</p><note>
463    /// <p>This functionality is not supported for directory buckets.</p>
464    /// </note>
465    pub fn get_sse_customer_algorithm(&self) -> &::std::option::Option<::std::string::String> {
466        self.inner.get_sse_customer_algorithm()
467    }
468    /// <p>Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the <code>x-amz-server-side-encryption-customer-algorithm header</code>. This must be the same encryption key specified in the initiate multipart upload request.</p><note>
469    /// <p>This functionality is not supported for directory buckets.</p>
470    /// </note>
471    pub fn sse_customer_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
472        self.inner = self.inner.sse_customer_key(input.into());
473        self
474    }
475    /// <p>Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the <code>x-amz-server-side-encryption-customer-algorithm header</code>. This must be the same encryption key specified in the initiate multipart upload request.</p><note>
476    /// <p>This functionality is not supported for directory buckets.</p>
477    /// </note>
478    pub fn set_sse_customer_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
479        self.inner = self.inner.set_sse_customer_key(input);
480        self
481    }
482    /// <p>Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the <code>x-amz-server-side-encryption-customer-algorithm header</code>. This must be the same encryption key specified in the initiate multipart upload request.</p><note>
483    /// <p>This functionality is not supported for directory buckets.</p>
484    /// </note>
485    pub fn get_sse_customer_key(&self) -> &::std::option::Option<::std::string::String> {
486        self.inner.get_sse_customer_key()
487    }
488    /// <p>Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.</p><note>
489    /// <p>This functionality is not supported for directory buckets.</p>
490    /// </note>
491    pub fn sse_customer_key_md5(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
492        self.inner = self.inner.sse_customer_key_md5(input.into());
493        self
494    }
495    /// <p>Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.</p><note>
496    /// <p>This functionality is not supported for directory buckets.</p>
497    /// </note>
498    pub fn set_sse_customer_key_md5(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
499        self.inner = self.inner.set_sse_customer_key_md5(input);
500        self
501    }
502    /// <p>Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.</p><note>
503    /// <p>This functionality is not supported for directory buckets.</p>
504    /// </note>
505    pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> {
506        self.inner.get_sse_customer_key_md5()
507    }
508    /// <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>
509    /// <p>This functionality is not supported for directory buckets.</p>
510    /// </note>
511    pub fn request_payer(mut self, input: crate::types::RequestPayer) -> Self {
512        self.inner = self.inner.request_payer(input);
513        self
514    }
515    /// <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>
516    /// <p>This functionality is not supported for directory buckets.</p>
517    /// </note>
518    pub fn set_request_payer(mut self, input: ::std::option::Option<crate::types::RequestPayer>) -> Self {
519        self.inner = self.inner.set_request_payer(input);
520        self
521    }
522    /// <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>
523    /// <p>This functionality is not supported for directory buckets.</p>
524    /// </note>
525    pub fn get_request_payer(&self) -> &::std::option::Option<crate::types::RequestPayer> {
526        self.inner.get_request_payer()
527    }
528    /// <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>
529    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
530        self.inner = self.inner.expected_bucket_owner(input.into());
531        self
532    }
533    /// <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>
534    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
535        self.inner = self.inner.set_expected_bucket_owner(input);
536        self
537    }
538    /// <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>
539    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
540        self.inner.get_expected_bucket_owner()
541    }
542}
543
544impl crate::client::customize::internal::CustomizablePresigned<crate::operation::upload_part::UploadPartError> for UploadPartFluentBuilder {
545    fn presign(
546        self,
547        config_override: crate::config::Builder,
548        presigning_config: crate::presigning::PresigningConfig,
549    ) -> crate::client::customize::internal::BoxFuture<
550        crate::client::customize::internal::SendResult<crate::presigning::PresignedRequest, crate::operation::upload_part::UploadPartError>,
551    > {
552        ::std::boxed::Box::pin(async move { self.config_override(config_override).presigned(presigning_config).await })
553    }
554}