# Google Cloud Network Connectivity V1 Client - Class ConsumerPscConnection (2.5.3)

2.5.3 (latest) 2.5.2 2.4.0 2.3.0 2.2.2 2.1.2 2.0.2 1.5.5 1.4.2 1.3.0 1.2.0 1.1.1 1.0.5 Reference documentation and code samples for the Google Cloud Network Connectivity V1 Client class ConsumerPscConnection.

PSC connection details on consumer side.

Generated from protobuf message `google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection`

## Namespace

Google \\ Cloud \\ NetworkConnectivity \\ V1 \\ ServiceConnectionMap

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ service_attachment_uri` | `string` The URI of a service attachment which is the target of the PSC connection. |
| `↳ state` | `int` The state of the PSC connection. |
| `↳ project` | `string` The consumer project whose PSC forwarding rule is connected to the service attachments in this service connection map. |
| `↳ network` | `string` The consumer network whose PSC forwarding rule is connected to the service attachments in this service connection map. Note that the network could be on a different project (shared VPC). |
| `↳ psc_connection_id` | `string` The PSC connection id of the PSC forwarding rule connected to the service attachments in this service connection map. |
| `↳ ip` | `string` The IP literal allocated on the consumer network for the PSC forwarding rule that is created to connect to the producer service attachment in this service connection map. |
| `↳ error_type` | `int` The error type indicates whether the error is consumer facing, producer facing or system internal. |
| `↳ error` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html` The most recent error during operating this connection. |
| `↳ gce_operation` | `string` The last Compute Engine operation to setup PSC connection. |
| `↳ forwarding_rule` | `string` The URI of the consumer forwarding rule created. Example: projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}. |
| `↳ error_info` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.ErrorInfo.html` Output only. The error info for the latest error during operating this connection. |
| `↳ selected_subnetwork` | `string` Output only. The URI of the selected subnetwork selected to allocate IP address for this connection. |
| `↳ producer_instance_id` | `string` Immutable. Deprecated. Use producer_instance_metadata instead. An immutable identifier for the producer instance. |
| `↳ producer_instance_metadata` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Immutable. An immutable map for the producer instance metadata. |
| `↳ ip_version` | `int` The requested IP version for the PSC connection. |

### getServiceAttachmentUri

The URI of a service attachment which is the target of the PSC
connection.

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

### setServiceAttachmentUri

The URI of a service attachment which is the target of the PSC
connection.

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

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

### getState

The state of the PSC connection.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.ServiceConnectionMap.ConsumerPscConnection.State). |

### setState

The state of the PSC connection.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.ServiceConnectionMap.ConsumerPscConnection.State). |

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

### getProject

The consumer project whose PSC forwarding rule is connected to the
service attachments in this service connection map.

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

### setProject

The consumer project whose PSC forwarding rule is connected to the
service attachments in this service connection map.

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

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

### getNetwork

The consumer network whose PSC forwarding rule is connected to the
service attachments in this service connection map.

Note that the network could be on a different project (shared VPC).

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

### setNetwork

The consumer network whose PSC forwarding rule is connected to the
service attachments in this service connection map.

Note that the network could be on a different project (shared VPC).

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

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

### getPscConnectionId

The PSC connection id of the PSC forwarding rule connected
to the service attachments in this service connection map.

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

### setPscConnectionId

The PSC connection id of the PSC forwarding rule connected
to the service attachments in this service connection map.

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

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

### getIp

The IP literal allocated on the consumer network for the PSC forwarding
rule that is created to connect to the producer service attachment in
this service connection map.

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

### setIp

The IP literal allocated on the consumer network for the PSC forwarding
rule that is created to connect to the producer service attachment in
this service connection map.

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

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

### getErrorType

The error type indicates whether the error is consumer facing, producer
facing or system internal.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ConnectionErrorType](https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.ConnectionErrorType). |

### setErrorType

The error type indicates whether the error is consumer facing, producer
facing or system internal.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ConnectionErrorType](https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.ConnectionErrorType). |

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

### getError

The most recent error during operating this connection.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html|null` |   |

### hasError

### clearError

### setError

The most recent error during operating this connection.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html` |

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

### getGceOperation

The last Compute Engine operation to setup PSC connection.

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

### setGceOperation

The last Compute Engine operation to setup PSC connection.

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

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

### getForwardingRule

The URI of the consumer forwarding rule created.

Example:
projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.

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

### setForwardingRule

The URI of the consumer forwarding rule created.

Example:
projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.

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

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

### getErrorInfo

Output only. The error info for the latest error during operating this
connection.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.ErrorInfo.html|null` |   |

### hasErrorInfo

### clearErrorInfo

### setErrorInfo

Output only. The error info for the latest error during operating this
connection.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.ErrorInfo.html` |

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

### getSelectedSubnetwork

Output only. The URI of the selected subnetwork selected to allocate IP
address for this connection.

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

### setSelectedSubnetwork

Output only. The URI of the selected subnetwork selected to allocate IP
address for this connection.

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

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

### getProducerInstanceId

Immutable. Deprecated. Use producer_instance_metadata instead.

An immutable identifier for the producer instance.

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

### setProducerInstanceId

Immutable. Deprecated. Use producer_instance_metadata instead.

An immutable identifier for the producer instance.

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

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

### getProducerInstanceMetadata

Immutable. An immutable map for the producer instance metadata.

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

### setProducerInstanceMetadata

Immutable. An immutable map for the producer instance metadata.

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

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

### getIpVersion

The requested IP version for the PSC connection.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### hasIpVersion

### clearIpVersion

### setIpVersion

The requested IP version for the PSC connection.

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

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