# Google Cloud Network Services V1 Client - Class RouteRule (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 RouteRule.

Specifies how to match traffic and how to route traffic when traffic is
matched.

Generated from protobuf message `google.cloud.networkservices.v1.HttpRoute.RouteRule`

## Namespace

Google \\ Cloud \\ NetworkServices \\ V1 \\ HttpRoute

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ matches` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.RouteMatch>` A list of matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched if ANY one of the matches is satisfied. If no matches field is specified, this rule will unconditionally match traffic. If a default rule is desired to be configured, add a rule with no matches specified to the end of the rules list. |
| `↳ action` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.RouteAction` The detailed rule defining how to route matched traffic. |

### getMatches

A list of matches define conditions used for matching the rule against
incoming HTTP requests. Each match is independent, i.e. this rule will be
matched if ANY one of the matches is satisfied.

If no matches field is specified, this rule will unconditionally match
traffic.
If a default rule is desired to be configured, add a rule with no matches
specified to the end of the rules list.

| **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.HttpRoute.RouteMatch>` |   |

### setMatches

A list of matches define conditions used for matching the rule against
incoming HTTP requests. Each match is independent, i.e. this rule will be
matched if ANY one of the matches is satisfied.

If no matches field is specified, this rule will unconditionally match
traffic.
If a default rule is desired to be configured, add a rule with no matches
specified to the end of the rules list.

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

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

### getAction

The detailed rule defining how to route matched traffic.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.RouteAction|null` |   |

### hasAction

### clearAction

### setAction

The detailed rule defining how to route matched traffic.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.HttpRoute.RouteAction` |

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