google-cloud-support-v2 1.0.1 → 1.2.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: 21d96ec15a11d6f7248cb53a6baa2b9275ccf59332c81108731ec878761b5e8a
4
- data.tar.gz: ed9fb1a0a89849f2cdef608a0c650a87658424494be5bb15a533648a501bf0c7
3
+ metadata.gz: e31853fc8a4eaa7918a7b3f83858a47627db4b85f841218a75dcecb0085f7aa2
4
+ data.tar.gz: f3b3b51c01c5ad73bb64173cd2620002da890185b00eef28859af2d97b9beca8
5
5
  SHA512:
6
- metadata.gz: e79254257ac3a58c30ce0ad766706ac5b506fc44a03302a9a2d375898de9a60228ca9887bbf04caa7505c2f3fadf073ac9fc99c22b525b89a0a2d7b8dd04abcb
7
- data.tar.gz: 636011eef3fba56bd5ef218df9c64ad2e202cca5abf5e6857648779003ebd0c2e59385db52e006a48800620d78257eb3bf05794aa79c8d1e5a7d77c63ac48124
6
+ metadata.gz: 60d68858ec697a7e1f899ccea5f67c0cbf2f3fa9912f414b4c872fe27311e07ab7f4e18ff683fd2a109673951bd7084871da4ba98e8fafc91806159a716af80e
7
+ data.tar.gz: 491eddbda8e5a325e0bc47509ab313f7a30adb5adf583dabd3cf89c08af7bca7b29b7ee687644a3a4b47f5c8d5eb0edea50bc092b4d0ac0e7890c37015fe0c18
data/README.md CHANGED
@@ -43,40 +43,50 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/support/docs/reference/support-api)
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/support/v2"
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::Support::V2::CaseAttachmentService::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).
76
86
 
77
87
  ## Supported Ruby Versions
78
88
 
79
- This library is supported on Ruby 2.7+.
89
+ This library is supported on Ruby 3.0+.
80
90
 
81
91
  Google provides official support for Ruby versions that are actively supported
82
92
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -162,8 +162,28 @@ module Google
162
162
  universe_domain: @config.universe_domain,
163
163
  channel_args: @config.channel_args,
164
164
  interceptors: @config.interceptors,
165
- channel_pool_config: @config.channel_pool
165
+ channel_pool_config: @config.channel_pool,
166
+ logger: @config.logger
166
167
  )
168
+
169
+ @case_attachment_service_stub.stub_logger&.info do |entry|
170
+ entry.set_system_name
171
+ entry.set_service
172
+ entry.message = "Created client for #{entry.service}"
173
+ entry.set_credentials_fields credentials
174
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
175
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
176
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
177
+ end
178
+ end
179
+
180
+ ##
181
+ # The logger used for request/response debug logging.
182
+ #
183
+ # @return [Logger]
184
+ #
185
+ def logger
186
+ @case_attachment_service_stub.logger
167
187
  end
168
188
 
169
189
  # Service calls
@@ -261,7 +281,7 @@ module Google
261
281
  @case_attachment_service_stub.call_rpc :list_attachments, request, options: options do |response, operation|
262
282
  response = ::Gapic::PagedEnumerable.new @case_attachment_service_stub, :list_attachments, request, response, operation, options
263
283
  yield response, operation if block_given?
264
- return response
284
+ throw :response, response
265
285
  end
266
286
  rescue ::GRPC::BadStatus => e
267
287
  raise ::Google::Cloud::Error.from_error(e)
@@ -311,6 +331,13 @@ module Google
311
331
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
312
332
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
313
333
  # * (`nil`) indicating no credentials
334
+ #
335
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
336
+ # external source for authentication to Google Cloud, you must validate it before
337
+ # providing it to a Google API client library. Providing an unvalidated credential
338
+ # configuration to Google APIs can compromise the security of your systems and data.
339
+ # For more information, refer to [Validate credential configurations from external
340
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
314
341
  # @return [::Object]
315
342
  # @!attribute [rw] scope
316
343
  # The OAuth scopes
@@ -350,6 +377,11 @@ module Google
350
377
  # default endpoint URL. The default value of nil uses the environment
351
378
  # universe (usually the default "googleapis.com" universe).
352
379
  # @return [::String,nil]
380
+ # @!attribute [rw] logger
381
+ # A custom logger to use for request/response debug logging, or the value
382
+ # `:default` (the default) to construct a default logger, or `nil` to
383
+ # explicitly disable logging.
384
+ # @return [::Logger,:default,nil]
353
385
  #
354
386
  class Configuration
355
387
  extend ::Gapic::Config
@@ -374,6 +406,7 @@ module Google
374
406
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
375
407
  config_attr :quota_project, nil, ::String, nil
376
408
  config_attr :universe_domain, nil, ::String, nil
409
+ config_attr :logger, :default, ::Logger, nil, :default
377
410
 
378
411
  # @private
379
412
  def initialize parent_config = nil
@@ -185,8 +185,28 @@ module Google
185
185
  universe_domain: @config.universe_domain,
186
186
  channel_args: @config.channel_args,
187
187
  interceptors: @config.interceptors,
188
- channel_pool_config: @config.channel_pool
188
+ channel_pool_config: @config.channel_pool,
189
+ logger: @config.logger
189
190
  )
191
+
192
+ @case_service_stub.stub_logger&.info do |entry|
193
+ entry.set_system_name
194
+ entry.set_service
195
+ entry.message = "Created client for #{entry.service}"
196
+ entry.set_credentials_fields credentials
197
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
198
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
199
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
200
+ end
201
+ end
202
+
203
+ ##
204
+ # The logger used for request/response debug logging.
205
+ #
206
+ # @return [Logger]
207
+ #
208
+ def logger
209
+ @case_service_stub.logger
190
210
  end
191
211
 
192
212
  # Service calls
@@ -271,7 +291,6 @@ module Google
271
291
 
272
292
  @case_service_stub.call_rpc :get_case, request, options: options do |response, operation|
273
293
  yield response, operation if block_given?
274
- return response
275
294
  end
276
295
  rescue ::GRPC::BadStatus => e
277
296
  raise ::Google::Cloud::Error.from_error(e)
@@ -390,7 +409,7 @@ module Google
390
409
  @case_service_stub.call_rpc :list_cases, request, options: options do |response, operation|
391
410
  response = ::Gapic::PagedEnumerable.new @case_service_stub, :list_cases, request, response, operation, options
392
411
  yield response, operation if block_given?
393
- return response
412
+ throw :response, response
394
413
  end
395
414
  rescue ::GRPC::BadStatus => e
396
415
  raise ::Google::Cloud::Error.from_error(e)
@@ -523,7 +542,7 @@ module Google
523
542
  @case_service_stub.call_rpc :search_cases, request, options: options do |response, operation|
524
543
  response = ::Gapic::PagedEnumerable.new @case_service_stub, :search_cases, request, response, operation, options
525
544
  yield response, operation if block_given?
526
- return response
545
+ throw :response, response
527
546
  end
528
547
  rescue ::GRPC::BadStatus => e
529
548
  raise ::Google::Cloud::Error.from_error(e)
@@ -614,7 +633,6 @@ module Google
614
633
 
615
634
  @case_service_stub.call_rpc :create_case, request, options: options do |response, operation|
616
635
  yield response, operation if block_given?
617
- return response
618
636
  end
619
637
  rescue ::GRPC::BadStatus => e
620
638
  raise ::Google::Cloud::Error.from_error(e)
@@ -710,7 +728,6 @@ module Google
710
728
 
711
729
  @case_service_stub.call_rpc :update_case, request, options: options do |response, operation|
712
730
  yield response, operation if block_given?
713
- return response
714
731
  end
715
732
  rescue ::GRPC::BadStatus => e
716
733
  raise ::Google::Cloud::Error.from_error(e)
@@ -804,7 +821,6 @@ module Google
804
821
 
805
822
  @case_service_stub.call_rpc :escalate_case, request, options: options do |response, operation|
806
823
  yield response, operation if block_given?
807
- return response
808
824
  end
809
825
  rescue ::GRPC::BadStatus => e
810
826
  raise ::Google::Cloud::Error.from_error(e)
@@ -890,7 +906,6 @@ module Google
890
906
 
891
907
  @case_service_stub.call_rpc :close_case, request, options: options do |response, operation|
892
908
  yield response, operation if block_given?
893
- return response
894
909
  end
895
910
  rescue ::GRPC::BadStatus => e
896
911
  raise ::Google::Cloud::Error.from_error(e)
@@ -983,7 +998,7 @@ module Google
983
998
  @case_service_stub.call_rpc :search_case_classifications, request, options: options do |response, operation|
984
999
  response = ::Gapic::PagedEnumerable.new @case_service_stub, :search_case_classifications, request, response, operation, options
985
1000
  yield response, operation if block_given?
986
- return response
1001
+ throw :response, response
987
1002
  end
988
1003
  rescue ::GRPC::BadStatus => e
989
1004
  raise ::Google::Cloud::Error.from_error(e)
@@ -1033,6 +1048,13 @@ module Google
1033
1048
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1034
1049
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1035
1050
  # * (`nil`) indicating no credentials
1051
+ #
1052
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1053
+ # external source for authentication to Google Cloud, you must validate it before
1054
+ # providing it to a Google API client library. Providing an unvalidated credential
1055
+ # configuration to Google APIs can compromise the security of your systems and data.
1056
+ # For more information, refer to [Validate credential configurations from external
1057
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1036
1058
  # @return [::Object]
1037
1059
  # @!attribute [rw] scope
1038
1060
  # The OAuth scopes
@@ -1072,6 +1094,11 @@ module Google
1072
1094
  # default endpoint URL. The default value of nil uses the environment
1073
1095
  # universe (usually the default "googleapis.com" universe).
1074
1096
  # @return [::String,nil]
1097
+ # @!attribute [rw] logger
1098
+ # A custom logger to use for request/response debug logging, or the value
1099
+ # `:default` (the default) to construct a default logger, or `nil` to
1100
+ # explicitly disable logging.
1101
+ # @return [::Logger,:default,nil]
1075
1102
  #
1076
1103
  class Configuration
1077
1104
  extend ::Gapic::Config
@@ -1096,6 +1123,7 @@ module Google
1096
1123
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1097
1124
  config_attr :quota_project, nil, ::String, nil
1098
1125
  config_attr :universe_domain, nil, ::String, nil
1126
+ config_attr :logger, :default, ::Logger, nil, :default
1099
1127
 
1100
1128
  # @private
1101
1129
  def initialize parent_config = nil
@@ -164,8 +164,28 @@ module Google
164
164
  universe_domain: @config.universe_domain,
165
165
  channel_args: @config.channel_args,
166
166
  interceptors: @config.interceptors,
167
- channel_pool_config: @config.channel_pool
167
+ channel_pool_config: @config.channel_pool,
168
+ logger: @config.logger
168
169
  )
170
+
171
+ @comment_service_stub.stub_logger&.info do |entry|
172
+ entry.set_system_name
173
+ entry.set_service
174
+ entry.message = "Created client for #{entry.service}"
175
+ entry.set_credentials_fields credentials
176
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
177
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
178
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
179
+ end
180
+ end
181
+
182
+ ##
183
+ # The logger used for request/response debug logging.
184
+ #
185
+ # @return [Logger]
186
+ #
187
+ def logger
188
+ @comment_service_stub.logger
169
189
  end
170
190
 
171
191
  # Service calls
@@ -261,7 +281,7 @@ module Google
261
281
  @comment_service_stub.call_rpc :list_comments, request, options: options do |response, operation|
262
282
  response = ::Gapic::PagedEnumerable.new @comment_service_stub, :list_comments, request, response, operation, options
263
283
  yield response, operation if block_given?
264
- return response
284
+ throw :response, response
265
285
  end
266
286
  rescue ::GRPC::BadStatus => e
267
287
  raise ::Google::Cloud::Error.from_error(e)
@@ -350,7 +370,6 @@ module Google
350
370
 
351
371
  @comment_service_stub.call_rpc :create_comment, request, options: options do |response, operation|
352
372
  yield response, operation if block_given?
353
- return response
354
373
  end
355
374
  rescue ::GRPC::BadStatus => e
356
375
  raise ::Google::Cloud::Error.from_error(e)
@@ -400,6 +419,13 @@ module Google
400
419
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
401
420
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
402
421
  # * (`nil`) indicating no credentials
422
+ #
423
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
424
+ # external source for authentication to Google Cloud, you must validate it before
425
+ # providing it to a Google API client library. Providing an unvalidated credential
426
+ # configuration to Google APIs can compromise the security of your systems and data.
427
+ # For more information, refer to [Validate credential configurations from external
428
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
403
429
  # @return [::Object]
404
430
  # @!attribute [rw] scope
405
431
  # The OAuth scopes
@@ -439,6 +465,11 @@ module Google
439
465
  # default endpoint URL. The default value of nil uses the environment
440
466
  # universe (usually the default "googleapis.com" universe).
441
467
  # @return [::String,nil]
468
+ # @!attribute [rw] logger
469
+ # A custom logger to use for request/response debug logging, or the value
470
+ # `:default` (the default) to construct a default logger, or `nil` to
471
+ # explicitly disable logging.
472
+ # @return [::Logger,:default,nil]
442
473
  #
443
474
  class Configuration
444
475
  extend ::Gapic::Config
@@ -463,6 +494,7 @@ module Google
463
494
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
464
495
  config_attr :quota_project, nil, ::String, nil
465
496
  config_attr :universe_domain, nil, ::String, nil
497
+ config_attr :logger, :default, ::Logger, nil, :default
466
498
 
467
499
  # @private
468
500
  def initialize parent_config = nil
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Support
23
23
  module V2
24
- VERSION = "1.0.1"
24
+ VERSION = "1.2.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-support-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.2.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-09-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
@@ -103,7 +102,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
103
102
  licenses:
104
103
  - Apache-2.0
105
104
  metadata: {}
106
- post_install_message:
107
105
  rdoc_options: []
108
106
  require_paths:
109
107
  - lib
@@ -111,15 +109,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
109
  requirements:
112
110
  - - ">="
113
111
  - !ruby/object:Gem::Version
114
- version: '2.7'
112
+ version: '3.0'
115
113
  required_rubygems_version: !ruby/object:Gem::Requirement
116
114
  requirements:
117
115
  - - ">="
118
116
  - !ruby/object:Gem::Version
119
117
  version: '0'
120
118
  requirements: []
121
- rubygems_version: 3.5.6
122
- signing_key:
119
+ rubygems_version: 3.6.2
123
120
  specification_version: 4
124
121
  summary: Manages Google Cloud technical support cases for Customer Care support offerings.
125
122
  test_files: []