google-cloud-tasks-v2beta3 0.10.1 → 0.10.2

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.
@@ -18,6 +18,7 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/tasks/v2beta3/cloudtasks_pb"
21
+ require "google/cloud/location"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -121,6 +122,8 @@ module Google
121
122
 
122
123
  default_config.rpcs.run_task.timeout = 20.0
123
124
 
125
+ default_config.rpcs.buffer_task.timeout = 20.0
126
+
124
127
  default_config
125
128
  end
126
129
  yield @configure if block_given?
@@ -190,6 +193,12 @@ module Google
190
193
  @quota_project_id = @config.quota_project
191
194
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
192
195
 
196
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
197
+ config.credentials = credentials
198
+ config.quota_project = @quota_project_id
199
+ config.endpoint = @config.endpoint
200
+ end
201
+
193
202
  @cloud_tasks_stub = ::Gapic::ServiceStub.new(
194
203
  ::Google::Cloud::Tasks::V2beta3::CloudTasks::Stub,
195
204
  credentials: credentials,
@@ -199,6 +208,13 @@ module Google
199
208
  )
200
209
  end
201
210
 
211
+ ##
212
+ # Get the associated client for mix-in of the Locations.
213
+ #
214
+ # @return [Google::Cloud::Location::Locations::Client]
215
+ #
216
+ attr_reader :location_client
217
+
202
218
  # Service calls
203
219
 
204
220
  ##
@@ -225,11 +241,10 @@ module Google
225
241
  # Required. The location name.
226
242
  # For example: `projects/PROJECT_ID/locations/LOCATION_ID`
227
243
  # @param filter [::String]
228
- # `filter` can be used to specify a subset of queues. Any {::Google::Cloud::Tasks::V2beta3::Queue Queue}
229
- # field can be used as a filter and several operators as supported.
230
- # For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as
231
- # described in
232
- # [Stackdriver's Advanced Logs
244
+ # `filter` can be used to specify a subset of queues. Any
245
+ # {::Google::Cloud::Tasks::V2beta3::Queue Queue} field can be used as a filter and
246
+ # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The
247
+ # filter syntax is the same as described in [Stackdriver's Advanced Logs
233
248
  # Filters](https://cloud.google.com/logging/docs/view/advanced_filters).
234
249
  #
235
250
  # Sample filter "state: PAUSED".
@@ -242,20 +257,22 @@ module Google
242
257
  # The maximum page size is 9800. If unspecified, the page size will
243
258
  # be the maximum. Fewer queues than requested might be returned,
244
259
  # even if more queues exist; use the
245
- # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token} in the
246
- # response to determine if more queues exist.
260
+ # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token}
261
+ # in the response to determine if more queues exist.
247
262
  # @param page_token [::String]
248
263
  # A token identifying the page of results to return.
249
264
  #
250
265
  # To request the first page results, page_token must be empty. To
251
266
  # request the next page of results, page_token must be the value of
252
- # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token} returned
253
- # from the previous call to {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues ListQueues}
254
- # method. It is an error to switch the value of the
255
- # {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest#filter filter} while iterating through pages.
267
+ # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token}
268
+ # returned from the previous call to
269
+ # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues ListQueues} method. It
270
+ # is an error to switch the value of the
271
+ # {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest#filter filter} while
272
+ # iterating through pages.
256
273
  # @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
257
- # Optional. Read mask is used for a more granular control over what the API returns.
258
- # If the mask is not present all fields will be returned except
274
+ # Optional. Read mask is used for a more granular control over what the API
275
+ # returns. If the mask is not present all fields will be returned except
259
276
  # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly
260
277
  # specified in the mask.
261
278
  #
@@ -350,8 +367,8 @@ module Google
350
367
  # Required. The resource name of the queue. For example:
351
368
  # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
352
369
  # @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
353
- # Optional. Read mask is used for a more granular control over what the API returns.
354
- # If the mask is not present all fields will be returned except
370
+ # Optional. Read mask is used for a more granular control over what the API
371
+ # returns. If the mask is not present all fields will be returned except
355
372
  # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly
356
373
  # specified in the mask.
357
374
  #
@@ -423,8 +440,8 @@ module Google
423
440
  # Creates a queue.
424
441
  #
425
442
  # Queues created with this method allow tasks to live for a maximum of 31
426
- # days. After a task is 31 days old, the task will be deleted regardless of whether
427
- # it was dispatched or not.
443
+ # days. After a task is 31 days old, the task will be deleted regardless of
444
+ # whether it was dispatched or not.
428
445
  #
429
446
  # WARNING: Using this method may have unintended side effects if you are
430
447
  # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
@@ -454,11 +471,12 @@ module Google
454
471
  #
455
472
  # The list of allowed locations can be obtained by calling Cloud
456
473
  # Tasks' implementation of
457
- # [ListLocations][google.cloud.location.Locations.ListLocations].
474
+ # `::Google::Cloud::Location::Locations::Client#list_locations`.
458
475
  # @param queue [::Google::Cloud::Tasks::V2beta3::Queue, ::Hash]
459
476
  # Required. The queue to create.
460
477
  #
461
- # [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as an existing queue.
478
+ # [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as
479
+ # an existing queue.
462
480
  #
463
481
  # @yield [response, operation] Access the result along with the RPC operation
464
482
  # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Queue]
@@ -531,8 +549,8 @@ module Google
531
549
  # the queue if it does exist.
532
550
  #
533
551
  # Queues created with this method allow tasks to live for a maximum of 31
534
- # days. After a task is 31 days old, the task will be deleted regardless of whether
535
- # it was dispatched or not.
552
+ # days. After a task is 31 days old, the task will be deleted regardless of
553
+ # whether it was dispatched or not.
536
554
  #
537
555
  # WARNING: Using this method may have unintended side effects if you are
538
556
  # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
@@ -559,11 +577,13 @@ module Google
559
577
  # @param queue [::Google::Cloud::Tasks::V2beta3::Queue, ::Hash]
560
578
  # Required. The queue to create or update.
561
579
  #
562
- # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} must be specified.
580
+ # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} must be
581
+ # specified.
563
582
  #
564
583
  # Output only fields cannot be modified using UpdateQueue.
565
584
  # Any value specified for an output only field will be ignored.
566
- # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} cannot be changed.
585
+ # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} cannot be
586
+ # changed.
567
587
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
568
588
  # A mask used to specify which fields of the queue are being updated.
569
589
  #
@@ -827,9 +847,10 @@ module Google
827
847
  #
828
848
  # If a queue is paused then the system will stop dispatching tasks
829
849
  # until the queue is resumed via
830
- # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue ResumeQueue}. Tasks can still be added
831
- # when the queue is paused. A queue is paused if its
832
- # {::Google::Cloud::Tasks::V2beta3::Queue#state state} is {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}.
850
+ # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue ResumeQueue}. Tasks can
851
+ # still be added when the queue is paused. A queue is paused if its
852
+ # {::Google::Cloud::Tasks::V2beta3::Queue#state state} is
853
+ # {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}.
833
854
  #
834
855
  # @overload pause_queue(request, options = nil)
835
856
  # Pass arguments to `pause_queue` via a request object, either of type
@@ -919,9 +940,11 @@ module Google
919
940
  #
920
941
  # This method resumes a queue after it has been
921
942
  # {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED} or
922
- # {::Google::Cloud::Tasks::V2beta3::Queue::State::DISABLED DISABLED}. The state of a queue is stored
923
- # in the queue's {::Google::Cloud::Tasks::V2beta3::Queue#state state}; after calling this method it
924
- # will be set to {::Google::Cloud::Tasks::V2beta3::Queue::State::RUNNING RUNNING}.
943
+ # {::Google::Cloud::Tasks::V2beta3::Queue::State::DISABLED DISABLED}. The state of a
944
+ # queue is stored in the queue's
945
+ # {::Google::Cloud::Tasks::V2beta3::Queue#state state}; after calling this method
946
+ # it will be set to
947
+ # {::Google::Cloud::Tasks::V2beta3::Queue::State::RUNNING RUNNING}.
925
948
  #
926
949
  # WARNING: Resuming many high-QPS queues at the same time can
927
950
  # lead to target overloading. If you are resuming high-QPS
@@ -1013,9 +1036,9 @@ module Google
1013
1036
  end
1014
1037
 
1015
1038
  ##
1016
- # Gets the access control policy for a {::Google::Cloud::Tasks::V2beta3::Queue Queue}.
1017
- # Returns an empty policy if the resource exists and does not have a policy
1018
- # set.
1039
+ # Gets the access control policy for a
1040
+ # {::Google::Cloud::Tasks::V2beta3::Queue Queue}. Returns an empty policy if the
1041
+ # resource exists and does not have a policy set.
1019
1042
  #
1020
1043
  # Authorization requires the following
1021
1044
  # [Google IAM](https://cloud.google.com/iam) permission on the specified
@@ -1110,8 +1133,8 @@ module Google
1110
1133
  end
1111
1134
 
1112
1135
  ##
1113
- # Sets the access control policy for a {::Google::Cloud::Tasks::V2beta3::Queue Queue}. Replaces any existing
1114
- # policy.
1136
+ # Sets the access control policy for a
1137
+ # {::Google::Cloud::Tasks::V2beta3::Queue Queue}. Replaces any existing policy.
1115
1138
  #
1116
1139
  # Note: The Cloud Console does not check queue-level IAM permissions yet.
1117
1140
  # Project-level permissions are required to use the Cloud Console.
@@ -1217,9 +1240,10 @@ module Google
1217
1240
  end
1218
1241
 
1219
1242
  ##
1220
- # Returns permissions that a caller has on a {::Google::Cloud::Tasks::V2beta3::Queue Queue}.
1221
- # If the resource does not exist, this will return an empty set of
1222
- # permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.
1243
+ # Returns permissions that a caller has on a
1244
+ # {::Google::Cloud::Tasks::V2beta3::Queue Queue}. If the resource does not exist,
1245
+ # this will return an empty set of permissions, not a
1246
+ # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.
1223
1247
  #
1224
1248
  # Note: This operation is designed to be used for building permission-aware
1225
1249
  # UIs and command-line tools, not for authorization checking. This operation
@@ -1316,10 +1340,10 @@ module Google
1316
1340
  ##
1317
1341
  # Lists the tasks in a queue.
1318
1342
  #
1319
- # By default, only the {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC} view is retrieved
1320
- # due to performance considerations;
1321
- # {::Google::Cloud::Tasks::V2beta3::ListTasksRequest#response_view response_view} controls the
1322
- # subset of information which is returned.
1343
+ # By default, only the {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}
1344
+ # view is retrieved due to performance considerations;
1345
+ # {::Google::Cloud::Tasks::V2beta3::ListTasksRequest#response_view response_view}
1346
+ # controls the subset of information which is returned.
1323
1347
  #
1324
1348
  # The tasks may be returned in any order. The ordering may change at any
1325
1349
  # time.
@@ -1343,24 +1367,25 @@ module Google
1343
1367
  # Required. The queue name. For example:
1344
1368
  # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
1345
1369
  # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View]
1346
- # The response_view specifies which subset of the {::Google::Cloud::Tasks::V2beta3::Task Task} will be
1347
- # returned.
1348
- #
1349
- # By default response_view is {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all
1350
- # information is retrieved by default because some data, such as
1351
- # payloads, might be desirable to return only when needed because
1352
- # of its large size or because of the sensitivity of data that it
1353
- # contains.
1354
- #
1355
- # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} requires
1356
- # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1357
- # permission on the {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
1370
+ # The response_view specifies which subset of the
1371
+ # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned.
1372
+ #
1373
+ # By default response_view is
1374
+ # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is
1375
+ # retrieved by default because some data, such as payloads, might be
1376
+ # desirable to return only when needed because of its large size or because
1377
+ # of the sensitivity of data that it contains.
1378
+ #
1379
+ # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
1380
+ # requires `cloudtasks.tasks.fullView` [Google
1381
+ # IAM](https://cloud.google.com/iam/) permission on the
1382
+ # {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
1358
1383
  # @param page_size [::Integer]
1359
1384
  # Maximum page size.
1360
1385
  #
1361
1386
  # Fewer tasks than requested might be returned, even if more tasks exist; use
1362
- # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token} in the response to
1363
- # determine if more tasks exist.
1387
+ # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token}
1388
+ # in the response to determine if more tasks exist.
1364
1389
  #
1365
1390
  # The maximum page size is 1000. If unspecified, the page size will be the
1366
1391
  # maximum.
@@ -1369,9 +1394,9 @@ module Google
1369
1394
  #
1370
1395
  # To request the first page results, page_token must be empty. To
1371
1396
  # request the next page of results, page_token must be the value of
1372
- # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token} returned
1373
- # from the previous call to {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks ListTasks}
1374
- # method.
1397
+ # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token}
1398
+ # returned from the previous call to
1399
+ # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks ListTasks} method.
1375
1400
  #
1376
1401
  # The page token is valid for only 2 hours.
1377
1402
  #
@@ -1466,18 +1491,19 @@ module Google
1466
1491
  # Required. The task name. For example:
1467
1492
  # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1468
1493
  # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View]
1469
- # The response_view specifies which subset of the {::Google::Cloud::Tasks::V2beta3::Task Task} will be
1470
- # returned.
1494
+ # The response_view specifies which subset of the
1495
+ # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned.
1471
1496
  #
1472
- # By default response_view is {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all
1473
- # information is retrieved by default because some data, such as
1474
- # payloads, might be desirable to return only when needed because
1475
- # of its large size or because of the sensitivity of data that it
1476
- # contains.
1497
+ # By default response_view is
1498
+ # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is
1499
+ # retrieved by default because some data, such as payloads, might be
1500
+ # desirable to return only when needed because of its large size or because
1501
+ # of the sensitivity of data that it contains.
1477
1502
  #
1478
- # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} requires
1479
- # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1480
- # permission on the {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
1503
+ # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
1504
+ # requires `cloudtasks.tasks.fullView` [Google
1505
+ # IAM](https://cloud.google.com/iam/) permission on the
1506
+ # {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
1481
1507
  #
1482
1508
  # @yield [response, operation] Access the result along with the RPC operation
1483
1509
  # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Task]
@@ -1575,13 +1601,13 @@ module Google
1575
1601
  #
1576
1602
  # Task names have the following format:
1577
1603
  # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
1578
- # The user can optionally specify a task {::Google::Cloud::Tasks::V2beta3::Task#name name}. If a
1579
- # name is not specified then the system will generate a random
1580
- # unique task id, which will be set in the task returned in the
1581
- # {::Google::Cloud::Tasks::V2beta3::Task#name response}.
1604
+ # The user can optionally specify a task
1605
+ # {::Google::Cloud::Tasks::V2beta3::Task#name name}. If a name is not specified
1606
+ # then the system will generate a random unique task id, which will be set in
1607
+ # the task returned in the {::Google::Cloud::Tasks::V2beta3::Task#name response}.
1582
1608
  #
1583
- # If {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} is not set or is in the
1584
- # past then Cloud Tasks will set it to the current time.
1609
+ # If {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} is not
1610
+ # set or is in the past then Cloud Tasks will set it to the current time.
1585
1611
  #
1586
1612
  # Task De-duplication:
1587
1613
  #
@@ -1590,33 +1616,34 @@ module Google
1590
1616
  # that was deleted or executed recently then the call will fail
1591
1617
  # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
1592
1618
  # If the task's queue was created using Cloud Tasks, then another task with
1593
- # the same name can't be created for ~1hour after the original task was
1619
+ # the same name can't be created for ~1 hour after the original task was
1594
1620
  # deleted or executed. If the task's queue was created using queue.yaml or
1595
1621
  # queue.xml, then another task with the same name can't be created
1596
- # for ~9days after the original task was deleted or executed.
1622
+ # for ~9 days after the original task was deleted or executed.
1597
1623
  #
1598
1624
  # Because there is an extra lookup cost to identify duplicate task
1599
- # names, these {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask} calls have significantly
1600
- # increased latency. Using hashed strings for the task id or for
1601
- # the prefix of the task id is recommended. Choosing task ids that
1602
- # are sequential or have sequential prefixes, for example using a
1625
+ # names, these {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask}
1626
+ # calls have significantly increased latency. Using hashed strings for the
1627
+ # task id or for the prefix of the task id is recommended. Choosing task ids
1628
+ # that are sequential or have sequential prefixes, for example using a
1603
1629
  # timestamp, causes an increase in latency and error rates in all
1604
1630
  # task commands. The infrastructure relies on an approximately
1605
1631
  # uniform distribution of task ids to store and serve tasks
1606
1632
  # efficiently.
1607
1633
  # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View]
1608
- # The response_view specifies which subset of the {::Google::Cloud::Tasks::V2beta3::Task Task} will be
1609
- # returned.
1634
+ # The response_view specifies which subset of the
1635
+ # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned.
1610
1636
  #
1611
- # By default response_view is {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all
1612
- # information is retrieved by default because some data, such as
1613
- # payloads, might be desirable to return only when needed because
1614
- # of its large size or because of the sensitivity of data that it
1615
- # contains.
1637
+ # By default response_view is
1638
+ # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is
1639
+ # retrieved by default because some data, such as payloads, might be
1640
+ # desirable to return only when needed because of its large size or because
1641
+ # of the sensitivity of data that it contains.
1616
1642
  #
1617
- # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} requires
1618
- # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1619
- # permission on the {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
1643
+ # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
1644
+ # requires `cloudtasks.tasks.fullView` [Google
1645
+ # IAM](https://cloud.google.com/iam/) permission on the
1646
+ # {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
1620
1647
  #
1621
1648
  # @yield [response, operation] Access the result along with the RPC operation
1622
1649
  # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Task]
@@ -1776,13 +1803,14 @@ module Google
1776
1803
  # Forces a task to run now.
1777
1804
  #
1778
1805
  # When this method is called, Cloud Tasks will dispatch the task, even if
1779
- # the task is already running, the queue has reached its {::Google::Cloud::Tasks::V2beta3::RateLimits RateLimits} or
1780
- # is {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}.
1806
+ # the task is already running, the queue has reached its
1807
+ # {::Google::Cloud::Tasks::V2beta3::RateLimits RateLimits} or is
1808
+ # {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}.
1781
1809
  #
1782
1810
  # This command is meant to be used for manual debugging. For
1783
- # example, {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask} can be used to retry a failed
1784
- # task after a fix has been made or to manually force a task to be
1785
- # dispatched now.
1811
+ # example, {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask} can be
1812
+ # used to retry a failed task after a fix has been made or to manually force
1813
+ # a task to be dispatched now.
1786
1814
  #
1787
1815
  # The dispatched task is returned. That is, the task that is returned
1788
1816
  # contains the [status][Task.status] after the task is dispatched but
@@ -1790,9 +1818,11 @@ module Google
1790
1818
  #
1791
1819
  # If Cloud Tasks receives a successful response from the task's
1792
1820
  # target, then the task will be deleted; otherwise the task's
1793
- # {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} will be reset to the time that
1794
- # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask} was called plus the retry delay specified
1795
- # in the queue's {::Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig}.
1821
+ # {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} will be
1822
+ # reset to the time that
1823
+ # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask} was called plus
1824
+ # the retry delay specified in the queue's
1825
+ # {::Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig}.
1796
1826
  #
1797
1827
  # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask} returns
1798
1828
  # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a
@@ -1817,18 +1847,19 @@ module Google
1817
1847
  # Required. The task name. For example:
1818
1848
  # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1819
1849
  # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View]
1820
- # The response_view specifies which subset of the {::Google::Cloud::Tasks::V2beta3::Task Task} will be
1821
- # returned.
1850
+ # The response_view specifies which subset of the
1851
+ # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned.
1822
1852
  #
1823
- # By default response_view is {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all
1824
- # information is retrieved by default because some data, such as
1825
- # payloads, might be desirable to return only when needed because
1826
- # of its large size or because of the sensitivity of data that it
1827
- # contains.
1853
+ # By default response_view is
1854
+ # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is
1855
+ # retrieved by default because some data, such as payloads, might be
1856
+ # desirable to return only when needed because of its large size or because
1857
+ # of the sensitivity of data that it contains.
1828
1858
  #
1829
- # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} requires
1830
- # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1831
- # permission on the {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
1859
+ # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
1860
+ # requires `cloudtasks.tasks.fullView` [Google
1861
+ # IAM](https://cloud.google.com/iam/) permission on the
1862
+ # {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
1832
1863
  #
1833
1864
  # @yield [response, operation] Access the result along with the RPC operation
1834
1865
  # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Task]
@@ -1894,6 +1925,115 @@ module Google
1894
1925
  raise ::Google::Cloud::Error.from_error(e)
1895
1926
  end
1896
1927
 
1928
+ ##
1929
+ # Creates and buffers a new task without the need to explicitly define a Task
1930
+ # message. The queue must have [HTTP
1931
+ # target][google.cloud.tasks.v2beta3.HttpTarget]. To create the task with a
1932
+ # custom ID, use the following format and set TASK_ID to your desired ID:
1933
+ # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer
1934
+ # To create the task with an automatically generated ID, use the following
1935
+ # format:
1936
+ # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer.
1937
+ # Note: This feature is in its experimental stage. You must request access to
1938
+ # the API through the [Cloud Tasks BufferTask Experiment Signup
1939
+ # form](https://forms.gle/X8Zr5hiXH5tTGFqh8).
1940
+ #
1941
+ # @overload buffer_task(request, options = nil)
1942
+ # Pass arguments to `buffer_task` via a request object, either of type
1943
+ # {::Google::Cloud::Tasks::V2beta3::BufferTaskRequest} or an equivalent Hash.
1944
+ #
1945
+ # @param request [::Google::Cloud::Tasks::V2beta3::BufferTaskRequest, ::Hash]
1946
+ # A request object representing the call parameters. Required. To specify no
1947
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1948
+ # @param options [::Gapic::CallOptions, ::Hash]
1949
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1950
+ #
1951
+ # @overload buffer_task(queue: nil, task_id: nil, body: nil)
1952
+ # Pass arguments to `buffer_task` via keyword arguments. Note that at
1953
+ # least one keyword argument is required. To specify no parameters, or to keep all
1954
+ # the default parameter values, pass an empty Hash as a request object (see above).
1955
+ #
1956
+ # @param queue [::String]
1957
+ # Required. The parent queue name. For example:
1958
+ # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
1959
+ #
1960
+ # The queue must already exist.
1961
+ # @param task_id [::String]
1962
+ # Optional. Task ID for the task being created. If not provided, a random
1963
+ # task ID is assigned to the task.
1964
+ # @param body [::Google::Api::HttpBody, ::Hash]
1965
+ # Optional. Body of the HTTP request.
1966
+ #
1967
+ # The body can take any generic value. The value is written to the
1968
+ # [HttpRequest][payload] of the [Task].
1969
+ #
1970
+ # @yield [response, operation] Access the result along with the RPC operation
1971
+ # @yieldparam response [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse]
1972
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1973
+ #
1974
+ # @return [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse]
1975
+ #
1976
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1977
+ #
1978
+ # @example Basic example
1979
+ # require "google/cloud/tasks/v2beta3"
1980
+ #
1981
+ # # Create a client object. The client can be reused for multiple calls.
1982
+ # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new
1983
+ #
1984
+ # # Create a request. To set request fields, pass in keyword arguments.
1985
+ # request = Google::Cloud::Tasks::V2beta3::BufferTaskRequest.new
1986
+ #
1987
+ # # Call the buffer_task method.
1988
+ # result = client.buffer_task request
1989
+ #
1990
+ # # The returned object is of type Google::Cloud::Tasks::V2beta3::BufferTaskResponse.
1991
+ # p result
1992
+ #
1993
+ def buffer_task request, options = nil
1994
+ raise ::ArgumentError, "request must be provided" if request.nil?
1995
+
1996
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::BufferTaskRequest
1997
+
1998
+ # Converts hash and nil to an options object
1999
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2000
+
2001
+ # Customize the options with defaults
2002
+ metadata = @config.rpcs.buffer_task.metadata.to_h
2003
+
2004
+ # Set x-goog-api-client and x-goog-user-project headers
2005
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2006
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2007
+ gapic_version: ::Google::Cloud::Tasks::V2beta3::VERSION
2008
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2009
+
2010
+ header_params = {}
2011
+ if request.queue
2012
+ header_params["queue"] = request.queue
2013
+ end
2014
+ if request.task_id
2015
+ header_params["task_id"] = request.task_id
2016
+ end
2017
+
2018
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2019
+ metadata[:"x-goog-request-params"] ||= request_params_header
2020
+
2021
+ options.apply_defaults timeout: @config.rpcs.buffer_task.timeout,
2022
+ metadata: metadata,
2023
+ retry_policy: @config.rpcs.buffer_task.retry_policy
2024
+
2025
+ options.apply_defaults timeout: @config.timeout,
2026
+ metadata: @config.metadata,
2027
+ retry_policy: @config.retry_policy
2028
+
2029
+ @cloud_tasks_stub.call_rpc :buffer_task, request, options: options do |response, operation|
2030
+ yield response, operation if block_given?
2031
+ return response
2032
+ end
2033
+ rescue ::GRPC::BadStatus => e
2034
+ raise ::Google::Cloud::Error.from_error(e)
2035
+ end
2036
+
1897
2037
  ##
1898
2038
  # Configuration class for the CloudTasks API.
1899
2039
  #
@@ -2111,6 +2251,11 @@ module Google
2111
2251
  # @return [::Gapic::Config::Method]
2112
2252
  #
2113
2253
  attr_reader :run_task
2254
+ ##
2255
+ # RPC-specific configuration for `buffer_task`
2256
+ # @return [::Gapic::Config::Method]
2257
+ #
2258
+ attr_reader :buffer_task
2114
2259
 
2115
2260
  # @private
2116
2261
  def initialize parent_rpcs = nil
@@ -2146,6 +2291,8 @@ module Google
2146
2291
  @delete_task = ::Gapic::Config::Method.new delete_task_config
2147
2292
  run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task
2148
2293
  @run_task = ::Gapic::Config::Method.new run_task_config
2294
+ buffer_task_config = parent_rpcs.buffer_task if parent_rpcs.respond_to? :buffer_task
2295
+ @buffer_task = ::Gapic::Config::Method.new buffer_task_config
2149
2296
 
2150
2297
  yield self if block_given?
2151
2298
  end