google-cloud-pubsub-v1 0.11.0 → 0.12.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: 443cecafdba18bff1520ec3c62b4348814d02de4b999da3aa68a55b9a08ef44a
4
- data.tar.gz: d553ef3a8145fd6e15e091f6c6cf400de82f759561db6a7d5ab34f7da62a5ae6
3
+ metadata.gz: 2659e3e73a8ffde00b78e5ae92ebc7b2c8c6cee8c3f7fc70a1b70406e392a211
4
+ data.tar.gz: b1c01642b01b74c743d853fc9e6d7740960e8b92664a907ffe8f7e36954832c9
5
5
  SHA512:
6
- metadata.gz: b5773a6ae2213a2bcafe136fc61a8f20cf7ec89a6bbfa3603e78d3b8031f3a0d938beff1aee7f821b28cff6dd23295125efd0c70663b96dbf56e5602fa369cd9
7
- data.tar.gz: b91938f324c8dfd1b475446edc69d7281d51a867c135c75884229dc9f138f5783f6aaee5f2b2eeaeba0c927c9273d46c37b695b283c5a2a859ba9e22c9a3f31a
6
+ metadata.gz: 297af5d26b56dd0b8446d0f2159543731d34a29b91630dd90e18cd6e1f0b53cf22dde40d013fa2b686ec821ca4cb8b82adddbaca5a8384b5f8853e455e8c9cab
7
+ data.tar.gz: ed11a7b84d15c76216c1e1c25e357242ddeacb944f4f109e65298349cca3904eb5a9c32fe501a85e1716aa469197a63eff96e8c198a32d630336b90f4cb30dd6
data/AUTHENTICATION.md CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
114
114
  To configure your system for this, simply:
115
115
 
116
116
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
117
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
118
118
  3. Write code as if already authenticated.
119
119
 
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
data/README.md CHANGED
@@ -46,7 +46,7 @@ for general usage information.
46
46
  ## Enabling Logging
47
47
 
48
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
49
+ The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
50
  or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
51
51
  that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
52
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Legacy IAM Policy client.
18
+ # No longer generated, but kept around for backward compatibility.
19
+ require "google/cloud/pubsub/v1/iam_policy"
@@ -14,7 +14,7 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
 
17
- # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
17
+ # Originally auto-generated by gapic-generator-ruby.
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/iam/v1/iam_policy_pb"
@@ -25,56 +25,18 @@ module Google
25
25
  module V1
26
26
  module IAMPolicy
27
27
  ##
28
- # Client for the IAMPolicy service.
28
+ # This module contains the legacy IAM Policy client.
29
29
  #
30
- # API Overview
31
- #
32
- #
33
- # Manages Identity and Access Management (IAM) policies.
34
- #
35
- # Any implementation of an API that offers access control features
36
- # implements the google.iam.v1.IAMPolicy interface.
37
- #
38
- # ## Data model
39
- #
40
- # Access control is applied when a principal (user or service account), takes
41
- # some action on a resource exposed by a service. Resources, identified by
42
- # URI-like names, are the unit of access control specification. Service
43
- # implementations can choose the granularity of access control and the
44
- # supported permissions for their resources.
45
- # For example one database service may allow access control to be
46
- # specified only at the Table level, whereas another might allow access control
47
- # to also be specified at the Column level.
48
- #
49
- # ## Policy Structure
50
- #
51
- # See google.iam.v1.Policy
52
- #
53
- # This is intentionally not a CRUD style API because access control policies
54
- # are created and deleted implicitly with the resources to which they are
55
- # attached.
30
+ # @deprecated Call `iam_policy_client` on any of the other client
31
+ # objects to get a client for IAM policies instead of using this
32
+ # legacy class.
56
33
  #
57
34
  class Client
58
35
  # @private
59
36
  attr_reader :iam_policy_stub
60
37
 
61
38
  ##
62
- # Configure the IAMPolicy Client class.
63
- #
64
- # See {::Google::Cloud::PubSub::V1::IAMPolicy::Client::Configuration}
65
- # for a description of the configuration fields.
66
- #
67
- # @example
68
- #
69
- # # Modify the configuration for all IAMPolicy clients
70
- # ::Google::Cloud::PubSub::V1::IAMPolicy::Client.configure do |config|
71
- # config.timeout = 10.0
72
- # end
73
- #
74
- # @yield [config] Configure the Client client.
75
- # @yieldparam config [Client::Configuration]
76
- #
77
- # @return [Client::Configuration]
39
+ # @deprecated
78
40
  #
79
41
  def self.configure
80
42
  @configure ||= begin
@@ -94,19 +56,7 @@ module Google
94
56
  end
95
57
 
96
58
  ##
97
- # Configure the IAMPolicy Client instance.
98
- #
99
- # The configuration is set to the derived mode, meaning that values can be changed,
100
- # but structural changes (adding new fields, etc.) are not allowed. Structural changes
101
- # should be made on {Client.configure}.
102
- #
103
- # See {::Google::Cloud::PubSub::V1::IAMPolicy::Client::Configuration}
104
- # for a description of the configuration fields.
105
- #
106
- # @yield [config] Configure the Client client.
107
- # @yieldparam config [Client::Configuration]
108
- #
109
- # @return [Client::Configuration]
59
+ # @deprecated
110
60
  #
111
61
  def configure
112
62
  yield @config if block_given?
@@ -114,20 +64,7 @@ module Google
114
64
  end
115
65
 
116
66
  ##
117
- # Create a new IAMPolicy client object.
118
- #
119
- # @example
120
- #
121
- # # Create a client using the default configuration
122
- # client = ::Google::Cloud::PubSub::V1::IAMPolicy::Client.new
123
- #
124
- # # Create a client using a custom configuration
125
- # client = ::Google::Cloud::PubSub::V1::IAMPolicy::Client.new do |config|
126
- # config.timeout = 10.0
127
- # end
128
- #
129
- # @yield [config] Configure the IAMPolicy client.
130
- # @yieldparam config [Client::Configuration]
67
+ # @deprecated
131
68
  #
132
69
  def initialize
133
70
  # These require statements are intentionally placed here to initialize
@@ -165,66 +102,8 @@ module Google
165
102
  )
166
103
  end
167
104
 
168
- # Service calls
169
-
170
105
  ##
171
- # Sets the access control policy on the specified resource. Replaces any
172
- # existing policy.
173
- #
174
- # Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
175
- #
176
- # @overload set_iam_policy(request, options = nil)
177
- # Pass arguments to `set_iam_policy` via a request object, either of type
178
- # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
179
- #
180
- # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
181
- # A request object representing the call parameters. Required. To specify no
182
- # parameters, or to keep all the default parameter values, pass an empty Hash.
183
- # @param options [::Gapic::CallOptions, ::Hash]
184
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
185
- #
186
- # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
187
- # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
188
- # least one keyword argument is required. To specify no parameters, or to keep all
189
- # the default parameter values, pass an empty Hash as a request object (see above).
190
- #
191
- # @param resource [::String]
192
- # REQUIRED: The resource for which the policy is being specified.
193
- # See the operation documentation for the appropriate value for this field.
194
- # @param policy [::Google::Iam::V1::Policy, ::Hash]
195
- # REQUIRED: The complete policy to be applied to the `resource`. The size of
196
- # the policy is limited to a few 10s of KB. An empty policy is a
197
- # valid policy but certain Cloud Platform services (such as Projects)
198
- # might reject them.
199
- # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
200
- # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
201
- # the fields in the mask will be modified. If no mask is provided, the
202
- # following default mask is used:
203
- #
204
- # `paths: "bindings, etag"`
205
- #
206
- # @yield [response, operation] Access the result along with the RPC operation
207
- # @yieldparam response [::Google::Iam::V1::Policy]
208
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
209
- #
210
- # @return [::Google::Iam::V1::Policy]
211
- #
212
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
213
- #
214
- # @example Basic example
215
- # require "google/iam/v1"
216
- #
217
- # # Create a client object. The client can be reused for multiple calls.
218
- # client = Google::Cloud::PubSub::V1::IAMPolicy::Client.new
219
- #
220
- # # Create a request. To set request fields, pass in keyword arguments.
221
- # request = Google::Iam::V1::SetIamPolicyRequest.new
222
- #
223
- # # Call the set_iam_policy method.
224
- # result = client.set_iam_policy request
225
- #
226
- # # The returned object is of type Google::Iam::V1::Policy.
227
- # p result
106
+ # @deprecated
228
107
  #
229
108
  def set_iam_policy request, options = nil
230
109
  raise ::ArgumentError, "request must be provided" if request.nil?
@@ -268,54 +147,7 @@ module Google
268
147
  end
269
148
 
270
149
  ##
271
- # Gets the access control policy for a resource.
272
- # Returns an empty policy if the resource exists and does not have a policy
273
- # set.
274
- #
275
- # @overload get_iam_policy(request, options = nil)
276
- # Pass arguments to `get_iam_policy` via a request object, either of type
277
- # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
278
- #
279
- # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
280
- # A request object representing the call parameters. Required. To specify no
281
- # parameters, or to keep all the default parameter values, pass an empty Hash.
282
- # @param options [::Gapic::CallOptions, ::Hash]
283
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
284
- #
285
- # @overload get_iam_policy(resource: nil, options: nil)
286
- # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
287
- # least one keyword argument is required. To specify no parameters, or to keep all
288
- # the default parameter values, pass an empty Hash as a request object (see above).
289
- #
290
- # @param resource [::String]
291
- # REQUIRED: The resource for which the policy is being requested.
292
- # See the operation documentation for the appropriate value for this field.
293
- # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
294
- # OPTIONAL: A `GetPolicyOptions` object for specifying options to
295
- # `GetIamPolicy`.
296
- #
297
- # @yield [response, operation] Access the result along with the RPC operation
298
- # @yieldparam response [::Google::Iam::V1::Policy]
299
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
300
- #
301
- # @return [::Google::Iam::V1::Policy]
302
- #
303
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
304
- #
305
- # @example Basic example
306
- # require "google/iam/v1"
307
- #
308
- # # Create a client object. The client can be reused for multiple calls.
309
- # client = Google::Cloud::PubSub::V1::IAMPolicy::Client.new
310
- #
311
- # # Create a request. To set request fields, pass in keyword arguments.
312
- # request = Google::Iam::V1::GetIamPolicyRequest.new
313
- #
314
- # # Call the get_iam_policy method.
315
- # result = client.get_iam_policy request
316
- #
317
- # # The returned object is of type Google::Iam::V1::Policy.
318
- # p result
150
+ # @deprecated
319
151
  #
320
152
  def get_iam_policy request, options = nil
321
153
  raise ::ArgumentError, "request must be provided" if request.nil?
@@ -359,60 +191,7 @@ module Google
359
191
  end
360
192
 
361
193
  ##
362
- # Returns permissions that a caller has on the specified resource.
363
- # If the resource does not exist, this will return an empty set of
364
- # permissions, not a `NOT_FOUND` error.
365
- #
366
- # Note: This operation is designed to be used for building permission-aware
367
- # UIs and command-line tools, not for authorization checking. This operation
368
- # may "fail open" without warning.
369
- #
370
- # @overload test_iam_permissions(request, options = nil)
371
- # Pass arguments to `test_iam_permissions` via a request object, either of type
372
- # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
373
- #
374
- # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
375
- # A request object representing the call parameters. Required. To specify no
376
- # parameters, or to keep all the default parameter values, pass an empty Hash.
377
- # @param options [::Gapic::CallOptions, ::Hash]
378
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
379
- #
380
- # @overload test_iam_permissions(resource: nil, permissions: nil)
381
- # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
382
- # least one keyword argument is required. To specify no parameters, or to keep all
383
- # the default parameter values, pass an empty Hash as a request object (see above).
384
- #
385
- # @param resource [::String]
386
- # REQUIRED: The resource for which the policy detail is being requested.
387
- # See the operation documentation for the appropriate value for this field.
388
- # @param permissions [::Array<::String>]
389
- # The set of permissions to check for the `resource`. Permissions with
390
- # wildcards (such as '*' or 'storage.*') are not allowed. For more
391
- # information see
392
- # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
393
- #
394
- # @yield [response, operation] Access the result along with the RPC operation
395
- # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse]
396
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
397
- #
398
- # @return [::Google::Iam::V1::TestIamPermissionsResponse]
399
- #
400
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
401
- #
402
- # @example Basic example
403
- # require "google/iam/v1"
404
- #
405
- # # Create a client object. The client can be reused for multiple calls.
406
- # client = Google::Cloud::PubSub::V1::IAMPolicy::Client.new
407
- #
408
- # # Create a request. To set request fields, pass in keyword arguments.
409
- # request = Google::Iam::V1::TestIamPermissionsRequest.new
410
- #
411
- # # Call the test_iam_permissions method.
412
- # result = client.test_iam_permissions request
413
- #
414
- # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
415
- # p result
194
+ # @deprecated
416
195
  #
417
196
  def test_iam_permissions request, options = nil
418
197
  raise ::ArgumentError, "request must be provided" if request.nil?
@@ -456,83 +235,9 @@ module Google
456
235
  end
457
236
 
458
237
  ##
459
- # Configuration class for the IAMPolicy API.
460
- #
461
- # This class represents the configuration for IAMPolicy,
462
- # providing control over timeouts, retry behavior, logging, transport
463
- # parameters, and other low-level controls. Certain parameters can also be
464
- # applied individually to specific RPCs. See
465
- # {::Google::Cloud::PubSub::V1::IAMPolicy::Client::Configuration::Rpcs}
466
- # for a list of RPCs that can be configured independently.
467
- #
468
- # Configuration can be applied globally to all clients, or to a single client
469
- # on construction.
470
- #
471
- # @example
472
- #
473
- # # Modify the global config, setting the timeout for
474
- # # set_iam_policy to 20 seconds,
475
- # # and all remaining timeouts to 10 seconds.
476
- # ::Google::Cloud::PubSub::V1::IAMPolicy::Client.configure do |config|
477
- # config.timeout = 10.0
478
- # config.rpcs.set_iam_policy.timeout = 20.0
479
- # end
480
- #
481
- # # Apply the above configuration only to a new client.
482
- # client = ::Google::Cloud::PubSub::V1::IAMPolicy::Client.new do |config|
483
- # config.timeout = 10.0
484
- # config.rpcs.set_iam_policy.timeout = 20.0
485
- # end
486
- #
487
- # @!attribute [rw] endpoint
488
- # The hostname or hostname:port of the service endpoint.
489
- # Defaults to `"pubsub.googleapis.com"`.
490
- # @return [::String]
491
- # @!attribute [rw] credentials
492
- # Credentials to send with calls. You may provide any of the following types:
493
- # * (`String`) The path to a service account key file in JSON format
494
- # * (`Hash`) A service account key as a Hash
495
- # * (`Google::Auth::Credentials`) A googleauth credentials object
496
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
497
- # * (`Signet::OAuth2::Client`) A signet oauth2 client object
498
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
499
- # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
500
- # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
501
- # * (`nil`) indicating no credentials
502
- # @return [::Object]
503
- # @!attribute [rw] scope
504
- # The OAuth scopes
505
- # @return [::Array<::String>]
506
- # @!attribute [rw] lib_name
507
- # The library name as recorded in instrumentation and logging
508
- # @return [::String]
509
- # @!attribute [rw] lib_version
510
- # The library version as recorded in instrumentation and logging
511
- # @return [::String]
512
- # @!attribute [rw] channel_args
513
- # Extra parameters passed to the gRPC channel. Note: this is ignored if a
514
- # `GRPC::Core::Channel` object is provided as the credential.
515
- # @return [::Hash]
516
- # @!attribute [rw] interceptors
517
- # An array of interceptors that are run before calls are executed.
518
- # @return [::Array<::GRPC::ClientInterceptor>]
519
- # @!attribute [rw] timeout
520
- # The call timeout in seconds.
521
- # @return [::Numeric]
522
- # @!attribute [rw] metadata
523
- # Additional gRPC headers to be sent with the call.
524
- # @return [::Hash{::Symbol=>::String}]
525
- # @!attribute [rw] retry_policy
526
- # The retry policy. The value is a hash with the following keys:
527
- # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
528
- # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
529
- # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
530
- # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
531
- # trigger a retry.
532
- # @return [::Hash]
533
- # @!attribute [rw] quota_project
534
- # A separate project against which to charge quota.
535
- # @return [::String]
238
+ # @deprecated Call `iam_policy_client` on any of the other client
239
+ # objects to get a client for IAM policies instead of using this
240
+ # legacy class.
536
241
  #
537
242
  class Configuration
538
243
  extend ::Gapic::Config
@@ -561,8 +266,7 @@ module Google
561
266
  end
562
267
 
563
268
  ##
564
- # Configurations for individual RPCs
565
- # @return [Rpcs]
269
+ # @deprecated
566
270
  #
567
271
  def rpcs
568
272
  @rpcs ||= begin
@@ -573,36 +277,21 @@ module Google
573
277
  end
574
278
 
575
279
  ##
576
- # Configuration RPC class for the IAMPolicy API.
577
- #
578
- # Includes fields providing the configuration for each RPC in this service.
579
- # Each configuration object is of type `Gapic::Config::Method` and includes
580
- # the following configuration fields:
581
- #
582
- # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
583
- # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
584
- # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
585
- # include the following keys:
586
- # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
587
- # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
588
- # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
589
- # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
590
- # trigger a retry.
280
+ # @deprecated Call `iam_policy_client` on any of the other client
281
+ # objects to get a client for IAM policies instead of using this
282
+ # legacy class.
591
283
  #
592
284
  class Rpcs
593
285
  ##
594
- # RPC-specific configuration for `set_iam_policy`
595
- # @return [::Gapic::Config::Method]
286
+ # @deprecated
596
287
  #
597
288
  attr_reader :set_iam_policy
598
289
  ##
599
- # RPC-specific configuration for `get_iam_policy`
600
- # @return [::Gapic::Config::Method]
290
+ # @deprecated
601
291
  #
602
292
  attr_reader :get_iam_policy
603
293
  ##
604
- # RPC-specific configuration for `test_iam_permissions`
605
- # @return [::Gapic::Config::Method]
294
+ # @deprecated
606
295
  #
607
296
  attr_reader :test_iam_permissions
608
297
 
@@ -14,7 +14,7 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
 
17
- # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
17
+ # Originally auto-generated by gapic-generator-ruby.
18
18
 
19
19
  require "googleauth"
20
20
 
@@ -23,7 +23,11 @@ module Google
23
23
  module PubSub
24
24
  module V1
25
25
  module IAMPolicy
26
- # Credentials for the IAMPolicy API.
26
+ ##
27
+ # @deprecated Call `iam_policy_client` on any of the other client
28
+ # objects to get a client for IAM policies instead of using this
29
+ # legacy class.
30
+ #
27
31
  class Credentials < ::Google::Auth::Credentials
28
32
  self.scope = [
29
33
  "https://www.googleapis.com/auth/cloud-platform",
@@ -14,7 +14,7 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
 
17
- # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
17
+ # Originally auto-generated by gapic-generator-ruby.
18
18
 
19
19
  require "gapic/common"
20
20
  require "gapic/config"
@@ -30,37 +30,11 @@ module Google
30
30
  module PubSub
31
31
  module V1
32
32
  ##
33
- # API Overview
33
+ # This module contains the legacy IAM Policy client.
34
34
  #
35
- #
36
- # Manages Identity and Access Management (IAM) policies.
37
- #
38
- # Any implementation of an API that offers access control features
39
- # implements the google.iam.v1.IAMPolicy interface.
40
- #
41
- # ## Data model
42
- #
43
- # Access control is applied when a principal (user or service account), takes
44
- # some action on a resource exposed by a service. Resources, identified by
45
- # URI-like names, are the unit of access control specification. Service
46
- # implementations can choose the granularity of access control and the
47
- # supported permissions for their resources.
48
- # For example one database service may allow access control to be
49
- # specified only at the Table level, whereas another might allow access control
50
- # to also be specified at the Column level.
51
- #
52
- # ## Policy Structure
53
- #
54
- # See google.iam.v1.Policy
55
- #
56
- # This is intentionally not a CRUD style API because access control policies
57
- # are created and deleted implicitly with the resources to which they are
58
- # attached.
59
- #
60
- # To load this service and instantiate a client:
61
- #
62
- # require "google/cloud/pubsub/v1/iam_policy"
63
- # client = ::Google::Cloud::PubSub::V1::IAMPolicy::Client.new
35
+ # @deprecated Call `iam_policy_client` on any of the other client
36
+ # objects to get a client for IAM policies instead of using this
37
+ # legacy class.
64
38
  #
65
39
  module IAMPolicy
66
40
  end
@@ -18,6 +18,7 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/pubsub/v1/pubsub_pb"
21
+ require "google/iam/v1"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -179,6 +180,12 @@ module Google
179
180
  @quota_project_id = @config.quota_project
180
181
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
181
182
 
183
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
184
+ config.credentials = credentials
185
+ config.quota_project = @quota_project_id
186
+ config.endpoint = @config.endpoint
187
+ end
188
+
182
189
  @publisher_stub = ::Gapic::ServiceStub.new(
183
190
  ::Google::Cloud::PubSub::V1::Publisher::Stub,
184
191
  credentials: credentials,
@@ -188,6 +195,13 @@ module Google
188
195
  )
189
196
  end
190
197
 
198
+ ##
199
+ # Get the associated client for mix-in of the IAMPolicy.
200
+ #
201
+ # @return [Google::Iam::V1::IAMPolicy::Client]
202
+ #
203
+ attr_reader :iam_policy_client
204
+
191
205
  # Service calls
192
206
 
193
207
  ##
@@ -34,7 +34,7 @@ module Google
34
34
  # The service that an application uses to manipulate topics, and to send
35
35
  # messages to a topic.
36
36
  #
37
- # To load this service and instantiate a client:
37
+ # @example Load this service and instantiate a gRPC client
38
38
  #
39
39
  # require "google/cloud/pubsub/v1/publisher"
40
40
  # client = ::Google::Cloud::PubSub::V1::Publisher::Client.new
@@ -18,6 +18,7 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/pubsub/v1/schema_pb"
21
+ require "google/iam/v1"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -133,6 +134,12 @@ module Google
133
134
  @quota_project_id = @config.quota_project
134
135
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
135
136
 
137
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
138
+ config.credentials = credentials
139
+ config.quota_project = @quota_project_id
140
+ config.endpoint = @config.endpoint
141
+ end
142
+
136
143
  @schema_service_stub = ::Gapic::ServiceStub.new(
137
144
  ::Google::Cloud::PubSub::V1::SchemaService::Stub,
138
145
  credentials: credentials,
@@ -142,6 +149,13 @@ module Google
142
149
  )
143
150
  end
144
151
 
152
+ ##
153
+ # Get the associated client for mix-in of the IAMPolicy.
154
+ #
155
+ # @return [Google::Iam::V1::IAMPolicy::Client]
156
+ #
157
+ attr_reader :iam_policy_client
158
+
145
159
  # Service calls
146
160
 
147
161
  ##
@@ -33,7 +33,7 @@ module Google
33
33
  ##
34
34
  # Service for doing schema-related operations.
35
35
  #
36
- # To load this service and instantiate a client:
36
+ # @example Load this service and instantiate a gRPC client
37
37
  #
38
38
  # require "google/cloud/pubsub/v1/schema_service"
39
39
  # client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new