google-cloud-commerce-consumer-procurement-v1 1.1.0 → 1.3.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: b2806abd56a36390df505d86defccf6b54ed0ad8144ff2347e322e10f135b9c0
4
- data.tar.gz: 7156f9718cd3e2ec371bd9ce504d66493286fed9287fac6e0c92e809ca7b9d15
3
+ metadata.gz: e2b93c332523126e0bbad5ede764e431c8d3663f1a1a1334fffb379ea7e92585
4
+ data.tar.gz: f56fbc3a6b883f6a34f86fd28b526e514f3dbf167e0ffcdf4fd79a98f2902fc2
5
5
  SHA512:
6
- metadata.gz: 0ec31da46c87b52c6f07b4d317332c49d3f76e400165657427f58be30566186cb5a0ab0b9813673fee1223346c8f286e01759755283276f6d274bb77e5b3ef0d
7
- data.tar.gz: '0463719766cd010a8618cac5b3389224d664b80d8e9e0a7af15fe0613b7d30abc8f5939d6a4d750f09f5cbbddab0ff2a77d54e5c85085ef25063b0ccab8107d9'
6
+ metadata.gz: 305da1046021f1c88821adc70db8be626b639f4b107fef4da00ed194fcdbee1473f7ea48b3b3619771cc9693e2ccd4169567365a50c0c0908a6c9e624bab768e
7
+ data.tar.gz: df9a39abbab8be9f4f4567f5c8d1bcffabb6ce9168449e9411a7298f76e3be28d6641ada0a82240a39a80e97c8d415b7460af91c46ea7d88a59e7d763efcab72
data/README.md CHANGED
@@ -42,40 +42,50 @@ for class and method documentation.
42
42
  See also the [Product Documentation](https://cloud.google.com/marketplace/docs/)
43
43
  for general usage information.
44
44
 
45
- ## Enabling Logging
46
-
47
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
48
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
49
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
50
- 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)
51
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
52
-
53
- Configuring a Ruby stdlib logger:
45
+ ## Debug Logging
46
+
47
+ This library comes with opt-in Debug Logging that can help you troubleshoot
48
+ your application's integration with the API. When logging is activated, key
49
+ events such as requests and responses, along with data payloads and metadata
50
+ such as headers and client configuration, are logged to the standard error
51
+ stream.
52
+
53
+ **WARNING:** Client Library Debug Logging includes your data payloads in
54
+ plaintext, which could include sensitive data such as PII for yourself or your
55
+ customers, private keys, or other security data that could be compromising if
56
+ leaked. Always practice good data hygiene with your application logs, and follow
57
+ the principle of least access. Google also recommends that Client Library Debug
58
+ Logging be enabled only temporarily during active debugging, and not used
59
+ permanently in production.
60
+
61
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
62
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
63
+ list of client library gem names. This will select the default logging behavior,
64
+ which writes logs to the standard error stream. On a local workstation, this may
65
+ result in logs appearing on the console. When running on a Google Cloud hosting
66
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
67
+ results in logs appearing alongside your application logs in the
68
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
69
+
70
+ You can customize logging by modifying the `logger` configuration when
71
+ constructing a client object. For example:
54
72
 
55
73
  ```ruby
74
+ require "google/cloud/commerce/consumer/procurement/v1"
56
75
  require "logger"
57
76
 
58
- module MyLogger
59
- LOGGER = Logger.new $stderr, level: Logger::WARN
60
- def logger
61
- LOGGER
62
- end
63
- end
64
-
65
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
66
- module GRPC
67
- extend MyLogger
77
+ client = ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Client.new do |config|
78
+ config.logger = Logger.new "my-app.log"
68
79
  end
69
80
  ```
70
81
 
71
-
72
82
  ## Google Cloud Samples
73
83
 
74
84
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
75
85
 
76
86
  ## Supported Ruby Versions
77
87
 
78
- This library is supported on Ruby 2.7+.
88
+ This library is supported on Ruby 3.0+.
79
89
 
80
90
  Google provides official support for Ruby versions that are actively supported
81
91
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -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
+ @consumer_procurement_service_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
+ @consumer_procurement_service_stub.logger
218
+ end
219
+
200
220
  # Service calls
201
221
 
202
222
  ##
@@ -309,7 +329,7 @@ module Google
309
329
  @consumer_procurement_service_stub.call_rpc :place_order, request, options: options do |response, operation|
310
330
  response = ::Gapic::Operation.new response, @operations_client, options: options
311
331
  yield response, operation if block_given?
312
- return response
332
+ throw :response, response
313
333
  end
314
334
  rescue ::GRPC::BadStatus => e
315
335
  raise ::Google::Cloud::Error.from_error(e)
@@ -396,7 +416,6 @@ module Google
396
416
 
397
417
  @consumer_procurement_service_stub.call_rpc :get_order, request, options: options do |response, operation|
398
418
  yield response, operation if block_given?
399
- return response
400
419
  end
401
420
  rescue ::GRPC::BadStatus => e
402
421
  raise ::Google::Cloud::Error.from_error(e)
@@ -513,7 +532,7 @@ module Google
513
532
  @consumer_procurement_service_stub.call_rpc :list_orders, request, options: options do |response, operation|
514
533
  response = ::Gapic::PagedEnumerable.new @consumer_procurement_service_stub, :list_orders, request, response, operation, options
515
534
  yield response, operation if block_given?
516
- return response
535
+ throw :response, response
517
536
  end
518
537
  rescue ::GRPC::BadStatus => e
519
538
  raise ::Google::Cloud::Error.from_error(e)
@@ -619,7 +638,7 @@ module Google
619
638
  @consumer_procurement_service_stub.call_rpc :modify_order, 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)
@@ -721,7 +740,7 @@ module Google
721
740
  @consumer_procurement_service_stub.call_rpc :cancel_order, request, options: options do |response, operation|
722
741
  response = ::Gapic::Operation.new response, @operations_client, options: options
723
742
  yield response, operation if block_given?
724
- return response
743
+ throw :response, response
725
744
  end
726
745
  rescue ::GRPC::BadStatus => e
727
746
  raise ::Google::Cloud::Error.from_error(e)
@@ -771,6 +790,13 @@ module Google
771
790
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
772
791
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
773
792
  # * (`nil`) indicating no credentials
793
+ #
794
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
795
+ # external source for authentication to Google Cloud, you must validate it before
796
+ # providing it to a Google API client library. Providing an unvalidated credential
797
+ # configuration to Google APIs can compromise the security of your systems and data.
798
+ # For more information, refer to [Validate credential configurations from external
799
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
774
800
  # @return [::Object]
775
801
  # @!attribute [rw] scope
776
802
  # The OAuth scopes
@@ -810,6 +836,11 @@ module Google
810
836
  # default endpoint URL. The default value of nil uses the environment
811
837
  # universe (usually the default "googleapis.com" universe).
812
838
  # @return [::String,nil]
839
+ # @!attribute [rw] logger
840
+ # A custom logger to use for request/response debug logging, or the value
841
+ # `:default` (the default) to construct a default logger, or `nil` to
842
+ # explicitly disable logging.
843
+ # @return [::Logger,:default,nil]
813
844
  #
814
845
  class Configuration
815
846
  extend ::Gapic::Config
@@ -834,6 +865,7 @@ module Google
834
865
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
835
866
  config_attr :quota_project, nil, ::String, nil
836
867
  config_attr :universe_domain, nil, ::String, nil
868
+ config_attr :logger, :default, ::Logger, nil, :default
837
869
 
838
870
  # @private
839
871
  def initialize parent_config = nil
@@ -126,14 +126,6 @@ module Google
126
126
  # Lists operations that match the specified filter in the request. If the
127
127
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
128
128
  #
129
- # NOTE: the `name` binding allows API services to override the binding
130
- # to use different resource name schemes, such as `users/*/operations`. To
131
- # override the binding, API services can add a binding such as
132
- # `"/v1/{name=users/*}/operations"` to their service configuration.
133
- # For backwards compatibility, the default name includes the operations
134
- # collection id, however overriding users must ensure the name binding
135
- # is the parent resource, without the operations collection id.
136
- #
137
129
  # @overload list_operations(request, options = nil)
138
130
  # Pass arguments to `list_operations` via a request object, either of type
139
131
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -223,7 +215,7 @@ module Google
223
215
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
224
216
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
225
217
  yield response, operation if block_given?
226
- return response
218
+ throw :response, response
227
219
  end
228
220
  rescue ::GRPC::BadStatus => e
229
221
  raise ::Google::Cloud::Error.from_error(e)
@@ -319,7 +311,7 @@ module Google
319
311
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
320
312
  response = ::Gapic::Operation.new response, @operations_client, options: options
321
313
  yield response, operation if block_given?
322
- return response
314
+ throw :response, response
323
315
  end
324
316
  rescue ::GRPC::BadStatus => e
325
317
  raise ::Google::Cloud::Error.from_error(e)
@@ -408,7 +400,6 @@ module Google
408
400
 
409
401
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
410
402
  yield response, operation if block_given?
411
- return response
412
403
  end
413
404
  rescue ::GRPC::BadStatus => e
414
405
  raise ::Google::Cloud::Error.from_error(e)
@@ -423,8 +414,9 @@ module Google
423
414
  # other methods to check whether the cancellation succeeded or whether the
424
415
  # operation completed despite cancellation. On successful cancellation,
425
416
  # the operation is not deleted; instead, it becomes an operation with
426
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
427
- # corresponding to `Code.CANCELLED`.
417
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
418
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
419
+ # `Code.CANCELLED`.
428
420
  #
429
421
  # @overload cancel_operation(request, options = nil)
430
422
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -503,7 +495,6 @@ module Google
503
495
 
504
496
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
505
497
  yield response, operation if block_given?
506
- return response
507
498
  end
508
499
  rescue ::GRPC::BadStatus => e
509
500
  raise ::Google::Cloud::Error.from_error(e)
@@ -601,7 +592,7 @@ module Google
601
592
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
602
593
  response = ::Gapic::Operation.new response, @operations_client, options: options
603
594
  yield response, operation if block_given?
604
- return response
595
+ throw :response, response
605
596
  end
606
597
  rescue ::GRPC::BadStatus => e
607
598
  raise ::Google::Cloud::Error.from_error(e)
@@ -651,6 +642,13 @@ module Google
651
642
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
652
643
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
653
644
  # * (`nil`) indicating no credentials
645
+ #
646
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
647
+ # external source for authentication to Google Cloud, you must validate it before
648
+ # providing it to a Google API client library. Providing an unvalidated credential
649
+ # configuration to Google APIs can compromise the security of your systems and data.
650
+ # For more information, refer to [Validate credential configurations from external
651
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
654
652
  # @return [::Object]
655
653
  # @!attribute [rw] scope
656
654
  # The OAuth scopes
@@ -690,6 +688,11 @@ module Google
690
688
  # default endpoint URL. The default value of nil uses the environment
691
689
  # universe (usually the default "googleapis.com" universe).
692
690
  # @return [::String,nil]
691
+ # @!attribute [rw] logger
692
+ # A custom logger to use for request/response debug logging, or the value
693
+ # `:default` (the default) to construct a default logger, or `nil` to
694
+ # explicitly disable logging.
695
+ # @return [::Logger,:default,nil]
693
696
  #
694
697
  class Configuration
695
698
  extend ::Gapic::Config
@@ -714,6 +717,7 @@ module Google
714
717
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
715
718
  config_attr :quota_project, nil, ::String, nil
716
719
  config_attr :universe_domain, nil, ::String, nil
720
+ config_attr :logger, :default, ::Logger, nil, :default
717
721
 
718
722
  # @private
719
723
  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
+ @consumer_procurement_service_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
+ @consumer_procurement_service_stub.logger
211
+ end
212
+
193
213
  # Service calls
194
214
 
195
215
  ##
@@ -295,7 +315,7 @@ module Google
295
315
  @consumer_procurement_service_stub.place_order request, options do |result, operation|
296
316
  result = ::Gapic::Operation.new result, @operations_client, options: options
297
317
  yield result, operation if block_given?
298
- return result
318
+ throw :response, result
299
319
  end
300
320
  rescue ::Gapic::Rest::Error => e
301
321
  raise ::Google::Cloud::Error.from_error(e)
@@ -375,7 +395,6 @@ module Google
375
395
 
376
396
  @consumer_procurement_service_stub.get_order request, options do |result, operation|
377
397
  yield result, operation if block_given?
378
- return result
379
398
  end
380
399
  rescue ::Gapic::Rest::Error => e
381
400
  raise ::Google::Cloud::Error.from_error(e)
@@ -485,7 +504,7 @@ module Google
485
504
  @consumer_procurement_service_stub.list_orders request, options do |result, operation|
486
505
  result = ::Gapic::Rest::PagedEnumerable.new @consumer_procurement_service_stub, :list_orders, "orders", request, result, options
487
506
  yield result, operation if block_given?
488
- return result
507
+ throw :response, result
489
508
  end
490
509
  rescue ::Gapic::Rest::Error => e
491
510
  raise ::Google::Cloud::Error.from_error(e)
@@ -584,7 +603,7 @@ module Google
584
603
  @consumer_procurement_service_stub.modify_order 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)
@@ -679,7 +698,7 @@ module Google
679
698
  @consumer_procurement_service_stub.cancel_order request, options do |result, operation|
680
699
  result = ::Gapic::Operation.new result, @operations_client, options: options
681
700
  yield result, operation if block_given?
682
- return result
701
+ throw :response, result
683
702
  end
684
703
  rescue ::Gapic::Rest::Error => e
685
704
  raise ::Google::Cloud::Error.from_error(e)
@@ -727,6 +746,13 @@ module Google
727
746
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
728
747
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
729
748
  # * (`nil`) indicating no credentials
749
+ #
750
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
751
+ # external source for authentication to Google Cloud, you must validate it before
752
+ # providing it to a Google API client library. Providing an unvalidated credential
753
+ # configuration to Google APIs can compromise the security of your systems and data.
754
+ # For more information, refer to [Validate credential configurations from external
755
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
730
756
  # @return [::Object]
731
757
  # @!attribute [rw] scope
732
758
  # The OAuth scopes
@@ -759,6 +785,11 @@ module Google
759
785
  # default endpoint URL. The default value of nil uses the environment
760
786
  # universe (usually the default "googleapis.com" universe).
761
787
  # @return [::String,nil]
788
+ # @!attribute [rw] logger
789
+ # A custom logger to use for request/response debug logging, or the value
790
+ # `:default` (the default) to construct a default logger, or `nil` to
791
+ # explicitly disable logging.
792
+ # @return [::Logger,:default,nil]
762
793
  #
763
794
  class Configuration
764
795
  extend ::Gapic::Config
@@ -780,6 +811,7 @@ module Google
780
811
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
781
812
  config_attr :quota_project, nil, ::String, nil
782
813
  config_attr :universe_domain, nil, ::String, nil
814
+ config_attr :logger, :default, ::Logger, nil, :default
783
815
 
784
816
  # @private
785
817
  def initialize parent_config = nil
@@ -117,14 +117,6 @@ module Google
117
117
  # Lists operations that match the specified filter in the request. If the
118
118
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
119
119
  #
120
- # NOTE: the `name` binding allows API services to override the binding
121
- # to use different resource name schemes, such as `users/*/operations`. To
122
- # override the binding, API services can add a binding such as
123
- # `"/v1/{name=users/*}/operations"` to their service configuration.
124
- # For backwards compatibility, the default name includes the operations
125
- # collection id, however overriding users must ensure the name binding
126
- # is the parent resource, without the operations collection id.
127
- #
128
120
  # @overload list_operations(request, options = nil)
129
121
  # Pass arguments to `list_operations` via a request object, either of type
130
122
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -206,7 +198,7 @@ module Google
206
198
  @operations_stub.list_operations request, options do |result, operation|
207
199
  result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
208
200
  yield result, operation if block_given?
209
- return result
201
+ throw :response, result
210
202
  end
211
203
  rescue ::Gapic::Rest::Error => e
212
204
  raise ::Google::Cloud::Error.from_error(e)
@@ -295,7 +287,7 @@ module Google
295
287
  @operations_stub.get_operation request, options do |result, operation|
296
288
  result = ::Gapic::Operation.new result, @operations_client, options: options
297
289
  yield result, operation if block_given?
298
- return result
290
+ throw :response, result
299
291
  end
300
292
  rescue ::Gapic::Rest::Error => e
301
293
  raise ::Google::Cloud::Error.from_error(e)
@@ -377,7 +369,6 @@ module Google
377
369
 
378
370
  @operations_stub.delete_operation request, options do |result, operation|
379
371
  yield result, operation if block_given?
380
- return result
381
372
  end
382
373
  rescue ::Gapic::Rest::Error => e
383
374
  raise ::Google::Cloud::Error.from_error(e)
@@ -392,8 +383,9 @@ module Google
392
383
  # other methods to check whether the cancellation succeeded or whether the
393
384
  # operation completed despite cancellation. On successful cancellation,
394
385
  # the operation is not deleted; instead, it becomes an operation with
395
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
396
- # corresponding to `Code.CANCELLED`.
386
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
387
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
388
+ # `Code.CANCELLED`.
397
389
  #
398
390
  # @overload cancel_operation(request, options = nil)
399
391
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -465,7 +457,6 @@ module Google
465
457
 
466
458
  @operations_stub.cancel_operation request, options do |result, operation|
467
459
  yield result, operation if block_given?
468
- return result
469
460
  end
470
461
  rescue ::Gapic::Rest::Error => e
471
462
  raise ::Google::Cloud::Error.from_error(e)
@@ -513,6 +504,13 @@ module Google
513
504
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
514
505
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
515
506
  # * (`nil`) indicating no credentials
507
+ #
508
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
509
+ # external source for authentication to Google Cloud, you must validate it before
510
+ # providing it to a Google API client library. Providing an unvalidated credential
511
+ # configuration to Google APIs can compromise the security of your systems and data.
512
+ # For more information, refer to [Validate credential configurations from external
513
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
516
514
  # @return [::Object]
517
515
  # @!attribute [rw] scope
518
516
  # The OAuth scopes
@@ -545,6 +543,11 @@ module Google
545
543
  # default endpoint URL. The default value of nil uses the environment
546
544
  # universe (usually the default "googleapis.com" universe).
547
545
  # @return [::String,nil]
546
+ # @!attribute [rw] logger
547
+ # A custom logger to use for request/response debug logging, or the value
548
+ # `:default` (the default) to construct a default logger, or `nil` to
549
+ # explicitly disable logging.
550
+ # @return [::Logger,:default,nil]
548
551
  #
549
552
  class Configuration
550
553
  extend ::Gapic::Config
@@ -566,6 +569,7 @@ module Google
566
569
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
567
570
  config_attr :quota_project, nil, ::String, nil
568
571
  config_attr :universe_domain, nil, ::String, nil
572
+ config_attr :logger, :default, ::Logger, nil, :default
569
573
 
570
574
  # @private
571
575
  def initialize parent_config = nil
@@ -685,16 +689,18 @@ module Google
685
689
 
686
690
  response = @client_stub.make_http_request(
687
691
  verb,
688
- uri: uri,
689
- body: body || "",
690
- params: query_string_params,
692
+ uri: uri,
693
+ body: body || "",
694
+ params: query_string_params,
695
+ method_name: "list_operations",
691
696
  options: options
692
697
  )
693
698
  operation = ::Gapic::Rest::TransportOperation.new response
694
699
  result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
695
-
696
- yield result, operation if block_given?
697
- result
700
+ catch :response do
701
+ yield result, operation if block_given?
702
+ result
703
+ end
698
704
  end
699
705
 
700
706
  ##
@@ -723,16 +729,18 @@ module Google
723
729
 
724
730
  response = @client_stub.make_http_request(
725
731
  verb,
726
- uri: uri,
727
- body: body || "",
728
- params: query_string_params,
732
+ uri: uri,
733
+ body: body || "",
734
+ params: query_string_params,
735
+ method_name: "get_operation",
729
736
  options: options
730
737
  )
731
738
  operation = ::Gapic::Rest::TransportOperation.new response
732
739
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
733
-
734
- yield result, operation if block_given?
735
- result
740
+ catch :response do
741
+ yield result, operation if block_given?
742
+ result
743
+ end
736
744
  end
737
745
 
738
746
  ##
@@ -761,16 +769,18 @@ module Google
761
769
 
762
770
  response = @client_stub.make_http_request(
763
771
  verb,
764
- uri: uri,
765
- body: body || "",
766
- params: query_string_params,
772
+ uri: uri,
773
+ body: body || "",
774
+ params: query_string_params,
775
+ method_name: "delete_operation",
767
776
  options: options
768
777
  )
769
778
  operation = ::Gapic::Rest::TransportOperation.new response
770
779
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
771
-
772
- yield result, operation if block_given?
773
- result
780
+ catch :response do
781
+ yield result, operation if block_given?
782
+ result
783
+ end
774
784
  end
775
785
 
776
786
  ##
@@ -799,16 +809,18 @@ module Google
799
809
 
800
810
  response = @client_stub.make_http_request(
801
811
  verb,
802
- uri: uri,
803
- body: body || "",
804
- params: query_string_params,
812
+ uri: uri,
813
+ body: body || "",
814
+ params: query_string_params,
815
+ method_name: "cancel_operation",
805
816
  options: options
806
817
  )
807
818
  operation = ::Gapic::Rest::TransportOperation.new response
808
819
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
809
-
810
- yield result, operation if block_given?
811
- result
820
+ catch :response do
821
+ yield result, operation if block_given?
822
+ result
823
+ end
812
824
  end
813
825
 
814
826
  ##