# Compute V1 Client - Class UsableSubnetwork (2.10.0)

2.10.0 (latest) 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.0.0 1.36.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 1.24.0 1.23.0 1.22.1 1.21.0 1.20.0 1.19.0 1.18.1 1.17.0 1.16.2 1.14.0 1.13.0 1.12.1 1.11.1 1.10.1 1.9.1 1.8.3 1.7.1 1.6.1 1.5.0 Reference documentation and code samples for the Compute V1 Client class UsableSubnetwork.

Subnetwork which the current user has compute.subnetworks.use permission on.

Generated from protobuf message `google.cloud.compute.v1.UsableSubnetwork`

## Namespace

Google \\ Cloud \\ Compute \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ external_ipv6_prefix` | `string` Output only. \[Output Only\] The external IPv6 address range that is assigned to this subnetwork. |
| `↳ internal_ipv6_prefix` | `string` Output only. \[Output Only\] The internal IPv6 address range that is assigned to this subnetwork. |
| `↳ ip_cidr_range` | `string` The range of internal addresses that are owned by this subnetwork. |
| `↳ ipv6_access_type` | `string` The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. Check the Ipv6AccessType enum for the list of possible values. |
| `↳ network` | `string` Network URL. |
| `↳ purpose` | `string` Check the Purpose enum for the list of possible values. |
| `↳ role` | `string` The role of subnetwork. Currently, this field is only used when purpose is set to GLOBAL_MANAGED_PROXY orREGIONAL_MANAGED_PROXY. The value can be set toACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request. Check the Role enum for the list of possible values. |
| `↳ secondary_ip_ranges` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.UsableSubnetworkSecondaryRange>` Secondary IP ranges. |
| `↳ stack_type` | `string` The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set toIPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated usingpatch. Check the StackType enum for the list of possible values. |
| `↳ subnetwork` | `string` Subnetwork URL. |

### getExternalIpv6Prefix

Output only. \[Output Only\] The external IPv6 address range that is assigned to this
subnetwork.

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

### hasExternalIpv6Prefix

### clearExternalIpv6Prefix

### setExternalIpv6Prefix

Output only. \[Output Only\] The external IPv6 address range that is assigned to this
subnetwork.

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

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

### getInternalIpv6Prefix

Output only. \[Output Only\] The internal IPv6 address range that is assigned to this
subnetwork.

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

### hasInternalIpv6Prefix

### clearInternalIpv6Prefix

### setInternalIpv6Prefix

Output only. \[Output Only\] The internal IPv6 address range that is assigned to this
subnetwork.

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

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

### getIpCidrRange

The range of internal addresses that are owned by this subnetwork.

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

### hasIpCidrRange

### clearIpCidrRange

### setIpCidrRange

The range of internal addresses that are owned by this subnetwork.

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

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

### getIpv6AccessType

The access type of IPv6 address this subnet holds. It's immutable and can
only be specified during creation or the first time the subnet is updated
into IPV4_IPV6 dual stack.

Check the Ipv6AccessType enum for the list of possible values.

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

### hasIpv6AccessType

### clearIpv6AccessType

### setIpv6AccessType

The access type of IPv6 address this subnet holds. It's immutable and can
only be specified during creation or the first time the subnet is updated
into IPV4_IPV6 dual stack.

Check the Ipv6AccessType enum for the list of possible values.

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

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

### getNetwork

Network URL.

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

### hasNetwork

### clearNetwork

### setNetwork

Network URL.

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

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

### getPurpose

Check the Purpose enum for the list of possible values.

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

### hasPurpose

### clearPurpose

### setPurpose

Check the Purpose enum for the list of possible values.

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

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

### getRole

The role of subnetwork. Currently, this field is only used when
purpose is set to GLOBAL_MANAGED_PROXY orREGIONAL_MANAGED_PROXY. The value can be set toACTIVE or BACKUP. An ACTIVE
subnetwork is one that is currently being used for Envoy-based load
balancers in a region. A BACKUP subnetwork is one that is
ready to be promoted to ACTIVE or is currently draining.

This field can be updated with a patch request.
Check the Role enum for the list of possible values.

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

### hasRole

### clearRole

### setRole

The role of subnetwork. Currently, this field is only used when
purpose is set to GLOBAL_MANAGED_PROXY orREGIONAL_MANAGED_PROXY. The value can be set toACTIVE or BACKUP. An ACTIVE
subnetwork is one that is currently being used for Envoy-based load
balancers in a region. A BACKUP subnetwork is one that is
ready to be promoted to ACTIVE or is currently draining.

This field can be updated with a patch request.
Check the Role enum for the list of possible values.

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

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

### getSecondaryIpRanges

Secondary IP ranges.

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

### setSecondaryIpRanges

Secondary IP ranges.

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

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

### getStackType

The stack type for the subnet. If set to IPV4_ONLY, new VMs
in the subnet are assigned IPv4 addresses only. If set toIPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and
IPv6 addresses. If not specified, IPV4_ONLY is used.

This field can be both set at resource creation time and updated usingpatch.
Check the StackType enum for the list of possible values.

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

### hasStackType

### clearStackType

### setStackType

The stack type for the subnet. If set to IPV4_ONLY, new VMs
in the subnet are assigned IPv4 addresses only. If set toIPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and
IPv6 addresses. If not specified, IPV4_ONLY is used.

This field can be both set at resource creation time and updated usingpatch.
Check the StackType enum for the list of possible values.

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

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

### getSubnetwork

Subnetwork URL.

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

### hasSubnetwork

### clearSubnetwork

### setSubnetwork

Subnetwork URL.

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

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