# Google Cloud Run V2 Client - Class VpcAccess (1.12.2)

1.12.2 (latest) 1.12.1 1.11.0 1.10.1 1.9.0 1.8.0 1.7.0 1.6.0 1.5.2 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0 0.9.3 0.8.0 0.7.2 0.6.0 0.5.2 0.4.0 0.3.4 Reference documentation and code samples for the Google Cloud Run V2 Client class VpcAccess.

VPC Access settings. For more information on sending traffic to a VPC
network, visit <https://cloud.google.com/run/docs/configuring/connecting-vpc>.

Generated from protobuf message `google.cloud.run.v2.VpcAccess`

## Namespace

Google \\ Cloud \\ Run \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ connector` | `string` VPC Access connector name. Format: `projects/{project}/locations/{location}/connectors/{connector}`, where `{project}` can be project id or number. For more information on sending traffic to a VPC network via a connector, visit <https://cloud.google.com/run/docs/configuring/vpc-connectors>. |
| `↳ egress` | `int` Optional. Traffic VPC egress settings. If not provided, it defaults to PRIVATE_RANGES_ONLY. |
| `↳ network_interfaces` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-run/latest/V2.VpcAccess.NetworkInterface>` Optional. Direct VPC egress settings. Currently only single network interface is supported. |

### getConnector

VPC Access connector name.

Format: `projects/{project}/locations/{location}/connectors/{connector}`,
where `{project}` can be project id or number.
For more information on sending traffic to a VPC network via a connector,
visit <https://cloud.google.com/run/docs/configuring/vpc-connectors>.

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

### setConnector

VPC Access connector name.

Format: `projects/{project}/locations/{location}/connectors/{connector}`,
where `{project}` can be project id or number.
For more information on sending traffic to a VPC network via a connector,
visit <https://cloud.google.com/run/docs/configuring/vpc-connectors>.

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

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

### getEgress

Optional. Traffic VPC egress settings. If not provided, it defaults to
PRIVATE_RANGES_ONLY.

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

### setEgress

Optional. Traffic VPC egress settings. If not provided, it defaults to
PRIVATE_RANGES_ONLY.

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

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

### getNetworkInterfaces

Optional. Direct VPC egress settings. Currently only single network
interface is supported.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-run/latest/V2.VpcAccess.NetworkInterface>` |   |

### setNetworkInterfaces

Optional. Direct VPC egress settings. Currently only single network
interface is supported.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-run/latest/V2.VpcAccess.NetworkInterface>` |

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