# Google Cloud Storage Transfer V1 Client - Class NotificationConfig (2.4.0)

2.4.0 (latest) 2.3.2 2.2.1 2.1.1 2.0.2 1.5.0 1.4.5 1.3.1 1.2.0 1.1.1 1.0.6 Reference documentation and code samples for the Google Cloud Storage Transfer V1 Client class NotificationConfig.

Specification to configure notifications published to Pub/Sub.

Notifications are published to the customer-provided topic using the
following `PubsubMessage.attributes`:

- `"eventType"`: one of the [EventType](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.NotificationConfig.EventType) values
- `"payloadFormat"`: one of the [PayloadFormat](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.NotificationConfig.PayloadFormat) values
- `"projectId"`: the [project_id](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.TransferOperation#_Google_Cloud_StorageTransfer_V1_TransferOperation__getProjectId__) of the `TransferOperation`
- `"transferJobName"`: the [transfer_job_name](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.TransferOperation#_Google_Cloud_StorageTransfer_V1_TransferOperation__getTransferJobName__) of the `TransferOperation`
- `"transferOperationName"`: the [name](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.TransferOperation#_Google_Cloud_StorageTransfer_V1_TransferOperation__getName__) of the `TransferOperation` The `PubsubMessage.data` contains a [TransferOperation](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.TransferOperation) resource formatted according to the specified `PayloadFormat`.

Generated from protobuf message `google.storagetransfer.v1.NotificationConfig`

## Namespace

Google \\ Cloud \\ StorageTransfer \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ pubsub_topic` | `string` Required. The `Topic.name` of the Pub/Sub topic to which to publish notifications. Must be of the format: `projects/{project}/topics/{topic}`. Not matching this format results in an [INVALID_ARGUMENT](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Code.html#_Google_Rpc_Code__INVALID_ARGUMENT) error. |
| `↳ event_types` | `int[]` Event types for which a notification is desired. If empty, send notifications for all event types. |
| `↳ payload_format` | `int` Required. The desired format of the notification message payloads. |

### getPubsubTopic

Required. The `Topic.name` of the Pub/Sub topic to which to publish
notifications. Must be of the format: `projects/{project}/topics/{topic}`.

Not matching this format results in an
[INVALID_ARGUMENT](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Code.html#_Google_Rpc_Code__INVALID_ARGUMENT) error.

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

### setPubsubTopic

Required. The `Topic.name` of the Pub/Sub topic to which to publish
notifications. Must be of the format: `projects/{project}/topics/{topic}`.

Not matching this format results in an
[INVALID_ARGUMENT](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Code.html#_Google_Rpc_Code__INVALID_ARGUMENT) error.

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

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

### getEventTypes

Event types for which a notification is desired. If empty, send
notifications for all event types.

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

### setEventTypes

Event types for which a notification is desired. If empty, send
notifications for all event types.

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

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

### getPayloadFormat

Required. The desired format of the notification message payloads.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [PayloadFormat](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.NotificationConfig.PayloadFormat). |

### setPayloadFormat

Required. The desired format of the notification message payloads.

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

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