google-iam-v2 0.6.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -20
- data/lib/google/iam/v2/policies/client.rb +31 -6
- data/lib/google/iam/v2/policies/operations.rb +9 -5
- data/lib/google/iam/v2/policies/rest/client.rb +31 -6
- data/lib/google/iam/v2/policies/rest/operations.rb +40 -28
- data/lib/google/iam/v2/policies/rest/service_stub.rb +54 -32
- data/lib/google/iam/v2/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bb33dd2d324db645bd9448b8b1c6fba86f1e6f96bd335fc25c7d8c3acb7bedc
|
4
|
+
data.tar.gz: e0620271b616d7d0a81f1758ae4e4be785ffb483b74628329ba6514882f0dbf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8aaddae04373d0b2310a73276ccac976b5a7c3fa5c52d0e849ab736e8f1ea84a2c36e75615b9fbe51023ffa5d1d4771374f5d283b9bb1cc1afe219d0639d4297
|
7
|
+
data.tar.gz: 58c28591974193b873f0f42036f8b17b54e70d7ca950577327fad169805f7d4ba1f0b1ea19d17b87c25e91cd578acd79505aa6d66a540c77e4a315e4b3b5733e
|
data/README.md
CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
|
|
43
43
|
See also the [Product Documentation](https://cloud.google.com/iam)
|
44
44
|
for general usage information.
|
45
45
|
|
46
|
-
##
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
## Debug Logging
|
47
|
+
|
48
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
49
|
+
your application's integration with the API. When logging is activated, key
|
50
|
+
events such as requests and responses, along with data payloads and metadata
|
51
|
+
such as headers and client configuration, are logged to the standard error
|
52
|
+
stream.
|
53
|
+
|
54
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
55
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
56
|
+
customers, private keys, or other security data that could be compromising if
|
57
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
58
|
+
the principle of least access. Google also recommends that Client Library Debug
|
59
|
+
Logging be enabled only temporarily during active debugging, and not used
|
60
|
+
permanently in production.
|
61
|
+
|
62
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
63
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
64
|
+
list of client library gem names. This will select the default logging behavior,
|
65
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
66
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
67
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
68
|
+
results in logs appearing alongside your application logs in the
|
69
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
70
|
+
|
71
|
+
You can customize logging by modifying the `logger` configuration when
|
72
|
+
constructing a client object. For example:
|
55
73
|
|
56
74
|
```ruby
|
75
|
+
require "google/iam/v2"
|
57
76
|
require "logger"
|
58
77
|
|
59
|
-
|
60
|
-
|
61
|
-
def logger
|
62
|
-
LOGGER
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
67
|
-
module GRPC
|
68
|
-
extend MyLogger
|
78
|
+
client = ::Google::Iam::V2::Policies::Client.new do |config|
|
79
|
+
config.logger = Logger.new "my-app.log"
|
69
80
|
end
|
70
81
|
```
|
71
82
|
|
72
|
-
|
73
83
|
## Google Cloud Samples
|
74
84
|
|
75
85
|
To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
|
@@ -186,8 +186,19 @@ module Google
|
|
186
186
|
universe_domain: @config.universe_domain,
|
187
187
|
channel_args: @config.channel_args,
|
188
188
|
interceptors: @config.interceptors,
|
189
|
-
channel_pool_config: @config.channel_pool
|
189
|
+
channel_pool_config: @config.channel_pool,
|
190
|
+
logger: @config.logger
|
190
191
|
)
|
192
|
+
|
193
|
+
@policies_stub.stub_logger&.info do |entry|
|
194
|
+
entry.set_system_name
|
195
|
+
entry.set_service
|
196
|
+
entry.message = "Created client for #{entry.service}"
|
197
|
+
entry.set_credentials_fields credentials
|
198
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
199
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
200
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
201
|
+
end
|
191
202
|
end
|
192
203
|
|
193
204
|
##
|
@@ -197,6 +208,15 @@ module Google
|
|
197
208
|
#
|
198
209
|
attr_reader :operations_client
|
199
210
|
|
211
|
+
##
|
212
|
+
# The logger used for request/response debug logging.
|
213
|
+
#
|
214
|
+
# @return [Logger]
|
215
|
+
#
|
216
|
+
def logger
|
217
|
+
@policies_stub.logger
|
218
|
+
end
|
219
|
+
|
200
220
|
# Service calls
|
201
221
|
|
202
222
|
##
|
@@ -305,7 +325,7 @@ module Google
|
|
305
325
|
@policies_stub.call_rpc :list_policies, request, options: options do |response, operation|
|
306
326
|
response = ::Gapic::PagedEnumerable.new @policies_stub, :list_policies, request, response, operation, options
|
307
327
|
yield response, operation if block_given?
|
308
|
-
|
328
|
+
throw :response, response
|
309
329
|
end
|
310
330
|
rescue ::GRPC::BadStatus => e
|
311
331
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -400,7 +420,6 @@ module Google
|
|
400
420
|
|
401
421
|
@policies_stub.call_rpc :get_policy, request, options: options do |response, operation|
|
402
422
|
yield response, operation if block_given?
|
403
|
-
return response
|
404
423
|
end
|
405
424
|
rescue ::GRPC::BadStatus => e
|
406
425
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -511,7 +530,7 @@ module Google
|
|
511
530
|
@policies_stub.call_rpc :create_policy, request, options: options do |response, operation|
|
512
531
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
513
532
|
yield response, operation if block_given?
|
514
|
-
|
533
|
+
throw :response, response
|
515
534
|
end
|
516
535
|
rescue ::GRPC::BadStatus => e
|
517
536
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -619,7 +638,7 @@ module Google
|
|
619
638
|
@policies_stub.call_rpc :update_policy, request, options: options do |response, operation|
|
620
639
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
621
640
|
yield response, operation if block_given?
|
622
|
-
|
641
|
+
throw :response, response
|
623
642
|
end
|
624
643
|
rescue ::GRPC::BadStatus => e
|
625
644
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -729,7 +748,7 @@ module Google
|
|
729
748
|
@policies_stub.call_rpc :delete_policy, request, options: options do |response, operation|
|
730
749
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
731
750
|
yield response, operation if block_given?
|
732
|
-
|
751
|
+
throw :response, response
|
733
752
|
end
|
734
753
|
rescue ::GRPC::BadStatus => e
|
735
754
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -818,6 +837,11 @@ module Google
|
|
818
837
|
# default endpoint URL. The default value of nil uses the environment
|
819
838
|
# universe (usually the default "googleapis.com" universe).
|
820
839
|
# @return [::String,nil]
|
840
|
+
# @!attribute [rw] logger
|
841
|
+
# A custom logger to use for request/response debug logging, or the value
|
842
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
843
|
+
# explicitly disable logging.
|
844
|
+
# @return [::Logger,:default,nil]
|
821
845
|
#
|
822
846
|
class Configuration
|
823
847
|
extend ::Gapic::Config
|
@@ -842,6 +866,7 @@ module Google
|
|
842
866
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
843
867
|
config_attr :quota_project, nil, ::String, nil
|
844
868
|
config_attr :universe_domain, nil, ::String, nil
|
869
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
845
870
|
|
846
871
|
# @private
|
847
872
|
def initialize parent_config = nil
|
@@ -212,7 +212,7 @@ module Google
|
|
212
212
|
wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
|
213
213
|
response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
|
214
214
|
yield response, operation if block_given?
|
215
|
-
|
215
|
+
throw :response, response
|
216
216
|
end
|
217
217
|
rescue ::GRPC::BadStatus => e
|
218
218
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -308,7 +308,7 @@ module Google
|
|
308
308
|
@operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
|
309
309
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
310
310
|
yield response, operation if block_given?
|
311
|
-
|
311
|
+
throw :response, response
|
312
312
|
end
|
313
313
|
rescue ::GRPC::BadStatus => e
|
314
314
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -397,7 +397,6 @@ module Google
|
|
397
397
|
|
398
398
|
@operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
|
399
399
|
yield response, operation if block_given?
|
400
|
-
return response
|
401
400
|
end
|
402
401
|
rescue ::GRPC::BadStatus => e
|
403
402
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -493,7 +492,6 @@ module Google
|
|
493
492
|
|
494
493
|
@operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
|
495
494
|
yield response, operation if block_given?
|
496
|
-
return response
|
497
495
|
end
|
498
496
|
rescue ::GRPC::BadStatus => e
|
499
497
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -591,7 +589,7 @@ module Google
|
|
591
589
|
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
592
590
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
593
591
|
yield response, operation if block_given?
|
594
|
-
|
592
|
+
throw :response, response
|
595
593
|
end
|
596
594
|
rescue ::GRPC::BadStatus => e
|
597
595
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -680,6 +678,11 @@ module Google
|
|
680
678
|
# default endpoint URL. The default value of nil uses the environment
|
681
679
|
# universe (usually the default "googleapis.com" universe).
|
682
680
|
# @return [::String,nil]
|
681
|
+
# @!attribute [rw] logger
|
682
|
+
# A custom logger to use for request/response debug logging, or the value
|
683
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
684
|
+
# explicitly disable logging.
|
685
|
+
# @return [::Logger,:default,nil]
|
683
686
|
#
|
684
687
|
class Configuration
|
685
688
|
extend ::Gapic::Config
|
@@ -704,6 +707,7 @@ module Google
|
|
704
707
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
705
708
|
config_attr :quota_project, nil, ::String, nil
|
706
709
|
config_attr :universe_domain, nil, ::String, nil
|
710
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
707
711
|
|
708
712
|
# @private
|
709
713
|
def initialize parent_config = nil
|
@@ -179,8 +179,19 @@ module Google
|
|
179
179
|
endpoint: @config.endpoint,
|
180
180
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
181
181
|
universe_domain: @config.universe_domain,
|
182
|
-
credentials: credentials
|
182
|
+
credentials: credentials,
|
183
|
+
logger: @config.logger
|
183
184
|
)
|
185
|
+
|
186
|
+
@policies_stub.logger(stub: true)&.info do |entry|
|
187
|
+
entry.set_system_name
|
188
|
+
entry.set_service
|
189
|
+
entry.message = "Created client for #{entry.service}"
|
190
|
+
entry.set_credentials_fields credentials
|
191
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
192
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
193
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
194
|
+
end
|
184
195
|
end
|
185
196
|
|
186
197
|
##
|
@@ -190,6 +201,15 @@ module Google
|
|
190
201
|
#
|
191
202
|
attr_reader :operations_client
|
192
203
|
|
204
|
+
##
|
205
|
+
# The logger used for request/response debug logging.
|
206
|
+
#
|
207
|
+
# @return [Logger]
|
208
|
+
#
|
209
|
+
def logger
|
210
|
+
@policies_stub.logger
|
211
|
+
end
|
212
|
+
|
193
213
|
# Service calls
|
194
214
|
|
195
215
|
##
|
@@ -291,7 +311,7 @@ module Google
|
|
291
311
|
@policies_stub.list_policies request, options do |result, operation|
|
292
312
|
result = ::Gapic::Rest::PagedEnumerable.new @policies_stub, :list_policies, "policies", request, result, options
|
293
313
|
yield result, operation if block_given?
|
294
|
-
|
314
|
+
throw :response, result
|
295
315
|
end
|
296
316
|
rescue ::Gapic::Rest::Error => e
|
297
317
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -379,7 +399,6 @@ module Google
|
|
379
399
|
|
380
400
|
@policies_stub.get_policy request, options do |result, operation|
|
381
401
|
yield result, operation if block_given?
|
382
|
-
return result
|
383
402
|
end
|
384
403
|
rescue ::Gapic::Rest::Error => e
|
385
404
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -483,7 +502,7 @@ module Google
|
|
483
502
|
@policies_stub.create_policy request, options do |result, operation|
|
484
503
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
485
504
|
yield result, operation if block_given?
|
486
|
-
|
505
|
+
throw :response, result
|
487
506
|
end
|
488
507
|
rescue ::Gapic::Rest::Error => e
|
489
508
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -584,7 +603,7 @@ module Google
|
|
584
603
|
@policies_stub.update_policy request, options do |result, operation|
|
585
604
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
586
605
|
yield result, operation if block_given?
|
587
|
-
|
606
|
+
throw :response, result
|
588
607
|
end
|
589
608
|
rescue ::Gapic::Rest::Error => e
|
590
609
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -687,7 +706,7 @@ module Google
|
|
687
706
|
@policies_stub.delete_policy request, options do |result, operation|
|
688
707
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
689
708
|
yield result, operation if block_given?
|
690
|
-
|
709
|
+
throw :response, result
|
691
710
|
end
|
692
711
|
rescue ::Gapic::Rest::Error => e
|
693
712
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -767,6 +786,11 @@ module Google
|
|
767
786
|
# default endpoint URL. The default value of nil uses the environment
|
768
787
|
# universe (usually the default "googleapis.com" universe).
|
769
788
|
# @return [::String,nil]
|
789
|
+
# @!attribute [rw] logger
|
790
|
+
# A custom logger to use for request/response debug logging, or the value
|
791
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
792
|
+
# explicitly disable logging.
|
793
|
+
# @return [::Logger,:default,nil]
|
770
794
|
#
|
771
795
|
class Configuration
|
772
796
|
extend ::Gapic::Config
|
@@ -788,6 +812,7 @@ module Google
|
|
788
812
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
789
813
|
config_attr :quota_project, nil, ::String, nil
|
790
814
|
config_attr :universe_domain, nil, ::String, nil
|
815
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
791
816
|
|
792
817
|
# @private
|
793
818
|
def initialize parent_config = nil
|
@@ -195,7 +195,7 @@ module Google
|
|
195
195
|
@operations_stub.list_operations request, options do |result, operation|
|
196
196
|
result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
|
197
197
|
yield result, operation if block_given?
|
198
|
-
|
198
|
+
throw :response, result
|
199
199
|
end
|
200
200
|
rescue ::Gapic::Rest::Error => e
|
201
201
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -284,7 +284,7 @@ module Google
|
|
284
284
|
@operations_stub.get_operation request, options do |result, operation|
|
285
285
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
286
286
|
yield result, operation if block_given?
|
287
|
-
|
287
|
+
throw :response, result
|
288
288
|
end
|
289
289
|
rescue ::Gapic::Rest::Error => e
|
290
290
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -366,7 +366,6 @@ module Google
|
|
366
366
|
|
367
367
|
@operations_stub.delete_operation request, options do |result, operation|
|
368
368
|
yield result, operation if block_given?
|
369
|
-
return result
|
370
369
|
end
|
371
370
|
rescue ::Gapic::Rest::Error => e
|
372
371
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -455,7 +454,6 @@ module Google
|
|
455
454
|
|
456
455
|
@operations_stub.cancel_operation request, options do |result, operation|
|
457
456
|
yield result, operation if block_given?
|
458
|
-
return result
|
459
457
|
end
|
460
458
|
rescue ::Gapic::Rest::Error => e
|
461
459
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -535,6 +533,11 @@ module Google
|
|
535
533
|
# default endpoint URL. The default value of nil uses the environment
|
536
534
|
# universe (usually the default "googleapis.com" universe).
|
537
535
|
# @return [::String,nil]
|
536
|
+
# @!attribute [rw] logger
|
537
|
+
# A custom logger to use for request/response debug logging, or the value
|
538
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
539
|
+
# explicitly disable logging.
|
540
|
+
# @return [::Logger,:default,nil]
|
538
541
|
#
|
539
542
|
class Configuration
|
540
543
|
extend ::Gapic::Config
|
@@ -556,6 +559,7 @@ module Google
|
|
556
559
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
557
560
|
config_attr :quota_project, nil, ::String, nil
|
558
561
|
config_attr :universe_domain, nil, ::String, nil
|
562
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
559
563
|
|
560
564
|
# @private
|
561
565
|
def initialize parent_config = nil
|
@@ -675,16 +679,18 @@ module Google
|
|
675
679
|
|
676
680
|
response = @client_stub.make_http_request(
|
677
681
|
verb,
|
678
|
-
uri:
|
679
|
-
body:
|
680
|
-
params:
|
682
|
+
uri: uri,
|
683
|
+
body: body || "",
|
684
|
+
params: query_string_params,
|
685
|
+
method_name: "list_operations",
|
681
686
|
options: options
|
682
687
|
)
|
683
688
|
operation = ::Gapic::Rest::TransportOperation.new response
|
684
689
|
result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
|
685
|
-
|
686
|
-
|
687
|
-
|
690
|
+
catch :response do
|
691
|
+
yield result, operation if block_given?
|
692
|
+
result
|
693
|
+
end
|
688
694
|
end
|
689
695
|
|
690
696
|
##
|
@@ -713,16 +719,18 @@ module Google
|
|
713
719
|
|
714
720
|
response = @client_stub.make_http_request(
|
715
721
|
verb,
|
716
|
-
uri:
|
717
|
-
body:
|
718
|
-
params:
|
722
|
+
uri: uri,
|
723
|
+
body: body || "",
|
724
|
+
params: query_string_params,
|
725
|
+
method_name: "get_operation",
|
719
726
|
options: options
|
720
727
|
)
|
721
728
|
operation = ::Gapic::Rest::TransportOperation.new response
|
722
729
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
723
|
-
|
724
|
-
|
725
|
-
|
730
|
+
catch :response do
|
731
|
+
yield result, operation if block_given?
|
732
|
+
result
|
733
|
+
end
|
726
734
|
end
|
727
735
|
|
728
736
|
##
|
@@ -751,16 +759,18 @@ module Google
|
|
751
759
|
|
752
760
|
response = @client_stub.make_http_request(
|
753
761
|
verb,
|
754
|
-
uri:
|
755
|
-
body:
|
756
|
-
params:
|
762
|
+
uri: uri,
|
763
|
+
body: body || "",
|
764
|
+
params: query_string_params,
|
765
|
+
method_name: "delete_operation",
|
757
766
|
options: options
|
758
767
|
)
|
759
768
|
operation = ::Gapic::Rest::TransportOperation.new response
|
760
769
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
761
|
-
|
762
|
-
|
763
|
-
|
770
|
+
catch :response do
|
771
|
+
yield result, operation if block_given?
|
772
|
+
result
|
773
|
+
end
|
764
774
|
end
|
765
775
|
|
766
776
|
##
|
@@ -789,16 +799,18 @@ module Google
|
|
789
799
|
|
790
800
|
response = @client_stub.make_http_request(
|
791
801
|
verb,
|
792
|
-
uri:
|
793
|
-
body:
|
794
|
-
params:
|
802
|
+
uri: uri,
|
803
|
+
body: body || "",
|
804
|
+
params: query_string_params,
|
805
|
+
method_name: "cancel_operation",
|
795
806
|
options: options
|
796
807
|
)
|
797
808
|
operation = ::Gapic::Rest::TransportOperation.new response
|
798
809
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
799
|
-
|
800
|
-
|
801
|
-
|
810
|
+
catch :response do
|
811
|
+
yield result, operation if block_given?
|
812
|
+
result
|
813
|
+
end
|
802
814
|
end
|
803
815
|
|
804
816
|
##
|
@@ -29,7 +29,8 @@ module Google
|
|
29
29
|
# including transcoding, making the REST call, and deserialing the response.
|
30
30
|
#
|
31
31
|
class ServiceStub
|
32
|
-
|
32
|
+
# @private
|
33
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
|
33
34
|
# These require statements are intentionally placed here to initialize
|
34
35
|
# the REST modules only when it's required.
|
35
36
|
require "gapic/rest"
|
@@ -39,7 +40,9 @@ module Google
|
|
39
40
|
universe_domain: universe_domain,
|
40
41
|
credentials: credentials,
|
41
42
|
numeric_enums: true,
|
42
|
-
|
43
|
+
service_name: self.class,
|
44
|
+
raise_faraday_errors: false,
|
45
|
+
logger: logger
|
43
46
|
end
|
44
47
|
|
45
48
|
##
|
@@ -60,6 +63,15 @@ module Google
|
|
60
63
|
@client_stub.endpoint
|
61
64
|
end
|
62
65
|
|
66
|
+
##
|
67
|
+
# The logger used for request/response debug logging.
|
68
|
+
#
|
69
|
+
# @return [Logger]
|
70
|
+
#
|
71
|
+
def logger stub: false
|
72
|
+
stub ? @client_stub.stub_logger : @client_stub.logger
|
73
|
+
end
|
74
|
+
|
63
75
|
##
|
64
76
|
# Baseline implementation for the list_policies REST call
|
65
77
|
#
|
@@ -86,16 +98,18 @@ module Google
|
|
86
98
|
|
87
99
|
response = @client_stub.make_http_request(
|
88
100
|
verb,
|
89
|
-
uri:
|
90
|
-
body:
|
91
|
-
params:
|
101
|
+
uri: uri,
|
102
|
+
body: body || "",
|
103
|
+
params: query_string_params,
|
104
|
+
method_name: "list_policies",
|
92
105
|
options: options
|
93
106
|
)
|
94
107
|
operation = ::Gapic::Rest::TransportOperation.new response
|
95
108
|
result = ::Google::Iam::V2::ListPoliciesResponse.decode_json response.body, ignore_unknown_fields: true
|
96
|
-
|
97
|
-
|
98
|
-
|
109
|
+
catch :response do
|
110
|
+
yield result, operation if block_given?
|
111
|
+
result
|
112
|
+
end
|
99
113
|
end
|
100
114
|
|
101
115
|
##
|
@@ -124,16 +138,18 @@ module Google
|
|
124
138
|
|
125
139
|
response = @client_stub.make_http_request(
|
126
140
|
verb,
|
127
|
-
uri:
|
128
|
-
body:
|
129
|
-
params:
|
141
|
+
uri: uri,
|
142
|
+
body: body || "",
|
143
|
+
params: query_string_params,
|
144
|
+
method_name: "get_policy",
|
130
145
|
options: options
|
131
146
|
)
|
132
147
|
operation = ::Gapic::Rest::TransportOperation.new response
|
133
148
|
result = ::Google::Iam::V2::Policy.decode_json response.body, ignore_unknown_fields: true
|
134
|
-
|
135
|
-
|
136
|
-
|
149
|
+
catch :response do
|
150
|
+
yield result, operation if block_given?
|
151
|
+
result
|
152
|
+
end
|
137
153
|
end
|
138
154
|
|
139
155
|
##
|
@@ -162,16 +178,18 @@ module Google
|
|
162
178
|
|
163
179
|
response = @client_stub.make_http_request(
|
164
180
|
verb,
|
165
|
-
uri:
|
166
|
-
body:
|
167
|
-
params:
|
181
|
+
uri: uri,
|
182
|
+
body: body || "",
|
183
|
+
params: query_string_params,
|
184
|
+
method_name: "create_policy",
|
168
185
|
options: options
|
169
186
|
)
|
170
187
|
operation = ::Gapic::Rest::TransportOperation.new response
|
171
188
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
172
|
-
|
173
|
-
|
174
|
-
|
189
|
+
catch :response do
|
190
|
+
yield result, operation if block_given?
|
191
|
+
result
|
192
|
+
end
|
175
193
|
end
|
176
194
|
|
177
195
|
##
|
@@ -200,16 +218,18 @@ module Google
|
|
200
218
|
|
201
219
|
response = @client_stub.make_http_request(
|
202
220
|
verb,
|
203
|
-
uri:
|
204
|
-
body:
|
205
|
-
params:
|
221
|
+
uri: uri,
|
222
|
+
body: body || "",
|
223
|
+
params: query_string_params,
|
224
|
+
method_name: "update_policy",
|
206
225
|
options: options
|
207
226
|
)
|
208
227
|
operation = ::Gapic::Rest::TransportOperation.new response
|
209
228
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
210
|
-
|
211
|
-
|
212
|
-
|
229
|
+
catch :response do
|
230
|
+
yield result, operation if block_given?
|
231
|
+
result
|
232
|
+
end
|
213
233
|
end
|
214
234
|
|
215
235
|
##
|
@@ -238,16 +258,18 @@ module Google
|
|
238
258
|
|
239
259
|
response = @client_stub.make_http_request(
|
240
260
|
verb,
|
241
|
-
uri:
|
242
|
-
body:
|
243
|
-
params:
|
261
|
+
uri: uri,
|
262
|
+
body: body || "",
|
263
|
+
params: query_string_params,
|
264
|
+
method_name: "delete_policy",
|
244
265
|
options: options
|
245
266
|
)
|
246
267
|
operation = ::Gapic::Rest::TransportOperation.new response
|
247
268
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
248
|
-
|
249
|
-
|
250
|
-
|
269
|
+
catch :response do
|
270
|
+
yield result, operation if block_given?
|
271
|
+
result
|
272
|
+
end
|
251
273
|
end
|
252
274
|
|
253
275
|
##
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-iam-v2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-10 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.
|
19
|
+
version: 0.24.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.
|
29
|
+
version: 0.24.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|