# Google Cloud Network Connectivity V1 Client - Class Route (2.5.3)

2.5.3 (latest) 2.5.2 2.4.0 2.3.0 2.2.2 2.1.2 2.0.2 1.5.5 1.4.2 1.3.0 1.2.0 1.1.1 1.0.5 Reference documentation and code samples for the Google Cloud Network Connectivity V1 Client class Route.

A route defines a path from VM instances within a spoke to a specific
destination resource. Only VPC spokes have routes.

Generated from protobuf message `google.cloud.networkconnectivity.v1.Route`

## Namespace

Google \\ Cloud \\ NetworkConnectivity \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Immutable. The name of the route. Route names must be unique. Route names use the following form: `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}/routes/{route_id}` |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time the route was created. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time the route was last updated. |
| `↳ ip_cidr_range` | `string` The destination IP address range. |
| `↳ type` | `int` Output only. The route's type. Its type is determined by the properties of its IP address range. |
| `↳ next_hop_vpc_network` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.NextHopVpcNetwork` Immutable. The destination VPC network for packets on this route. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional labels in key-value pair format. For more information about labels, see [Requirements for labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements). |
| `↳ description` | `string` An optional description of the route. |
| `↳ uid` | `string` Output only. The Google-generated UUID for the route. This value is unique across all Network Connectivity Center route resources. If a route is deleted and another with the same name is created, the new route is assigned a different `uid`. |
| `↳ state` | `int` Output only. The current lifecycle state of the route. |
| `↳ spoke` | `string` Immutable. The spoke that this route leads to. Example: projects/12345/locations/global/spokes/SPOKE |
| `↳ location` | `string` Output only. The origin location of the route. Uses the following form: "projects/{project}/locations/{location}" Example: projects/1234/locations/us-central1 |
| `↳ priority` | `int|string` Output only. The priority of this route. Priority is used to break ties in cases where a destination matches more than one route. In these cases the route with the lowest-numbered priority value wins. |
| `↳ next_hop_vpn_tunnel` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.NextHopVPNTunnel` Immutable. The next-hop VPN tunnel for packets on this route. |
| `↳ next_hop_router_appliance_instance` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.NextHopRouterApplianceInstance` Immutable. The next-hop Router appliance instance for packets on this route. |
| `↳ next_hop_interconnect_attachment` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.NextHopInterconnectAttachment` Immutable. The next-hop VLAN attachment for packets on this route. |

### getName

Immutable. The name of the route. Route names must be unique. Route names
use the following form:
`projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}/routes/{route_id}`

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

### setName

Immutable. The name of the route. Route names must be unique. Route names
use the following form:
`projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}/routes/{route_id}`

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

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

### getCreateTime

Output only. The time the route was created.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The time the route was created.

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

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

### getUpdateTime

Output only. The time the route was last updated.

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

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The time the route was last updated.

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

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

### getIpCidrRange

The destination IP address range.

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

### setIpCidrRange

The destination IP address range.

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

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

### getType

Output only. The route's type. Its type is determined by the properties of
its IP address range.

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

### setType

Output only. The route's type. Its type is determined by the properties of
its IP address range.

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

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

### getNextHopVpcNetwork

Immutable. The destination VPC network for packets on this route.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.NextHopVpcNetwork|null` |   |

### hasNextHopVpcNetwork

### clearNextHopVpcNetwork

### setNextHopVpcNetwork

Immutable. The destination VPC network for packets on this route.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.NextHopVpcNetwork` |

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

### getLabels

Optional labels in key-value pair format. For more information about
labels, see [Requirements for
labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).

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

### setLabels

Optional labels in key-value pair format. For more information about
labels, see [Requirements for
labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).

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

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

### getDescription

An optional description of the route.

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

### setDescription

An optional description of the route.

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

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

### getUid

Output only. The Google-generated UUID for the route. This value is unique
across all Network Connectivity Center route resources. If a
route is deleted and another with the same name is created,
the new route is assigned a different `uid`.

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

### setUid

Output only. The Google-generated UUID for the route. This value is unique
across all Network Connectivity Center route resources. If a
route is deleted and another with the same name is created,
the new route is assigned a different `uid`.

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

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

### getState

Output only. The current lifecycle state of the route.

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

### setState

Output only. The current lifecycle state of the route.

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

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

### getSpoke

Immutable. The spoke that this route leads to.

Example: projects/12345/locations/global/spokes/SPOKE

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

### setSpoke

Immutable. The spoke that this route leads to.

Example: projects/12345/locations/global/spokes/SPOKE

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

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

### getLocation

Output only. The origin location of the route.

Uses the following form: "projects/{project}/locations/{location}"
Example: projects/1234/locations/us-central1

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

### setLocation

Output only. The origin location of the route.

Uses the following form: "projects/{project}/locations/{location}"
Example: projects/1234/locations/us-central1

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

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

### getPriority

Output only. The priority of this route. Priority is used to break ties in
cases where a destination matches more than one route. In these cases the
route with the lowest-numbered priority value wins.

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

### setPriority

Output only. The priority of this route. Priority is used to break ties in
cases where a destination matches more than one route. In these cases the
route with the lowest-numbered priority value wins.

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

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

### getNextHopVpnTunnel

Immutable. The next-hop VPN tunnel for packets on this route.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.NextHopVPNTunnel|null` |   |

### hasNextHopVpnTunnel

### clearNextHopVpnTunnel

### setNextHopVpnTunnel

Immutable. The next-hop VPN tunnel for packets on this route.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.NextHopVPNTunnel` |

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

### getNextHopRouterApplianceInstance

Immutable. The next-hop Router appliance instance for packets on this
route.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.NextHopRouterApplianceInstance|null` |   |

### hasNextHopRouterApplianceInstance

### clearNextHopRouterApplianceInstance

### setNextHopRouterApplianceInstance

Immutable. The next-hop Router appliance instance for packets on this
route.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.NextHopRouterApplianceInstance` |

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

### getNextHopInterconnectAttachment

Immutable. The next-hop VLAN attachment for packets on this route.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.NextHopInterconnectAttachment|null` |   |

### hasNextHopInterconnectAttachment

### clearNextHopInterconnectAttachment

### setNextHopInterconnectAttachment

Immutable. The next-hop VLAN attachment for packets on this route.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.NextHopInterconnectAttachment` |

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