# Google Cloud Security Command Center V2 Client - Class Connection (2.5.1)

2.5.1 (latest) 2.5.0 2.4.2 2.3.0 2.2.1 2.1.1 2.0.4 1.32.0 1.31.0 1.30.0 1.29.0 1.28.2 1.21.0 1.20.2 1.19.1 1.18.0 1.17.0 1.16.0 1.15.1 1.14.2 1.13.1 Reference documentation and code samples for the Google Cloud Security Command Center V2 Client class Connection.

Contains information about the IP connection associated with the finding.

Generated from protobuf message `google.cloud.securitycenter.v2.Connection`

## Namespace

Google \\ Cloud \\ SecurityCenter \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ destination_ip` | `string` Destination IP address. Not present for sockets that are listening and not connected. |
| `↳ destination_port` | `int` Destination port. Not present for sockets that are listening and not connected. |
| `↳ source_ip` | `string` Source IP address. |
| `↳ source_port` | `int` Source port. |
| `↳ protocol` | `int` IANA Internet Protocol Number such as TCP(6) and UDP(17). |

### getDestinationIp

Destination IP address. Not present for sockets that are listening and not
connected.

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

### setDestinationIp

Destination IP address. Not present for sockets that are listening and not
connected.

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

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

### getDestinationPort

Destination port. Not present for sockets that are listening and not
connected.

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

### setDestinationPort

Destination port. Not present for sockets that are listening and not
connected.

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

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

### getSourceIp

Source IP address.

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

### setSourceIp

Source IP address.

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

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

### getSourcePort

Source port.

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

### setSourcePort

Source port.

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

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

### getProtocol

IANA Internet Protocol Number such as TCP(6) and UDP(17).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Protocol](https://docs.cloud.google.com/php/docs/reference/cloud-security-center/latest/V2.Connection.Protocol). |

### setProtocol

IANA Internet Protocol Number such as TCP(6) and UDP(17).

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

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