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

Describes how to route traffic.

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

## Namespace

Google \\ Cloud \\ NetworkServices \\ V1 \\ GrpcRoute

## 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.GrpcRoute.RouteMatch>` Optional. Matches define conditions used for matching the rule against incoming gRPC 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. |
| `↳ action` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.GrpcRoute.RouteAction` Required. A detailed rule defining how to route traffic. This field is required. |

### getMatches

Optional. Matches define conditions used for matching the rule against
incoming gRPC 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.

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

### setMatches

Optional. Matches define conditions used for matching the rule against
incoming gRPC 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.

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

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

### getAction

Required. A detailed rule defining how to route traffic. This field is
required.

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

### hasAction

### clearAction

### setAction

Required. A detailed rule defining how to route traffic. This field is
required.

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

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