Class CopyObjectRequest
Container for the parameters to the CopyObject operation.
Creates a copy of an object that is already stored in Amazon S3.
public class CopyObjectRequest : PutWithACLRequest
- Inheritance
-
CopyObjectRequest
- Inherited Members
Constructors
CopyObjectRequest()
public CopyObjectRequest()
Properties
CannedACL
A canned access control list (CACL) to apply to the object. Please refer to S3CannedACL for information on S3 Canned ACLs.
This action is not supported by Amazon S3 on Outposts.
public S3CannedACL CannedACL { get; set; }
Property Value
ContentType
This is a convenience property for Headers.ContentType.
public string ContentType { get; set; }
Property Value
CopySourceServerSideEncryptionCustomerMethod
The Server-side encryption algorithm to be used with the customer provided key.
public ServerSideEncryptionCustomerMethod CopySourceServerSideEncryptionCustomerMethod { get; set; }
Property Value
CopySourceServerSideEncryptionCustomerProvidedKey
The customer provided encryption key for the source object of the copy.
Important: Amazon S3 does not store the encryption key you provide.
public string CopySourceServerSideEncryptionCustomerProvidedKey { get; set; }
Property Value
CopySourceServerSideEncryptionCustomerProvidedKeyMD5
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; set; }
Property Value
DestinationBucket
The name of the destination bucket.
When using this API 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 operation with an access point through the AWS 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 Simple Storage Service Developer Guide.
When using this API 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 using this operation using S3 on Outposts through the AWS SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using S3 on Outposts in the Amazon Simple Storage Service Developer Guide.
public string DestinationBucket { get; set; }
Property Value
DestinationKey
The key to be given to the copy of the source object.
public string DestinationKey { get; set; }
Property Value
Remarks
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
ETagToMatch
ETag to be matched as a pre-condition for copying the source object otherwise returns a PreconditionFailed.
public string ETagToMatch { get; set; }
Property Value
Remarks
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.
ETagToNotMatch
ETag that must not be matched as a pre-condition for copying the source object, otherwise returns a PreconditionFailed.
public string ETagToNotMatch { get; set; }
Property Value
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; set; }
Property Value
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; set; }
Property Value
Headers
The collection of headers for the request.
public HeadersCollection Headers { get; }
Property Value
Metadata
The collection of meta data for the request.
public MetadataCollection Metadata { get; }
Property Value
MetadataDirective
Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request.
public S3MetadataDirective MetadataDirective { get; set; }
Property Value
ModifiedSinceDate
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.[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; set; }
Property Value
Remarks
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.
ModifiedSinceDateUtc
Copies the object if it has been modified since the specified time, otherwise returns a PreconditionFailed.
public DateTime ModifiedSinceDateUtc { get; set; }
Property Value
Remarks
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.
ObjectLockLegalHoldStatus
Gets and sets the property ObjectLockLegalHoldStatus.
Specifies whether you want to apply a Legal Hold to the copied object.
public ObjectLockLegalHoldStatus ObjectLockLegalHoldStatus { get; set; }
Property Value
ObjectLockMode
Gets and sets the property ObjectLockMode.
The Object Lock mode that you want to apply to the copied object.
public ObjectLockMode ObjectLockMode { get; set; }
Property Value
ObjectLockRetainUntilDate
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; set; }
Property Value
RequestPayer
Confirms that the requester knows that she or he will be charged for the list objects request. Bucket owners need not specify this parameter in their requests.
public RequestPayer RequestPayer { get; set; }
Property Value
ServerSideEncryptionCustomerMethod
The Server-side encryption algorithm to be used with the customer provided key.
public ServerSideEncryptionCustomerMethod ServerSideEncryptionCustomerMethod { get; set; }
Property Value
ServerSideEncryptionCustomerProvidedKey
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.
public string ServerSideEncryptionCustomerProvidedKey { get; set; }
Property Value
ServerSideEncryptionCustomerProvidedKeyMD5
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; set; }
Property Value
ServerSideEncryptionKeyManagementServiceEncryptionContext
Specifies the AWS 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.
public string ServerSideEncryptionKeyManagementServiceEncryptionContext { get; set; }
Property Value
ServerSideEncryptionKeyManagementServiceKeyId
The id of the AWS Key Management Service key that Amazon S3 should use to encrypt and decrypt the object. If a key id is not specified, the default key will be used for encryption and decryption.
public string ServerSideEncryptionKeyManagementServiceKeyId { get; set; }
Property Value
ServerSideEncryptionMethod
The Server-side encryption algorithm used when storing this object in S3.
public ServerSideEncryptionMethod ServerSideEncryptionMethod { get; set; }
Property Value
SourceBucket
The name of the bucket containing the object to copy.
public string SourceBucket { get; set; }
Property Value
SourceKey
The key of the object to copy.
public string SourceKey { get; set; }
Property Value
Remarks
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
SourceVersionId
Specifies a particular version of the source object to copy. By default the latest version is copied.
public string SourceVersionId { get; set; }
Property Value
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 Service Developer Guide.
public S3StorageClass StorageClass { get; set; }
Property Value
TagSet
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<Tag> TagSet { get; set; }
Property Value
UnmodifiedSinceDate
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.[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; set; }
Property Value
Remarks
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.
UnmodifiedSinceDateUtc
Copies the object if it has not been modified since the specified time, otherwise returns a PreconditionFailed.
public DateTime UnmodifiedSinceDateUtc { get; set; }
Property Value
Remarks
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.
WebsiteRedirectLocation
If the bucketName is configured as a website, redirects requests for this object to another object in the same bucketName or to an external URL. Amazon S3 stores the value of this header in the object metadata.
public string WebsiteRedirectLocation { get; set; }