google-cloud-tasks 0.2.4 → 0.2.5

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 (25) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/tasks.rb +2 -2
  4. data/lib/google/cloud/tasks/v2beta3.rb +138 -0
  5. data/lib/google/cloud/tasks/v2beta3/cloud_tasks_client.rb +1254 -0
  6. data/lib/google/cloud/tasks/v2beta3/cloud_tasks_client_config.json +106 -0
  7. data/lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb +99 -0
  8. data/lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb +200 -0
  9. data/lib/google/cloud/tasks/v2beta3/credentials.rb +41 -0
  10. data/lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/cloudtasks.rb +340 -0
  11. data/lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/queue.rb +306 -0
  12. data/lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/target.rb +265 -0
  13. data/lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/task.rb +141 -0
  14. data/lib/google/cloud/tasks/v2beta3/doc/google/iam/v1/iam_policy.rb +63 -0
  15. data/lib/google/cloud/tasks/v2beta3/doc/google/iam/v1/policy.rb +128 -0
  16. data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/any.rb +130 -0
  17. data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/duration.rb +91 -0
  18. data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/empty.rb +29 -0
  19. data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/field_mask.rb +230 -0
  20. data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/timestamp.rb +109 -0
  21. data/lib/google/cloud/tasks/v2beta3/doc/google/rpc/status.rb +84 -0
  22. data/lib/google/cloud/tasks/v2beta3/queue_pb.rb +53 -0
  23. data/lib/google/cloud/tasks/v2beta3/target_pb.rb +46 -0
  24. data/lib/google/cloud/tasks/v2beta3/task_pb.rb +48 -0
  25. metadata +25 -4
@@ -0,0 +1,306 @@
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
+ # https://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
+
16
+ module Google
17
+ module Cloud
18
+ module Tasks
19
+ module V2beta3
20
+ # A queue is a container of related tasks. Queues are configured to manage
21
+ # how those tasks are dispatched. Configurable properties include rate limits,
22
+ # retry options, queue types, and others.
23
+ # @!attribute [rw] name
24
+ # @return [String]
25
+ # Caller-specified and required in {Google::Cloud::Tasks::V2beta3::CloudTasks::CreateQueue CreateQueue},
26
+ # after which it becomes output only.
27
+ #
28
+ # The queue name.
29
+ #
30
+ # The queue name must have the following format:
31
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
32
+ #
33
+ # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
34
+ # hyphens (-), colons (:), or periods (.).
35
+ # For more information, see
36
+ # [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
37
+ # * `LOCATION_ID` is the canonical ID for the queue's location.
38
+ # The list of available locations can be obtained by calling
39
+ # {Google::Cloud::Location::Locations::ListLocations ListLocations}.
40
+ # For more information, see https://cloud.google.com/about/locations/.
41
+ # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
42
+ # hyphens (-). The maximum length is 100 characters.
43
+ # @!attribute [rw] app_engine_http_queue
44
+ # @return [Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue]
45
+ # App Engine HTTP queue.
46
+ #
47
+ # An App Engine queue is a queue that has an {Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue AppEngineHttpQueue} type.
48
+ # @!attribute [rw] rate_limits
49
+ # @return [Google::Cloud::Tasks::V2beta3::RateLimits]
50
+ # Rate limits for task dispatches.
51
+ #
52
+ # {Google::Cloud::Tasks::V2beta3::Queue#rate_limits rate_limits} and
53
+ # {Google::Cloud::Tasks::V2beta3::Queue#retry_config retry_config} are related because they both
54
+ # control task attempts however they control how tasks are
55
+ # attempted in different ways:
56
+ #
57
+ # * {Google::Cloud::Tasks::V2beta3::Queue#rate_limits rate_limits} controls the total rate of
58
+ # dispatches from a queue (i.e. all traffic dispatched from the
59
+ # queue, regardless of whether the dispatch is from a first
60
+ # attempt or a retry).
61
+ # * {Google::Cloud::Tasks::V2beta3::Queue#retry_config retry_config} controls what happens to
62
+ # particular a task after its first attempt fails. That is,
63
+ # {Google::Cloud::Tasks::V2beta3::Queue#retry_config retry_config} controls task retries (the
64
+ # second attempt, third attempt, etc).
65
+ # @!attribute [rw] retry_config
66
+ # @return [Google::Cloud::Tasks::V2beta3::RetryConfig]
67
+ # Settings that determine the retry behavior.
68
+ #
69
+ # * For tasks created using Cloud Tasks: the queue-level retry settings
70
+ # apply to all tasks in the queue that were created using Cloud Tasks.
71
+ # Retry settings cannot be set on individual tasks.
72
+ # * For tasks created using the App Engine SDK: the queue-level retry
73
+ # settings apply to all tasks in the queue which do not have retry settings
74
+ # explicitly set on the task and were created by the App Engine SDK. See
75
+ # [App Engine documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
76
+ # @!attribute [rw] state
77
+ # @return [Google::Cloud::Tasks::V2beta3::Queue::State]
78
+ # Output only. The state of the queue.
79
+ #
80
+ # `state` can only be changed by called
81
+ # {Google::Cloud::Tasks::V2beta3::CloudTasks::PauseQueue PauseQueue},
82
+ # {Google::Cloud::Tasks::V2beta3::CloudTasks::ResumeQueue ResumeQueue}, or uploading
83
+ # [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref).
84
+ # {Google::Cloud::Tasks::V2beta3::CloudTasks::UpdateQueue UpdateQueue} cannot be used to change `state`.
85
+ # @!attribute [rw] purge_time
86
+ # @return [Google::Protobuf::Timestamp]
87
+ # Output only. The last time this queue was purged.
88
+ #
89
+ # All tasks that were {Google::Cloud::Tasks::V2beta3::Task#create_time created} before this time
90
+ # were purged.
91
+ #
92
+ # A queue can be purged using {Google::Cloud::Tasks::V2beta3::CloudTasks::PurgeQueue PurgeQueue}, the
93
+ # [App Engine Task Queue SDK, or the Cloud Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
94
+ #
95
+ # Purge time will be truncated to the nearest microsecond. Purge
96
+ # time will be unset if the queue has never been purged.
97
+ class Queue
98
+ # State of the queue.
99
+ module State
100
+ # Unspecified state.
101
+ STATE_UNSPECIFIED = 0
102
+
103
+ # The queue is running. Tasks can be dispatched.
104
+ #
105
+ # If the queue was created using Cloud Tasks and the queue has
106
+ # had no activity (method calls or task dispatches) for 30 days,
107
+ # the queue may take a few minutes to re-activate. Some method
108
+ # calls may return {Google::Rpc::Code::NOT_FOUND NOT_FOUND} and
109
+ # tasks may not be dispatched for a few minutes until the queue
110
+ # has been re-activated.
111
+ RUNNING = 1
112
+
113
+ # Tasks are paused by the user. If the queue is paused then Cloud
114
+ # Tasks will stop delivering tasks from it, but more tasks can
115
+ # still be added to it by the user.
116
+ PAUSED = 2
117
+
118
+ # The queue is disabled.
119
+ #
120
+ # A queue becomes `DISABLED` when
121
+ # [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) or
122
+ # [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) is uploaded
123
+ # which does not contain the queue. You cannot directly disable a queue.
124
+ #
125
+ # When a queue is disabled, tasks can still be added to a queue
126
+ # but the tasks are not dispatched.
127
+ #
128
+ # To permanently delete this queue and all of its tasks, call
129
+ # {Google::Cloud::Tasks::V2beta3::CloudTasks::DeleteQueue DeleteQueue}.
130
+ DISABLED = 3
131
+ end
132
+ end
133
+
134
+ # Rate limits.
135
+ #
136
+ # This message determines the maximum rate that tasks can be dispatched by a
137
+ # queue, regardless of whether the dispatch is a first task attempt or a retry.
138
+ #
139
+ # Note: The debugging command, {Google::Cloud::Tasks::V2beta3::CloudTasks::RunTask RunTask}, will run a task
140
+ # even if the queue has reached its {Google::Cloud::Tasks::V2beta3::RateLimits RateLimits}.
141
+ # @!attribute [rw] max_dispatches_per_second
142
+ # @return [Float]
143
+ # The maximum rate at which tasks are dispatched from this queue.
144
+ #
145
+ # If unspecified when the queue is created, Cloud Tasks will pick the
146
+ # default.
147
+ #
148
+ # * For {Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue App Engine queues}, the maximum allowed value
149
+ # is 500.
150
+ #
151
+ #
152
+ # This field has the same meaning as
153
+ # [rate in queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate).
154
+ # @!attribute [rw] max_burst_size
155
+ # @return [Integer]
156
+ # Output only. The max burst size.
157
+ #
158
+ # Max burst size limits how fast tasks in queue are processed when
159
+ # many tasks are in the queue and the rate is high. This field
160
+ # allows the queue to have a high rate so processing starts shortly
161
+ # after a task is enqueued, but still limits resource usage when
162
+ # many tasks are enqueued in a short period of time.
163
+ #
164
+ # The [token bucket](https://wikipedia.org/wiki/Token_Bucket)
165
+ # algorithm is used to control the rate of task dispatches. Each
166
+ # queue has a token bucket that holds tokens, up to the maximum
167
+ # specified by `max_burst_size`. Each time a task is dispatched, a
168
+ # token is removed from the bucket. Tasks will be dispatched until
169
+ # the queue's bucket runs out of tokens. The bucket will be
170
+ # continuously refilled with new tokens based on
171
+ # {Google::Cloud::Tasks::V2beta3::RateLimits#max_dispatches_per_second max_dispatches_per_second}.
172
+ #
173
+ # Cloud Tasks will pick the value of `max_burst_size` based on the
174
+ # value of
175
+ # {Google::Cloud::Tasks::V2beta3::RateLimits#max_dispatches_per_second max_dispatches_per_second}.
176
+ #
177
+ # For App Engine queues that were created or updated using
178
+ # `queue.yaml/xml`, `max_burst_size` is equal to
179
+ # [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size).
180
+ # Since `max_burst_size` is output only, if
181
+ # {Google::Cloud::Tasks::V2beta3::CloudTasks::UpdateQueue UpdateQueue} is called on a queue
182
+ # created by `queue.yaml/xml`, `max_burst_size` will be reset based
183
+ # on the value of
184
+ # {Google::Cloud::Tasks::V2beta3::RateLimits#max_dispatches_per_second max_dispatches_per_second},
185
+ # regardless of whether
186
+ # {Google::Cloud::Tasks::V2beta3::RateLimits#max_dispatches_per_second max_dispatches_per_second}
187
+ # is updated.
188
+ # @!attribute [rw] max_concurrent_dispatches
189
+ # @return [Integer]
190
+ # The maximum number of concurrent tasks that Cloud Tasks allows
191
+ # to be dispatched for this queue. After this threshold has been
192
+ # reached, Cloud Tasks stops dispatching tasks until the number of
193
+ # concurrent requests decreases.
194
+ #
195
+ # If unspecified when the queue is created, Cloud Tasks will pick the
196
+ # default.
197
+ #
198
+ #
199
+ # The maximum allowed value is 5,000.
200
+ #
201
+ #
202
+ # This field has the same meaning as
203
+ # [max_concurrent_requests in queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests).
204
+ class RateLimits; end
205
+
206
+ # Retry config.
207
+ #
208
+ # These settings determine when a failed task attempt is retried.
209
+ # @!attribute [rw] max_attempts
210
+ # @return [Integer]
211
+ # Number of attempts per task.
212
+ #
213
+ # Cloud Tasks will attempt the task `max_attempts` times (that is, if the
214
+ # first attempt fails, then there will be `max_attempts - 1` retries). Must
215
+ # be >= -1.
216
+ #
217
+ # If unspecified when the queue is created, Cloud Tasks will pick the
218
+ # default.
219
+ #
220
+ # -1 indicates unlimited attempts.
221
+ #
222
+ # This field has the same meaning as
223
+ # [task_retry_limit in queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
224
+ # @!attribute [rw] max_retry_duration
225
+ # @return [Google::Protobuf::Duration]
226
+ # If positive, `max_retry_duration` specifies the time limit for
227
+ # retrying a failed task, measured from when the task was first
228
+ # attempted. Once `max_retry_duration` time has passed *and* the
229
+ # task has been attempted {Google::Cloud::Tasks::V2beta3::RetryConfig#max_attempts max_attempts}
230
+ # times, no further attempts will be made and the task will be
231
+ # deleted.
232
+ #
233
+ # If zero, then the task age is unlimited.
234
+ #
235
+ # If unspecified when the queue is created, Cloud Tasks will pick the
236
+ # default.
237
+ #
238
+ #
239
+ # `max_retry_duration` will be truncated to the nearest second.
240
+ #
241
+ # This field has the same meaning as
242
+ # [task_age_limit in queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
243
+ # @!attribute [rw] min_backoff
244
+ # @return [Google::Protobuf::Duration]
245
+ # A task will be {Google::Cloud::Tasks::V2beta3::Task#schedule_time scheduled} for retry between
246
+ # {Google::Cloud::Tasks::V2beta3::RetryConfig#min_backoff min_backoff} and
247
+ # {Google::Cloud::Tasks::V2beta3::RetryConfig#max_backoff max_backoff} duration after it fails,
248
+ # if the queue's {Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig} specifies that the task should be
249
+ # retried.
250
+ #
251
+ # If unspecified when the queue is created, Cloud Tasks will pick the
252
+ # default.
253
+ #
254
+ #
255
+ # `min_backoff` will be truncated to the nearest second.
256
+ #
257
+ # This field has the same meaning as
258
+ # [min_backoff_seconds in queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
259
+ # @!attribute [rw] max_backoff
260
+ # @return [Google::Protobuf::Duration]
261
+ # A task will be {Google::Cloud::Tasks::V2beta3::Task#schedule_time scheduled} for retry between
262
+ # {Google::Cloud::Tasks::V2beta3::RetryConfig#min_backoff min_backoff} and
263
+ # {Google::Cloud::Tasks::V2beta3::RetryConfig#max_backoff max_backoff} duration after it fails,
264
+ # if the queue's {Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig} specifies that the task should be
265
+ # retried.
266
+ #
267
+ # If unspecified when the queue is created, Cloud Tasks will pick the
268
+ # default.
269
+ #
270
+ #
271
+ # `max_backoff` will be truncated to the nearest second.
272
+ #
273
+ # This field has the same meaning as
274
+ # [max_backoff_seconds in queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
275
+ # @!attribute [rw] max_doublings
276
+ # @return [Integer]
277
+ # The time between retries will double `max_doublings` times.
278
+ #
279
+ # A task's retry interval starts at
280
+ # {Google::Cloud::Tasks::V2beta3::RetryConfig#min_backoff min_backoff}, then doubles
281
+ # `max_doublings` times, then increases linearly, and finally
282
+ # retries retries at intervals of
283
+ # {Google::Cloud::Tasks::V2beta3::RetryConfig#max_backoff max_backoff} up to
284
+ # {Google::Cloud::Tasks::V2beta3::RetryConfig#max_attempts max_attempts} times.
285
+ #
286
+ # For example, if {Google::Cloud::Tasks::V2beta3::RetryConfig#min_backoff min_backoff} is 10s,
287
+ # {Google::Cloud::Tasks::V2beta3::RetryConfig#max_backoff max_backoff} is 300s, and
288
+ # `max_doublings` is 3, then the a task will first be retried in
289
+ # 10s. The retry interval will double three times, and then
290
+ # increase linearly by 2^3 * 10s. Finally, the task will retry at
291
+ # intervals of {Google::Cloud::Tasks::V2beta3::RetryConfig#max_backoff max_backoff} until the
292
+ # task has been attempted {Google::Cloud::Tasks::V2beta3::RetryConfig#max_attempts max_attempts}
293
+ # times. Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s,
294
+ # 240s, 300s, 300s, ....
295
+ #
296
+ # If unspecified when the queue is created, Cloud Tasks will pick the
297
+ # default.
298
+ #
299
+ #
300
+ # This field has the same meaning as
301
+ # [max_doublings in queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
302
+ class RetryConfig; end
303
+ end
304
+ end
305
+ end
306
+ end
@@ -0,0 +1,265 @@
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
+ # https://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
+
16
+ module Google
17
+ module Cloud
18
+ module Tasks
19
+ module V2beta3
20
+ # App Engine HTTP queue.
21
+ #
22
+ # The task will be delivered to the App Engine application hostname
23
+ # specified by its {Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue AppEngineHttpQueue} and {Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest AppEngineHttpRequest}.
24
+ # The documentation for {Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest AppEngineHttpRequest} explains how the
25
+ # task's host URL is constructed.
26
+ #
27
+ # Using {Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue AppEngineHttpQueue} requires
28
+ # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
29
+ # Google IAM permission for the project
30
+ # and the following scope:
31
+ #
32
+ # `https://www.googleapis.com/auth/cloud-platform`
33
+ # @!attribute [rw] app_engine_routing_override
34
+ # @return [Google::Cloud::Tasks::V2beta3::AppEngineRouting]
35
+ # Overrides for the
36
+ # {Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest#app_engine_routing task-level app_engine_routing}.
37
+ #
38
+ # If set, `app_engine_routing_override` is used for all tasks in
39
+ # the queue, no matter what the setting is for the
40
+ # {Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest#app_engine_routing task-level app_engine_routing}.
41
+ class AppEngineHttpQueue; end
42
+
43
+ # App Engine HTTP request.
44
+ #
45
+ # The message defines the HTTP request that is sent to an App Engine app when
46
+ # the task is dispatched.
47
+ #
48
+ # This proto can only be used for tasks in a queue which has
49
+ # {Google::Cloud::Tasks::V2beta3::Queue#app_engine_http_queue app_engine_http_queue} set.
50
+ #
51
+ # Using {Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest AppEngineHttpRequest} requires
52
+ # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
53
+ # Google IAM permission for the project
54
+ # and the following scope:
55
+ #
56
+ # `https://www.googleapis.com/auth/cloud-platform`
57
+ #
58
+ # The task will be delivered to the App Engine app which belongs to the same
59
+ # project as the queue. For more information, see
60
+ # [How Requests are Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
61
+ # and how routing is affected by
62
+ # [dispatch files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
63
+ #
64
+ # The {Google::Cloud::Tasks::V2beta3::AppEngineRouting AppEngineRouting} used to construct the URL that the task is
65
+ # delivered to can be set at the queue-level or task-level:
66
+ #
67
+ # * If set,
68
+ # {Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue#app_engine_routing_override app_engine_routing_override}
69
+ # is used for all tasks in the queue, no matter what the setting
70
+ # is for the
71
+ # {Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest#app_engine_routing task-level app_engine_routing}.
72
+ #
73
+ #
74
+ # The `url` that the task will be sent to is:
75
+ #
76
+ # * `url =` {Google::Cloud::Tasks::V2beta3::AppEngineRouting#host host} `+`
77
+ # {Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest#relative_uri relative_uri}
78
+ #
79
+ # The task attempt has succeeded if the app's request handler returns
80
+ # an HTTP response code in the range [`200` - `299`]. `503` is
81
+ # considered an App Engine system error instead of an application
82
+ # error. Requests returning error `503` will be retried regardless of
83
+ # retry configuration and not counted against retry counts.
84
+ # Any other response code or a failure to receive a response before the
85
+ # deadline is a failed attempt.
86
+ # @!attribute [rw] http_method
87
+ # @return [Google::Cloud::Tasks::V2beta3::HttpMethod]
88
+ # The HTTP method to use for the request. The default is POST.
89
+ #
90
+ # The app's request handler for the task's target URL must be able to handle
91
+ # HTTP requests with this http_method, otherwise the task attempt will fail
92
+ # with error code 405 (Method Not Allowed). See
93
+ # [Writing a push task request handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
94
+ # and the documentation for the request handlers in the language your app is
95
+ # written in e.g.
96
+ # [Python Request Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass).
97
+ # @!attribute [rw] app_engine_routing
98
+ # @return [Google::Cloud::Tasks::V2beta3::AppEngineRouting]
99
+ # Task-level setting for App Engine routing.
100
+ #
101
+ # If set,
102
+ # {Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue#app_engine_routing_override app_engine_routing_override}
103
+ # is used for all tasks in the queue, no matter what the setting is for the
104
+ # {Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest#app_engine_routing task-level app_engine_routing}.
105
+ # @!attribute [rw] relative_uri
106
+ # @return [String]
107
+ # The relative URI.
108
+ #
109
+ # The relative URI must begin with "/" and must be a valid HTTP relative URI.
110
+ # It can contain a path and query string arguments.
111
+ # If the relative URI is empty, then the root path "/" will be used.
112
+ # No spaces are allowed, and the maximum length allowed is 2083 characters.
113
+ # @!attribute [rw] headers
114
+ # @return [Hash{String => String}]
115
+ # HTTP request headers.
116
+ #
117
+ # This map contains the header field names and values.
118
+ # Headers can be set when the
119
+ # {Google::Cloud::Tasks::V2beta3::CloudTasks::CreateTask task is created}.
120
+ # Repeated headers are not supported but a header value can contain commas.
121
+ #
122
+ # Cloud Tasks sets some headers to default values:
123
+ #
124
+ # * `User-Agent`: By default, this header is
125
+ # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
126
+ # This header can be modified, but Cloud Tasks will append
127
+ # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
128
+ # modified `User-Agent`.
129
+ #
130
+ # If the task has a {Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest#body body}, Cloud
131
+ # Tasks sets the following headers:
132
+ #
133
+ # * `Content-Type`: By default, the `Content-Type` header is set to
134
+ # `"application/octet-stream"`. The default can be overridden by explicitly
135
+ # setting `Content-Type` to a particular media type when the
136
+ # {Google::Cloud::Tasks::V2beta3::CloudTasks::CreateTask task is created}.
137
+ # For example, `Content-Type` can be set to `"application/json"`.
138
+ # * `Content-Length`: This is computed by Cloud Tasks. This value is
139
+ # output only. It cannot be changed.
140
+ #
141
+ # The headers below cannot be set or overridden:
142
+ #
143
+ # * `Host`
144
+ # * `X-Google-*`
145
+ # * `X-AppEngine-*`
146
+ #
147
+ # In addition, Cloud Tasks sets some headers when the task is dispatched,
148
+ # such as headers containing information about the task; see
149
+ # [request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
150
+ # These headers are set only when the task is dispatched, so they are not
151
+ # visible when the task is returned in a Cloud Tasks response.
152
+ #
153
+ # Although there is no specific limit for the maximum number of headers or
154
+ # the size, there is a limit on the maximum size of the {Google::Cloud::Tasks::V2beta3::Task Task}. For more
155
+ # information, see the {Google::Cloud::Tasks::V2beta3::CloudTasks::CreateTask CreateTask} documentation.
156
+ # @!attribute [rw] body
157
+ # @return [String]
158
+ # HTTP request body.
159
+ #
160
+ # A request body is allowed only if the HTTP method is POST or PUT. It is
161
+ # an error to set a body on a task with an incompatible {Google::Cloud::Tasks::V2beta3::HttpMethod HttpMethod}.
162
+ class AppEngineHttpRequest; end
163
+
164
+ # App Engine Routing.
165
+ #
166
+ # Specifies the target URI. Since this target type dispatches tasks to secure
167
+ # app handlers, unsecure app handlers, and URIs restricted with
168
+ # [`login: admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
169
+ # the protocol (for example, HTTP or HTTPS) cannot be explictly specified.
170
+ # Task dispatches do not follow redirects and cannot target URI paths
171
+ # restricted with
172
+ # [`login: required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
173
+ # because tasks are not run as any user.
174
+ #
175
+ # For more information about services, versions, and instances see
176
+ # [An Overview of App Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
177
+ # [Microservices Architecture on Google App Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
178
+ # [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
179
+ # and [App Engine Flex request routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
180
+ # @!attribute [rw] service
181
+ # @return [String]
182
+ # App service.
183
+ #
184
+ # By default, the task is sent to the service which is the default
185
+ # service when the task is attempted.
186
+ #
187
+ # For some queues or tasks which were created using the App Engine
188
+ # Task Queue API, {Google::Cloud::Tasks::V2beta3::AppEngineRouting#host host} is not parsable
189
+ # into {Google::Cloud::Tasks::V2beta3::AppEngineRouting#service service},
190
+ # {Google::Cloud::Tasks::V2beta3::AppEngineRouting#version version}, and
191
+ # {Google::Cloud::Tasks::V2beta3::AppEngineRouting#instance instance}. For example, some tasks
192
+ # which were created using the App Engine SDK use a custom domain
193
+ # name; custom domains are not parsed by Cloud Tasks. If
194
+ # {Google::Cloud::Tasks::V2beta3::AppEngineRouting#host host} is not parsable, then
195
+ # {Google::Cloud::Tasks::V2beta3::AppEngineRouting#service service},
196
+ # {Google::Cloud::Tasks::V2beta3::AppEngineRouting#version version}, and
197
+ # {Google::Cloud::Tasks::V2beta3::AppEngineRouting#instance instance} are the empty string.
198
+ # @!attribute [rw] version
199
+ # @return [String]
200
+ # App version.
201
+ #
202
+ # By default, the task is sent to the version which is the default
203
+ # version when the task is attempted.
204
+ #
205
+ # For some queues or tasks which were created using the App Engine
206
+ # Task Queue API, {Google::Cloud::Tasks::V2beta3::AppEngineRouting#host host} is not parsable
207
+ # into {Google::Cloud::Tasks::V2beta3::AppEngineRouting#service service},
208
+ # {Google::Cloud::Tasks::V2beta3::AppEngineRouting#version version}, and
209
+ # {Google::Cloud::Tasks::V2beta3::AppEngineRouting#instance instance}. For example, some tasks
210
+ # which were created using the App Engine SDK use a custom domain
211
+ # name; custom domains are not parsed by Cloud Tasks. If
212
+ # {Google::Cloud::Tasks::V2beta3::AppEngineRouting#host host} is not parsable, then
213
+ # {Google::Cloud::Tasks::V2beta3::AppEngineRouting#service service},
214
+ # {Google::Cloud::Tasks::V2beta3::AppEngineRouting#version version}, and
215
+ # {Google::Cloud::Tasks::V2beta3::AppEngineRouting#instance instance} are the empty string.
216
+ # @!attribute [rw] instance
217
+ # @return [String]
218
+ # App instance.
219
+ #
220
+ # By default, the task is sent to an instance which is available when
221
+ # the task is attempted.
222
+ #
223
+ # Requests can only be sent to a specific instance if
224
+ # [manual scaling is used in App Engine Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
225
+ # App Engine Flex does not support instances. For more information, see
226
+ # [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
227
+ # and [App Engine Flex request routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
228
+ # @!attribute [rw] host
229
+ # @return [String]
230
+ # Output only. The host that the task is sent to.
231
+ #
232
+ # The host is constructed from the domain name of the app associated with
233
+ # the queue's project ID (for example <app-id>.appspot.com), and the
234
+ # {Google::Cloud::Tasks::V2beta3::AppEngineRouting#service service}, {Google::Cloud::Tasks::V2beta3::AppEngineRouting#version version},
235
+ # and {Google::Cloud::Tasks::V2beta3::AppEngineRouting#instance instance}. Tasks which were created using
236
+ # the App Engine SDK might have a custom domain name.
237
+ #
238
+ # For more information, see
239
+ # [How Requests are Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
240
+ class AppEngineRouting; end
241
+
242
+ # The HTTP method used to execute the task.
243
+ module HttpMethod
244
+ # HTTP method unspecified
245
+ HTTP_METHOD_UNSPECIFIED = 0
246
+
247
+ # HTTP POST
248
+ POST = 1
249
+
250
+ # HTTP GET
251
+ GET = 2
252
+
253
+ # HTTP HEAD
254
+ HEAD = 3
255
+
256
+ # HTTP PUT
257
+ PUT = 4
258
+
259
+ # HTTP DELETE
260
+ DELETE = 5
261
+ end
262
+ end
263
+ end
264
+ end
265
+ end