# Google Cloud Functions V2 Client - Class SecretVersion (2.1.3)

2.1.3 (latest) 2.1.2 2.0.6 1.7.0 1.6.5 1.5.0 1.4.2 1.3.1 1.2.0 1.1.2 1.0.3 Reference documentation and code samples for the Google Cloud Functions V2 Client class SecretVersion.

Configuration for a single version.

Generated from protobuf message `google.cloud.functions.v2.SecretVolume.SecretVersion`

## Namespace

Google \\ Cloud \\ Functions \\ V2 \\ SecretVolume

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ version` | `string` Version of the secret (version number or the string 'latest'). It is preferable to use `latest` version with secret volumes as secret value changes are reflected immediately. |
| `↳ path` | `string` Relative path of the file under the mount path where the secret value for this version will be fetched and made available. For example, setting the mount_path as '/etc/secrets' and path as `secret_foo` would mount the secret value file at `/etc/secrets/secret_foo`. |

### getVersion

Version of the secret (version number or the string 'latest'). It is
preferable to use `latest` version with secret volumes as secret value
changes are reflected immediately.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setVersion

Version of the secret (version number or the string 'latest'). It is
preferable to use `latest` version with secret volumes as secret value
changes are reflected immediately.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPath

Relative path of the file under the mount path where the secret value for
this version will be fetched and made available. For example, setting the
mount_path as '/etc/secrets' and path as `secret_foo` would mount the
secret value file at `/etc/secrets/secret_foo`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setPath

Relative path of the file under the mount path where the secret value for
this version will be fetched and made available. For example, setting the
mount_path as '/etc/secrets' and path as `secret_foo` would mount the
secret value file at `/etc/secrets/secret_foo`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |