google-cloud-support-v2 1.11.2 → 1.11.3

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.
@@ -25,6 +25,7 @@ require "google/cloud/support/v2/version"
25
25
  require "google/cloud/support/v2/case_service/credentials"
26
26
  require "google/cloud/support/v2/case_service/paths"
27
27
  require "google/cloud/support/v2/case_service/client"
28
+ require "google/cloud/support/v2/case_service/rest"
28
29
 
29
30
  module Google
30
31
  module Cloud
@@ -38,6 +39,11 @@ module Google
38
39
  # require "google/cloud/support/v2/case_service"
39
40
  # client = ::Google::Cloud::Support::V2::CaseService::Client.new
40
41
  #
42
+ # @example Load this service and instantiate a REST client
43
+ #
44
+ # require "google/cloud/support/v2/case_service/rest"
45
+ # client = ::Google::Cloud::Support::V2::CaseService::Rest::Client.new
46
+ #
41
47
  module CaseService
42
48
  end
43
49
  end
@@ -0,0 +1,647 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/v2/comment_service_pb"
21
+ require "google/cloud/support/v2/comment_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Support
26
+ module V2
27
+ module CommentService
28
+ module Rest
29
+ ##
30
+ # REST client for the CommentService service.
31
+ #
32
+ # A service to manage comments on cases.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :comment_service_stub
45
+
46
+ ##
47
+ # Configure the CommentService Client class.
48
+ #
49
+ # See {::Google::Cloud::Support::V2::CommentService::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all CommentService clients
55
+ # ::Google::Cloud::Support::V2::CommentService::Rest::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "Support", "V2"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.rpcs.list_comments.timeout = 60.0
76
+ default_config.rpcs.list_comments.retry_policy = {
77
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
78
+ }
79
+
80
+ default_config.rpcs.create_comment.timeout = 60.0
81
+
82
+ default_config
83
+ end
84
+ yield @configure if block_given?
85
+ @configure
86
+ end
87
+
88
+ ##
89
+ # Configure the CommentService Client instance.
90
+ #
91
+ # The configuration is set to the derived mode, meaning that values can be changed,
92
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
93
+ # should be made on {Client.configure}.
94
+ #
95
+ # See {::Google::Cloud::Support::V2::CommentService::Rest::Client::Configuration}
96
+ # for a description of the configuration fields.
97
+ #
98
+ # @yield [config] Configure the Client client.
99
+ # @yieldparam config [Client::Configuration]
100
+ #
101
+ # @return [Client::Configuration]
102
+ #
103
+ def configure
104
+ yield @config if block_given?
105
+ @config
106
+ end
107
+
108
+ ##
109
+ # The effective universe domain
110
+ #
111
+ # @return [String]
112
+ #
113
+ def universe_domain
114
+ @comment_service_stub.universe_domain
115
+ end
116
+
117
+ ##
118
+ # Create a new CommentService REST client object.
119
+ #
120
+ # @example
121
+ #
122
+ # # Create a client using the default configuration
123
+ # client = ::Google::Cloud::Support::V2::CommentService::Rest::Client.new
124
+ #
125
+ # # Create a client using a custom configuration
126
+ # client = ::Google::Cloud::Support::V2::CommentService::Rest::Client.new do |config|
127
+ # config.timeout = 10.0
128
+ # end
129
+ #
130
+ # @yield [config] Configure the CommentService client.
131
+ # @yieldparam config [Client::Configuration]
132
+ #
133
+ def initialize
134
+ # Create the configuration object
135
+ @config = Configuration.new Client.configure
136
+
137
+ # Yield the configuration if needed
138
+ yield @config if block_given?
139
+
140
+ # Create credentials
141
+ credentials = @config.credentials
142
+ # Use self-signed JWT if the endpoint is unchanged from default,
143
+ # but only if the default endpoint does not have a region prefix.
144
+ enable_self_signed_jwt = @config.endpoint.nil? ||
145
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
146
+ !@config.endpoint.split(".").first.include?("-"))
147
+ credentials ||= Credentials.default scope: @config.scope,
148
+ enable_self_signed_jwt: enable_self_signed_jwt
149
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
150
+ credentials = Credentials.new credentials, scope: @config.scope
151
+ end
152
+
153
+ @quota_project_id = @config.quota_project
154
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
155
+
156
+ @comment_service_stub = ::Google::Cloud::Support::V2::CommentService::Rest::ServiceStub.new(
157
+ endpoint: @config.endpoint,
158
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
159
+ universe_domain: @config.universe_domain,
160
+ credentials: credentials,
161
+ logger: @config.logger
162
+ )
163
+
164
+ @comment_service_stub.logger(stub: true)&.info do |entry|
165
+ entry.set_system_name
166
+ entry.set_service
167
+ entry.message = "Created client for #{entry.service}"
168
+ entry.set_credentials_fields credentials
169
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
170
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
171
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
172
+ end
173
+ end
174
+
175
+ ##
176
+ # The logger used for request/response debug logging.
177
+ #
178
+ # @return [Logger]
179
+ #
180
+ def logger
181
+ @comment_service_stub.logger
182
+ end
183
+
184
+ # Service calls
185
+
186
+ ##
187
+ # List all the comments associated with a case.
188
+ #
189
+ # @overload list_comments(request, options = nil)
190
+ # Pass arguments to `list_comments` via a request object, either of type
191
+ # {::Google::Cloud::Support::V2::ListCommentsRequest} or an equivalent Hash.
192
+ #
193
+ # @param request [::Google::Cloud::Support::V2::ListCommentsRequest, ::Hash]
194
+ # A request object representing the call parameters. Required. To specify no
195
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
196
+ # @param options [::Gapic::CallOptions, ::Hash]
197
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
198
+ #
199
+ # @overload list_comments(parent: nil, page_size: nil, page_token: nil)
200
+ # Pass arguments to `list_comments` via keyword arguments. Note that at
201
+ # least one keyword argument is required. To specify no parameters, or to keep all
202
+ # the default parameter values, pass an empty Hash as a request object (see above).
203
+ #
204
+ # @param parent [::String]
205
+ # Required. The name of the case for which to list comments.
206
+ # @param page_size [::Integer]
207
+ # The maximum number of comments to fetch. Defaults to 10.
208
+ # @param page_token [::String]
209
+ # A token identifying the page of results to return. If unspecified, the
210
+ # first page is returned.
211
+ # @yield [result, operation] Access the result along with the TransportOperation object
212
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2::Comment>]
213
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
214
+ #
215
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2::Comment>]
216
+ #
217
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
218
+ #
219
+ # @example Basic example
220
+ # require "google/cloud/support/v2"
221
+ #
222
+ # # Create a client object. The client can be reused for multiple calls.
223
+ # client = Google::Cloud::Support::V2::CommentService::Rest::Client.new
224
+ #
225
+ # # Create a request. To set request fields, pass in keyword arguments.
226
+ # request = Google::Cloud::Support::V2::ListCommentsRequest.new
227
+ #
228
+ # # Call the list_comments method.
229
+ # result = client.list_comments request
230
+ #
231
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
232
+ # # over elements, and API calls will be issued to fetch pages as needed.
233
+ # result.each do |item|
234
+ # # Each element is of type ::Google::Cloud::Support::V2::Comment.
235
+ # p item
236
+ # end
237
+ #
238
+ def list_comments request, options = nil
239
+ raise ::ArgumentError, "request must be provided" if request.nil?
240
+
241
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::ListCommentsRequest
242
+
243
+ # Converts hash and nil to an options object
244
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
245
+
246
+ # Customize the options with defaults
247
+ call_metadata = @config.rpcs.list_comments.metadata.to_h
248
+
249
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
250
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
251
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
252
+ gapic_version: ::Google::Cloud::Support::V2::VERSION,
253
+ transports_version_send: [:rest]
254
+
255
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
256
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
257
+
258
+ options.apply_defaults timeout: @config.rpcs.list_comments.timeout,
259
+ metadata: call_metadata,
260
+ retry_policy: @config.rpcs.list_comments.retry_policy
261
+
262
+ options.apply_defaults timeout: @config.timeout,
263
+ metadata: @config.metadata,
264
+ retry_policy: @config.retry_policy
265
+
266
+ @comment_service_stub.list_comments request, options do |result, operation|
267
+ result = ::Gapic::Rest::PagedEnumerable.new @comment_service_stub, :list_comments, "comments", request, result, options
268
+ yield result, operation if block_given?
269
+ throw :response, result
270
+ end
271
+ rescue ::Gapic::Rest::Error => e
272
+ raise ::Google::Cloud::Error.from_error(e)
273
+ end
274
+
275
+ ##
276
+ # Add a new comment to a case.
277
+ #
278
+ # The comment must have the following fields set: `body`.
279
+ #
280
+ # @overload create_comment(request, options = nil)
281
+ # Pass arguments to `create_comment` via a request object, either of type
282
+ # {::Google::Cloud::Support::V2::CreateCommentRequest} or an equivalent Hash.
283
+ #
284
+ # @param request [::Google::Cloud::Support::V2::CreateCommentRequest, ::Hash]
285
+ # A request object representing the call parameters. Required. To specify no
286
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
287
+ # @param options [::Gapic::CallOptions, ::Hash]
288
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
289
+ #
290
+ # @overload create_comment(parent: nil, comment: nil)
291
+ # Pass arguments to `create_comment` via keyword arguments. Note that at
292
+ # least one keyword argument is required. To specify no parameters, or to keep all
293
+ # the default parameter values, pass an empty Hash as a request object (see above).
294
+ #
295
+ # @param parent [::String]
296
+ # Required. The name of the case to which the comment should be added.
297
+ # @param comment [::Google::Cloud::Support::V2::Comment, ::Hash]
298
+ # Required. The comment to be added.
299
+ # @yield [result, operation] Access the result along with the TransportOperation object
300
+ # @yieldparam result [::Google::Cloud::Support::V2::Comment]
301
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
302
+ #
303
+ # @return [::Google::Cloud::Support::V2::Comment]
304
+ #
305
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
306
+ #
307
+ # @example Basic example
308
+ # require "google/cloud/support/v2"
309
+ #
310
+ # # Create a client object. The client can be reused for multiple calls.
311
+ # client = Google::Cloud::Support::V2::CommentService::Rest::Client.new
312
+ #
313
+ # # Create a request. To set request fields, pass in keyword arguments.
314
+ # request = Google::Cloud::Support::V2::CreateCommentRequest.new
315
+ #
316
+ # # Call the create_comment method.
317
+ # result = client.create_comment request
318
+ #
319
+ # # The returned object is of type Google::Cloud::Support::V2::Comment.
320
+ # p result
321
+ #
322
+ def create_comment request, options = nil
323
+ raise ::ArgumentError, "request must be provided" if request.nil?
324
+
325
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::CreateCommentRequest
326
+
327
+ # Converts hash and nil to an options object
328
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
329
+
330
+ # Customize the options with defaults
331
+ call_metadata = @config.rpcs.create_comment.metadata.to_h
332
+
333
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
334
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
335
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
336
+ gapic_version: ::Google::Cloud::Support::V2::VERSION,
337
+ transports_version_send: [:rest]
338
+
339
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
340
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
341
+
342
+ options.apply_defaults timeout: @config.rpcs.create_comment.timeout,
343
+ metadata: call_metadata,
344
+ retry_policy: @config.rpcs.create_comment.retry_policy
345
+
346
+ options.apply_defaults timeout: @config.timeout,
347
+ metadata: @config.metadata,
348
+ retry_policy: @config.retry_policy
349
+
350
+ @comment_service_stub.create_comment request, options do |result, operation|
351
+ yield result, operation if block_given?
352
+ end
353
+ rescue ::Gapic::Rest::Error => e
354
+ raise ::Google::Cloud::Error.from_error(e)
355
+ end
356
+
357
+ ##
358
+ # Retrieve a comment.
359
+ #
360
+ # EXAMPLES:
361
+ #
362
+ # cURL:
363
+ #
364
+ # ```shell
365
+ # comment="projects/some-project/cases/43595344/comments/234567890"
366
+ # curl \
367
+ # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
368
+ # "https://cloudsupport.googleapis.com/v2/$comment"
369
+ # ```
370
+ #
371
+ # Python:
372
+ #
373
+ # ```python
374
+ # import googleapiclient.discovery
375
+ #
376
+ # api_version = "v2"
377
+ # supportApiService = googleapiclient.discovery.build(
378
+ # serviceName="cloudsupport",
379
+ # version=api_version,
380
+ # discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version=\\{api_version}",
381
+ # )
382
+ #
383
+ # request = supportApiService.cases().comments().get(
384
+ # name="projects/some-project/cases/43595344/comments/234567890",
385
+ # )
386
+ # print(request.execute())
387
+ # ```
388
+ #
389
+ # @overload get_comment(request, options = nil)
390
+ # Pass arguments to `get_comment` via a request object, either of type
391
+ # {::Google::Cloud::Support::V2::GetCommentRequest} or an equivalent Hash.
392
+ #
393
+ # @param request [::Google::Cloud::Support::V2::GetCommentRequest, ::Hash]
394
+ # A request object representing the call parameters. Required. To specify no
395
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
396
+ # @param options [::Gapic::CallOptions, ::Hash]
397
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
398
+ #
399
+ # @overload get_comment(name: nil)
400
+ # Pass arguments to `get_comment` via keyword arguments. Note that at
401
+ # least one keyword argument is required. To specify no parameters, or to keep all
402
+ # the default parameter values, pass an empty Hash as a request object (see above).
403
+ #
404
+ # @param name [::String]
405
+ # Required. The name of the comment to retrieve.
406
+ # @yield [result, operation] Access the result along with the TransportOperation object
407
+ # @yieldparam result [::Google::Cloud::Support::V2::Comment]
408
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
409
+ #
410
+ # @return [::Google::Cloud::Support::V2::Comment]
411
+ #
412
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
413
+ #
414
+ # @example Basic example
415
+ # require "google/cloud/support/v2"
416
+ #
417
+ # # Create a client object. The client can be reused for multiple calls.
418
+ # client = Google::Cloud::Support::V2::CommentService::Rest::Client.new
419
+ #
420
+ # # Create a request. To set request fields, pass in keyword arguments.
421
+ # request = Google::Cloud::Support::V2::GetCommentRequest.new
422
+ #
423
+ # # Call the get_comment method.
424
+ # result = client.get_comment request
425
+ #
426
+ # # The returned object is of type Google::Cloud::Support::V2::Comment.
427
+ # p result
428
+ #
429
+ def get_comment request, options = nil
430
+ raise ::ArgumentError, "request must be provided" if request.nil?
431
+
432
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::GetCommentRequest
433
+
434
+ # Converts hash and nil to an options object
435
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
436
+
437
+ # Customize the options with defaults
438
+ call_metadata = @config.rpcs.get_comment.metadata.to_h
439
+
440
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
441
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
442
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
443
+ gapic_version: ::Google::Cloud::Support::V2::VERSION,
444
+ transports_version_send: [:rest]
445
+
446
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
447
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
448
+
449
+ options.apply_defaults timeout: @config.rpcs.get_comment.timeout,
450
+ metadata: call_metadata,
451
+ retry_policy: @config.rpcs.get_comment.retry_policy
452
+
453
+ options.apply_defaults timeout: @config.timeout,
454
+ metadata: @config.metadata,
455
+ retry_policy: @config.retry_policy
456
+
457
+ @comment_service_stub.get_comment request, options do |result, operation|
458
+ yield result, operation if block_given?
459
+ end
460
+ rescue ::Gapic::Rest::Error => e
461
+ raise ::Google::Cloud::Error.from_error(e)
462
+ end
463
+
464
+ ##
465
+ # Configuration class for the CommentService REST API.
466
+ #
467
+ # This class represents the configuration for CommentService REST,
468
+ # providing control over timeouts, retry behavior, logging, transport
469
+ # parameters, and other low-level controls. Certain parameters can also be
470
+ # applied individually to specific RPCs. See
471
+ # {::Google::Cloud::Support::V2::CommentService::Rest::Client::Configuration::Rpcs}
472
+ # for a list of RPCs that can be configured independently.
473
+ #
474
+ # Configuration can be applied globally to all clients, or to a single client
475
+ # on construction.
476
+ #
477
+ # @example
478
+ #
479
+ # # Modify the global config, setting the timeout for
480
+ # # list_comments to 20 seconds,
481
+ # # and all remaining timeouts to 10 seconds.
482
+ # ::Google::Cloud::Support::V2::CommentService::Rest::Client.configure do |config|
483
+ # config.timeout = 10.0
484
+ # config.rpcs.list_comments.timeout = 20.0
485
+ # end
486
+ #
487
+ # # Apply the above configuration only to a new client.
488
+ # client = ::Google::Cloud::Support::V2::CommentService::Rest::Client.new do |config|
489
+ # config.timeout = 10.0
490
+ # config.rpcs.list_comments.timeout = 20.0
491
+ # end
492
+ #
493
+ # @!attribute [rw] endpoint
494
+ # A custom service endpoint, as a hostname or hostname:port. The default is
495
+ # nil, indicating to use the default endpoint in the current universe domain.
496
+ # @return [::String,nil]
497
+ # @!attribute [rw] credentials
498
+ # Credentials to send with calls. You may provide any of the following types:
499
+ # * (`String`) The path to a service account key file in JSON format
500
+ # * (`Hash`) A service account key as a Hash
501
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
502
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
503
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
504
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
505
+ # * (`nil`) indicating no credentials
506
+ #
507
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
508
+ # external source for authentication to Google Cloud, you must validate it before
509
+ # providing it to a Google API client library. Providing an unvalidated credential
510
+ # configuration to Google APIs can compromise the security of your systems and data.
511
+ # For more information, refer to [Validate credential configurations from external
512
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
513
+ # @return [::Object]
514
+ # @!attribute [rw] scope
515
+ # The OAuth scopes
516
+ # @return [::Array<::String>]
517
+ # @!attribute [rw] lib_name
518
+ # The library name as recorded in instrumentation and logging
519
+ # @return [::String]
520
+ # @!attribute [rw] lib_version
521
+ # The library version as recorded in instrumentation and logging
522
+ # @return [::String]
523
+ # @!attribute [rw] timeout
524
+ # The call timeout in seconds.
525
+ # @return [::Numeric]
526
+ # @!attribute [rw] metadata
527
+ # Additional headers to be sent with the call.
528
+ # @return [::Hash{::Symbol=>::String}]
529
+ # @!attribute [rw] retry_policy
530
+ # The retry policy. The value is a hash with the following keys:
531
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
532
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
533
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
534
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
535
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
536
+ # trigger a retry.
537
+ # @return [::Hash]
538
+ # @!attribute [rw] quota_project
539
+ # A separate project against which to charge quota.
540
+ # @return [::String]
541
+ # @!attribute [rw] universe_domain
542
+ # The universe domain within which to make requests. This determines the
543
+ # default endpoint URL. The default value of nil uses the environment
544
+ # universe (usually the default "googleapis.com" universe).
545
+ # @return [::String,nil]
546
+ # @!attribute [rw] logger
547
+ # A custom logger to use for request/response debug logging, or the value
548
+ # `:default` (the default) to construct a default logger, or `nil` to
549
+ # explicitly disable logging.
550
+ # @return [::Logger,:default,nil]
551
+ #
552
+ class Configuration
553
+ extend ::Gapic::Config
554
+
555
+ # @private
556
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
557
+ DEFAULT_ENDPOINT = "cloudsupport.googleapis.com"
558
+
559
+ config_attr :endpoint, nil, ::String, nil
560
+ config_attr :credentials, nil do |value|
561
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
562
+ allowed.any? { |klass| klass === value }
563
+ end
564
+ config_attr :scope, nil, ::String, ::Array, nil
565
+ config_attr :lib_name, nil, ::String, nil
566
+ config_attr :lib_version, nil, ::String, nil
567
+ config_attr :timeout, nil, ::Numeric, nil
568
+ config_attr :metadata, nil, ::Hash, nil
569
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
570
+ config_attr :quota_project, nil, ::String, nil
571
+ config_attr :universe_domain, nil, ::String, nil
572
+ config_attr :logger, :default, ::Logger, nil, :default
573
+
574
+ # @private
575
+ def initialize parent_config = nil
576
+ @parent_config = parent_config unless parent_config.nil?
577
+
578
+ yield self if block_given?
579
+ end
580
+
581
+ ##
582
+ # Configurations for individual RPCs
583
+ # @return [Rpcs]
584
+ #
585
+ def rpcs
586
+ @rpcs ||= begin
587
+ parent_rpcs = nil
588
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
589
+ Rpcs.new parent_rpcs
590
+ end
591
+ end
592
+
593
+ ##
594
+ # Configuration RPC class for the CommentService API.
595
+ #
596
+ # Includes fields providing the configuration for each RPC in this service.
597
+ # Each configuration object is of type `Gapic::Config::Method` and includes
598
+ # the following configuration fields:
599
+ #
600
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
601
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
602
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
603
+ # include the following keys:
604
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
605
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
606
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
607
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
608
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
609
+ # trigger a retry.
610
+ #
611
+ class Rpcs
612
+ ##
613
+ # RPC-specific configuration for `list_comments`
614
+ # @return [::Gapic::Config::Method]
615
+ #
616
+ attr_reader :list_comments
617
+ ##
618
+ # RPC-specific configuration for `create_comment`
619
+ # @return [::Gapic::Config::Method]
620
+ #
621
+ attr_reader :create_comment
622
+ ##
623
+ # RPC-specific configuration for `get_comment`
624
+ # @return [::Gapic::Config::Method]
625
+ #
626
+ attr_reader :get_comment
627
+
628
+ # @private
629
+ def initialize parent_rpcs = nil
630
+ list_comments_config = parent_rpcs.list_comments if parent_rpcs.respond_to? :list_comments
631
+ @list_comments = ::Gapic::Config::Method.new list_comments_config
632
+ create_comment_config = parent_rpcs.create_comment if parent_rpcs.respond_to? :create_comment
633
+ @create_comment = ::Gapic::Config::Method.new create_comment_config
634
+ get_comment_config = parent_rpcs.get_comment if parent_rpcs.respond_to? :get_comment
635
+ @get_comment = ::Gapic::Config::Method.new get_comment_config
636
+
637
+ yield self if block_given?
638
+ end
639
+ end
640
+ end
641
+ end
642
+ end
643
+ end
644
+ end
645
+ end
646
+ end
647
+ end