Google Cloud Functions V2 Client - Class PBFunction (1.4.2)

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
NameDescription
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}.

getName

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

Returns
TypeDescription
string

setName

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDescription

User-provided description of a function.

Returns
TypeDescription
string

setDescription

User-provided description of a function.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getBuildConfig

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

Returns
TypeDescription
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
NameDescription
var Google\Cloud\Functions\V2\BuildConfig
Returns
TypeDescription
$this

getServiceConfig

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

Returns
TypeDescription
Google\Cloud\Functions\V2\ServiceConfig|null

hasServiceConfig

clearServiceConfig

setServiceConfig

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

Parameter
NameDescription
var Google\Cloud\Functions\V2\ServiceConfig
Returns
TypeDescription
$this

getEventTrigger

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

Returns
TypeDescription
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
NameDescription
var Google\Cloud\Functions\V2\EventTrigger
Returns
TypeDescription
$this

getState

Output only. State of the function.

Returns
TypeDescription
int

setState

Output only. State of the function.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getUpdateTime

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

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasUpdateTime

clearUpdateTime

setUpdateTime

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

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getLabels

Labels associated with this Cloud Function.

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setLabels

Labels associated with this Cloud Function.

Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getStateMessages

Output only. State Messages for this Cloud Function.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setStateMessages

Output only. State Messages for this Cloud Function.

Parameter
NameDescription
var array<Google\Cloud\Functions\V2\StateMessage>
Returns
TypeDescription
$this

getEnvironment

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

Returns
TypeDescription
int

setEnvironment

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

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getUrl

Output only. The deployed url for the function.

Returns
TypeDescription
string

setUrl

Output only. The deployed url for the function.

Parameter
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$this