# Network Services V1 API - Class Google::Cloud::NetworkServices::V1::GrpcRoute::RouteRule (v2.10.1)

2.10.1 (latest) 2.10.0 2.9.0 2.8.0 2.7.0 2.6.1 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.1 1.2.0 1.1.0 1.0.1 0.2.0 0.1.0 Reference documentation and code samples for the Network Services V1 API class Google::Cloud::NetworkServices::V1::GrpcRoute::RouteRule.

Describes how to route traffic.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #action

    def action() -> ::Google::Cloud::NetworkServices::V1::GrpcRoute::RouteAction

**Returns**

- ([::Google::Cloud::NetworkServices::V1::GrpcRoute::RouteAction](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-GrpcRoute-RouteAction)) --- Required. A detailed rule defining how to route traffic. This field is required.

### #action=

    def action=(value) -> ::Google::Cloud::NetworkServices::V1::GrpcRoute::RouteAction

**Parameter**

- **value** ([::Google::Cloud::NetworkServices::V1::GrpcRoute::RouteAction](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-GrpcRoute-RouteAction)) --- Required. A detailed rule defining how to route traffic. This field is required.
**Returns**

- ([::Google::Cloud::NetworkServices::V1::GrpcRoute::RouteAction](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-GrpcRoute-RouteAction)) --- Required. A detailed rule defining how to route traffic. This field is required.

### #matches

    def matches() -> ::Array<::Google::Cloud::NetworkServices::V1::GrpcRoute::RouteMatch>

**Returns**

- (::Array\<[::Google::Cloud::NetworkServices::V1::GrpcRoute::RouteMatch](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-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.

### #matches=

    def matches=(value) -> ::Array<::Google::Cloud::NetworkServices::V1::GrpcRoute::RouteMatch>

**Parameter**

- **value** (::Array\<[::Google::Cloud::NetworkServices::V1::GrpcRoute::RouteMatch](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-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.
**Returns**

- (::Array\<[::Google::Cloud::NetworkServices::V1::GrpcRoute::RouteMatch](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-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.