google-cloud-pubsub-v1 0.5.0 → 0.6.1
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 +4 -4
- data/AUTHENTICATION.md +3 -3
- data/lib/google/cloud/pubsub/v1/iam_policy/client.rb +98 -48
- data/lib/google/cloud/pubsub/v1/publisher/client.rb +252 -73
- data/lib/google/cloud/pubsub/v1/schema_service/client.rb +173 -60
- data/lib/google/cloud/pubsub/v1/subscriber/client.rb +416 -99
- data/lib/google/cloud/pubsub/v1/version.rb +1 -1
- data/lib/google/pubsub/v1/pubsub_pb.rb +4 -2
- data/lib/google/pubsub/v1/schema_pb.rb +2 -2
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/pubsub/v1/pubsub.rb +21 -2
- data/proto_docs/google/pubsub/v1/schema.rb +2 -0
- data/proto_docs/google/type/expr.rb +35 -12
- metadata +4 -5
- data/lib/google/iam/v1/iam_policy_services_pb.rb +0 -81
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d56cc17594032fd9f7922440bb1e361788d9fb761af4f97818b094715bf2e75a
|
4
|
+
data.tar.gz: f112e0ff2369f89d662c02b1cebc913b9096c88ddb5c13df3c1c19d7d71e6c0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b72839c23b21ae5b20db0abecf75199238ce0e2808fe75774fe3199ab65e08243e32dae9698a02f9da531f6204f72d67afd781ac05d5209cab35673e3df6a8d
|
7
|
+
data.tar.gz: 3bd6d52b3e4cd305275056d9ddcdb9710d9a56e957da8e030e1d1b7d8eede13cff168537e1cfdcc84bfd8d8ac9e69cdb7fc62c148e31e985f304522a62ebe26b
|
data/AUTHENTICATION.md
CHANGED
@@ -82,8 +82,8 @@ client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new
|
|
82
82
|
|
83
83
|
### Configuration
|
84
84
|
|
85
|
-
The **Credentials JSON** can be configured instead of
|
86
|
-
environment
|
85
|
+
The path to the **Credentials JSON** file can be configured instead of storing
|
86
|
+
it in an environment variable. Either on an individual client initialization:
|
87
87
|
|
88
88
|
```ruby
|
89
89
|
require "google/cloud/pubsub/v1"
|
@@ -93,7 +93,7 @@ client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config|
|
|
93
93
|
end
|
94
94
|
```
|
95
95
|
|
96
|
-
Or
|
96
|
+
Or globally for all clients:
|
97
97
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/pubsub/v1"
|
@@ -63,13 +63,12 @@ module Google
|
|
63
63
|
# See {::Google::Cloud::PubSub::V1::IAMPolicy::Client::Configuration}
|
64
64
|
# for a description of the configuration fields.
|
65
65
|
#
|
66
|
-
#
|
66
|
+
# @example
|
67
67
|
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
72
|
-
# end
|
68
|
+
# # Modify the configuration for all IAMPolicy clients
|
69
|
+
# ::Google::Cloud::PubSub::V1::IAMPolicy::Client.configure do |config|
|
70
|
+
# config.timeout = 10.0
|
71
|
+
# end
|
73
72
|
#
|
74
73
|
# @yield [config] Configure the Client client.
|
75
74
|
# @yieldparam config [Client::Configuration]
|
@@ -116,19 +115,15 @@ module Google
|
|
116
115
|
##
|
117
116
|
# Create a new IAMPolicy client object.
|
118
117
|
#
|
119
|
-
#
|
120
|
-
#
|
121
|
-
# To create a new IAMPolicy client with the default
|
122
|
-
# configuration:
|
118
|
+
# @example
|
123
119
|
#
|
124
|
-
#
|
120
|
+
# # Create a client using the default configuration
|
121
|
+
# client = ::Google::Cloud::PubSub::V1::IAMPolicy::Client.new
|
125
122
|
#
|
126
|
-
#
|
127
|
-
#
|
128
|
-
#
|
129
|
-
#
|
130
|
-
# config.timeout = 10.0
|
131
|
-
# end
|
123
|
+
# # Create a client using a custom configuration
|
124
|
+
# client = ::Google::Cloud::PubSub::V1::IAMPolicy::Client.new do |config|
|
125
|
+
# config.timeout = 10.0
|
126
|
+
# end
|
132
127
|
#
|
133
128
|
# @yield [config] Configure the IAMPolicy client.
|
134
129
|
# @yieldparam config [Client::Configuration]
|
@@ -148,10 +143,9 @@ module Google
|
|
148
143
|
|
149
144
|
# Create credentials
|
150
145
|
credentials = @config.credentials
|
151
|
-
# Use self-signed JWT if the
|
146
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
152
147
|
# but only if the default endpoint does not have a region prefix.
|
153
|
-
enable_self_signed_jwt = @config.
|
154
|
-
@config.endpoint == Client.configure.endpoint &&
|
148
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
155
149
|
!@config.endpoint.split(".").first.include?("-")
|
156
150
|
credentials ||= Credentials.default scope: @config.scope,
|
157
151
|
enable_self_signed_jwt: enable_self_signed_jwt
|
@@ -208,6 +202,21 @@ module Google
|
|
208
202
|
#
|
209
203
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
210
204
|
#
|
205
|
+
# @example Basic example
|
206
|
+
# require "google/iam/v1"
|
207
|
+
#
|
208
|
+
# # Create a client object. The client can be reused for multiple calls.
|
209
|
+
# client = Google::Cloud::PubSub::V1::IAMPolicy::Client.new
|
210
|
+
#
|
211
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
212
|
+
# request = Google::Iam::V1::SetIamPolicyRequest.new
|
213
|
+
#
|
214
|
+
# # Call the set_iam_policy method.
|
215
|
+
# result = client.set_iam_policy request
|
216
|
+
#
|
217
|
+
# # The returned object is of type Google::Iam::V1::Policy.
|
218
|
+
# p result
|
219
|
+
#
|
211
220
|
def set_iam_policy request, options = nil
|
212
221
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
213
222
|
|
@@ -225,16 +234,20 @@ module Google
|
|
225
234
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
226
235
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
227
236
|
|
228
|
-
header_params = {
|
229
|
-
|
230
|
-
|
237
|
+
header_params = {}
|
238
|
+
if request.resource
|
239
|
+
header_params["resource"] = request.resource
|
240
|
+
end
|
241
|
+
|
231
242
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
232
243
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
233
244
|
|
234
245
|
options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
|
235
246
|
metadata: metadata,
|
236
247
|
retry_policy: @config.rpcs.set_iam_policy.retry_policy
|
237
|
-
|
248
|
+
|
249
|
+
options.apply_defaults timeout: @config.timeout,
|
250
|
+
metadata: @config.metadata,
|
238
251
|
retry_policy: @config.retry_policy
|
239
252
|
|
240
253
|
@iam_policy_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
|
@@ -280,6 +293,21 @@ module Google
|
|
280
293
|
#
|
281
294
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
282
295
|
#
|
296
|
+
# @example Basic example
|
297
|
+
# require "google/iam/v1"
|
298
|
+
#
|
299
|
+
# # Create a client object. The client can be reused for multiple calls.
|
300
|
+
# client = Google::Cloud::PubSub::V1::IAMPolicy::Client.new
|
301
|
+
#
|
302
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
303
|
+
# request = Google::Iam::V1::GetIamPolicyRequest.new
|
304
|
+
#
|
305
|
+
# # Call the get_iam_policy method.
|
306
|
+
# result = client.get_iam_policy request
|
307
|
+
#
|
308
|
+
# # The returned object is of type Google::Iam::V1::Policy.
|
309
|
+
# p result
|
310
|
+
#
|
283
311
|
def get_iam_policy request, options = nil
|
284
312
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
285
313
|
|
@@ -297,16 +325,20 @@ module Google
|
|
297
325
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
298
326
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
299
327
|
|
300
|
-
header_params = {
|
301
|
-
|
302
|
-
|
328
|
+
header_params = {}
|
329
|
+
if request.resource
|
330
|
+
header_params["resource"] = request.resource
|
331
|
+
end
|
332
|
+
|
303
333
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
304
334
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
305
335
|
|
306
336
|
options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
|
307
337
|
metadata: metadata,
|
308
338
|
retry_policy: @config.rpcs.get_iam_policy.retry_policy
|
309
|
-
|
339
|
+
|
340
|
+
options.apply_defaults timeout: @config.timeout,
|
341
|
+
metadata: @config.metadata,
|
310
342
|
retry_policy: @config.retry_policy
|
311
343
|
|
312
344
|
@iam_policy_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
|
@@ -358,6 +390,21 @@ module Google
|
|
358
390
|
#
|
359
391
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
360
392
|
#
|
393
|
+
# @example Basic example
|
394
|
+
# require "google/iam/v1"
|
395
|
+
#
|
396
|
+
# # Create a client object. The client can be reused for multiple calls.
|
397
|
+
# client = Google::Cloud::PubSub::V1::IAMPolicy::Client.new
|
398
|
+
#
|
399
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
400
|
+
# request = Google::Iam::V1::TestIamPermissionsRequest.new
|
401
|
+
#
|
402
|
+
# # Call the test_iam_permissions method.
|
403
|
+
# result = client.test_iam_permissions request
|
404
|
+
#
|
405
|
+
# # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
|
406
|
+
# p result
|
407
|
+
#
|
361
408
|
def test_iam_permissions request, options = nil
|
362
409
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
363
410
|
|
@@ -375,16 +422,20 @@ module Google
|
|
375
422
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
376
423
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
377
424
|
|
378
|
-
header_params = {
|
379
|
-
|
380
|
-
|
425
|
+
header_params = {}
|
426
|
+
if request.resource
|
427
|
+
header_params["resource"] = request.resource
|
428
|
+
end
|
429
|
+
|
381
430
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
382
431
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
383
432
|
|
384
433
|
options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
|
385
434
|
metadata: metadata,
|
386
435
|
retry_policy: @config.rpcs.test_iam_permissions.retry_policy
|
387
|
-
|
436
|
+
|
437
|
+
options.apply_defaults timeout: @config.timeout,
|
438
|
+
metadata: @config.metadata,
|
388
439
|
retry_policy: @config.retry_policy
|
389
440
|
|
390
441
|
@iam_policy_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
|
@@ -408,22 +459,21 @@ module Google
|
|
408
459
|
# Configuration can be applied globally to all clients, or to a single client
|
409
460
|
# on construction.
|
410
461
|
#
|
411
|
-
#
|
412
|
-
#
|
413
|
-
#
|
414
|
-
# to 20 seconds,
|
415
|
-
#
|
416
|
-
#
|
417
|
-
#
|
418
|
-
#
|
419
|
-
#
|
420
|
-
#
|
421
|
-
#
|
422
|
-
#
|
423
|
-
#
|
424
|
-
#
|
425
|
-
#
|
426
|
-
# end
|
462
|
+
# @example
|
463
|
+
#
|
464
|
+
# # Modify the global config, setting the timeout for
|
465
|
+
# # set_iam_policy to 20 seconds,
|
466
|
+
# # and all remaining timeouts to 10 seconds.
|
467
|
+
# ::Google::Cloud::PubSub::V1::IAMPolicy::Client.configure do |config|
|
468
|
+
# config.timeout = 10.0
|
469
|
+
# config.rpcs.set_iam_policy.timeout = 20.0
|
470
|
+
# end
|
471
|
+
#
|
472
|
+
# # Apply the above configuration only to a new client.
|
473
|
+
# client = ::Google::Cloud::PubSub::V1::IAMPolicy::Client.new do |config|
|
474
|
+
# config.timeout = 10.0
|
475
|
+
# config.rpcs.set_iam_policy.timeout = 20.0
|
476
|
+
# end
|
427
477
|
#
|
428
478
|
# @!attribute [rw] endpoint
|
429
479
|
# The hostname or hostname:port of the service endpoint.
|