/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.S3.Model
{
///
/// Container for the parameters to the CompleteMultipartUpload operation.
/// Completes a multipart upload by assembling previously uploaded parts.
///
///
///
/// You first initiate the multipart upload and then upload all parts using the UploadPart
/// operation. After successfully uploading all relevant parts of an upload, you call
/// this action to complete the upload. Upon receiving this request, Amazon S3 concatenates
/// all the parts in ascending order by part number to create a new object. In the Complete
/// Multipart Upload request, you must provide the parts list. You must ensure that the
/// parts list is complete. This action concatenates the parts that you provide in the
/// list. For each part in the list, you must provide the part number and the ETag
/// value, returned after that part was uploaded.
///
///
///
/// Processing of a Complete Multipart Upload request could take several minutes to complete.
/// After Amazon S3 begins processing the request, it sends an HTTP response header that
/// specifies a 200 OK response. While processing is in progress, Amazon S3 periodically
/// sends white space characters to keep the connection from timing out. Because a request
/// could fail after the initial 200 OK response has been sent, it is important that you
/// check the response body to determine whether the request succeeded.
///
///
///
/// Note that if CompleteMultipartUpload
fails, applications should be prepared
/// to retry the failed requests. For more information, see Amazon
/// S3 Error Best Practices.
///
///
///
/// You cannot use Content-Type: application/x-www-form-urlencode
with Complete
/// Multipart Upload requests. It is not allowed by the Amazon S3. Also, if
/// you do not provide a Content-Type
header, CompleteMultipartUpload
/// returns a 200 OK response.
///
///
///
/// For more information about multipart uploads, see Uploading
/// Objects Using Multipart Upload.
///
///
///
/// For information about permissions required to use the multipart upload API, see Multipart
/// Upload and Permissions.
///
///
///
/// CompleteMultipartUpload
has the following special errors:
///
/// -
///
/// Error code:
EntityTooSmall
///
/// -
///
/// Description: Your proposed upload is smaller than the minimum allowed object size.
/// Each part must be at least 5 MB in size, except the last part.
///
///
-
///
/// 400 Bad Request
///
///
-
///
/// Error code:
InvalidPart
///
/// -
///
/// Description: One or more of the specified parts could not be found. The part might
/// not have been uploaded, or the specified entity tag might not have matched the part's
/// entity tag.
///
///
-
///
/// 400 Bad Request
///
///
-
///
/// Error code:
InvalidPartOrder
///
/// -
///
/// Description: The list of parts was not in ascending order. The parts list must be
/// specified in order by part number.
///
///
-
///
/// 400 Bad Request
///
///
-
///
/// Error code:
NoSuchUpload
///
/// -
///
/// Description: The specified multipart upload does not exist. The upload ID might be
/// invalid, or the multipart upload might have been aborted or completed.
///
///
-
///
/// 404 Not Found
///
///
///
/// The following operations are related to CompleteMultipartUpload
:
///
///
///
public partial class CompleteMultipartUploadRequest : AmazonWebServiceRequest
{
private string bucketName;
private string _checksumCRC32;
private string _checksumCRC32C;
private string _checksumSHA1;
private string _checksumSHA256;
private string key;
private List partETags = new List();
private string uploadId;
private RequestPayer requestPayer;
private string _sseCustomerAlgorithm;
private string _sseCustomerKey;
private string _sseCustomerKeyMD5;
private string expectedBucketOwner;
///
/// Gets and sets the property BucketName.
///
/// Name of the bucket to which the multipart upload was initiated.
///
///
///
/// When using this action with an access point, you must direct requests to the access
/// point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.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 Using
/// access points in the Amazon S3 User Guide.
///
///
///
/// 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 AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com
.
/// 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 What
/// is S3 on Outposts? in the Amazon S3 User Guide.
///
///
public string BucketName
{
get { return this.bucketName; }
set { this.bucketName = value; }
}
// Check to see if BucketName property is set
internal bool IsSetBucketName()
{
return this.bucketName != null;
}
///
/// Gets and sets the property ChecksumCRC32.
///
/// 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 specifies the base64-encoded, 32-bit
/// CRC32 checksum of the object. For more information, see
/// Checking object integrity in the Amazon S3 User Guide.
///
///
public string ChecksumCRC32
{
get { return this._checksumCRC32; }
set { this._checksumCRC32 = value; }
}
// Check to see if ChecksumCRC32 property is set
internal bool IsSetChecksumCRC32()
{
return this._checksumCRC32 != null;
}
///
/// Gets and sets the property ChecksumCRC32C.
///
/// 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 specifies the base64-encoded, 32-bit
/// CRC32C checksum of the object. For more information, see
/// Checking object integrity in the Amazon S3 User Guide.
///
///
public string ChecksumCRC32C
{
get { return this._checksumCRC32C; }
set { this._checksumCRC32C = value; }
}
// Check to see if ChecksumCRC32C property is set
internal bool IsSetChecksumCRC32C()
{
return this._checksumCRC32C != null;
}
///
/// Gets and sets the property ChecksumSHA1.
///
/// 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 specifies the base64-encoded, 160-bit
/// SHA-1 digest of the object. For more information, see
/// Checking object integrity in the Amazon S3 User Guide.
///
///
public string ChecksumSHA1
{
get { return this._checksumSHA1; }
set { this._checksumSHA1 = value; }
}
// Check to see if ChecksumSHA1 property is set
internal bool IsSetChecksumSHA1()
{
return this._checksumSHA1 != null;
}
///
/// Gets and sets the property ChecksumSHA256.
///
/// 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 specifies the base64-encoded, 256-bit
/// SHA-256 digest of the object. For more information, see
/// Checking object integrity in the Amazon S3 User Guide.
///
///
public string ChecksumSHA256
{
get { return this._checksumSHA256; }
set { this._checksumSHA256 = value; }
}
// Check to see if ChecksumSHA256 property is set
internal bool IsSetChecksumSHA256()
{
return this._checksumSHA256 != null;
}
///
/// The account ID of the expected bucket owner.
/// If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
///
public string ExpectedBucketOwner
{
get { return this.expectedBucketOwner; }
set { this.expectedBucketOwner = value; }
}
///
/// Checks to see if ExpectedBucketOwner is set.
///
/// true, if ExpectedBucketOwner property is set.
internal bool IsSetExpectedBucketOwner()
{
return !String.IsNullOrEmpty(this.expectedBucketOwner);
}
///
/// The key of the S3 object that was being uploaded.
///
///
/// This property will be used as part of the resource path of the HTTP request. In .NET the System.Uri class
/// is used to construct the uri for the request. The System.Uri class will canonicalize the uri string by compacting characters like "..". /// For example an object key of "foo/../bar/file.txt" will be transformed into "bar/file.txt" because the ".."
/// is interpreted as use parent directory. For further information view the documentation for
/// the Uri class: https://docs.microsoft.com/en-us/dotnet/api/system.uri
///
public string Key
{
get { return this.key; }
set { this.key = value; }
}
// Check to see if Key property is set
internal bool IsSetKey()
{
return this.key != null;
}
///
/// A collection of part numbers and corresponding etags.
///
public List PartETags
{
get
{
if (this.partETags == null)
{
this.partETags = new List();
}
return this.partETags;
}
set { this.partETags = value; }
}
///
/// Adds a collection of part numbers and corresponding etags.
///
/// PartETags that will added to this request.
public void AddPartETags(params PartETag[] partETags)
{
foreach (PartETag part in partETags)
{
this.PartETags.Add(part);
}
}
///
/// Adds a collection of part numbers and corresponding etags.
///
/// PartETags that will added to this request.
public void AddPartETags(IEnumerable partETags)
{
foreach (PartETag part in partETags)
{
this.PartETags.Add(part);
}
}
///
/// Adds a collection of part numbers and corresponding etags by transforming the UploadPartResponses into PartETags.
///
/// The list of response objects return from UploadParts.
public void AddPartETags(params UploadPartResponse[] responses)
{
foreach (UploadPartResponse response in responses)
{
this.PartETags.Add(new PartETag(response));
}
}
///
/// Adds a collection of part numbers and corresponding etags by transforming the UploadPartResponses into PartETags.
///
/// The list of response objects return from UploadParts.
public void AddPartETags(IEnumerable responses)
{
foreach (UploadPartResponse response in responses)
{
this.PartETags.Add(new PartETag(response));
}
}
///
/// Adds a collection of part numbers and corresponding etags by transforming the CopyPartResponse into PartETags.
///
/// The list of response objects return from CopyParts.
public void AddPartETags(params CopyPartResponse[] responses)
{
foreach (CopyPartResponse response in responses)
{
this.PartETags.Add(new PartETag(response.PartNumber, response.ETag));
}
}
///
/// Adds a collection of part numbers and corresponding etags by transforming the CopyPartResponse into PartETags.
///
/// The list of response objects return from CopyParts.
public void AddPartETags(IEnumerable responses)
{
foreach (CopyPartResponse response in responses)
{
this.PartETags.Add(new PartETag(response.PartNumber, response.ETag));
}
}
///
/// Confirms that the requester knows that she or he will be charged for the request.
/// Bucket owners need not specify this parameter in their requests.
///
public RequestPayer RequestPayer
{
get { return this.requestPayer; }
set { this.requestPayer = value; }
}
///
/// Checks to see if RequetsPayer is set.
///
/// true, if RequestPayer property is set.
internal bool IsSetRequestPayer()
{
return requestPayer != null;
}
///
/// Gets and sets the property SSECustomerAlgorithm.
///
/// The SSE algorithm used to encrypt the object. This is only needed when the object
/// was created using a checksum algorithm. For more information, see Protecting
/// data using SSE-C keys in the Amazon S3 User Guide.
///
///
public string SSECustomerAlgorithm
{
get { return this._sseCustomerAlgorithm; }
set { this._sseCustomerAlgorithm = value; }
}
// Check to see if SSECustomerAlgorithm property is set
internal bool IsSetSSECustomerAlgorithm()
{
return this._sseCustomerAlgorithm != null;
}
///
/// Gets and sets the property SSECustomerKey.
///
/// The SSE customer key. This is only needed when the object was cureated using a checksum
/// algorithm. For more information, see Protecting
/// data using SSE-C keys in the Amazon S3 User Guide.
///
///
public string SSECustomerKey
{
get { return this._sseCustomerKey; }
set { this._sseCustomerKey = value; }
}
// Check to see if SSECustomerKey property is set
internal bool IsSetSSECustomerKey()
{
return this._sseCustomerKey != null;
}
///
/// Gets and sets the property SSECustomerKeyMD5.
///
/// The MD5 SSE customer key. This is only needed when the object was cureated using a
/// checksum algorithm. For more information, see Protecting
/// data using SSE-C keys in the Amazon S3 User Guide.
///
///
public string SSECustomerKeyMD5
{
get { return this._sseCustomerKeyMD5; }
set { this._sseCustomerKeyMD5 = value; }
}
// Check to see if SSECustomerKeyMD5 property is set
internal bool IsSetSSECustomerKeyMD5()
{
return this._sseCustomerKeyMD5 != null;
}
///
/// The upload id for the in-progress multipart upload that should be completed.
///
public string UploadId
{
get { return this.uploadId; }
set { this.uploadId = value; }
}
// Check to see if UploadId property is set
internal bool IsSetUploadId()
{
return this.uploadId != null;
}
}
}