# Google Cloud Batch V1 Client - Class Message (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 Message.

Message details.

Describe the conditions under which messages will be sent.
If no attribute is defined, no message will be sent by default.
One message should specify either the job or the task level attributes,
but not both. For example,
job level: JOB_STATE_CHANGED and/or a specified new_job_state;
task level: TASK_STATE_CHANGED and/or a specified new_task_state.

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

## Namespace

Google \\ Cloud \\ Batch \\ V1 \\ JobNotification

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ type` | `int` The message type. |
| `↳ new_job_state` | `int` The new job state. |
| `↳ new_task_state` | `int` The new task state. |

### getType

The message type.

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

### setType

The message type.

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

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

### getNewJobState

The new job state.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.JobStatus.State). |

### setNewJobState

The new job state.

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

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

### getNewTaskState

The new task state.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.TaskStatus.State). |

### setNewTaskState

The new task state.

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

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