# Google Maps FleetEngine Delivery V1 Client - Class CreateTaskRequest (0.5.3)

0.5.3 (latest) 0.5.2 0.4.1 0.3.1 0.2.0 0.1.8 Reference documentation and code samples for the Google Maps FleetEngine Delivery V1 Client class CreateTaskRequest.

The `CreateTask` request message.

Generated from protobuf message `maps.fleetengine.delivery.v1.CreateTaskRequest`

## Namespace

Google \\ Maps \\ FleetEngine \\ Delivery \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ header` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.DeliveryRequestHeader` Optional. The standard Delivery API request header. |
| `↳ parent` | `string` Required. Must be in the format `providers/{provider}`. The `provider` must be the Google Cloud Project ID. For example, `sample-cloud-project`. |
| `↳ task_id` | `string` Required. The Task ID must be unique, but it should be not a shipment tracking ID. To store a shipment tracking ID, use the `tracking_id` field. Note that multiple tasks can have the same `tracking_id`. Task IDs are subject to the following restrictions: \* \* Must be a valid Unicode string. \* \* Limited to a maximum length of 64 characters. \* \* Normalized according to [Unicode Normalization Form C](http://www.unicode.org/reports/tr15/). \* \* May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'. |
| `↳ task` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Task` Required. The Task entity to create. When creating a Task, the following fields are required: \* \* `type` \* \* `state` (must be set to `OPEN`) \* \* `tracking_id` (must not be set for `UNAVAILABLE` or `SCHEDULED_STOP` tasks, but required for all other task types) \* \* `planned_location` (optional for `UNAVAILABLE` tasks) \* \* `task_duration` The following fields can be optionally set: \* \* `target_time_window` \* \* `task_tracking_view_config` \* \* `attributes` Note: The Task's `name` field is ignored. All other Task fields must not be set; otherwise, an error is returned. |

### getHeader

Optional. The standard Delivery API request header.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.DeliveryRequestHeader|null` |   |

### hasHeader

### clearHeader

### setHeader

Optional. The standard Delivery API request header.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.DeliveryRequestHeader` |

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

### getParent

Required. Must be in the format `providers/{provider}`. The `provider` must
be the Google Cloud Project ID. For example, `sample-cloud-project`.

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

### setParent

Required. Must be in the format `providers/{provider}`. The `provider` must
be the Google Cloud Project ID. For example, `sample-cloud-project`.

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

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

### getTaskId

Required. The Task ID must be unique, but it should be not a shipment
tracking ID. To store a shipment tracking ID, use the `tracking_id` field.

Note that multiple tasks can have the same `tracking_id`. Task IDs are
subject to the following restrictions:

- Must be a valid Unicode string.
- Limited to a maximum length of 64 characters.
- Normalized according to [Unicode Normalization Form C](http://www.unicode.org/reports/tr15/).
- May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'.

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

### setTaskId

Required. The Task ID must be unique, but it should be not a shipment
tracking ID. To store a shipment tracking ID, use the `tracking_id` field.

Note that multiple tasks can have the same `tracking_id`. Task IDs are
subject to the following restrictions:

- Must be a valid Unicode string.
- Limited to a maximum length of 64 characters.
- Normalized according to [Unicode Normalization Form C](http://www.unicode.org/reports/tr15/).
- May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'.

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

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

### getTask

Required. The Task entity to create.

When creating a Task, the following fields are required:

- `type`
- `state` (must be set to `OPEN`)
- `tracking_id` (must not be set for `UNAVAILABLE` or `SCHEDULED_STOP` tasks, but required for all other task types)
- `planned_location` (optional for `UNAVAILABLE` tasks)
- `task_duration` The following fields can be optionally set:
- `target_time_window`
- `task_tracking_view_config`
- `attributes` Note: The Task's `name` field is ignored. All other Task fields must not be set; otherwise, an error is returned.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Task|null` |   |

### hasTask

### clearTask

### setTask

Required. The Task entity to create.

When creating a Task, the following fields are required:

- `type`
- `state` (must be set to `OPEN`)
- `tracking_id` (must not be set for `UNAVAILABLE` or `SCHEDULED_STOP` tasks, but required for all other task types)
- `planned_location` (optional for `UNAVAILABLE` tasks)
- `task_duration` The following fields can be optionally set:
- `target_time_window`
- `task_tracking_view_config`
- `attributes` Note: The Task's `name` field is ignored. All other Task fields must not be set; otherwise, an error is returned.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Task` |

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. Must be in the format `providers/{provider}`. The `provider` must be the Google Cloud Project ID. For example, `sample-cloud-project`. |
| `task` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Task` Required. The Task entity to create. When creating a Task, the following fields are required: - - `type` - - `state` (must be set to `OPEN`) - - `tracking_id` (must not be set for `UNAVAILABLE` or `SCHEDULED_STOP` tasks, but required for all other task types) - - `planned_location` (optional for `UNAVAILABLE` tasks) - - `task_duration` The following fields can be optionally set: - - `target_time_window` - - `task_tracking_view_config` - - `attributes` Note: The Task's `name` field is ignored. All other Task fields must not be set; otherwise, an error is returned. |
| `taskId` | `string` Required. The Task ID must be unique, but it should be not a shipment tracking ID. To store a shipment tracking ID, use the `tracking_id` field. Note that multiple tasks can have the same `tracking_id`. Task IDs are subject to the following restrictions: - - Must be a valid Unicode string. - - Limited to a maximum length of 64 characters. - - Normalized according to [Unicode Normalization Form C](http://www.unicode.org/reports/tr15/). - - May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.CreateTaskRequest` |   |