# Google Cloud Batch V1 Client - Class JobNotification (1.4.1)

1.4.1 (latest) 1.4.0 1.3.1 1.2.2 1.1.7 1.0.3 0.17.0 0.16.10 0.15.0 0.14.0 0.13.1 0.12.1 0.11.3 0.10.0 0.9.0 0.8.0 0.7.0 0.6.0 0.5.2 0.4.0 0.3.0 0.2.2 Reference documentation and code samples for the Google Cloud Batch V1 Client class JobNotification.

Notification configurations.

Generated from protobuf message `google.cloud.batch.v1.JobNotification`

## Namespace

Google \\ Cloud \\ Batch \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ pubsub_topic` | `string` The Pub/Sub topic where notifications for the job, like state changes, will be published. If undefined, no Pub/Sub notifications are sent for this job. Specify the topic using the following format: `projects/{project}/topics/{topic}`. Notably, if you want to specify a Pub/Sub topic that is in a different project than the job, your administrator must grant your project's Batch service agent permission to publish to that topic. For more information about configuring Pub/Sub notifications for a job, see <https://cloud.google.com/batch/docs/enable-notifications>. |
| `↳ message` | `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.JobNotification.Message` The attribute requirements of messages to be sent to this Pub/Sub topic. Without this field, no message will be sent. |

### getPubsubTopic

The Pub/Sub topic where notifications for the job, like state
changes, will be published. If undefined, no Pub/Sub notifications
are sent for this job.

Specify the topic using the following format:
`projects/{project}/topics/{topic}`.
Notably, if you want to specify a Pub/Sub topic that is in a
different project than the job, your administrator must grant your
project's Batch service agent permission to publish to that topic.
For more information about configuring Pub/Sub notifications for
a job, see
<https://cloud.google.com/batch/docs/enable-notifications>.

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

### setPubsubTopic

The Pub/Sub topic where notifications for the job, like state
changes, will be published. If undefined, no Pub/Sub notifications
are sent for this job.

Specify the topic using the following format:
`projects/{project}/topics/{topic}`.
Notably, if you want to specify a Pub/Sub topic that is in a
different project than the job, your administrator must grant your
project's Batch service agent permission to publish to that topic.
For more information about configuring Pub/Sub notifications for
a job, see
<https://cloud.google.com/batch/docs/enable-notifications>.

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

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

### getMessage

The attribute requirements of messages to be sent to this Pub/Sub topic.

Without this field, no message will be sent.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.JobNotification.Message|null` |   |

### hasMessage

### clearMessage

### setMessage

The attribute requirements of messages to be sent to this Pub/Sub topic.

Without this field, no message will be sent.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.JobNotification.Message` |

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