Send feedback
Google Cloud Functions V2 Client - Class PBFunction (2.1.3)
Stay organized with collections
Save and categorize content based on your preferences.
2.1.3 (latest)
2.1.2
2.0.6
1.7.0
1.6.5
1.5.0
1.4.2
1.3.1
1.2.0
1.1.2
1.0.3
Reference documentation and code samples for the Google Cloud Functions V2 Client class PBFunction.
Describes a Cloud Function that contains user computation executed in
response to an event. It encapsulates function and trigger configurations.
Generated from protobuf message google.cloud.functions.v2.Function
Namespace
Google \ Cloud \ Functions \ V2
Methods
__construct
Parameter
Name
Description
data
mixed
getName
A user-defined name of the function. Function names must be unique
globally and match pattern projects/*/locations/*/functions/*
Returns
Type
Description
string
setName
A user-defined name of the function. Function names must be unique
globally and match pattern projects/*/locations/*/functions/*
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDescription
User-provided description of a function.
Returns
Type
Description
string
setDescription
User-provided description of a function.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getBuildConfig
Describes the Build step of the function that builds a container from the
given source.
hasBuildConfig
clearBuildConfig
setBuildConfig
Describes the Build step of the function that builds a container from the
given source.
Returns
Type
Description
$this
getServiceConfig
Describes the Service being deployed. Currently deploys services to Cloud
Run (fully managed).
hasServiceConfig
clearServiceConfig
setServiceConfig
Describes the Service being deployed. Currently deploys services to Cloud
Run (fully managed).
Returns
Type
Description
$this
getEventTrigger
An Eventarc trigger managed by Google Cloud Functions that fires events in
response to a condition in another service.
hasEventTrigger
clearEventTrigger
setEventTrigger
An Eventarc trigger managed by Google Cloud Functions that fires events in
response to a condition in another service.
Returns
Type
Description
$this
getState
Output only. State of the function.
Returns
Type
Description
int
Enum of type State .
setState
Output only. State of the function.
Parameter
Name
Description
var
int
Enum of type State .
Returns
Type
Description
$this
getUpdateTime
Output only. The last update timestamp of a Cloud Function.
hasUpdateTime
clearUpdateTime
setUpdateTime
Output only. The last update timestamp of a Cloud Function.
Returns
Type
Description
$this
getLabels
Labels associated with this Cloud Function.
setLabels
Labels associated with this Cloud Function.
Returns
Type
Description
$this
getStateMessages
Output only. State Messages for this Cloud Function.
setStateMessages
Output only. State Messages for this Cloud Function.
Returns
Type
Description
$this
getEnvironment
Describe whether the function is 1st Gen or 2nd Gen.
setEnvironment
Describe whether the function is 1st Gen or 2nd Gen.
Parameter
Name
Description
var
int
Enum of type Environment .
Returns
Type
Description
$this
getUrl
Output only. The deployed url for the function.
Returns
Type
Description
string
setUrl
Output only. The deployed url for the function.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getKmsKeyName
Resource name of a KMS crypto key (managed by the user) used to
encrypt/decrypt function resources.
It must match the pattern
projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}.
Returns
Type
Description
string
setKmsKeyName
Resource name of a KMS crypto key (managed by the user) used to
encrypt/decrypt function resources.
It must match the pattern
projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getSatisfiesPzs
Output only. Reserved for future use.
Returns
Type
Description
bool
setSatisfiesPzs
Output only. Reserved for future use.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
getCreateTime
Output only. The create timestamp of a Cloud Function. This is only
applicable to 2nd Gen functions.
hasCreateTime
clearCreateTime
setCreateTime
Output only. The create timestamp of a Cloud Function. This is only
applicable to 2nd Gen functions.
Returns
Type
Description
$this
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-03-18 UTC.
Need to tell us more?
[[["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 2026-03-18 UTC."],[],[]]