google-cloud-managed_kafka-v1 0.2.0 → 0.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: 1368d318c076a048cb519fb03bd38e603b17917dcae6fba986250f818bd2a3d7
4
- data.tar.gz: e23f9a22c7a6df14761ecf4ca2539619e9e9cce3e7223c8ab42ecf71ad47830d
3
+ metadata.gz: a47e726021fe5724d64480fd8b409cdfe8e83c7eb42237efe475f273522a5815
4
+ data.tar.gz: 268db2f077b6569f531b1c1a3d4d42b4279550227e3a7127cc16c976d40a2ad5
5
5
  SHA512:
6
- metadata.gz: ed412345ed41d114c78132b1019ccce5e7771ac1ffd4cb19bc87589d16c65e492cd4888e8a142f16bd7a00d5a81ea96059f1287ed967812e19cbaaab62d26307
7
- data.tar.gz: f6a8a6d8e0aed81011a0d5994fd6f73c4c2fc462f0cc8687c3ef8d1da8ccf4c1e501527ce9dba02f3895a7cd6bcc5f9ab639d81af1a9068a7020ad952625d063
6
+ metadata.gz: 80c5eb115f828c14a723b9be6014142bbbab2937540920c658fdc41925bbb9fa9e3c2356ad6fc5ae4b68efe8103192743031020733ee085d96f53b713eb6101f
7
+ data.tar.gz: a9bc82cc0739bc5938f555afb81ec03b62e98a8c6cb650c2a59ca003fbb269ecb48c8e0618c68b0eebb184e01f4ce46f0c16a9f71d7bda3ba63bfcc4e8892cda
data/README.md CHANGED
@@ -42,33 +42,43 @@ for class and method documentation.
42
42
  See also the [Product Documentation](https://cloud.google.com/managed-service-for-apache-kafka/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/managed_kafka/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::ManagedKafka::V1::ManagedKafka::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).
@@ -212,14 +212,26 @@ module Google
212
212
  universe_domain: @config.universe_domain,
213
213
  channel_args: @config.channel_args,
214
214
  interceptors: @config.interceptors,
215
- channel_pool_config: @config.channel_pool
215
+ channel_pool_config: @config.channel_pool,
216
+ logger: @config.logger
216
217
  )
217
218
 
219
+ @managed_kafka_stub.stub_logger&.info do |entry|
220
+ entry.set_system_name
221
+ entry.set_service
222
+ entry.message = "Created client for #{entry.service}"
223
+ entry.set_credentials_fields credentials
224
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
225
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
226
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
227
+ end
228
+
218
229
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
219
230
  config.credentials = credentials
220
231
  config.quota_project = @quota_project_id
221
232
  config.endpoint = @managed_kafka_stub.endpoint
222
233
  config.universe_domain = @managed_kafka_stub.universe_domain
234
+ config.logger = @managed_kafka_stub.logger if config.respond_to? :logger=
223
235
  end
224
236
  end
225
237
 
@@ -237,6 +249,15 @@ module Google
237
249
  #
238
250
  attr_reader :location_client
239
251
 
252
+ ##
253
+ # The logger used for request/response debug logging.
254
+ #
255
+ # @return [Logger]
256
+ #
257
+ def logger
258
+ @managed_kafka_stub.logger
259
+ end
260
+
240
261
  # Service calls
241
262
 
242
263
  ##
@@ -339,7 +360,7 @@ module Google
339
360
  @managed_kafka_stub.call_rpc :list_clusters, request, options: options do |response, operation|
340
361
  response = ::Gapic::PagedEnumerable.new @managed_kafka_stub, :list_clusters, request, response, operation, options
341
362
  yield response, operation if block_given?
342
- return response
363
+ throw :response, response
343
364
  end
344
365
  rescue ::GRPC::BadStatus => e
345
366
  raise ::Google::Cloud::Error.from_error(e)
@@ -425,7 +446,6 @@ module Google
425
446
 
426
447
  @managed_kafka_stub.call_rpc :get_cluster, request, options: options do |response, operation|
427
448
  yield response, operation if block_given?
428
- return response
429
449
  end
430
450
  rescue ::GRPC::BadStatus => e
431
451
  raise ::Google::Cloud::Error.from_error(e)
@@ -545,7 +565,7 @@ module Google
545
565
  @managed_kafka_stub.call_rpc :create_cluster, request, options: options do |response, operation|
546
566
  response = ::Gapic::Operation.new response, @operations_client, options: options
547
567
  yield response, operation if block_given?
548
- return response
568
+ throw :response, response
549
569
  end
550
570
  rescue ::GRPC::BadStatus => e
551
571
  raise ::Google::Cloud::Error.from_error(e)
@@ -660,7 +680,7 @@ module Google
660
680
  @managed_kafka_stub.call_rpc :update_cluster, request, options: options do |response, operation|
661
681
  response = ::Gapic::Operation.new response, @operations_client, options: options
662
682
  yield response, operation if block_given?
663
- return response
683
+ throw :response, response
664
684
  end
665
685
  rescue ::GRPC::BadStatus => e
666
686
  raise ::Google::Cloud::Error.from_error(e)
@@ -769,7 +789,7 @@ module Google
769
789
  @managed_kafka_stub.call_rpc :delete_cluster, request, options: options do |response, operation|
770
790
  response = ::Gapic::Operation.new response, @operations_client, options: options
771
791
  yield response, operation if block_given?
772
- return response
792
+ throw :response, response
773
793
  end
774
794
  rescue ::GRPC::BadStatus => e
775
795
  raise ::Google::Cloud::Error.from_error(e)
@@ -871,7 +891,7 @@ module Google
871
891
  @managed_kafka_stub.call_rpc :list_topics, request, options: options do |response, operation|
872
892
  response = ::Gapic::PagedEnumerable.new @managed_kafka_stub, :list_topics, request, response, operation, options
873
893
  yield response, operation if block_given?
874
- return response
894
+ throw :response, response
875
895
  end
876
896
  rescue ::GRPC::BadStatus => e
877
897
  raise ::Google::Cloud::Error.from_error(e)
@@ -959,7 +979,6 @@ module Google
959
979
 
960
980
  @managed_kafka_stub.call_rpc :get_topic, request, options: options do |response, operation|
961
981
  yield response, operation if block_given?
962
- return response
963
982
  end
964
983
  rescue ::GRPC::BadStatus => e
965
984
  raise ::Google::Cloud::Error.from_error(e)
@@ -1055,7 +1074,6 @@ module Google
1055
1074
 
1056
1075
  @managed_kafka_stub.call_rpc :create_topic, request, options: options do |response, operation|
1057
1076
  yield response, operation if block_given?
1058
- return response
1059
1077
  end
1060
1078
  rescue ::GRPC::BadStatus => e
1061
1079
  raise ::Google::Cloud::Error.from_error(e)
@@ -1147,7 +1165,6 @@ module Google
1147
1165
 
1148
1166
  @managed_kafka_stub.call_rpc :update_topic, request, options: options do |response, operation|
1149
1167
  yield response, operation if block_given?
1150
- return response
1151
1168
  end
1152
1169
  rescue ::GRPC::BadStatus => e
1153
1170
  raise ::Google::Cloud::Error.from_error(e)
@@ -1234,7 +1251,6 @@ module Google
1234
1251
 
1235
1252
  @managed_kafka_stub.call_rpc :delete_topic, request, options: options do |response, operation|
1236
1253
  yield response, operation if block_given?
1237
- return response
1238
1254
  end
1239
1255
  rescue ::GRPC::BadStatus => e
1240
1256
  raise ::Google::Cloud::Error.from_error(e)
@@ -1337,7 +1353,7 @@ module Google
1337
1353
  @managed_kafka_stub.call_rpc :list_consumer_groups, request, options: options do |response, operation|
1338
1354
  response = ::Gapic::PagedEnumerable.new @managed_kafka_stub, :list_consumer_groups, request, response, operation, options
1339
1355
  yield response, operation if block_given?
1340
- return response
1356
+ throw :response, response
1341
1357
  end
1342
1358
  rescue ::GRPC::BadStatus => e
1343
1359
  raise ::Google::Cloud::Error.from_error(e)
@@ -1424,7 +1440,6 @@ module Google
1424
1440
 
1425
1441
  @managed_kafka_stub.call_rpc :get_consumer_group, request, options: options do |response, operation|
1426
1442
  yield response, operation if block_given?
1427
- return response
1428
1443
  end
1429
1444
  rescue ::GRPC::BadStatus => e
1430
1445
  raise ::Google::Cloud::Error.from_error(e)
@@ -1516,7 +1531,6 @@ module Google
1516
1531
 
1517
1532
  @managed_kafka_stub.call_rpc :update_consumer_group, request, options: options do |response, operation|
1518
1533
  yield response, operation if block_given?
1519
- return response
1520
1534
  end
1521
1535
  rescue ::GRPC::BadStatus => e
1522
1536
  raise ::Google::Cloud::Error.from_error(e)
@@ -1603,7 +1617,6 @@ module Google
1603
1617
 
1604
1618
  @managed_kafka_stub.call_rpc :delete_consumer_group, request, options: options do |response, operation|
1605
1619
  yield response, operation if block_given?
1606
- return response
1607
1620
  end
1608
1621
  rescue ::GRPC::BadStatus => e
1609
1622
  raise ::Google::Cloud::Error.from_error(e)
@@ -1692,6 +1705,11 @@ module Google
1692
1705
  # default endpoint URL. The default value of nil uses the environment
1693
1706
  # universe (usually the default "googleapis.com" universe).
1694
1707
  # @return [::String,nil]
1708
+ # @!attribute [rw] logger
1709
+ # A custom logger to use for request/response debug logging, or the value
1710
+ # `:default` (the default) to construct a default logger, or `nil` to
1711
+ # explicitly disable logging.
1712
+ # @return [::Logger,:default,nil]
1695
1713
  #
1696
1714
  class Configuration
1697
1715
  extend ::Gapic::Config
@@ -1716,6 +1734,7 @@ module Google
1716
1734
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1717
1735
  config_attr :quota_project, nil, ::String, nil
1718
1736
  config_attr :universe_domain, nil, ::String, nil
1737
+ config_attr :logger, :default, ::Logger, nil, :default
1719
1738
 
1720
1739
  # @private
1721
1740
  def initialize parent_config = nil
@@ -213,7 +213,7 @@ module Google
213
213
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
214
214
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
215
215
  yield response, operation if block_given?
216
- return response
216
+ throw :response, response
217
217
  end
218
218
  rescue ::GRPC::BadStatus => e
219
219
  raise ::Google::Cloud::Error.from_error(e)
@@ -309,7 +309,7 @@ module Google
309
309
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
310
310
  response = ::Gapic::Operation.new response, @operations_client, options: options
311
311
  yield response, operation if block_given?
312
- return response
312
+ throw :response, response
313
313
  end
314
314
  rescue ::GRPC::BadStatus => e
315
315
  raise ::Google::Cloud::Error.from_error(e)
@@ -398,7 +398,6 @@ module Google
398
398
 
399
399
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
400
400
  yield response, operation if block_given?
401
- return response
402
401
  end
403
402
  rescue ::GRPC::BadStatus => e
404
403
  raise ::Google::Cloud::Error.from_error(e)
@@ -494,7 +493,6 @@ module Google
494
493
 
495
494
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
496
495
  yield response, operation if block_given?
497
- return response
498
496
  end
499
497
  rescue ::GRPC::BadStatus => e
500
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -592,7 +590,7 @@ module Google
592
590
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
593
591
  response = ::Gapic::Operation.new response, @operations_client, options: options
594
592
  yield response, operation if block_given?
595
- return response
593
+ throw :response, response
596
594
  end
597
595
  rescue ::GRPC::BadStatus => e
598
596
  raise ::Google::Cloud::Error.from_error(e)
@@ -681,6 +679,11 @@ module Google
681
679
  # default endpoint URL. The default value of nil uses the environment
682
680
  # universe (usually the default "googleapis.com" universe).
683
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]
684
687
  #
685
688
  class Configuration
686
689
  extend ::Gapic::Config
@@ -705,6 +708,7 @@ module Google
705
708
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
706
709
  config_attr :quota_project, nil, ::String, nil
707
710
  config_attr :universe_domain, nil, ::String, nil
711
+ config_attr :logger, :default, ::Logger, nil, :default
708
712
 
709
713
  # @private
710
714
  def initialize parent_config = nil
@@ -205,15 +205,27 @@ module Google
205
205
  endpoint: @config.endpoint,
206
206
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
207
207
  universe_domain: @config.universe_domain,
208
- credentials: credentials
208
+ credentials: credentials,
209
+ logger: @config.logger
209
210
  )
210
211
 
212
+ @managed_kafka_stub.logger(stub: true)&.info do |entry|
213
+ entry.set_system_name
214
+ entry.set_service
215
+ entry.message = "Created client for #{entry.service}"
216
+ entry.set_credentials_fields credentials
217
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
218
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
219
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
220
+ end
221
+
211
222
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
212
223
  config.credentials = credentials
213
224
  config.quota_project = @quota_project_id
214
225
  config.endpoint = @managed_kafka_stub.endpoint
215
226
  config.universe_domain = @managed_kafka_stub.universe_domain
216
227
  config.bindings_override = @config.bindings_override
228
+ config.logger = @managed_kafka_stub.logger if config.respond_to? :logger=
217
229
  end
218
230
  end
219
231
 
@@ -231,6 +243,15 @@ module Google
231
243
  #
232
244
  attr_reader :location_client
233
245
 
246
+ ##
247
+ # The logger used for request/response debug logging.
248
+ #
249
+ # @return [Logger]
250
+ #
251
+ def logger
252
+ @managed_kafka_stub.logger
253
+ end
254
+
234
255
  # Service calls
235
256
 
236
257
  ##
@@ -325,7 +346,6 @@ module Google
325
346
 
326
347
  @managed_kafka_stub.list_clusters request, options do |result, operation|
327
348
  yield result, operation if block_given?
328
- return result
329
349
  end
330
350
  rescue ::Gapic::Rest::Error => e
331
351
  raise ::Google::Cloud::Error.from_error(e)
@@ -404,7 +424,6 @@ module Google
404
424
 
405
425
  @managed_kafka_stub.get_cluster request, options do |result, operation|
406
426
  yield result, operation if block_given?
407
- return result
408
427
  end
409
428
  rescue ::Gapic::Rest::Error => e
410
429
  raise ::Google::Cloud::Error.from_error(e)
@@ -517,7 +536,7 @@ module Google
517
536
  @managed_kafka_stub.create_cluster request, options do |result, operation|
518
537
  result = ::Gapic::Operation.new result, @operations_client, options: options
519
538
  yield result, operation if block_given?
520
- return result
539
+ throw :response, result
521
540
  end
522
541
  rescue ::Gapic::Rest::Error => e
523
542
  raise ::Google::Cloud::Error.from_error(e)
@@ -625,7 +644,7 @@ module Google
625
644
  @managed_kafka_stub.update_cluster request, options do |result, operation|
626
645
  result = ::Gapic::Operation.new result, @operations_client, options: options
627
646
  yield result, operation if block_given?
628
- return result
647
+ throw :response, result
629
648
  end
630
649
  rescue ::Gapic::Rest::Error => e
631
650
  raise ::Google::Cloud::Error.from_error(e)
@@ -727,7 +746,7 @@ module Google
727
746
  @managed_kafka_stub.delete_cluster request, options do |result, operation|
728
747
  result = ::Gapic::Operation.new result, @operations_client, options: options
729
748
  yield result, operation if block_given?
730
- return result
749
+ throw :response, result
731
750
  end
732
751
  rescue ::Gapic::Rest::Error => e
733
752
  raise ::Google::Cloud::Error.from_error(e)
@@ -822,7 +841,7 @@ module Google
822
841
  @managed_kafka_stub.list_topics request, options do |result, operation|
823
842
  result = ::Gapic::Rest::PagedEnumerable.new @managed_kafka_stub, :list_topics, "topics", request, result, options
824
843
  yield result, operation if block_given?
825
- return result
844
+ throw :response, result
826
845
  end
827
846
  rescue ::Gapic::Rest::Error => e
828
847
  raise ::Google::Cloud::Error.from_error(e)
@@ -903,7 +922,6 @@ module Google
903
922
 
904
923
  @managed_kafka_stub.get_topic request, options do |result, operation|
905
924
  yield result, operation if block_given?
906
- return result
907
925
  end
908
926
  rescue ::Gapic::Rest::Error => e
909
927
  raise ::Google::Cloud::Error.from_error(e)
@@ -992,7 +1010,6 @@ module Google
992
1010
 
993
1011
  @managed_kafka_stub.create_topic request, options do |result, operation|
994
1012
  yield result, operation if block_given?
995
- return result
996
1013
  end
997
1014
  rescue ::Gapic::Rest::Error => e
998
1015
  raise ::Google::Cloud::Error.from_error(e)
@@ -1077,7 +1094,6 @@ module Google
1077
1094
 
1078
1095
  @managed_kafka_stub.update_topic request, options do |result, operation|
1079
1096
  yield result, operation if block_given?
1080
- return result
1081
1097
  end
1082
1098
  rescue ::Gapic::Rest::Error => e
1083
1099
  raise ::Google::Cloud::Error.from_error(e)
@@ -1157,7 +1173,6 @@ module Google
1157
1173
 
1158
1174
  @managed_kafka_stub.delete_topic request, options do |result, operation|
1159
1175
  yield result, operation if block_given?
1160
- return result
1161
1176
  end
1162
1177
  rescue ::Gapic::Rest::Error => e
1163
1178
  raise ::Google::Cloud::Error.from_error(e)
@@ -1253,7 +1268,7 @@ module Google
1253
1268
  @managed_kafka_stub.list_consumer_groups request, options do |result, operation|
1254
1269
  result = ::Gapic::Rest::PagedEnumerable.new @managed_kafka_stub, :list_consumer_groups, "consumer_groups", request, result, options
1255
1270
  yield result, operation if block_given?
1256
- return result
1271
+ throw :response, result
1257
1272
  end
1258
1273
  rescue ::Gapic::Rest::Error => e
1259
1274
  raise ::Google::Cloud::Error.from_error(e)
@@ -1333,7 +1348,6 @@ module Google
1333
1348
 
1334
1349
  @managed_kafka_stub.get_consumer_group request, options do |result, operation|
1335
1350
  yield result, operation if block_given?
1336
- return result
1337
1351
  end
1338
1352
  rescue ::Gapic::Rest::Error => e
1339
1353
  raise ::Google::Cloud::Error.from_error(e)
@@ -1418,7 +1432,6 @@ module Google
1418
1432
 
1419
1433
  @managed_kafka_stub.update_consumer_group request, options do |result, operation|
1420
1434
  yield result, operation if block_given?
1421
- return result
1422
1435
  end
1423
1436
  rescue ::Gapic::Rest::Error => e
1424
1437
  raise ::Google::Cloud::Error.from_error(e)
@@ -1498,7 +1511,6 @@ module Google
1498
1511
 
1499
1512
  @managed_kafka_stub.delete_consumer_group request, options do |result, operation|
1500
1513
  yield result, operation if block_given?
1501
- return result
1502
1514
  end
1503
1515
  rescue ::Gapic::Rest::Error => e
1504
1516
  raise ::Google::Cloud::Error.from_error(e)
@@ -1578,6 +1590,11 @@ module Google
1578
1590
  # default endpoint URL. The default value of nil uses the environment
1579
1591
  # universe (usually the default "googleapis.com" universe).
1580
1592
  # @return [::String,nil]
1593
+ # @!attribute [rw] logger
1594
+ # A custom logger to use for request/response debug logging, or the value
1595
+ # `:default` (the default) to construct a default logger, or `nil` to
1596
+ # explicitly disable logging.
1597
+ # @return [::Logger,:default,nil]
1581
1598
  #
1582
1599
  class Configuration
1583
1600
  extend ::Gapic::Config
@@ -1606,6 +1623,7 @@ module Google
1606
1623
  # by the host service.
1607
1624
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1608
1625
  config_attr :bindings_override, {}, ::Hash, nil
1626
+ config_attr :logger, :default, ::Logger, nil, :default
1609
1627
 
1610
1628
  # @private
1611
1629
  def initialize parent_config = nil
@@ -196,7 +196,7 @@ module Google
196
196
  @operations_stub.list_operations request, options do |result, operation|
197
197
  result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
198
198
  yield result, operation if block_given?
199
- return result
199
+ throw :response, result
200
200
  end
201
201
  rescue ::Gapic::Rest::Error => e
202
202
  raise ::Google::Cloud::Error.from_error(e)
@@ -285,7 +285,7 @@ module Google
285
285
  @operations_stub.get_operation request, options do |result, operation|
286
286
  result = ::Gapic::Operation.new result, @operations_client, options: options
287
287
  yield result, operation if block_given?
288
- return result
288
+ throw :response, result
289
289
  end
290
290
  rescue ::Gapic::Rest::Error => e
291
291
  raise ::Google::Cloud::Error.from_error(e)
@@ -367,7 +367,6 @@ module Google
367
367
 
368
368
  @operations_stub.delete_operation request, options do |result, operation|
369
369
  yield result, operation if block_given?
370
- return result
371
370
  end
372
371
  rescue ::Gapic::Rest::Error => e
373
372
  raise ::Google::Cloud::Error.from_error(e)
@@ -456,7 +455,6 @@ module Google
456
455
 
457
456
  @operations_stub.cancel_operation request, options do |result, operation|
458
457
  yield result, operation if block_given?
459
- return result
460
458
  end
461
459
  rescue ::Gapic::Rest::Error => e
462
460
  raise ::Google::Cloud::Error.from_error(e)
@@ -536,6 +534,11 @@ module Google
536
534
  # default endpoint URL. The default value of nil uses the environment
537
535
  # universe (usually the default "googleapis.com" universe).
538
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]
539
542
  #
540
543
  class Configuration
541
544
  extend ::Gapic::Config
@@ -557,6 +560,7 @@ module Google
557
560
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
558
561
  config_attr :quota_project, nil, ::String, nil
559
562
  config_attr :universe_domain, nil, ::String, nil
563
+ config_attr :logger, :default, ::Logger, nil, :default
560
564
 
561
565
  # @private
562
566
  def initialize parent_config = nil
@@ -676,16 +680,18 @@ module Google
676
680
 
677
681
  response = @client_stub.make_http_request(
678
682
  verb,
679
- uri: uri,
680
- body: body || "",
681
- params: query_string_params,
683
+ uri: uri,
684
+ body: body || "",
685
+ params: query_string_params,
686
+ method_name: "list_operations",
682
687
  options: options
683
688
  )
684
689
  operation = ::Gapic::Rest::TransportOperation.new response
685
690
  result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
686
-
687
- yield result, operation if block_given?
688
- result
691
+ catch :response do
692
+ yield result, operation if block_given?
693
+ result
694
+ end
689
695
  end
690
696
 
691
697
  ##
@@ -714,16 +720,18 @@ module Google
714
720
 
715
721
  response = @client_stub.make_http_request(
716
722
  verb,
717
- uri: uri,
718
- body: body || "",
719
- params: query_string_params,
723
+ uri: uri,
724
+ body: body || "",
725
+ params: query_string_params,
726
+ method_name: "get_operation",
720
727
  options: options
721
728
  )
722
729
  operation = ::Gapic::Rest::TransportOperation.new response
723
730
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
724
-
725
- yield result, operation if block_given?
726
- result
731
+ catch :response do
732
+ yield result, operation if block_given?
733
+ result
734
+ end
727
735
  end
728
736
 
729
737
  ##
@@ -752,16 +760,18 @@ module Google
752
760
 
753
761
  response = @client_stub.make_http_request(
754
762
  verb,
755
- uri: uri,
756
- body: body || "",
757
- params: query_string_params,
763
+ uri: uri,
764
+ body: body || "",
765
+ params: query_string_params,
766
+ method_name: "delete_operation",
758
767
  options: options
759
768
  )
760
769
  operation = ::Gapic::Rest::TransportOperation.new response
761
770
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
762
-
763
- yield result, operation if block_given?
764
- result
771
+ catch :response do
772
+ yield result, operation if block_given?
773
+ result
774
+ end
765
775
  end
766
776
 
767
777
  ##
@@ -790,16 +800,18 @@ module Google
790
800
 
791
801
  response = @client_stub.make_http_request(
792
802
  verb,
793
- uri: uri,
794
- body: body || "",
795
- params: query_string_params,
803
+ uri: uri,
804
+ body: body || "",
805
+ params: query_string_params,
806
+ method_name: "cancel_operation",
796
807
  options: options
797
808
  )
798
809
  operation = ::Gapic::Rest::TransportOperation.new response
799
810
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
800
-
801
- yield result, operation if block_given?
802
- result
811
+ catch :response do
812
+ yield result, operation if block_given?
813
+ result
814
+ end
803
815
  end
804
816
 
805
817
  ##
@@ -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_clusters 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_clusters",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::ManagedKafka::V1::ListClustersResponse.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_cluster",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::ManagedKafka::V1::Cluster.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_cluster",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Longrunning::Operation.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_cluster",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Longrunning::Operation.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_cluster",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Longrunning::Operation.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_topics",
283
306
  options: options
284
307
  )
285
308
  operation = ::Gapic::Rest::TransportOperation.new response
286
309
  result = ::Google::Cloud::ManagedKafka::V1::ListTopicsResponse.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_topic",
321
346
  options: options
322
347
  )
323
348
  operation = ::Gapic::Rest::TransportOperation.new response
324
349
  result = ::Google::Cloud::ManagedKafka::V1::Topic.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
  ##
@@ -353,16 +379,18 @@ module Google
353
379
 
354
380
  response = @client_stub.make_http_request(
355
381
  verb,
356
- uri: uri,
357
- body: body || "",
358
- params: query_string_params,
382
+ uri: uri,
383
+ body: body || "",
384
+ params: query_string_params,
385
+ method_name: "create_topic",
359
386
  options: options
360
387
  )
361
388
  operation = ::Gapic::Rest::TransportOperation.new response
362
389
  result = ::Google::Cloud::ManagedKafka::V1::Topic.decode_json response.body, ignore_unknown_fields: true
363
-
364
- yield result, operation if block_given?
365
- result
390
+ catch :response do
391
+ yield result, operation if block_given?
392
+ result
393
+ end
366
394
  end
367
395
 
368
396
  ##
@@ -391,16 +419,18 @@ module Google
391
419
 
392
420
  response = @client_stub.make_http_request(
393
421
  verb,
394
- uri: uri,
395
- body: body || "",
396
- params: query_string_params,
422
+ uri: uri,
423
+ body: body || "",
424
+ params: query_string_params,
425
+ method_name: "update_topic",
397
426
  options: options
398
427
  )
399
428
  operation = ::Gapic::Rest::TransportOperation.new response
400
429
  result = ::Google::Cloud::ManagedKafka::V1::Topic.decode_json response.body, ignore_unknown_fields: true
401
-
402
- yield result, operation if block_given?
403
- result
430
+ catch :response do
431
+ yield result, operation if block_given?
432
+ result
433
+ end
404
434
  end
405
435
 
406
436
  ##
@@ -429,16 +459,18 @@ module Google
429
459
 
430
460
  response = @client_stub.make_http_request(
431
461
  verb,
432
- uri: uri,
433
- body: body || "",
434
- params: query_string_params,
462
+ uri: uri,
463
+ body: body || "",
464
+ params: query_string_params,
465
+ method_name: "delete_topic",
435
466
  options: options
436
467
  )
437
468
  operation = ::Gapic::Rest::TransportOperation.new response
438
469
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
439
-
440
- yield result, operation if block_given?
441
- result
470
+ catch :response do
471
+ yield result, operation if block_given?
472
+ result
473
+ end
442
474
  end
443
475
 
444
476
  ##
@@ -467,16 +499,18 @@ module Google
467
499
 
468
500
  response = @client_stub.make_http_request(
469
501
  verb,
470
- uri: uri,
471
- body: body || "",
472
- params: query_string_params,
502
+ uri: uri,
503
+ body: body || "",
504
+ params: query_string_params,
505
+ method_name: "list_consumer_groups",
473
506
  options: options
474
507
  )
475
508
  operation = ::Gapic::Rest::TransportOperation.new response
476
509
  result = ::Google::Cloud::ManagedKafka::V1::ListConsumerGroupsResponse.decode_json response.body, ignore_unknown_fields: true
477
-
478
- yield result, operation if block_given?
479
- result
510
+ catch :response do
511
+ yield result, operation if block_given?
512
+ result
513
+ end
480
514
  end
481
515
 
482
516
  ##
@@ -505,16 +539,18 @@ module Google
505
539
 
506
540
  response = @client_stub.make_http_request(
507
541
  verb,
508
- uri: uri,
509
- body: body || "",
510
- params: query_string_params,
542
+ uri: uri,
543
+ body: body || "",
544
+ params: query_string_params,
545
+ method_name: "get_consumer_group",
511
546
  options: options
512
547
  )
513
548
  operation = ::Gapic::Rest::TransportOperation.new response
514
549
  result = ::Google::Cloud::ManagedKafka::V1::ConsumerGroup.decode_json response.body, ignore_unknown_fields: true
515
-
516
- yield result, operation if block_given?
517
- result
550
+ catch :response do
551
+ yield result, operation if block_given?
552
+ result
553
+ end
518
554
  end
519
555
 
520
556
  ##
@@ -543,16 +579,18 @@ module Google
543
579
 
544
580
  response = @client_stub.make_http_request(
545
581
  verb,
546
- uri: uri,
547
- body: body || "",
548
- params: query_string_params,
582
+ uri: uri,
583
+ body: body || "",
584
+ params: query_string_params,
585
+ method_name: "update_consumer_group",
549
586
  options: options
550
587
  )
551
588
  operation = ::Gapic::Rest::TransportOperation.new response
552
589
  result = ::Google::Cloud::ManagedKafka::V1::ConsumerGroup.decode_json response.body, ignore_unknown_fields: true
553
-
554
- yield result, operation if block_given?
555
- result
590
+ catch :response do
591
+ yield result, operation if block_given?
592
+ result
593
+ end
556
594
  end
557
595
 
558
596
  ##
@@ -581,16 +619,18 @@ module Google
581
619
 
582
620
  response = @client_stub.make_http_request(
583
621
  verb,
584
- uri: uri,
585
- body: body || "",
586
- params: query_string_params,
622
+ uri: uri,
623
+ body: body || "",
624
+ params: query_string_params,
625
+ method_name: "delete_consumer_group",
587
626
  options: options
588
627
  )
589
628
  operation = ::Gapic::Rest::TransportOperation.new response
590
629
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
591
-
592
- yield result, operation if block_given?
593
- result
630
+ catch :response do
631
+ yield result, operation if block_given?
632
+ result
633
+ end
594
634
  end
595
635
 
596
636
  ##
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module ManagedKafka
23
23
  module V1
24
- VERSION = "0.2.0"
24
+ VERSION = "0.3.0"
25
25
  end
26
26
  end
27
27
  end
@@ -306,9 +306,28 @@ module Google
306
306
  # @!attribute [rw] common
307
307
  # @return [::Google::Api::CommonLanguageSettings]
308
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
309
319
  class GoSettings
310
320
  include ::Google::Protobuf::MessageExts
311
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
312
331
  end
313
332
 
314
333
  # Describes the generator configuration for a method.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-managed_kafka-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-04 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
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0'
130
130
  requirements: []
131
- rubygems_version: 3.5.22
131
+ rubygems_version: 3.5.23
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Manage Apache Kafka clusters and resources.