google-cloud-resource_manager-v3 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -20
  3. data/lib/google/cloud/resource_manager/v3/folders/client.rb +34 -12
  4. data/lib/google/cloud/resource_manager/v3/folders/operations.rb +12 -15
  5. data/lib/google/cloud/resource_manager/v3/folders/rest/client.rb +34 -12
  6. data/lib/google/cloud/resource_manager/v3/folders/rest/operations.rb +43 -38
  7. data/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb +102 -68
  8. data/lib/google/cloud/resource_manager/v3/organizations/client.rb +28 -6
  9. data/lib/google/cloud/resource_manager/v3/organizations/rest/client.rb +28 -6
  10. data/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb +54 -32
  11. data/lib/google/cloud/resource_manager/v3/projects/client.rb +34 -12
  12. data/lib/google/cloud/resource_manager/v3/projects/operations.rb +12 -15
  13. data/lib/google/cloud/resource_manager/v3/projects/rest/client.rb +34 -12
  14. data/lib/google/cloud/resource_manager/v3/projects/rest/operations.rb +43 -38
  15. data/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb +102 -68
  16. data/lib/google/cloud/resource_manager/v3/tag_bindings/client.rb +31 -5
  17. data/lib/google/cloud/resource_manager/v3/tag_bindings/operations.rb +12 -15
  18. data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/client.rb +31 -5
  19. data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/operations.rb +43 -38
  20. data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb +46 -26
  21. data/lib/google/cloud/resource_manager/v3/tag_holds/client.rb +30 -4
  22. data/lib/google/cloud/resource_manager/v3/tag_holds/operations.rb +12 -15
  23. data/lib/google/cloud/resource_manager/v3/tag_holds/rest/client.rb +30 -4
  24. data/lib/google/cloud/resource_manager/v3/tag_holds/rest/operations.rb +43 -38
  25. data/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb +38 -20
  26. data/lib/google/cloud/resource_manager/v3/tag_keys/client.rb +31 -10
  27. data/lib/google/cloud/resource_manager/v3/tag_keys/operations.rb +12 -15
  28. data/lib/google/cloud/resource_manager/v3/tag_keys/rest/client.rb +31 -10
  29. data/lib/google/cloud/resource_manager/v3/tag_keys/rest/operations.rb +43 -38
  30. data/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb +86 -56
  31. data/lib/google/cloud/resource_manager/v3/tag_values/client.rb +31 -10
  32. data/lib/google/cloud/resource_manager/v3/tag_values/operations.rb +12 -15
  33. data/lib/google/cloud/resource_manager/v3/tag_values/rest/client.rb +31 -10
  34. data/lib/google/cloud/resource_manager/v3/tag_values/rest/operations.rb +43 -38
  35. data/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb +86 -56
  36. data/lib/google/cloud/resource_manager/v3/version.rb +1 -1
  37. data/proto_docs/google/api/client.rb +39 -0
  38. data/proto_docs/google/longrunning/operations.rb +19 -14
  39. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92827b8a1dde2b810fbb9beaf540daeb104ede5675117a9066731dcea8ee48c9
4
- data.tar.gz: 528f349bb42b145439b37b0ca6262bb6a4519c2e88104688097a48ac9fec1035
3
+ metadata.gz: c51d6368b29f32a9188cc849d16b48f8c6e1b4e10756cc05661fa3c83b75dd25
4
+ data.tar.gz: 39c8563cf64c1bc9b3613e0fb018e7a652db372072daab1f572cdeb6dd6b3159
5
5
  SHA512:
6
- metadata.gz: 1d110d673cb93bab58f733445f5dc566f231af4b4985a419694feb61e0271ea96ffa264d8deb7d68eb71cdde73244ee3870de422f1c99e32d781d0062b495bc1
7
- data.tar.gz: 11e84680d9fdc1007bb5230454863b41ce15f5fb507b23dc33fbd361ba1edba55eaefba7ca2eb162b19241fd05af18c7ce16be4bd4a2dd1181b9e3d8961a9aa6
6
+ metadata.gz: 23c05cd73776e46d99b2432bc7254cc54680820cea01b380ecd3232f7c3ea97ab4e15de911b304ba80ca1e6575c870355bfb82f66091f3c8d83e621b99a52d4b
7
+ data.tar.gz: ed8c700c72aae01308186aaaa3e83b25f4a4129492773744dbb8d3b836e4d2413c56decc137c845372f68aed38e1e043c59368a05708aeff370d04f66c5b586d
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/resource-manager/)
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/cloud/resource_manager/v3"
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::Cloud::ResourceManager::V3::Folders::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).
@@ -195,8 +195,19 @@ module Google
195
195
  universe_domain: @config.universe_domain,
196
196
  channel_args: @config.channel_args,
197
197
  interceptors: @config.interceptors,
198
- channel_pool_config: @config.channel_pool
198
+ channel_pool_config: @config.channel_pool,
199
+ logger: @config.logger
199
200
  )
201
+
202
+ @folders_stub.stub_logger&.info do |entry|
203
+ entry.set_system_name
204
+ entry.set_service
205
+ entry.message = "Created client for #{entry.service}"
206
+ entry.set_credentials_fields credentials
207
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
208
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
209
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
210
+ end
200
211
  end
201
212
 
202
213
  ##
@@ -206,6 +217,15 @@ module Google
206
217
  #
207
218
  attr_reader :operations_client
208
219
 
220
+ ##
221
+ # The logger used for request/response debug logging.
222
+ #
223
+ # @return [Logger]
224
+ #
225
+ def logger
226
+ @folders_stub.logger
227
+ end
228
+
209
229
  # Service calls
210
230
 
211
231
  ##
@@ -293,7 +313,6 @@ module Google
293
313
 
294
314
  @folders_stub.call_rpc :get_folder, request, options: options do |response, operation|
295
315
  yield response, operation if block_given?
296
- return response
297
316
  end
298
317
  rescue ::GRPC::BadStatus => e
299
318
  raise ::Google::Cloud::Error.from_error(e)
@@ -401,7 +420,7 @@ module Google
401
420
  @folders_stub.call_rpc :list_folders, request, options: options do |response, operation|
402
421
  response = ::Gapic::PagedEnumerable.new @folders_stub, :list_folders, request, response, operation, options
403
422
  yield response, operation if block_given?
404
- return response
423
+ throw :response, response
405
424
  end
406
425
  rescue ::GRPC::BadStatus => e
407
426
  raise ::Google::Cloud::Error.from_error(e)
@@ -526,7 +545,7 @@ module Google
526
545
  @folders_stub.call_rpc :search_folders, request, options: options do |response, operation|
527
546
  response = ::Gapic::PagedEnumerable.new @folders_stub, :search_folders, request, response, operation, options
528
547
  yield response, operation if block_given?
529
- return response
548
+ throw :response, response
530
549
  end
531
550
  rescue ::GRPC::BadStatus => e
532
551
  raise ::Google::Cloud::Error.from_error(e)
@@ -639,7 +658,7 @@ module Google
639
658
  @folders_stub.call_rpc :create_folder, request, options: options do |response, operation|
640
659
  response = ::Gapic::Operation.new response, @operations_client, options: options
641
660
  yield response, operation if block_given?
642
- return response
661
+ throw :response, response
643
662
  end
644
663
  rescue ::GRPC::BadStatus => e
645
664
  raise ::Google::Cloud::Error.from_error(e)
@@ -753,7 +772,7 @@ module Google
753
772
  @folders_stub.call_rpc :update_folder, request, options: options do |response, operation|
754
773
  response = ::Gapic::Operation.new response, @operations_client, options: options
755
774
  yield response, operation if block_given?
756
- return response
775
+ throw :response, response
757
776
  end
758
777
  rescue ::GRPC::BadStatus => e
759
778
  raise ::Google::Cloud::Error.from_error(e)
@@ -868,7 +887,7 @@ module Google
868
887
  @folders_stub.call_rpc :move_folder, request, options: options do |response, operation|
869
888
  response = ::Gapic::Operation.new response, @operations_client, options: options
870
889
  yield response, operation if block_given?
871
- return response
890
+ throw :response, response
872
891
  end
873
892
  rescue ::GRPC::BadStatus => e
874
893
  raise ::Google::Cloud::Error.from_error(e)
@@ -973,7 +992,7 @@ module Google
973
992
  @folders_stub.call_rpc :delete_folder, request, options: options do |response, operation|
974
993
  response = ::Gapic::Operation.new response, @operations_client, options: options
975
994
  yield response, operation if block_given?
976
- return response
995
+ throw :response, response
977
996
  end
978
997
  rescue ::GRPC::BadStatus => e
979
998
  raise ::Google::Cloud::Error.from_error(e)
@@ -1078,7 +1097,7 @@ module Google
1078
1097
  @folders_stub.call_rpc :undelete_folder, request, options: options do |response, operation|
1079
1098
  response = ::Gapic::Operation.new response, @operations_client, options: options
1080
1099
  yield response, operation if block_given?
1081
- return response
1100
+ throw :response, response
1082
1101
  end
1083
1102
  rescue ::GRPC::BadStatus => e
1084
1103
  raise ::Google::Cloud::Error.from_error(e)
@@ -1172,7 +1191,6 @@ module Google
1172
1191
 
1173
1192
  @folders_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
1174
1193
  yield response, operation if block_given?
1175
- return response
1176
1194
  end
1177
1195
  rescue ::GRPC::BadStatus => e
1178
1196
  raise ::Google::Cloud::Error.from_error(e)
@@ -1274,7 +1292,6 @@ module Google
1274
1292
 
1275
1293
  @folders_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
1276
1294
  yield response, operation if block_given?
1277
- return response
1278
1295
  end
1279
1296
  rescue ::GRPC::BadStatus => e
1280
1297
  raise ::Google::Cloud::Error.from_error(e)
@@ -1370,7 +1387,6 @@ module Google
1370
1387
 
1371
1388
  @folders_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
1372
1389
  yield response, operation if block_given?
1373
- return response
1374
1390
  end
1375
1391
  rescue ::GRPC::BadStatus => e
1376
1392
  raise ::Google::Cloud::Error.from_error(e)
@@ -1459,6 +1475,11 @@ module Google
1459
1475
  # default endpoint URL. The default value of nil uses the environment
1460
1476
  # universe (usually the default "googleapis.com" universe).
1461
1477
  # @return [::String,nil]
1478
+ # @!attribute [rw] logger
1479
+ # A custom logger to use for request/response debug logging, or the value
1480
+ # `:default` (the default) to construct a default logger, or `nil` to
1481
+ # explicitly disable logging.
1482
+ # @return [::Logger,:default,nil]
1462
1483
  #
1463
1484
  class Configuration
1464
1485
  extend ::Gapic::Config
@@ -1483,6 +1504,7 @@ module Google
1483
1504
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1484
1505
  config_attr :quota_project, nil, ::String, nil
1485
1506
  config_attr :universe_domain, nil, ::String, nil
1507
+ config_attr :logger, :default, ::Logger, nil, :default
1486
1508
 
1487
1509
  # @private
1488
1510
  def initialize parent_config = nil
@@ -124,14 +124,6 @@ module Google
124
124
  # Lists operations that match the specified filter in the request. If the
125
125
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
126
126
  #
127
- # NOTE: the `name` binding allows API services to override the binding
128
- # to use different resource name schemes, such as `users/*/operations`. To
129
- # override the binding, API services can add a binding such as
130
- # `"/v1/{name=users/*}/operations"` to their service configuration.
131
- # For backwards compatibility, the default name includes the operations
132
- # collection id, however overriding users must ensure the name binding
133
- # is the parent resource, without the operations collection id.
134
- #
135
127
  # @overload list_operations(request, options = nil)
136
128
  # Pass arguments to `list_operations` via a request object, either of type
137
129
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -221,7 +213,7 @@ module Google
221
213
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
222
214
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
223
215
  yield response, operation if block_given?
224
- return response
216
+ throw :response, response
225
217
  end
226
218
  rescue ::GRPC::BadStatus => e
227
219
  raise ::Google::Cloud::Error.from_error(e)
@@ -317,7 +309,7 @@ module Google
317
309
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
318
310
  response = ::Gapic::Operation.new response, @operations_client, options: options
319
311
  yield response, operation if block_given?
320
- return response
312
+ throw :response, response
321
313
  end
322
314
  rescue ::GRPC::BadStatus => e
323
315
  raise ::Google::Cloud::Error.from_error(e)
@@ -406,7 +398,6 @@ module Google
406
398
 
407
399
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
408
400
  yield response, operation if block_given?
409
- return response
410
401
  end
411
402
  rescue ::GRPC::BadStatus => e
412
403
  raise ::Google::Cloud::Error.from_error(e)
@@ -421,8 +412,9 @@ module Google
421
412
  # other methods to check whether the cancellation succeeded or whether the
422
413
  # operation completed despite cancellation. On successful cancellation,
423
414
  # the operation is not deleted; instead, it becomes an operation with
424
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
425
- # corresponding to `Code.CANCELLED`.
415
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
416
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
417
+ # `Code.CANCELLED`.
426
418
  #
427
419
  # @overload cancel_operation(request, options = nil)
428
420
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -501,7 +493,6 @@ module Google
501
493
 
502
494
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
503
495
  yield response, operation if block_given?
504
- return response
505
496
  end
506
497
  rescue ::GRPC::BadStatus => e
507
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -599,7 +590,7 @@ module Google
599
590
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
600
591
  response = ::Gapic::Operation.new response, @operations_client, options: options
601
592
  yield response, operation if block_given?
602
- return response
593
+ throw :response, response
603
594
  end
604
595
  rescue ::GRPC::BadStatus => e
605
596
  raise ::Google::Cloud::Error.from_error(e)
@@ -688,6 +679,11 @@ module Google
688
679
  # default endpoint URL. The default value of nil uses the environment
689
680
  # universe (usually the default "googleapis.com" universe).
690
681
  # @return [::String,nil]
682
+ # @!attribute [rw] logger
683
+ # A custom logger to use for request/response debug logging, or the value
684
+ # `:default` (the default) to construct a default logger, or `nil` to
685
+ # explicitly disable logging.
686
+ # @return [::Logger,:default,nil]
691
687
  #
692
688
  class Configuration
693
689
  extend ::Gapic::Config
@@ -712,6 +708,7 @@ module Google
712
708
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
713
709
  config_attr :quota_project, nil, ::String, nil
714
710
  config_attr :universe_domain, nil, ::String, nil
711
+ config_attr :logger, :default, ::Logger, nil, :default
715
712
 
716
713
  # @private
717
714
  def initialize parent_config = nil
@@ -188,8 +188,19 @@ module Google
188
188
  endpoint: @config.endpoint,
189
189
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
190
190
  universe_domain: @config.universe_domain,
191
- credentials: credentials
191
+ credentials: credentials,
192
+ logger: @config.logger
192
193
  )
194
+
195
+ @folders_stub.logger(stub: true)&.info do |entry|
196
+ entry.set_system_name
197
+ entry.set_service
198
+ entry.message = "Created client for #{entry.service}"
199
+ entry.set_credentials_fields credentials
200
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
201
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
202
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
203
+ end
193
204
  end
194
205
 
195
206
  ##
@@ -199,6 +210,15 @@ module Google
199
210
  #
200
211
  attr_reader :operations_client
201
212
 
213
+ ##
214
+ # The logger used for request/response debug logging.
215
+ #
216
+ # @return [Logger]
217
+ #
218
+ def logger
219
+ @folders_stub.logger
220
+ end
221
+
202
222
  # Service calls
203
223
 
204
224
  ##
@@ -279,7 +299,6 @@ module Google
279
299
 
280
300
  @folders_stub.get_folder request, options do |result, operation|
281
301
  yield result, operation if block_given?
282
- return result
283
302
  end
284
303
  rescue ::Gapic::Rest::Error => e
285
304
  raise ::Google::Cloud::Error.from_error(e)
@@ -388,7 +407,7 @@ module Google
388
407
  @folders_stub.list_folders request, options do |result, operation|
389
408
  result = ::Gapic::Rest::PagedEnumerable.new @folders_stub, :list_folders, "folders", request, result, options
390
409
  yield result, operation if block_given?
391
- return result
410
+ throw :response, result
392
411
  end
393
412
  rescue ::Gapic::Rest::Error => e
394
413
  raise ::Google::Cloud::Error.from_error(e)
@@ -514,7 +533,7 @@ module Google
514
533
  @folders_stub.search_folders request, options do |result, operation|
515
534
  result = ::Gapic::Rest::PagedEnumerable.new @folders_stub, :search_folders, "folders", request, result, options
516
535
  yield result, operation if block_given?
517
- return result
536
+ throw :response, result
518
537
  end
519
538
  rescue ::Gapic::Rest::Error => e
520
539
  raise ::Google::Cloud::Error.from_error(e)
@@ -628,7 +647,7 @@ module Google
628
647
  @folders_stub.create_folder request, options do |result, operation|
629
648
  result = ::Gapic::Operation.new result, @operations_client, options: options
630
649
  yield result, operation if block_given?
631
- return result
650
+ throw :response, result
632
651
  end
633
652
  rescue ::Gapic::Rest::Error => e
634
653
  raise ::Google::Cloud::Error.from_error(e)
@@ -735,7 +754,7 @@ module Google
735
754
  @folders_stub.update_folder request, options do |result, operation|
736
755
  result = ::Gapic::Operation.new result, @operations_client, options: options
737
756
  yield result, operation if block_given?
738
- return result
757
+ throw :response, result
739
758
  end
740
759
  rescue ::Gapic::Rest::Error => e
741
760
  raise ::Google::Cloud::Error.from_error(e)
@@ -843,7 +862,7 @@ module Google
843
862
  @folders_stub.move_folder request, options do |result, operation|
844
863
  result = ::Gapic::Operation.new result, @operations_client, options: options
845
864
  yield result, operation if block_given?
846
- return result
865
+ throw :response, result
847
866
  end
848
867
  rescue ::Gapic::Rest::Error => e
849
868
  raise ::Google::Cloud::Error.from_error(e)
@@ -941,7 +960,7 @@ module Google
941
960
  @folders_stub.delete_folder request, options do |result, operation|
942
961
  result = ::Gapic::Operation.new result, @operations_client, options: options
943
962
  yield result, operation if block_given?
944
- return result
963
+ throw :response, result
945
964
  end
946
965
  rescue ::Gapic::Rest::Error => e
947
966
  raise ::Google::Cloud::Error.from_error(e)
@@ -1039,7 +1058,7 @@ module Google
1039
1058
  @folders_stub.undelete_folder request, options do |result, operation|
1040
1059
  result = ::Gapic::Operation.new result, @operations_client, options: options
1041
1060
  yield result, operation if block_given?
1042
- return result
1061
+ throw :response, result
1043
1062
  end
1044
1063
  rescue ::Gapic::Rest::Error => e
1045
1064
  raise ::Google::Cloud::Error.from_error(e)
@@ -1126,7 +1145,6 @@ module Google
1126
1145
 
1127
1146
  @folders_stub.get_iam_policy request, options do |result, operation|
1128
1147
  yield result, operation if block_given?
1129
- return result
1130
1148
  end
1131
1149
  rescue ::Gapic::Rest::Error => e
1132
1150
  raise ::Google::Cloud::Error.from_error(e)
@@ -1221,7 +1239,6 @@ module Google
1221
1239
 
1222
1240
  @folders_stub.set_iam_policy request, options do |result, operation|
1223
1241
  yield result, operation if block_given?
1224
- return result
1225
1242
  end
1226
1243
  rescue ::Gapic::Rest::Error => e
1227
1244
  raise ::Google::Cloud::Error.from_error(e)
@@ -1310,7 +1327,6 @@ module Google
1310
1327
 
1311
1328
  @folders_stub.test_iam_permissions request, options do |result, operation|
1312
1329
  yield result, operation if block_given?
1313
- return result
1314
1330
  end
1315
1331
  rescue ::Gapic::Rest::Error => e
1316
1332
  raise ::Google::Cloud::Error.from_error(e)
@@ -1390,6 +1406,11 @@ module Google
1390
1406
  # default endpoint URL. The default value of nil uses the environment
1391
1407
  # universe (usually the default "googleapis.com" universe).
1392
1408
  # @return [::String,nil]
1409
+ # @!attribute [rw] logger
1410
+ # A custom logger to use for request/response debug logging, or the value
1411
+ # `:default` (the default) to construct a default logger, or `nil` to
1412
+ # explicitly disable logging.
1413
+ # @return [::Logger,:default,nil]
1393
1414
  #
1394
1415
  class Configuration
1395
1416
  extend ::Gapic::Config
@@ -1411,6 +1432,7 @@ module Google
1411
1432
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1412
1433
  config_attr :quota_project, nil, ::String, nil
1413
1434
  config_attr :universe_domain, nil, ::String, nil
1435
+ config_attr :logger, :default, ::Logger, nil, :default
1414
1436
 
1415
1437
  # @private
1416
1438
  def initialize parent_config = nil
@@ -115,14 +115,6 @@ module Google
115
115
  # Lists operations that match the specified filter in the request. If the
116
116
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
117
117
  #
118
- # NOTE: the `name` binding allows API services to override the binding
119
- # to use different resource name schemes, such as `users/*/operations`. To
120
- # override the binding, API services can add a binding such as
121
- # `"/v1/{name=users/*}/operations"` to their service configuration.
122
- # For backwards compatibility, the default name includes the operations
123
- # collection id, however overriding users must ensure the name binding
124
- # is the parent resource, without the operations collection id.
125
- #
126
118
  # @overload list_operations(request, options = nil)
127
119
  # Pass arguments to `list_operations` via a request object, either of type
128
120
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -204,7 +196,7 @@ module Google
204
196
  @operations_stub.list_operations request, options do |result, operation|
205
197
  result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
206
198
  yield result, operation if block_given?
207
- return result
199
+ throw :response, result
208
200
  end
209
201
  rescue ::Gapic::Rest::Error => e
210
202
  raise ::Google::Cloud::Error.from_error(e)
@@ -293,7 +285,7 @@ module Google
293
285
  @operations_stub.get_operation request, options do |result, operation|
294
286
  result = ::Gapic::Operation.new result, @operations_client, options: options
295
287
  yield result, operation if block_given?
296
- return result
288
+ throw :response, result
297
289
  end
298
290
  rescue ::Gapic::Rest::Error => e
299
291
  raise ::Google::Cloud::Error.from_error(e)
@@ -375,7 +367,6 @@ module Google
375
367
 
376
368
  @operations_stub.delete_operation request, options do |result, operation|
377
369
  yield result, operation if block_given?
378
- return result
379
370
  end
380
371
  rescue ::Gapic::Rest::Error => e
381
372
  raise ::Google::Cloud::Error.from_error(e)
@@ -390,8 +381,9 @@ module Google
390
381
  # other methods to check whether the cancellation succeeded or whether the
391
382
  # operation completed despite cancellation. On successful cancellation,
392
383
  # the operation is not deleted; instead, it becomes an operation with
393
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
394
- # corresponding to `Code.CANCELLED`.
384
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
385
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
386
+ # `Code.CANCELLED`.
395
387
  #
396
388
  # @overload cancel_operation(request, options = nil)
397
389
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -463,7 +455,6 @@ module Google
463
455
 
464
456
  @operations_stub.cancel_operation request, options do |result, operation|
465
457
  yield result, operation if block_given?
466
- return result
467
458
  end
468
459
  rescue ::Gapic::Rest::Error => e
469
460
  raise ::Google::Cloud::Error.from_error(e)
@@ -543,6 +534,11 @@ module Google
543
534
  # default endpoint URL. The default value of nil uses the environment
544
535
  # universe (usually the default "googleapis.com" universe).
545
536
  # @return [::String,nil]
537
+ # @!attribute [rw] logger
538
+ # A custom logger to use for request/response debug logging, or the value
539
+ # `:default` (the default) to construct a default logger, or `nil` to
540
+ # explicitly disable logging.
541
+ # @return [::Logger,:default,nil]
546
542
  #
547
543
  class Configuration
548
544
  extend ::Gapic::Config
@@ -564,6 +560,7 @@ module Google
564
560
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
565
561
  config_attr :quota_project, nil, ::String, nil
566
562
  config_attr :universe_domain, nil, ::String, nil
563
+ config_attr :logger, :default, ::Logger, nil, :default
567
564
 
568
565
  # @private
569
566
  def initialize parent_config = nil
@@ -683,16 +680,18 @@ module Google
683
680
 
684
681
  response = @client_stub.make_http_request(
685
682
  verb,
686
- uri: uri,
687
- body: body || "",
688
- params: query_string_params,
683
+ uri: uri,
684
+ body: body || "",
685
+ params: query_string_params,
686
+ method_name: "list_operations",
689
687
  options: options
690
688
  )
691
689
  operation = ::Gapic::Rest::TransportOperation.new response
692
690
  result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
693
-
694
- yield result, operation if block_given?
695
- result
691
+ catch :response do
692
+ yield result, operation if block_given?
693
+ result
694
+ end
696
695
  end
697
696
 
698
697
  ##
@@ -721,16 +720,18 @@ module Google
721
720
 
722
721
  response = @client_stub.make_http_request(
723
722
  verb,
724
- uri: uri,
725
- body: body || "",
726
- params: query_string_params,
723
+ uri: uri,
724
+ body: body || "",
725
+ params: query_string_params,
726
+ method_name: "get_operation",
727
727
  options: options
728
728
  )
729
729
  operation = ::Gapic::Rest::TransportOperation.new response
730
730
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
731
-
732
- yield result, operation if block_given?
733
- result
731
+ catch :response do
732
+ yield result, operation if block_given?
733
+ result
734
+ end
734
735
  end
735
736
 
736
737
  ##
@@ -759,16 +760,18 @@ module Google
759
760
 
760
761
  response = @client_stub.make_http_request(
761
762
  verb,
762
- uri: uri,
763
- body: body || "",
764
- params: query_string_params,
763
+ uri: uri,
764
+ body: body || "",
765
+ params: query_string_params,
766
+ method_name: "delete_operation",
765
767
  options: options
766
768
  )
767
769
  operation = ::Gapic::Rest::TransportOperation.new response
768
770
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
769
-
770
- yield result, operation if block_given?
771
- result
771
+ catch :response do
772
+ yield result, operation if block_given?
773
+ result
774
+ end
772
775
  end
773
776
 
774
777
  ##
@@ -797,16 +800,18 @@ module Google
797
800
 
798
801
  response = @client_stub.make_http_request(
799
802
  verb,
800
- uri: uri,
801
- body: body || "",
802
- params: query_string_params,
803
+ uri: uri,
804
+ body: body || "",
805
+ params: query_string_params,
806
+ method_name: "cancel_operation",
803
807
  options: options
804
808
  )
805
809
  operation = ::Gapic::Rest::TransportOperation.new response
806
810
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
807
-
808
- yield result, operation if block_given?
809
- result
811
+ catch :response do
812
+ yield result, operation if block_given?
813
+ result
814
+ end
810
815
  end
811
816
 
812
817
  ##