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

A Network Connectivity Center spoke represents one or more network
connectivity resources.

When you create a spoke, you associate it with a hub. You must also
identify a value for exactly one of the following fields:

- linked_vpn_tunnels
- linked_interconnect_attachments
- linked_router_appliance_instances
- linked_vpc_network

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

## 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 spoke. Spoke names must be unique. They use the following form: `projects/{project_number}/locations/{region}/spokes/{spoke_id}` |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time the spoke was created. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time the spoke 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 spoke. |
| `↳ hub` | `string` Immutable. The name of the hub that this spoke is attached to. |
| `↳ group` | `string` Optional. The name of the group that this spoke is associated with. |
| `↳ linked_vpn_tunnels` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.LinkedVpnTunnels` Optional. VPN tunnels that are associated with the spoke. |
| `↳ linked_interconnect_attachments` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.LinkedInterconnectAttachments` Optional. VLAN attachments that are associated with the spoke. |
| `↳ linked_router_appliance_instances` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.LinkedRouterApplianceInstances` Optional. Router appliance instances that are associated with the spoke. |
| `↳ linked_vpc_network` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.LinkedVpcNetwork` Optional. VPC network that is associated with the spoke. |
| `↳ linked_producer_vpc_network` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.LinkedProducerVpcNetwork` Optional. The linked producer VPC that is associated with the spoke. |
| `↳ unique_id` | `string` Output only. The Google-generated UUID for the spoke. This value is unique across all spoke resources. If a spoke is deleted and another with the same name is created, the new spoke is assigned a different `unique_id`. |
| `↳ state` | `int` Output only. The current lifecycle state of this spoke. |
| `↳ reasons` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.Spoke.StateReason>` Output only. The reasons for current state of the spoke. |
| `↳ spoke_type` | `int` Output only. The type of resource associated with the spoke. |
| `↳ etag` | `string` Optional. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. |
| `↳ field_paths_pending_update` | `string[]` Optional. The list of fields waiting for hub administration's approval. |

### getName

Immutable. The name of the spoke. Spoke names must be unique. They use the
following form:
`projects/{project_number}/locations/{region}/spokes/{spoke_id}`

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

### setName

Immutable. The name of the spoke. Spoke names must be unique. They use the
following form:
`projects/{project_number}/locations/{region}/spokes/{spoke_id}`

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

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

### getCreateTime

Output only. The time the spoke was created.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The time the spoke 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 spoke 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 spoke 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 spoke.

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

### setDescription

Optional. An optional description of the spoke.

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

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

### getHub

Immutable. The name of the hub that this spoke is attached to.

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

### setHub

Immutable. The name of the hub that this spoke is attached to.

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

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

### getGroup

Optional. The name of the group that this spoke is associated with.

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

### setGroup

Optional. The name of the group that this spoke is associated with.

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

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

### getLinkedVpnTunnels

Optional. VPN tunnels that are associated with the spoke.

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

### hasLinkedVpnTunnels

### clearLinkedVpnTunnels

### setLinkedVpnTunnels

Optional. VPN tunnels that are associated with the spoke.

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

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

### getLinkedInterconnectAttachments

Optional. VLAN attachments that are associated with the spoke.

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

### hasLinkedInterconnectAttachments

### clearLinkedInterconnectAttachments

### setLinkedInterconnectAttachments

Optional. VLAN attachments that are associated with the spoke.

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

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

### getLinkedRouterApplianceInstances

Optional. Router appliance instances that are associated with the spoke.

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

### hasLinkedRouterApplianceInstances

### clearLinkedRouterApplianceInstances

### setLinkedRouterApplianceInstances

Optional. Router appliance instances that are associated with the spoke.

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

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

### getLinkedVpcNetwork

Optional. VPC network that is associated with the spoke.

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

### hasLinkedVpcNetwork

### clearLinkedVpcNetwork

### setLinkedVpcNetwork

Optional. VPC network that is associated with the spoke.

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

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

### getLinkedProducerVpcNetwork

Optional. The linked producer VPC that is associated with the spoke.

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

### hasLinkedProducerVpcNetwork

### clearLinkedProducerVpcNetwork

### setLinkedProducerVpcNetwork

Optional. The linked producer VPC that is associated with the spoke.

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

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

### getUniqueId

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

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

### setUniqueId

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

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

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

### getState

Output only. The current lifecycle state of this spoke.

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

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

### getReasons

Output only. The reasons for current state of the spoke.

| **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.Spoke.StateReason>` |   |

### setReasons

Output only. The reasons for current state of the spoke.

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

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

### getSpokeType

Output only. The type of resource associated with the spoke.

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

### setSpokeType

Output only. The type of resource associated with the spoke.

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

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

### getEtag

Optional. This checksum is computed by the server based on the value of
other fields, and may be sent on update and delete requests to ensure the
client has an up-to-date value before proceeding.

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

### setEtag

Optional. This checksum is computed by the server based on the value of
other fields, and may be sent on update and delete requests to ensure the
client has an up-to-date value before proceeding.

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

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

### getFieldPathsPendingUpdate

Optional. The list of fields waiting for hub administration's approval.

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

### setFieldPathsPendingUpdate

Optional. The list of fields waiting for hub administration's approval.

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

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