google-cloud-pubsub-v1 0.5.2 → 0.7.0

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: e6e2a4a9f6746191781373c0594d27f8dccef450607d23da6bc9abed9a13730c
4
- data.tar.gz: 5f508e848d394c34604079c27aff3e465d95bee3a176cc89170e09c9fd025b3e
3
+ metadata.gz: 5f116b2346c2abd053ce718fe01d61ecd08eb4ceeceb9f877bfe1f5e0a9cabbc
4
+ data.tar.gz: 00571d24398815cb9c58af6e84c8f039761d4fae331af3eedb3bb33dcf999e17
5
5
  SHA512:
6
- metadata.gz: 64c8dd6ad2f2ac7ee7bd85e72a9abc1b6fee01b2b3a35ef208e923d542c5185946f89e721f4987459d4603c096208b07b6db76a4a08e0165d5f9ce7cc95a88b2
7
- data.tar.gz: f0fb04598dc4cdb5ffaa92e045aba68e780afc9b53a7bf9e69d8763082e4cf8fda9565c695bb4173abeadb5a837769541ccb4e9a321fc4b5b395722ba41b021a
6
+ metadata.gz: e562784e1fb6bb9ab903da8abc82b2841950942b8a8516d3c896045e25918946df767ad7ce72c1efb281daebe4bc577c0221cc817d06363948d007f489ec5511
7
+ data.tar.gz: f83cec94bba896acb0c12e82fa93672ec1acd03f2d2a67eee30c9011331d57206024383db3aff966a4d5a83ef848e9c61eb92df9e70abee3eaa2d54017298d5f
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title=Cloud Pub/Sub V1 API
2
+ --title="Cloud Pub/Sub V1 API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
data/AUTHENTICATION.md CHANGED
@@ -120,15 +120,6 @@ To configure your system for this, simply:
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
121
121
  *should* only be used during development.
122
122
 
123
- [gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
124
- [dev-console]: https://console.cloud.google.com/project
125
-
126
- [enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
127
-
128
- [create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
129
- [create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
130
- [reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
131
-
132
123
  ## Creating a Service Account
133
124
 
134
125
  Google Cloud requires **Service Account Credentials** to
@@ -139,31 +130,22 @@ If you are not running this client within
139
130
  [Google Cloud Platform environments](#google-cloud-platform-environments), you
140
131
  need a Google Developers service account.
141
132
 
142
- 1. Visit the [Google Developers Console][dev-console].
133
+ 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
143
134
  2. Create a new project or click on an existing project.
144
- 3. Activate the slide-out navigation tray and select **API Manager**. From
135
+ 3. Activate the menu in the upper left and select **APIs & Services**. From
145
136
  here, you will enable the APIs that your application requires.
146
137
 
147
- ![Enable the APIs that your application requires][enable-apis]
148
-
149
138
  *Note: You may need to enable billing in order to use these services.*
150
139
 
151
140
  4. Select **Credentials** from the side navigation.
152
141
 
153
- You should see a screen like one of the following.
154
-
155
- ![Create a new service account][create-new-service-account]
156
-
157
- ![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
158
-
159
- Find the "Add credentials" drop down and select "Service account" to be
160
- guided through downloading a new JSON key file.
142
+ Find the "Create credentials" drop down near the top of the page, and select
143
+ "Service account" to be guided through downloading a new JSON key file.
161
144
 
162
145
  If you want to re-use an existing service account, you can easily generate a
163
- new key file. Just select the account you wish to re-use, and click "Generate
164
- new JSON key":
165
-
166
- ![Re-use an existing service account][reuse-service-account]
146
+ new key file. Just select the account you wish to re-use, click the pencil
147
+ tool on the right side to edit the service account, select the **Keys** tab,
148
+ and then select **Add Key**.
167
149
 
168
150
  The key file you download will be used by this library to authenticate API
169
151
  requests and should be stored in a secure location.
data/README.md CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Cloud::PubSub::V1::CreateSchemaRequest.new # (request fields
37
37
  response = client.create_schema request
38
38
  ```
39
39
 
40
- View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-pubsub-v1/latest)
40
+ View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest)
41
41
  for class and method documentation.
42
42
 
43
43
  See also the [Product Documentation](https://cloud.google.com/pubsub)
@@ -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.