1// Copyright 2019 Google LLC.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15
16syntax = "proto3";
17
18package google.cloud.tasks.v2;
19
20import "google/api/annotations.proto";
21import "google/api/client.proto";
22import "google/api/field_behavior.proto";
23import "google/api/resource.proto";
24import "google/cloud/tasks/v2/queue.proto";
25import "google/cloud/tasks/v2/task.proto";
26import "google/iam/v1/iam_policy.proto";
27import "google/iam/v1/policy.proto";
28import "google/protobuf/empty.proto";
29import "google/protobuf/field_mask.proto";
30
31option go_package = "cloud.google.com/go/cloudtasks/apiv2/cloudtaskspb;cloudtaskspb";
32option java_multiple_files = true;
33option java_outer_classname = "CloudTasksProto";
34option java_package = "com.google.cloud.tasks.v2";
35option objc_class_prefix = "TASKS";
36
37// Cloud Tasks allows developers to manage the execution of background
38// work in their applications.
39service CloudTasks {
40  option (google.api.default_host) = "cloudtasks.googleapis.com";
41  option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
42
43  // Lists queues.
44  //
45  // Queues are returned in lexicographical order.
46  rpc ListQueues(ListQueuesRequest) returns (ListQueuesResponse) {
47    option (google.api.http) = {
48      get: "/v2/{parent=projects/*/locations/*}/queues"
49    };
50    option (google.api.method_signature) = "parent";
51  }
52
53  // Gets a queue.
54  rpc GetQueue(GetQueueRequest) returns (Queue) {
55    option (google.api.http) = {
56      get: "/v2/{name=projects/*/locations/*/queues/*}"
57    };
58    option (google.api.method_signature) = "name";
59  }
60
61  // Creates a queue.
62  //
63  // Queues created with this method allow tasks to live for a maximum of 31
64  // days. After a task is 31 days old, the task will be deleted regardless of whether
65  // it was dispatched or not.
66  //
67  // WARNING: Using this method may have unintended side effects if you are
68  // using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
69  // Read
70  // [Overview of Queue Management and
71  // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using
72  // this method.
73  rpc CreateQueue(CreateQueueRequest) returns (Queue) {
74    option (google.api.http) = {
75      post: "/v2/{parent=projects/*/locations/*}/queues"
76      body: "queue"
77    };
78    option (google.api.method_signature) = "parent,queue";
79  }
80
81  // Updates a queue.
82  //
83  // This method creates the queue if it does not exist and updates
84  // the queue if it does exist.
85  //
86  // Queues created with this method allow tasks to live for a maximum of 31
87  // days. After a task is 31 days old, the task will be deleted regardless of whether
88  // it was dispatched or not.
89  //
90  // WARNING: Using this method may have unintended side effects if you are
91  // using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
92  // Read
93  // [Overview of Queue Management and
94  // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using
95  // this method.
96  rpc UpdateQueue(UpdateQueueRequest) returns (Queue) {
97    option (google.api.http) = {
98      patch: "/v2/{queue.name=projects/*/locations/*/queues/*}"
99      body: "queue"
100    };
101    option (google.api.method_signature) = "queue,update_mask";
102  }
103
104  // Deletes a queue.
105  //
106  // This command will delete the queue even if it has tasks in it.
107  //
108  // Note: If you delete a queue, a queue with the same name can't be created
109  // for 7 days.
110  //
111  // WARNING: Using this method may have unintended side effects if you are
112  // using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
113  // Read
114  // [Overview of Queue Management and
115  // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using
116  // this method.
117  rpc DeleteQueue(DeleteQueueRequest) returns (google.protobuf.Empty) {
118    option (google.api.http) = {
119      delete: "/v2/{name=projects/*/locations/*/queues/*}"
120    };
121    option (google.api.method_signature) = "name";
122  }
123
124  // Purges a queue by deleting all of its tasks.
125  //
126  // All tasks created before this method is called are permanently deleted.
127  //
128  // Purge operations can take up to one minute to take effect. Tasks
129  // might be dispatched before the purge takes effect. A purge is irreversible.
130  rpc PurgeQueue(PurgeQueueRequest) returns (Queue) {
131    option (google.api.http) = {
132      post: "/v2/{name=projects/*/locations/*/queues/*}:purge"
133      body: "*"
134    };
135    option (google.api.method_signature) = "name";
136  }
137
138  // Pauses the queue.
139  //
140  // If a queue is paused then the system will stop dispatching tasks
141  // until the queue is resumed via
142  // [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue]. Tasks can still be added
143  // when the queue is paused. A queue is paused if its
144  // [state][google.cloud.tasks.v2.Queue.state] is [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED].
145  rpc PauseQueue(PauseQueueRequest) returns (Queue) {
146    option (google.api.http) = {
147      post: "/v2/{name=projects/*/locations/*/queues/*}:pause"
148      body: "*"
149    };
150    option (google.api.method_signature) = "name";
151  }
152
153  // Resume a queue.
154  //
155  // This method resumes a queue after it has been
156  // [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED] or
157  // [DISABLED][google.cloud.tasks.v2.Queue.State.DISABLED]. The state of a queue is stored
158  // in the queue's [state][google.cloud.tasks.v2.Queue.state]; after calling this method it
159  // will be set to [RUNNING][google.cloud.tasks.v2.Queue.State.RUNNING].
160  //
161  // WARNING: Resuming many high-QPS queues at the same time can
162  // lead to target overloading. If you are resuming high-QPS
163  // queues, follow the 500/50/5 pattern described in
164  // [Managing Cloud Tasks Scaling
165  // Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling).
166  rpc ResumeQueue(ResumeQueueRequest) returns (Queue) {
167    option (google.api.http) = {
168      post: "/v2/{name=projects/*/locations/*/queues/*}:resume"
169      body: "*"
170    };
171    option (google.api.method_signature) = "name";
172  }
173
174  // Gets the access control policy for a [Queue][google.cloud.tasks.v2.Queue].
175  // Returns an empty policy if the resource exists and does not have a policy
176  // set.
177  //
178  // Authorization requires the following
179  // [Google IAM](https://cloud.google.com/iam) permission on the specified
180  // resource parent:
181  //
182  // * `cloudtasks.queues.getIamPolicy`
183  rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
184    option (google.api.http) = {
185      post: "/v2/{resource=projects/*/locations/*/queues/*}:getIamPolicy"
186      body: "*"
187    };
188    option (google.api.method_signature) = "resource";
189  }
190
191  // Sets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. Replaces any existing
192  // policy.
193  //
194  // Note: The Cloud Console does not check queue-level IAM permissions yet.
195  // Project-level permissions are required to use the Cloud Console.
196  //
197  // Authorization requires the following
198  // [Google IAM](https://cloud.google.com/iam) permission on the specified
199  // resource parent:
200  //
201  // * `cloudtasks.queues.setIamPolicy`
202  rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
203    option (google.api.http) = {
204      post: "/v2/{resource=projects/*/locations/*/queues/*}:setIamPolicy"
205      body: "*"
206    };
207    option (google.api.method_signature) = "resource,policy";
208  }
209
210  // Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2.Queue].
211  // If the resource does not exist, this will return an empty set of
212  // permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.
213  //
214  // Note: This operation is designed to be used for building permission-aware
215  // UIs and command-line tools, not for authorization checking. This operation
216  // may "fail open" without warning.
217  rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
218    option (google.api.http) = {
219      post: "/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions"
220      body: "*"
221    };
222    option (google.api.method_signature) = "resource,permissions";
223  }
224
225  // Lists the tasks in a queue.
226  //
227  // By default, only the [BASIC][google.cloud.tasks.v2.Task.View.BASIC] view is retrieved
228  // due to performance considerations;
229  // [response_view][google.cloud.tasks.v2.ListTasksRequest.response_view] controls the
230  // subset of information which is returned.
231  //
232  // The tasks may be returned in any order. The ordering may change at any
233  // time.
234  rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) {
235    option (google.api.http) = {
236      get: "/v2/{parent=projects/*/locations/*/queues/*}/tasks"
237    };
238    option (google.api.method_signature) = "parent";
239  }
240
241  // Gets a task.
242  rpc GetTask(GetTaskRequest) returns (Task) {
243    option (google.api.http) = {
244      get: "/v2/{name=projects/*/locations/*/queues/*/tasks/*}"
245    };
246    option (google.api.method_signature) = "name";
247  }
248
249  // Creates a task and adds it to a queue.
250  //
251  // Tasks cannot be updated after creation; there is no UpdateTask command.
252  //
253  // * The maximum task size is 100KB.
254  rpc CreateTask(CreateTaskRequest) returns (Task) {
255    option (google.api.http) = {
256      post: "/v2/{parent=projects/*/locations/*/queues/*}/tasks"
257      body: "*"
258    };
259    option (google.api.method_signature) = "parent,task";
260  }
261
262  // Deletes a task.
263  //
264  // A task can be deleted if it is scheduled or dispatched. A task
265  // cannot be deleted if it has executed successfully or permanently
266  // failed.
267  rpc DeleteTask(DeleteTaskRequest) returns (google.protobuf.Empty) {
268    option (google.api.http) = {
269      delete: "/v2/{name=projects/*/locations/*/queues/*/tasks/*}"
270    };
271    option (google.api.method_signature) = "name";
272  }
273
274  // Forces a task to run now.
275  //
276  // When this method is called, Cloud Tasks will dispatch the task, even if
277  // the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2.RateLimits] or
278  // is [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED].
279  //
280  // This command is meant to be used for manual debugging. For
281  // example, [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] can be used to retry a failed
282  // task after a fix has been made or to manually force a task to be
283  // dispatched now.
284  //
285  // The dispatched task is returned. That is, the task that is returned
286  // contains the [status][Task.status] after the task is dispatched but
287  // before the task is received by its target.
288  //
289  // If Cloud Tasks receives a successful response from the task's
290  // target, then the task will be deleted; otherwise the task's
291  // [schedule_time][google.cloud.tasks.v2.Task.schedule_time] will be reset to the time that
292  // [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] was called plus the retry delay specified
293  // in the queue's [RetryConfig][google.cloud.tasks.v2.RetryConfig].
294  //
295  // [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] returns
296  // [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a
297  // task that has already succeeded or permanently failed.
298  rpc RunTask(RunTaskRequest) returns (Task) {
299    option (google.api.http) = {
300      post: "/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run"
301      body: "*"
302    };
303    option (google.api.method_signature) = "name";
304  }
305}
306
307// Request message for [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues].
308message ListQueuesRequest {
309  // Required. The location name.
310  // For example: `projects/PROJECT_ID/locations/LOCATION_ID`
311  string parent = 1 [
312    (google.api.field_behavior) = REQUIRED,
313    (google.api.resource_reference) = {
314      child_type: "cloudtasks.googleapis.com/Queue"
315    }
316  ];
317
318  // `filter` can be used to specify a subset of queues. Any [Queue][google.cloud.tasks.v2.Queue]
319  // field can be used as a filter and several operators as supported.
320  // For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as
321  // described in
322  // [Stackdriver's Advanced Logs
323  // Filters](https://cloud.google.com/logging/docs/view/advanced_filters).
324  //
325  // Sample filter "state: PAUSED".
326  //
327  // Note that using filters might cause fewer queues than the
328  // requested page_size to be returned.
329  string filter = 2;
330
331  // Requested page size.
332  //
333  // The maximum page size is 9800. If unspecified, the page size will
334  // be the maximum. Fewer queues than requested might be returned,
335  // even if more queues exist; use the
336  // [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] in the
337  // response to determine if more queues exist.
338  int32 page_size = 3;
339
340  // A token identifying the page of results to return.
341  //
342  // To request the first page results, page_token must be empty. To
343  // request the next page of results, page_token must be the value of
344  // [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] returned
345  // from the previous call to [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues]
346  // method. It is an error to switch the value of the
347  // [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating through pages.
348  string page_token = 4;
349}
350
351// Response message for [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues].
352message ListQueuesResponse {
353  // The list of queues.
354  repeated Queue queues = 1;
355
356  // A token to retrieve next page of results.
357  //
358  // To return the next page of results, call
359  // [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] with this value as the
360  // [page_token][google.cloud.tasks.v2.ListQueuesRequest.page_token].
361  //
362  // If the next_page_token is empty, there are no more results.
363  //
364  // The page token is valid for only 2 hours.
365  string next_page_token = 2;
366}
367
368// Request message for [GetQueue][google.cloud.tasks.v2.CloudTasks.GetQueue].
369message GetQueueRequest {
370  // Required. The resource name of the queue. For example:
371  // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
372  string name = 1 [
373    (google.api.field_behavior) = REQUIRED,
374    (google.api.resource_reference) = {
375      type: "cloudtasks.googleapis.com/Queue"
376    }
377  ];
378}
379
380// Request message for [CreateQueue][google.cloud.tasks.v2.CloudTasks.CreateQueue].
381message CreateQueueRequest {
382  // Required. The location name in which the queue will be created.
383  // For example: `projects/PROJECT_ID/locations/LOCATION_ID`
384  //
385  // The list of allowed locations can be obtained by calling Cloud
386  // Tasks' implementation of
387  // [ListLocations][google.cloud.location.Locations.ListLocations].
388  string parent = 1 [
389    (google.api.field_behavior) = REQUIRED,
390    (google.api.resource_reference) = {
391      child_type: "cloudtasks.googleapis.com/Queue"
392    }
393  ];
394
395  // Required. The queue to create.
396  //
397  // [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an existing queue.
398  Queue queue = 2 [(google.api.field_behavior) = REQUIRED];
399}
400
401// Request message for [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue].
402message UpdateQueueRequest {
403  // Required. The queue to create or update.
404  //
405  // The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified.
406  //
407  // Output only fields cannot be modified using UpdateQueue.
408  // Any value specified for an output only field will be ignored.
409  // The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed.
410  Queue queue = 1 [(google.api.field_behavior) = REQUIRED];
411
412  // A mask used to specify which fields of the queue are being updated.
413  //
414  // If empty, then all fields will be updated.
415  google.protobuf.FieldMask update_mask = 2;
416}
417
418// Request message for [DeleteQueue][google.cloud.tasks.v2.CloudTasks.DeleteQueue].
419message DeleteQueueRequest {
420  // Required. The queue name. For example:
421  // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
422  string name = 1 [
423    (google.api.field_behavior) = REQUIRED,
424    (google.api.resource_reference) = {
425      type: "cloudtasks.googleapis.com/Queue"
426    }
427  ];
428}
429
430// Request message for [PurgeQueue][google.cloud.tasks.v2.CloudTasks.PurgeQueue].
431message PurgeQueueRequest {
432  // Required. The queue name. For example:
433  // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
434  string name = 1 [
435    (google.api.field_behavior) = REQUIRED,
436    (google.api.resource_reference) = {
437      type: "cloudtasks.googleapis.com/Queue"
438    }
439  ];
440}
441
442// Request message for [PauseQueue][google.cloud.tasks.v2.CloudTasks.PauseQueue].
443message PauseQueueRequest {
444  // Required. The queue name. For example:
445  // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
446  string name = 1 [
447    (google.api.field_behavior) = REQUIRED,
448    (google.api.resource_reference) = {
449      type: "cloudtasks.googleapis.com/Queue"
450    }
451  ];
452}
453
454// Request message for [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue].
455message ResumeQueueRequest {
456  // Required. The queue name. For example:
457  // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
458  string name = 1 [
459    (google.api.field_behavior) = REQUIRED,
460    (google.api.resource_reference) = {
461      type: "cloudtasks.googleapis.com/Queue"
462    }
463  ];
464}
465
466// Request message for listing tasks using [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks].
467message ListTasksRequest {
468  // Required. The queue name. For example:
469  // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
470  string parent = 1 [
471    (google.api.field_behavior) = REQUIRED,
472    (google.api.resource_reference) = {
473      child_type: "cloudtasks.googleapis.com/Task"
474    }
475  ];
476
477  // The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
478  // returned.
479  //
480  // By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
481  // information is retrieved by default because some data, such as
482  // payloads, might be desirable to return only when needed because
483  // of its large size or because of the sensitivity of data that it
484  // contains.
485  //
486  // Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
487  // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
488  // permission on the [Task][google.cloud.tasks.v2.Task] resource.
489  Task.View response_view = 2;
490
491  // Maximum page size.
492  //
493  // Fewer tasks than requested might be returned, even if more tasks exist; use
494  // [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] in the response to
495  // determine if more tasks exist.
496  //
497  // The maximum page size is 1000. If unspecified, the page size will be the
498  // maximum.
499  int32 page_size = 3;
500
501  // A token identifying the page of results to return.
502  //
503  // To request the first page results, page_token must be empty. To
504  // request the next page of results, page_token must be the value of
505  // [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] returned
506  // from the previous call to [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks]
507  // method.
508  //
509  // The page token is valid for only 2 hours.
510  string page_token = 4;
511}
512
513// Response message for listing tasks using [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks].
514message ListTasksResponse {
515  // The list of tasks.
516  repeated Task tasks = 1;
517
518  // A token to retrieve next page of results.
519  //
520  // To return the next page of results, call
521  // [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] with this value as the
522  // [page_token][google.cloud.tasks.v2.ListTasksRequest.page_token].
523  //
524  // If the next_page_token is empty, there are no more results.
525  string next_page_token = 2;
526}
527
528// Request message for getting a task using [GetTask][google.cloud.tasks.v2.CloudTasks.GetTask].
529message GetTaskRequest {
530  // Required. The task name. For example:
531  // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
532  string name = 1 [
533    (google.api.field_behavior) = REQUIRED,
534    (google.api.resource_reference) = {
535      type: "cloudtasks.googleapis.com/Task"
536    }
537  ];
538
539  // The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
540  // returned.
541  //
542  // By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
543  // information is retrieved by default because some data, such as
544  // payloads, might be desirable to return only when needed because
545  // of its large size or because of the sensitivity of data that it
546  // contains.
547  //
548  // Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
549  // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
550  // permission on the [Task][google.cloud.tasks.v2.Task] resource.
551  Task.View response_view = 2;
552}
553
554// Request message for [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask].
555message CreateTaskRequest {
556  // Required. The queue name. For example:
557  // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
558  //
559  // The queue must already exist.
560  string parent = 1 [
561    (google.api.field_behavior) = REQUIRED,
562    (google.api.resource_reference) = {
563      child_type: "cloudtasks.googleapis.com/Task"
564    }
565  ];
566
567  // Required. The task to add.
568  //
569  // Task names have the following format:
570  // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
571  // The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a
572  // name is not specified then the system will generate a random
573  // unique task id, which will be set in the task returned in the
574  // [response][google.cloud.tasks.v2.Task.name].
575  //
576  // If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the
577  // past then Cloud Tasks will set it to the current time.
578  //
579  // Task De-duplication:
580  //
581  // Explicitly specifying a task ID enables task de-duplication.  If
582  // a task's ID is identical to that of an existing task or a task
583  // that was deleted or executed recently then the call will fail
584  // with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
585  // If the task's queue was created using Cloud Tasks, then another task with
586  // the same name can't be created for ~1hour after the original task was
587  // deleted or executed. If the task's queue was created using queue.yaml or
588  // queue.xml, then another task with the same name can't be created
589  // for ~9days after the original task was deleted or executed.
590  //
591  // Because there is an extra lookup cost to identify duplicate task
592  // names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly
593  // increased latency. Using hashed strings for the task id or for
594  // the prefix of the task id is recommended. Choosing task ids that
595  // are sequential or have sequential prefixes, for example using a
596  // timestamp, causes an increase in latency and error rates in all
597  // task commands. The infrastructure relies on an approximately
598  // uniform distribution of task ids to store and serve tasks
599  // efficiently.
600  Task task = 2 [(google.api.field_behavior) = REQUIRED];
601
602  // The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
603  // returned.
604  //
605  // By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
606  // information is retrieved by default because some data, such as
607  // payloads, might be desirable to return only when needed because
608  // of its large size or because of the sensitivity of data that it
609  // contains.
610  //
611  // Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
612  // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
613  // permission on the [Task][google.cloud.tasks.v2.Task] resource.
614  Task.View response_view = 3;
615}
616
617// Request message for deleting a task using
618// [DeleteTask][google.cloud.tasks.v2.CloudTasks.DeleteTask].
619message DeleteTaskRequest {
620  // Required. The task name. For example:
621  // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
622  string name = 1 [
623    (google.api.field_behavior) = REQUIRED,
624    (google.api.resource_reference) = {
625      type: "cloudtasks.googleapis.com/Task"
626    }
627  ];
628}
629
630// Request message for forcing a task to run now using
631// [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask].
632message RunTaskRequest {
633  // Required. The task name. For example:
634  // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
635  string name = 1 [
636    (google.api.field_behavior) = REQUIRED,
637    (google.api.resource_reference) = {
638      type: "cloudtasks.googleapis.com/Task"
639    }
640  ];
641
642  // The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
643  // returned.
644  //
645  // By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
646  // information is retrieved by default because some data, such as
647  // payloads, might be desirable to return only when needed because
648  // of its large size or because of the sensitivity of data that it
649  // contains.
650  //
651  // Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
652  // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
653  // permission on the [Task][google.cloud.tasks.v2.Task] resource.
654  Task.View response_view = 2;
655}
656