google-iam-v1 0.3.beta.1 → 0.3.beta.3

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: '0208d232d05d383c20892f9525be07737ea6fd36054f85c88acd5cca7f2f8c3a'
4
- data.tar.gz: f3a9227c16050722e560c02172aee7e3273d1b3a883dc520b8494a50c6597263
3
+ metadata.gz: a3b5442316ad0d97c6e4ea7fc9e0599e4a3782b91fec0c0da55e9fb7ea0ea86a
4
+ data.tar.gz: 123d76256489bf1522530d1c22f5a1784e1ffb53fc5d4d89304ee49b77fad463
5
5
  SHA512:
6
- metadata.gz: 2fa9c5d718e270132b34a11b67aacb8c81a64dd134363705fe5228d9041f5e8e37439dccb360174938909881be1ffb44dac29b9fddb1db2c5846c5261563c13b
7
- data.tar.gz: b9d57d064deddeccc5ad0bfd3745fd97b8dbf0695220f47aa7aab0d906c91c50b2e9a9b92c028039b066a6e417c0d5ed7b9b00a2f1045b45be2ac56b9d6f2f1c
6
+ metadata.gz: 0e8c655e87db2835cfc942b64258a2cdfdd3ebdf4514b764e4cd7ad15f2dacb2fee1586504c443ed7fe9686416580a3b08b469074ec93a59a44f06c311771ebd
7
+ data.tar.gz: b42f06925d6b80cbe11fb5637cb007e273a245bae7cffdc1db9e3ff0f9891c516da92487e65c7eda010463a95722c5cf3bc38cd0093127df91020ac58e9fad78
@@ -226,16 +226,14 @@ module Google
226
226
  metadata: @config.metadata,
227
227
  retry_policy: @config.retry_policy
228
228
 
229
- @iam_policy_stub.set_iam_policy request, options do |result, response|
229
+ bindings_override = @config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"]
230
+
231
+ @iam_policy_stub.set_iam_policy request, options, bindings_override: bindings_override do |result, response|
230
232
  yield result, response if block_given?
231
233
  return result
232
234
  end
233
- rescue ::Faraday::Error => e
234
- begin
235
- raise ::Gapic::Rest::Error.wrap_faraday_error e
236
- rescue ::Gapic::Rest::Error => gapic_error
237
- raise ::Google::Cloud::Error.from_error gapic_error
238
- end
235
+ rescue ::Gapic::Rest::Error => e
236
+ raise ::Google::Cloud::Error.from_error(e)
239
237
  end
240
238
 
241
239
  ##
@@ -298,16 +296,14 @@ module Google
298
296
  metadata: @config.metadata,
299
297
  retry_policy: @config.retry_policy
300
298
 
301
- @iam_policy_stub.get_iam_policy request, options do |result, response|
299
+ bindings_override = @config.bindings_override["google.iam.v1.IAMPolicy.GetIamPolicy"]
300
+
301
+ @iam_policy_stub.get_iam_policy request, options, bindings_override: bindings_override do |result, response|
302
302
  yield result, response if block_given?
303
303
  return result
304
304
  end
305
- rescue ::Faraday::Error => e
306
- begin
307
- raise ::Gapic::Rest::Error.wrap_faraday_error e
308
- rescue ::Gapic::Rest::Error => gapic_error
309
- raise ::Google::Cloud::Error.from_error gapic_error
310
- end
305
+ rescue ::Gapic::Rest::Error => e
306
+ raise ::Google::Cloud::Error.from_error(e)
311
307
  end
312
308
 
313
309
  ##
@@ -376,16 +372,14 @@ module Google
376
372
  metadata: @config.metadata,
377
373
  retry_policy: @config.retry_policy
378
374
 
379
- @iam_policy_stub.test_iam_permissions request, options do |result, response|
375
+ bindings_override = @config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"]
376
+
377
+ @iam_policy_stub.test_iam_permissions request, options, bindings_override: bindings_override do |result, response|
380
378
  yield result, response if block_given?
381
379
  return result
382
380
  end
383
- rescue ::Faraday::Error => e
384
- begin
385
- raise ::Gapic::Rest::Error.wrap_faraday_error e
386
- rescue ::Gapic::Rest::Error => gapic_error
387
- raise ::Google::Cloud::Error.from_error gapic_error
388
- end
381
+ rescue ::Gapic::Rest::Error => e
382
+ raise ::Google::Cloud::Error.from_error(e)
389
383
  end
390
384
 
391
385
  ##
@@ -474,6 +468,13 @@ module Google
474
468
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
475
469
  config_attr :quota_project, nil, ::String, nil
476
470
 
471
+ # @private
472
+ # Overrides for http bindings for the RPCs of this service
473
+ # are only used when this service is used as mixin, and only
474
+ # by the host service.
475
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
476
+ config_attr :bindings_override, {}, ::Hash, nil
477
+
477
478
  # @private
478
479
  def initialize parent_config = nil
479
480
  @parent_config = parent_config unless parent_config.nil?
@@ -34,7 +34,9 @@ module Google
34
34
  # the REST modules only when it's required.
35
35
  require "gapic/rest"
36
36
 
37
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, numeric_enums: false
37
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ numeric_enums: false,
39
+ raise_faraday_errors: false
38
40
  end
39
41
 
40
42
  ##
@@ -44,6 +46,8 @@ module Google
44
46
  # A request object representing the call parameters. Required.
45
47
  # @param options [::Gapic::CallOptions]
46
48
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
49
+ # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil]
50
+ # Binding overrides for the transcoding. Only used internally.
47
51
  #
48
52
  # @yield [result, response] Access the result along with the Faraday response object
49
53
  # @yieldparam result [::Google::Iam::V1::Policy]
@@ -51,10 +55,10 @@ module Google
51
55
  #
52
56
  # @return [::Google::Iam::V1::Policy]
53
57
  # A result object deserialized from the server's reply
54
- def set_iam_policy request_pb, options = nil
58
+ def set_iam_policy request_pb, options = nil, bindings_override: nil
55
59
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
56
60
 
57
- verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb
61
+ verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb, bindings_override: bindings_override
58
62
  query_string_params = if query_string_params.any?
59
63
  query_string_params.to_h { |p| p.split("=", 2) }
60
64
  else
@@ -81,6 +85,8 @@ module Google
81
85
  # A request object representing the call parameters. Required.
82
86
  # @param options [::Gapic::CallOptions]
83
87
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
88
+ # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil]
89
+ # Binding overrides for the transcoding. Only used internally.
84
90
  #
85
91
  # @yield [result, response] Access the result along with the Faraday response object
86
92
  # @yieldparam result [::Google::Iam::V1::Policy]
@@ -88,10 +94,10 @@ module Google
88
94
  #
89
95
  # @return [::Google::Iam::V1::Policy]
90
96
  # A result object deserialized from the server's reply
91
- def get_iam_policy request_pb, options = nil
97
+ def get_iam_policy request_pb, options = nil, bindings_override: nil
92
98
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
93
99
 
94
- verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb
100
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb, bindings_override: bindings_override
95
101
  query_string_params = if query_string_params.any?
96
102
  query_string_params.to_h { |p| p.split("=", 2) }
97
103
  else
@@ -118,6 +124,8 @@ module Google
118
124
  # A request object representing the call parameters. Required.
119
125
  # @param options [::Gapic::CallOptions]
120
126
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
127
+ # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil]
128
+ # Binding overrides for the transcoding. Only used internally.
121
129
  #
122
130
  # @yield [result, response] Access the result along with the Faraday response object
123
131
  # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
@@ -125,10 +133,10 @@ module Google
125
133
  #
126
134
  # @return [::Google::Iam::V1::TestIamPermissionsResponse]
127
135
  # A result object deserialized from the server's reply
128
- def test_iam_permissions request_pb, options = nil
136
+ def test_iam_permissions request_pb, options = nil, bindings_override: nil
129
137
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
130
138
 
131
- verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb
139
+ verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb, bindings_override: bindings_override
132
140
  query_string_params = if query_string_params.any?
133
141
  query_string_params.to_h { |p| p.split("=", 2) }
134
142
  else
@@ -155,18 +163,21 @@ module Google
155
163
  #
156
164
  # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest]
157
165
  # A request object representing the call parameters. Required.
166
+ # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil]
167
+ # Binding overrides for the transcoding.
158
168
  # @return [Array(String, [String, nil], Hash{String => String})]
159
169
  # Uri, Body, Query string parameters
160
- def self.transcode_set_iam_policy_request request_pb
161
- transcoder = Gapic::Rest::GrpcTranscoder.new
162
- .with_bindings(
163
- uri_method: :post,
164
- uri_template: "/v1/{resource}:setIamPolicy",
165
- body: "*",
166
- matches: [
167
- ["resource", %r{^.*$}, true]
168
- ]
169
- )
170
+ def self.transcode_set_iam_policy_request request_pb, bindings_override: nil
171
+ transcoder = Gapic::Rest::GrpcTranscoder.new(bindings_override) if bindings_override
172
+ transcoder ||= Gapic::Rest::GrpcTranscoder.new
173
+ .with_bindings(
174
+ uri_method: :post,
175
+ uri_template: "/v1/{resource}:setIamPolicy",
176
+ body: "*",
177
+ matches: [
178
+ ["resource", %r{^.*$}, true]
179
+ ]
180
+ )
170
181
  transcoder.transcode request_pb
171
182
  end
172
183
 
@@ -177,18 +188,21 @@ module Google
177
188
  #
178
189
  # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest]
179
190
  # A request object representing the call parameters. Required.
191
+ # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil]
192
+ # Binding overrides for the transcoding.
180
193
  # @return [Array(String, [String, nil], Hash{String => String})]
181
194
  # Uri, Body, Query string parameters
182
- def self.transcode_get_iam_policy_request request_pb
183
- transcoder = Gapic::Rest::GrpcTranscoder.new
184
- .with_bindings(
185
- uri_method: :post,
186
- uri_template: "/v1/{resource}:getIamPolicy",
187
- body: "*",
188
- matches: [
189
- ["resource", %r{^.*$}, true]
190
- ]
191
- )
195
+ def self.transcode_get_iam_policy_request request_pb, bindings_override: nil
196
+ transcoder = Gapic::Rest::GrpcTranscoder.new(bindings_override) if bindings_override
197
+ transcoder ||= Gapic::Rest::GrpcTranscoder.new
198
+ .with_bindings(
199
+ uri_method: :post,
200
+ uri_template: "/v1/{resource}:getIamPolicy",
201
+ body: "*",
202
+ matches: [
203
+ ["resource", %r{^.*$}, true]
204
+ ]
205
+ )
192
206
  transcoder.transcode request_pb
193
207
  end
194
208
 
@@ -199,18 +213,21 @@ module Google
199
213
  #
200
214
  # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest]
201
215
  # A request object representing the call parameters. Required.
216
+ # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil]
217
+ # Binding overrides for the transcoding.
202
218
  # @return [Array(String, [String, nil], Hash{String => String})]
203
219
  # Uri, Body, Query string parameters
204
- def self.transcode_test_iam_permissions_request request_pb
205
- transcoder = Gapic::Rest::GrpcTranscoder.new
206
- .with_bindings(
207
- uri_method: :post,
208
- uri_template: "/v1/{resource}:testIamPermissions",
209
- body: "*",
210
- matches: [
211
- ["resource", %r{^.*$}, true]
212
- ]
213
- )
220
+ def self.transcode_test_iam_permissions_request request_pb, bindings_override: nil
221
+ transcoder = Gapic::Rest::GrpcTranscoder.new(bindings_override) if bindings_override
222
+ transcoder ||= Gapic::Rest::GrpcTranscoder.new
223
+ .with_bindings(
224
+ uri_method: :post,
225
+ uri_template: "/v1/{resource}:testIamPermissions",
226
+ body: "*",
227
+ matches: [
228
+ ["resource", %r{^.*$}, true]
229
+ ]
230
+ )
214
231
  transcoder.transcode request_pb
215
232
  end
216
233
  end
@@ -57,12 +57,12 @@ module Google
57
57
  # are created and deleted implicitly with the resources to which they are
58
58
  # attached.
59
59
  #
60
- # To load this service and instantiate a GRPC client:
60
+ # @example Load this service and instantiate a gRPC client
61
61
  #
62
62
  # require "google/iam/v1/iam_policy"
63
63
  # client = ::Google::Iam::V1::IAMPolicy::Client.new
64
64
  #
65
- # To load this service and instantiate a REST client:
65
+ # @example Load this service and instantiate a REST client
66
66
  #
67
67
  # require "google/iam/v1/iam_policy/rest"
68
68
  # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Iam
22
22
  module V1
23
- VERSION = "0.3.beta.1"
23
+ VERSION = "0.3.beta.3"
24
24
  end
25
25
  end
26
26
  end
data/lib/google/iam/v1.rb CHANGED
@@ -22,17 +22,14 @@ require "google/iam/v1/version"
22
22
  module Google
23
23
  module Iam
24
24
  ##
25
- # To load this package, including all its services, and instantiate a GRPC client:
25
+ # API client module.
26
26
  #
27
- # @example
27
+ # @example Load this package, including all its services, and instantiate a gRPC client
28
28
  #
29
29
  # require "google/iam/v1"
30
30
  # client = ::Google::Iam::V1::IAMPolicy::Client.new
31
31
  #
32
- ##
33
- # To load this package, including all its services, and instantiate a REST client:
34
- #
35
- # @example
32
+ # @example Load this package, including all its services, and instantiate a REST client
36
33
  #
37
34
  # require "google/iam/v1"
38
35
  # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-iam-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.beta.1
4
+ version: 0.3.beta.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-08 00:00:00.000000000 Z
11
+ date: 2022-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.12'
19
+ version: 0.16.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.12'
29
+ version: 0.16.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a