google-cloud-tasks-v2 0.1.0 → 0.2.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c553824d4d5368dfce5fe05547f67589e15b8c300a503437168636ea510f8d4
4
- data.tar.gz: df65bfbcace41a2e559311f19acb4e8a0898469a5abf9ff10897b82cfcd7c58e
3
+ metadata.gz: 25368b88f1f0f682925a2938a2f58f24e6b77e92a6bb7169bb63930082dfb9f4
4
+ data.tar.gz: 3a03de961c70bd6a8876acfb1e918532875d12cafad10c9a812db0adef56a6f7
5
5
  SHA512:
6
- metadata.gz: b69517d9fd93153772c379aa17d3376e901ba72af26b3962a0b2990a57f680330d8866032bf985bb17e4f48a456ef41203056b7ae02658fae3eafc4e62d2f595
7
- data.tar.gz: 1de2ab1ab88fe5e9739389fee598fa73b22454358ae0646d5cb9a9fea451d3659969980c954b1f847219de56fc0eec25110956bc7d2ce13e13c83df3e8beabb3
6
+ metadata.gz: 25db44cbb15065ee9f0bf827dd8d506e7c4ff673f6acaeb7730e34f1e22df65848f9225551869386a01f0eac03e939ae037503a4d4195a0c0d004e4ff034e35a
7
+ data.tar.gz: 0ae5b39fd5fecb578f1ef7c340dc408e8ec129a2260ce2961934e27270f13892eb1d3b19f83b7a4ce6c1bd6b817be3052f5c81ad2693e4cae963664f02f33545
data/README.md CHANGED
@@ -18,6 +18,7 @@ In order to use this library, you first need to go through the following steps:
18
18
 
19
19
  1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
20
20
  1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
21
+ 1. [Enable the API.](https://console.cloud.google.com/apis/library/cloudtasks.googleapis.com)
21
22
  1. {file:AUTHENTICATION.md Set up authentication.}
22
23
 
23
24
  ## Quick Start
@@ -33,6 +34,9 @@ response = client.list_queues request
33
34
  View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-tasks-v2/latest)
34
35
  for class and method documentation.
35
36
 
37
+ See also the [Product Documentation](https://cloud.google.com/tasks)
38
+ for general usage information.
39
+
36
40
  ## Enabling Logging
37
41
 
38
42
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
@@ -71,7 +71,7 @@ module Google
71
71
  initial_delay: 0.1,
72
72
  max_delay: 10.0,
73
73
  multiplier: 1.3,
74
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
74
+ retry_codes: [4, 14]
75
75
  }
76
76
 
77
77
  default_config.rpcs.get_queue.timeout = 10.0
@@ -79,7 +79,7 @@ module Google
79
79
  initial_delay: 0.1,
80
80
  max_delay: 10.0,
81
81
  multiplier: 1.3,
82
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
82
+ retry_codes: [4, 14]
83
83
  }
84
84
 
85
85
  default_config.rpcs.create_queue.timeout = 10.0
@@ -91,7 +91,7 @@ module Google
91
91
  initial_delay: 0.1,
92
92
  max_delay: 10.0,
93
93
  multiplier: 1.3,
94
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
94
+ retry_codes: [4, 14]
95
95
  }
96
96
 
97
97
  default_config.rpcs.purge_queue.timeout = 10.0
@@ -105,7 +105,7 @@ module Google
105
105
  initial_delay: 0.1,
106
106
  max_delay: 10.0,
107
107
  multiplier: 1.3,
108
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
108
+ retry_codes: [4, 14]
109
109
  }
110
110
 
111
111
  default_config.rpcs.set_iam_policy.timeout = 10.0
@@ -115,7 +115,7 @@ module Google
115
115
  initial_delay: 0.1,
116
116
  max_delay: 10.0,
117
117
  multiplier: 1.3,
118
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
118
+ retry_codes: [4, 14]
119
119
  }
120
120
 
121
121
  default_config.rpcs.list_tasks.timeout = 10.0
@@ -123,7 +123,7 @@ module Google
123
123
  initial_delay: 0.1,
124
124
  max_delay: 10.0,
125
125
  multiplier: 1.3,
126
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
126
+ retry_codes: [4, 14]
127
127
  }
128
128
 
129
129
  default_config.rpcs.get_task.timeout = 10.0
@@ -131,7 +131,7 @@ module Google
131
131
  initial_delay: 0.1,
132
132
  max_delay: 10.0,
133
133
  multiplier: 1.3,
134
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
134
+ retry_codes: [4, 14]
135
135
  }
136
136
 
137
137
  default_config.rpcs.create_task.timeout = 10.0
@@ -141,7 +141,7 @@ module Google
141
141
  initial_delay: 0.1,
142
142
  max_delay: 10.0,
143
143
  multiplier: 1.3,
144
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
144
+ retry_codes: [4, 14]
145
145
  }
146
146
 
147
147
  default_config.rpcs.run_task.timeout = 10.0
@@ -211,7 +211,8 @@ module Google
211
211
  if credentials.is_a?(String) || credentials.is_a?(Hash)
212
212
  credentials = Credentials.new credentials, scope: @config.scope
213
213
  end
214
- @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
214
+ @quota_project_id = @config.quota_project
215
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
215
216
 
216
217
  @cloud_tasks_stub = ::Gapic::ServiceStub.new(
217
218
  ::Google::Cloud::Tasks::V2::CloudTasks::Stub,
@@ -1665,24 +1666,28 @@ module Google
1665
1666
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1666
1667
  # trigger a retry.
1667
1668
  # @return [::Hash]
1669
+ # @!attribute [rw] quota_project
1670
+ # A separate project against which to charge quota.
1671
+ # @return [::String]
1668
1672
  #
1669
1673
  class Configuration
1670
1674
  extend ::Gapic::Config
1671
1675
 
1672
- config_attr :endpoint, "cloudtasks.googleapis.com", String
1673
- config_attr :credentials, nil do |value|
1676
+ config_attr :endpoint, "cloudtasks.googleapis.com", ::String
1677
+ config_attr :credentials, nil do |value|
1674
1678
  allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1675
1679
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1676
1680
  allowed.any? { |klass| klass === value }
1677
1681
  end
1678
- config_attr :scope, nil, ::String, ::Array, nil
1679
- config_attr :lib_name, nil, ::String, nil
1680
- config_attr :lib_version, nil, ::String, nil
1681
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1682
- config_attr :interceptors, nil, ::Array, nil
1683
- config_attr :timeout, nil, ::Numeric, nil
1684
- config_attr :metadata, nil, ::Hash, nil
1685
- config_attr :retry_policy, nil, ::Hash, Proc, nil
1682
+ config_attr :scope, nil, ::String, ::Array, nil
1683
+ config_attr :lib_name, nil, ::String, nil
1684
+ config_attr :lib_version, nil, ::String, nil
1685
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1686
+ config_attr :interceptors, nil, ::Array, nil
1687
+ config_attr :timeout, nil, ::Numeric, nil
1688
+ config_attr :metadata, nil, ::Hash, nil
1689
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1690
+ config_attr :quota_project, nil, ::String, nil
1686
1691
 
1687
1692
  # @private
1688
1693
  def initialize parent_config = nil
@@ -1698,7 +1703,7 @@ module Google
1698
1703
  def rpcs
1699
1704
  @rpcs ||= begin
1700
1705
  parent_rpcs = nil
1701
- parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
1706
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
1702
1707
  Rpcs.new parent_rpcs
1703
1708
  end
1704
1709
  end
@@ -38,9 +38,9 @@ module Google
38
38
  # Lists queues.
39
39
  #
40
40
  # Queues are returned in lexicographical order.
41
- rpc :ListQueues, ListQueuesRequest, ListQueuesResponse
41
+ rpc :ListQueues, Google::Cloud::Tasks::V2::ListQueuesRequest, Google::Cloud::Tasks::V2::ListQueuesResponse
42
42
  # Gets a queue.
43
- rpc :GetQueue, GetQueueRequest, Queue
43
+ rpc :GetQueue, Google::Cloud::Tasks::V2::GetQueueRequest, Google::Cloud::Tasks::V2::Queue
44
44
  # Creates a queue.
45
45
  #
46
46
  # Queues created with this method allow tasks to live for a maximum of 31
@@ -53,7 +53,7 @@ module Google
53
53
  # [Overview of Queue Management and
54
54
  # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using
55
55
  # this method.
56
- rpc :CreateQueue, CreateQueueRequest, Queue
56
+ rpc :CreateQueue, Google::Cloud::Tasks::V2::CreateQueueRequest, Google::Cloud::Tasks::V2::Queue
57
57
  # Updates a queue.
58
58
  #
59
59
  # This method creates the queue if it does not exist and updates
@@ -69,7 +69,7 @@ module Google
69
69
  # [Overview of Queue Management and
70
70
  # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using
71
71
  # this method.
72
- rpc :UpdateQueue, UpdateQueueRequest, Queue
72
+ rpc :UpdateQueue, Google::Cloud::Tasks::V2::UpdateQueueRequest, Google::Cloud::Tasks::V2::Queue
73
73
  # Deletes a queue.
74
74
  #
75
75
  # This command will delete the queue even if it has tasks in it.
@@ -83,14 +83,14 @@ module Google
83
83
  # [Overview of Queue Management and
84
84
  # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using
85
85
  # this method.
86
- rpc :DeleteQueue, DeleteQueueRequest, Google::Protobuf::Empty
86
+ rpc :DeleteQueue, Google::Cloud::Tasks::V2::DeleteQueueRequest, Google::Protobuf::Empty
87
87
  # Purges a queue by deleting all of its tasks.
88
88
  #
89
89
  # All tasks created before this method is called are permanently deleted.
90
90
  #
91
91
  # Purge operations can take up to one minute to take effect. Tasks
92
92
  # might be dispatched before the purge takes effect. A purge is irreversible.
93
- rpc :PurgeQueue, PurgeQueueRequest, Queue
93
+ rpc :PurgeQueue, Google::Cloud::Tasks::V2::PurgeQueueRequest, Google::Cloud::Tasks::V2::Queue
94
94
  # Pauses the queue.
95
95
  #
96
96
  # If a queue is paused then the system will stop dispatching tasks
@@ -98,7 +98,7 @@ module Google
98
98
  # [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue]. Tasks can still be added
99
99
  # when the queue is paused. A queue is paused if its
100
100
  # [state][google.cloud.tasks.v2.Queue.state] is [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED].
101
- rpc :PauseQueue, PauseQueueRequest, Queue
101
+ rpc :PauseQueue, Google::Cloud::Tasks::V2::PauseQueueRequest, Google::Cloud::Tasks::V2::Queue
102
102
  # Resume a queue.
103
103
  #
104
104
  # This method resumes a queue after it has been
@@ -112,7 +112,7 @@ module Google
112
112
  # queues, follow the 500/50/5 pattern described in
113
113
  # [Managing Cloud Tasks Scaling
114
114
  # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling).
115
- rpc :ResumeQueue, ResumeQueueRequest, Queue
115
+ rpc :ResumeQueue, Google::Cloud::Tasks::V2::ResumeQueueRequest, Google::Cloud::Tasks::V2::Queue
116
116
  # Gets the access control policy for a [Queue][google.cloud.tasks.v2.Queue].
117
117
  # Returns an empty policy if the resource exists and does not have a policy
118
118
  # set.
@@ -152,21 +152,21 @@ module Google
152
152
  #
153
153
  # The tasks may be returned in any order. The ordering may change at any
154
154
  # time.
155
- rpc :ListTasks, ListTasksRequest, ListTasksResponse
155
+ rpc :ListTasks, Google::Cloud::Tasks::V2::ListTasksRequest, Google::Cloud::Tasks::V2::ListTasksResponse
156
156
  # Gets a task.
157
- rpc :GetTask, GetTaskRequest, Task
157
+ rpc :GetTask, Google::Cloud::Tasks::V2::GetTaskRequest, Google::Cloud::Tasks::V2::Task
158
158
  # Creates a task and adds it to a queue.
159
159
  #
160
160
  # Tasks cannot be updated after creation; there is no UpdateTask command.
161
161
  #
162
162
  # * The maximum task size is 100KB.
163
- rpc :CreateTask, CreateTaskRequest, Task
163
+ rpc :CreateTask, Google::Cloud::Tasks::V2::CreateTaskRequest, Google::Cloud::Tasks::V2::Task
164
164
  # Deletes a task.
165
165
  #
166
166
  # A task can be deleted if it is scheduled or dispatched. A task
167
167
  # cannot be deleted if it has executed successfully or permanently
168
168
  # failed.
169
- rpc :DeleteTask, DeleteTaskRequest, Google::Protobuf::Empty
169
+ rpc :DeleteTask, Google::Cloud::Tasks::V2::DeleteTaskRequest, Google::Protobuf::Empty
170
170
  # Forces a task to run now.
171
171
  #
172
172
  # When this method is called, Cloud Tasks will dispatch the task, even if
@@ -191,7 +191,7 @@ module Google
191
191
  # [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] returns
192
192
  # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a
193
193
  # task that has already succeeded or permanently failed.
194
- rpc :RunTask, RunTaskRequest, Task
194
+ rpc :RunTask, Google::Cloud::Tasks::V2::RunTaskRequest, Google::Cloud::Tasks::V2::Task
195
195
  end
196
196
 
197
197
  Stub = Service.rpc_stub_class
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Tasks
23
23
  module V2
24
- VERSION = "0.1.0"
24
+ VERSION = "0.2.4"
25
25
  end
26
26
  end
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-tasks-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-06 00:00:00.000000000 Z
11
+ date: 2020-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.2'
19
+ version: '0.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.2'
26
+ version: '0.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: google-cloud-errors
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -78,14 +78,42 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '5.10'
81
+ version: '5.14'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '5.10'
88
+ version: '5.14'
89
+ - !ruby/object:Gem::Dependency
90
+ name: minitest-focus
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '1.1'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '1.1'
103
+ - !ruby/object:Gem::Dependency
104
+ name: minitest-rg
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '5.2'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '5.2'
89
117
  - !ruby/object:Gem::Dependency
90
118
  name: rake
91
119
  requirement: !ruby/object:Gem::Requirement
@@ -156,7 +184,6 @@ files:
156
184
  - LICENSE.md
157
185
  - README.md
158
186
  - lib/google-cloud-tasks-v2.rb
159
- - lib/google/cloud/common_resources_pb.rb
160
187
  - lib/google/cloud/tasks/v2.rb
161
188
  - lib/google/cloud/tasks/v2/cloud_tasks.rb
162
189
  - lib/google/cloud/tasks/v2/cloud_tasks/client.rb
@@ -204,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
231
  - !ruby/object:Gem::Version
205
232
  version: '0'
206
233
  requirements: []
207
- rubygems_version: 3.0.6
234
+ rubygems_version: 3.1.3
208
235
  signing_key:
209
236
  specification_version: 4
210
237
  summary: API Client library for the Cloud Tasks V2 API
@@ -1,15 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/common_resources.proto
3
-
4
- require 'google/protobuf'
5
-
6
- require 'google/api/resource_pb'
7
- Google::Protobuf::DescriptorPool.generated_pool.build do
8
- add_file("google/cloud/common_resources.proto", :syntax => :proto3) do
9
- end
10
- end
11
-
12
- module Google
13
- module Cloud
14
- end
15
- end