# Google Cloud Tasks V2 Client - Class Attempt (2.2.0)

2.2.0 (latest) 2.1.2 2.0.2 1.15.2 1.14.6 1.13.2 1.12.2 1.11.11 Reference documentation and code samples for the Google Cloud Tasks V2 Client class Attempt.

The status of a task attempt.

Generated from protobuf message `google.cloud.tasks.v2.Attempt`

## Namespace

Google \\ Cloud \\ Tasks \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ schedule_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time that this attempt was scheduled. `schedule_time` will be truncated to the nearest microsecond. |
| `↳ dispatch_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time that this attempt was dispatched. `dispatch_time` will be truncated to the nearest microsecond. |
| `↳ response_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time that this attempt response was received. `response_time` will be truncated to the nearest microsecond. |
| `↳ response_status` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html` Output only. The response from the worker for this attempt. If `response_time` is unset, then the task has not been attempted or is currently running and the `response_status` field is meaningless. |

### getScheduleTime

Output only. The time that this attempt was scheduled.

`schedule_time` will be truncated to the nearest microsecond.

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

### hasScheduleTime

### clearScheduleTime

### setScheduleTime

Output only. The time that this attempt was scheduled.

`schedule_time` will be truncated to the nearest microsecond.

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

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

### getDispatchTime

Output only. The time that this attempt was dispatched.

`dispatch_time` will be truncated to the nearest microsecond.

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

### hasDispatchTime

### clearDispatchTime

### setDispatchTime

Output only. The time that this attempt was dispatched.

`dispatch_time` will be truncated to the nearest microsecond.

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

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

### getResponseTime

Output only. The time that this attempt response was received.

`response_time` will be truncated to the nearest microsecond.

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

### hasResponseTime

### clearResponseTime

### setResponseTime

Output only. The time that this attempt response was received.

`response_time` will be truncated to the nearest microsecond.

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

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

### getResponseStatus

Output only. The response from the worker for this attempt.

If `response_time` is unset, then the task has not been attempted or is
currently running and the `response_status` field is meaningless.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html|null` |   |

### hasResponseStatus

### clearResponseStatus

### setResponseStatus

Output only. The response from the worker for this attempt.

If `response_time` is unset, then the task has not been attempted or is
currently running and the `response_status` field is meaningless.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html` |

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