google-cloud-support-v2beta 0.a → 0.1.1

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.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/cloud/support/v2beta/actor_pb.rb +44 -0
  6. data/lib/google/cloud/support/v2beta/attachment_pb.rb +49 -0
  7. data/lib/google/cloud/support/v2beta/attachment_service_pb.rb +50 -0
  8. data/lib/google/cloud/support/v2beta/attachment_service_services_pb.rb +45 -0
  9. data/lib/google/cloud/support/v2beta/case_attachment_service/client.rb +480 -0
  10. data/lib/google/cloud/support/v2beta/case_attachment_service/credentials.rb +47 -0
  11. data/lib/google/cloud/support/v2beta/case_attachment_service/paths.rb +72 -0
  12. data/lib/google/cloud/support/v2beta/case_attachment_service/rest/client.rb +447 -0
  13. data/lib/google/cloud/support/v2beta/case_attachment_service/rest/service_stub.rb +149 -0
  14. data/lib/google/cloud/support/v2beta/case_attachment_service/rest.rb +52 -0
  15. data/lib/google/cloud/support/v2beta/case_attachment_service.rb +55 -0
  16. data/lib/google/cloud/support/v2beta/case_pb.rb +54 -0
  17. data/lib/google/cloud/support/v2beta/case_service/client.rb +1252 -0
  18. data/lib/google/cloud/support/v2beta/case_service/credentials.rb +47 -0
  19. data/lib/google/cloud/support/v2beta/case_service/paths.rb +100 -0
  20. data/lib/google/cloud/support/v2beta/case_service/rest/client.rb +1178 -0
  21. data/lib/google/cloud/support/v2beta/case_service/rest/service_stub.rb +624 -0
  22. data/lib/google/cloud/support/v2beta/case_service/rest.rb +52 -0
  23. data/lib/google/cloud/support/v2beta/case_service.rb +55 -0
  24. data/lib/google/cloud/support/v2beta/case_service_pb.rb +63 -0
  25. data/lib/google/cloud/support/v2beta/case_service_services_pb.rb +82 -0
  26. data/lib/google/cloud/support/v2beta/comment_pb.rb +49 -0
  27. data/lib/google/cloud/support/v2beta/comment_service/client.rb +571 -0
  28. data/lib/google/cloud/support/v2beta/comment_service/credentials.rb +47 -0
  29. data/lib/google/cloud/support/v2beta/comment_service/paths.rb +115 -0
  30. data/lib/google/cloud/support/v2beta/comment_service/rest/client.rb +531 -0
  31. data/lib/google/cloud/support/v2beta/comment_service/rest/service_stub.rb +219 -0
  32. data/lib/google/cloud/support/v2beta/comment_service/rest.rb +52 -0
  33. data/lib/google/cloud/support/v2beta/comment_service.rb +55 -0
  34. data/lib/google/cloud/support/v2beta/comment_service_pb.rb +51 -0
  35. data/lib/google/cloud/support/v2beta/comment_service_services_pb.rb +49 -0
  36. data/lib/google/cloud/support/v2beta/content_pb.rb +42 -0
  37. data/lib/google/cloud/support/v2beta/email_message_pb.rb +51 -0
  38. data/lib/google/cloud/support/v2beta/escalation_pb.rb +45 -0
  39. data/lib/google/cloud/support/v2beta/feed_item_pb.rb +52 -0
  40. data/lib/google/cloud/support/v2beta/feed_service/client.rb +482 -0
  41. data/lib/google/cloud/support/v2beta/feed_service/credentials.rb +47 -0
  42. data/lib/google/cloud/support/v2beta/feed_service/paths.rb +72 -0
  43. data/lib/google/cloud/support/v2beta/feed_service/rest/client.rb +449 -0
  44. data/lib/google/cloud/support/v2beta/feed_service/rest/service_stub.rb +149 -0
  45. data/lib/google/cloud/support/v2beta/feed_service/rest.rb +52 -0
  46. data/lib/google/cloud/support/v2beta/feed_service.rb +55 -0
  47. data/lib/google/cloud/support/v2beta/feed_service_pb.rb +50 -0
  48. data/lib/google/cloud/support/v2beta/feed_service_services_pb.rb +46 -0
  49. data/lib/google/cloud/support/v2beta/rest.rb +40 -0
  50. data/lib/google/cloud/support/v2beta/version.rb +7 -2
  51. data/lib/google/cloud/support/v2beta.rb +48 -0
  52. data/lib/google-cloud-support-v2beta.rb +21 -0
  53. data/proto_docs/README.md +4 -0
  54. data/proto_docs/google/api/client.rb +473 -0
  55. data/proto_docs/google/api/field_behavior.rb +85 -0
  56. data/proto_docs/google/api/launch_stage.rb +71 -0
  57. data/proto_docs/google/api/resource.rb +227 -0
  58. data/proto_docs/google/cloud/support/v2beta/actor.rb +59 -0
  59. data/proto_docs/google/cloud/support/v2beta/attachment.rb +58 -0
  60. data/proto_docs/google/cloud/support/v2beta/attachment_service.rb +63 -0
  61. data/proto_docs/google/cloud/support/v2beta/case.rb +215 -0
  62. data/proto_docs/google/cloud/support/v2beta/case_service.rb +245 -0
  63. data/proto_docs/google/cloud/support/v2beta/comment.rb +58 -0
  64. data/proto_docs/google/cloud/support/v2beta/comment_service.rb +68 -0
  65. data/proto_docs/google/cloud/support/v2beta/content.rb +35 -0
  66. data/proto_docs/google/cloud/support/v2beta/email_message.rb +55 -0
  67. data/proto_docs/google/cloud/support/v2beta/escalation.rb +55 -0
  68. data/proto_docs/google/cloud/support/v2beta/feed_item.rb +56 -0
  69. data/proto_docs/google/cloud/support/v2beta/feed_service.rb +65 -0
  70. data/proto_docs/google/protobuf/duration.rb +98 -0
  71. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  72. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  73. metadata +106 -10
@@ -0,0 +1,571 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/support/v2beta/comment_service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Support
25
+ module V2beta
26
+ module CommentService
27
+ ##
28
+ # Client for the CommentService service.
29
+ #
30
+ # A service to manage comments on cases.
31
+ #
32
+ class Client
33
+ # @private
34
+ API_VERSION = ""
35
+
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$"
38
+
39
+ include Paths
40
+
41
+ # @private
42
+ attr_reader :comment_service_stub
43
+
44
+ ##
45
+ # Configure the CommentService Client class.
46
+ #
47
+ # See {::Google::Cloud::Support::V2beta::CommentService::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all CommentService clients
53
+ # ::Google::Cloud::Support::V2beta::CommentService::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
56
+ #
57
+ # @yield [config] Configure the Client client.
58
+ # @yieldparam config [Client::Configuration]
59
+ #
60
+ # @return [Client::Configuration]
61
+ #
62
+ def self.configure
63
+ @configure ||= begin
64
+ namespace = ["Google", "Cloud", "Support", "V2beta"]
65
+ parent_config = while namespace.any?
66
+ parent_name = namespace.join "::"
67
+ parent_const = const_get parent_name
68
+ break parent_const.configure if parent_const.respond_to? :configure
69
+ namespace.pop
70
+ end
71
+ default_config = Client::Configuration.new parent_config
72
+
73
+ default_config.rpcs.list_comments.timeout = 60.0
74
+ default_config.rpcs.list_comments.retry_policy = {
75
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
76
+ }
77
+
78
+ default_config.rpcs.create_comment.timeout = 60.0
79
+
80
+ default_config
81
+ end
82
+ yield @configure if block_given?
83
+ @configure
84
+ end
85
+
86
+ ##
87
+ # Configure the CommentService Client instance.
88
+ #
89
+ # The configuration is set to the derived mode, meaning that values can be changed,
90
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
91
+ # should be made on {Client.configure}.
92
+ #
93
+ # See {::Google::Cloud::Support::V2beta::CommentService::Client::Configuration}
94
+ # for a description of the configuration fields.
95
+ #
96
+ # @yield [config] Configure the Client client.
97
+ # @yieldparam config [Client::Configuration]
98
+ #
99
+ # @return [Client::Configuration]
100
+ #
101
+ def configure
102
+ yield @config if block_given?
103
+ @config
104
+ end
105
+
106
+ ##
107
+ # The effective universe domain
108
+ #
109
+ # @return [String]
110
+ #
111
+ def universe_domain
112
+ @comment_service_stub.universe_domain
113
+ end
114
+
115
+ ##
116
+ # Create a new CommentService client object.
117
+ #
118
+ # @example
119
+ #
120
+ # # Create a client using the default configuration
121
+ # client = ::Google::Cloud::Support::V2beta::CommentService::Client.new
122
+ #
123
+ # # Create a client using a custom configuration
124
+ # client = ::Google::Cloud::Support::V2beta::CommentService::Client.new do |config|
125
+ # config.timeout = 10.0
126
+ # end
127
+ #
128
+ # @yield [config] Configure the CommentService client.
129
+ # @yieldparam config [Client::Configuration]
130
+ #
131
+ def initialize
132
+ # These require statements are intentionally placed here to initialize
133
+ # the gRPC module only when it's required.
134
+ # See https://github.com/googleapis/toolkit/issues/446
135
+ require "gapic/grpc"
136
+ require "google/cloud/support/v2beta/comment_service_services_pb"
137
+
138
+ # Create the configuration object
139
+ @config = Configuration.new Client.configure
140
+
141
+ # Yield the configuration if needed
142
+ yield @config if block_given?
143
+
144
+ # Create credentials
145
+ credentials = @config.credentials
146
+ # Use self-signed JWT if the endpoint is unchanged from default,
147
+ # but only if the default endpoint does not have a region prefix.
148
+ enable_self_signed_jwt = @config.endpoint.nil? ||
149
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
150
+ !@config.endpoint.split(".").first.include?("-"))
151
+ credentials ||= Credentials.default scope: @config.scope,
152
+ enable_self_signed_jwt: enable_self_signed_jwt
153
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
154
+ credentials = Credentials.new credentials, scope: @config.scope
155
+ end
156
+ @quota_project_id = @config.quota_project
157
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
158
+
159
+ @comment_service_stub = ::Gapic::ServiceStub.new(
160
+ ::Google::Cloud::Support::V2beta::CommentService::Stub,
161
+ credentials: credentials,
162
+ endpoint: @config.endpoint,
163
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
164
+ universe_domain: @config.universe_domain,
165
+ channel_args: @config.channel_args,
166
+ interceptors: @config.interceptors,
167
+ channel_pool_config: @config.channel_pool,
168
+ logger: @config.logger
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
189
+ end
190
+
191
+ # Service calls
192
+
193
+ ##
194
+ # List all the comments associated with a case.
195
+ #
196
+ # @overload list_comments(request, options = nil)
197
+ # Pass arguments to `list_comments` via a request object, either of type
198
+ # {::Google::Cloud::Support::V2beta::ListCommentsRequest} or an equivalent Hash.
199
+ #
200
+ # @param request [::Google::Cloud::Support::V2beta::ListCommentsRequest, ::Hash]
201
+ # A request object representing the call parameters. Required. To specify no
202
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
203
+ # @param options [::Gapic::CallOptions, ::Hash]
204
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
205
+ #
206
+ # @overload list_comments(parent: nil, page_size: nil, page_token: nil)
207
+ # Pass arguments to `list_comments` via keyword arguments. Note that at
208
+ # least one keyword argument is required. To specify no parameters, or to keep all
209
+ # the default parameter values, pass an empty Hash as a request object (see above).
210
+ #
211
+ # @param parent [::String]
212
+ # Required. The name of the case for which to list comments.
213
+ # @param page_size [::Integer]
214
+ # The maximum number of comments to fetch. Defaults to 10.
215
+ # @param page_token [::String]
216
+ # A token identifying the page of results to return. If unspecified, the
217
+ # first page is returned.
218
+ #
219
+ # @yield [response, operation] Access the result along with the RPC operation
220
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Comment>]
221
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
222
+ #
223
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Comment>]
224
+ #
225
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
226
+ #
227
+ # @example Basic example
228
+ # require "google/cloud/support/v2beta"
229
+ #
230
+ # # Create a client object. The client can be reused for multiple calls.
231
+ # client = Google::Cloud::Support::V2beta::CommentService::Client.new
232
+ #
233
+ # # Create a request. To set request fields, pass in keyword arguments.
234
+ # request = Google::Cloud::Support::V2beta::ListCommentsRequest.new
235
+ #
236
+ # # Call the list_comments method.
237
+ # result = client.list_comments request
238
+ #
239
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
240
+ # # over elements, and API calls will be issued to fetch pages as needed.
241
+ # result.each do |item|
242
+ # # Each element is of type ::Google::Cloud::Support::V2beta::Comment.
243
+ # p item
244
+ # end
245
+ #
246
+ def list_comments request, options = nil
247
+ raise ::ArgumentError, "request must be provided" if request.nil?
248
+
249
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ListCommentsRequest
250
+
251
+ # Converts hash and nil to an options object
252
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
253
+
254
+ # Customize the options with defaults
255
+ metadata = @config.rpcs.list_comments.metadata.to_h
256
+
257
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
258
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
259
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
260
+ gapic_version: ::Google::Cloud::Support::V2beta::VERSION
261
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
262
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
263
+
264
+ header_params = {}
265
+ if request.parent
266
+ header_params["parent"] = request.parent
267
+ end
268
+
269
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
270
+ metadata[:"x-goog-request-params"] ||= request_params_header
271
+
272
+ options.apply_defaults timeout: @config.rpcs.list_comments.timeout,
273
+ metadata: metadata,
274
+ retry_policy: @config.rpcs.list_comments.retry_policy
275
+
276
+ options.apply_defaults timeout: @config.timeout,
277
+ metadata: @config.metadata,
278
+ retry_policy: @config.retry_policy
279
+
280
+ @comment_service_stub.call_rpc :list_comments, request, options: options do |response, operation|
281
+ response = ::Gapic::PagedEnumerable.new @comment_service_stub, :list_comments, request, response, operation, options
282
+ yield response, operation if block_given?
283
+ throw :response, response
284
+ end
285
+ rescue ::GRPC::BadStatus => e
286
+ raise ::Google::Cloud::Error.from_error(e)
287
+ end
288
+
289
+ ##
290
+ # Add a new comment to a case.
291
+ #
292
+ # The comment must have the following fields set: `body`.
293
+ #
294
+ # @overload create_comment(request, options = nil)
295
+ # Pass arguments to `create_comment` via a request object, either of type
296
+ # {::Google::Cloud::Support::V2beta::CreateCommentRequest} or an equivalent Hash.
297
+ #
298
+ # @param request [::Google::Cloud::Support::V2beta::CreateCommentRequest, ::Hash]
299
+ # A request object representing the call parameters. Required. To specify no
300
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
301
+ # @param options [::Gapic::CallOptions, ::Hash]
302
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
303
+ #
304
+ # @overload create_comment(parent: nil, comment: nil)
305
+ # Pass arguments to `create_comment` via keyword arguments. Note that at
306
+ # least one keyword argument is required. To specify no parameters, or to keep all
307
+ # the default parameter values, pass an empty Hash as a request object (see above).
308
+ #
309
+ # @param parent [::String]
310
+ # Required. The name of the case to which the comment should be added.
311
+ # @param comment [::Google::Cloud::Support::V2beta::Comment, ::Hash]
312
+ # Required. The comment to be added.
313
+ #
314
+ # @yield [response, operation] Access the result along with the RPC operation
315
+ # @yieldparam response [::Google::Cloud::Support::V2beta::Comment]
316
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
317
+ #
318
+ # @return [::Google::Cloud::Support::V2beta::Comment]
319
+ #
320
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
321
+ #
322
+ # @example Basic example
323
+ # require "google/cloud/support/v2beta"
324
+ #
325
+ # # Create a client object. The client can be reused for multiple calls.
326
+ # client = Google::Cloud::Support::V2beta::CommentService::Client.new
327
+ #
328
+ # # Create a request. To set request fields, pass in keyword arguments.
329
+ # request = Google::Cloud::Support::V2beta::CreateCommentRequest.new
330
+ #
331
+ # # Call the create_comment method.
332
+ # result = client.create_comment request
333
+ #
334
+ # # The returned object is of type Google::Cloud::Support::V2beta::Comment.
335
+ # p result
336
+ #
337
+ def create_comment request, options = nil
338
+ raise ::ArgumentError, "request must be provided" if request.nil?
339
+
340
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::CreateCommentRequest
341
+
342
+ # Converts hash and nil to an options object
343
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
344
+
345
+ # Customize the options with defaults
346
+ metadata = @config.rpcs.create_comment.metadata.to_h
347
+
348
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
349
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
350
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
351
+ gapic_version: ::Google::Cloud::Support::V2beta::VERSION
352
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
353
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
354
+
355
+ header_params = {}
356
+ if request.parent
357
+ header_params["parent"] = request.parent
358
+ end
359
+
360
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
361
+ metadata[:"x-goog-request-params"] ||= request_params_header
362
+
363
+ options.apply_defaults timeout: @config.rpcs.create_comment.timeout,
364
+ metadata: metadata,
365
+ retry_policy: @config.rpcs.create_comment.retry_policy
366
+
367
+ options.apply_defaults timeout: @config.timeout,
368
+ metadata: @config.metadata,
369
+ retry_policy: @config.retry_policy
370
+
371
+ @comment_service_stub.call_rpc :create_comment, request, options: options do |response, operation|
372
+ yield response, operation if block_given?
373
+ end
374
+ rescue ::GRPC::BadStatus => e
375
+ raise ::Google::Cloud::Error.from_error(e)
376
+ end
377
+
378
+ ##
379
+ # Configuration class for the CommentService API.
380
+ #
381
+ # This class represents the configuration for CommentService,
382
+ # providing control over timeouts, retry behavior, logging, transport
383
+ # parameters, and other low-level controls. Certain parameters can also be
384
+ # applied individually to specific RPCs. See
385
+ # {::Google::Cloud::Support::V2beta::CommentService::Client::Configuration::Rpcs}
386
+ # for a list of RPCs that can be configured independently.
387
+ #
388
+ # Configuration can be applied globally to all clients, or to a single client
389
+ # on construction.
390
+ #
391
+ # @example
392
+ #
393
+ # # Modify the global config, setting the timeout for
394
+ # # list_comments to 20 seconds,
395
+ # # and all remaining timeouts to 10 seconds.
396
+ # ::Google::Cloud::Support::V2beta::CommentService::Client.configure do |config|
397
+ # config.timeout = 10.0
398
+ # config.rpcs.list_comments.timeout = 20.0
399
+ # end
400
+ #
401
+ # # Apply the above configuration only to a new client.
402
+ # client = ::Google::Cloud::Support::V2beta::CommentService::Client.new do |config|
403
+ # config.timeout = 10.0
404
+ # config.rpcs.list_comments.timeout = 20.0
405
+ # end
406
+ #
407
+ # @!attribute [rw] endpoint
408
+ # A custom service endpoint, as a hostname or hostname:port. The default is
409
+ # nil, indicating to use the default endpoint in the current universe domain.
410
+ # @return [::String,nil]
411
+ # @!attribute [rw] credentials
412
+ # Credentials to send with calls. You may provide any of the following types:
413
+ # * (`String`) The path to a service account key file in JSON format
414
+ # * (`Hash`) A service account key as a Hash
415
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
416
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
417
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
418
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
419
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
420
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
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).
429
+ # @return [::Object]
430
+ # @!attribute [rw] scope
431
+ # The OAuth scopes
432
+ # @return [::Array<::String>]
433
+ # @!attribute [rw] lib_name
434
+ # The library name as recorded in instrumentation and logging
435
+ # @return [::String]
436
+ # @!attribute [rw] lib_version
437
+ # The library version as recorded in instrumentation and logging
438
+ # @return [::String]
439
+ # @!attribute [rw] channel_args
440
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
441
+ # `GRPC::Core::Channel` object is provided as the credential.
442
+ # @return [::Hash]
443
+ # @!attribute [rw] interceptors
444
+ # An array of interceptors that are run before calls are executed.
445
+ # @return [::Array<::GRPC::ClientInterceptor>]
446
+ # @!attribute [rw] timeout
447
+ # The call timeout in seconds.
448
+ # @return [::Numeric]
449
+ # @!attribute [rw] metadata
450
+ # Additional gRPC headers to be sent with the call.
451
+ # @return [::Hash{::Symbol=>::String}]
452
+ # @!attribute [rw] retry_policy
453
+ # The retry policy. The value is a hash with the following keys:
454
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
455
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
456
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
457
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
458
+ # trigger a retry.
459
+ # @return [::Hash]
460
+ # @!attribute [rw] quota_project
461
+ # A separate project against which to charge quota.
462
+ # @return [::String]
463
+ # @!attribute [rw] universe_domain
464
+ # The universe domain within which to make requests. This determines the
465
+ # default endpoint URL. The default value of nil uses the environment
466
+ # universe (usually the default "googleapis.com" universe).
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]
473
+ #
474
+ class Configuration
475
+ extend ::Gapic::Config
476
+
477
+ # @private
478
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
479
+ DEFAULT_ENDPOINT = "cloudsupport.googleapis.com"
480
+
481
+ config_attr :endpoint, nil, ::String, nil
482
+ config_attr :credentials, nil do |value|
483
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
484
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
485
+ allowed.any? { |klass| klass === value }
486
+ end
487
+ config_attr :scope, nil, ::String, ::Array, nil
488
+ config_attr :lib_name, nil, ::String, nil
489
+ config_attr :lib_version, nil, ::String, nil
490
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
491
+ config_attr :interceptors, nil, ::Array, nil
492
+ config_attr :timeout, nil, ::Numeric, nil
493
+ config_attr :metadata, nil, ::Hash, nil
494
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
495
+ config_attr :quota_project, nil, ::String, nil
496
+ config_attr :universe_domain, nil, ::String, nil
497
+ config_attr :logger, :default, ::Logger, nil, :default
498
+
499
+ # @private
500
+ def initialize parent_config = nil
501
+ @parent_config = parent_config unless parent_config.nil?
502
+
503
+ yield self if block_given?
504
+ end
505
+
506
+ ##
507
+ # Configurations for individual RPCs
508
+ # @return [Rpcs]
509
+ #
510
+ def rpcs
511
+ @rpcs ||= begin
512
+ parent_rpcs = nil
513
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
514
+ Rpcs.new parent_rpcs
515
+ end
516
+ end
517
+
518
+ ##
519
+ # Configuration for the channel pool
520
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
521
+ #
522
+ def channel_pool
523
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
524
+ end
525
+
526
+ ##
527
+ # Configuration RPC class for the CommentService API.
528
+ #
529
+ # Includes fields providing the configuration for each RPC in this service.
530
+ # Each configuration object is of type `Gapic::Config::Method` and includes
531
+ # the following configuration fields:
532
+ #
533
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
534
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
535
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
536
+ # include the following keys:
537
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
538
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
539
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
540
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
541
+ # trigger a retry.
542
+ #
543
+ class Rpcs
544
+ ##
545
+ # RPC-specific configuration for `list_comments`
546
+ # @return [::Gapic::Config::Method]
547
+ #
548
+ attr_reader :list_comments
549
+ ##
550
+ # RPC-specific configuration for `create_comment`
551
+ # @return [::Gapic::Config::Method]
552
+ #
553
+ attr_reader :create_comment
554
+
555
+ # @private
556
+ def initialize parent_rpcs = nil
557
+ list_comments_config = parent_rpcs.list_comments if parent_rpcs.respond_to? :list_comments
558
+ @list_comments = ::Gapic::Config::Method.new list_comments_config
559
+ create_comment_config = parent_rpcs.create_comment if parent_rpcs.respond_to? :create_comment
560
+ @create_comment = ::Gapic::Config::Method.new create_comment_config
561
+
562
+ yield self if block_given?
563
+ end
564
+ end
565
+ end
566
+ end
567
+ end
568
+ end
569
+ end
570
+ end
571
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Support
24
+ module V2beta
25
+ module CommentService
26
+ # Credentials for the CommentService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "GOOGLE_CLOUD_CREDENTIALS",
33
+ "GOOGLE_CLOUD_KEYFILE",
34
+ "GCLOUD_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
36
+ "GOOGLE_CLOUD_KEYFILE_JSON",
37
+ "GCLOUD_KEYFILE_JSON"
38
+ ]
39
+ self.paths = [
40
+ "~/.config/google_cloud/application_default_credentials.json"
41
+ ]
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end