google-cloud-pubsub-v1 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea290a4b67119400d64e406358b2178cc48258781b03b11e9014e794a9e245af
4
- data.tar.gz: 5ee9272687acdedb1063782b1489248791796c3130455da09f3b6e878b7c6aad
3
+ metadata.gz: 3e4470b53901c05a76316bd9212a064ab754b57cf6e0adf02c4747874eb22a5c
4
+ data.tar.gz: e2505dd7f33e97e1a9fed9d4fd9ad0231811987d2931bc3c69a8891812dd9d4b
5
5
  SHA512:
6
- metadata.gz: 9cb916dbe8ec206e4905c36714048c0acd2b89b67441d22ec9085d06222e7d7773aa8a7f1e1e5f87357a4d7e147f13cf4f7c6f265e25df40c69fc5f29e4fa8e3
7
- data.tar.gz: c1a229cb63fa45006eaeba3e819ceeea451efb2ff5eb8240511e2d6ee37f5a8faf884e8a4cb8708bead088f198f2652b42e5434e0c239a2cb52a880a5fa6d665
6
+ metadata.gz: cb8151ea833daea5adec419088a01d43fc2ddb46c030acd1087e159e94ee524628f79843f4da8b4cdca3a5c41a3cc30abc8e3429847ff469ea6ddbe4f4bd4494
7
+ data.tar.gz: d206ab6e2da715ca3f43561629eabab26420b9e1b1bb8803665bd4f975551e3a4f3db79e24aee68c1d8892ef01859f51d38f69fd344eea48843f7746cb5f7e32
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/pubsub)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/pubsub/v1"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -204,14 +204,26 @@ module Google
204
204
  universe_domain: @config.universe_domain,
205
205
  channel_args: @config.channel_args,
206
206
  interceptors: @config.interceptors,
207
- channel_pool_config: @config.channel_pool
207
+ channel_pool_config: @config.channel_pool,
208
+ logger: @config.logger
208
209
  )
209
210
 
211
+ @publisher_stub.stub_logger&.info do |entry|
212
+ entry.set_system_name
213
+ entry.set_service
214
+ entry.message = "Created client for #{entry.service}"
215
+ entry.set_credentials_fields credentials
216
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
217
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
218
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
219
+ end
220
+
210
221
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
211
222
  config.credentials = credentials
212
223
  config.quota_project = @quota_project_id
213
224
  config.endpoint = @publisher_stub.endpoint
214
225
  config.universe_domain = @publisher_stub.universe_domain
226
+ config.logger = @publisher_stub.logger if config.respond_to? :logger=
215
227
  end
216
228
  end
217
229
 
@@ -222,6 +234,15 @@ module Google
222
234
  #
223
235
  attr_reader :iam_policy_client
224
236
 
237
+ ##
238
+ # The logger used for request/response debug logging.
239
+ #
240
+ # @return [Logger]
241
+ #
242
+ def logger
243
+ @publisher_stub.logger
244
+ end
245
+
225
246
  # Service calls
226
247
 
227
248
  ##
@@ -339,7 +360,6 @@ module Google
339
360
 
340
361
  @publisher_stub.call_rpc :create_topic, request, options: options do |response, operation|
341
362
  yield response, operation if block_given?
342
- return response
343
363
  end
344
364
  rescue ::GRPC::BadStatus => e
345
365
  raise ::Google::Cloud::Error.from_error(e)
@@ -432,7 +452,6 @@ module Google
432
452
 
433
453
  @publisher_stub.call_rpc :update_topic, request, options: options do |response, operation|
434
454
  yield response, operation if block_given?
435
- return response
436
455
  end
437
456
  rescue ::GRPC::BadStatus => e
438
457
  raise ::Google::Cloud::Error.from_error(e)
@@ -522,7 +541,6 @@ module Google
522
541
 
523
542
  @publisher_stub.call_rpc :publish, request, options: options do |response, operation|
524
543
  yield response, operation if block_given?
525
- return response
526
544
  end
527
545
  rescue ::GRPC::BadStatus => e
528
546
  raise ::Google::Cloud::Error.from_error(e)
@@ -609,7 +627,6 @@ module Google
609
627
 
610
628
  @publisher_stub.call_rpc :get_topic, request, options: options do |response, operation|
611
629
  yield response, operation if block_given?
612
- return response
613
630
  end
614
631
  rescue ::GRPC::BadStatus => e
615
632
  raise ::Google::Cloud::Error.from_error(e)
@@ -707,7 +724,7 @@ module Google
707
724
  @publisher_stub.call_rpc :list_topics, request, options: options do |response, operation|
708
725
  response = ::Gapic::PagedEnumerable.new @publisher_stub, :list_topics, request, response, operation, options
709
726
  yield response, operation if block_given?
710
- return response
727
+ throw :response, response
711
728
  end
712
729
  rescue ::GRPC::BadStatus => e
713
730
  raise ::Google::Cloud::Error.from_error(e)
@@ -800,7 +817,6 @@ module Google
800
817
 
801
818
  @publisher_stub.call_rpc :list_topic_subscriptions, request, options: options do |response, operation|
802
819
  yield response, operation if block_given?
803
- return response
804
820
  end
805
821
  rescue ::GRPC::BadStatus => e
806
822
  raise ::Google::Cloud::Error.from_error(e)
@@ -897,7 +913,6 @@ module Google
897
913
 
898
914
  @publisher_stub.call_rpc :list_topic_snapshots, request, options: options do |response, operation|
899
915
  yield response, operation if block_given?
900
- return response
901
916
  end
902
917
  rescue ::GRPC::BadStatus => e
903
918
  raise ::Google::Cloud::Error.from_error(e)
@@ -988,7 +1003,6 @@ module Google
988
1003
 
989
1004
  @publisher_stub.call_rpc :delete_topic, request, options: options do |response, operation|
990
1005
  yield response, operation if block_given?
991
- return response
992
1006
  end
993
1007
  rescue ::GRPC::BadStatus => e
994
1008
  raise ::Google::Cloud::Error.from_error(e)
@@ -1078,7 +1092,6 @@ module Google
1078
1092
 
1079
1093
  @publisher_stub.call_rpc :detach_subscription, request, options: options do |response, operation|
1080
1094
  yield response, operation if block_given?
1081
- return response
1082
1095
  end
1083
1096
  rescue ::GRPC::BadStatus => e
1084
1097
  raise ::Google::Cloud::Error.from_error(e)
@@ -1167,6 +1180,11 @@ module Google
1167
1180
  # default endpoint URL. The default value of nil uses the environment
1168
1181
  # universe (usually the default "googleapis.com" universe).
1169
1182
  # @return [::String,nil]
1183
+ # @!attribute [rw] logger
1184
+ # A custom logger to use for request/response debug logging, or the value
1185
+ # `:default` (the default) to construct a default logger, or `nil` to
1186
+ # explicitly disable logging.
1187
+ # @return [::Logger,:default,nil]
1170
1188
  #
1171
1189
  class Configuration
1172
1190
  extend ::Gapic::Config
@@ -1191,6 +1209,7 @@ module Google
1191
1209
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1192
1210
  config_attr :quota_project, nil, ::String, nil
1193
1211
  config_attr :universe_domain, nil, ::String, nil
1212
+ config_attr :logger, :default, ::Logger, nil, :default
1194
1213
 
1195
1214
  # @private
1196
1215
  def initialize parent_config = nil
@@ -208,14 +208,26 @@ module Google
208
208
  universe_domain: @config.universe_domain,
209
209
  channel_args: @config.channel_args,
210
210
  interceptors: @config.interceptors,
211
- channel_pool_config: @config.channel_pool
211
+ channel_pool_config: @config.channel_pool,
212
+ logger: @config.logger
212
213
  )
213
214
 
215
+ @schema_service_stub.stub_logger&.info do |entry|
216
+ entry.set_system_name
217
+ entry.set_service
218
+ entry.message = "Created client for #{entry.service}"
219
+ entry.set_credentials_fields credentials
220
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
221
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
222
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
223
+ end
224
+
214
225
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
215
226
  config.credentials = credentials
216
227
  config.quota_project = @quota_project_id
217
228
  config.endpoint = @schema_service_stub.endpoint
218
229
  config.universe_domain = @schema_service_stub.universe_domain
230
+ config.logger = @schema_service_stub.logger if config.respond_to? :logger=
219
231
  end
220
232
  end
221
233
 
@@ -226,6 +238,15 @@ module Google
226
238
  #
227
239
  attr_reader :iam_policy_client
228
240
 
241
+ ##
242
+ # The logger used for request/response debug logging.
243
+ #
244
+ # @return [Logger]
245
+ #
246
+ def logger
247
+ @schema_service_stub.logger
248
+ end
249
+
229
250
  # Service calls
230
251
 
231
252
  ##
@@ -321,7 +342,6 @@ module Google
321
342
 
322
343
  @schema_service_stub.call_rpc :create_schema, request, options: options do |response, operation|
323
344
  yield response, operation if block_given?
324
- return response
325
345
  end
326
346
  rescue ::GRPC::BadStatus => e
327
347
  raise ::Google::Cloud::Error.from_error(e)
@@ -411,7 +431,6 @@ module Google
411
431
 
412
432
  @schema_service_stub.call_rpc :get_schema, request, options: options do |response, operation|
413
433
  yield response, operation if block_given?
414
- return response
415
434
  end
416
435
  rescue ::GRPC::BadStatus => e
417
436
  raise ::Google::Cloud::Error.from_error(e)
@@ -513,7 +532,7 @@ module Google
513
532
  @schema_service_stub.call_rpc :list_schemas, request, options: options do |response, operation|
514
533
  response = ::Gapic::PagedEnumerable.new @schema_service_stub, :list_schemas, 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)
@@ -613,7 +632,7 @@ module Google
613
632
  @schema_service_stub.call_rpc :list_schema_revisions, request, options: options do |response, operation|
614
633
  response = ::Gapic::PagedEnumerable.new @schema_service_stub, :list_schema_revisions, request, response, operation, options
615
634
  yield response, operation if block_given?
616
- return response
635
+ throw :response, response
617
636
  end
618
637
  rescue ::GRPC::BadStatus => e
619
638
  raise ::Google::Cloud::Error.from_error(e)
@@ -702,7 +721,6 @@ module Google
702
721
 
703
722
  @schema_service_stub.call_rpc :commit_schema, request, options: options do |response, operation|
704
723
  yield response, operation if block_given?
705
- return response
706
724
  end
707
725
  rescue ::GRPC::BadStatus => e
708
726
  raise ::Google::Cloud::Error.from_error(e)
@@ -793,7 +811,6 @@ module Google
793
811
 
794
812
  @schema_service_stub.call_rpc :rollback_schema, request, options: options do |response, operation|
795
813
  yield response, operation if block_given?
796
- return response
797
814
  end
798
815
  rescue ::GRPC::BadStatus => e
799
816
  raise ::Google::Cloud::Error.from_error(e)
@@ -886,7 +903,6 @@ module Google
886
903
 
887
904
  @schema_service_stub.call_rpc :delete_schema_revision, request, options: options do |response, operation|
888
905
  yield response, operation if block_given?
889
- return response
890
906
  end
891
907
  rescue ::GRPC::BadStatus => e
892
908
  raise ::Google::Cloud::Error.from_error(e)
@@ -973,7 +989,6 @@ module Google
973
989
 
974
990
  @schema_service_stub.call_rpc :delete_schema, request, options: options do |response, operation|
975
991
  yield response, operation if block_given?
976
- return response
977
992
  end
978
993
  rescue ::GRPC::BadStatus => e
979
994
  raise ::Google::Cloud::Error.from_error(e)
@@ -1062,7 +1077,6 @@ module Google
1062
1077
 
1063
1078
  @schema_service_stub.call_rpc :validate_schema, request, options: options do |response, operation|
1064
1079
  yield response, operation if block_given?
1065
- return response
1066
1080
  end
1067
1081
  rescue ::GRPC::BadStatus => e
1068
1082
  raise ::Google::Cloud::Error.from_error(e)
@@ -1159,7 +1173,6 @@ module Google
1159
1173
 
1160
1174
  @schema_service_stub.call_rpc :validate_message, request, options: options do |response, operation|
1161
1175
  yield response, operation if block_given?
1162
- return response
1163
1176
  end
1164
1177
  rescue ::GRPC::BadStatus => e
1165
1178
  raise ::Google::Cloud::Error.from_error(e)
@@ -1248,6 +1261,11 @@ module Google
1248
1261
  # default endpoint URL. The default value of nil uses the environment
1249
1262
  # universe (usually the default "googleapis.com" universe).
1250
1263
  # @return [::String,nil]
1264
+ # @!attribute [rw] logger
1265
+ # A custom logger to use for request/response debug logging, or the value
1266
+ # `:default` (the default) to construct a default logger, or `nil` to
1267
+ # explicitly disable logging.
1268
+ # @return [::Logger,:default,nil]
1251
1269
  #
1252
1270
  class Configuration
1253
1271
  extend ::Gapic::Config
@@ -1272,6 +1290,7 @@ module Google
1272
1290
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1273
1291
  config_attr :quota_project, nil, ::String, nil
1274
1292
  config_attr :universe_domain, nil, ::String, nil
1293
+ config_attr :logger, :default, ::Logger, nil, :default
1275
1294
 
1276
1295
  # @private
1277
1296
  def initialize parent_config = nil
@@ -240,14 +240,26 @@ module Google
240
240
  universe_domain: @config.universe_domain,
241
241
  channel_args: @config.channel_args,
242
242
  interceptors: @config.interceptors,
243
- channel_pool_config: @config.channel_pool
243
+ channel_pool_config: @config.channel_pool,
244
+ logger: @config.logger
244
245
  )
245
246
 
247
+ @subscriber_stub.stub_logger&.info do |entry|
248
+ entry.set_system_name
249
+ entry.set_service
250
+ entry.message = "Created client for #{entry.service}"
251
+ entry.set_credentials_fields credentials
252
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
253
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
254
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
255
+ end
256
+
246
257
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
247
258
  config.credentials = credentials
248
259
  config.quota_project = @quota_project_id
249
260
  config.endpoint = @subscriber_stub.endpoint
250
261
  config.universe_domain = @subscriber_stub.universe_domain
262
+ config.logger = @subscriber_stub.logger if config.respond_to? :logger=
251
263
  end
252
264
  end
253
265
 
@@ -258,6 +270,15 @@ module Google
258
270
  #
259
271
  attr_reader :iam_policy_client
260
272
 
273
+ ##
274
+ # The logger used for request/response debug logging.
275
+ #
276
+ # @return [Logger]
277
+ #
278
+ def logger
279
+ @subscriber_stub.logger
280
+ end
281
+
261
282
  # Service calls
262
283
 
263
284
  ##
@@ -460,7 +481,6 @@ module Google
460
481
 
461
482
  @subscriber_stub.call_rpc :create_subscription, request, options: options do |response, operation|
462
483
  yield response, operation if block_given?
463
- return response
464
484
  end
465
485
  rescue ::GRPC::BadStatus => e
466
486
  raise ::Google::Cloud::Error.from_error(e)
@@ -547,7 +567,6 @@ module Google
547
567
 
548
568
  @subscriber_stub.call_rpc :get_subscription, request, options: options do |response, operation|
549
569
  yield response, operation if block_given?
550
- return response
551
570
  end
552
571
  rescue ::GRPC::BadStatus => e
553
572
  raise ::Google::Cloud::Error.from_error(e)
@@ -638,7 +657,6 @@ module Google
638
657
 
639
658
  @subscriber_stub.call_rpc :update_subscription, request, options: options do |response, operation|
640
659
  yield response, operation if block_given?
641
- return response
642
660
  end
643
661
  rescue ::GRPC::BadStatus => e
644
662
  raise ::Google::Cloud::Error.from_error(e)
@@ -736,7 +754,7 @@ module Google
736
754
  @subscriber_stub.call_rpc :list_subscriptions, request, options: options do |response, operation|
737
755
  response = ::Gapic::PagedEnumerable.new @subscriber_stub, :list_subscriptions, request, response, operation, options
738
756
  yield response, operation if block_given?
739
- return response
757
+ throw :response, response
740
758
  end
741
759
  rescue ::GRPC::BadStatus => e
742
760
  raise ::Google::Cloud::Error.from_error(e)
@@ -827,7 +845,6 @@ module Google
827
845
 
828
846
  @subscriber_stub.call_rpc :delete_subscription, request, options: options do |response, operation|
829
847
  yield response, operation if block_given?
830
- return response
831
848
  end
832
849
  rescue ::GRPC::BadStatus => e
833
850
  raise ::Google::Cloud::Error.from_error(e)
@@ -930,7 +947,6 @@ module Google
930
947
 
931
948
  @subscriber_stub.call_rpc :modify_ack_deadline, request, options: options do |response, operation|
932
949
  yield response, operation if block_given?
933
- return response
934
950
  end
935
951
  rescue ::GRPC::BadStatus => e
936
952
  raise ::Google::Cloud::Error.from_error(e)
@@ -1027,7 +1043,6 @@ module Google
1027
1043
 
1028
1044
  @subscriber_stub.call_rpc :acknowledge, request, options: options do |response, operation|
1029
1045
  yield response, operation if block_given?
1030
- return response
1031
1046
  end
1032
1047
  rescue ::GRPC::BadStatus => e
1033
1048
  raise ::Google::Cloud::Error.from_error(e)
@@ -1126,7 +1141,6 @@ module Google
1126
1141
 
1127
1142
  @subscriber_stub.call_rpc :pull, request, options: options do |response, operation|
1128
1143
  yield response, operation if block_given?
1129
- return response
1130
1144
  end
1131
1145
  rescue ::GRPC::BadStatus => e
1132
1146
  raise ::Google::Cloud::Error.from_error(e)
@@ -1211,7 +1225,6 @@ module Google
1211
1225
 
1212
1226
  @subscriber_stub.call_rpc :streaming_pull, request, options: options do |response, operation|
1213
1227
  yield response, operation if block_given?
1214
- return response
1215
1228
  end
1216
1229
  rescue ::GRPC::BadStatus => e
1217
1230
  raise ::Google::Cloud::Error.from_error(e)
@@ -1310,7 +1323,6 @@ module Google
1310
1323
 
1311
1324
  @subscriber_stub.call_rpc :modify_push_config, request, options: options do |response, operation|
1312
1325
  yield response, operation if block_given?
1313
- return response
1314
1326
  end
1315
1327
  rescue ::GRPC::BadStatus => e
1316
1328
  raise ::Google::Cloud::Error.from_error(e)
@@ -1401,7 +1413,6 @@ module Google
1401
1413
 
1402
1414
  @subscriber_stub.call_rpc :get_snapshot, request, options: options do |response, operation|
1403
1415
  yield response, operation if block_given?
1404
- return response
1405
1416
  end
1406
1417
  rescue ::GRPC::BadStatus => e
1407
1418
  raise ::Google::Cloud::Error.from_error(e)
@@ -1503,7 +1514,7 @@ module Google
1503
1514
  @subscriber_stub.call_rpc :list_snapshots, request, options: options do |response, operation|
1504
1515
  response = ::Gapic::PagedEnumerable.new @subscriber_stub, :list_snapshots, request, response, operation, options
1505
1516
  yield response, operation if block_given?
1506
- return response
1517
+ throw :response, response
1507
1518
  end
1508
1519
  rescue ::GRPC::BadStatus => e
1509
1520
  raise ::Google::Cloud::Error.from_error(e)
@@ -1622,7 +1633,6 @@ module Google
1622
1633
 
1623
1634
  @subscriber_stub.call_rpc :create_snapshot, request, options: options do |response, operation|
1624
1635
  yield response, operation if block_given?
1625
- return response
1626
1636
  end
1627
1637
  rescue ::GRPC::BadStatus => e
1628
1638
  raise ::Google::Cloud::Error.from_error(e)
@@ -1716,7 +1726,6 @@ module Google
1716
1726
 
1717
1727
  @subscriber_stub.call_rpc :update_snapshot, request, options: options do |response, operation|
1718
1728
  yield response, operation if block_given?
1719
- return response
1720
1729
  end
1721
1730
  rescue ::GRPC::BadStatus => e
1722
1731
  raise ::Google::Cloud::Error.from_error(e)
@@ -1811,7 +1820,6 @@ module Google
1811
1820
 
1812
1821
  @subscriber_stub.call_rpc :delete_snapshot, request, options: options do |response, operation|
1813
1822
  yield response, operation if block_given?
1814
- return response
1815
1823
  end
1816
1824
  rescue ::GRPC::BadStatus => e
1817
1825
  raise ::Google::Cloud::Error.from_error(e)
@@ -1919,7 +1927,6 @@ module Google
1919
1927
 
1920
1928
  @subscriber_stub.call_rpc :seek, request, options: options do |response, operation|
1921
1929
  yield response, operation if block_given?
1922
- return response
1923
1930
  end
1924
1931
  rescue ::GRPC::BadStatus => e
1925
1932
  raise ::Google::Cloud::Error.from_error(e)
@@ -2008,6 +2015,11 @@ module Google
2008
2015
  # default endpoint URL. The default value of nil uses the environment
2009
2016
  # universe (usually the default "googleapis.com" universe).
2010
2017
  # @return [::String,nil]
2018
+ # @!attribute [rw] logger
2019
+ # A custom logger to use for request/response debug logging, or the value
2020
+ # `:default` (the default) to construct a default logger, or `nil` to
2021
+ # explicitly disable logging.
2022
+ # @return [::Logger,:default,nil]
2011
2023
  #
2012
2024
  class Configuration
2013
2025
  extend ::Gapic::Config
@@ -2032,6 +2044,7 @@ module Google
2032
2044
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2033
2045
  config_attr :quota_project, nil, ::String, nil
2034
2046
  config_attr :universe_domain, nil, ::String, nil
2047
+ config_attr :logger, :default, ::Logger, nil, :default
2035
2048
 
2036
2049
  # @private
2037
2050
  def initialize parent_config = nil
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module PubSub
23
23
  module V1
24
- VERSION = "1.3.0"
24
+ VERSION = "1.4.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
@@ -212,6 +215,12 @@ module Google
212
215
  # enabled. By default, asynchronous REST clients will not be generated.
213
216
  # This feature will be enabled by default 1 month after launching the
214
217
  # feature in preview packages.
218
+ # @!attribute [rw] protobuf_pythonic_types_enabled
219
+ # @return [::Boolean]
220
+ # Enables generation of protobuf code using new types that are more
221
+ # Pythonic which are included in `protobuf>=5.29.x`. This feature will be
222
+ # enabled by default 1 month after launching the feature in preview
223
+ # packages.
215
224
  class ExperimentalFeatures
216
225
  include ::Google::Protobuf::MessageExts
217
226
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -297,9 +306,28 @@ module Google
297
306
  # @!attribute [rw] common
298
307
  # @return [::Google::Api::CommonLanguageSettings]
299
308
  # Some settings.
309
+ # @!attribute [rw] renamed_services
310
+ # @return [::Google::Protobuf::Map{::String => ::String}]
311
+ # Map of service names to renamed services. Keys are the package relative
312
+ # service names and values are the name to be used for the service client
313
+ # and call options.
314
+ #
315
+ # publishing:
316
+ # go_settings:
317
+ # renamed_services:
318
+ # Publisher: TopicAdmin
300
319
  class GoSettings
301
320
  include ::Google::Protobuf::MessageExts
302
321
  extend ::Google::Protobuf::MessageExts::ClassMethods
322
+
323
+ # @!attribute [rw] key
324
+ # @return [::String]
325
+ # @!attribute [rw] value
326
+ # @return [::String]
327
+ class RenamedServicesEntry
328
+ include ::Google::Protobuf::MessageExts
329
+ extend ::Google::Protobuf::MessageExts::ClassMethods
330
+ end
303
331
  end
304
332
 
305
333
  # Describes the generator configuration for a method.
@@ -375,6 +403,17 @@ module Google
375
403
  end
376
404
  end
377
405
 
406
+ # This message is used to configure the generation of a subset of the RPCs in
407
+ # a service for client libraries.
408
+ # @!attribute [rw] methods
409
+ # @return [::Array<::String>]
410
+ # An allowlist of the fully qualified names of RPCs that should be included
411
+ # on public client surfaces.
412
+ class SelectiveGapicGeneration
413
+ include ::Google::Protobuf::MessageExts
414
+ extend ::Google::Protobuf::MessageExts::ClassMethods
415
+ end
416
+
378
417
  # The organization for which the client libraries are being published.
379
418
  # Affects the url where generated docs are published, etc.
380
419
  module ClientLibraryOrganization
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-pubsub-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.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-10-15 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
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0'
135
135
  requirements: []
136
- rubygems_version: 3.5.21
136
+ rubygems_version: 3.5.23
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: Provides reliable, many-to-many, asynchronous messaging between applications.