# Google Cloud Notebooks V2 Client - Class NetworkInterface (1.1.3)

1.1.3 (latest) 1.1.2 1.0.5 0.7.5 0.6.2 0.5.0 0.4.1 0.3.6 Reference documentation and code samples for the Google Cloud Notebooks V2 Client class NetworkInterface.

The definition of a network interface resource attached to a VM.

Generated from protobuf message `google.cloud.notebooks.v2.NetworkInterface`

## Namespace

Google \\ Cloud \\ Notebooks \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ network` | `string` Optional. The name of the VPC that this VM instance is in. Format: `projects/{project_id}/global/networks/{network_id}` |
| `↳ subnet` | `string` Optional. The name of the subnet that this VM instance is in. Format: `projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}` |
| `↳ nic_type` | `int` Optional. The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet. |

### getNetwork

Optional. The name of the VPC that this VM instance is in.

Format:
`projects/{project_id}/global/networks/{network_id}`

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

### setNetwork

Optional. The name of the VPC that this VM instance is in.

Format:
`projects/{project_id}/global/networks/{network_id}`

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

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

### getSubnet

Optional. The name of the subnet that this VM instance is in.

Format:
`projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}`

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

### setSubnet

Optional. The name of the subnet that this VM instance is in.

Format:
`projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}`

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

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

### getNicType

Optional. The type of vNIC to be used on this interface. This may be gVNIC
or VirtioNet.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [NicType](https://docs.cloud.google.com/php/docs/reference/cloud-notebooks/latest/V2.NetworkInterface.NicType). |

### setNicType

Optional. The type of vNIC to be used on this interface. This may be gVNIC
or VirtioNet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [NicType](https://docs.cloud.google.com/php/docs/reference/cloud-notebooks/latest/V2.NetworkInterface.NicType). |

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