google-cloud-pubsub-v1 0.10.0 → 0.12.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: cca9d3319952549629377f2711733a83ebc7e7df2f0fc6252c807bf06abaadbb
4
- data.tar.gz: 33ee951144993321545c68373e1db7a349fcb788b581d1d69bbfccf113ff2a01
3
+ metadata.gz: d98ae127654ffa655c567eadff7dfc28cc131e68ac7716d40f68704d8f061118
4
+ data.tar.gz: d8da26f605fb01815b937f5fdc56634492c51157db87670e41b50f281e8c0eb6
5
5
  SHA512:
6
- metadata.gz: c09ad2ff9cb8f6b34879b4f8c3cd83a4f061efc2fec9c57ef101f542cfae5cadbeed8d20273613f5bb2be7d7a5934b7951d2c12ed7df67ed6d81515c53b82c66
7
- data.tar.gz: b7ceb6290a46805732d3732ea44fdb63875ba21ff192ad08da34796cdbc2c85b6f7e7d4879e79f0316f6886b400470493498c72446fc588529f16c5eb3e90aee
6
+ metadata.gz: f04d0ec694b3cebd2daaa541a0295aa212b8eaad7d939d7222219358e3acc69e44d6f5f2f11e1a717c45cce3d34fad165a11c86341ff8d46bdcaaef1a50194e5
7
+ data.tar.gz: 95d5cb21ecc54d183846406d5546508c6f496a65390c3461420cbf9b477c22a34c1f18bcd0134c6377e1feb9189d99c9ea756a6ba65f6571b7918faaeb298843
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
@@ -76,14 +76,14 @@ To browse ready to use code samples check [Google Cloud Samples](https://cloud.g
76
76
 
77
77
  ## Supported Ruby Versions
78
78
 
79
- This library is supported on Ruby 2.5+.
79
+ This library is supported on Ruby 2.6+.
80
80
 
81
81
  Google provides official support for Ruby versions that are actively supported
82
82
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
83
- in security maintenance, and not end of life. Currently, this means Ruby 2.5
84
- and later. Older versions of Ruby _may_ still work, but are unsupported and not
85
- recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
86
- about the Ruby support schedule.
83
+ in security maintenance, and not end of life. Older versions of Ruby _may_
84
+ still work, but are unsupported and not recommended. See
85
+ https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
86
+ support schedule.
87
87
 
88
88
  ## Which client should I use?
89
89
 
@@ -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
  ##
@@ -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
  ##