# Google Cloud Network Services V1 Client - Class LbTrafficExtension (0.8.2)

0.8.2 (latest) 0.8.1 0.7.1 0.6.1 0.5.0 0.4.0 0.3.0 0.2.3 0.1.1 Reference documentation and code samples for the Google Cloud Network Services V1 Client class LbTrafficExtension.

`LbTrafficExtension` is a resource that lets the extension service modify the
headers and payloads of both requests and responses without impacting the
choice of backend services or any other security policies associated with the
backend service.

Generated from protobuf message `google.cloud.networkservices.v1.LbTrafficExtension`

## Namespace

Google \\ Cloud \\ NetworkServices \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Required. Identifier. Name of the `LbTrafficExtension` resource in the following format: `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The timestamp when the resource was created. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The timestamp when the resource was updated. |
| `↳ description` | `string` Optional. A human-readable description of the resource. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. Set of labels associated with the `LbTrafficExtension` resource. The format must comply with [the requirements for labels](https://cloud.google.com/compute/docs/labeling-resources#requirements) for Google Cloud resources. |
| `↳ forwarding_rules` | `string[]` Optional. A list of references to the forwarding rules to which this service extension is attached. At least one forwarding rule is required. Only one `LbTrafficExtension` resource can be associated with a forwarding rule. |
| `↳ extension_chains` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.ExtensionChain>` Required. A set of ordered extension chains that contain the match conditions and extensions to execute. Match conditions for each extension chain are evaluated in sequence for a given request. The first extension chain that has a condition that matches the request is executed. Any subsequent extension chains do not execute. Limited to 5 extension chains per resource. |
| `↳ load_balancing_scheme` | `int` Required. All backend services and forwarding rules referenced by this extension must share the same load balancing scheme. Supported values: `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more information, refer to [Backend services overview](https://cloud.google.com/load-balancing/docs/backend-service). |
| `↳ metadata` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct` Optional. The metadata provided here is included as part of the `metadata_context` (of type `google.protobuf.Struct`) in the `ProcessingRequest` message sent to the extension server. The metadata applies to all extensions in all extensions chains in this resource. The metadata is available under the key `com.google.lb_traffic_extension.<resource_name>`. The following variables are supported in the metadata: `{forwarding_rule_id}` - substituted with the forwarding rule's fully qualified resource name. This field must not be set if at least one of the extension chains contains plugin extensions. Setting it results in a validation error. You can set metadata at either the resource level or the extension level. The extension level metadata is recommended because you can pass a different set of metadata through each extension to the backend. |

### getName

Required. Identifier. Name of the `LbTrafficExtension` resource in the
following format:
`projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Required. Identifier. Name of the `LbTrafficExtension` resource in the
following format:
`projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_extension}`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

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

### getCreateTime

Output only. The timestamp when the resource was created.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The timestamp when the resource was created.

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

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

### getUpdateTime

Output only. The timestamp when the resource was updated.

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

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The timestamp when the resource was updated.

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

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

### getDescription

Optional. A human-readable description of the resource.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDescription

Optional. A human-readable description of the resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

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

### getLabels

Optional. Set of labels associated with the `LbTrafficExtension` resource.

The format must comply with [the requirements for
labels](https://cloud.google.com/compute/docs/labeling-resources#requirements)
for Google Cloud resources.

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

### setLabels

Optional. Set of labels associated with the `LbTrafficExtension` resource.

The format must comply with [the requirements for
labels](https://cloud.google.com/compute/docs/labeling-resources#requirements)
for Google Cloud resources.

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

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

### getForwardingRules

Optional. A list of references to the forwarding rules to which this
service extension is attached. At least one forwarding rule is required.

Only one `LbTrafficExtension` resource can be associated with a forwarding
rule.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setForwardingRules

Optional. A list of references to the forwarding rules to which this
service extension is attached. At least one forwarding rule is required.

Only one `LbTrafficExtension` resource can be associated with a forwarding
rule.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string[]` |

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

### getExtensionChains

Required. A set of ordered extension chains that contain the match
conditions and extensions to execute. Match conditions for each extension
chain are evaluated in sequence for a given request. The first extension
chain that has a condition that matches the request is executed.

Any subsequent extension chains do not execute.
Limited to 5 extension chains per resource.

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

### setExtensionChains

Required. A set of ordered extension chains that contain the match
conditions and extensions to execute. Match conditions for each extension
chain are evaluated in sequence for a given request. The first extension
chain that has a condition that matches the request is executed.

Any subsequent extension chains do not execute.
Limited to 5 extension chains per resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.ExtensionChain>` |

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

### getLoadBalancingScheme

Required. All backend services and forwarding rules referenced by this
extension must share the same load balancing scheme. Supported values:
`INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more information, refer to
[Backend services
overview](https://cloud.google.com/load-balancing/docs/backend-service).

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

### setLoadBalancingScheme

Required. All backend services and forwarding rules referenced by this
extension must share the same load balancing scheme. Supported values:
`INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more information, refer to
[Backend services
overview](https://cloud.google.com/load-balancing/docs/backend-service).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [LoadBalancingScheme](https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.LoadBalancingScheme). |

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

### getMetadata

Optional. The metadata provided here is included as part of the
`metadata_context` (of type `google.protobuf.Struct`) in the
`ProcessingRequest` message sent to the extension server.

The metadata applies to all extensions in all extensions chains in this
resource.
The metadata is available under the key
`com.google.lb_traffic_extension.<resource_name>`.
The following variables are supported in the metadata:
`{forwarding_rule_id}` - substituted with the forwarding rule's fully
qualified resource name.
This field must not be set if at least one of the extension chains
contains plugin extensions. Setting it results in a validation error.
You can set metadata at either the resource level or the extension level.
The extension level metadata is recommended because you can pass a
different set of metadata through each extension to the backend.

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

### hasMetadata

### clearMetadata

### setMetadata

Optional. The metadata provided here is included as part of the
`metadata_context` (of type `google.protobuf.Struct`) in the
`ProcessingRequest` message sent to the extension server.

The metadata applies to all extensions in all extensions chains in this
resource.
The metadata is available under the key
`com.google.lb_traffic_extension.<resource_name>`.
The following variables are supported in the metadata:
`{forwarding_rule_id}` - substituted with the forwarding rule's fully
qualified resource name.
This field must not be set if at least one of the extension chains
contains plugin extensions. Setting it results in a validation error.
You can set metadata at either the resource level or the extension level.
The extension level metadata is recommended because you can pass a
different set of metadata through each extension to the backend.

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

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