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

A Network Connectivity Center hub is a global management resource to which
you attach spokes. A single hub can contain spokes from multiple regions.

However, if any of a hub's spokes use the site-to-site data transfer feature,
the resources associated with those spokes must all be in the same VPC
network. Spokes that do not use site-to-site data transfer can be associated
with any VPC network in your project.

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

## 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 hub. Hub names must be unique. They use the following form: `projects/{project_number}/locations/global/hubs/{hub_id}` |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time the hub was created. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time the hub was last updated. |
| `↳ 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` Optional. An optional description of the hub. |
| `↳ unique_id` | `string` Output only. The Google-generated UUID for the hub. This value is unique across all hub resources. If a hub is deleted and another with the same name is created, the new hub is assigned a different unique_id. |
| `↳ state` | `int` Output only. The current lifecycle state of this hub. |
| `↳ routing_vpcs` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.RoutingVPC>` The VPC networks associated with this hub's spokes. This field is read-only. Network Connectivity Center automatically populates it based on the set of spokes attached to the hub. |
| `↳ route_tables` | `string[]` Output only. The route tables that belong to this hub. They use the following form: `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}` This field is read-only. Network Connectivity Center automatically populates it based on the route tables nested under the hub. |
| `↳ spoke_summary` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.SpokeSummary` Output only. A summary of the spokes associated with a hub. The summary includes a count of spokes according to type and according to state. If any spokes are inactive, the summary also lists the reasons they are inactive, including a count for each reason. |
| `↳ policy_mode` | `int` Optional. The policy mode of this hub. This field can be either PRESET or CUSTOM. If unspecified, the policy_mode defaults to PRESET. |
| `↳ preset_topology` | `int` Optional. The topology implemented in this hub. Currently, this field is only used when policy_mode = PRESET. The available preset topologies are MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET, the preset_topology defaults to MESH. When policy_mode = CUSTOM, the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED. |
| `↳ export_psc` | `bool` Optional. Whether Private Service Connect connection propagation is enabled for the hub. If true, Private Service Connect endpoints in VPC spokes attached to the hub are made accessible to other VPC spokes attached to the hub. The default value is false. |

### getName

Immutable. The name of the hub. Hub names must be unique. They use the
following form:
`projects/{project_number}/locations/global/hubs/{hub_id}`

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

### setName

Immutable. The name of the hub. Hub names must be unique. They use the
following form:
`projects/{project_number}/locations/global/hubs/{hub_id}`

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

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

### getCreateTime

Output only. The time the hub was created.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The time the hub 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 hub 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 hub was last updated.

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

| **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

Optional. An optional description of the hub.

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

### setDescription

Optional. An optional description of the hub.

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

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

### getUniqueId

Output only. The Google-generated UUID for the hub. This value is unique
across all hub resources. If a hub is deleted and another with the same
name is created, the new hub is assigned a different unique_id.

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

### setUniqueId

Output only. The Google-generated UUID for the hub. This value is unique
across all hub resources. If a hub is deleted and another with the same
name is created, the new hub is assigned a different unique_id.

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

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

### getState

Output only. The current lifecycle state of this hub.

| **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 this hub.

| **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` |   |

### getRoutingVpcs

The VPC networks associated with this hub's spokes.

This field is read-only. Network Connectivity Center automatically
populates it based on the set of spokes attached to the hub.

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

### setRoutingVpcs

The VPC networks associated with this hub's spokes.

This field is read-only. Network Connectivity Center automatically
populates it based on the set of spokes attached to the hub.

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

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

### getRouteTables

Output only. The route tables that belong to this hub. They use the
following form:
`projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
This field is read-only. Network Connectivity Center automatically
populates it based on the route tables nested under the hub.

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

### setRouteTables

Output only. The route tables that belong to this hub. They use the
following form:
`projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
This field is read-only. Network Connectivity Center automatically
populates it based on the route tables nested under the hub.

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

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

### getSpokeSummary

Output only. A summary of the spokes associated with a hub. The
summary includes a count of spokes according to type
and according to state. If any spokes are inactive,
the summary also lists the reasons they are inactive,
including a count for each reason.

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

### hasSpokeSummary

### clearSpokeSummary

### setSpokeSummary

Output only. A summary of the spokes associated with a hub. The
summary includes a count of spokes according to type
and according to state. If any spokes are inactive,
the summary also lists the reasons they are inactive,
including a count for each reason.

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

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

### getPolicyMode

Optional. The policy mode of this hub. This field can be either
PRESET or CUSTOM. If unspecified, the
policy_mode defaults to PRESET.

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

### setPolicyMode

Optional. The policy mode of this hub. This field can be either
PRESET or CUSTOM. If unspecified, the
policy_mode defaults to PRESET.

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

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

### getPresetTopology

Optional. The topology implemented in this hub. Currently, this field is
only used when policy_mode = PRESET. The available preset topologies are
MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET,
the preset_topology defaults to MESH. When policy_mode = CUSTOM,
the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED.

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

### setPresetTopology

Optional. The topology implemented in this hub. Currently, this field is
only used when policy_mode = PRESET. The available preset topologies are
MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET,
the preset_topology defaults to MESH. When policy_mode = CUSTOM,
the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED.

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

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

### getExportPsc

Optional. Whether Private Service Connect connection propagation is enabled
for the hub. If true, Private Service Connect endpoints in VPC spokes
attached to the hub are made accessible to other VPC spokes attached to the
hub. The default value is false.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### hasExportPsc

### clearExportPsc

### setExportPsc

Optional. Whether Private Service Connect connection propagation is enabled
for the hub. If true, Private Service Connect endpoints in VPC spokes
attached to the hub are made accessible to other VPC spokes attached to the
hub. The default value is false.

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

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