Method: providers.tasks.batchCreate
Stay organized with collections
Save and categorize content based on your preferences.
Creates and returns a batch of new Task
objects.
HTTP request
POST https://fleetengine.googleapis.com/v1/{parent=providers/*}/tasks:batchCreate
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
parent |
string
Required. The parent resource shared by all tasks. This value must be in the format providers/{provider} . The provider must be the Google Cloud Project ID. For example, sample-cloud-project . The parent field in the CreateTaskRequest messages must either be empty, or it must match this field.
|
Request body
The request body contains data with the following structure:
Fields |
header |
object (DeliveryRequestHeader )
Optional. The standard Delivery API request header. Note: If you set this field, then the header field in the CreateTaskRequest messages must either be empty, or it must match this field.
|
requests[] |
object (CreateTaskRequest )
Required. The request message that specifies the resources to create. Note: You can create a maximum of 500 tasks in a batch.
|
Response body
The BatchCreateTask
response message.
If successful, the response body contains data with the following structure:
JSON representation |
{
"tasks": [
{
object (Task )
}
]
} |
Fields |
tasks[] |
object (Task )
The created Tasks.
|
CreateTaskRequest
The tasks.create
request message.
JSON representation |
{
"header": {
object (DeliveryRequestHeader )
},
"parent": string,
"taskId": string,
"task": {
object (Task )
}
} |
Fields |
parent |
string
Required. Must be in the format providers/{provider} . The provider must be the Google Cloud Project ID. For example, sample-cloud-project .
|
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 trackingId field. Note that multiple tasks can have the same trackingId . 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.
- May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'.
|
task |
object (Task )
Required. The Task entity to create. When creating a Task, the following fields are required:
type
state (must be set to OPEN )
trackingId (must not be set for UNAVAILABLE or SCHEDULED_STOP tasks, but required for all other task types)
plannedLocation (optional for UNAVAILABLE tasks)
taskDuration
Note: The Task's name field is ignored. All other Task fields must not be set; otherwise, an error is returned.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-18 UTC."],[[["Creates up to 500 `Task` objects at once using the `BatchCreateTasks` method."],["Requires a `parent` resource in the URL path, indicating the Google Cloud Project ID."],["The request body includes an optional `header` and a required list of `requests`, each defining a `Task` to create."],["The response returns a list of created `Task` objects within the `tasks` field."],["Each individual `CreateTaskRequest` requires a `taskId`, `type`, `state`, `trackingId`, and other relevant fields depending on the task type."]]],[]]