google-cloud-pubsub-v1 0.5.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f7d1c69dbbebade711c381290821b22d0e8205d613b3b615e2fc1ce1de949ff
4
- data.tar.gz: 0700d32c025dc6a8a872cdf95183e72f69480a926cd1a47e4c4e3c38cf6ba209
3
+ metadata.gz: d56cc17594032fd9f7922440bb1e361788d9fb761af4f97818b094715bf2e75a
4
+ data.tar.gz: f112e0ff2369f89d662c02b1cebc913b9096c88ddb5c13df3c1c19d7d71e6c0c
5
5
  SHA512:
6
- metadata.gz: f808f020eea3ffdbd6274b0748ed72bd59c9c7cf2e1fcdb85534088a60fc81fe3e45c891c94443a8472b5b33c0ec465818c346382e18dc7e8cffe1f8a52a8970
7
- data.tar.gz: 2b8d9fb7e95d30951805c13df5e42ada749733ef334acadfda225246fcfc1a0ba5e1d693c7abd1bd80dfb25a3782ee192dcf6f4f74ea48939647cb715b9183d2
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 placing them in
86
- environment variables. Either on an individual client initialization:
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 configured globally for all clients:
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
- # ## Example
66
+ # @example
67
67
  #
68
- # To modify the configuration for all IAMPolicy clients:
69
- #
70
- # ::Google::Cloud::PubSub::V1::IAMPolicy::Client.configure do |config|
71
- # config.timeout = 10.0
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
- # ## Examples
120
- #
121
- # To create a new IAMPolicy client with the default
122
- # configuration:
118
+ # @example
123
119
  #
124
- # client = ::Google::Cloud::PubSub::V1::IAMPolicy::Client.new
120
+ # # Create a client using the default configuration
121
+ # client = ::Google::Cloud::PubSub::V1::IAMPolicy::Client.new
125
122
  #
126
- # To create a new IAMPolicy client with a custom
127
- # configuration:
128
- #
129
- # client = ::Google::Cloud::PubSub::V1::IAMPolicy::Client.new do |config|
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 scope and endpoint are unchanged from default,
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.scope == Client.configure.scope &&
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
- "resource" => request.resource
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
- options.apply_defaults metadata: @config.metadata,
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
- "resource" => request.resource
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
- options.apply_defaults metadata: @config.metadata,
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
- "resource" => request.resource
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
- options.apply_defaults metadata: @config.metadata,
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
- # # Examples
412
- #
413
- # To modify the global config, setting the timeout for set_iam_policy
414
- # to 20 seconds, and all remaining timeouts to 10 seconds:
415
- #
416
- # ::Google::Cloud::PubSub::V1::IAMPolicy::Client.configure do |config|
417
- # config.timeout = 10.0
418
- # config.rpcs.set_iam_policy.timeout = 20.0
419
- # end
420
- #
421
- # To apply the above configuration only to a new client:
422
- #
423
- # client = ::Google::Cloud::PubSub::V1::IAMPolicy::Client.new do |config|
424
- # config.timeout = 10.0
425
- # config.rpcs.set_iam_policy.timeout = 20.0
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.