# Google Cloud BigQuery Migration V2 Client - Class MigrationSubtask (1.3.0)

1.3.0 (latest) 1.2.3 1.1.5 1.0.0 0.4.5 0.3.3 0.2.2 0.1.4 Reference documentation and code samples for the Google Cloud BigQuery Migration V2 Client class MigrationSubtask.

A subtask for a migration which carries details about the configuration of
the subtask. The content of the details should not matter to the end user,
but is a contract between the subtask creator and subtask worker.

Generated from protobuf message `google.cloud.bigquery.migration.v2.MigrationSubtask`

## Namespace

Google \\ Cloud \\ BigQuery \\ Migration \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Output only. Immutable. The resource name for the migration subtask. The ID is server-generated. Example: `projects/123/locations/us/workflows/345/subtasks/678` |
| `↳ task_id` | `string` The unique ID of the task to which this subtask belongs. |
| `↳ type` | `string` The type of the Subtask. The migration service does not check whether this is a known type. It is up to the task creator (i.e. orchestrator or worker) to ensure it only creates subtasks for which there are compatible workers polling for Subtasks. |
| `↳ state` | `int` Output only. The current state of the subtask. |
| `↳ processing_error` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.ErrorInfo.html` Output only. An explanation that may be populated when the task is in FAILED state. |
| `↳ resource_error_details` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-migration/latest/V2.ResourceErrorDetail>` Output only. Provides details to errors and issues encountered while processing the subtask. Presence of error details does not mean that the subtask failed. |
| `↳ resource_error_count` | `int` Output only. The number or resources with errors. Note: This is not the total number of errors as each resource can have more than one error. This is used to indicate truncation by having a `resource_error_count` that is higher than the size of `resource_error_details`. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Time when the subtask was created. |
| `↳ last_update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Time when the subtask was last updated. |
| `↳ metrics` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-migration/latest/V2.TimeSeries>` Output only. The metrics for the subtask. |

### getName

Output only. Immutable. The resource name for the migration subtask. The ID
is server-generated.

Example: `projects/123/locations/us/workflows/345/subtasks/678`

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

### setName

Output only. Immutable. The resource name for the migration subtask. The ID
is server-generated.

Example: `projects/123/locations/us/workflows/345/subtasks/678`

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

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

### getTaskId

The unique ID of the task to which this subtask belongs.

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

### setTaskId

The unique ID of the task to which this subtask belongs.

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

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

### getType

The type of the Subtask. The migration service does not check whether this
is a known type. It is up to the task creator (i.e. orchestrator or worker)
to ensure it only creates subtasks for which there are compatible workers
polling for Subtasks.

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

### setType

The type of the Subtask. The migration service does not check whether this
is a known type. It is up to the task creator (i.e. orchestrator or worker)
to ensure it only creates subtasks for which there are compatible workers
polling for Subtasks.

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

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

### getState

Output only. The current state of the subtask.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-migration/latest/V2.MigrationSubtask.State). |

### setState

Output only. The current state of the subtask.

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

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

### getProcessingError

Output only. An explanation that may be populated when the task is in
FAILED state.

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

### hasProcessingError

### clearProcessingError

### setProcessingError

Output only. An explanation that may be populated when the task is in
FAILED state.

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

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

### getResourceErrorDetails

Output only. Provides details to errors and issues encountered while
processing the subtask. Presence of error details does not mean that the
subtask failed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-migration/latest/V2.ResourceErrorDetail>` |   |

### setResourceErrorDetails

Output only. Provides details to errors and issues encountered while
processing the subtask. Presence of error details does not mean that the
subtask failed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-migration/latest/V2.ResourceErrorDetail>` |

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

### getResourceErrorCount

Output only. The number or resources with errors. Note: This is not the
total number of errors as each resource can have more than one error. This
is used to indicate truncation by having a `resource_error_count` that is
higher than the size of `resource_error_details`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setResourceErrorCount

Output only. The number or resources with errors. Note: This is not the
total number of errors as each resource can have more than one error. This
is used to indicate truncation by having a `resource_error_count` that is
higher than the size of `resource_error_details`.

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

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

### getCreateTime

Output only. Time when the subtask was created.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. Time when the subtask was created.

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

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

### getLastUpdateTime

Output only. Time when the subtask was last updated.

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

### hasLastUpdateTime

### clearLastUpdateTime

### setLastUpdateTime

Output only. Time when the subtask was last updated.

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

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

### getMetrics

Output only. The metrics for the subtask.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-migration/latest/V2.TimeSeries>` |   |

### setMetrics

Output only. The metrics for the subtask.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-migration/latest/V2.TimeSeries>` |

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