google-cloud-advisory_notifications-v1 0.10.1 → 0.11.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: 3be8e82a34456d392807faf2f2b390aec9060c76d6ef6a9f2385673c5c733aa9
4
- data.tar.gz: 3a47e94a07a7573e92dba8dbff421a25e5692f0480daf357826ec4dac74cdc00
3
+ metadata.gz: 4ae90ab9c68533f6e2b8e0bd5bc2a3d45b5ad8146d22c3db4d0b0ce0a2c8692f
4
+ data.tar.gz: e104ec520ee6a7fab76e67e16fe681539ad9f4b3a87803a9b679e8abd291e207
5
5
  SHA512:
6
- metadata.gz: 6e20710a78d91499ea406613530e07dfac7176969ccb5ade9ded4847c0374e332a1482f86adfd579a427a70fb4dac0df0ab8282259951de7a781d44cfff5321d
7
- data.tar.gz: 4d8c595c0eb53542015b9b6431b8761ecf8162871a2a9954310b5b1e0e181dbf0e14cba88492701f01c01021ab8458c69b6ef2b5cc2e8f154ed93da0cbe76b48
6
+ metadata.gz: a238c945e418a844e8ff3f95f723603205e5df11a1e1435ba1231528101ff8acd02de770a542a525d282dbf7f9e2776be0143639e2fc18197bc6bb9be0c0b511
7
+ data.tar.gz: ac2ca3afe6a893d4344bed42dc14b2931be0da3e70ac6b63385384b0883dd2c2fd37d105d464d2ab1d3914fed66f1ae85bff3c55fa6cbd173a47e447775a8ffb
data/README.md CHANGED
@@ -42,33 +42,43 @@ for class and method documentation.
42
42
  See also the [Product Documentation](https://cloud.google.com/advisory-notifications/docs/overview)
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/advisory_notifications/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::AdvisoryNotifications::V1::AdvisoryNotificationsService::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).
@@ -167,8 +167,28 @@ module Google
167
167
  universe_domain: @config.universe_domain,
168
168
  channel_args: @config.channel_args,
169
169
  interceptors: @config.interceptors,
170
- channel_pool_config: @config.channel_pool
170
+ channel_pool_config: @config.channel_pool,
171
+ logger: @config.logger
171
172
  )
173
+
174
+ @advisory_notifications_service_stub.stub_logger&.info do |entry|
175
+ entry.set_system_name
176
+ entry.set_service
177
+ entry.message = "Created client for #{entry.service}"
178
+ entry.set_credentials_fields credentials
179
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
180
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
181
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
182
+ end
183
+ end
184
+
185
+ ##
186
+ # The logger used for request/response debug logging.
187
+ #
188
+ # @return [Logger]
189
+ #
190
+ def logger
191
+ @advisory_notifications_service_stub.logger
172
192
  end
173
193
 
174
194
  # Service calls
@@ -278,7 +298,7 @@ module Google
278
298
  @advisory_notifications_service_stub.call_rpc :list_notifications, request, options: options do |response, operation|
279
299
  response = ::Gapic::PagedEnumerable.new @advisory_notifications_service_stub, :list_notifications, request, response, operation, options
280
300
  yield response, operation if block_given?
281
- return response
301
+ throw :response, response
282
302
  end
283
303
  rescue ::GRPC::BadStatus => e
284
304
  raise ::Google::Cloud::Error.from_error(e)
@@ -373,7 +393,6 @@ module Google
373
393
 
374
394
  @advisory_notifications_service_stub.call_rpc :get_notification, request, options: options do |response, operation|
375
395
  yield response, operation if block_given?
376
- return response
377
396
  end
378
397
  rescue ::GRPC::BadStatus => e
379
398
  raise ::Google::Cloud::Error.from_error(e)
@@ -462,7 +481,6 @@ module Google
462
481
 
463
482
  @advisory_notifications_service_stub.call_rpc :get_settings, request, options: options do |response, operation|
464
483
  yield response, operation if block_given?
465
- return response
466
484
  end
467
485
  rescue ::GRPC::BadStatus => e
468
486
  raise ::Google::Cloud::Error.from_error(e)
@@ -548,7 +566,6 @@ module Google
548
566
 
549
567
  @advisory_notifications_service_stub.call_rpc :update_settings, request, options: options do |response, operation|
550
568
  yield response, operation if block_given?
551
- return response
552
569
  end
553
570
  rescue ::GRPC::BadStatus => e
554
571
  raise ::Google::Cloud::Error.from_error(e)
@@ -637,6 +654,11 @@ module Google
637
654
  # default endpoint URL. The default value of nil uses the environment
638
655
  # universe (usually the default "googleapis.com" universe).
639
656
  # @return [::String,nil]
657
+ # @!attribute [rw] logger
658
+ # A custom logger to use for request/response debug logging, or the value
659
+ # `:default` (the default) to construct a default logger, or `nil` to
660
+ # explicitly disable logging.
661
+ # @return [::Logger,:default,nil]
640
662
  #
641
663
  class Configuration
642
664
  extend ::Gapic::Config
@@ -661,6 +683,7 @@ module Google
661
683
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
662
684
  config_attr :quota_project, nil, ::String, nil
663
685
  config_attr :universe_domain, nil, ::String, nil
686
+ config_attr :logger, :default, ::Logger, nil, :default
664
687
 
665
688
  # @private
666
689
  def initialize parent_config = nil
@@ -160,8 +160,28 @@ module Google
160
160
  endpoint: @config.endpoint,
161
161
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
162
162
  universe_domain: @config.universe_domain,
163
- credentials: credentials
163
+ credentials: credentials,
164
+ logger: @config.logger
164
165
  )
166
+
167
+ @advisory_notifications_service_stub.logger(stub: true)&.info do |entry|
168
+ entry.set_system_name
169
+ entry.set_service
170
+ entry.message = "Created client for #{entry.service}"
171
+ entry.set_credentials_fields credentials
172
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
173
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
174
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
175
+ end
176
+ end
177
+
178
+ ##
179
+ # The logger used for request/response debug logging.
180
+ #
181
+ # @return [Logger]
182
+ #
183
+ def logger
184
+ @advisory_notifications_service_stub.logger
165
185
  end
166
186
 
167
187
  # Service calls
@@ -264,7 +284,7 @@ module Google
264
284
  @advisory_notifications_service_stub.list_notifications request, options do |result, operation|
265
285
  result = ::Gapic::Rest::PagedEnumerable.new @advisory_notifications_service_stub, :list_notifications, "notifications", request, result, options
266
286
  yield result, operation if block_given?
267
- return result
287
+ throw :response, result
268
288
  end
269
289
  rescue ::Gapic::Rest::Error => e
270
290
  raise ::Google::Cloud::Error.from_error(e)
@@ -352,7 +372,6 @@ module Google
352
372
 
353
373
  @advisory_notifications_service_stub.get_notification request, options do |result, operation|
354
374
  yield result, operation if block_given?
355
- return result
356
375
  end
357
376
  rescue ::Gapic::Rest::Error => e
358
377
  raise ::Google::Cloud::Error.from_error(e)
@@ -434,7 +453,6 @@ module Google
434
453
 
435
454
  @advisory_notifications_service_stub.get_settings request, options do |result, operation|
436
455
  yield result, operation if block_given?
437
- return result
438
456
  end
439
457
  rescue ::Gapic::Rest::Error => e
440
458
  raise ::Google::Cloud::Error.from_error(e)
@@ -513,7 +531,6 @@ module Google
513
531
 
514
532
  @advisory_notifications_service_stub.update_settings request, options do |result, operation|
515
533
  yield result, operation if block_given?
516
- return result
517
534
  end
518
535
  rescue ::Gapic::Rest::Error => e
519
536
  raise ::Google::Cloud::Error.from_error(e)
@@ -593,6 +610,11 @@ module Google
593
610
  # default endpoint URL. The default value of nil uses the environment
594
611
  # universe (usually the default "googleapis.com" universe).
595
612
  # @return [::String,nil]
613
+ # @!attribute [rw] logger
614
+ # A custom logger to use for request/response debug logging, or the value
615
+ # `:default` (the default) to construct a default logger, or `nil` to
616
+ # explicitly disable logging.
617
+ # @return [::Logger,:default,nil]
596
618
  #
597
619
  class Configuration
598
620
  extend ::Gapic::Config
@@ -614,6 +636,7 @@ module Google
614
636
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
615
637
  config_attr :quota_project, nil, ::String, nil
616
638
  config_attr :universe_domain, nil, ::String, nil
639
+ config_attr :logger, :default, ::Logger, nil, :default
617
640
 
618
641
  # @private
619
642
  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_notifications 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_notifications",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::AdvisoryNotifications::V1::ListNotificationsResponse.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_notification",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::AdvisoryNotifications::V1::Notification.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: "get_settings",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::AdvisoryNotifications::V1::Settings.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_settings",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Cloud::AdvisoryNotifications::V1::Settings.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
  ##
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module AdvisoryNotifications
23
23
  module V1
24
- VERSION = "0.10.1"
24
+ VERSION = "0.11.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
@@ -196,9 +199,32 @@ module Google
196
199
  # @!attribute [rw] common
197
200
  # @return [::Google::Api::CommonLanguageSettings]
198
201
  # Some settings.
202
+ # @!attribute [rw] experimental_features
203
+ # @return [::Google::Api::PythonSettings::ExperimentalFeatures]
204
+ # Experimental features to be included during client library generation.
199
205
  class PythonSettings
200
206
  include ::Google::Protobuf::MessageExts
201
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
202
228
  end
203
229
 
204
230
  # Settings for Node client libraries.
@@ -280,9 +306,28 @@ module Google
280
306
  # @!attribute [rw] common
281
307
  # @return [::Google::Api::CommonLanguageSettings]
282
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
283
319
  class GoSettings
284
320
  include ::Google::Protobuf::MessageExts
285
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
286
331
  end
287
332
 
288
333
  # Describes the generator configuration for a method.
@@ -358,6 +403,17 @@ module Google
358
403
  end
359
404
  end
360
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
+
361
417
  # The organization for which the client libraries are being published.
362
418
  # Affects the url where generated docs are published, etc.
363
419
  module ClientLibraryOrganization
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-advisory_notifications-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.11.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-08-09 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
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  requirements: []
100
- rubygems_version: 3.5.6
100
+ rubygems_version: 3.5.23
101
101
  signing_key:
102
102
  specification_version: 4
103
103
  summary: An API for accessing Advisory Notifications in Google Cloud.