aws_sdk_glacier/operation/upload_multipart_part/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::upload_multipart_part::_upload_multipart_part_output::UploadMultipartPartOutputBuilder;
3
4pub use crate::operation::upload_multipart_part::_upload_multipart_part_input::UploadMultipartPartInputBuilder;
5
6impl crate::operation::upload_multipart_part::builders::UploadMultipartPartInputBuilder {
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_multipart_part::UploadMultipartPartOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::upload_multipart_part::UploadMultipartPartError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.upload_multipart_part();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UploadMultipartPart`.
24///
25/// <p>This operation uploads a part of an archive. You can upload archive parts in any order. You can also upload them in parallel. You can upload up to 10,000 parts for a multipart upload.</p>
26/// <p>Amazon Glacier rejects your upload part request if any of the following conditions is true:</p>
27/// <ul>
28/// <li>
29/// <p><b>SHA256 tree hash does not match</b>To ensure that part data is not corrupted in transmission, you compute a SHA256 tree hash of the part and include it in your request. Upon receiving the part data, Amazon S3 Glacier also computes a SHA256 tree hash. If these hash values don't match, the operation fails. For information about computing a SHA256 tree hash, see <a href="https://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html">Computing Checksums</a>.</p></li>
30/// <li>
31/// <p><b>Part size does not match</b>The size of each part except the last must match the size specified in the corresponding <code>InitiateMultipartUpload</code> request. The size of the last part must be the same size as, or smaller than, the specified size.</p><note>
32/// <p>If you upload a part whose size is smaller than the part size you specified in your initiate multipart upload request and that part is not the last part, then the upload part request will succeed. However, the subsequent Complete Multipart Upload request will fail.</p>
33/// </note></li>
34/// <li>
35/// <p><b>Range does not align</b>The byte range value in the request does not align with the part size specified in the corresponding initiate request. For example, if you specify a part size of 4194304 bytes (4 MB), then 0 to 4194303 bytes (4 MB - 1) and 4194304 (4 MB) to 8388607 (8 MB - 1) are valid part ranges. However, if you set a range value of 2 MB to 6 MB, the range does not align with the part size and the upload will fail.</p></li>
36/// </ul>
37/// <p>This operation is idempotent. If you upload the same part multiple times, the data included in the most recent request overwrites the previously uploaded data.</p>
38/// <p>An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM) users don't have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see <a href="https://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html">Access Control Using AWS Identity and Access Management (IAM)</a>.</p>
39/// <p>For conceptual information and underlying REST API, see <a href="https://docs.aws.amazon.com/amazonglacier/latest/dev/uploading-archive-mpu.html">Uploading Large Archives in Parts (Multipart Upload)</a> and <a href="https://docs.aws.amazon.com/amazonglacier/latest/dev/api-upload-part.html">Upload Part </a> in the <i>Amazon Glacier Developer Guide</i>.</p>
40#[derive(::std::fmt::Debug)]
41pub struct UploadMultipartPartFluentBuilder {
42    handle: ::std::sync::Arc<crate::client::Handle>,
43    inner: crate::operation::upload_multipart_part::builders::UploadMultipartPartInputBuilder,
44    config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl
47    crate::client::customize::internal::CustomizableSend<
48        crate::operation::upload_multipart_part::UploadMultipartPartOutput,
49        crate::operation::upload_multipart_part::UploadMultipartPartError,
50    > for UploadMultipartPartFluentBuilder
51{
52    fn send(
53        self,
54        config_override: crate::config::Builder,
55    ) -> crate::client::customize::internal::BoxFuture<
56        crate::client::customize::internal::SendResult<
57            crate::operation::upload_multipart_part::UploadMultipartPartOutput,
58            crate::operation::upload_multipart_part::UploadMultipartPartError,
59        >,
60    > {
61        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
62    }
63}
64impl UploadMultipartPartFluentBuilder {
65    /// Creates a new `UploadMultipartPartFluentBuilder`.
66    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
67        Self {
68            handle,
69            inner: ::std::default::Default::default(),
70            config_override: ::std::option::Option::None,
71        }
72    }
73    /// Access the UploadMultipartPart as a reference.
74    pub fn as_input(&self) -> &crate::operation::upload_multipart_part::builders::UploadMultipartPartInputBuilder {
75        &self.inner
76    }
77    /// Sends the request and returns the response.
78    ///
79    /// If an error occurs, an `SdkError` will be returned with additional details that
80    /// can be matched against.
81    ///
82    /// By default, any retryable failures will be retried twice. Retry behavior
83    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
84    /// set when configuring the client.
85    pub async fn send(
86        self,
87    ) -> ::std::result::Result<
88        crate::operation::upload_multipart_part::UploadMultipartPartOutput,
89        ::aws_smithy_runtime_api::client::result::SdkError<
90            crate::operation::upload_multipart_part::UploadMultipartPartError,
91            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
92        >,
93    > {
94        let input = self
95            .inner
96            .build()
97            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
98        let runtime_plugins = crate::operation::upload_multipart_part::UploadMultipartPart::operation_runtime_plugins(
99            self.handle.runtime_plugins.clone(),
100            &self.handle.conf,
101            self.config_override,
102        );
103        crate::operation::upload_multipart_part::UploadMultipartPart::orchestrate(&runtime_plugins, input).await
104    }
105
106    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
107    pub fn customize(
108        self,
109    ) -> crate::client::customize::CustomizableOperation<
110        crate::operation::upload_multipart_part::UploadMultipartPartOutput,
111        crate::operation::upload_multipart_part::UploadMultipartPartError,
112        Self,
113    > {
114        crate::client::customize::CustomizableOperation::new(self)
115    }
116    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
117        self.set_config_override(::std::option::Option::Some(config_override.into()));
118        self
119    }
120
121    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
122        self.config_override = config_override;
123        self
124    }
125    /// <p>The <code>AccountId</code> value is the AWS account ID of the account that owns the vault. You can either specify an AWS account ID or optionally a single '<code>-</code>' (hyphen), in which case Amazon S3 Glacier uses the AWS account ID associated with the credentials used to sign the request. If you use an account ID, do not include any hyphens ('-') in the ID.</p>
126    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.account_id(input.into());
128        self
129    }
130    /// <p>The <code>AccountId</code> value is the AWS account ID of the account that owns the vault. You can either specify an AWS account ID or optionally a single '<code>-</code>' (hyphen), in which case Amazon S3 Glacier uses the AWS account ID associated with the credentials used to sign the request. If you use an account ID, do not include any hyphens ('-') in the ID.</p>
131    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_account_id(input);
133        self
134    }
135    /// <p>The <code>AccountId</code> value is the AWS account ID of the account that owns the vault. You can either specify an AWS account ID or optionally a single '<code>-</code>' (hyphen), in which case Amazon S3 Glacier uses the AWS account ID associated with the credentials used to sign the request. If you use an account ID, do not include any hyphens ('-') in the ID.</p>
136    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_account_id()
138    }
139    /// <p>The name of the vault.</p>
140    pub fn vault_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.vault_name(input.into());
142        self
143    }
144    /// <p>The name of the vault.</p>
145    pub fn set_vault_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_vault_name(input);
147        self
148    }
149    /// <p>The name of the vault.</p>
150    pub fn get_vault_name(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_vault_name()
152    }
153    /// <p>The upload ID of the multipart upload.</p>
154    pub fn upload_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.upload_id(input.into());
156        self
157    }
158    /// <p>The upload ID of the multipart upload.</p>
159    pub fn set_upload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_upload_id(input);
161        self
162    }
163    /// <p>The upload ID of the multipart upload.</p>
164    pub fn get_upload_id(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_upload_id()
166    }
167    /// <p>The SHA256 tree hash of the data being uploaded.</p>
168    pub fn checksum(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.inner = self.inner.checksum(input.into());
170        self
171    }
172    /// <p>The SHA256 tree hash of the data being uploaded.</p>
173    pub fn set_checksum(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_checksum(input);
175        self
176    }
177    /// <p>The SHA256 tree hash of the data being uploaded.</p>
178    pub fn get_checksum(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_checksum()
180    }
181    /// <p>Identifies the range of bytes in the assembled archive that will be uploaded in this part. Amazon S3 Glacier uses this information to assemble the archive in the proper sequence. The format of this header follows RFC 2616. An example header is Content-Range:bytes 0-4194303/*.</p>
182    pub fn range(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.range(input.into());
184        self
185    }
186    /// <p>Identifies the range of bytes in the assembled archive that will be uploaded in this part. Amazon S3 Glacier uses this information to assemble the archive in the proper sequence. The format of this header follows RFC 2616. An example header is Content-Range:bytes 0-4194303/*.</p>
187    pub fn set_range(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_range(input);
189        self
190    }
191    /// <p>Identifies the range of bytes in the assembled archive that will be uploaded in this part. Amazon S3 Glacier uses this information to assemble the archive in the proper sequence. The format of this header follows RFC 2616. An example header is Content-Range:bytes 0-4194303/*.</p>
192    pub fn get_range(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_range()
194    }
195    /// <p>The data to upload.</p>
196    pub fn body(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
197        self.inner = self.inner.body(input);
198        self
199    }
200    /// <p>The data to upload.</p>
201    pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
202        self.inner = self.inner.set_body(input);
203        self
204    }
205    /// <p>The data to upload.</p>
206    pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
207        self.inner.get_body()
208    }
209}