# Google Cloud Security Command Center V2 Client - Class IpRules (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 IpRules.

IP rules associated with the finding.

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

## Namespace

Google \\ Cloud \\ SecurityCenter \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ direction` | `int` The direction that the rule is applicable to, one of ingress or egress. |
| `↳ allowed` | `https://docs.cloud.google.com/php/docs/reference/cloud-security-center/latest/V2.Allowed` Tuple with allowed rules. |
| `↳ denied` | `https://docs.cloud.google.com/php/docs/reference/cloud-security-center/latest/V2.Denied` Tuple with denied rules. |
| `↳ source_ip_ranges` | `string[]` If source IP ranges are specified, the firewall rule applies only to traffic that has a source IP address in these ranges. These ranges must be expressed in CIDR format. Only supports IPv4. |
| `↳ destination_ip_ranges` | `string[]` If destination IP ranges are specified, the firewall rule applies only to traffic that has a destination IP address in these ranges. These ranges must be expressed in CIDR format. Only supports IPv4. |
| `↳ exposed_services` | `string[]` Name of the network protocol service, such as FTP, that is exposed by the open port. Follows the naming convention available at: <https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml>. |

### getDirection

The direction that the rule is applicable to, one of ingress or egress.

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

### setDirection

The direction that the rule is applicable to, one of ingress or egress.

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

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

### getAllowed

Tuple with allowed rules.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-security-center/latest/V2.Allowed|null` |   |

### hasAllowed

### setAllowed

Tuple with allowed rules.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-security-center/latest/V2.Allowed` |

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

### getDenied

Tuple with denied rules.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-security-center/latest/V2.Denied|null` |   |

### hasDenied

### setDenied

Tuple with denied rules.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-security-center/latest/V2.Denied` |

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

### getSourceIpRanges

If source IP ranges are specified, the firewall rule applies only to
traffic that has a source IP address in these ranges. These ranges must be
expressed in CIDR format. Only supports IPv4.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setSourceIpRanges

If source IP ranges are specified, the firewall rule applies only to
traffic that has a source IP address in these ranges. These ranges must be
expressed in CIDR format. Only supports IPv4.

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

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

### getDestinationIpRanges

If destination IP ranges are specified, the firewall rule applies only to
traffic that has a destination IP address in these ranges. These ranges
must be expressed in CIDR format. Only supports IPv4.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setDestinationIpRanges

If destination IP ranges are specified, the firewall rule applies only to
traffic that has a destination IP address in these ranges. These ranges
must be expressed in CIDR format. Only supports IPv4.

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

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

### getExposedServices

Name of the network protocol service, such as FTP, that is exposed by the
open port. Follows the naming convention available at:
<https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml>.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setExposedServices

Name of the network protocol service, such as FTP, that is exposed by the
open port. Follows the naming convention available at:
<https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml>.

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

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

### getRules

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