# Data Loss Prevention V2 Client - Class PubSubNotification (2.13.0)

2.13.0 (latest) 2.12.0 2.11.0 2.10.0 2.9.2 2.8.1 2.7.0 2.6.1 2.4.1 2.3.0 2.2.3 2.1.0 2.0.0 1.19.0 1.18.0 1.17.0 1.16.0 1.15.1 1.14.0 1.13.2 1.12.0 1.11.0 1.10.2 1.9.0 1.8.6 Reference documentation and code samples for the Data Loss Prevention V2 Client class PubSubNotification.

Send a Pub/Sub message into the given Pub/Sub topic to connect other
systems to data profile generation. The message payload data will
be the byte serialization of `DataProfilePubSubMessage`.

Generated from protobuf message `google.privacy.dlp.v2.DataProfileAction.PubSubNotification`

## Namespace

Google \\ Cloud \\ Dlp \\ V2 \\ DataProfileAction

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ topic` | `string` Cloud Pub/Sub topic to send notifications to. Format is projects/{project}/topics/{topic}. |
| `↳ event` | `int` The type of event that triggers a Pub/Sub. At most one `PubSubNotification` per EventType is permitted. |
| `↳ pubsub_condition` | `https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.DataProfilePubSubCondition` Conditions (e.g., data risk or sensitivity level) for triggering a Pub/Sub. |
| `↳ detail_of_message` | `int` How much data to include in the Pub/Sub message. If the user wishes to limit the size of the message, they can use resource_name and fetch the profile fields they wish to. Per table profile (not per column). |

### getTopic

Cloud Pub/Sub topic to send notifications to.

Format is projects/{project}/topics/{topic}.

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

### setTopic

Cloud Pub/Sub topic to send notifications to.

Format is projects/{project}/topics/{topic}.

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

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

### getEvent

The type of event that triggers a Pub/Sub. At most one
`PubSubNotification` per EventType is permitted.

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

### setEvent

The type of event that triggers a Pub/Sub. At most one
`PubSubNotification` per EventType is permitted.

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

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

### getPubsubCondition

Conditions (e.g., data risk or sensitivity level) for triggering a
Pub/Sub.

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

### hasPubsubCondition

### clearPubsubCondition

### setPubsubCondition

Conditions (e.g., data risk or sensitivity level) for triggering a
Pub/Sub.

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

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

### getDetailOfMessage

How much data to include in the Pub/Sub message. If the user wishes to
limit the size of the message, they can use resource_name and fetch the
profile fields they wish to. Per table profile (not per column).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [DetailLevel](https://docs.cloud.google.com/php/docs/reference/cloud-dlp/latest/V2.DataProfileAction.PubSubNotification.DetailLevel). |

### setDetailOfMessage

How much data to include in the Pub/Sub message. If the user wishes to
limit the size of the message, they can use resource_name and fetch the
profile fields they wish to. Per table profile (not per column).

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

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