# Google Cloud Vmware Engine V1 Client - Class NetworkPolicy (1.3.0)

1.3.0 (latest) 1.2.2 1.1.4 1.0.0 0.5.6 0.4.0 0.3.3 0.2.1 0.1.4 Reference documentation and code samples for the Google Cloud Vmware Engine V1 Client class NetworkPolicy.

Represents a network policy resource. Network policies are regional
resources. You can use a network policy to enable or disable internet access
and external IP access. Network policies are associated with a VMware Engine
network, which might span across regions. For a given region, a network
policy applies to all private clouds in the VMware Engine network associated
with the policy.

Generated from protobuf message `google.cloud.vmwareengine.v1.NetworkPolicy`

## Namespace

Google \\ Cloud \\ VmwareEngine \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Output only. The resource name of this network policy. Resource names are schemeless URIs that follow the conventions in <https://cloud.google.com/apis/design/resource_names>. For example: `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Creation time of this resource. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Last update time of this resource. |
| `↳ internet_access` | `https://docs.cloud.google.com/php/docs/reference/cloud-vmware-engine/latest/V1.NetworkPolicy.NetworkService` Network service that allows VMware workloads to access the internet. |
| `↳ external_ip` | `https://docs.cloud.google.com/php/docs/reference/cloud-vmware-engine/latest/V1.NetworkPolicy.NetworkService` Network service that allows External IP addresses to be assigned to VMware workloads. This service can only be enabled when `internet_access` is also enabled. |
| `↳ edge_services_cidr` | `string` Required. IP address range in CIDR notation used to create internet access and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network. |
| `↳ uid` | `string` Output only. System-generated unique identifier for the resource. |
| `↳ vmware_engine_network` | `string` Optional. The relative resource name of the VMware Engine network. Specify the name in the following form: `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` where `{project}` can either be a project number or a project ID. |
| `↳ description` | `string` Optional. User-provided description for this network policy. |
| `↳ vmware_engine_network_canonical` | `string` Output only. The canonical name of the VMware Engine network in the form: `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` |

### getName

Output only. The resource name of this network policy.

Resource names are schemeless URIs that follow the conventions in
<https://cloud.google.com/apis/design/resource_names>.
For example:
`projects/my-project/locations/us-central1/networkPolicies/my-network-policy`

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

### setName

Output only. The resource name of this network policy.

Resource names are schemeless URIs that follow the conventions in
<https://cloud.google.com/apis/design/resource_names>.
For example:
`projects/my-project/locations/us-central1/networkPolicies/my-network-policy`

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

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

### getCreateTime

Output only. Creation time of this resource.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. Creation time of this resource.

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

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

### getUpdateTime

Output only. Last update time of this resource.

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

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. Last update time of this resource.

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

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

### getInternetAccess

Network service that allows VMware workloads to access the internet.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-vmware-engine/latest/V1.NetworkPolicy.NetworkService|null` |   |

### hasInternetAccess

### clearInternetAccess

### setInternetAccess

Network service that allows VMware workloads to access the internet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-vmware-engine/latest/V1.NetworkPolicy.NetworkService` |

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

### getExternalIp

Network service that allows External IP addresses to be assigned to VMware
workloads. This service can only be enabled when `internet_access` is also
enabled.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-vmware-engine/latest/V1.NetworkPolicy.NetworkService|null` |   |

### hasExternalIp

### clearExternalIp

### setExternalIp

Network service that allows External IP addresses to be assigned to VMware
workloads. This service can only be enabled when `internet_access` is also
enabled.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-vmware-engine/latest/V1.NetworkPolicy.NetworkService` |

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

### getEdgeServicesCidr

Required. IP address range in CIDR notation used to create internet access
and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is
required. The range cannot overlap with any prefixes either in the consumer
VPC network or in use by the private clouds attached to that VPC network.

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

### setEdgeServicesCidr

Required. IP address range in CIDR notation used to create internet access
and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is
required. The range cannot overlap with any prefixes either in the consumer
VPC network or in use by the private clouds attached to that VPC network.

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

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

### getUid

Output only. System-generated unique identifier for the resource.

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

### setUid

Output only. System-generated unique identifier for the resource.

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

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

### getVmwareEngineNetwork

Optional. The relative resource name of the VMware Engine network.

Specify the name in the following form:
`projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
where `{project}` can either be a project number or a project ID.

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

### setVmwareEngineNetwork

Optional. The relative resource name of the VMware Engine network.

Specify the name in the following form:
`projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
where `{project}` can either be a project number or a project ID.

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

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

### getDescription

Optional. User-provided description for this network policy.

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

### setDescription

Optional. User-provided description for this network policy.

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

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

### getVmwareEngineNetworkCanonical

Output only. The canonical name of the VMware Engine network in the form:
`projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`

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

### setVmwareEngineNetworkCanonical

Output only. The canonical name of the VMware Engine network in the form:
`projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`

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

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