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 messagegoogle.cloud.secretmanager.v1beta2.SecretVersion
Namespace
Google \ Cloud \ SecretManager \ V1beta2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Output only. The resource name of theSecretVersionin the formatprojects/*/secrets/*/versions/*.SecretVersionIDs in aSecretstart at 1 and are incremented for each subsequent version of the secret.
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.
Output only. The customer-managed encryption status of theSecretVersion. Only populated if customer-managed encryption is used andSecretis a Regionalised Secret.
getName
Output only. The resource name of theSecretVersionin the
formatprojects/*/secrets/*/versions/*.
SecretVersionIDs in aSecretstart at 1 and are
incremented for each subsequent version of the secret.
Returns
Type
Description
string
setName
Output only. The resource name of theSecretVersionin the
formatprojects/*/secrets/*/versions/*.
SecretVersionIDs in aSecretstart 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 theSecretVersionwas
created.
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.
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.
Output only. The customer-managed encryption status of theSecretVersion. Only
populated if customer-managed encryption is used andSecretis a Regionalised
Secret.
Output only. The customer-managed encryption status of theSecretVersion. Only
populated if customer-managed encryption is used andSecretis a Regionalised
Secret.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Secret Manager V1beta2 Client - Class SecretVersion (2.1.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.1 (latest)](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion)\n- [2.1.0](/php/docs/reference/cloud-secret-manager/2.1.0/V1beta2.SecretVersion)\n- [2.0.2](/php/docs/reference/cloud-secret-manager/2.0.2/V1beta2.SecretVersion)\n- [1.15.4](/php/docs/reference/cloud-secret-manager/1.15.4/V1beta2.SecretVersion)\n- [1.13.0](/php/docs/reference/cloud-secret-manager/1.13.0/V1beta2.SecretVersion)\n- [1.12.3](/php/docs/reference/cloud-secret-manager/1.12.3/V1beta2.SecretVersion)\n- [1.11.0](/php/docs/reference/cloud-secret-manager/1.11.0/V1beta2.SecretVersion)\n- [1.10.4](/php/docs/reference/cloud-secret-manager/1.10.4/V1beta2.SecretVersion)\n- [1.9.7](/php/docs/reference/cloud-secret-manager/1.9.7/V1beta2.SecretVersion) \n| **Beta**\n|\n|\n| This library is covered by the [Pre-GA Offerings Terms](/terms/service-terms#1)\n| of the Terms of Service. Pre-GA libraries might have limited support,\n| and changes to pre-GA libraries might not be compatible with other pre-GA versions.\n| For more information, see the\n[launch stage descriptions](/products#product-launch-stages). \nReference documentation and code samples for the Secret Manager V1beta2 Client class SecretVersion.\n\nA secret version resource in the Secret Manager API.\n\nGenerated from protobuf message `google.cloud.secretmanager.v1beta2.SecretVersion`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ SecretManager \\\\ V1beta2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nOutput only. The resource name of the\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion) in the\nformat `projects/*/secrets/*/versions/*`.\n\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion) IDs in a\n[Secret](/php/docs/reference/cloud-secret-manager/latest/V1beta2.Secret) start at 1 and are\nincremented for each subsequent version of the secret.\n\n### setName\n\nOutput only. The resource name of the\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion) in the\nformat `projects/*/secrets/*/versions/*`.\n\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion) IDs in a\n[Secret](/php/docs/reference/cloud-secret-manager/latest/V1beta2.Secret) start at 1 and are\nincremented for each subsequent version of the secret.\n\n### getCreateTime\n\nOutput only. The time at which the\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion) was\ncreated.\n\n### hasCreateTime\n\n### clearCreateTime\n\n### setCreateTime\n\nOutput only. The time at which the\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion) was\ncreated.\n\n### getDestroyTime\n\nOutput only. The time this\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion) was\ndestroyed. Only present if\n[state](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion#_Google_Cloud_SecretManager_V1beta2_SecretVersion__getState__) is\n[DESTROYED](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion.State#_Google_Cloud_SecretManager_V1beta2_SecretVersion_State__DESTROYED).\n\n### hasDestroyTime\n\n### clearDestroyTime\n\n### setDestroyTime\n\nOutput only. The time this\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion) was\ndestroyed. Only present if\n[state](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion#_Google_Cloud_SecretManager_V1beta2_SecretVersion__getState__) is\n[DESTROYED](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion.State#_Google_Cloud_SecretManager_V1beta2_SecretVersion_State__DESTROYED).\n\n### getState\n\nOutput only. The current state of the\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion).\n\n### setState\n\nOutput only. The current state of the\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion).\n\n### getReplicationStatus\n\nThe replication status of the\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion).\n\n### hasReplicationStatus\n\n### clearReplicationStatus\n\n### setReplicationStatus\n\nThe replication status of the\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion).\n\n### getEtag\n\nOutput only. Etag of the currently stored\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion).\n\n### setEtag\n\nOutput only. Etag of the currently stored\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion).\n\n### getClientSpecifiedPayloadChecksum\n\nOutput only. True if payload checksum specified in\n[SecretPayload](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretPayload) object\nhas been received by\n[SecretManagerService](/php/docs/reference/cloud-secret-manager/latest/V1beta2.Client.SecretManagerServiceClient)\non\n[SecretManagerService.AddSecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.Client.SecretManagerServiceClient#_Google_Cloud_SecretManager_V1beta2_Client_SecretManagerServiceClient__addSecretVersion__).\n\n### setClientSpecifiedPayloadChecksum\n\nOutput only. True if payload checksum specified in\n[SecretPayload](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretPayload) object\nhas been received by\n[SecretManagerService](/php/docs/reference/cloud-secret-manager/latest/V1beta2.Client.SecretManagerServiceClient)\non\n[SecretManagerService.AddSecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.Client.SecretManagerServiceClient#_Google_Cloud_SecretManager_V1beta2_Client_SecretManagerServiceClient__addSecretVersion__).\n\n### getScheduledDestroyTime\n\nOptional. Output only. Scheduled destroy time for secret version.\n\nThis is a part of the Delayed secret version destroy feature. For a\nSecret with a valid version destroy TTL, when a secert version is\ndestroyed, version is moved to disabled state and it is scheduled for\ndestruction Version is destroyed only after the scheduled_destroy_time.\n\n### hasScheduledDestroyTime\n\n### clearScheduledDestroyTime\n\n### setScheduledDestroyTime\n\nOptional. Output only. Scheduled destroy time for secret version.\n\nThis is a part of the Delayed secret version destroy feature. For a\nSecret with a valid version destroy TTL, when a secert version is\ndestroyed, version is moved to disabled state and it is scheduled for\ndestruction Version is destroyed only after the scheduled_destroy_time.\n\n### getCustomerManagedEncryption\n\nOutput only. The customer-managed encryption status of the\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion). Only\npopulated if customer-managed encryption is used and\n[Secret](/php/docs/reference/cloud-secret-manager/latest/V1beta2.Secret) is a Regionalised\nSecret.\n\n### hasCustomerManagedEncryption\n\n### clearCustomerManagedEncryption\n\n### setCustomerManagedEncryption\n\nOutput only. The customer-managed encryption status of the\n[SecretVersion](/php/docs/reference/cloud-secret-manager/latest/V1beta2.SecretVersion). Only\npopulated if customer-managed encryption is used and\n[Secret](/php/docs/reference/cloud-secret-manager/latest/V1beta2.Secret) is a Regionalised\nSecret."]]