google-iam-v2 0.6.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c819f6c58cebafdc2ebb7b3b04a15d6ef6a0e3ddd4c001402eee453359c2e8e
4
- data.tar.gz: f7a104dd3d7c6efe031f1e74f69a200ee0b2f2f2265e5bcdbcd584ab2fc638d6
3
+ metadata.gz: 3bb33dd2d324db645bd9448b8b1c6fba86f1e6f96bd335fc25c7d8c3acb7bedc
4
+ data.tar.gz: e0620271b616d7d0a81f1758ae4e4be785ffb483b74628329ba6514882f0dbf4
5
5
  SHA512:
6
- metadata.gz: 774d63b8bb700d7441c95f138b27c5f8bc155a1d5909c769396f41881cc26cf28ad0a033f3bd99ae02177006c18eabd990e6020c4aaa45370fc8839f5ba1cbbd
7
- data.tar.gz: 8b177bd609a48d7ea541f314c3726ad9cdd077dc7b28fb2f21a249618b25a696cf0b1ff73e4f41355a82e7ea0161189be29c8489b891dec0b81030fb2bf9810e
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
- ## Enabling Logging
47
-
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/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
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
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
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
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
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
- return response
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
- return response
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
- return response
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
- return response
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
- return response
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
- return response
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
- return response
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
- return result
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
- return result
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
- return result
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
- return result
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
- return result
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
- return result
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: uri,
679
- body: body || "",
680
- params: query_string_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
- yield result, operation if block_given?
687
- result
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: uri,
717
- body: body || "",
718
- params: query_string_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
- yield result, operation if block_given?
725
- result
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: uri,
755
- body: body || "",
756
- params: query_string_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
- yield result, operation if block_given?
763
- result
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: uri,
793
- body: body || "",
794
- params: query_string_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
- yield result, operation if block_given?
801
- result
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
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
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
- raise_faraday_errors: false
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: uri,
90
- body: body || "",
91
- params: query_string_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
- yield result, operation if block_given?
98
- result
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: uri,
128
- body: body || "",
129
- params: query_string_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
- yield result, operation if block_given?
136
- result
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: uri,
166
- body: body || "",
167
- params: query_string_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
- yield result, operation if block_given?
174
- result
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: uri,
204
- body: body || "",
205
- params: query_string_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
- yield result, operation if block_given?
212
- result
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: uri,
242
- body: body || "",
243
- params: query_string_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
- yield result, operation if block_given?
250
- result
269
+ catch :response do
270
+ yield result, operation if block_given?
271
+ result
272
+ end
251
273
  end
252
274
 
253
275
  ##
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Iam
22
22
  module V2
23
- VERSION = "0.6.2"
23
+ VERSION = "0.7.0"
24
24
  end
25
25
  end
26
26
  end
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.6.2
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-05 00:00:00.000000000 Z
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.21.1
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.21.1
29
+ version: 0.24.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a