google-cloud-storage_insights-v1 0.5.0 → 0.6.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: df52b0c341a099f3ad6d8a00eb5deb5e747db2611d5951e8ac7c0713c2bed500
4
- data.tar.gz: 5779c12a5ad084a0e299f23fd955ed30947bcb0746d36bfbb2b01ac6c3e7fd57
3
+ metadata.gz: 0bf16fe552f717324df1aa8b402898ebc2fc319d7aaad151655ffa0ff305c5f1
4
+ data.tar.gz: 7a426ce3dec5d21dbe95b4b8295f3f7fa9c054bb26d6e6307f4e6f343d648d12
5
5
  SHA512:
6
- metadata.gz: ee0bded7f7f02bd06fb3073f869bafca5a0838ade621b6fbecc63f27abba3c4ef77f7d438c03dd824ec798f5cb11d603a4dcebcbd18f8a1be8ccc626bb8cad39
7
- data.tar.gz: 2a014069d5a6c5150957e5a91f436ae482e9e3063efb812fdc125e5ad4b684d61b3e9935da0f6ab8542471e0700c78690af720c6acaf6f11dca35594365f4204
6
+ metadata.gz: 6e81a758672f1c4174bfa1aefaee8edf766d98e8c8a868587880bcad087cedf8a26d4efc4c890db5431bdec6f8730efd12b798121b81a4c1d438cc2a9ee07dde
7
+ data.tar.gz: 14cb526aa7421fc8379d8f0c188e131d53060d6f885c16a403de68c78e308a08c74a3ae681ac1d78defa60b06503d220da4cd3f4ce41bfa6db4d49a8a2d35c75
data/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  Provides insights capability on Google Cloud Storage.
4
4
 
5
- Provides insights capability on Google Cloud Storage.
6
5
 
7
6
  https://github.com/googleapis/google-cloud-ruby
8
7
 
@@ -43,33 +42,43 @@ for class and method documentation.
43
42
  See also the [Product Documentation](https://cloud.google.com/storage/docs/insights/storage-insights)
44
43
  for general usage information.
45
44
 
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:
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:
55
72
 
56
73
  ```ruby
74
+ require "google/cloud/storage_insights/v1"
57
75
  require "logger"
58
76
 
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
77
+ client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config|
78
+ config.logger = Logger.new "my-app.log"
69
79
  end
70
80
  ```
71
81
 
72
-
73
82
  ## Google Cloud Samples
74
83
 
75
84
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -31,6 +31,9 @@ module Google
31
31
  # Service describing handlers for resources
32
32
  #
33
33
  class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
34
37
  # @private
35
38
  DEFAULT_ENDPOINT_TEMPLATE = "storageinsights.$UNIVERSE_DOMAIN$"
36
39
 
@@ -177,14 +180,26 @@ module Google
177
180
  universe_domain: @config.universe_domain,
178
181
  channel_args: @config.channel_args,
179
182
  interceptors: @config.interceptors,
180
- channel_pool_config: @config.channel_pool
183
+ channel_pool_config: @config.channel_pool,
184
+ logger: @config.logger
181
185
  )
182
186
 
187
+ @storage_insights_stub.stub_logger&.info do |entry|
188
+ entry.set_system_name
189
+ entry.set_service
190
+ entry.message = "Created client for #{entry.service}"
191
+ entry.set_credentials_fields credentials
192
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
193
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
194
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
195
+ end
196
+
183
197
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
184
198
  config.credentials = credentials
185
199
  config.quota_project = @quota_project_id
186
200
  config.endpoint = @storage_insights_stub.endpoint
187
201
  config.universe_domain = @storage_insights_stub.universe_domain
202
+ config.logger = @storage_insights_stub.logger if config.respond_to? :logger=
188
203
  end
189
204
  end
190
205
 
@@ -195,6 +210,15 @@ module Google
195
210
  #
196
211
  attr_reader :location_client
197
212
 
213
+ ##
214
+ # The logger used for request/response debug logging.
215
+ #
216
+ # @return [Logger]
217
+ #
218
+ def logger
219
+ @storage_insights_stub.logger
220
+ end
221
+
198
222
  # Service calls
199
223
 
200
224
  ##
@@ -265,10 +289,11 @@ module Google
265
289
  # Customize the options with defaults
266
290
  metadata = @config.rpcs.list_report_configs.metadata.to_h
267
291
 
268
- # Set x-goog-api-client and x-goog-user-project headers
292
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
269
293
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
270
294
  lib_name: @config.lib_name, lib_version: @config.lib_version,
271
295
  gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
296
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
272
297
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
273
298
 
274
299
  header_params = {}
@@ -290,7 +315,7 @@ module Google
290
315
  @storage_insights_stub.call_rpc :list_report_configs, request, options: options do |response, operation|
291
316
  response = ::Gapic::PagedEnumerable.new @storage_insights_stub, :list_report_configs, request, response, operation, options
292
317
  yield response, operation if block_given?
293
- return response
318
+ throw :response, response
294
319
  end
295
320
  rescue ::GRPC::BadStatus => e
296
321
  raise ::Google::Cloud::Error.from_error(e)
@@ -351,10 +376,11 @@ module Google
351
376
  # Customize the options with defaults
352
377
  metadata = @config.rpcs.get_report_config.metadata.to_h
353
378
 
354
- # Set x-goog-api-client and x-goog-user-project headers
379
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
355
380
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
356
381
  lib_name: @config.lib_name, lib_version: @config.lib_version,
357
382
  gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
383
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
358
384
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
359
385
 
360
386
  header_params = {}
@@ -375,7 +401,6 @@ module Google
375
401
 
376
402
  @storage_insights_stub.call_rpc :get_report_config, request, options: options do |response, operation|
377
403
  yield response, operation if block_given?
378
- return response
379
404
  end
380
405
  rescue ::GRPC::BadStatus => e
381
406
  raise ::Google::Cloud::Error.from_error(e)
@@ -452,10 +477,11 @@ module Google
452
477
  # Customize the options with defaults
453
478
  metadata = @config.rpcs.create_report_config.metadata.to_h
454
479
 
455
- # Set x-goog-api-client and x-goog-user-project headers
480
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
456
481
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
457
482
  lib_name: @config.lib_name, lib_version: @config.lib_version,
458
483
  gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
484
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
459
485
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
460
486
 
461
487
  header_params = {}
@@ -476,7 +502,6 @@ module Google
476
502
 
477
503
  @storage_insights_stub.call_rpc :create_report_config, request, options: options do |response, operation|
478
504
  yield response, operation if block_given?
479
- return response
480
505
  end
481
506
  rescue ::GRPC::BadStatus => e
482
507
  raise ::Google::Cloud::Error.from_error(e)
@@ -557,10 +582,11 @@ module Google
557
582
  # Customize the options with defaults
558
583
  metadata = @config.rpcs.update_report_config.metadata.to_h
559
584
 
560
- # Set x-goog-api-client and x-goog-user-project headers
585
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
561
586
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
562
587
  lib_name: @config.lib_name, lib_version: @config.lib_version,
563
588
  gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
589
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
564
590
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
565
591
 
566
592
  header_params = {}
@@ -581,7 +607,6 @@ module Google
581
607
 
582
608
  @storage_insights_stub.call_rpc :update_report_config, request, options: options do |response, operation|
583
609
  yield response, operation if block_given?
584
- return response
585
610
  end
586
611
  rescue ::GRPC::BadStatus => e
587
612
  raise ::Google::Cloud::Error.from_error(e)
@@ -658,10 +683,11 @@ module Google
658
683
  # Customize the options with defaults
659
684
  metadata = @config.rpcs.delete_report_config.metadata.to_h
660
685
 
661
- # Set x-goog-api-client and x-goog-user-project headers
686
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
662
687
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
663
688
  lib_name: @config.lib_name, lib_version: @config.lib_version,
664
689
  gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
690
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
665
691
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
666
692
 
667
693
  header_params = {}
@@ -682,7 +708,6 @@ module Google
682
708
 
683
709
  @storage_insights_stub.call_rpc :delete_report_config, request, options: options do |response, operation|
684
710
  yield response, operation if block_given?
685
- return response
686
711
  end
687
712
  rescue ::GRPC::BadStatus => e
688
713
  raise ::Google::Cloud::Error.from_error(e)
@@ -756,10 +781,11 @@ module Google
756
781
  # Customize the options with defaults
757
782
  metadata = @config.rpcs.list_report_details.metadata.to_h
758
783
 
759
- # Set x-goog-api-client and x-goog-user-project headers
784
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
760
785
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
761
786
  lib_name: @config.lib_name, lib_version: @config.lib_version,
762
787
  gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
788
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
763
789
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
764
790
 
765
791
  header_params = {}
@@ -781,7 +807,7 @@ module Google
781
807
  @storage_insights_stub.call_rpc :list_report_details, request, options: options do |response, operation|
782
808
  response = ::Gapic::PagedEnumerable.new @storage_insights_stub, :list_report_details, request, response, operation, options
783
809
  yield response, operation if block_given?
784
- return response
810
+ throw :response, response
785
811
  end
786
812
  rescue ::GRPC::BadStatus => e
787
813
  raise ::Google::Cloud::Error.from_error(e)
@@ -842,10 +868,11 @@ module Google
842
868
  # Customize the options with defaults
843
869
  metadata = @config.rpcs.get_report_detail.metadata.to_h
844
870
 
845
- # Set x-goog-api-client and x-goog-user-project headers
871
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
846
872
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
847
873
  lib_name: @config.lib_name, lib_version: @config.lib_version,
848
874
  gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
875
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
849
876
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
850
877
 
851
878
  header_params = {}
@@ -866,7 +893,6 @@ module Google
866
893
 
867
894
  @storage_insights_stub.call_rpc :get_report_detail, request, options: options do |response, operation|
868
895
  yield response, operation if block_given?
869
- return response
870
896
  end
871
897
  rescue ::GRPC::BadStatus => e
872
898
  raise ::Google::Cloud::Error.from_error(e)
@@ -955,6 +981,11 @@ module Google
955
981
  # default endpoint URL. The default value of nil uses the environment
956
982
  # universe (usually the default "googleapis.com" universe).
957
983
  # @return [::String,nil]
984
+ # @!attribute [rw] logger
985
+ # A custom logger to use for request/response debug logging, or the value
986
+ # `:default` (the default) to construct a default logger, or `nil` to
987
+ # explicitly disable logging.
988
+ # @return [::Logger,:default,nil]
958
989
  #
959
990
  class Configuration
960
991
  extend ::Gapic::Config
@@ -979,6 +1010,7 @@ module Google
979
1010
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
980
1011
  config_attr :quota_project, nil, ::String, nil
981
1012
  config_attr :universe_domain, nil, ::String, nil
1013
+ config_attr :logger, :default, ::Logger, nil, :default
982
1014
 
983
1015
  # @private
984
1016
  def initialize parent_config = nil
@@ -33,6 +33,9 @@ module Google
33
33
  # Service describing handlers for resources
34
34
  #
35
35
  class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
36
39
  # @private
37
40
  DEFAULT_ENDPOINT_TEMPLATE = "storageinsights.$UNIVERSE_DOMAIN$"
38
41
 
@@ -170,15 +173,27 @@ module Google
170
173
  endpoint: @config.endpoint,
171
174
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
172
175
  universe_domain: @config.universe_domain,
173
- credentials: credentials
176
+ credentials: credentials,
177
+ logger: @config.logger
174
178
  )
175
179
 
180
+ @storage_insights_stub.logger(stub: true)&.info do |entry|
181
+ entry.set_system_name
182
+ entry.set_service
183
+ entry.message = "Created client for #{entry.service}"
184
+ entry.set_credentials_fields credentials
185
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
186
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
187
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
188
+ end
189
+
176
190
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
177
191
  config.credentials = credentials
178
192
  config.quota_project = @quota_project_id
179
193
  config.endpoint = @storage_insights_stub.endpoint
180
194
  config.universe_domain = @storage_insights_stub.universe_domain
181
195
  config.bindings_override = @config.bindings_override
196
+ config.logger = @storage_insights_stub.logger if config.respond_to? :logger=
182
197
  end
183
198
  end
184
199
 
@@ -189,6 +204,15 @@ module Google
189
204
  #
190
205
  attr_reader :location_client
191
206
 
207
+ ##
208
+ # The logger used for request/response debug logging.
209
+ #
210
+ # @return [Logger]
211
+ #
212
+ def logger
213
+ @storage_insights_stub.logger
214
+ end
215
+
192
216
  # Service calls
193
217
 
194
218
  ##
@@ -258,12 +282,13 @@ module Google
258
282
  # Customize the options with defaults
259
283
  call_metadata = @config.rpcs.list_report_configs.metadata.to_h
260
284
 
261
- # Set x-goog-api-client and x-goog-user-project headers
285
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
262
286
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
263
287
  lib_name: @config.lib_name, lib_version: @config.lib_version,
264
288
  gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION,
265
289
  transports_version_send: [:rest]
266
290
 
291
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
267
292
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
268
293
 
269
294
  options.apply_defaults timeout: @config.rpcs.list_report_configs.timeout,
@@ -276,7 +301,6 @@ module Google
276
301
 
277
302
  @storage_insights_stub.list_report_configs request, options do |result, operation|
278
303
  yield result, operation if block_given?
279
- return result
280
304
  end
281
305
  rescue ::Gapic::Rest::Error => e
282
306
  raise ::Google::Cloud::Error.from_error(e)
@@ -336,12 +360,13 @@ module Google
336
360
  # Customize the options with defaults
337
361
  call_metadata = @config.rpcs.get_report_config.metadata.to_h
338
362
 
339
- # Set x-goog-api-client and x-goog-user-project headers
363
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
340
364
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
341
365
  lib_name: @config.lib_name, lib_version: @config.lib_version,
342
366
  gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION,
343
367
  transports_version_send: [:rest]
344
368
 
369
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
345
370
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
346
371
 
347
372
  options.apply_defaults timeout: @config.rpcs.get_report_config.timeout,
@@ -354,7 +379,6 @@ module Google
354
379
 
355
380
  @storage_insights_stub.get_report_config request, options do |result, operation|
356
381
  yield result, operation if block_given?
357
- return result
358
382
  end
359
383
  rescue ::Gapic::Rest::Error => e
360
384
  raise ::Google::Cloud::Error.from_error(e)
@@ -430,12 +454,13 @@ module Google
430
454
  # Customize the options with defaults
431
455
  call_metadata = @config.rpcs.create_report_config.metadata.to_h
432
456
 
433
- # Set x-goog-api-client and x-goog-user-project headers
457
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
434
458
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
435
459
  lib_name: @config.lib_name, lib_version: @config.lib_version,
436
460
  gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION,
437
461
  transports_version_send: [:rest]
438
462
 
463
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
439
464
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
440
465
 
441
466
  options.apply_defaults timeout: @config.rpcs.create_report_config.timeout,
@@ -448,7 +473,6 @@ module Google
448
473
 
449
474
  @storage_insights_stub.create_report_config request, options do |result, operation|
450
475
  yield result, operation if block_given?
451
- return result
452
476
  end
453
477
  rescue ::Gapic::Rest::Error => e
454
478
  raise ::Google::Cloud::Error.from_error(e)
@@ -528,12 +552,13 @@ module Google
528
552
  # Customize the options with defaults
529
553
  call_metadata = @config.rpcs.update_report_config.metadata.to_h
530
554
 
531
- # Set x-goog-api-client and x-goog-user-project headers
555
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
532
556
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
533
557
  lib_name: @config.lib_name, lib_version: @config.lib_version,
534
558
  gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION,
535
559
  transports_version_send: [:rest]
536
560
 
561
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
537
562
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
538
563
 
539
564
  options.apply_defaults timeout: @config.rpcs.update_report_config.timeout,
@@ -546,7 +571,6 @@ module Google
546
571
 
547
572
  @storage_insights_stub.update_report_config request, options do |result, operation|
548
573
  yield result, operation if block_given?
549
- return result
550
574
  end
551
575
  rescue ::Gapic::Rest::Error => e
552
576
  raise ::Google::Cloud::Error.from_error(e)
@@ -622,12 +646,13 @@ module Google
622
646
  # Customize the options with defaults
623
647
  call_metadata = @config.rpcs.delete_report_config.metadata.to_h
624
648
 
625
- # Set x-goog-api-client and x-goog-user-project headers
649
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
626
650
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
627
651
  lib_name: @config.lib_name, lib_version: @config.lib_version,
628
652
  gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION,
629
653
  transports_version_send: [:rest]
630
654
 
655
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
631
656
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
632
657
 
633
658
  options.apply_defaults timeout: @config.rpcs.delete_report_config.timeout,
@@ -640,7 +665,6 @@ module Google
640
665
 
641
666
  @storage_insights_stub.delete_report_config request, options do |result, operation|
642
667
  yield result, operation if block_given?
643
- return result
644
668
  end
645
669
  rescue ::Gapic::Rest::Error => e
646
670
  raise ::Google::Cloud::Error.from_error(e)
@@ -713,12 +737,13 @@ module Google
713
737
  # Customize the options with defaults
714
738
  call_metadata = @config.rpcs.list_report_details.metadata.to_h
715
739
 
716
- # Set x-goog-api-client and x-goog-user-project headers
740
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
717
741
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
718
742
  lib_name: @config.lib_name, lib_version: @config.lib_version,
719
743
  gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION,
720
744
  transports_version_send: [:rest]
721
745
 
746
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
722
747
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
723
748
 
724
749
  options.apply_defaults timeout: @config.rpcs.list_report_details.timeout,
@@ -731,7 +756,6 @@ module Google
731
756
 
732
757
  @storage_insights_stub.list_report_details request, options do |result, operation|
733
758
  yield result, operation if block_given?
734
- return result
735
759
  end
736
760
  rescue ::Gapic::Rest::Error => e
737
761
  raise ::Google::Cloud::Error.from_error(e)
@@ -791,12 +815,13 @@ module Google
791
815
  # Customize the options with defaults
792
816
  call_metadata = @config.rpcs.get_report_detail.metadata.to_h
793
817
 
794
- # Set x-goog-api-client and x-goog-user-project headers
818
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
795
819
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
796
820
  lib_name: @config.lib_name, lib_version: @config.lib_version,
797
821
  gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION,
798
822
  transports_version_send: [:rest]
799
823
 
824
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
800
825
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
801
826
 
802
827
  options.apply_defaults timeout: @config.rpcs.get_report_detail.timeout,
@@ -809,7 +834,6 @@ module Google
809
834
 
810
835
  @storage_insights_stub.get_report_detail request, options do |result, operation|
811
836
  yield result, operation if block_given?
812
- return result
813
837
  end
814
838
  rescue ::Gapic::Rest::Error => e
815
839
  raise ::Google::Cloud::Error.from_error(e)
@@ -889,6 +913,11 @@ module Google
889
913
  # default endpoint URL. The default value of nil uses the environment
890
914
  # universe (usually the default "googleapis.com" universe).
891
915
  # @return [::String,nil]
916
+ # @!attribute [rw] logger
917
+ # A custom logger to use for request/response debug logging, or the value
918
+ # `:default` (the default) to construct a default logger, or `nil` to
919
+ # explicitly disable logging.
920
+ # @return [::Logger,:default,nil]
892
921
  #
893
922
  class Configuration
894
923
  extend ::Gapic::Config
@@ -917,6 +946,7 @@ module Google
917
946
  # by the host service.
918
947
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
919
948
  config_attr :bindings_override, {}, ::Hash, nil
949
+ config_attr :logger, :default, ::Logger, nil, :default
920
950
 
921
951
  # @private
922
952
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the list_report_configs REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "list_report_configs",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::StorageInsights::V1::ListReportConfigsResponse.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "get_report_config",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::StorageInsights::V1::ReportConfig.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "create_report_config",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::StorageInsights::V1::ReportConfig.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "update_report_config",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Cloud::StorageInsights::V1::ReportConfig.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "delete_report_config",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -277,16 +299,18 @@ module Google
277
299
 
278
300
  response = @client_stub.make_http_request(
279
301
  verb,
280
- uri: uri,
281
- body: body || "",
282
- params: query_string_params,
302
+ uri: uri,
303
+ body: body || "",
304
+ params: query_string_params,
305
+ method_name: "list_report_details",
283
306
  options: options
284
307
  )
285
308
  operation = ::Gapic::Rest::TransportOperation.new response
286
309
  result = ::Google::Cloud::StorageInsights::V1::ListReportDetailsResponse.decode_json response.body, ignore_unknown_fields: true
287
-
288
- yield result, operation if block_given?
289
- result
310
+ catch :response do
311
+ yield result, operation if block_given?
312
+ result
313
+ end
290
314
  end
291
315
 
292
316
  ##
@@ -315,16 +339,18 @@ module Google
315
339
 
316
340
  response = @client_stub.make_http_request(
317
341
  verb,
318
- uri: uri,
319
- body: body || "",
320
- params: query_string_params,
342
+ uri: uri,
343
+ body: body || "",
344
+ params: query_string_params,
345
+ method_name: "get_report_detail",
321
346
  options: options
322
347
  )
323
348
  operation = ::Gapic::Rest::TransportOperation.new response
324
349
  result = ::Google::Cloud::StorageInsights::V1::ReportDetail.decode_json response.body, ignore_unknown_fields: true
325
-
326
- yield result, operation if block_given?
327
- result
350
+ catch :response do
351
+ yield result, operation if block_given?
352
+ result
353
+ end
328
354
  end
329
355
 
330
356
  ##
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module StorageInsights
23
23
  module V1
24
- VERSION = "0.5.0"
24
+ VERSION = "0.6.0"
25
25
  end
26
26
  end
27
27
  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
@@ -118,6 +121,10 @@ module Google
118
121
  # @return [::String]
119
122
  # Optional link to proto reference documentation. Example:
120
123
  # https://cloud.google.com/pubsub/lite/docs/reference/rpc
124
+ # @!attribute [rw] rest_reference_documentation_uri
125
+ # @return [::String]
126
+ # Optional link to REST reference documentation. Example:
127
+ # https://cloud.google.com/pubsub/lite/docs/reference/rest
121
128
  class Publishing
122
129
  include ::Google::Protobuf::MessageExts
123
130
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -192,9 +199,32 @@ module Google
192
199
  # @!attribute [rw] common
193
200
  # @return [::Google::Api::CommonLanguageSettings]
194
201
  # Some settings.
202
+ # @!attribute [rw] experimental_features
203
+ # @return [::Google::Api::PythonSettings::ExperimentalFeatures]
204
+ # Experimental features to be included during client library generation.
195
205
  class PythonSettings
196
206
  include ::Google::Protobuf::MessageExts
197
207
  extend ::Google::Protobuf::MessageExts::ClassMethods
208
+
209
+ # Experimental features to be included during client library generation.
210
+ # These fields will be deprecated once the feature graduates and is enabled
211
+ # by default.
212
+ # @!attribute [rw] rest_async_io_enabled
213
+ # @return [::Boolean]
214
+ # Enables generation of asynchronous REST clients if `rest` transport is
215
+ # enabled. By default, asynchronous REST clients will not be generated.
216
+ # This feature will be enabled by default 1 month after launching the
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.
224
+ class ExperimentalFeatures
225
+ include ::Google::Protobuf::MessageExts
226
+ extend ::Google::Protobuf::MessageExts::ClassMethods
227
+ end
198
228
  end
199
229
 
200
230
  # Settings for Node client libraries.
@@ -276,9 +306,28 @@ module Google
276
306
  # @!attribute [rw] common
277
307
  # @return [::Google::Api::CommonLanguageSettings]
278
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
279
319
  class GoSettings
280
320
  include ::Google::Protobuf::MessageExts
281
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
282
331
  end
283
332
 
284
333
  # Describes the generator configuration for a method.
@@ -286,6 +335,13 @@ module Google
286
335
  # @return [::String]
287
336
  # The fully qualified name of the method, for which the options below apply.
288
337
  # This is used to find the method to apply the options.
338
+ #
339
+ # Example:
340
+ #
341
+ # publishing:
342
+ # method_settings:
343
+ # - selector: google.storage.control.v2.StorageControl.CreateFolder
344
+ # # method settings for CreateFolder...
289
345
  # @!attribute [rw] long_running
290
346
  # @return [::Google::Api::MethodSettings::LongRunning]
291
347
  # Describes settings to use for long-running operations when generating
@@ -294,17 +350,14 @@ module Google
294
350
  #
295
351
  # Example of a YAML configuration::
296
352
  #
297
- # publishing:
298
- # method_settings:
353
+ # publishing:
354
+ # method_settings:
299
355
  # - selector: google.cloud.speech.v2.Speech.BatchRecognize
300
356
  # long_running:
301
- # initial_poll_delay:
302
- # seconds: 60 # 1 minute
357
+ # initial_poll_delay: 60s # 1 minute
303
358
  # poll_delay_multiplier: 1.5
304
- # max_poll_delay:
305
- # seconds: 360 # 6 minutes
306
- # total_poll_timeout:
307
- # seconds: 54000 # 90 minutes
359
+ # max_poll_delay: 360s # 6 minutes
360
+ # total_poll_timeout: 54000s # 90 minutes
308
361
  # @!attribute [rw] auto_populated_fields
309
362
  # @return [::Array<::String>]
310
363
  # List of top-level fields of the request message, that should be
@@ -313,8 +366,8 @@ module Google
313
366
  #
314
367
  # Example of a YAML configuration:
315
368
  #
316
- # publishing:
317
- # method_settings:
369
+ # publishing:
370
+ # method_settings:
318
371
  # - selector: google.example.v1.ExampleService.CreateExample
319
372
  # auto_populated_fields:
320
373
  # - request_id
@@ -350,6 +403,17 @@ module Google
350
403
  end
351
404
  end
352
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
+
353
417
  # The organization for which the client libraries are being published.
354
418
  # Affects the url where generated docs are published, etc.
355
419
  module ClientLibraryOrganization
@@ -124,8 +124,13 @@ module Google
124
124
  # @return [::String]
125
125
  # The plural name used in the resource name and permission names, such as
126
126
  # 'projects' for the resource name of 'projects/\\{project}' and the permission
127
- # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
128
- # concept of the `plural` field in k8s CRD spec
127
+ # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
128
+ # to this is for Nested Collections that have stuttering names, as defined
129
+ # in [AIP-122](https://google.aip.dev/122#nested-collections), where the
130
+ # collection ID in the resource name pattern does not necessarily directly
131
+ # match the `plural` value.
132
+ #
133
+ # It is the same concept of the `plural` field in k8s CRD spec
129
134
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
130
135
  #
131
136
  # Note: The plural form is required even for singleton resources. See
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-storage_insights-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.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-02-26 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
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
- rubygems_version: 3.5.6
127
+ rubygems_version: 3.5.23
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Provides insights capability on Google Cloud Storage.