# Secret Manager V1 Client - Class SecretVersion (2.3.0)

2.3.0 (latest) 2.2.2 2.1.1 2.0.2 1.15.4 1.13.0 1.12.3 1.11.0 1.10.4 1.9.7 Reference documentation and code samples for the Secret Manager V1 Client class SecretVersion.

A secret version resource in the Secret Manager API.

Generated from protobuf message `google.cloud.secretmanager.v1.SecretVersion`

## Namespace

Google \\ Cloud \\ SecretManager \\ V1

## Methods

### __construct

Constructor.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `data` | `mixed` |

### getName

Output only. The resource name of the
[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion) in the format
`projects/*/secrets/*/versions/*`.

[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion) IDs in a
[Secret](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.Secret) start at 1 and are
incremented for each subsequent version of the secret.

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

### setName

Output only. The resource name of the
[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion) in the format
`projects/*/secrets/*/versions/*`.

[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion) IDs in a
[Secret](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.Secret) start at 1 and are
incremented for each subsequent version of the secret.

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

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

### getCreateTime

Output only. The time at which the
[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion) was created.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The time at which the
[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion) was created.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getDestroyTime

Output only. The time this
[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion) was destroyed.

Only present if [state](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion#_Google_Cloud_SecretManager_V1_SecretVersion__getState__)
is
[DESTROYED](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion.State#_Google_Cloud_SecretManager_V1_SecretVersion_State__DESTROYED).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasDestroyTime

### clearDestroyTime

### setDestroyTime

Output only. The time this
[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion) was destroyed.

Only present if [state](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion#_Google_Cloud_SecretManager_V1_SecretVersion__getState__)
is
[DESTROYED](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion.State#_Google_Cloud_SecretManager_V1_SecretVersion_State__DESTROYED).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getState

Output only. The current state of the
[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion.State). |

### setState

Output only. The current state of the
[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion.State). |

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

### getReplicationStatus

The replication status of the
[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.ReplicationStatus|null` |   |

### hasReplicationStatus

### clearReplicationStatus

### setReplicationStatus

The replication status of the
[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.ReplicationStatus` |

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

### getEtag

Output only. Etag of the currently stored
[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion).

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

### setEtag

Output only. Etag of the currently stored
[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion).

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

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

### getClientSpecifiedPayloadChecksum

Output only. True if payload checksum specified in
[SecretPayload](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretPayload) object has
been received by
[SecretManagerService](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.Client.SecretManagerServiceClient)
on
[SecretManagerService.AddSecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.Client.SecretManagerServiceClient#_Google_Cloud_SecretManager_V1_Client_SecretManagerServiceClient__addSecretVersion__).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setClientSpecifiedPayloadChecksum

Output only. True if payload checksum specified in
[SecretPayload](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretPayload) object has
been received by
[SecretManagerService](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.Client.SecretManagerServiceClient)
on
[SecretManagerService.AddSecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.Client.SecretManagerServiceClient#_Google_Cloud_SecretManager_V1_Client_SecretManagerServiceClient__addSecretVersion__).

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

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

### getScheduledDestroyTime

Optional. Output only. Scheduled destroy time for secret version.

This is a part of the Delayed secret version destroy feature. For a
Secret with a valid version destroy TTL, when a secert version is
destroyed, version is moved to disabled state and it is scheduled for
destruction Version is destroyed only after the scheduled_destroy_time.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasScheduledDestroyTime

### clearScheduledDestroyTime

### setScheduledDestroyTime

Optional. Output only. Scheduled destroy time for secret version.

This is a part of the Delayed secret version destroy feature. For a
Secret with a valid version destroy TTL, when a secert version is
destroyed, version is moved to disabled state and it is scheduled for
destruction Version is destroyed only after the scheduled_destroy_time.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getCustomerManagedEncryption

Output only. The customer-managed encryption status of the
[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion). Only
populated if customer-managed encryption is used and
[Secret](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.Secret) is a regionalized secret.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.CustomerManagedEncryptionStatus|null` |   |

### hasCustomerManagedEncryption

### clearCustomerManagedEncryption

### setCustomerManagedEncryption

Output only. The customer-managed encryption status of the
[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.SecretVersion). Only
populated if customer-managed encryption is used and
[Secret](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.Secret) is a regionalized secret.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1.CustomerManagedEncryptionStatus` |

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