google-cloud-tasks-v2beta2 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +71 -0
  6. data/lib/google-cloud-tasks-v2beta2.rb +21 -0
  7. data/lib/google/cloud/common_resources_pb.rb +15 -0
  8. data/lib/google/cloud/tasks/v2beta2.rb +35 -0
  9. data/lib/google/cloud/tasks/v2beta2/cloud_tasks.rb +50 -0
  10. data/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb +2324 -0
  11. data/lib/google/cloud/tasks/v2beta2/cloud_tasks/credentials.rb +51 -0
  12. data/lib/google/cloud/tasks/v2beta2/cloud_tasks/paths.rb +90 -0
  13. data/lib/google/cloud/tasks/v2beta2/cloudtasks_pb.rb +134 -0
  14. data/lib/google/cloud/tasks/v2beta2/cloudtasks_services_pb.rb +257 -0
  15. data/lib/google/cloud/tasks/v2beta2/queue_pb.rb +59 -0
  16. data/lib/google/cloud/tasks/v2beta2/target_pb.rb +55 -0
  17. data/lib/google/cloud/tasks/v2beta2/task_pb.rb +55 -0
  18. data/lib/google/cloud/tasks/v2beta2/version.rb +28 -0
  19. data/proto_docs/README.md +4 -0
  20. data/proto_docs/google/api/field_behavior.rb +59 -0
  21. data/proto_docs/google/api/resource.rb +247 -0
  22. data/proto_docs/google/cloud/tasks/v2beta2/cloudtasks.rb +547 -0
  23. data/proto_docs/google/cloud/tasks/v2beta2/queue.rb +349 -0
  24. data/proto_docs/google/cloud/tasks/v2beta2/target.rb +405 -0
  25. data/proto_docs/google/cloud/tasks/v2beta2/task.rb +179 -0
  26. data/proto_docs/google/iam/v1/iam_policy.rb +80 -0
  27. data/proto_docs/google/iam/v1/options.rb +40 -0
  28. data/proto_docs/google/iam/v1/policy.rb +248 -0
  29. data/proto_docs/google/protobuf/any.rb +138 -0
  30. data/proto_docs/google/protobuf/duration.rb +98 -0
  31. data/proto_docs/google/protobuf/empty.rb +36 -0
  32. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  33. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  34. data/proto_docs/google/rpc/status.rb +46 -0
  35. data/proto_docs/google/type/expr.rb +52 -0
  36. metadata +211 -0
@@ -0,0 +1,349 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Tasks
23
+ module V2beta2
24
+ # A queue is a container of related tasks. Queues are configured to manage
25
+ # how those tasks are dispatched. Configurable properties include rate limits,
26
+ # retry options, target types, and others.
27
+ # @!attribute [rw] name
28
+ # @return [::String]
29
+ # Caller-specified and required in {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_queue CreateQueue},
30
+ # after which it becomes output only.
31
+ #
32
+ # The queue name.
33
+ #
34
+ # The queue name must have the following format:
35
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
36
+ #
37
+ # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
38
+ # hyphens (-), colons (:), or periods (.).
39
+ # For more information, see
40
+ # [Identifying
41
+ # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
42
+ # * `LOCATION_ID` is the canonical ID for the queue's location.
43
+ # The list of available locations can be obtained by calling
44
+ # [ListLocations][google.cloud.location.Locations.ListLocations].
45
+ # For more information, see https://cloud.google.com/about/locations/.
46
+ # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
47
+ # hyphens (-). The maximum length is 100 characters.
48
+ # @!attribute [rw] app_engine_http_target
49
+ # @return [::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget]
50
+ # App Engine HTTP target.
51
+ #
52
+ # An App Engine queue is a queue that has an {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget AppEngineHttpTarget}.
53
+ # @!attribute [rw] pull_target
54
+ # @return [::Google::Cloud::Tasks::V2beta2::PullTarget]
55
+ # Pull target.
56
+ #
57
+ # A pull queue is a queue that has a {::Google::Cloud::Tasks::V2beta2::PullTarget PullTarget}.
58
+ # @!attribute [rw] rate_limits
59
+ # @return [::Google::Cloud::Tasks::V2beta2::RateLimits]
60
+ # Rate limits for task dispatches.
61
+ #
62
+ # {::Google::Cloud::Tasks::V2beta2::Queue#rate_limits rate_limits} and
63
+ # {::Google::Cloud::Tasks::V2beta2::Queue#retry_config retry_config} are related because they both
64
+ # control task attempts however they control how tasks are
65
+ # attempted in different ways:
66
+ #
67
+ # * {::Google::Cloud::Tasks::V2beta2::Queue#rate_limits rate_limits} controls the total rate of
68
+ # dispatches from a queue (i.e. all traffic dispatched from the
69
+ # queue, regardless of whether the dispatch is from a first
70
+ # attempt or a retry).
71
+ # * {::Google::Cloud::Tasks::V2beta2::Queue#retry_config retry_config} controls what happens to
72
+ # particular a task after its first attempt fails. That is,
73
+ # {::Google::Cloud::Tasks::V2beta2::Queue#retry_config retry_config} controls task retries (the
74
+ # second attempt, third attempt, etc).
75
+ # @!attribute [rw] retry_config
76
+ # @return [::Google::Cloud::Tasks::V2beta2::RetryConfig]
77
+ # Settings that determine the retry behavior.
78
+ #
79
+ # * For tasks created using Cloud Tasks: the queue-level retry settings
80
+ # apply to all tasks in the queue that were created using Cloud Tasks.
81
+ # Retry settings cannot be set on individual tasks.
82
+ # * For tasks created using the App Engine SDK: the queue-level retry
83
+ # settings apply to all tasks in the queue which do not have retry settings
84
+ # explicitly set on the task and were created by the App Engine SDK. See
85
+ # [App Engine
86
+ # documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
87
+ # @!attribute [rw] state
88
+ # @return [::Google::Cloud::Tasks::V2beta2::Queue::State]
89
+ # Output only. The state of the queue.
90
+ #
91
+ # `state` can only be changed by called
92
+ # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#pause_queue PauseQueue},
93
+ # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#resume_queue ResumeQueue}, or uploading
94
+ # [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref).
95
+ # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue UpdateQueue} cannot be used to change `state`.
96
+ # @!attribute [rw] purge_time
97
+ # @return [::Google::Protobuf::Timestamp]
98
+ # Output only. The last time this queue was purged.
99
+ #
100
+ # All tasks that were {::Google::Cloud::Tasks::V2beta2::Task#create_time created} before this time
101
+ # were purged.
102
+ #
103
+ # A queue can be purged using {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#purge_queue PurgeQueue}, the
104
+ # [App Engine Task Queue SDK, or the Cloud
105
+ # Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
106
+ #
107
+ # Purge time will be truncated to the nearest microsecond. Purge
108
+ # time will be unset if the queue has never been purged.
109
+ class Queue
110
+ include ::Google::Protobuf::MessageExts
111
+ extend ::Google::Protobuf::MessageExts::ClassMethods
112
+
113
+ # State of the queue.
114
+ module State
115
+ # Unspecified state.
116
+ STATE_UNSPECIFIED = 0
117
+
118
+ # The queue is running. Tasks can be dispatched.
119
+ #
120
+ # If the queue was created using Cloud Tasks and the queue has
121
+ # had no activity (method calls or task dispatches) for 30 days,
122
+ # the queue may take a few minutes to re-activate. Some method
123
+ # calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and
124
+ # tasks may not be dispatched for a few minutes until the queue
125
+ # has been re-activated.
126
+ RUNNING = 1
127
+
128
+ # Tasks are paused by the user. If the queue is paused then Cloud
129
+ # Tasks will stop delivering tasks from it, but more tasks can
130
+ # still be added to it by the user. When a pull queue is paused,
131
+ # all {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} calls will return a
132
+ # [FAILED_PRECONDITION][google.rpc.Code.FAILED_PRECONDITION].
133
+ PAUSED = 2
134
+
135
+ # The queue is disabled.
136
+ #
137
+ # A queue becomes `DISABLED` when
138
+ # [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref)
139
+ # or
140
+ # [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref)
141
+ # is uploaded which does not contain the queue. You cannot directly disable
142
+ # a queue.
143
+ #
144
+ # When a queue is disabled, tasks can still be added to a queue
145
+ # but the tasks are not dispatched and
146
+ # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} calls return a
147
+ # `FAILED_PRECONDITION` error.
148
+ #
149
+ # To permanently delete this queue and all of its tasks, call
150
+ # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_queue DeleteQueue}.
151
+ DISABLED = 3
152
+ end
153
+ end
154
+
155
+ # Rate limits.
156
+ #
157
+ # This message determines the maximum rate that tasks can be dispatched by a
158
+ # queue, regardless of whether the dispatch is a first task attempt or a retry.
159
+ #
160
+ # Note: The debugging command, {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task RunTask}, will run a task
161
+ # even if the queue has reached its {::Google::Cloud::Tasks::V2beta2::RateLimits RateLimits}.
162
+ # @!attribute [rw] max_tasks_dispatched_per_second
163
+ # @return [::Float]
164
+ # The maximum rate at which tasks are dispatched from this queue.
165
+ #
166
+ # If unspecified when the queue is created, Cloud Tasks will pick the
167
+ # default.
168
+ #
169
+ # * For {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget App Engine queues}, the maximum allowed value
170
+ # is 500.
171
+ # * This field is output only for {::Google::Cloud::Tasks::V2beta2::PullTarget pull queues}. In addition to the
172
+ # `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of
173
+ # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} requests are allowed per pull queue.
174
+ #
175
+ #
176
+ # This field has the same meaning as
177
+ # [rate in
178
+ # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate).
179
+ # @!attribute [rw] max_burst_size
180
+ # @return [::Integer]
181
+ # Output only. The max burst size.
182
+ #
183
+ # Max burst size limits how fast tasks in queue are processed when
184
+ # many tasks are in the queue and the rate is high. This field
185
+ # allows the queue to have a high rate so processing starts shortly
186
+ # after a task is enqueued, but still limits resource usage when
187
+ # many tasks are enqueued in a short period of time.
188
+ #
189
+ # The [token bucket](https://wikipedia.org/wiki/Token_Bucket)
190
+ # algorithm is used to control the rate of task dispatches. Each
191
+ # queue has a token bucket that holds tokens, up to the maximum
192
+ # specified by `max_burst_size`. Each time a task is dispatched, a
193
+ # token is removed from the bucket. Tasks will be dispatched until
194
+ # the queue's bucket runs out of tokens. The bucket will be
195
+ # continuously refilled with new tokens based on
196
+ # {::Google::Cloud::Tasks::V2beta2::RateLimits#max_tasks_dispatched_per_second max_tasks_dispatched_per_second}.
197
+ #
198
+ # Cloud Tasks will pick the value of `max_burst_size` based on the
199
+ # value of
200
+ # {::Google::Cloud::Tasks::V2beta2::RateLimits#max_tasks_dispatched_per_second max_tasks_dispatched_per_second}.
201
+ #
202
+ # For App Engine queues that were created or updated using
203
+ # `queue.yaml/xml`, `max_burst_size` is equal to
204
+ # [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size).
205
+ # Since `max_burst_size` is output only, if
206
+ # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue UpdateQueue} is called on a queue
207
+ # created by `queue.yaml/xml`, `max_burst_size` will be reset based
208
+ # on the value of
209
+ # {::Google::Cloud::Tasks::V2beta2::RateLimits#max_tasks_dispatched_per_second max_tasks_dispatched_per_second},
210
+ # regardless of whether
211
+ # {::Google::Cloud::Tasks::V2beta2::RateLimits#max_tasks_dispatched_per_second max_tasks_dispatched_per_second}
212
+ # is updated.
213
+ # @!attribute [rw] max_concurrent_tasks
214
+ # @return [::Integer]
215
+ # The maximum number of concurrent tasks that Cloud Tasks allows
216
+ # to be dispatched for this queue. After this threshold has been
217
+ # reached, Cloud Tasks stops dispatching tasks until the number of
218
+ # concurrent requests decreases.
219
+ #
220
+ # If unspecified when the queue is created, Cloud Tasks will pick the
221
+ # default.
222
+ #
223
+ #
224
+ # The maximum allowed value is 5,000.
225
+ #
226
+ # This field is output only for
227
+ # {::Google::Cloud::Tasks::V2beta2::PullTarget pull queues} and always -1, which indicates no limit. No other
228
+ # queue types can have `max_concurrent_tasks` set to -1.
229
+ #
230
+ #
231
+ # This field has the same meaning as
232
+ # [max_concurrent_requests in
233
+ # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests).
234
+ class RateLimits
235
+ include ::Google::Protobuf::MessageExts
236
+ extend ::Google::Protobuf::MessageExts::ClassMethods
237
+ end
238
+
239
+ # Retry config.
240
+ #
241
+ # These settings determine how a failed task attempt is retried.
242
+ # @!attribute [rw] max_attempts
243
+ # @return [::Integer]
244
+ # The maximum number of attempts for a task.
245
+ #
246
+ # Cloud Tasks will attempt the task `max_attempts` times (that
247
+ # is, if the first attempt fails, then there will be
248
+ # `max_attempts - 1` retries). Must be > 0.
249
+ # @!attribute [rw] unlimited_attempts
250
+ # @return [::Boolean]
251
+ # If true, then the number of attempts is unlimited.
252
+ # @!attribute [rw] max_retry_duration
253
+ # @return [::Google::Protobuf::Duration]
254
+ # If positive, `max_retry_duration` specifies the time limit for
255
+ # retrying a failed task, measured from when the task was first
256
+ # attempted. Once `max_retry_duration` time has passed *and* the
257
+ # task has been attempted {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_attempts max_attempts}
258
+ # times, no further attempts will be made and the task will be
259
+ # deleted.
260
+ #
261
+ # If zero, then the task age is unlimited.
262
+ #
263
+ # If unspecified when the queue is created, Cloud Tasks will pick the
264
+ # default.
265
+ #
266
+ # This field is output only for {::Google::Cloud::Tasks::V2beta2::PullTarget pull queues}.
267
+ #
268
+ #
269
+ # `max_retry_duration` will be truncated to the nearest second.
270
+ #
271
+ # This field has the same meaning as
272
+ # [task_age_limit in
273
+ # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
274
+ # @!attribute [rw] min_backoff
275
+ # @return [::Google::Protobuf::Duration]
276
+ # A task will be {::Google::Cloud::Tasks::V2beta2::Task#schedule_time scheduled} for retry between
277
+ # {::Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff} and
278
+ # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} duration after it fails,
279
+ # if the queue's {::Google::Cloud::Tasks::V2beta2::RetryConfig RetryConfig} specifies that the task should be
280
+ # retried.
281
+ #
282
+ # If unspecified when the queue is created, Cloud Tasks will pick the
283
+ # default.
284
+ #
285
+ # This field is output only for {::Google::Cloud::Tasks::V2beta2::PullTarget pull queues}.
286
+ #
287
+ #
288
+ # `min_backoff` will be truncated to the nearest second.
289
+ #
290
+ # This field has the same meaning as
291
+ # [min_backoff_seconds in
292
+ # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
293
+ # @!attribute [rw] max_backoff
294
+ # @return [::Google::Protobuf::Duration]
295
+ # A task will be {::Google::Cloud::Tasks::V2beta2::Task#schedule_time scheduled} for retry between
296
+ # {::Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff} and
297
+ # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} duration after it fails,
298
+ # if the queue's {::Google::Cloud::Tasks::V2beta2::RetryConfig RetryConfig} specifies that the task should be
299
+ # retried.
300
+ #
301
+ # If unspecified when the queue is created, Cloud Tasks will pick the
302
+ # default.
303
+ #
304
+ # This field is output only for {::Google::Cloud::Tasks::V2beta2::PullTarget pull queues}.
305
+ #
306
+ #
307
+ # `max_backoff` will be truncated to the nearest second.
308
+ #
309
+ # This field has the same meaning as
310
+ # [max_backoff_seconds in
311
+ # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
312
+ # @!attribute [rw] max_doublings
313
+ # @return [::Integer]
314
+ # The time between retries will double `max_doublings` times.
315
+ #
316
+ # A task's retry interval starts at
317
+ # {::Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff}, then doubles
318
+ # `max_doublings` times, then increases linearly, and finally
319
+ # retries retries at intervals of
320
+ # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} up to
321
+ # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_attempts max_attempts} times.
322
+ #
323
+ # For example, if {::Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff} is 10s,
324
+ # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} is 300s, and
325
+ # `max_doublings` is 3, then the a task will first be retried in
326
+ # 10s. The retry interval will double three times, and then
327
+ # increase linearly by 2^3 * 10s. Finally, the task will retry at
328
+ # intervals of {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} until the
329
+ # task has been attempted {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_attempts max_attempts}
330
+ # times. Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s,
331
+ # 240s, 300s, 300s, ....
332
+ #
333
+ # If unspecified when the queue is created, Cloud Tasks will pick the
334
+ # default.
335
+ #
336
+ # This field is output only for {::Google::Cloud::Tasks::V2beta2::PullTarget pull queues}.
337
+ #
338
+ #
339
+ # This field has the same meaning as
340
+ # [max_doublings in
341
+ # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
342
+ class RetryConfig
343
+ include ::Google::Protobuf::MessageExts
344
+ extend ::Google::Protobuf::MessageExts::ClassMethods
345
+ end
346
+ end
347
+ end
348
+ end
349
+ end
@@ -0,0 +1,405 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Tasks
23
+ module V2beta2
24
+ # Pull target.
25
+ class PullTarget
26
+ include ::Google::Protobuf::MessageExts
27
+ extend ::Google::Protobuf::MessageExts::ClassMethods
28
+ end
29
+
30
+ # The pull message contains data that can be used by the caller of
31
+ # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} to process the task.
32
+ #
33
+ # This proto can only be used for tasks in a queue which has
34
+ # {::Google::Cloud::Tasks::V2beta2::Queue#pull_target pull_target} set.
35
+ # @!attribute [rw] payload
36
+ # @return [::String]
37
+ # A data payload consumed by the worker to execute the task.
38
+ # @!attribute [rw] tag
39
+ # @return [::String]
40
+ # The task's tag.
41
+ #
42
+ # Tags allow similar tasks to be processed in a batch. If you label
43
+ # tasks with a tag, your worker can
44
+ # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks lease tasks} with the same tag using
45
+ # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#filter filter}. For example, if you want to
46
+ # aggregate the events associated with a specific user once a day,
47
+ # you could tag tasks with the user ID.
48
+ #
49
+ # The task's tag can only be set when the
50
+ # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task task is created}.
51
+ #
52
+ # The tag must be less than 500 characters.
53
+ #
54
+ # SDK compatibility: Although the SDK allows tags to be either
55
+ # string or
56
+ # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
57
+ # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8
58
+ # encoded, the tag will be empty when the task is returned by Cloud Tasks.
59
+ class PullMessage
60
+ include ::Google::Protobuf::MessageExts
61
+ extend ::Google::Protobuf::MessageExts::ClassMethods
62
+ end
63
+
64
+ # App Engine HTTP target.
65
+ #
66
+ # The task will be delivered to the App Engine application hostname
67
+ # specified by its {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget AppEngineHttpTarget} and {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest AppEngineHttpRequest}.
68
+ # The documentation for {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest AppEngineHttpRequest} explains how the
69
+ # task's host URL is constructed.
70
+ #
71
+ # Using {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget AppEngineHttpTarget} requires
72
+ # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
73
+ # Google IAM permission for the project
74
+ # and the following scope:
75
+ #
76
+ # `https://www.googleapis.com/auth/cloud-platform`
77
+ # @!attribute [rw] app_engine_routing_override
78
+ # @return [::Google::Cloud::Tasks::V2beta2::AppEngineRouting]
79
+ # Overrides for the
80
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#app_engine_routing task-level app_engine_routing}.
81
+ #
82
+ # If set, `app_engine_routing_override` is used for all tasks in
83
+ # the queue, no matter what the setting is for the
84
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#app_engine_routing task-level app_engine_routing}.
85
+ class AppEngineHttpTarget
86
+ include ::Google::Protobuf::MessageExts
87
+ extend ::Google::Protobuf::MessageExts::ClassMethods
88
+ end
89
+
90
+ # App Engine HTTP request.
91
+ #
92
+ # The message defines the HTTP request that is sent to an App Engine app when
93
+ # the task is dispatched.
94
+ #
95
+ # This proto can only be used for tasks in a queue which has
96
+ # {::Google::Cloud::Tasks::V2beta2::Queue#app_engine_http_target app_engine_http_target} set.
97
+ #
98
+ # Using {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest AppEngineHttpRequest} requires
99
+ # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
100
+ # Google IAM permission for the project
101
+ # and the following scope:
102
+ #
103
+ # `https://www.googleapis.com/auth/cloud-platform`
104
+ #
105
+ # The task will be delivered to the App Engine app which belongs to the same
106
+ # project as the queue. For more information, see
107
+ # [How Requests are
108
+ # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
109
+ # and how routing is affected by
110
+ # [dispatch
111
+ # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
112
+ # Traffic is encrypted during transport and never leaves Google datacenters.
113
+ # Because this traffic is carried over a communication mechanism internal to
114
+ # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
115
+ # The request to the handler, however, will appear to have used the HTTP
116
+ # protocol.
117
+ #
118
+ # The {::Google::Cloud::Tasks::V2beta2::AppEngineRouting AppEngineRouting} used to construct the URL that the task is
119
+ # delivered to can be set at the queue-level or task-level:
120
+ #
121
+ # * If set,
122
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget#app_engine_routing_override app_engine_routing_override}
123
+ # is used for all tasks in the queue, no matter what the setting
124
+ # is for the
125
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#app_engine_routing task-level app_engine_routing}.
126
+ #
127
+ #
128
+ # The `url` that the task will be sent to is:
129
+ #
130
+ # * `url =` {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} `+`
131
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#relative_url relative_url}
132
+ #
133
+ # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
134
+ # URIs restricted with
135
+ # [`login:
136
+ # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
137
+ # Because tasks are not run as any user, they cannot be dispatched to URIs
138
+ # restricted with
139
+ # [`login:
140
+ # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
141
+ # Task dispatches also do not follow redirects.
142
+ #
143
+ # The task attempt has succeeded if the app's request handler returns an HTTP
144
+ # response code in the range [`200` - `299`]. The task attempt has failed if
145
+ # the app's handler returns a non-2xx response code or Cloud Tasks does
146
+ # not receive response before the [deadline][Task.dispatch_deadline]. Failed
147
+ # tasks will be retried according to the
148
+ # {::Google::Cloud::Tasks::V2beta2::Queue#retry_config retry configuration}. `503` (Service Unavailable) is
149
+ # considered an App Engine system error instead of an application error and
150
+ # will cause Cloud Tasks' traffic congestion control to temporarily throttle
151
+ # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
152
+ # Requests) response from an app handler does not cause traffic congestion
153
+ # control to throttle the queue.
154
+ # @!attribute [rw] http_method
155
+ # @return [::Google::Cloud::Tasks::V2beta2::HttpMethod]
156
+ # The HTTP method to use for the request. The default is POST.
157
+ #
158
+ # The app's request handler for the task's target URL must be able to handle
159
+ # HTTP requests with this http_method, otherwise the task attempt will fail
160
+ # with error code 405 (Method Not Allowed). See
161
+ # [Writing a push task request
162
+ # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
163
+ # and the documentation for the request handlers in the language your app is
164
+ # written in e.g.
165
+ # [Python Request
166
+ # Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass).
167
+ # @!attribute [rw] app_engine_routing
168
+ # @return [::Google::Cloud::Tasks::V2beta2::AppEngineRouting]
169
+ # Task-level setting for App Engine routing.
170
+ #
171
+ # If set,
172
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget#app_engine_routing_override app_engine_routing_override}
173
+ # is used for all tasks in the queue, no matter what the setting is for the
174
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#app_engine_routing task-level app_engine_routing}.
175
+ # @!attribute [rw] relative_url
176
+ # @return [::String]
177
+ # The relative URL.
178
+ #
179
+ # The relative URL must begin with "/" and must be a valid HTTP relative URL.
180
+ # It can contain a path and query string arguments.
181
+ # If the relative URL is empty, then the root path "/" will be used.
182
+ # No spaces are allowed, and the maximum length allowed is 2083 characters.
183
+ # @!attribute [rw] headers
184
+ # @return [::Google::Protobuf::Map{::String => ::String}]
185
+ # HTTP request headers.
186
+ #
187
+ # This map contains the header field names and values.
188
+ # Headers can be set when the
189
+ # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task task is created}.
190
+ # Repeated headers are not supported but a header value can contain commas.
191
+ #
192
+ # Cloud Tasks sets some headers to default values:
193
+ #
194
+ # * `User-Agent`: By default, this header is
195
+ # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
196
+ # This header can be modified, but Cloud Tasks will append
197
+ # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
198
+ # modified `User-Agent`.
199
+ #
200
+ # If the task has a {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#payload payload}, Cloud
201
+ # Tasks sets the following headers:
202
+ #
203
+ # * `Content-Type`: By default, the `Content-Type` header is set to
204
+ # `"application/octet-stream"`. The default can be overridden by explicitly
205
+ # setting `Content-Type` to a particular media type when the
206
+ # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task task is created}.
207
+ # For example, `Content-Type` can be set to `"application/json"`.
208
+ # * `Content-Length`: This is computed by Cloud Tasks. This value is
209
+ # output only. It cannot be changed.
210
+ #
211
+ # The headers below cannot be set or overridden:
212
+ #
213
+ # * `Host`
214
+ # * `X-Google-*`
215
+ # * `X-AppEngine-*`
216
+ #
217
+ # In addition, Cloud Tasks sets some headers when the task is dispatched,
218
+ # such as headers containing information about the task; see
219
+ # [request
220
+ # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
221
+ # These headers are set only when the task is dispatched, so they are not
222
+ # visible when the task is returned in a Cloud Tasks response.
223
+ #
224
+ # Although there is no specific limit for the maximum number of headers or
225
+ # the size, there is a limit on the maximum size of the {::Google::Cloud::Tasks::V2beta2::Task Task}. For more
226
+ # information, see the {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task CreateTask} documentation.
227
+ # @!attribute [rw] payload
228
+ # @return [::String]
229
+ # Payload.
230
+ #
231
+ # The payload will be sent as the HTTP message body. A message
232
+ # body, and thus a payload, is allowed only if the HTTP method is
233
+ # POST or PUT. It is an error to set a data payload on a task with
234
+ # an incompatible {::Google::Cloud::Tasks::V2beta2::HttpMethod HttpMethod}.
235
+ class AppEngineHttpRequest
236
+ include ::Google::Protobuf::MessageExts
237
+ extend ::Google::Protobuf::MessageExts::ClassMethods
238
+
239
+ # @!attribute [rw] key
240
+ # @return [::String]
241
+ # @!attribute [rw] value
242
+ # @return [::String]
243
+ class HeadersEntry
244
+ include ::Google::Protobuf::MessageExts
245
+ extend ::Google::Protobuf::MessageExts::ClassMethods
246
+ end
247
+ end
248
+
249
+ # App Engine Routing.
250
+ #
251
+ # Defines routing characteristics specific to App Engine - service, version,
252
+ # and instance.
253
+ #
254
+ # For more information about services, versions, and instances see
255
+ # [An Overview of App
256
+ # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
257
+ # [Microservices Architecture on Google App
258
+ # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
259
+ # [App Engine Standard request
260
+ # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
261
+ # and [App Engine Flex request
262
+ # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
263
+ # @!attribute [rw] service
264
+ # @return [::String]
265
+ # App service.
266
+ #
267
+ # By default, the task is sent to the service which is the default
268
+ # service when the task is attempted.
269
+ #
270
+ # For some queues or tasks which were created using the App Engine
271
+ # Task Queue API, {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is not parsable
272
+ # into {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service},
273
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and
274
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance}. For example, some tasks
275
+ # which were created using the App Engine SDK use a custom domain
276
+ # name; custom domains are not parsed by Cloud Tasks. If
277
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is not parsable, then
278
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service},
279
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and
280
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} are the empty string.
281
+ # @!attribute [rw] version
282
+ # @return [::String]
283
+ # App version.
284
+ #
285
+ # By default, the task is sent to the version which is the default
286
+ # version when the task is attempted.
287
+ #
288
+ # For some queues or tasks which were created using the App Engine
289
+ # Task Queue API, {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is not parsable
290
+ # into {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service},
291
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and
292
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance}. For example, some tasks
293
+ # which were created using the App Engine SDK use a custom domain
294
+ # name; custom domains are not parsed by Cloud Tasks. If
295
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is not parsable, then
296
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service},
297
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and
298
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} are the empty string.
299
+ # @!attribute [rw] instance
300
+ # @return [::String]
301
+ # App instance.
302
+ #
303
+ # By default, the task is sent to an instance which is available when
304
+ # the task is attempted.
305
+ #
306
+ # Requests can only be sent to a specific instance if
307
+ # [manual scaling is used in App Engine
308
+ # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
309
+ # App Engine Flex does not support instances. For more information, see
310
+ # [App Engine Standard request
311
+ # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
312
+ # and [App Engine Flex request
313
+ # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
314
+ # @!attribute [rw] host
315
+ # @return [::String]
316
+ # Output only. The host that the task is sent to.
317
+ #
318
+ # For more information, see
319
+ # [How Requests are
320
+ # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
321
+ #
322
+ # The host is constructed as:
323
+ #
324
+ #
325
+ # * `host = [application_domain_name]`</br>
326
+ # `| [service] + '.' + [application_domain_name]`</br>
327
+ # `| [version] + '.' + [application_domain_name]`</br>
328
+ # `| [version_dot_service]+ '.' + [application_domain_name]`</br>
329
+ # `| [instance] + '.' + [application_domain_name]`</br>
330
+ # `| [instance_dot_service] + '.' + [application_domain_name]`</br>
331
+ # `| [instance_dot_version] + '.' + [application_domain_name]`</br>
332
+ # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
333
+ #
334
+ # * `application_domain_name` = The domain name of the app, for
335
+ # example <app-id>.appspot.com, which is associated with the
336
+ # queue's project ID. Some tasks which were created using the App Engine
337
+ # SDK use a custom domain name.
338
+ #
339
+ # * `service =` {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}
340
+ #
341
+ # * `version =` {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}
342
+ #
343
+ # * `version_dot_service =`
344
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version} `+ '.' +`
345
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}
346
+ #
347
+ # * `instance =` {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance}
348
+ #
349
+ # * `instance_dot_service =`
350
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} `+ '.' +`
351
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}
352
+ #
353
+ # * `instance_dot_version =`
354
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} `+ '.' +`
355
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}
356
+ #
357
+ # * `instance_dot_version_dot_service =`
358
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} `+ '.' +`
359
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version} `+ '.' +`
360
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}
361
+ #
362
+ # If {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service} is empty, then the task will be sent
363
+ # to the service which is the default service when the task is attempted.
364
+ #
365
+ # If {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version} is empty, then the task will be sent
366
+ # to the version which is the default version when the task is attempted.
367
+ #
368
+ # If {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} is empty, then the task
369
+ # will be sent to an instance which is available when the task is
370
+ # attempted.
371
+ #
372
+ # If {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service},
373
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, or
374
+ # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} is invalid, then the task
375
+ # will be sent to the default version of the default service when
376
+ # the task is attempted.
377
+ class AppEngineRouting
378
+ include ::Google::Protobuf::MessageExts
379
+ extend ::Google::Protobuf::MessageExts::ClassMethods
380
+ end
381
+
382
+ # The HTTP method used to execute the task.
383
+ module HttpMethod
384
+ # HTTP method unspecified
385
+ HTTP_METHOD_UNSPECIFIED = 0
386
+
387
+ # HTTP POST
388
+ POST = 1
389
+
390
+ # HTTP GET
391
+ GET = 2
392
+
393
+ # HTTP HEAD
394
+ HEAD = 3
395
+
396
+ # HTTP PUT
397
+ PUT = 4
398
+
399
+ # HTTP DELETE
400
+ DELETE = 5
401
+ end
402
+ end
403
+ end
404
+ end
405
+ end