Google Cloud Functions V2 Client - Class PBFunction (1.7.0)

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

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ name string

A user-defined name of the function. Function names must be unique globally and match pattern projects/*/locations/*/functions/*

↳ description string

User-provided description of a function.

↳ build_config Google\Cloud\Functions\V2\BuildConfig

Describes the Build step of the function that builds a container from the given source.

↳ service_config Google\Cloud\Functions\V2\ServiceConfig

Describes the Service being deployed. Currently deploys services to Cloud Run (fully managed).

↳ event_trigger Google\Cloud\Functions\V2\EventTrigger

An Eventarc trigger managed by Google Cloud Functions that fires events in response to a condition in another service.

↳ state int

Output only. State of the function.

↳ update_time Google\Protobuf\Timestamp

Output only. The last update timestamp of a Cloud Function.

↳ labels array|Google\Protobuf\Internal\MapField

Labels associated with this Cloud Function.

↳ state_messages array<Google\Cloud\Functions\V2\StateMessage>

Output only. State Messages for this Cloud Function.

↳ environment int

Describe whether the function is 1st Gen or 2nd Gen.

↳ url string

Output only. The deployed url for the function.

↳ kms_key_name string

[Preview] 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}.

↳ satisfies_pzs bool

Output only. Reserved for future use.

↳ create_time Google\Protobuf\Timestamp

Output only. The create timestamp of a Cloud Function. This is only applicable to 2nd Gen functions.

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.

Returns
Type Description
Google\Cloud\Functions\V2\BuildConfig|null

hasBuildConfig

clearBuildConfig

setBuildConfig

Describes the Build step of the function that builds a container from the given source.

Parameter
Name Description
var Google\Cloud\Functions\V2\BuildConfig
Returns
Type Description
$this

getServiceConfig

Describes the Service being deployed. Currently deploys services to Cloud Run (fully managed).

Returns
Type Description
Google\Cloud\Functions\V2\ServiceConfig|null

hasServiceConfig

clearServiceConfig

setServiceConfig

Describes the Service being deployed. Currently deploys services to Cloud Run (fully managed).

Parameter
Name Description
var Google\Cloud\Functions\V2\ServiceConfig
Returns
Type Description
$this

getEventTrigger

An Eventarc trigger managed by Google Cloud Functions that fires events in response to a condition in another service.

Returns
Type Description
Google\Cloud\Functions\V2\EventTrigger|null

hasEventTrigger

clearEventTrigger

setEventTrigger

An Eventarc trigger managed by Google Cloud Functions that fires events in response to a condition in another service.

Parameter
Name Description
var Google\Cloud\Functions\V2\EventTrigger
Returns
Type Description
$this

getState

Output only. State of the function.

Returns
Type Description
int

setState

Output only. State of the function.

Parameter
Name Description
var int
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\Internal\RepeatedField

setStateMessages

Output only. State Messages for this Cloud Function.

Parameter
Name Description
var array<Google\Cloud\Functions\V2\StateMessage>
Returns
Type Description
$this

getEnvironment

Describe whether the function is 1st Gen or 2nd Gen.

Returns
Type Description
int

setEnvironment

Describe whether the function is 1st Gen or 2nd Gen.

Parameter
Name Description
var int
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

[Preview] 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

[Preview] 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