0.16.0 (latest) 0.15.0 0.14.0 0.13.3 0.12.0 0.10.0 0.9.0 0.8.0 0.7.0 0.6.2 0.5.1 0.4.2 0.3.0 0.2.0 0.1.1

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Google Cloud Memorystore V1beta Client class PscConnection.

User created Psc connection configuration.

Generated from protobuf message `google.cloud.memorystore.v1beta.PscConnection`

## Namespace

Google \\ Cloud \\ Memorystore \\ V1beta

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ port` | `int` Optional. port will only be set for Primary/Reader or Discovery endpoint. |
| `↳ psc_connection_id` | `string` Required. The PSC connection id of the forwarding rule connected to the service attachment. |
| `↳ ip_address` | `string` Required. The IP allocated on the consumer network for the PSC forwarding rule. |
| `↳ forwarding_rule` | `string` Required. The URI of the consumer side forwarding rule. Format: projects/{project}/regions/{region}/forwardingRules/{forwarding_rule} |
| `↳ project_id` | `string` Output only. The consumer project_id where the forwarding rule is created from. |
| `↳ network` | `string` Required. The consumer network where the IP address resides, in the form of projects/{project_id}/global/networks/{network_name}. |
| `↳ service_attachment` | `string` Required. The service attachment which is the target of the PSC connection, in the form of projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}. |
| `↳ psc_connection_status` | `int` Output only. The status of the PSC connection: whether a connection exists and ACTIVE or it no longer exists. Please note that this value is updated periodically. Please use Private Service Connect APIs for the latest status. |
| `↳ connection_type` | `int` Output only. Type of the PSC connection. |

### getPort

Optional. port will only be set for Primary/Reader or Discovery endpoint.

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

### hasPort

### setPort

Optional. port will only be set for Primary/Reader or Discovery endpoint.

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

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

### getPscConnectionId

Required. The PSC connection id of the forwarding rule connected to the
service attachment.

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

### setPscConnectionId

Required. The PSC connection id of the forwarding rule connected to the
service attachment.

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

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

### getIpAddress

Required. The IP allocated on the consumer network for the PSC forwarding
rule.

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

### setIpAddress

Required. The IP allocated on the consumer network for the PSC forwarding
rule.

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

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

### getForwardingRule

Required. The URI of the consumer side forwarding rule.

Format:
projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}

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

### setForwardingRule

Required. The URI of the consumer side forwarding rule.

Format:
projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}

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

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

### getProjectId

Output only. The consumer project_id where the forwarding rule is created
from.

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

### setProjectId

Output only. The consumer project_id where the forwarding rule is created
from.

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

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

### getNetwork

Required. The consumer network where the IP address resides, in the form of
projects/{project_id}/global/networks/{network_name}.

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

### setNetwork

Required. The consumer network where the IP address resides, in the form of
projects/{project_id}/global/networks/{network_name}.

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

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

### getServiceAttachment

Required. The service attachment which is the target of the PSC connection,
in the form of
projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.

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

### setServiceAttachment

Required. The service attachment which is the target of the PSC connection,
in the form of
projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.

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

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

### getPscConnectionStatus

Output only. The status of the PSC connection: whether a connection exists
and ACTIVE or it no longer exists. Please note that this value is updated
periodically. Please use Private Service Connect APIs for the latest
status.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [PscConnectionStatus](https://docs.cloud.google.com/php/docs/reference/cloud-memorystore/latest/V1beta.PscConnectionStatus). |

### setPscConnectionStatus

Output only. The status of the PSC connection: whether a connection exists
and ACTIVE or it no longer exists. Please note that this value is updated
periodically. Please use Private Service Connect APIs for the latest
status.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [PscConnectionStatus](https://docs.cloud.google.com/php/docs/reference/cloud-memorystore/latest/V1beta.PscConnectionStatus). |

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

### getConnectionType

Output only. Type of the PSC connection.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ConnectionType](https://docs.cloud.google.com/php/docs/reference/cloud-memorystore/latest/V1beta.ConnectionType). |

### setConnectionType

Output only. Type of the PSC connection.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ConnectionType](https://docs.cloud.google.com/php/docs/reference/cloud-memorystore/latest/V1beta.ConnectionType). |

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

### getPorts

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