1*d5c09012SAndroid Build Coastguard Worker// Copyright 2023 Google LLC 2*d5c09012SAndroid Build Coastguard Worker// 3*d5c09012SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License"); 4*d5c09012SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License. 5*d5c09012SAndroid Build Coastguard Worker// You may obtain a copy of the License at 6*d5c09012SAndroid Build Coastguard Worker// 7*d5c09012SAndroid Build Coastguard Worker// http://www.apache.org/licenses/LICENSE-2.0 8*d5c09012SAndroid Build Coastguard Worker// 9*d5c09012SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software 10*d5c09012SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS, 11*d5c09012SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12*d5c09012SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and 13*d5c09012SAndroid Build Coastguard Worker// limitations under the License. 14*d5c09012SAndroid Build Coastguard Worker 15*d5c09012SAndroid Build Coastguard Workersyntax = "proto3"; 16*d5c09012SAndroid Build Coastguard Worker 17*d5c09012SAndroid Build Coastguard Workerpackage google.cloud.tasks.v2beta3; 18*d5c09012SAndroid Build Coastguard Worker 19*d5c09012SAndroid Build Coastguard Workerimport "google/api/resource.proto"; 20*d5c09012SAndroid Build Coastguard Workerimport "google/cloud/tasks/v2beta3/target.proto"; 21*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/duration.proto"; 22*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/timestamp.proto"; 23*d5c09012SAndroid Build Coastguard Workerimport "google/rpc/status.proto"; 24*d5c09012SAndroid Build Coastguard Worker 25*d5c09012SAndroid Build Coastguard Workeroption go_package = "cloud.google.com/go/cloudtasks/apiv2beta3/cloudtaskspb;cloudtaskspb"; 26*d5c09012SAndroid Build Coastguard Workeroption java_multiple_files = true; 27*d5c09012SAndroid Build Coastguard Workeroption java_outer_classname = "TaskProto"; 28*d5c09012SAndroid Build Coastguard Workeroption java_package = "com.google.cloud.tasks.v2beta3"; 29*d5c09012SAndroid Build Coastguard Worker 30*d5c09012SAndroid Build Coastguard Worker// A unit of scheduled work. 31*d5c09012SAndroid Build Coastguard Workermessage Task { 32*d5c09012SAndroid Build Coastguard Worker option (google.api.resource) = { 33*d5c09012SAndroid Build Coastguard Worker type: "cloudtasks.googleapis.com/Task" 34*d5c09012SAndroid Build Coastguard Worker pattern: "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}" 35*d5c09012SAndroid Build Coastguard Worker }; 36*d5c09012SAndroid Build Coastguard Worker 37*d5c09012SAndroid Build Coastguard Worker // The view specifies a subset of [Task][google.cloud.tasks.v2beta3.Task] 38*d5c09012SAndroid Build Coastguard Worker // data. 39*d5c09012SAndroid Build Coastguard Worker // 40*d5c09012SAndroid Build Coastguard Worker // When a task is returned in a response, not all 41*d5c09012SAndroid Build Coastguard Worker // information is retrieved by default because some data, such as 42*d5c09012SAndroid Build Coastguard Worker // payloads, might be desirable to return only when needed because 43*d5c09012SAndroid Build Coastguard Worker // of its large size or because of the sensitivity of data that it 44*d5c09012SAndroid Build Coastguard Worker // contains. 45*d5c09012SAndroid Build Coastguard Worker enum View { 46*d5c09012SAndroid Build Coastguard Worker // Unspecified. Defaults to BASIC. 47*d5c09012SAndroid Build Coastguard Worker VIEW_UNSPECIFIED = 0; 48*d5c09012SAndroid Build Coastguard Worker 49*d5c09012SAndroid Build Coastguard Worker // The basic view omits fields which can be large or can contain 50*d5c09012SAndroid Build Coastguard Worker // sensitive data. 51*d5c09012SAndroid Build Coastguard Worker // 52*d5c09012SAndroid Build Coastguard Worker // This view does not include the 53*d5c09012SAndroid Build Coastguard Worker // [body in 54*d5c09012SAndroid Build Coastguard Worker // AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body]. 55*d5c09012SAndroid Build Coastguard Worker // Bodies are desirable to return only when needed, because they 56*d5c09012SAndroid Build Coastguard Worker // can be large and because of the sensitivity of the data that you 57*d5c09012SAndroid Build Coastguard Worker // choose to store in it. 58*d5c09012SAndroid Build Coastguard Worker BASIC = 1; 59*d5c09012SAndroid Build Coastguard Worker 60*d5c09012SAndroid Build Coastguard Worker // All information is returned. 61*d5c09012SAndroid Build Coastguard Worker // 62*d5c09012SAndroid Build Coastguard Worker // Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] 63*d5c09012SAndroid Build Coastguard Worker // requires `cloudtasks.tasks.fullView` [Google 64*d5c09012SAndroid Build Coastguard Worker // IAM](https://cloud.google.com/iam/) permission on the 65*d5c09012SAndroid Build Coastguard Worker // [Queue][google.cloud.tasks.v2beta3.Queue] resource. 66*d5c09012SAndroid Build Coastguard Worker FULL = 2; 67*d5c09012SAndroid Build Coastguard Worker } 68*d5c09012SAndroid Build Coastguard Worker 69*d5c09012SAndroid Build Coastguard Worker // Optionally caller-specified in 70*d5c09012SAndroid Build Coastguard Worker // [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 71*d5c09012SAndroid Build Coastguard Worker // 72*d5c09012SAndroid Build Coastguard Worker // The task name. 73*d5c09012SAndroid Build Coastguard Worker // 74*d5c09012SAndroid Build Coastguard Worker // The task name must have the following format: 75*d5c09012SAndroid Build Coastguard Worker // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` 76*d5c09012SAndroid Build Coastguard Worker // 77*d5c09012SAndroid Build Coastguard Worker // * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), 78*d5c09012SAndroid Build Coastguard Worker // hyphens (-), colons (:), or periods (.). 79*d5c09012SAndroid Build Coastguard Worker // For more information, see 80*d5c09012SAndroid Build Coastguard Worker // [Identifying 81*d5c09012SAndroid Build Coastguard Worker // projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) 82*d5c09012SAndroid Build Coastguard Worker // * `LOCATION_ID` is the canonical ID for the task's location. 83*d5c09012SAndroid Build Coastguard Worker // The list of available locations can be obtained by calling 84*d5c09012SAndroid Build Coastguard Worker // [ListLocations][google.cloud.location.Locations.ListLocations]. 85*d5c09012SAndroid Build Coastguard Worker // For more information, see https://cloud.google.com/about/locations/. 86*d5c09012SAndroid Build Coastguard Worker // * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or 87*d5c09012SAndroid Build Coastguard Worker // hyphens (-). The maximum length is 100 characters. 88*d5c09012SAndroid Build Coastguard Worker // * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), 89*d5c09012SAndroid Build Coastguard Worker // hyphens (-), or underscores (_). The maximum length is 500 characters. 90*d5c09012SAndroid Build Coastguard Worker string name = 1; 91*d5c09012SAndroid Build Coastguard Worker 92*d5c09012SAndroid Build Coastguard Worker // Required. The message to send to the worker. 93*d5c09012SAndroid Build Coastguard Worker oneof payload_type { 94*d5c09012SAndroid Build Coastguard Worker // HTTP request that is sent to the App Engine app handler. 95*d5c09012SAndroid Build Coastguard Worker // 96*d5c09012SAndroid Build Coastguard Worker // An App Engine task is a task that has 97*d5c09012SAndroid Build Coastguard Worker // [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] 98*d5c09012SAndroid Build Coastguard Worker // set. 99*d5c09012SAndroid Build Coastguard Worker AppEngineHttpRequest app_engine_http_request = 3; 100*d5c09012SAndroid Build Coastguard Worker 101*d5c09012SAndroid Build Coastguard Worker // HTTP request that is sent to the task's target. 102*d5c09012SAndroid Build Coastguard Worker // 103*d5c09012SAndroid Build Coastguard Worker // An HTTP task is a task that has 104*d5c09012SAndroid Build Coastguard Worker // [HttpRequest][google.cloud.tasks.v2beta3.HttpRequest] set. 105*d5c09012SAndroid Build Coastguard Worker HttpRequest http_request = 11; 106*d5c09012SAndroid Build Coastguard Worker 107*d5c09012SAndroid Build Coastguard Worker // Pull Message contained in a task in a 108*d5c09012SAndroid Build Coastguard Worker // [PULL][google.cloud.tasks.v2beta3.Queue.type] queue type. This payload 109*d5c09012SAndroid Build Coastguard Worker // type cannot be explicitly set through Cloud Tasks API. Its purpose, 110*d5c09012SAndroid Build Coastguard Worker // currently is to provide backward compatibility with App Engine Task Queue 111*d5c09012SAndroid Build Coastguard Worker // [pull](https://cloud.google.com/appengine/docs/standard/java/taskqueue/pull/) 112*d5c09012SAndroid Build Coastguard Worker // queues to provide a way to inspect contents of pull tasks through the 113*d5c09012SAndroid Build Coastguard Worker // [CloudTasks.GetTask][google.cloud.tasks.v2beta3.CloudTasks.GetTask]. 114*d5c09012SAndroid Build Coastguard Worker PullMessage pull_message = 13; 115*d5c09012SAndroid Build Coastguard Worker } 116*d5c09012SAndroid Build Coastguard Worker 117*d5c09012SAndroid Build Coastguard Worker // The time when the task is scheduled to be attempted. 118*d5c09012SAndroid Build Coastguard Worker // 119*d5c09012SAndroid Build Coastguard Worker // For App Engine queues, this is when the task will be attempted or retried. 120*d5c09012SAndroid Build Coastguard Worker // 121*d5c09012SAndroid Build Coastguard Worker // `schedule_time` will be truncated to the nearest microsecond. 122*d5c09012SAndroid Build Coastguard Worker google.protobuf.Timestamp schedule_time = 4; 123*d5c09012SAndroid Build Coastguard Worker 124*d5c09012SAndroid Build Coastguard Worker // Output only. The time that the task was created. 125*d5c09012SAndroid Build Coastguard Worker // 126*d5c09012SAndroid Build Coastguard Worker // `create_time` will be truncated to the nearest second. 127*d5c09012SAndroid Build Coastguard Worker google.protobuf.Timestamp create_time = 5; 128*d5c09012SAndroid Build Coastguard Worker 129*d5c09012SAndroid Build Coastguard Worker // The deadline for requests sent to the worker. If the worker does not 130*d5c09012SAndroid Build Coastguard Worker // respond by this deadline then the request is cancelled and the attempt 131*d5c09012SAndroid Build Coastguard Worker // is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the 132*d5c09012SAndroid Build Coastguard Worker // task according to the 133*d5c09012SAndroid Build Coastguard Worker // [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. 134*d5c09012SAndroid Build Coastguard Worker // 135*d5c09012SAndroid Build Coastguard Worker // Note that when the request is cancelled, Cloud Tasks will stop listening 136*d5c09012SAndroid Build Coastguard Worker // for the response, but whether the worker stops processing depends on the 137*d5c09012SAndroid Build Coastguard Worker // worker. For example, if the worker is stuck, it may not react to cancelled 138*d5c09012SAndroid Build Coastguard Worker // requests. 139*d5c09012SAndroid Build Coastguard Worker // 140*d5c09012SAndroid Build Coastguard Worker // The default and maximum values depend on the type of request: 141*d5c09012SAndroid Build Coastguard Worker // 142*d5c09012SAndroid Build Coastguard Worker // * For [HTTP tasks][google.cloud.tasks.v2beta3.HttpRequest], the default is 143*d5c09012SAndroid Build Coastguard Worker // 10 minutes. The deadline 144*d5c09012SAndroid Build Coastguard Worker // must be in the interval [15 seconds, 30 minutes]. 145*d5c09012SAndroid Build Coastguard Worker // 146*d5c09012SAndroid Build Coastguard Worker // * For [App Engine tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest], 147*d5c09012SAndroid Build Coastguard Worker // 0 indicates that the 148*d5c09012SAndroid Build Coastguard Worker // request has the default deadline. The default deadline depends on the 149*d5c09012SAndroid Build Coastguard Worker // [scaling 150*d5c09012SAndroid Build Coastguard Worker // type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) 151*d5c09012SAndroid Build Coastguard Worker // of the service: 10 minutes for standard apps with automatic scaling, 24 152*d5c09012SAndroid Build Coastguard Worker // hours for standard apps with manual and basic scaling, and 60 minutes for 153*d5c09012SAndroid Build Coastguard Worker // flex apps. If the request deadline is set, it must be in the interval [15 154*d5c09012SAndroid Build Coastguard Worker // seconds, 24 hours 15 seconds]. Regardless of the task's 155*d5c09012SAndroid Build Coastguard Worker // `dispatch_deadline`, the app handler will not run for longer than than 156*d5c09012SAndroid Build Coastguard Worker // the service's timeout. We recommend setting the `dispatch_deadline` to 157*d5c09012SAndroid Build Coastguard Worker // at most a few seconds more than the app handler's timeout. For more 158*d5c09012SAndroid Build Coastguard Worker // information see 159*d5c09012SAndroid Build Coastguard Worker // [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). 160*d5c09012SAndroid Build Coastguard Worker // 161*d5c09012SAndroid Build Coastguard Worker // `dispatch_deadline` will be truncated to the nearest millisecond. The 162*d5c09012SAndroid Build Coastguard Worker // deadline is an approximate deadline. 163*d5c09012SAndroid Build Coastguard Worker google.protobuf.Duration dispatch_deadline = 12; 164*d5c09012SAndroid Build Coastguard Worker 165*d5c09012SAndroid Build Coastguard Worker // Output only. The number of attempts dispatched. 166*d5c09012SAndroid Build Coastguard Worker // 167*d5c09012SAndroid Build Coastguard Worker // This count includes attempts which have been dispatched but haven't 168*d5c09012SAndroid Build Coastguard Worker // received a response. 169*d5c09012SAndroid Build Coastguard Worker int32 dispatch_count = 6; 170*d5c09012SAndroid Build Coastguard Worker 171*d5c09012SAndroid Build Coastguard Worker // Output only. The number of attempts which have received a response. 172*d5c09012SAndroid Build Coastguard Worker int32 response_count = 7; 173*d5c09012SAndroid Build Coastguard Worker 174*d5c09012SAndroid Build Coastguard Worker // Output only. The status of the task's first attempt. 175*d5c09012SAndroid Build Coastguard Worker // 176*d5c09012SAndroid Build Coastguard Worker // Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will 177*d5c09012SAndroid Build Coastguard Worker // be set. The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information 178*d5c09012SAndroid Build Coastguard Worker // is not retained by Cloud Tasks. 179*d5c09012SAndroid Build Coastguard Worker Attempt first_attempt = 8; 180*d5c09012SAndroid Build Coastguard Worker 181*d5c09012SAndroid Build Coastguard Worker // Output only. The status of the task's last attempt. 182*d5c09012SAndroid Build Coastguard Worker Attempt last_attempt = 9; 183*d5c09012SAndroid Build Coastguard Worker 184*d5c09012SAndroid Build Coastguard Worker // Output only. The view specifies which subset of the 185*d5c09012SAndroid Build Coastguard Worker // [Task][google.cloud.tasks.v2beta3.Task] has been returned. 186*d5c09012SAndroid Build Coastguard Worker View view = 10; 187*d5c09012SAndroid Build Coastguard Worker} 188*d5c09012SAndroid Build Coastguard Worker 189*d5c09012SAndroid Build Coastguard Worker// The status of a task attempt. 190*d5c09012SAndroid Build Coastguard Workermessage Attempt { 191*d5c09012SAndroid Build Coastguard Worker // Output only. The time that this attempt was scheduled. 192*d5c09012SAndroid Build Coastguard Worker // 193*d5c09012SAndroid Build Coastguard Worker // `schedule_time` will be truncated to the nearest microsecond. 194*d5c09012SAndroid Build Coastguard Worker google.protobuf.Timestamp schedule_time = 1; 195*d5c09012SAndroid Build Coastguard Worker 196*d5c09012SAndroid Build Coastguard Worker // Output only. The time that this attempt was dispatched. 197*d5c09012SAndroid Build Coastguard Worker // 198*d5c09012SAndroid Build Coastguard Worker // `dispatch_time` will be truncated to the nearest microsecond. 199*d5c09012SAndroid Build Coastguard Worker google.protobuf.Timestamp dispatch_time = 2; 200*d5c09012SAndroid Build Coastguard Worker 201*d5c09012SAndroid Build Coastguard Worker // Output only. The time that this attempt response was received. 202*d5c09012SAndroid Build Coastguard Worker // 203*d5c09012SAndroid Build Coastguard Worker // `response_time` will be truncated to the nearest microsecond. 204*d5c09012SAndroid Build Coastguard Worker google.protobuf.Timestamp response_time = 3; 205*d5c09012SAndroid Build Coastguard Worker 206*d5c09012SAndroid Build Coastguard Worker // Output only. The response from the worker for this attempt. 207*d5c09012SAndroid Build Coastguard Worker // 208*d5c09012SAndroid Build Coastguard Worker // If `response_time` is unset, then the task has not been attempted or is 209*d5c09012SAndroid Build Coastguard Worker // currently running and the `response_status` field is meaningless. 210*d5c09012SAndroid Build Coastguard Worker google.rpc.Status response_status = 4; 211*d5c09012SAndroid Build Coastguard Worker} 212