google-cloud-support-v2beta 0.a → 0.1.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.
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 +75 -0
  9. data/lib/google/cloud/support/v2beta/case_attachment_service/client.rb +510 -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 +477 -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 +1526 -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 +1452 -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 +356 -0
  26. data/lib/google/cloud/support/v2beta/comment_pb.rb +49 -0
  27. data/lib/google/cloud/support/v2beta/comment_service/client.rb +639 -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 +599 -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 +117 -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 +105 -9
@@ -0,0 +1,599 @@
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
+ require "google/cloud/support/v2beta/comment_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Support
26
+ module V2beta
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::V2beta::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::V2beta::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", "V2beta"]
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::V2beta::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::V2beta::CommentService::Rest::Client.new
124
+ #
125
+ # # Create a client using a custom configuration
126
+ # client = ::Google::Cloud::Support::V2beta::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::V2beta::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
+ # EXAMPLES:
190
+ #
191
+ # cURL:
192
+ #
193
+ # ```shell
194
+ # case="projects/some-project/cases/43595344"
195
+ # curl \
196
+ # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
197
+ # "https://cloudsupport.googleapis.com/v2/$case/comments"
198
+ # ```
199
+ #
200
+ # Python:
201
+ #
202
+ # ```python
203
+ # import googleapiclient.discovery
204
+ #
205
+ # api_version = "v2"
206
+ # supportApiService = googleapiclient.discovery.build(
207
+ # serviceName="cloudsupport",
208
+ # version=api_version,
209
+ # discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version=\\{api_version}",
210
+ # )
211
+ # request = (
212
+ # supportApiService.cases()
213
+ # .comments()
214
+ # .list(parent="projects/some-project/cases/43595344")
215
+ # )
216
+ # print(request.execute())
217
+ # ```
218
+ #
219
+ # @overload list_comments(request, options = nil)
220
+ # Pass arguments to `list_comments` via a request object, either of type
221
+ # {::Google::Cloud::Support::V2beta::ListCommentsRequest} or an equivalent Hash.
222
+ #
223
+ # @param request [::Google::Cloud::Support::V2beta::ListCommentsRequest, ::Hash]
224
+ # A request object representing the call parameters. Required. To specify no
225
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
226
+ # @param options [::Gapic::CallOptions, ::Hash]
227
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
228
+ #
229
+ # @overload list_comments(parent: nil, page_size: nil, page_token: nil)
230
+ # Pass arguments to `list_comments` via keyword arguments. Note that at
231
+ # least one keyword argument is required. To specify no parameters, or to keep all
232
+ # the default parameter values, pass an empty Hash as a request object (see above).
233
+ #
234
+ # @param parent [::String]
235
+ # Required. The name of the case for which to list comments.
236
+ # @param page_size [::Integer]
237
+ # The maximum number of comments to fetch. Defaults to 10.
238
+ # @param page_token [::String]
239
+ # A token identifying the page of results to return. If unspecified, the
240
+ # first page is returned.
241
+ # @yield [result, operation] Access the result along with the TransportOperation object
242
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Comment>]
243
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
244
+ #
245
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Comment>]
246
+ #
247
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
248
+ #
249
+ # @example Basic example
250
+ # require "google/cloud/support/v2beta"
251
+ #
252
+ # # Create a client object. The client can be reused for multiple calls.
253
+ # client = Google::Cloud::Support::V2beta::CommentService::Rest::Client.new
254
+ #
255
+ # # Create a request. To set request fields, pass in keyword arguments.
256
+ # request = Google::Cloud::Support::V2beta::ListCommentsRequest.new
257
+ #
258
+ # # Call the list_comments method.
259
+ # result = client.list_comments request
260
+ #
261
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
262
+ # # over elements, and API calls will be issued to fetch pages as needed.
263
+ # result.each do |item|
264
+ # # Each element is of type ::Google::Cloud::Support::V2beta::Comment.
265
+ # p item
266
+ # end
267
+ #
268
+ def list_comments request, options = nil
269
+ raise ::ArgumentError, "request must be provided" if request.nil?
270
+
271
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ListCommentsRequest
272
+
273
+ # Converts hash and nil to an options object
274
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
275
+
276
+ # Customize the options with defaults
277
+ call_metadata = @config.rpcs.list_comments.metadata.to_h
278
+
279
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
280
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
281
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
282
+ gapic_version: ::Google::Cloud::Support::V2beta::VERSION,
283
+ transports_version_send: [:rest]
284
+
285
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
286
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
287
+
288
+ options.apply_defaults timeout: @config.rpcs.list_comments.timeout,
289
+ metadata: call_metadata,
290
+ retry_policy: @config.rpcs.list_comments.retry_policy
291
+
292
+ options.apply_defaults timeout: @config.timeout,
293
+ metadata: @config.metadata,
294
+ retry_policy: @config.retry_policy
295
+
296
+ @comment_service_stub.list_comments request, options do |result, operation|
297
+ result = ::Gapic::Rest::PagedEnumerable.new @comment_service_stub, :list_comments, "comments", request, result, options
298
+ yield result, operation if block_given?
299
+ throw :response, result
300
+ end
301
+ rescue ::Gapic::Rest::Error => e
302
+ raise ::Google::Cloud::Error.from_error(e)
303
+ end
304
+
305
+ ##
306
+ # Add a new comment to a case.
307
+ #
308
+ # The comment must have the following fields set: `body`.
309
+ #
310
+ # EXAMPLES:
311
+ #
312
+ # cURL:
313
+ #
314
+ # ```shell
315
+ # case="projects/some-project/cases/43591344"
316
+ # curl \
317
+ # --request POST \
318
+ # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
319
+ # --header 'Content-Type: application/json' \
320
+ # --data '{
321
+ # "body": "This is a test comment."
322
+ # }' \
323
+ # "https://cloudsupport.googleapis.com/v2/$case/comments"
324
+ # ```
325
+ #
326
+ # Python:
327
+ #
328
+ # ```python
329
+ # import googleapiclient.discovery
330
+ #
331
+ # api_version = "v2"
332
+ # supportApiService = googleapiclient.discovery.build(
333
+ # serviceName="cloudsupport",
334
+ # version=api_version,
335
+ # discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version=\\{api_version}",
336
+ # )
337
+ # request = (
338
+ # supportApiService.cases()
339
+ # .comments()
340
+ # .create(
341
+ # parent="projects/some-project/cases/43595344",
342
+ # body=\\{"body": "This is a test comment."},
343
+ # )
344
+ # )
345
+ # print(request.execute())
346
+ # ```
347
+ #
348
+ # @overload create_comment(request, options = nil)
349
+ # Pass arguments to `create_comment` via a request object, either of type
350
+ # {::Google::Cloud::Support::V2beta::CreateCommentRequest} or an equivalent Hash.
351
+ #
352
+ # @param request [::Google::Cloud::Support::V2beta::CreateCommentRequest, ::Hash]
353
+ # A request object representing the call parameters. Required. To specify no
354
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
355
+ # @param options [::Gapic::CallOptions, ::Hash]
356
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
357
+ #
358
+ # @overload create_comment(parent: nil, comment: nil)
359
+ # Pass arguments to `create_comment` via keyword arguments. Note that at
360
+ # least one keyword argument is required. To specify no parameters, or to keep all
361
+ # the default parameter values, pass an empty Hash as a request object (see above).
362
+ #
363
+ # @param parent [::String]
364
+ # Required. The name of the case to which the comment should be added.
365
+ # @param comment [::Google::Cloud::Support::V2beta::Comment, ::Hash]
366
+ # Required. The comment to be added.
367
+ # @yield [result, operation] Access the result along with the TransportOperation object
368
+ # @yieldparam result [::Google::Cloud::Support::V2beta::Comment]
369
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
370
+ #
371
+ # @return [::Google::Cloud::Support::V2beta::Comment]
372
+ #
373
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
374
+ #
375
+ # @example Basic example
376
+ # require "google/cloud/support/v2beta"
377
+ #
378
+ # # Create a client object. The client can be reused for multiple calls.
379
+ # client = Google::Cloud::Support::V2beta::CommentService::Rest::Client.new
380
+ #
381
+ # # Create a request. To set request fields, pass in keyword arguments.
382
+ # request = Google::Cloud::Support::V2beta::CreateCommentRequest.new
383
+ #
384
+ # # Call the create_comment method.
385
+ # result = client.create_comment request
386
+ #
387
+ # # The returned object is of type Google::Cloud::Support::V2beta::Comment.
388
+ # p result
389
+ #
390
+ def create_comment request, options = nil
391
+ raise ::ArgumentError, "request must be provided" if request.nil?
392
+
393
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::CreateCommentRequest
394
+
395
+ # Converts hash and nil to an options object
396
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
397
+
398
+ # Customize the options with defaults
399
+ call_metadata = @config.rpcs.create_comment.metadata.to_h
400
+
401
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
402
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
403
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
404
+ gapic_version: ::Google::Cloud::Support::V2beta::VERSION,
405
+ transports_version_send: [:rest]
406
+
407
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
408
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
409
+
410
+ options.apply_defaults timeout: @config.rpcs.create_comment.timeout,
411
+ metadata: call_metadata,
412
+ retry_policy: @config.rpcs.create_comment.retry_policy
413
+
414
+ options.apply_defaults timeout: @config.timeout,
415
+ metadata: @config.metadata,
416
+ retry_policy: @config.retry_policy
417
+
418
+ @comment_service_stub.create_comment request, options do |result, operation|
419
+ yield result, operation if block_given?
420
+ end
421
+ rescue ::Gapic::Rest::Error => e
422
+ raise ::Google::Cloud::Error.from_error(e)
423
+ end
424
+
425
+ ##
426
+ # Configuration class for the CommentService REST API.
427
+ #
428
+ # This class represents the configuration for CommentService REST,
429
+ # providing control over timeouts, retry behavior, logging, transport
430
+ # parameters, and other low-level controls. Certain parameters can also be
431
+ # applied individually to specific RPCs. See
432
+ # {::Google::Cloud::Support::V2beta::CommentService::Rest::Client::Configuration::Rpcs}
433
+ # for a list of RPCs that can be configured independently.
434
+ #
435
+ # Configuration can be applied globally to all clients, or to a single client
436
+ # on construction.
437
+ #
438
+ # @example
439
+ #
440
+ # # Modify the global config, setting the timeout for
441
+ # # list_comments to 20 seconds,
442
+ # # and all remaining timeouts to 10 seconds.
443
+ # ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.configure do |config|
444
+ # config.timeout = 10.0
445
+ # config.rpcs.list_comments.timeout = 20.0
446
+ # end
447
+ #
448
+ # # Apply the above configuration only to a new client.
449
+ # client = ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.new do |config|
450
+ # config.timeout = 10.0
451
+ # config.rpcs.list_comments.timeout = 20.0
452
+ # end
453
+ #
454
+ # @!attribute [rw] endpoint
455
+ # A custom service endpoint, as a hostname or hostname:port. The default is
456
+ # nil, indicating to use the default endpoint in the current universe domain.
457
+ # @return [::String,nil]
458
+ # @!attribute [rw] credentials
459
+ # Credentials to send with calls. You may provide any of the following types:
460
+ # * (`String`) The path to a service account key file in JSON format
461
+ # * (`Hash`) A service account key as a Hash
462
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
463
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
464
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
465
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
466
+ # * (`nil`) indicating no credentials
467
+ #
468
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
469
+ # external source for authentication to Google Cloud, you must validate it before
470
+ # providing it to a Google API client library. Providing an unvalidated credential
471
+ # configuration to Google APIs can compromise the security of your systems and data.
472
+ # For more information, refer to [Validate credential configurations from external
473
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
474
+ # @return [::Object]
475
+ # @!attribute [rw] scope
476
+ # The OAuth scopes
477
+ # @return [::Array<::String>]
478
+ # @!attribute [rw] lib_name
479
+ # The library name as recorded in instrumentation and logging
480
+ # @return [::String]
481
+ # @!attribute [rw] lib_version
482
+ # The library version as recorded in instrumentation and logging
483
+ # @return [::String]
484
+ # @!attribute [rw] timeout
485
+ # The call timeout in seconds.
486
+ # @return [::Numeric]
487
+ # @!attribute [rw] metadata
488
+ # Additional headers to be sent with the call.
489
+ # @return [::Hash{::Symbol=>::String}]
490
+ # @!attribute [rw] retry_policy
491
+ # The retry policy. The value is a hash with the following keys:
492
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
493
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
494
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
495
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
496
+ # trigger a retry.
497
+ # @return [::Hash]
498
+ # @!attribute [rw] quota_project
499
+ # A separate project against which to charge quota.
500
+ # @return [::String]
501
+ # @!attribute [rw] universe_domain
502
+ # The universe domain within which to make requests. This determines the
503
+ # default endpoint URL. The default value of nil uses the environment
504
+ # universe (usually the default "googleapis.com" universe).
505
+ # @return [::String,nil]
506
+ # @!attribute [rw] logger
507
+ # A custom logger to use for request/response debug logging, or the value
508
+ # `:default` (the default) to construct a default logger, or `nil` to
509
+ # explicitly disable logging.
510
+ # @return [::Logger,:default,nil]
511
+ #
512
+ class Configuration
513
+ extend ::Gapic::Config
514
+
515
+ # @private
516
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
517
+ DEFAULT_ENDPOINT = "cloudsupport.googleapis.com"
518
+
519
+ config_attr :endpoint, nil, ::String, nil
520
+ config_attr :credentials, nil do |value|
521
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
522
+ allowed.any? { |klass| klass === value }
523
+ end
524
+ config_attr :scope, nil, ::String, ::Array, nil
525
+ config_attr :lib_name, nil, ::String, nil
526
+ config_attr :lib_version, nil, ::String, nil
527
+ config_attr :timeout, nil, ::Numeric, nil
528
+ config_attr :metadata, nil, ::Hash, nil
529
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
530
+ config_attr :quota_project, nil, ::String, nil
531
+ config_attr :universe_domain, nil, ::String, nil
532
+ config_attr :logger, :default, ::Logger, nil, :default
533
+
534
+ # @private
535
+ def initialize parent_config = nil
536
+ @parent_config = parent_config unless parent_config.nil?
537
+
538
+ yield self if block_given?
539
+ end
540
+
541
+ ##
542
+ # Configurations for individual RPCs
543
+ # @return [Rpcs]
544
+ #
545
+ def rpcs
546
+ @rpcs ||= begin
547
+ parent_rpcs = nil
548
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
549
+ Rpcs.new parent_rpcs
550
+ end
551
+ end
552
+
553
+ ##
554
+ # Configuration RPC class for the CommentService API.
555
+ #
556
+ # Includes fields providing the configuration for each RPC in this service.
557
+ # Each configuration object is of type `Gapic::Config::Method` and includes
558
+ # the following configuration fields:
559
+ #
560
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
561
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
562
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
563
+ # include the following keys:
564
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
565
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
566
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
567
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
568
+ # trigger a retry.
569
+ #
570
+ class Rpcs
571
+ ##
572
+ # RPC-specific configuration for `list_comments`
573
+ # @return [::Gapic::Config::Method]
574
+ #
575
+ attr_reader :list_comments
576
+ ##
577
+ # RPC-specific configuration for `create_comment`
578
+ # @return [::Gapic::Config::Method]
579
+ #
580
+ attr_reader :create_comment
581
+
582
+ # @private
583
+ def initialize parent_rpcs = nil
584
+ list_comments_config = parent_rpcs.list_comments if parent_rpcs.respond_to? :list_comments
585
+ @list_comments = ::Gapic::Config::Method.new list_comments_config
586
+ create_comment_config = parent_rpcs.create_comment if parent_rpcs.respond_to? :create_comment
587
+ @create_comment = ::Gapic::Config::Method.new create_comment_config
588
+
589
+ yield self if block_given?
590
+ end
591
+ end
592
+ end
593
+ end
594
+ end
595
+ end
596
+ end
597
+ end
598
+ end
599
+ end