google-cloud-tasks-v2beta3 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/tasks/v2beta3/bindings_override.rb +102 -0
- data/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb +265 -109
- data/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb +523 -114
- data/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb +61 -0
- data/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest.rb +1 -0
- data/lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb +5 -1
- data/lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb +49 -30
- data/lib/google/cloud/tasks/v2beta3/queue_pb.rb +1 -1
- data/lib/google/cloud/tasks/v2beta3/rest.rb +1 -0
- data/lib/google/cloud/tasks/v2beta3/target_pb.rb +9 -1
- data/lib/google/cloud/tasks/v2beta3/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +14 -0
- data/proto_docs/google/api/httpbody.rb +80 -0
- data/proto_docs/google/cloud/tasks/v2beta3/cloudtasks.rb +155 -99
- data/proto_docs/google/cloud/tasks/v2beta3/queue.rb +5 -2
- data/proto_docs/google/cloud/tasks/v2beta3/target.rb +199 -0
- data/proto_docs/google/cloud/tasks/v2beta3/task.rb +1 -1
- data/proto_docs/google/iam/v1/policy.rb +8 -4
- metadata +27 -5
@@ -19,6 +19,7 @@
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/tasks/v2beta3/cloudtasks_pb"
|
21
21
|
require "google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub"
|
22
|
+
require "google/cloud/location/rest"
|
22
23
|
|
23
24
|
module Google
|
24
25
|
module Cloud
|
@@ -123,6 +124,8 @@ module Google
|
|
123
124
|
|
124
125
|
default_config.rpcs.run_task.timeout = 20.0
|
125
126
|
|
127
|
+
default_config.rpcs.buffer_task.timeout = 20.0
|
128
|
+
|
126
129
|
default_config
|
127
130
|
end
|
128
131
|
yield @configure if block_given?
|
@@ -187,9 +190,23 @@ module Google
|
|
187
190
|
@quota_project_id = @config.quota_project
|
188
191
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
189
192
|
|
193
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
194
|
+
config.credentials = credentials
|
195
|
+
config.quota_project = @quota_project_id
|
196
|
+
config.endpoint = @config.endpoint
|
197
|
+
config.bindings_override = @config.bindings_override
|
198
|
+
end
|
199
|
+
|
190
200
|
@cloud_tasks_stub = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
191
201
|
end
|
192
202
|
|
203
|
+
##
|
204
|
+
# Get the associated client for mix-in of the Locations.
|
205
|
+
#
|
206
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
207
|
+
#
|
208
|
+
attr_reader :location_client
|
209
|
+
|
193
210
|
# Service calls
|
194
211
|
|
195
212
|
##
|
@@ -216,11 +233,10 @@ module Google
|
|
216
233
|
# Required. The location name.
|
217
234
|
# For example: `projects/PROJECT_ID/locations/LOCATION_ID`
|
218
235
|
# @param filter [::String]
|
219
|
-
# `filter` can be used to specify a subset of queues. Any
|
220
|
-
# field can be used as a filter and
|
221
|
-
# For example: `<=, <, >=, >, !=, =, :`. The
|
222
|
-
# described in
|
223
|
-
# [Stackdriver's Advanced Logs
|
236
|
+
# `filter` can be used to specify a subset of queues. Any
|
237
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue Queue} field can be used as a filter and
|
238
|
+
# several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The
|
239
|
+
# filter syntax is the same as described in [Stackdriver's Advanced Logs
|
224
240
|
# Filters](https://cloud.google.com/logging/docs/view/advanced_filters).
|
225
241
|
#
|
226
242
|
# Sample filter "state: PAUSED".
|
@@ -233,20 +249,22 @@ module Google
|
|
233
249
|
# The maximum page size is 9800. If unspecified, the page size will
|
234
250
|
# be the maximum. Fewer queues than requested might be returned,
|
235
251
|
# even if more queues exist; use the
|
236
|
-
# {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token}
|
237
|
-
# response to determine if more queues exist.
|
252
|
+
# {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token}
|
253
|
+
# in the response to determine if more queues exist.
|
238
254
|
# @param page_token [::String]
|
239
255
|
# A token identifying the page of results to return.
|
240
256
|
#
|
241
257
|
# To request the first page results, page_token must be empty. To
|
242
258
|
# request the next page of results, page_token must be the value of
|
243
|
-
# {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token}
|
244
|
-
# from the previous call to
|
245
|
-
# method. It
|
246
|
-
#
|
259
|
+
# {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token}
|
260
|
+
# returned from the previous call to
|
261
|
+
# {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#list_queues ListQueues} method. It
|
262
|
+
# is an error to switch the value of the
|
263
|
+
# {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest#filter filter} while
|
264
|
+
# iterating through pages.
|
247
265
|
# @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
|
248
|
-
# Optional. Read mask is used for a more granular control over what the API
|
249
|
-
# If the mask is not present all fields will be returned except
|
266
|
+
# Optional. Read mask is used for a more granular control over what the API
|
267
|
+
# returns. If the mask is not present all fields will be returned except
|
250
268
|
# [Queue.stats]. [Queue.stats] will be returned only if it was explicitly
|
251
269
|
# specified in the mask.
|
252
270
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
@@ -256,6 +274,26 @@ module Google
|
|
256
274
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Queue>]
|
257
275
|
#
|
258
276
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
277
|
+
#
|
278
|
+
# @example Basic example
|
279
|
+
# require "google/cloud/tasks/v2beta3"
|
280
|
+
#
|
281
|
+
# # Create a client object. The client can be reused for multiple calls.
|
282
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
283
|
+
#
|
284
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
285
|
+
# request = Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new
|
286
|
+
#
|
287
|
+
# # Call the list_queues method.
|
288
|
+
# result = client.list_queues request
|
289
|
+
#
|
290
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
291
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
292
|
+
# result.each do |item|
|
293
|
+
# # Each element is of type ::Google::Cloud::Tasks::V2beta3::Queue.
|
294
|
+
# p item
|
295
|
+
# end
|
296
|
+
#
|
259
297
|
def list_queues request, options = nil
|
260
298
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
261
299
|
|
@@ -314,8 +352,8 @@ module Google
|
|
314
352
|
# Required. The resource name of the queue. For example:
|
315
353
|
# `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
|
316
354
|
# @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
|
317
|
-
# Optional. Read mask is used for a more granular control over what the API
|
318
|
-
# If the mask is not present all fields will be returned except
|
355
|
+
# Optional. Read mask is used for a more granular control over what the API
|
356
|
+
# returns. If the mask is not present all fields will be returned except
|
319
357
|
# [Queue.stats]. [Queue.stats] will be returned only if it was explicitly
|
320
358
|
# specified in the mask.
|
321
359
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
@@ -325,6 +363,22 @@ module Google
|
|
325
363
|
# @return [::Google::Cloud::Tasks::V2beta3::Queue]
|
326
364
|
#
|
327
365
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
366
|
+
#
|
367
|
+
# @example Basic example
|
368
|
+
# require "google/cloud/tasks/v2beta3"
|
369
|
+
#
|
370
|
+
# # Create a client object. The client can be reused for multiple calls.
|
371
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
372
|
+
#
|
373
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
374
|
+
# request = Google::Cloud::Tasks::V2beta3::GetQueueRequest.new
|
375
|
+
#
|
376
|
+
# # Call the get_queue method.
|
377
|
+
# result = client.get_queue request
|
378
|
+
#
|
379
|
+
# # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue.
|
380
|
+
# p result
|
381
|
+
#
|
328
382
|
def get_queue request, options = nil
|
329
383
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
330
384
|
|
@@ -364,8 +418,8 @@ module Google
|
|
364
418
|
# Creates a queue.
|
365
419
|
#
|
366
420
|
# Queues created with this method allow tasks to live for a maximum of 31
|
367
|
-
# days. After a task is 31 days old, the task will be deleted regardless of
|
368
|
-
# it was dispatched or not.
|
421
|
+
# days. After a task is 31 days old, the task will be deleted regardless of
|
422
|
+
# whether it was dispatched or not.
|
369
423
|
#
|
370
424
|
# WARNING: Using this method may have unintended side effects if you are
|
371
425
|
# using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
|
@@ -395,11 +449,12 @@ module Google
|
|
395
449
|
#
|
396
450
|
# The list of allowed locations can be obtained by calling Cloud
|
397
451
|
# Tasks' implementation of
|
398
|
-
#
|
452
|
+
# `::Google::Cloud::Location::Locations::Rest::Client#list_locations`.
|
399
453
|
# @param queue [::Google::Cloud::Tasks::V2beta3::Queue, ::Hash]
|
400
454
|
# Required. The queue to create.
|
401
455
|
#
|
402
|
-
# [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as
|
456
|
+
# [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as
|
457
|
+
# an existing queue.
|
403
458
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
404
459
|
# @yieldparam result [::Google::Cloud::Tasks::V2beta3::Queue]
|
405
460
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -407,6 +462,22 @@ module Google
|
|
407
462
|
# @return [::Google::Cloud::Tasks::V2beta3::Queue]
|
408
463
|
#
|
409
464
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
465
|
+
#
|
466
|
+
# @example Basic example
|
467
|
+
# require "google/cloud/tasks/v2beta3"
|
468
|
+
#
|
469
|
+
# # Create a client object. The client can be reused for multiple calls.
|
470
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
471
|
+
#
|
472
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
473
|
+
# request = Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new
|
474
|
+
#
|
475
|
+
# # Call the create_queue method.
|
476
|
+
# result = client.create_queue request
|
477
|
+
#
|
478
|
+
# # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue.
|
479
|
+
# p result
|
480
|
+
#
|
410
481
|
def create_queue request, options = nil
|
411
482
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
412
483
|
|
@@ -449,8 +520,8 @@ module Google
|
|
449
520
|
# the queue if it does exist.
|
450
521
|
#
|
451
522
|
# Queues created with this method allow tasks to live for a maximum of 31
|
452
|
-
# days. After a task is 31 days old, the task will be deleted regardless of
|
453
|
-
# it was dispatched or not.
|
523
|
+
# days. After a task is 31 days old, the task will be deleted regardless of
|
524
|
+
# whether it was dispatched or not.
|
454
525
|
#
|
455
526
|
# WARNING: Using this method may have unintended side effects if you are
|
456
527
|
# using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
|
@@ -477,11 +548,13 @@ module Google
|
|
477
548
|
# @param queue [::Google::Cloud::Tasks::V2beta3::Queue, ::Hash]
|
478
549
|
# Required. The queue to create or update.
|
479
550
|
#
|
480
|
-
# The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} must be
|
551
|
+
# The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} must be
|
552
|
+
# specified.
|
481
553
|
#
|
482
554
|
# Output only fields cannot be modified using UpdateQueue.
|
483
555
|
# Any value specified for an output only field will be ignored.
|
484
|
-
# The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} cannot be
|
556
|
+
# The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} cannot be
|
557
|
+
# changed.
|
485
558
|
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
486
559
|
# A mask used to specify which fields of the queue are being updated.
|
487
560
|
#
|
@@ -493,6 +566,22 @@ module Google
|
|
493
566
|
# @return [::Google::Cloud::Tasks::V2beta3::Queue]
|
494
567
|
#
|
495
568
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
569
|
+
#
|
570
|
+
# @example Basic example
|
571
|
+
# require "google/cloud/tasks/v2beta3"
|
572
|
+
#
|
573
|
+
# # Create a client object. The client can be reused for multiple calls.
|
574
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
575
|
+
#
|
576
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
577
|
+
# request = Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new
|
578
|
+
#
|
579
|
+
# # Call the update_queue method.
|
580
|
+
# result = client.update_queue request
|
581
|
+
#
|
582
|
+
# # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue.
|
583
|
+
# p result
|
584
|
+
#
|
496
585
|
def update_queue request, options = nil
|
497
586
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
498
587
|
|
@@ -568,6 +657,22 @@ module Google
|
|
568
657
|
# @return [::Google::Protobuf::Empty]
|
569
658
|
#
|
570
659
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
660
|
+
#
|
661
|
+
# @example Basic example
|
662
|
+
# require "google/cloud/tasks/v2beta3"
|
663
|
+
#
|
664
|
+
# # Create a client object. The client can be reused for multiple calls.
|
665
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
666
|
+
#
|
667
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
668
|
+
# request = Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new
|
669
|
+
#
|
670
|
+
# # Call the delete_queue method.
|
671
|
+
# result = client.delete_queue request
|
672
|
+
#
|
673
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
674
|
+
# p result
|
675
|
+
#
|
571
676
|
def delete_queue request, options = nil
|
572
677
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
573
678
|
|
@@ -636,6 +741,22 @@ module Google
|
|
636
741
|
# @return [::Google::Cloud::Tasks::V2beta3::Queue]
|
637
742
|
#
|
638
743
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
744
|
+
#
|
745
|
+
# @example Basic example
|
746
|
+
# require "google/cloud/tasks/v2beta3"
|
747
|
+
#
|
748
|
+
# # Create a client object. The client can be reused for multiple calls.
|
749
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
750
|
+
#
|
751
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
752
|
+
# request = Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new
|
753
|
+
#
|
754
|
+
# # Call the purge_queue method.
|
755
|
+
# result = client.purge_queue request
|
756
|
+
#
|
757
|
+
# # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue.
|
758
|
+
# p result
|
759
|
+
#
|
639
760
|
def purge_queue request, options = nil
|
640
761
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
641
762
|
|
@@ -676,9 +797,10 @@ module Google
|
|
676
797
|
#
|
677
798
|
# If a queue is paused then the system will stop dispatching tasks
|
678
799
|
# until the queue is resumed via
|
679
|
-
# {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#resume_queue ResumeQueue}. Tasks can
|
680
|
-
# when the queue is paused. A queue is paused if its
|
681
|
-
# {::Google::Cloud::Tasks::V2beta3::Queue#state state} is
|
800
|
+
# {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#resume_queue ResumeQueue}. Tasks can
|
801
|
+
# still be added when the queue is paused. A queue is paused if its
|
802
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue#state state} is
|
803
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}.
|
682
804
|
#
|
683
805
|
# @overload pause_queue(request, options = nil)
|
684
806
|
# Pass arguments to `pause_queue` via a request object, either of type
|
@@ -705,6 +827,22 @@ module Google
|
|
705
827
|
# @return [::Google::Cloud::Tasks::V2beta3::Queue]
|
706
828
|
#
|
707
829
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
830
|
+
#
|
831
|
+
# @example Basic example
|
832
|
+
# require "google/cloud/tasks/v2beta3"
|
833
|
+
#
|
834
|
+
# # Create a client object. The client can be reused for multiple calls.
|
835
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
836
|
+
#
|
837
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
838
|
+
# request = Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new
|
839
|
+
#
|
840
|
+
# # Call the pause_queue method.
|
841
|
+
# result = client.pause_queue request
|
842
|
+
#
|
843
|
+
# # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue.
|
844
|
+
# p result
|
845
|
+
#
|
708
846
|
def pause_queue request, options = nil
|
709
847
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
710
848
|
|
@@ -745,9 +883,11 @@ module Google
|
|
745
883
|
#
|
746
884
|
# This method resumes a queue after it has been
|
747
885
|
# {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED} or
|
748
|
-
# {::Google::Cloud::Tasks::V2beta3::Queue::State::DISABLED DISABLED}. The state of a
|
749
|
-
# in the queue's
|
750
|
-
#
|
886
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue::State::DISABLED DISABLED}. The state of a
|
887
|
+
# queue is stored in the queue's
|
888
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue#state state}; after calling this method
|
889
|
+
# it will be set to
|
890
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue::State::RUNNING RUNNING}.
|
751
891
|
#
|
752
892
|
# WARNING: Resuming many high-QPS queues at the same time can
|
753
893
|
# lead to target overloading. If you are resuming high-QPS
|
@@ -780,6 +920,22 @@ module Google
|
|
780
920
|
# @return [::Google::Cloud::Tasks::V2beta3::Queue]
|
781
921
|
#
|
782
922
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
923
|
+
#
|
924
|
+
# @example Basic example
|
925
|
+
# require "google/cloud/tasks/v2beta3"
|
926
|
+
#
|
927
|
+
# # Create a client object. The client can be reused for multiple calls.
|
928
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
929
|
+
#
|
930
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
931
|
+
# request = Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new
|
932
|
+
#
|
933
|
+
# # Call the resume_queue method.
|
934
|
+
# result = client.resume_queue request
|
935
|
+
#
|
936
|
+
# # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue.
|
937
|
+
# p result
|
938
|
+
#
|
783
939
|
def resume_queue request, options = nil
|
784
940
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
785
941
|
|
@@ -816,9 +972,9 @@ module Google
|
|
816
972
|
end
|
817
973
|
|
818
974
|
##
|
819
|
-
# Gets the access control policy for a
|
820
|
-
# Returns an empty policy if the
|
821
|
-
# set.
|
975
|
+
# Gets the access control policy for a
|
976
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue Queue}. Returns an empty policy if the
|
977
|
+
# resource exists and does not have a policy set.
|
822
978
|
#
|
823
979
|
# Authorization requires the following
|
824
980
|
# [Google IAM](https://cloud.google.com/iam) permission on the specified
|
@@ -854,6 +1010,22 @@ module Google
|
|
854
1010
|
# @return [::Google::Iam::V1::Policy]
|
855
1011
|
#
|
856
1012
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1013
|
+
#
|
1014
|
+
# @example Basic example
|
1015
|
+
# require "google/cloud/tasks/v2beta3"
|
1016
|
+
#
|
1017
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1018
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
1019
|
+
#
|
1020
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1021
|
+
# request = Google::Iam::V1::GetIamPolicyRequest.new
|
1022
|
+
#
|
1023
|
+
# # Call the get_iam_policy method.
|
1024
|
+
# result = client.get_iam_policy request
|
1025
|
+
#
|
1026
|
+
# # The returned object is of type Google::Iam::V1::Policy.
|
1027
|
+
# p result
|
1028
|
+
#
|
857
1029
|
def get_iam_policy request, options = nil
|
858
1030
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
859
1031
|
|
@@ -890,8 +1062,8 @@ module Google
|
|
890
1062
|
end
|
891
1063
|
|
892
1064
|
##
|
893
|
-
# Sets the access control policy for a
|
894
|
-
# policy.
|
1065
|
+
# Sets the access control policy for a
|
1066
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue Queue}. Replaces any existing policy.
|
895
1067
|
#
|
896
1068
|
# Note: The Cloud Console does not check queue-level IAM permissions yet.
|
897
1069
|
# Project-level permissions are required to use the Cloud Console.
|
@@ -938,6 +1110,22 @@ module Google
|
|
938
1110
|
# @return [::Google::Iam::V1::Policy]
|
939
1111
|
#
|
940
1112
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1113
|
+
#
|
1114
|
+
# @example Basic example
|
1115
|
+
# require "google/cloud/tasks/v2beta3"
|
1116
|
+
#
|
1117
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1118
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
1119
|
+
#
|
1120
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1121
|
+
# request = Google::Iam::V1::SetIamPolicyRequest.new
|
1122
|
+
#
|
1123
|
+
# # Call the set_iam_policy method.
|
1124
|
+
# result = client.set_iam_policy request
|
1125
|
+
#
|
1126
|
+
# # The returned object is of type Google::Iam::V1::Policy.
|
1127
|
+
# p result
|
1128
|
+
#
|
941
1129
|
def set_iam_policy request, options = nil
|
942
1130
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
943
1131
|
|
@@ -974,9 +1162,10 @@ module Google
|
|
974
1162
|
end
|
975
1163
|
|
976
1164
|
##
|
977
|
-
# Returns permissions that a caller has on a
|
978
|
-
# If the resource does not exist,
|
979
|
-
# permissions, not a
|
1165
|
+
# Returns permissions that a caller has on a
|
1166
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue Queue}. If the resource does not exist,
|
1167
|
+
# this will return an empty set of permissions, not a
|
1168
|
+
# [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.
|
980
1169
|
#
|
981
1170
|
# Note: This operation is designed to be used for building permission-aware
|
982
1171
|
# UIs and command-line tools, not for authorization checking. This operation
|
@@ -1012,6 +1201,22 @@ module Google
|
|
1012
1201
|
# @return [::Google::Iam::V1::TestIamPermissionsResponse]
|
1013
1202
|
#
|
1014
1203
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1204
|
+
#
|
1205
|
+
# @example Basic example
|
1206
|
+
# require "google/cloud/tasks/v2beta3"
|
1207
|
+
#
|
1208
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1209
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
1210
|
+
#
|
1211
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1212
|
+
# request = Google::Iam::V1::TestIamPermissionsRequest.new
|
1213
|
+
#
|
1214
|
+
# # Call the test_iam_permissions method.
|
1215
|
+
# result = client.test_iam_permissions request
|
1216
|
+
#
|
1217
|
+
# # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
|
1218
|
+
# p result
|
1219
|
+
#
|
1015
1220
|
def test_iam_permissions request, options = nil
|
1016
1221
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1017
1222
|
|
@@ -1050,10 +1255,10 @@ module Google
|
|
1050
1255
|
##
|
1051
1256
|
# Lists the tasks in a queue.
|
1052
1257
|
#
|
1053
|
-
# By default, only the {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}
|
1054
|
-
# due to performance considerations;
|
1055
|
-
# {::Google::Cloud::Tasks::V2beta3::ListTasksRequest#response_view response_view}
|
1056
|
-
# subset of information which is returned.
|
1258
|
+
# By default, only the {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}
|
1259
|
+
# view is retrieved due to performance considerations;
|
1260
|
+
# {::Google::Cloud::Tasks::V2beta3::ListTasksRequest#response_view response_view}
|
1261
|
+
# controls the subset of information which is returned.
|
1057
1262
|
#
|
1058
1263
|
# The tasks may be returned in any order. The ordering may change at any
|
1059
1264
|
# time.
|
@@ -1077,24 +1282,25 @@ module Google
|
|
1077
1282
|
# Required. The queue name. For example:
|
1078
1283
|
# `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
|
1079
1284
|
# @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View]
|
1080
|
-
# The response_view specifies which subset of the
|
1081
|
-
# returned.
|
1082
|
-
#
|
1083
|
-
# By default response_view is
|
1084
|
-
#
|
1085
|
-
#
|
1086
|
-
#
|
1087
|
-
# contains.
|
1088
|
-
#
|
1089
|
-
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1090
|
-
# `cloudtasks.tasks.fullView` [Google
|
1091
|
-
# permission on the
|
1285
|
+
# The response_view specifies which subset of the
|
1286
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned.
|
1287
|
+
#
|
1288
|
+
# By default response_view is
|
1289
|
+
# {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is
|
1290
|
+
# retrieved by default because some data, such as payloads, might be
|
1291
|
+
# desirable to return only when needed because of its large size or because
|
1292
|
+
# of the sensitivity of data that it contains.
|
1293
|
+
#
|
1294
|
+
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1295
|
+
# requires `cloudtasks.tasks.fullView` [Google
|
1296
|
+
# IAM](https://cloud.google.com/iam/) permission on the
|
1297
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
|
1092
1298
|
# @param page_size [::Integer]
|
1093
1299
|
# Maximum page size.
|
1094
1300
|
#
|
1095
1301
|
# Fewer tasks than requested might be returned, even if more tasks exist; use
|
1096
|
-
# {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token}
|
1097
|
-
# determine if more tasks exist.
|
1302
|
+
# {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token}
|
1303
|
+
# in the response to determine if more tasks exist.
|
1098
1304
|
#
|
1099
1305
|
# The maximum page size is 1000. If unspecified, the page size will be the
|
1100
1306
|
# maximum.
|
@@ -1103,9 +1309,9 @@ module Google
|
|
1103
1309
|
#
|
1104
1310
|
# To request the first page results, page_token must be empty. To
|
1105
1311
|
# request the next page of results, page_token must be the value of
|
1106
|
-
# {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token}
|
1107
|
-
# from the previous call to
|
1108
|
-
# method.
|
1312
|
+
# {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token}
|
1313
|
+
# returned from the previous call to
|
1314
|
+
# {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#list_tasks ListTasks} method.
|
1109
1315
|
#
|
1110
1316
|
# The page token is valid for only 2 hours.
|
1111
1317
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
@@ -1115,6 +1321,26 @@ module Google
|
|
1115
1321
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Task>]
|
1116
1322
|
#
|
1117
1323
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1324
|
+
#
|
1325
|
+
# @example Basic example
|
1326
|
+
# require "google/cloud/tasks/v2beta3"
|
1327
|
+
#
|
1328
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1329
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
1330
|
+
#
|
1331
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1332
|
+
# request = Google::Cloud::Tasks::V2beta3::ListTasksRequest.new
|
1333
|
+
#
|
1334
|
+
# # Call the list_tasks method.
|
1335
|
+
# result = client.list_tasks request
|
1336
|
+
#
|
1337
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1338
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1339
|
+
# result.each do |item|
|
1340
|
+
# # Each element is of type ::Google::Cloud::Tasks::V2beta3::Task.
|
1341
|
+
# p item
|
1342
|
+
# end
|
1343
|
+
#
|
1118
1344
|
def list_tasks request, options = nil
|
1119
1345
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1120
1346
|
|
@@ -1173,18 +1399,19 @@ module Google
|
|
1173
1399
|
# Required. The task name. For example:
|
1174
1400
|
# `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
|
1175
1401
|
# @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View]
|
1176
|
-
# The response_view specifies which subset of the
|
1177
|
-
# returned.
|
1178
|
-
#
|
1179
|
-
# By default response_view is
|
1180
|
-
#
|
1181
|
-
#
|
1182
|
-
#
|
1183
|
-
# contains.
|
1184
|
-
#
|
1185
|
-
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1186
|
-
# `cloudtasks.tasks.fullView` [Google
|
1187
|
-
# permission on the
|
1402
|
+
# The response_view specifies which subset of the
|
1403
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned.
|
1404
|
+
#
|
1405
|
+
# By default response_view is
|
1406
|
+
# {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is
|
1407
|
+
# retrieved by default because some data, such as payloads, might be
|
1408
|
+
# desirable to return only when needed because of its large size or because
|
1409
|
+
# of the sensitivity of data that it contains.
|
1410
|
+
#
|
1411
|
+
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1412
|
+
# requires `cloudtasks.tasks.fullView` [Google
|
1413
|
+
# IAM](https://cloud.google.com/iam/) permission on the
|
1414
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
|
1188
1415
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1189
1416
|
# @yieldparam result [::Google::Cloud::Tasks::V2beta3::Task]
|
1190
1417
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -1192,6 +1419,22 @@ module Google
|
|
1192
1419
|
# @return [::Google::Cloud::Tasks::V2beta3::Task]
|
1193
1420
|
#
|
1194
1421
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1422
|
+
#
|
1423
|
+
# @example Basic example
|
1424
|
+
# require "google/cloud/tasks/v2beta3"
|
1425
|
+
#
|
1426
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1427
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
1428
|
+
#
|
1429
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1430
|
+
# request = Google::Cloud::Tasks::V2beta3::GetTaskRequest.new
|
1431
|
+
#
|
1432
|
+
# # Call the get_task method.
|
1433
|
+
# result = client.get_task request
|
1434
|
+
#
|
1435
|
+
# # The returned object is of type Google::Cloud::Tasks::V2beta3::Task.
|
1436
|
+
# p result
|
1437
|
+
#
|
1195
1438
|
def get_task request, options = nil
|
1196
1439
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1197
1440
|
|
@@ -1259,13 +1502,13 @@ module Google
|
|
1259
1502
|
#
|
1260
1503
|
# Task names have the following format:
|
1261
1504
|
# `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
|
1262
|
-
# The user can optionally specify a task
|
1263
|
-
# name
|
1264
|
-
# unique task id, which will be set in
|
1265
|
-
# {::Google::Cloud::Tasks::V2beta3::Task#name response}.
|
1505
|
+
# The user can optionally specify a task
|
1506
|
+
# {::Google::Cloud::Tasks::V2beta3::Task#name name}. If a name is not specified
|
1507
|
+
# then the system will generate a random unique task id, which will be set in
|
1508
|
+
# the task returned in the {::Google::Cloud::Tasks::V2beta3::Task#name response}.
|
1266
1509
|
#
|
1267
|
-
# If {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} is not
|
1268
|
-
# past then Cloud Tasks will set it to the current time.
|
1510
|
+
# If {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} is not
|
1511
|
+
# set or is in the past then Cloud Tasks will set it to the current time.
|
1269
1512
|
#
|
1270
1513
|
# Task De-duplication:
|
1271
1514
|
#
|
@@ -1274,33 +1517,34 @@ module Google
|
|
1274
1517
|
# that was deleted or executed recently then the call will fail
|
1275
1518
|
# with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
|
1276
1519
|
# If the task's queue was created using Cloud Tasks, then another task with
|
1277
|
-
# the same name can't be created for ~
|
1520
|
+
# the same name can't be created for ~1 hour after the original task was
|
1278
1521
|
# deleted or executed. If the task's queue was created using queue.yaml or
|
1279
1522
|
# queue.xml, then another task with the same name can't be created
|
1280
|
-
# for ~
|
1523
|
+
# for ~9 days after the original task was deleted or executed.
|
1281
1524
|
#
|
1282
1525
|
# Because there is an extra lookup cost to identify duplicate task
|
1283
|
-
# names, these {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#create_task CreateTask}
|
1284
|
-
# increased latency. Using hashed strings for the
|
1285
|
-
# the prefix of the task id is recommended. Choosing task ids
|
1286
|
-
# are sequential or have sequential prefixes, for example using a
|
1526
|
+
# names, these {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#create_task CreateTask}
|
1527
|
+
# calls have significantly increased latency. Using hashed strings for the
|
1528
|
+
# task id or for the prefix of the task id is recommended. Choosing task ids
|
1529
|
+
# that are sequential or have sequential prefixes, for example using a
|
1287
1530
|
# timestamp, causes an increase in latency and error rates in all
|
1288
1531
|
# task commands. The infrastructure relies on an approximately
|
1289
1532
|
# uniform distribution of task ids to store and serve tasks
|
1290
1533
|
# efficiently.
|
1291
1534
|
# @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View]
|
1292
|
-
# The response_view specifies which subset of the
|
1293
|
-
# returned.
|
1294
|
-
#
|
1295
|
-
# By default response_view is
|
1296
|
-
#
|
1297
|
-
#
|
1298
|
-
#
|
1299
|
-
# contains.
|
1300
|
-
#
|
1301
|
-
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1302
|
-
# `cloudtasks.tasks.fullView` [Google
|
1303
|
-
# permission on the
|
1535
|
+
# The response_view specifies which subset of the
|
1536
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned.
|
1537
|
+
#
|
1538
|
+
# By default response_view is
|
1539
|
+
# {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is
|
1540
|
+
# retrieved by default because some data, such as payloads, might be
|
1541
|
+
# desirable to return only when needed because of its large size or because
|
1542
|
+
# of the sensitivity of data that it contains.
|
1543
|
+
#
|
1544
|
+
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1545
|
+
# requires `cloudtasks.tasks.fullView` [Google
|
1546
|
+
# IAM](https://cloud.google.com/iam/) permission on the
|
1547
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
|
1304
1548
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1305
1549
|
# @yieldparam result [::Google::Cloud::Tasks::V2beta3::Task]
|
1306
1550
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -1308,6 +1552,22 @@ module Google
|
|
1308
1552
|
# @return [::Google::Cloud::Tasks::V2beta3::Task]
|
1309
1553
|
#
|
1310
1554
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1555
|
+
#
|
1556
|
+
# @example Basic example
|
1557
|
+
# require "google/cloud/tasks/v2beta3"
|
1558
|
+
#
|
1559
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1560
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
1561
|
+
#
|
1562
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1563
|
+
# request = Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new
|
1564
|
+
#
|
1565
|
+
# # Call the create_task method.
|
1566
|
+
# result = client.create_task request
|
1567
|
+
#
|
1568
|
+
# # The returned object is of type Google::Cloud::Tasks::V2beta3::Task.
|
1569
|
+
# p result
|
1570
|
+
#
|
1311
1571
|
def create_task request, options = nil
|
1312
1572
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1313
1573
|
|
@@ -1375,6 +1635,22 @@ module Google
|
|
1375
1635
|
# @return [::Google::Protobuf::Empty]
|
1376
1636
|
#
|
1377
1637
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1638
|
+
#
|
1639
|
+
# @example Basic example
|
1640
|
+
# require "google/cloud/tasks/v2beta3"
|
1641
|
+
#
|
1642
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1643
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
1644
|
+
#
|
1645
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1646
|
+
# request = Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new
|
1647
|
+
#
|
1648
|
+
# # Call the delete_task method.
|
1649
|
+
# result = client.delete_task request
|
1650
|
+
#
|
1651
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1652
|
+
# p result
|
1653
|
+
#
|
1378
1654
|
def delete_task request, options = nil
|
1379
1655
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1380
1656
|
|
@@ -1414,13 +1690,14 @@ module Google
|
|
1414
1690
|
# Forces a task to run now.
|
1415
1691
|
#
|
1416
1692
|
# When this method is called, Cloud Tasks will dispatch the task, even if
|
1417
|
-
# the task is already running, the queue has reached its
|
1418
|
-
#
|
1693
|
+
# the task is already running, the queue has reached its
|
1694
|
+
# {::Google::Cloud::Tasks::V2beta3::RateLimits RateLimits} or is
|
1695
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}.
|
1419
1696
|
#
|
1420
1697
|
# This command is meant to be used for manual debugging. For
|
1421
|
-
# example, {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#run_task RunTask} can be
|
1422
|
-
# task after a fix has been made or to manually force
|
1423
|
-
# dispatched now.
|
1698
|
+
# example, {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#run_task RunTask} can be
|
1699
|
+
# used to retry a failed task after a fix has been made or to manually force
|
1700
|
+
# a task to be dispatched now.
|
1424
1701
|
#
|
1425
1702
|
# The dispatched task is returned. That is, the task that is returned
|
1426
1703
|
# contains the [status][Task.status] after the task is dispatched but
|
@@ -1428,9 +1705,11 @@ module Google
|
|
1428
1705
|
#
|
1429
1706
|
# If Cloud Tasks receives a successful response from the task's
|
1430
1707
|
# target, then the task will be deleted; otherwise the task's
|
1431
|
-
# {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} will be
|
1432
|
-
#
|
1433
|
-
#
|
1708
|
+
# {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} will be
|
1709
|
+
# reset to the time that
|
1710
|
+
# {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#run_task RunTask} was called plus
|
1711
|
+
# the retry delay specified in the queue's
|
1712
|
+
# {::Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig}.
|
1434
1713
|
#
|
1435
1714
|
# {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#run_task RunTask} returns
|
1436
1715
|
# [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a
|
@@ -1455,18 +1734,19 @@ module Google
|
|
1455
1734
|
# Required. The task name. For example:
|
1456
1735
|
# `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
|
1457
1736
|
# @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View]
|
1458
|
-
# The response_view specifies which subset of the
|
1459
|
-
# returned.
|
1460
|
-
#
|
1461
|
-
# By default response_view is
|
1462
|
-
#
|
1463
|
-
#
|
1464
|
-
#
|
1465
|
-
# contains.
|
1466
|
-
#
|
1467
|
-
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1468
|
-
# `cloudtasks.tasks.fullView` [Google
|
1469
|
-
# permission on the
|
1737
|
+
# The response_view specifies which subset of the
|
1738
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned.
|
1739
|
+
#
|
1740
|
+
# By default response_view is
|
1741
|
+
# {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is
|
1742
|
+
# retrieved by default because some data, such as payloads, might be
|
1743
|
+
# desirable to return only when needed because of its large size or because
|
1744
|
+
# of the sensitivity of data that it contains.
|
1745
|
+
#
|
1746
|
+
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1747
|
+
# requires `cloudtasks.tasks.fullView` [Google
|
1748
|
+
# IAM](https://cloud.google.com/iam/) permission on the
|
1749
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
|
1470
1750
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1471
1751
|
# @yieldparam result [::Google::Cloud::Tasks::V2beta3::Task]
|
1472
1752
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -1474,6 +1754,22 @@ module Google
|
|
1474
1754
|
# @return [::Google::Cloud::Tasks::V2beta3::Task]
|
1475
1755
|
#
|
1476
1756
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1757
|
+
#
|
1758
|
+
# @example Basic example
|
1759
|
+
# require "google/cloud/tasks/v2beta3"
|
1760
|
+
#
|
1761
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1762
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
1763
|
+
#
|
1764
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1765
|
+
# request = Google::Cloud::Tasks::V2beta3::RunTaskRequest.new
|
1766
|
+
#
|
1767
|
+
# # Call the run_task method.
|
1768
|
+
# result = client.run_task request
|
1769
|
+
#
|
1770
|
+
# # The returned object is of type Google::Cloud::Tasks::V2beta3::Task.
|
1771
|
+
# p result
|
1772
|
+
#
|
1477
1773
|
def run_task request, options = nil
|
1478
1774
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1479
1775
|
|
@@ -1509,6 +1805,105 @@ module Google
|
|
1509
1805
|
raise ::Google::Cloud::Error.from_error(e)
|
1510
1806
|
end
|
1511
1807
|
|
1808
|
+
##
|
1809
|
+
# Creates and buffers a new task without the need to explicitly define a Task
|
1810
|
+
# message. The queue must have [HTTP
|
1811
|
+
# target][google.cloud.tasks.v2beta3.HttpTarget]. To create the task with a
|
1812
|
+
# custom ID, use the following format and set TASK_ID to your desired ID:
|
1813
|
+
# projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer
|
1814
|
+
# To create the task with an automatically generated ID, use the following
|
1815
|
+
# format:
|
1816
|
+
# projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer.
|
1817
|
+
# Note: This feature is in its experimental stage. You must request access to
|
1818
|
+
# the API through the [Cloud Tasks BufferTask Experiment Signup
|
1819
|
+
# form](https://forms.gle/X8Zr5hiXH5tTGFqh8).
|
1820
|
+
#
|
1821
|
+
# @overload buffer_task(request, options = nil)
|
1822
|
+
# Pass arguments to `buffer_task` via a request object, either of type
|
1823
|
+
# {::Google::Cloud::Tasks::V2beta3::BufferTaskRequest} or an equivalent Hash.
|
1824
|
+
#
|
1825
|
+
# @param request [::Google::Cloud::Tasks::V2beta3::BufferTaskRequest, ::Hash]
|
1826
|
+
# A request object representing the call parameters. Required. To specify no
|
1827
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1828
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1829
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1830
|
+
#
|
1831
|
+
# @overload buffer_task(queue: nil, task_id: nil, body: nil)
|
1832
|
+
# Pass arguments to `buffer_task` via keyword arguments. Note that at
|
1833
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1834
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1835
|
+
#
|
1836
|
+
# @param queue [::String]
|
1837
|
+
# Required. The parent queue name. For example:
|
1838
|
+
# projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
|
1839
|
+
#
|
1840
|
+
# The queue must already exist.
|
1841
|
+
# @param task_id [::String]
|
1842
|
+
# Optional. Task ID for the task being created. If not provided, a random
|
1843
|
+
# task ID is assigned to the task.
|
1844
|
+
# @param body [::Google::Api::HttpBody, ::Hash]
|
1845
|
+
# Optional. Body of the HTTP request.
|
1846
|
+
#
|
1847
|
+
# The body can take any generic value. The value is written to the
|
1848
|
+
# [HttpRequest][payload] of the [Task].
|
1849
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1850
|
+
# @yieldparam result [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse]
|
1851
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1852
|
+
#
|
1853
|
+
# @return [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse]
|
1854
|
+
#
|
1855
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1856
|
+
#
|
1857
|
+
# @example Basic example
|
1858
|
+
# require "google/cloud/tasks/v2beta3"
|
1859
|
+
#
|
1860
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1861
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new
|
1862
|
+
#
|
1863
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1864
|
+
# request = Google::Cloud::Tasks::V2beta3::BufferTaskRequest.new
|
1865
|
+
#
|
1866
|
+
# # Call the buffer_task method.
|
1867
|
+
# result = client.buffer_task request
|
1868
|
+
#
|
1869
|
+
# # The returned object is of type Google::Cloud::Tasks::V2beta3::BufferTaskResponse.
|
1870
|
+
# p result
|
1871
|
+
#
|
1872
|
+
def buffer_task request, options = nil
|
1873
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1874
|
+
|
1875
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::BufferTaskRequest
|
1876
|
+
|
1877
|
+
# Converts hash and nil to an options object
|
1878
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1879
|
+
|
1880
|
+
# Customize the options with defaults
|
1881
|
+
call_metadata = @config.rpcs.buffer_task.metadata.to_h
|
1882
|
+
|
1883
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1884
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1885
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1886
|
+
gapic_version: ::Google::Cloud::Tasks::V2beta3::VERSION,
|
1887
|
+
transports_version_send: [:rest]
|
1888
|
+
|
1889
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1890
|
+
|
1891
|
+
options.apply_defaults timeout: @config.rpcs.buffer_task.timeout,
|
1892
|
+
metadata: call_metadata,
|
1893
|
+
retry_policy: @config.rpcs.buffer_task.retry_policy
|
1894
|
+
|
1895
|
+
options.apply_defaults timeout: @config.timeout,
|
1896
|
+
metadata: @config.metadata,
|
1897
|
+
retry_policy: @config.retry_policy
|
1898
|
+
|
1899
|
+
@cloud_tasks_stub.buffer_task request, options do |result, operation|
|
1900
|
+
yield result, operation if block_given?
|
1901
|
+
return result
|
1902
|
+
end
|
1903
|
+
rescue ::Gapic::Rest::Error => e
|
1904
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1905
|
+
end
|
1906
|
+
|
1512
1907
|
##
|
1513
1908
|
# Configuration class for the CloudTasks REST API.
|
1514
1909
|
#
|
@@ -1597,6 +1992,13 @@ module Google
|
|
1597
1992
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1598
1993
|
config_attr :quota_project, nil, ::String, nil
|
1599
1994
|
|
1995
|
+
# @private
|
1996
|
+
# Overrides for http bindings for the RPCs of this service
|
1997
|
+
# are only used when this service is used as mixin, and only
|
1998
|
+
# by the host service.
|
1999
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
2000
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
2001
|
+
|
1600
2002
|
# @private
|
1601
2003
|
def initialize parent_config = nil
|
1602
2004
|
@parent_config = parent_config unless parent_config.nil?
|
@@ -1714,6 +2116,11 @@ module Google
|
|
1714
2116
|
# @return [::Gapic::Config::Method]
|
1715
2117
|
#
|
1716
2118
|
attr_reader :run_task
|
2119
|
+
##
|
2120
|
+
# RPC-specific configuration for `buffer_task`
|
2121
|
+
# @return [::Gapic::Config::Method]
|
2122
|
+
#
|
2123
|
+
attr_reader :buffer_task
|
1717
2124
|
|
1718
2125
|
# @private
|
1719
2126
|
def initialize parent_rpcs = nil
|
@@ -1749,6 +2156,8 @@ module Google
|
|
1749
2156
|
@delete_task = ::Gapic::Config::Method.new delete_task_config
|
1750
2157
|
run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task
|
1751
2158
|
@run_task = ::Gapic::Config::Method.new run_task_config
|
2159
|
+
buffer_task_config = parent_rpcs.buffer_task if parent_rpcs.respond_to? :buffer_task
|
2160
|
+
@buffer_task = ::Gapic::Config::Method.new buffer_task_config
|
1752
2161
|
|
1753
2162
|
yield self if block_given?
|
1754
2163
|
end
|