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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Google Cloud Functions V2 Client - Class SecretVersion (2.0.6)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.6 (latest)](/php/docs/reference/cloud-functions/latest/V2.SecretVolume.SecretVersion)\n- [2.0.5](/php/docs/reference/cloud-functions/2.0.5/V2.SecretVolume.SecretVersion)\n- [1.7.0](/php/docs/reference/cloud-functions/1.7.0/V2.SecretVolume.SecretVersion)\n- [1.6.5](/php/docs/reference/cloud-functions/1.6.5/V2.SecretVolume.SecretVersion)\n- [1.5.0](/php/docs/reference/cloud-functions/1.5.0/V2.SecretVolume.SecretVersion)\n- [1.4.2](/php/docs/reference/cloud-functions/1.4.2/V2.SecretVolume.SecretVersion)\n- [1.3.1](/php/docs/reference/cloud-functions/1.3.1/V2.SecretVolume.SecretVersion)\n- [1.2.0](/php/docs/reference/cloud-functions/1.2.0/V2.SecretVolume.SecretVersion)\n- [1.1.2](/php/docs/reference/cloud-functions/1.1.2/V2.SecretVolume.SecretVersion)\n- [1.0.3](/php/docs/reference/cloud-functions/1.0.3/V2.SecretVolume.SecretVersion) \nReference documentation and code samples for the Google Cloud Functions V2 Client class SecretVersion.\n\nConfiguration for a single version.\n\nGenerated from protobuf message `google.cloud.functions.v2.SecretVolume.SecretVersion`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Functions \\\\ V2 \\\\ SecretVolume\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getVersion\n\nVersion of the secret (version number or the string 'latest'). It is\npreferable to use `latest` version with secret volumes as secret value\nchanges are reflected immediately.\n\n### setVersion\n\nVersion of the secret (version number or the string 'latest'). It is\npreferable to use `latest` version with secret volumes as secret value\nchanges are reflected immediately.\n\n### getPath\n\nRelative path of the file under the mount path where the secret value for\nthis version will be fetched and made available. For example, setting the\nmount_path as '/etc/secrets' and path as `secret_foo` would mount the\nsecret value file at `/etc/secrets/secret_foo`.\n\n### setPath\n\nRelative path of the file under the mount path where the secret value for\nthis version will be fetched and made available. For example, setting the\nmount_path as '/etc/secrets' and path as `secret_foo` would mount the\nsecret value file at `/etc/secrets/secret_foo`."]]