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

Job status.

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

## Namespace

Google \\ Cloud \\ Batch \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ state` | `int` Job state |
| `↳ status_events` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.StatusEvent>` Job status events |
| `↳ task_groups` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Aggregated task status for each TaskGroup in the Job. The map key is TaskGroup ID. |
| `↳ run_duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` The duration of time that the Job spent in status RUNNING. |

### getState

Job state

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

### setState

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` |   |

### getStatusEvents

Job status events

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.StatusEvent>` |   |

### setStatusEvents

Job status events

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.StatusEvent>` |

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

### getTaskGroups

Aggregated task status for each TaskGroup in the Job.

The map key is TaskGroup ID.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setTaskGroups

Aggregated task status for each TaskGroup in the Job.

The map key is TaskGroup ID.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getRunDuration

The duration of time that the Job spent in status RUNNING.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasRunDuration

### clearRunDuration

### setRunDuration

The duration of time that the Job spent in status RUNNING.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

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