AWS SDK Version 4 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Container for the parameters to the RenameObject operation. Renames an object or directory (prefix with delimiter) as an atomic operation in a directory bucket.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.S3.Model.RenameObjectRequest

Namespace: Amazon.S3.Model
Assembly: AWSSDK.S3.dll
Version: 3.x.y.z

Syntax

C#
public class RenameObjectRequest : AmazonWebServiceRequest
         IAmazonWebServiceRequest

The RenameObjectRequest type exposes the following members

Constructors

NameDescription
Public Method RenameObjectRequest()

Properties

NameTypeDescription
Public Property BucketName System.String

Gets and sets the property BucketName.

The name of the bucket in which the object or directory will be renamed.

Public Property ClientToken System.String

Gets and sets the property ClientToken.

A token to ensure that the rename request is idempotent. It's suitable to use the same client token across multiple requests when you're retrying a failed operation.

Public Property DestinationIfMatch System.String

Gets and sets the property DestinationIfMatch.

If the specified entity tag (ETag) matches the destination object's ETag, Amazon S3 will process the request.

Public Property DestinationIfModifiedSince System.DateTime

Gets and sets the property DestinationIfModifiedSince.

If the destination object was modified after the specified time, Amazon S3 will process the request.

Public Property DestinationIfNoneMatch System.String

Gets and sets the property DestinationIfNoneMatch.

If the specified entity tag (ETag) does not match the destination object's ETag, Amazon S3 will process the request.

Public Property DestinationIfUnmodifiedSince System.DateTime

Gets and sets the property DestinationIfUnmodifiedSince.

If the destination object was not modified after the specified time, Amazon S3 will process the request.

Public Property Key System.String

Gets and sets the property Key.

The new key name (full path) for the object or directory.

Public Property RenameSource System.String

Gets and sets the property RenameSource.

The key name (full path) of the source object or directory to be renamed. It must be URL-encoded.

Format: /bucket-name/object-key

Public Property SourceIfMatch System.String

Gets and sets the property SourceIfMatch.

If the specified entity tag (ETag) matches the source object's ETag, Amazon S3 will process the request.

Public Property SourceIfModifiedSince System.DateTime

Gets and sets the property SourceIfModifiedSince.

If the source object was modified after the specified time, Amazon S3 will process the request.

Public Property SourceIfNoneMatch System.String

Gets and sets the property SourceIfNoneMatch.

If the specified entity tag (ETag) does not match the source object's ETag, Amazon S3 will process the request.

Public Property SourceIfUnmodifiedSince System.DateTime

Gets and sets the property SourceIfUnmodifiedSince.

If the source object was not modified after the specified time, Amazon S3 will process the request.

Remarks

This operation is only supported for directory buckets.

To rename an object or directory, you must have permissions to perform both the s3:GetObject and s3:PutObject actions.

If a directory is specified in the rename request, all objects with the specified prefix are atomically renamed. However, existing objects that are encrypted with customer-provided encryption keys (SSE-C) won't be renamed.

The following operations are related to RenameObject: PutObjectCopyObjectDeleteObject

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.7.2 and newer