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 DownloadObjectOptions

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

Options for `DownloadObject` operations.

## Inheritance

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

## 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

### ChunkSize

    public int? ChunkSize { get; set; }

The chunk size to use for each request.

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

### DownloadValidationMode

    public DownloadValidationMode? DownloadValidationMode { get; set; }

Specifies whether or not the object's hash should be validated. If this property is null,
the hash will always be validated.

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

**Remarks**
This is effectively an escape hatch for situations where hash validation fails.
See <https://github.com/googleapis/google-cloud-dotnet/issues/1641> for background
on this option. It is recommended that you leave this option unset (or use
[Automatic](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.DownloadValidationMode#Google_Cloud_Storage_V1_DownloadValidationMode_Automatic)) unless you are knowingly
downloading data for an object where hashing will fail.


The current implementation defaults to [Always](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.DownloadValidationMode#Google_Cloud_Storage_V1_DownloadValidationMode_Always); in a future
major version the default will change to [Automatic](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.DownloadValidationMode#Google_Cloud_Storage_V1_DownloadValidationMode_Automatic) which will
automatically ignore the hash where validation is expected to fail (even with valid data).

### 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` |   |

### Generation

    public long? Generation { get; set; }

The generation to download. When not specified, the latest version
is always downloaded.

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

### IfGenerationMatch

    public long? IfGenerationMatch { get; set; }

Precondition for download: the object is only downloaded if its 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 download: the object is only downloaded if its 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 download: the object is only downloaded if its 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 download: the object is only downloaded if its meta-generation does not match the given value.

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

### Range

    public RangeHeaderValue Range { get; set; }

If non-null, limits the range of bytes of the object to download.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.net.http.headers.rangeheadervalue` |   |

### 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` |   |