Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / google-proto-files / google / cloud / tasks / v2beta2 / task.proto
1 // Copyright 2018 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 syntax = "proto3";
16
17 package google.cloud.tasks.v2beta2;
18
19 import "google/api/annotations.proto";
20 import "google/cloud/tasks/v2beta2/target.proto";
21 import "google/protobuf/timestamp.proto";
22 import "google/rpc/status.proto";
23
24 option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2beta2;tasks";
25 option java_multiple_files = true;
26 option java_outer_classname = "TaskProto";
27 option java_package = "com.google.cloud.tasks.v2beta2";
28
29 // A unit of scheduled work.
30 message Task {
31   // The view specifies a subset of [Task][google.cloud.tasks.v2beta2.Task]
32   // data.
33   //
34   // When a task is returned in a response, not all
35   // information is retrieved by default because some data, such as
36   // payloads, might be desirable to return only when needed because
37   // of its large size or because of the sensitivity of data that it
38   // contains.
39   enum View {
40     // Unspecified. Defaults to BASIC.
41     VIEW_UNSPECIFIED = 0;
42
43     // The basic view omits fields which can be large or can contain
44     // sensitive data.
45     //
46     // This view does not include the
47     // ([payload in
48     // AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest]
49     // and [payload in
50     // PullMessage][google.cloud.tasks.v2beta2.PullMessage.payload]). These
51     // payloads are desirable to return only when needed, because they can be
52     // large and because of the sensitivity of the data that you choose to store
53     // in it.
54     BASIC = 1;
55
56     // All information is returned.
57     //
58     // Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL]
59     // requires `cloudtasks.tasks.fullView` [Google
60     // IAM](https://cloud.google.com/iam/) permission on the
61     // [Queue][google.cloud.tasks.v2beta2.Queue] resource.
62     FULL = 2;
63   }
64
65   // Optionally caller-specified in
66   // [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask].
67   //
68   // The task name.
69   //
70   // The task name must have the following format:
71   // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
72   //
73   // * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
74   //    hyphens (-), colons (:), or periods (.).
75   //    For more information, see
76   //    [Identifying
77   //    projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
78   // * `LOCATION_ID` is the canonical ID for the task's location.
79   //    The list of available locations can be obtained by calling
80   //    [ListLocations][google.cloud.location.Locations.ListLocations].
81   //    For more information, see https://cloud.google.com/about/locations/.
82   // * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
83   //   hyphens (-). The maximum length is 100 characters.
84   // * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
85   //   hyphens (-), or underscores (_). The maximum length is 500 characters.
86   string name = 1;
87
88   // Required.
89   //
90   // The task's payload is used by the task's target to process the task.
91   // A payload is valid only if it is compatible with the queue's target.
92   oneof payload_type {
93     // App Engine HTTP request that is sent to the task's target. Can
94     // be set only if
95     // [app_engine_http_target][google.cloud.tasks.v2beta2.Queue.app_engine_http_target]
96     // is set on the queue.
97     //
98     // An App Engine task is a task that has
99     // [AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest]
100     // set.
101     AppEngineHttpRequest app_engine_http_request = 3;
102
103     // [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] to process
104     // the task. Can be set only if
105     // [pull_target][google.cloud.tasks.v2beta2.Queue.pull_target] is set on the
106     // queue.
107     //
108     // A pull task is a task that has
109     // [PullMessage][google.cloud.tasks.v2beta2.PullMessage] set.
110     PullMessage pull_message = 4;
111   }
112
113   // The time when the task is scheduled to be attempted.
114   //
115   // For App Engine queues, this is when the task will be attempted or retried.
116   //
117   // For pull queues, this is the time when the task is available to
118   // be leased; if a task is currently leased, this is the time when
119   // the current lease expires, that is, the time that the task was
120   // leased plus the
121   // [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration].
122   //
123   // `schedule_time` will be truncated to the nearest microsecond.
124   google.protobuf.Timestamp schedule_time = 5;
125
126   // Output only. The time that the task was created.
127   //
128   // `create_time` will be truncated to the nearest second.
129   google.protobuf.Timestamp create_time = 6;
130
131   // Output only. The task status.
132   TaskStatus status = 7;
133
134   // Output only. The view specifies which subset of the
135   // [Task][google.cloud.tasks.v2beta2.Task] has been returned.
136   View view = 8;
137 }
138
139 // Status of the task.
140 message TaskStatus {
141   // Output only. The number of attempts dispatched.
142   //
143   // This count includes tasks which have been dispatched but haven't
144   // received a response.
145   int32 attempt_dispatch_count = 1;
146
147   // Output only. The number of attempts which have received a response.
148   //
149   // This field is not calculated for [pull
150   // tasks][google.cloud.tasks.v2beta2.PullMessage].
151   int32 attempt_response_count = 2;
152
153   // Output only. The status of the task's first attempt.
154   //
155   // Only
156   // [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time]
157   // will be set. The other
158   // [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is
159   // not retained by Cloud Tasks.
160   //
161   // This field is not calculated for [pull
162   // tasks][google.cloud.tasks.v2beta2.PullMessage].
163   AttemptStatus first_attempt_status = 3;
164
165   // Output only. The status of the task's last attempt.
166   //
167   // This field is not calculated for [pull
168   // tasks][google.cloud.tasks.v2beta2.PullMessage].
169   AttemptStatus last_attempt_status = 4;
170 }
171
172 // The status of a task attempt.
173 message AttemptStatus {
174   // Output only. The time that this attempt was scheduled.
175   //
176   // `schedule_time` will be truncated to the nearest microsecond.
177   google.protobuf.Timestamp schedule_time = 1;
178
179   // Output only. The time that this attempt was dispatched.
180   //
181   // `dispatch_time` will be truncated to the nearest microsecond.
182   google.protobuf.Timestamp dispatch_time = 2;
183
184   // Output only. The time that this attempt response was received.
185   //
186   // `response_time` will be truncated to the nearest microsecond.
187   google.protobuf.Timestamp response_time = 3;
188
189   // Output only. The response from the target for this attempt.
190   //
191   // If the task has not been attempted or the task is currently running
192   // then the response status is unset.
193   google.rpc.Status response_status = 4;
194 }