google-iam-v2 0.6.1 → 0.7.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: b743e5437f7987c2dfad011b985ffa7e3d6a1f530db05593f724279b446ab3b1
4
- data.tar.gz: 8250b7387b993c634e3582e6bcd06fdb23a47f325ea831b041ac24c0aa2dd72c
3
+ metadata.gz: 3bb33dd2d324db645bd9448b8b1c6fba86f1e6f96bd335fc25c7d8c3acb7bedc
4
+ data.tar.gz: e0620271b616d7d0a81f1758ae4e4be785ffb483b74628329ba6514882f0dbf4
5
5
  SHA512:
6
- metadata.gz: cf6340885b3cc1c4cbc4f8ab7764a8e053c1966f1340fd1539ec2f2d8c6b07b763bb50ba20133316596ba897d842a13e81390206f2a508b7317a27a667abf211
7
- data.tar.gz: 366e42d5b219c94cb39dce3b16cf1446069b7e07b27e01cf1f9a253ff46caa321f93032aa157061217acf03b02153754c81a76a3ee733a15be90db63e117a913
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
@@ -123,14 +123,6 @@ module Google
123
123
  # Lists operations that match the specified filter in the request. If the
124
124
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
125
125
  #
126
- # NOTE: the `name` binding allows API services to override the binding
127
- # to use different resource name schemes, such as `users/*/operations`. To
128
- # override the binding, API services can add a binding such as
129
- # `"/v1/{name=users/*}/operations"` to their service configuration.
130
- # For backwards compatibility, the default name includes the operations
131
- # collection id, however overriding users must ensure the name binding
132
- # is the parent resource, without the operations collection id.
133
- #
134
126
  # @overload list_operations(request, options = nil)
135
127
  # Pass arguments to `list_operations` via a request object, either of type
136
128
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -220,7 +212,7 @@ module Google
220
212
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
221
213
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
222
214
  yield response, operation if block_given?
223
- return response
215
+ throw :response, response
224
216
  end
225
217
  rescue ::GRPC::BadStatus => e
226
218
  raise ::Google::Cloud::Error.from_error(e)
@@ -316,7 +308,7 @@ module Google
316
308
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
317
309
  response = ::Gapic::Operation.new response, @operations_client, options: options
318
310
  yield response, operation if block_given?
319
- return response
311
+ throw :response, response
320
312
  end
321
313
  rescue ::GRPC::BadStatus => e
322
314
  raise ::Google::Cloud::Error.from_error(e)
@@ -405,7 +397,6 @@ module Google
405
397
 
406
398
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
407
399
  yield response, operation if block_given?
408
- return response
409
400
  end
410
401
  rescue ::GRPC::BadStatus => e
411
402
  raise ::Google::Cloud::Error.from_error(e)
@@ -420,8 +411,9 @@ module Google
420
411
  # other methods to check whether the cancellation succeeded or whether the
421
412
  # operation completed despite cancellation. On successful cancellation,
422
413
  # the operation is not deleted; instead, it becomes an operation with
423
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
424
- # corresponding to `Code.CANCELLED`.
414
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
415
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
416
+ # `Code.CANCELLED`.
425
417
  #
426
418
  # @overload cancel_operation(request, options = nil)
427
419
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -500,7 +492,6 @@ module Google
500
492
 
501
493
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
502
494
  yield response, operation if block_given?
503
- return response
504
495
  end
505
496
  rescue ::GRPC::BadStatus => e
506
497
  raise ::Google::Cloud::Error.from_error(e)
@@ -598,7 +589,7 @@ module Google
598
589
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
599
590
  response = ::Gapic::Operation.new response, @operations_client, options: options
600
591
  yield response, operation if block_given?
601
- return response
592
+ throw :response, response
602
593
  end
603
594
  rescue ::GRPC::BadStatus => e
604
595
  raise ::Google::Cloud::Error.from_error(e)
@@ -687,6 +678,11 @@ module Google
687
678
  # default endpoint URL. The default value of nil uses the environment
688
679
  # universe (usually the default "googleapis.com" universe).
689
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]
690
686
  #
691
687
  class Configuration
692
688
  extend ::Gapic::Config
@@ -711,6 +707,7 @@ module Google
711
707
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
712
708
  config_attr :quota_project, nil, ::String, nil
713
709
  config_attr :universe_domain, nil, ::String, nil
710
+ config_attr :logger, :default, ::Logger, nil, :default
714
711
 
715
712
  # @private
716
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
@@ -114,14 +114,6 @@ module Google
114
114
  # Lists operations that match the specified filter in the request. If the
115
115
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
116
116
  #
117
- # NOTE: the `name` binding allows API services to override the binding
118
- # to use different resource name schemes, such as `users/*/operations`. To
119
- # override the binding, API services can add a binding such as
120
- # `"/v1/{name=users/*}/operations"` to their service configuration.
121
- # For backwards compatibility, the default name includes the operations
122
- # collection id, however overriding users must ensure the name binding
123
- # is the parent resource, without the operations collection id.
124
- #
125
117
  # @overload list_operations(request, options = nil)
126
118
  # Pass arguments to `list_operations` via a request object, either of type
127
119
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -203,7 +195,7 @@ module Google
203
195
  @operations_stub.list_operations request, options do |result, operation|
204
196
  result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
205
197
  yield result, operation if block_given?
206
- return result
198
+ throw :response, result
207
199
  end
208
200
  rescue ::Gapic::Rest::Error => e
209
201
  raise ::Google::Cloud::Error.from_error(e)
@@ -292,7 +284,7 @@ module Google
292
284
  @operations_stub.get_operation request, options do |result, operation|
293
285
  result = ::Gapic::Operation.new result, @operations_client, options: options
294
286
  yield result, operation if block_given?
295
- return result
287
+ throw :response, result
296
288
  end
297
289
  rescue ::Gapic::Rest::Error => e
298
290
  raise ::Google::Cloud::Error.from_error(e)
@@ -374,7 +366,6 @@ module Google
374
366
 
375
367
  @operations_stub.delete_operation request, options do |result, operation|
376
368
  yield result, operation if block_given?
377
- return result
378
369
  end
379
370
  rescue ::Gapic::Rest::Error => e
380
371
  raise ::Google::Cloud::Error.from_error(e)
@@ -389,8 +380,9 @@ module Google
389
380
  # other methods to check whether the cancellation succeeded or whether the
390
381
  # operation completed despite cancellation. On successful cancellation,
391
382
  # the operation is not deleted; instead, it becomes an operation with
392
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
393
- # corresponding to `Code.CANCELLED`.
383
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
384
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
385
+ # `Code.CANCELLED`.
394
386
  #
395
387
  # @overload cancel_operation(request, options = nil)
396
388
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -462,7 +454,6 @@ module Google
462
454
 
463
455
  @operations_stub.cancel_operation request, options do |result, operation|
464
456
  yield result, operation if block_given?
465
- return result
466
457
  end
467
458
  rescue ::Gapic::Rest::Error => e
468
459
  raise ::Google::Cloud::Error.from_error(e)
@@ -542,6 +533,11 @@ module Google
542
533
  # default endpoint URL. The default value of nil uses the environment
543
534
  # universe (usually the default "googleapis.com" universe).
544
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]
545
541
  #
546
542
  class Configuration
547
543
  extend ::Gapic::Config
@@ -563,6 +559,7 @@ module Google
563
559
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
564
560
  config_attr :quota_project, nil, ::String, nil
565
561
  config_attr :universe_domain, nil, ::String, nil
562
+ config_attr :logger, :default, ::Logger, nil, :default
566
563
 
567
564
  # @private
568
565
  def initialize parent_config = nil
@@ -682,16 +679,18 @@ module Google
682
679
 
683
680
  response = @client_stub.make_http_request(
684
681
  verb,
685
- uri: uri,
686
- body: body || "",
687
- params: query_string_params,
682
+ uri: uri,
683
+ body: body || "",
684
+ params: query_string_params,
685
+ method_name: "list_operations",
688
686
  options: options
689
687
  )
690
688
  operation = ::Gapic::Rest::TransportOperation.new response
691
689
  result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
692
-
693
- yield result, operation if block_given?
694
- result
690
+ catch :response do
691
+ yield result, operation if block_given?
692
+ result
693
+ end
695
694
  end
696
695
 
697
696
  ##
@@ -720,16 +719,18 @@ module Google
720
719
 
721
720
  response = @client_stub.make_http_request(
722
721
  verb,
723
- uri: uri,
724
- body: body || "",
725
- params: query_string_params,
722
+ uri: uri,
723
+ body: body || "",
724
+ params: query_string_params,
725
+ method_name: "get_operation",
726
726
  options: options
727
727
  )
728
728
  operation = ::Gapic::Rest::TransportOperation.new response
729
729
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
730
-
731
- yield result, operation if block_given?
732
- result
730
+ catch :response do
731
+ yield result, operation if block_given?
732
+ result
733
+ end
733
734
  end
734
735
 
735
736
  ##
@@ -758,16 +759,18 @@ module Google
758
759
 
759
760
  response = @client_stub.make_http_request(
760
761
  verb,
761
- uri: uri,
762
- body: body || "",
763
- params: query_string_params,
762
+ uri: uri,
763
+ body: body || "",
764
+ params: query_string_params,
765
+ method_name: "delete_operation",
764
766
  options: options
765
767
  )
766
768
  operation = ::Gapic::Rest::TransportOperation.new response
767
769
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
768
-
769
- yield result, operation if block_given?
770
- result
770
+ catch :response do
771
+ yield result, operation if block_given?
772
+ result
773
+ end
771
774
  end
772
775
 
773
776
  ##
@@ -796,16 +799,18 @@ module Google
796
799
 
797
800
  response = @client_stub.make_http_request(
798
801
  verb,
799
- uri: uri,
800
- body: body || "",
801
- params: query_string_params,
802
+ uri: uri,
803
+ body: body || "",
804
+ params: query_string_params,
805
+ method_name: "cancel_operation",
802
806
  options: options
803
807
  )
804
808
  operation = ::Gapic::Rest::TransportOperation.new response
805
809
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
806
-
807
- yield result, operation if block_given?
808
- result
810
+ catch :response do
811
+ yield result, operation if block_given?
812
+ result
813
+ end
809
814
  end
810
815
 
811
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.1"
23
+ VERSION = "0.7.0"
24
24
  end
25
25
  end
26
26
  end
@@ -28,6 +28,9 @@ module Google
28
28
  # @!attribute [rw] destinations
29
29
  # @return [::Array<::Google::Api::ClientLibraryDestination>]
30
30
  # The destination where API teams want this client library to be published.
31
+ # @!attribute [rw] selective_gapic_generation
32
+ # @return [::Google::Api::SelectiveGapicGeneration]
33
+ # Configuration for which RPCs should be generated in the GAPIC client.
31
34
  class CommonLanguageSettings
32
35
  include ::Google::Protobuf::MessageExts
33
36
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -212,6 +215,12 @@ module Google
212
215
  # enabled. By default, asynchronous REST clients will not be generated.
213
216
  # This feature will be enabled by default 1 month after launching the
214
217
  # feature in preview packages.
218
+ # @!attribute [rw] protobuf_pythonic_types_enabled
219
+ # @return [::Boolean]
220
+ # Enables generation of protobuf code using new types that are more
221
+ # Pythonic which are included in `protobuf>=5.29.x`. This feature will be
222
+ # enabled by default 1 month after launching the feature in preview
223
+ # packages.
215
224
  class ExperimentalFeatures
216
225
  include ::Google::Protobuf::MessageExts
217
226
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -297,9 +306,28 @@ module Google
297
306
  # @!attribute [rw] common
298
307
  # @return [::Google::Api::CommonLanguageSettings]
299
308
  # Some settings.
309
+ # @!attribute [rw] renamed_services
310
+ # @return [::Google::Protobuf::Map{::String => ::String}]
311
+ # Map of service names to renamed services. Keys are the package relative
312
+ # service names and values are the name to be used for the service client
313
+ # and call options.
314
+ #
315
+ # publishing:
316
+ # go_settings:
317
+ # renamed_services:
318
+ # Publisher: TopicAdmin
300
319
  class GoSettings
301
320
  include ::Google::Protobuf::MessageExts
302
321
  extend ::Google::Protobuf::MessageExts::ClassMethods
322
+
323
+ # @!attribute [rw] key
324
+ # @return [::String]
325
+ # @!attribute [rw] value
326
+ # @return [::String]
327
+ class RenamedServicesEntry
328
+ include ::Google::Protobuf::MessageExts
329
+ extend ::Google::Protobuf::MessageExts::ClassMethods
330
+ end
303
331
  end
304
332
 
305
333
  # Describes the generator configuration for a method.
@@ -375,6 +403,17 @@ module Google
375
403
  end
376
404
  end
377
405
 
406
+ # This message is used to configure the generation of a subset of the RPCs in
407
+ # a service for client libraries.
408
+ # @!attribute [rw] methods
409
+ # @return [::Array<::String>]
410
+ # An allowlist of the fully qualified names of RPCs that should be included
411
+ # on public client surfaces.
412
+ class SelectiveGapicGeneration
413
+ include ::Google::Protobuf::MessageExts
414
+ extend ::Google::Protobuf::MessageExts::ClassMethods
415
+ end
416
+
378
417
  # The organization for which the client libraries are being published.
379
418
  # Affects the url where generated docs are published, etc.
380
419
  module ClientLibraryOrganization
@@ -42,7 +42,7 @@ module Google
42
42
  # The error result of the operation in case of failure or cancellation.
43
43
  # @!attribute [rw] response
44
44
  # @return [::Google::Protobuf::Any]
45
- # The normal response of the operation in case of success. If the original
45
+ # The normal, successful response of the operation. If the original
46
46
  # method returns no data on success, such as `Delete`, the response is
47
47
  # `google.protobuf.Empty`. If the original method is standard
48
48
  # `Get`/`Create`/`Update`, the response should be the resource. For other
@@ -55,7 +55,8 @@ module Google
55
55
  extend ::Google::Protobuf::MessageExts::ClassMethods
56
56
  end
57
57
 
58
- # The request message for Operations.GetOperation.
58
+ # The request message for
59
+ # Operations.GetOperation.
59
60
  # @!attribute [rw] name
60
61
  # @return [::String]
61
62
  # The name of the operation resource.
@@ -64,7 +65,8 @@ module Google
64
65
  extend ::Google::Protobuf::MessageExts::ClassMethods
65
66
  end
66
67
 
67
- # The request message for Operations.ListOperations.
68
+ # The request message for
69
+ # Operations.ListOperations.
68
70
  # @!attribute [rw] name
69
71
  # @return [::String]
70
72
  # The name of the operation's parent resource.
@@ -82,7 +84,8 @@ module Google
82
84
  extend ::Google::Protobuf::MessageExts::ClassMethods
83
85
  end
84
86
 
85
- # The response message for Operations.ListOperations.
87
+ # The response message for
88
+ # Operations.ListOperations.
86
89
  # @!attribute [rw] operations
87
90
  # @return [::Array<::Google::Longrunning::Operation>]
88
91
  # A list of operations that matches the specified filter in the request.
@@ -94,7 +97,8 @@ module Google
94
97
  extend ::Google::Protobuf::MessageExts::ClassMethods
95
98
  end
96
99
 
97
- # The request message for Operations.CancelOperation.
100
+ # The request message for
101
+ # Operations.CancelOperation.
98
102
  # @!attribute [rw] name
99
103
  # @return [::String]
100
104
  # The name of the operation resource to be cancelled.
@@ -103,7 +107,8 @@ module Google
103
107
  extend ::Google::Protobuf::MessageExts::ClassMethods
104
108
  end
105
109
 
106
- # The request message for Operations.DeleteOperation.
110
+ # The request message for
111
+ # Operations.DeleteOperation.
107
112
  # @!attribute [rw] name
108
113
  # @return [::String]
109
114
  # The name of the operation resource to be deleted.
@@ -112,7 +117,8 @@ module Google
112
117
  extend ::Google::Protobuf::MessageExts::ClassMethods
113
118
  end
114
119
 
115
- # The request message for Operations.WaitOperation.
120
+ # The request message for
121
+ # Operations.WaitOperation.
116
122
  # @!attribute [rw] name
117
123
  # @return [::String]
118
124
  # The name of the operation resource to wait on.
@@ -130,13 +136,12 @@ module Google
130
136
  #
131
137
  # Example:
132
138
  #
133
- # rpc LongRunningRecognize(LongRunningRecognizeRequest)
134
- # returns (google.longrunning.Operation) {
135
- # option (google.longrunning.operation_info) = {
136
- # response_type: "LongRunningRecognizeResponse"
137
- # metadata_type: "LongRunningRecognizeMetadata"
138
- # };
139
- # }
139
+ # rpc Export(ExportRequest) returns (google.longrunning.Operation) {
140
+ # option (google.longrunning.operation_info) = {
141
+ # response_type: "ExportResponse"
142
+ # metadata_type: "ExportMetadata"
143
+ # };
144
+ # }
140
145
  # @!attribute [rw] response_type
141
146
  # @return [::String]
142
147
  # Required. The message name of the primary return type for this
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.1
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-08-30 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
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  - !ruby/object:Gem::Version
106
106
  version: '0'
107
107
  requirements: []
108
- rubygems_version: 3.5.6
108
+ rubygems_version: 3.5.23
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: Manages identity and access control for Google Cloud Platform resources,