# Google Cloud Functions V2 Client - Class PBFunction (2.1.3)

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

Constructor.

| **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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-functions/latest/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` | `https://docs.cloud.google.com/php/docs/reference/cloud-functions/latest/V2.BuildConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getServiceConfig

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-functions/latest/V2.ServiceConfig|null` |   |

### hasServiceConfig

### clearServiceConfig

### setServiceConfig

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-functions/latest/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** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-functions/latest/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` | `https://docs.cloud.google.com/php/docs/reference/cloud-functions/latest/V2.EventTrigger` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getState

Output only. State of the function.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-functions/latest/V2.PBFunction.State). |

### setState

Output only. State of the function.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-functions/latest/V2.PBFunction.State). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUpdateTime

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLabels

Labels associated with this Cloud Function.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

Labels associated with this Cloud Function.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getStateMessages

Output only. State Messages for this Cloud Function.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-functions/latest/V2.StateMessage>` |   |

### setStateMessages

Output only. State Messages for this Cloud Function.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-functions/latest/V2.StateMessage>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEnvironment

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Environment](https://docs.cloud.google.com/php/docs/reference/cloud-functions/latest/V2.Environment). |

### setEnvironment

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Environment](https://docs.cloud.google.com/php/docs/reference/cloud-functions/latest/V2.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** |
| `https://protobuf.dev/reference/php/api-docs/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` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |