google-cloud-advisory_notifications-v1 0.10.2 → 0.12.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: fb995a1e6265cc6cf918dd9c61f293055cf2ab1a0a77fa22bee527a7f3c65677
4
- data.tar.gz: 811af4d450450c573fa6f26a2837403418103624eb364efd7959d2089afe7f7c
3
+ metadata.gz: 86c2c9518b2c6b5df0e73cfae073ba16584803fa50ded83ec320360a09feb609
4
+ data.tar.gz: 231ad4afd9034ec6a0536ea75c5a4ee64452fc38b8fb58d2d65bc1f0059d4bd0
5
5
  SHA512:
6
- metadata.gz: ba05833eb265fdfd92e41becb911e60fe4e9c4e061861d0540a222af3b30a6d3f183d2fe5c2c272a988b415c1d9e16312f90454f068b288e23b8254b04359d53
7
- data.tar.gz: b9b0b633a5023e132024b4406fb6ea461c7bd9613e62a5c1bffd5a5d3a7c1a819eeae09119f6ffb43039e2710877dd93e6c9deac1703c6c7952c6c6a20d8a764
6
+ metadata.gz: 8cbe7e5ff899845f9e0577fe385d466e3a503b8a00c359ef44d0ecd8957950137287cb69988a2fb99a7890b3ce314fa17825d8be3c1b8e3f4a249e88e9d3f760
7
+ data.tar.gz: 5d36ad5d5a90622e95735628acee807f21ea103adb3beedb922d960e7c6e10b04e0e7e71dfc188e05d8543b9e6166cb2c11a2b144047e3aee17c257eecbf5932
data/README.md CHANGED
@@ -42,40 +42,50 @@ 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).
75
85
 
76
86
  ## Supported Ruby Versions
77
87
 
78
- This library is supported on Ruby 2.7+.
88
+ This library is supported on Ruby 3.0+.
79
89
 
80
90
  Google provides official support for Ruby versions that are actively supported
81
91
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -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)
@@ -598,6 +615,13 @@ module Google
598
615
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
599
616
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
600
617
  # * (`nil`) indicating no credentials
618
+ #
619
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
620
+ # external source for authentication to Google Cloud, you must validate it before
621
+ # providing it to a Google API client library. Providing an unvalidated credential
622
+ # configuration to Google APIs can compromise the security of your systems and data.
623
+ # For more information, refer to [Validate credential configurations from external
624
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
601
625
  # @return [::Object]
602
626
  # @!attribute [rw] scope
603
627
  # The OAuth scopes
@@ -637,6 +661,11 @@ module Google
637
661
  # default endpoint URL. The default value of nil uses the environment
638
662
  # universe (usually the default "googleapis.com" universe).
639
663
  # @return [::String,nil]
664
+ # @!attribute [rw] logger
665
+ # A custom logger to use for request/response debug logging, or the value
666
+ # `:default` (the default) to construct a default logger, or `nil` to
667
+ # explicitly disable logging.
668
+ # @return [::Logger,:default,nil]
640
669
  #
641
670
  class Configuration
642
671
  extend ::Gapic::Config
@@ -661,6 +690,7 @@ module Google
661
690
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
662
691
  config_attr :quota_project, nil, ::String, nil
663
692
  config_attr :universe_domain, nil, ::String, nil
693
+ config_attr :logger, :default, ::Logger, nil, :default
664
694
 
665
695
  # @private
666
696
  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)
@@ -561,6 +578,13 @@ module Google
561
578
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
562
579
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
563
580
  # * (`nil`) indicating no credentials
581
+ #
582
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
583
+ # external source for authentication to Google Cloud, you must validate it before
584
+ # providing it to a Google API client library. Providing an unvalidated credential
585
+ # configuration to Google APIs can compromise the security of your systems and data.
586
+ # For more information, refer to [Validate credential configurations from external
587
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
564
588
  # @return [::Object]
565
589
  # @!attribute [rw] scope
566
590
  # The OAuth scopes
@@ -593,6 +617,11 @@ module Google
593
617
  # default endpoint URL. The default value of nil uses the environment
594
618
  # universe (usually the default "googleapis.com" universe).
595
619
  # @return [::String,nil]
620
+ # @!attribute [rw] logger
621
+ # A custom logger to use for request/response debug logging, or the value
622
+ # `:default` (the default) to construct a default logger, or `nil` to
623
+ # explicitly disable logging.
624
+ # @return [::Logger,:default,nil]
596
625
  #
597
626
  class Configuration
598
627
  extend ::Gapic::Config
@@ -614,6 +643,7 @@ module Google
614
643
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
615
644
  config_attr :quota_project, nil, ::String, nil
616
645
  config_attr :universe_domain, nil, ::String, nil
646
+ config_attr :logger, :default, ::Logger, nil, :default
617
647
 
618
648
  # @private
619
649
  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.2"
24
+ VERSION = "0.12.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,13 @@
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.2
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-30 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: gapic-common
@@ -16,7 +15,7 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 0.21.1
18
+ version: 0.25.0
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
21
  version: 2.a
@@ -26,7 +25,7 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- version: 0.21.1
28
+ version: 0.25.0
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
31
  version: 2.a
@@ -82,7 +81,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
82
81
  licenses:
83
82
  - Apache-2.0
84
83
  metadata: {}
85
- post_install_message:
86
84
  rdoc_options: []
87
85
  require_paths:
88
86
  - lib
@@ -90,15 +88,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
88
  requirements:
91
89
  - - ">="
92
90
  - !ruby/object:Gem::Version
93
- version: '2.7'
91
+ version: '3.0'
94
92
  required_rubygems_version: !ruby/object:Gem::Requirement
95
93
  requirements:
96
94
  - - ">="
97
95
  - !ruby/object:Gem::Version
98
96
  version: '0'
99
97
  requirements: []
100
- rubygems_version: 3.5.6
101
- signing_key:
98
+ rubygems_version: 3.6.2
102
99
  specification_version: 4
103
100
  summary: An API for accessing Advisory Notifications in Google Cloud.
104
101
  test_files: []