# Secret Manager V1beta2 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

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Secret Manager V1beta2 Client class SecretVersion.

A secret version resource in the Secret Manager API.

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

## Namespace

Google \\ Cloud \\ SecretManager \\ V1beta2

## 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/V1beta2.SecretVersion) in the
format `projects/*/secrets/*/versions/*`.

[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion) IDs in a
[Secret](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.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/V1beta2.SecretVersion) in the
format `projects/*/secrets/*/versions/*`.

[SecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion) IDs in a
[Secret](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.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/V1beta2.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/V1beta2.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/V1beta2.SecretVersion) was
destroyed. Only present if
[state](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion#_Google_Cloud_SecretManager_V1beta2_SecretVersion__getState__) is
[DESTROYED](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion.State#_Google_Cloud_SecretManager_V1beta2_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/V1beta2.SecretVersion) was
destroyed. Only present if
[state](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion#_Google_Cloud_SecretManager_V1beta2_SecretVersion__getState__) is
[DESTROYED](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion.State#_Google_Cloud_SecretManager_V1beta2_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/V1beta2.SecretVersion).

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

### setState

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.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/V1beta2.SecretVersion).

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

### hasReplicationStatus

### clearReplicationStatus

### setReplicationStatus

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.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/V1beta2.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/V1beta2.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/V1beta2.SecretPayload) object
has been received by
[SecretManagerService](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Client.SecretManagerServiceClient)
on
[SecretManagerService.AddSecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Client.SecretManagerServiceClient#_Google_Cloud_SecretManager_V1beta2_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/V1beta2.SecretPayload) object
has been received by
[SecretManagerService](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Client.SecretManagerServiceClient)
on
[SecretManagerService.AddSecretVersion](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Client.SecretManagerServiceClient#_Google_Cloud_SecretManager_V1beta2_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/V1beta2.SecretVersion). Only
populated if customer-managed encryption is used and
[Secret](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Secret) is a Regionalised
Secret.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.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/V1beta2.SecretVersion). Only
populated if customer-managed encryption is used and
[Secret](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Secret) is a Regionalised
Secret.

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

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