/*
* 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 CopyObject operation.
/// Creates a copy of an object that is already stored in Amazon S3.
///
///
///
/// You can store individual objects of up to 5 TB in Amazon S3. You create a copy of
/// your object up to 5 GB in size in a single atomic action using this API. However,
/// to copy an object greater than 5 GB, you must use the multipart upload Upload Part
/// - Copy API. For more information, see Copy
/// Object Using the REST Multipart Upload API.
///
///
///
/// All copy requests must be authenticated. Additionally, you must have read access
/// to the source object and write access to the destination bucket. For more information,
/// see REST
/// Authentication. Both the Region that you want to copy the object from and the
/// Region that you want to copy the object to must be enabled for your account.
///
///
///
/// A copy request might return an error when Amazon S3 receives the copy request or while
/// Amazon S3 is copying the files. If the error occurs before the copy action starts,
/// you receive a standard Amazon S3 error. If the error occurs during the copy operation,
/// the error response is embedded in the 200 OK
response. This means that
/// a 200 OK
response can contain either a success or an error. Design your
/// application to parse the contents of the response and handle it appropriately. If you call
/// the S3 API directly, make sure to design your application to parse the contents of
/// the response and handle it appropriately. If you use Amazon Web Services SDKs, SDKs
/// handle this condition. The SDKs detect the embedded error and apply error handling
/// per your configuration settings (including automatically retrying the request as appropriate).
/// If the condition persists, the SDKs throws an exception (or, for the SDKs that don't
/// use exceptions, they return the error).
///
///
///
/// If the copy is successful, you receive a response with information about the copied
/// object.
///
///
///
/// If the request is an HTTP 1.1 request, the response is chunk encoded. If it were not,
/// it would not contain the content-length, and you would need to read the entire body.
///
///
///
/// The copy request charge is based on the storage class and Region that you specify
/// for the destination object. For pricing information, see Amazon
/// S3 pricing.
///
///
///
/// Amazon S3 transfer acceleration does not support cross-Region copies. If you request
/// a cross-Region copy using a transfer acceleration endpoint, you get a 400 Bad
/// Request
error. For more information, see Transfer
/// Acceleration.
///
/// - Metadata
-
///
///
/// When copying an object, you can preserve all metadata (default) or specify new metadata.
/// However, the ACL is not preserved and is set to private for the user making the request.
/// To override the default ACL setting, specify a new ACL when generating a copy request.
/// For more information, see Using
/// ACLs.
///
///
///
/// To specify whether you want the object metadata copied from the source object or replaced
/// with metadata provided in the request, you can optionally add the
x-amz-metadata-directive
/// header. When you grant permissions, you can use the s3:x-amz-metadata-directive
/// condition key to enforce certain metadata behavior when objects are uploaded. For
/// more information, see Specifying
/// Conditions in a Policy in the Amazon S3 User Guide. For a complete list
/// of Amazon S3-specific condition keys, see Actions,
/// Resources, and Condition Keys for Amazon S3.
///
///
///
/// x-amz-website-redirect-location
is unique to each object and must be
/// specified in the request headers to copy the value.
///
/// - x-amz-copy-source-if Headers
-
///
/// To only copy an object under certain conditions, such as whether the
Etag
/// matches or whether the object was modified before or after a specified date, use the
/// following request parameters:
///
/// -
///
///
x-amz-copy-source-if-match
///
/// -
///
///
x-amz-copy-source-if-none-match
///
/// -
///
///
x-amz-copy-source-if-unmodified-since
///
/// -
///
///
x-amz-copy-source-if-modified-since
///
///
///
/// If both the x-amz-copy-source-if-match
and x-amz-copy-source-if-unmodified-since
/// headers are present in the request and evaluate as follows, Amazon S3 returns 200
/// OK
and copies the data:
///
/// -
///
///
x-amz-copy-source-if-match
condition evaluates to true
///
/// -
///
///
x-amz-copy-source-if-unmodified-since
condition evaluates to false
///
///
///
/// If both the x-amz-copy-source-if-none-match
and x-amz-copy-source-if-modified-since
/// headers are present in the request and evaluate as follows, Amazon S3 returns the
/// 412 Precondition Failed
response code:
///
/// -
///
///
x-amz-copy-source-if-none-match
condition evaluates to false
///
/// -
///
///
x-amz-copy-source-if-modified-since
condition evaluates to true
///
///
///
/// All headers with the x-amz-
prefix, including x-amz-copy-source
,
/// must be signed.
///
/// - Server-side encryption
-
///
/// Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket.
/// When copying an object, if you don't specify encryption information in your copy request,
/// the encryption setting of the target object is set to the default encryption configuration
/// of the destination bucket. By default, all buckets have a base level of encryption
/// configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3).
/// If the destination bucket has a default encryption configuration that uses server-side
/// encryption with an Key Management Service (KMS) key (SSE-KMS), or a customer-provided
/// encryption key (SSE-C), Amazon S3 uses the corresponding KMS key, or a customer-provided
/// key to encrypt the target object copy.
///
///
///
/// When you perform a CopyObject operation, you can optionally use the appropriate encryption-related
/// headers to encrypt the object using server-side encryption with Amazon Web Services
/// managed encryption keys (SSE-S3 or SSE-KMS) or a customer-provided encryption key.
/// With server-side encryption, Amazon S3 encrypts your data as it writes it to disks
/// in its data centers and decrypts the data when you access it. For more information
/// about server-side encryption, see Using
/// Server-Side Encryption.
///
///
///
/// If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object. For
/// more information, see Amazon
/// S3 Bucket Keys in the Amazon S3 User Guide.
///
///
- Access Control List (ACL)-Specific Request Headers
-
///
/// When copying an object, you can optionally use headers to grant ACL-based permissions.
/// By default, all objects are private. Only the owner has full access control. When
/// adding a new object, you can grant permissions to individual Amazon Web Services accounts
/// or to predefined groups defined by Amazon S3. These permissions are then added to
/// the ACL on the object. For more information, see Access
/// Control List (ACL) Overview and Managing
/// ACLs Using the REST API.
///
///
///
/// If the bucket that you're copying objects to uses the bucket owner enforced setting
/// for S3 Object Ownership, ACLs are disabled and no longer affect permissions. Buckets
/// that use this setting only accept PUT requests that don't specify an ACL or PUT requests
/// that specify bucket owner full control ACLs, such as the
bucket-owner-full-control
/// canned ACL or an equivalent form of this ACL expressed in the XML format.
///
///
///
/// For more information, see
/// Controlling ownership of objects and disabling ACLs in the Amazon S3 User Guide.
///
///
///
/// If your bucket uses the bucket owner enforced setting for Object Ownership, all objects
/// written to the bucket by any account will be owned by the bucket owner.
///
///
/// - Storage Class Options
-
///
/// You can use the
CopyObject
action to change the storage class of an object
/// that is already stored in Amazon S3 using the StorageClass
parameter.
/// For more information, see Storage
/// Classes in the Amazon S3 User Guide.
///
///
///
/// If the source object's storage class is GLACIER, you must restore a copy of this object
/// before you can use it as a source object for the copy operation. For more information,
/// see RestoreObject.
/// For more information, see Copying
/// Objects.
///
/// - Versioning
-
///
/// By default,
x-amz-copy-source
identifies the current version of an object
/// to copy. If the current version is a delete marker, Amazon S3 behaves as if the object
/// was deleted. To copy a different version, use the versionId
subresource.
///
///
///
/// If you enable versioning on the target bucket, Amazon S3 generates a unique version
/// ID for the object being copied. This version ID is different from the version ID of
/// the source object. Amazon S3 returns the version ID of the copied object in the x-amz-version-id
/// response header in the response.
///
///
///
/// If you do not enable versioning or suspend it on the target bucket, the version ID
/// that Amazon S3 generates is always null.
///
///
///
/// The following operations are related to CopyObject
:
///
///
///
public partial class CopyObjectRequest : PutWithACLRequest
{
private S3CannedACL cannedACL;
private bool? bucketKeyEnabled;
private string srcBucket;
private string srcKey;
private string srcVersionId;
private string dstBucket;
private string dstKey;
private RequestPayer requestPayer;
private string expectedBucketOwner;
private string expectedSourceBucketOwner;
private ChecksumAlgorithm _checksumAlgorithm;
private string etagToMatch;
private string etagToNotMatch;
private DateTime? modifiedSinceDate;
private DateTime? unmodifiedSinceDate;
private DateTime? modifiedSinceDateUtc;
private DateTime? unmodifiedSinceDateUtc;
private List tagset = new List();
private S3MetadataDirective metadataDirective;
private S3StorageClass storageClass;
private ObjectLockLegalHoldStatus objectLockLegalHoldStatus;
private ObjectLockMode objectLockMode;
private DateTime? objectLockRetainUntilDate;
private string websiteRedirectLocation;
private HeadersCollection headersCollection = new HeadersCollection();
private MetadataCollection metadataCollection = new MetadataCollection();
private ServerSideEncryptionMethod serverSideEncryption;
private ServerSideEncryptionCustomerMethod serverSideCustomerEncryption;
private string serverSideEncryptionCustomerProvidedKey;
private string serverSideEncryptionCustomerProvidedKeyMD5;
private string serverSideEncryptionKeyManagementServiceKeyId;
private string serverSideEncryptionKeyManagementServiceEncryptionContext;
private ServerSideEncryptionCustomerMethod copySourceServerSideCustomerEncryption;
private string copySourceServerSideEncryptionCustomerProvidedKey;
private string copySourceServerSideEncryptionCustomerProvidedKeyMD5;
///
/// A canned access control list (CACL) to apply to the object.
/// Please refer to for
/// information on S3 Canned ACLs.
/// This action is not supported by Amazon S3 on Outposts.
///
public S3CannedACL CannedACL
{
get { return this.cannedACL; }
set { this.cannedACL = value; }
}
// Check to see if CannedACL property is set
internal bool IsSetCannedACL()
{
return cannedACL != null && cannedACL != S3CannedACL.NoACL;
}
///
/// Gets and sets the property BucketKeyEnabled.
///
/// Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with
/// server-side encryption using AWS KMS (SSE-KMS). Setting this header to true
/// causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.
///
///
///
/// Specifying this header with a COPY action doesn't affect bucket-level settings for
/// S3 Bucket Key.
///
///
public bool BucketKeyEnabled
{
get { return this.bucketKeyEnabled.GetValueOrDefault(); }
set { this.bucketKeyEnabled = value; }
}
internal bool IsSetBucketKeyEnabled()
{
return bucketKeyEnabled.HasValue;
}
///
/// This is a convenience property for Headers.ContentType.
///
public string ContentType
{
get { return this.Headers.ContentType; }
set { this.Headers.ContentType = value; }
}
///
///
/// This property is deprecated. Setting this property results in non-UTC DateTimes not
/// being marshalled correctly. Use ModifiedSinceDateUtc instead. Setting either ModifiedSinceDate or
/// ModifiedSinceDateUtc results in both ModifiedSinceDate and ModifiedSinceDateUtc being assigned,
/// the latest assignment to either one of the two property is reflected in the value of both.
/// ModifiedSinceDate is provided for backwards compatibility only and assigning a non-Utc DateTime
/// to it results in the wrong timestamp being passed to the service.
///
/// Copies the object if it has been modified since the specified time, otherwise returns a PreconditionFailed.
///
///
/// Copies the object if it has been modified since the
/// specified time; otherwise returns a 412 (failed condition).
/// Constraints: This property can be used with ETagToNotMatch,
/// but cannot be used with other conditional copy properties.
///
[Obsolete("Setting this property results in non-UTC DateTimes not being marshalled correctly. " +
"Use ModifiedSinceDateUtc instead. Setting either ModifiedSinceDate or ModifiedSinceDateUtc results in both ModifiedSinceDate and " +
"ModifiedSinceDateUtc being assigned, the latest assignment to either one of the two property is " +
"reflected in the value of both. ModifiedSinceDate is provided for backwards compatibility only and " +
"assigning a non-Utc DateTime to it results in the wrong timestamp being passed to the service.", false)]
public DateTime ModifiedSinceDate
{
get { return this.modifiedSinceDate.GetValueOrDefault(); }
set
{
this.modifiedSinceDate = value;
this.modifiedSinceDateUtc = new DateTime(value.Ticks, DateTimeKind.Utc);
}
}
///
/// Copies the object if it has been modified since the specified time, otherwise returns a PreconditionFailed.
///
///
/// Copies the object if it has been modified since the
/// specified time; otherwise returns a 412 (failed condition).
/// Constraints: This property can be used with ETagToNotMatch,
/// but cannot be used with other conditional copy properties.
///
public DateTime ModifiedSinceDateUtc
{
get { return this.modifiedSinceDateUtc ?? default(DateTime); }
set
{
this.modifiedSinceDateUtc = value;
this.modifiedSinceDate = value;
}
}
///
/// Checks if ModifiedSinceDateUtc property is set.
///
/// true if ModifiedSinceDateUtc property is set.
internal bool IsSetModifiedSinceDateUtc()
{
return this.modifiedSinceDateUtc.HasValue;
}
///
///
/// This property is deprecated. Setting this property results in non-UTC DateTimes not
/// being marshalled correctly. Use UnmodifiedSinceDateUtc instead. Setting either UnmodifiedSinceDate or
/// UnmodifiedSinceDateUtc results in both UnmodifiedSinceDate and UnmodifiedSinceDateUtc being assigned,
/// the latest assignment to either one of the two property is reflected in the value of both.
/// UnmodifiedSinceDate is provided for backwards compatibility only and assigning a non-Utc DateTime
/// to it results in the wrong timestamp being passed to the service.
///
/// Copies the object if it has not been modified since the specified time, otherwise returns a PreconditionFailed.
///
///
/// Copies the object if it hasn't been modified since the
/// specified time; otherwise returns a 412 (precondition failed).
/// Constraints: This property can be used with ETagToMatch,
/// but cannot be used with other conditional copy properties.
///
[Obsolete("Setting this property results in non-UTC DateTimes not being marshalled correctly. " +
"Use UnmodifiedSinceDateUtc instead. Setting either UnmodifiedSinceDate or UnmodifiedSinceDateUtc results in both UnmodifiedSinceDate and " +
"UnmodifiedSinceDateUtc being assigned, the latest assignment to either one of the two property is " +
"reflected in the value of both. UnmodifiedSinceDate is provided for backwards compatibility only and " +
"assigning a non-Utc DateTime to it results in the wrong timestamp being passed to the service.", false)]
public DateTime UnmodifiedSinceDate
{
get { return this.unmodifiedSinceDate ?? default(DateTime); }
set
{
this.unmodifiedSinceDate = value;
this.unmodifiedSinceDateUtc = new DateTime(value.Ticks, DateTimeKind.Utc);
}
}
///
/// Copies the object if it has not been modified since the specified time, otherwise returns a PreconditionFailed.
///
///
/// Copies the object if it hasn't been modified since the
/// specified time; otherwise returns a 412 (precondition failed).
/// Constraints: This property can be used with ETagToMatch,
/// but cannot be used with other conditional copy properties.
///
public DateTime UnmodifiedSinceDateUtc
{
get { return this.unmodifiedSinceDateUtc ?? default(DateTime); }
set
{
this.unmodifiedSinceDateUtc = value;
this.unmodifiedSinceDate = value;
}
}
///
/// Checks if UnmodifiedSinceDateUtc property is set.
///
/// true if UnmodifiedSinceDateUtc property is set.
internal bool IsSetUnmodifiedSinceDateUtc()
{
return this.unmodifiedSinceDateUtc.HasValue;
}
///
/// The Server-side encryption algorithm to be used with the customer provided key.
///
///
public ServerSideEncryptionCustomerMethod CopySourceServerSideEncryptionCustomerMethod
{
get { return this.copySourceServerSideCustomerEncryption; }
set { this.copySourceServerSideCustomerEncryption = value; }
}
// Check to see if CopySourceServerSideEncryptionCustomerMethod property is set
internal bool IsSetCopySourceServerSideEncryptionCustomerMethod()
{
return this.copySourceServerSideCustomerEncryption != null && this.copySourceServerSideCustomerEncryption != ServerSideEncryptionCustomerMethod.None;
}
///
/// The customer provided encryption key for the source object of the copy.
///
/// Important: Amazon S3 does not store the encryption key you provide.
///
///
[AWSProperty(Sensitive=true)]
public string CopySourceServerSideEncryptionCustomerProvidedKey
{
get { return this.copySourceServerSideEncryptionCustomerProvidedKey; }
set { this.copySourceServerSideEncryptionCustomerProvidedKey = value; }
}
///
/// Checks if CopySourceServerSideEncryptionCustomerProvidedKey property is set.
///
/// true if CopySourceServerSideEncryptionCustomerProvidedKey property is set.
internal bool IsSetCopySourceServerSideEncryptionCustomerProvidedKey()
{
return !System.String.IsNullOrEmpty(this.copySourceServerSideEncryptionCustomerProvidedKey);
}
///
/// The MD5 of the customer encryption key specified in the CopySourceServerSideEncryptionCustomerProvidedKey property. The MD5 is
/// base 64 encoded. This field is optional, the SDK will calculate the MD5 if this is not set.
///
public string CopySourceServerSideEncryptionCustomerProvidedKeyMD5
{
get { return this.copySourceServerSideEncryptionCustomerProvidedKeyMD5; }
set { this.copySourceServerSideEncryptionCustomerProvidedKeyMD5 = value; }
}
///
/// Checks if CopySourceServerSideEncryptionCustomerProvidedKeyMD5 property is set.
///
/// true if CopySourceServerSideEncryptionCustomerProvidedKey property is set.
internal bool IsSetCopySourceServerSideEncryptionCustomerProvidedKeyMD5()
{
return !System.String.IsNullOrEmpty(this.copySourceServerSideEncryptionCustomerProvidedKeyMD5);
}
///
/// Gets and sets the property DestinationBucket.
///
/// The name of the destination bucket.
///
///
///
/// 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 DestinationBucket
{
get { return this.dstBucket; }
set { this.dstBucket = value; }
}
///
/// Checks if DestinationBucket property is set.
///
/// true if DestinationBucket property is set.
internal bool IsSetDestinationBucket()
{
return !System.String.IsNullOrEmpty(this.dstBucket);
}
///
/// The key to be given to the copy of the source object.
///
///
/// 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 DestinationKey
{
get { return this.dstKey; }
set { this.dstKey = value; }
}
///
/// Checks if DestinationKey property is set.
///
/// true if DestinationKey property is set.
internal bool IsSetDestinationKey()
{
return !System.String.IsNullOrEmpty(this.dstKey);
}
///
/// Gets and sets the property ExpectedBucketOwner.
///
/// The account ID of the expected destination bucket owner. If the destination 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; }
}
// Check to see if ExpectedBucketOwner property is set
internal bool IsSetExpectedBucketOwner()
{
return !String.IsNullOrEmpty(this.expectedBucketOwner);
}
///
/// Gets and sets the property ExpectedSourceBucketOwner.
///
/// The account ID of the expected source bucket owner. If the source bucket is owned
/// by a different account, the request will fail with an HTTP 403 (Access Denied)
/// error.
///
///
public string ExpectedSourceBucketOwner
{
get { return this.expectedSourceBucketOwner; }
set { this.expectedSourceBucketOwner = value; }
}
///
/// Checks to see if ExpectedSourceBucketOwner is set.
///
/// true, if ExpectedSourceBucketOwner property is set.
internal bool IsSetExpectedSourceBucketOwner()
{
return !String.IsNullOrEmpty(this.expectedSourceBucketOwner);
}
///
/// The collection of meta data for the request.
///
public MetadataCollection Metadata
{
get
{
if (this.metadataCollection == null)
this.metadataCollection = new MetadataCollection();
return this.metadataCollection;
}
}
///
/// Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request.
///
///
public S3MetadataDirective MetadataDirective
{
get { return this.metadataDirective; }
set { this.metadataDirective = value; }
}
///
/// Gets and sets the property ObjectLockLegalHoldStatus.
///
/// Specifies whether you want to apply a Legal Hold to the copied object.
///
///
public ObjectLockLegalHoldStatus ObjectLockLegalHoldStatus
{
get { return this.objectLockLegalHoldStatus; }
set { this.objectLockLegalHoldStatus = value; }
}
// Check to see if ObjectLockLegalHoldStatus property is set
internal bool IsSetObjectLockLegalHoldStatus()
{
return this.objectLockLegalHoldStatus != null;
}
///
/// Gets and sets the property ObjectLockMode.
///
/// The Object Lock mode that you want to apply to the copied object.
///
///
public ObjectLockMode ObjectLockMode
{
get { return this.objectLockMode; }
set { this.objectLockMode = value; }
}
// Check to see if ObjectLockMode property is set
internal bool IsSetObjectLockMode()
{
return this.objectLockMode != null;
}
///
/// Gets and sets the property ObjectLockRetainUntilDate.
///
/// The date and time when you want the copied object's Object Lock to expire.
///
///
public DateTime ObjectLockRetainUntilDate
{
get { return this.objectLockRetainUntilDate.GetValueOrDefault(); }
set { this.objectLockRetainUntilDate = value; }
}
// Check to see if ObjectLockRetainUntilDate property is set
internal bool IsSetObjectLockRetainUntilDate()
{
return this.objectLockRetainUntilDate.HasValue;
}
///
/// 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;
}
///
/// The name of the bucket containing the object to copy.
///
public string SourceBucket
{
get { return this.srcBucket; }
set { this.srcBucket = value; }
}
///
/// Checks if SourceBucket property is set.
///
/// true if SourceBucket property is set.
// Check to see if SourceBucket property is set
internal bool IsSetSourceBucket()
{
return !System.String.IsNullOrEmpty(this.srcBucket);
}
///
/// The key of the object to copy.
///
///
/// 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 SourceKey
{
get { return this.srcKey; }
set { this.srcKey = value; }
}
///
/// Checks if SourceKey property is set.
///
/// true if SourceKey property is set.
internal bool IsSetSourceKey()
{
return !System.String.IsNullOrEmpty(this.srcKey);
}
///
/// Specifies a particular version of the source object to copy. By default the latest version is copied.
///
public string SourceVersionId
{
get { return this.srcVersionId; }
set { this.srcVersionId = value; }
}
///
/// Checks if SourceVersionId property is set.
///
/// true if SourceVersionId property is set.
internal bool IsSetSourceVersionId()
{
return !System.String.IsNullOrEmpty(this.srcVersionId);
}
///
///
/// The server-side encryption algorithm used when storing this object in Amazon S3 (for
/// example, AES256, aws:kms
).
///
///
public ServerSideEncryptionMethod ServerSideEncryptionMethod
{
get { return this.serverSideEncryption; }
set { this.serverSideEncryption = value; }
}
// Check to see if ServerSideEncryption property is set
internal bool IsSetServerSideEncryptionMethod()
{
return this.serverSideEncryption != null && this.serverSideEncryption != ServerSideEncryptionMethod.None;
}
///
/// The Server-side encryption algorithm to be used with the customer provided key.
///
///
public ServerSideEncryptionCustomerMethod ServerSideEncryptionCustomerMethod
{
get { return this.serverSideCustomerEncryption; }
set { this.serverSideCustomerEncryption = value; }
}
// Check to see if ServerSideEncryptionCustomerMethod property is set
internal bool IsSetServerSideEncryptionCustomerMethod()
{
return this.serverSideCustomerEncryption != null && this.serverSideCustomerEncryption != ServerSideEncryptionCustomerMethod.None;
}
///
/// The base64-encoded encryption key for Amazon S3 to use to encrypt the object
///
/// Using the encryption key you provide as part of your request Amazon S3 manages both the encryption, as it writes
/// to disks, and decryption, when you access your objects. Therefore, you don't need to maintain any data encryption code. The only
/// thing you do is manage the encryption keys you provide.
/// ///
/// When you retrieve an object, you must provide the same encryption key as part of your request. Amazon S3 first verifies
/// the encryption key you provided matches, and then decrypts the object before returning the object data to you.
///
///
/// Important: Amazon S3 does not store the encryption key you provide.
///
///
[AWSProperty(Sensitive=true)]
public string ServerSideEncryptionCustomerProvidedKey
{
get { return this.serverSideEncryptionCustomerProvidedKey; }
set { this.serverSideEncryptionCustomerProvidedKey = value; }
}
///
/// Checks if ServerSideEncryptionCustomerProvidedKey property is set.
///
/// true if ServerSideEncryptionCustomerProvidedKey property is set.
internal bool IsSetServerSideEncryptionCustomerProvidedKey()
{
return !System.String.IsNullOrEmpty(this.serverSideEncryptionCustomerProvidedKey);
}
///
/// The MD5 of the customer encryption key specified in the ServerSideEncryptionCustomerProvidedKey property. The MD5 is
/// base 64 encoded. This field is optional, the SDK will calculate the MD5 if this is not set.
///
public string ServerSideEncryptionCustomerProvidedKeyMD5
{
get { return this.serverSideEncryptionCustomerProvidedKeyMD5; }
set { this.serverSideEncryptionCustomerProvidedKeyMD5 = value; }
}
///
/// Checks if ServerSideEncryptionCustomerProvidedKeyMD5 property is set.
///
/// true if ServerSideEncryptionCustomerProvidedKey property is set.
internal bool IsSetServerSideEncryptionCustomerProvidedKeyMD5()
{
return !System.String.IsNullOrEmpty(this.serverSideEncryptionCustomerProvidedKeyMD5);
}
///
/// Gets and sets the property SSEKMSEncryptionContext.
///
/// Specifies the Amazon Web Services KMS Encryption Context to use for object encryption.
/// The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption
/// context key-value pairs.
///
///
[AWSProperty(Sensitive=true)]
public string ServerSideEncryptionKeyManagementServiceEncryptionContext
{
get { return this.serverSideEncryptionKeyManagementServiceEncryptionContext; }
set { this.serverSideEncryptionKeyManagementServiceEncryptionContext = value; }
}
///
/// Checks if ServerSideEncryptionKeyManagementServiceEncryptionContext property is set.
///
/// true if ServerSideEncryptionKeyManagementServiceEncryptionContext property is set.
internal bool IsSetServerSideEncryptionKeyManagementServiceEncryptionContext()
{
return !System.String.IsNullOrEmpty(this.serverSideEncryptionKeyManagementServiceEncryptionContext);
}
///
/// Gets and sets the property SSEKMSKeyId.
///
/// Specifies the Amazon Web Services KMS key ID to use for object encryption. All GET
/// and PUT requests for an object protected by Amazon Web Services KMS will fail if not
/// made via SSL or using SigV4. For information about configuring using any of the officially
/// supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying
/// the Signature Version in Request Authentication in the Amazon S3 User Guide.
///
///
[AWSProperty(Sensitive=true)]
public string ServerSideEncryptionKeyManagementServiceKeyId
{
get { return this.serverSideEncryptionKeyManagementServiceKeyId; }
set { this.serverSideEncryptionKeyManagementServiceKeyId = value; }
}
///
/// Checks if ServerSideEncryptionKeyManagementServiceKeyId property is set.
///
/// true if ServerSideEncryptionKeyManagementServiceKeyId property is set.
internal bool IsSetServerSideEncryptionKeyManagementServiceKeyId()
{
return !System.String.IsNullOrEmpty(this.serverSideEncryptionKeyManagementServiceKeyId);
}
///
/// Gets and sets the property StorageClass.
///
/// By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects.
/// The STANDARD storage class provides high durability and high availability. Depending
/// on performance needs, you can specify a different Storage Class. Amazon S3 on Outposts
/// only uses the OUTPOSTS Storage Class. For more information, see Storage
/// Classes in the Amazon S3 User Guide.
///
///
public S3StorageClass StorageClass
{
get { return this.storageClass; }
set { this.storageClass = value; }
}
// Check to see if StorageClass property is set
internal bool IsSetStorageClass()
{
return this.storageClass != null;
}
///
/// The tag-set for the object destination object this value must be used in conjunction with the TaggingDirective. The tag-set must be encoded as URL Query parameters.
///
public List TagSet
{
get { return this.tagset; }
set { this.tagset = value; }
}
///
/// Checks if Tagging property is set
///
/// true if Tagging is set.
internal bool IsSetTagSet()
{
return (this.tagset != null) && (this.tagset.Count > 0);
}
///
///
/// If the bucket is configured as a website, redirects requests for this object to another
/// object in the same bucket or to an external URL. Amazon S3 stores the value of this
/// header in the object metadata. This value is unique to each object and is not copied
/// when using the x-amz-metadata-directive
header. Instead, you may opt
/// to provide this header in combination with the directive.
///
///
public string WebsiteRedirectLocation
{
get { return this.websiteRedirectLocation; }
set { this.websiteRedirectLocation = value; }
}
// Check to see if WebsiteRedirectLocation property is set
internal bool IsSetWebsiteRedirectLocation()
{
return this.websiteRedirectLocation != null;
}
///
/// ETag to be matched as a pre-condition for copying the source object
/// otherwise returns a PreconditionFailed.
///
///
/// Copies the object if its entity tag (ETag) matches
/// the specified tag; otherwise return a 412 (precondition failed).
/// Constraints: This property can be used with IfUnmodifiedSince,
/// but cannot be used with other conditional copy properties.
///
public string ETagToMatch
{
get { return this.etagToMatch; }
set { this.etagToMatch = value; }
}
///
/// Checks if ETagToMatch property is set.
///
///
/// Copies the object if its entity tag (ETag) is different
/// than the specified Etag; otherwise returns a 412 (failed condition).
/// Constraints: This header can be used with IfModifiedSince, but cannot
/// be used with other conditional copy properties.
///
/// true if ETagToMatch property is set.
internal bool IsSetETagToMatch()
{
return !System.String.IsNullOrEmpty(this.etagToMatch);
}
///
/// ETag that must not be matched as a pre-condition for copying the source object,
/// otherwise returns a PreconditionFailed.
///
public string ETagToNotMatch
{
get { return this.etagToNotMatch; }
set { this.etagToNotMatch = value; }
}
///
/// Checks if ETagToNotMatch property is set.
///
/// true if ETagToNotMatch property is set.
internal bool IsSetETagToNotMatch()
{
return !System.String.IsNullOrEmpty(this.etagToNotMatch);
}
///
/// The collection of headers for the request.
///
public HeadersCollection Headers
{
get
{
if (this.headersCollection == null)
this.headersCollection = new HeadersCollection();
return this.headersCollection;
}
}
///
/// Gets and sets the property ChecksumAlgorithm.
///
/// Indicates the algorithm you want Amazon S3 to use to create the checksum for the object.
/// For more information, see Checking
/// object integrity in the Amazon S3 User Guide.
///
///
public ChecksumAlgorithm ChecksumAlgorithm
{
get { return this._checksumAlgorithm; }
set { this._checksumAlgorithm = value; }
}
// Check to see if ChecksumAlgorithm property is set
internal bool IsSetChecksumAlgorithm()
{
return this._checksumAlgorithm != null;
}
}
}