5.0.0 (latest) 4.16.0 4.15.0 4.14.0 4.13.0 4.11.0 4.10.0 4.9.0 4.8.0 4.7.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.7.0 3.6.0 3.5.0 3.4.0

    public sealed class CopyObjectOptions

Reference documentation and code samples for the Google Cloud Storage v1 API class CopyObjectOptions.

Options for `CopyObject` operations.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> CopyObjectOptions

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Storage.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1)

## Assembly

Google.Cloud.Storage.V1.dll

## Properties

### DestinationPredefinedAcl

    public PredefinedObjectAcl? DestinationPredefinedAcl { get; set; }

A predefined set of ACLs for the new object.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.PredefinedObjectAcl` |   |

### EncryptionKey

    public EncryptionKey EncryptionKey { get; set; }

The encryption key to use for this operation. If this property is null, the [EncryptionKey](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.StorageClient#Google_Cloud_Storage_V1_StorageClient_EncryptionKey)
will be used instead. Use [None](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.EncryptionKey#Google_Cloud_Storage_V1_EncryptionKey_None) to remove encryption headers from this request.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.EncryptionKey` |   |

### ExtraMetadata

    public Object ExtraMetadata { get; set; }

Additional object metadata for the new object. This can be used to specify the storage
class of the new object, the content type etc. If this property is not set, the existing
object metadata will be used unchanged.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://googleapis.dev/dotnet/Google.Apis.Storage.v1/1.76.0.4250/api/Google.Apis.Storage.v1.Data.Object.html` |   |

### IfGenerationMatch

    public long? IfGenerationMatch { get; set; }

Precondition for copying: the object is only copied if the existing destination object's
generation matches the given value.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int64` |   |

### IfGenerationNotMatch

    public long? IfGenerationNotMatch { get; set; }

Precondition for copying: the object is only copied if the existing destination object's
generation does not match the given value.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int64` |   |

### IfMetagenerationMatch

    public long? IfMetagenerationMatch { get; set; }

Precondition for copying: the object is only copied if the existing destination object's
meta-generation matches the given value.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int64` |   |

### IfMetagenerationNotMatch

    public long? IfMetagenerationNotMatch { get; set; }

Precondition for copying: the object is only copied if the existing destination object's
meta-generation does not match the given value.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int64` |   |

### IfSourceGenerationMatch

    public long? IfSourceGenerationMatch { get; set; }

Precondition for copying: the object is only copied if the source object's
generation matches the given value.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int64` |   |

### IfSourceGenerationNotMatch

    public long? IfSourceGenerationNotMatch { get; set; }

Precondition for copying: the object is only copied if the source object's
generation does not match the given value.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int64` |   |

### IfSourceMetagenerationMatch

    public long? IfSourceMetagenerationMatch { get; set; }

Precondition for copying: the object is only copied if the source object's
meta-generation matches the given value.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int64` |   |

### IfSourceMetagenerationNotMatch

    public long? IfSourceMetagenerationNotMatch { get; set; }

Precondition for copying: the object is only copied if the source object's
meta-generation does not match the given value.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int64` |   |

### KmsKeyName

    public string KmsKeyName { get; set; }

The name of the Cloud KMS key to use to encrypt the new object.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** Currently, either customer-supplied encryption or a Cloud KMS key can be used, but not both.
If this property is null and customer-supplied encryption is not being used,
the bucket encryption defaults will be used to determine the encryption for the object.
If this property is non-null and the client object has a default encryption key, the [EncryptionKey](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.CopyObjectOptions#Google_Cloud_Storage_V1_CopyObjectOptions_EncryptionKey) property
of this options object must be set to [None](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.EncryptionKey#Google_Cloud_Storage_V1_EncryptionKey_None) to make the intention clear.

### Projection

    public Projection? Projection { get; set; }

The projection to retrieve.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.Projection` |   |

### RetryOptions

    public RetryOptions RetryOptions { get; set; }

Options to pass custom retry configuration for each API request.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.RetryOptions` |   |

### SourceEncryptionKey

    public EncryptionKey SourceEncryptionKey { get; set; }

The encryption key to use for the source of the copy. If this property is null, the [EncryptionKey](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.StorageClient#Google_Cloud_Storage_V1_StorageClient_EncryptionKey)
will be used instead. Use [None](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.EncryptionKey#Google_Cloud_Storage_V1_EncryptionKey_None) if the source is not encrypted.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.EncryptionKey` |   |

### SourceGeneration

    public long? SourceGeneration { get; set; }

The generation of the object resource to copy. When not
set, the latest generation will be copied.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int64` |   |

### UserProject

    public string UserProject { get; set; }

If set, this is the ID of the project which will be billed for the request.
The caller must have suitable permissions for the project being billed.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |