@@ -72,6 +72,14 @@ service DeliveryService {
7272 option (google.api.method_signature ) = "delivery_vehicle,update_mask" ;
7373 }
7474
75+ // Creates and returns a batch of new `Task` objects.
76+ rpc BatchCreateTasks (BatchCreateTasksRequest ) returns (BatchCreateTasksResponse ) {
77+ option (google.api.http ) = {
78+ post : "/v1/{parent=providers/*}/tasks:batchCreate"
79+ body : "*"
80+ };
81+ }
82+
7583 // Creates and returns a new `Task` object.
7684 rpc CreateTask (CreateTaskRequest ) returns (Task ) {
7785 option (google.api.http ) = {
@@ -254,6 +262,37 @@ message UpdateDeliveryVehicleRequest {
254262 google.protobuf.FieldMask update_mask = 4 [(google.api.field_behavior ) = REQUIRED ];
255263}
256264
265+ // The `BatchCreateTask` request message.
266+ message BatchCreateTasksRequest {
267+ // Optional. The standard Delivery API request header.
268+ // Note: If you set this field, then the header field in the
269+ // `CreateTaskRequest` messages must either be empty, or it must match this
270+ // field.
271+ DeliveryRequestHeader header = 1 [(google.api.field_behavior ) = OPTIONAL ];
272+
273+ // Required. The parent resource shared by all tasks. This value must be in the format
274+ // `providers/{provider}`. The `provider` must be the Google Cloud Project ID.
275+ // For example, `sample-cloud-project`. The parent field in the
276+ // `CreateTaskRequest` messages must either be empty, or it must match this
277+ // field.
278+ string parent = 3 [
279+ (google.api.field_behavior ) = REQUIRED ,
280+ (google.api.resource_reference ) = {
281+ child_type : "fleetengine.googleapis.com/Task"
282+ }
283+ ];
284+
285+ // Required. The request message that specifies the resources to create.
286+ // Note: You can create a maximum of 500 tasks in a batch.
287+ repeated CreateTaskRequest requests = 4 [(google.api.field_behavior ) = REQUIRED ];
288+ }
289+
290+ // The `BatchCreateTask` response message.
291+ message BatchCreateTasksResponse {
292+ // The created Tasks.
293+ repeated Task tasks = 1 ;
294+ }
295+
257296// The `CreateTask` request message.
258297message CreateTaskRequest {
259298 // Optional. The standard Delivery API request header.
0 commit comments