# Google Cloud Vmware Engine V1 Client - Class NetworkService (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 NetworkService.

Represents a network service that is managed by a `NetworkPolicy` resource.

A network service provides a way to control an aspect of external access to
VMware workloads. For example, whether the VMware workloads in the
private clouds governed by a network policy can access or be accessed from
the internet.

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

## Namespace

Google \\ Cloud \\ VmwareEngine \\ V1 \\ NetworkPolicy

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ enabled` | `bool` True if the service is enabled; false otherwise. |
| `↳ state` | `int` Output only. State of the service. New values may be added to this enum when appropriate. |

### getEnabled

True if the service is enabled; false otherwise.

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

### setEnabled

True if the service is enabled; false otherwise.

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

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

### getState

Output only. State of the service. New values may be added to this enum
when appropriate.

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

### setState

Output only. State of the service. New values may be added to this enum
when appropriate.

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

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