Google Cloud Functions V2 Client - Class PBFunction (2.1.4)
Stay organized with collections
Save and categorize content based on your preferences.
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.
| Returns |
| Type |
Description |
Google\Protobuf\Timestamp|null |
|
hasUpdateTime
clearUpdateTime
setUpdateTime
Output only. The last update timestamp of a Cloud Function.
| Parameter |
| Name |
Description |
var |
Google\Protobuf\Timestamp
|
| Returns |
| Type |
Description |
$this |
|
getLabels
Labels associated with this Cloud Function.
| Returns |
| Type |
Description |
Google\Protobuf\Internal\MapField |
|
setLabels
Labels associated with this Cloud Function.
| Parameter |
| Name |
Description |
var |
array|Google\Protobuf\Internal\MapField
|
| Returns |
| Type |
Description |
$this |
|
getStateMessages
Output only. State Messages for this Cloud Function.
| Returns |
| Type |
Description |
Google\Protobuf\RepeatedField<StateMessage> |
|
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.
| Returns |
| Type |
Description |
Google\Protobuf\Timestamp|null |
|
hasCreateTime
clearCreateTime
setCreateTime
Output only. The create timestamp of a Cloud Function. This is only
applicable to 2nd Gen functions.
| Parameter |
| Name |
Description |
var |
Google\Protobuf\Timestamp
|
| Returns |
| Type |
Description |
$this |
|
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-07-31 UTC.
[null,null,["Last updated 2026-07-31 UTC."],[],[]]