Project identifier (preferably project number but can also be the
project ID) of the project that contains the secret. If not set, it is
assumed that the secret is in the same project as the function.
Project identifier (preferably project number but can also be the
project ID) of the project that contains the secret. If not set, it is
assumed that the secret is in the same project as the function.
Version of the secret (version number or the string 'latest'). It is
recommended to use a numeric version for secret environment variables as
any updates to the secret value is not reflected until new instances
start.
Version of the secret (version number or the string 'latest'). It is
recommended to use a numeric version for secret environment variables as
any updates to the secret value is not reflected until new instances
start.
[[["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-08-07 UTC."],[],[],null,["# Interface SecretEnvVarOrBuilder (0.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.16.0 (latest)](/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.functions.v2.SecretEnvVarOrBuilder)\n- [0.15.0](/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.functions.v2.SecretEnvVarOrBuilder)\n- [0.14.1](/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.functions.v2.SecretEnvVarOrBuilder) \n\n public interface SecretEnvVarOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getKey()\n\n public abstract String getKey()\n\nName of the environment variable.\n\n`string key = 1;`\n\n### getKeyBytes()\n\n public abstract ByteString getKeyBytes()\n\nName of the environment variable.\n\n`string key = 1;`\n\n### getProjectId()\n\n public abstract String getProjectId()\n\nProject identifier (preferably project number but can also be the\nproject ID) of the project that contains the secret. If not set, it is\nassumed that the secret is in the same project as the function.\n\n`string project_id = 2;`\n\n### getProjectIdBytes()\n\n public abstract ByteString getProjectIdBytes()\n\nProject identifier (preferably project number but can also be the\nproject ID) of the project that contains the secret. If not set, it is\nassumed that the secret is in the same project as the function.\n\n`string project_id = 2;`\n\n### getSecret()\n\n public abstract String getSecret()\n\nName of the secret in secret manager (not the full resource name).\n\n`string secret = 3;`\n\n### getSecretBytes()\n\n public abstract ByteString getSecretBytes()\n\nName of the secret in secret manager (not the full resource name).\n\n`string secret = 3;`\n\n### getVersion()\n\n public abstract String getVersion()\n\nVersion of the secret (version number or the string 'latest'). It is\nrecommended to use a numeric version for secret environment variables as\nany updates to the secret value is not reflected until new instances\nstart.\n\n`string version = 4;`\n\n### getVersionBytes()\n\n public abstract ByteString getVersionBytes()\n\nVersion of the secret (version number or the string 'latest'). It is\nrecommended to use a numeric version for secret environment variables as\nany updates to the secret value is not reflected until new instances\nstart.\n\n`string version = 4;`"]]