google-cloud-support-v2 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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/support/v2/actor_pb.rb +44 -0
  6. data/lib/google/cloud/support/v2/attachment_pb.rb +49 -0
  7. data/lib/google/cloud/support/v2/attachment_service_pb.rb +50 -0
  8. data/lib/google/cloud/support/v2/attachment_service_services_pb.rb +45 -0
  9. data/lib/google/cloud/support/v2/case_attachment_service/client.rb +407 -0
  10. data/lib/google/cloud/support/v2/case_attachment_service/credentials.rb +47 -0
  11. data/lib/google/cloud/support/v2/case_attachment_service/paths.rb +72 -0
  12. data/lib/google/cloud/support/v2/case_attachment_service.rb +49 -0
  13. data/lib/google/cloud/support/v2/case_pb.rb +52 -0
  14. data/lib/google/cloud/support/v2/case_service/client.rb +1171 -0
  15. data/lib/google/cloud/support/v2/case_service/credentials.rb +47 -0
  16. data/lib/google/cloud/support/v2/case_service/paths.rb +100 -0
  17. data/lib/google/cloud/support/v2/case_service.rb +49 -0
  18. data/lib/google/cloud/support/v2/case_service_pb.rb +63 -0
  19. data/lib/google/cloud/support/v2/case_service_services_pb.rb +75 -0
  20. data/lib/google/cloud/support/v2/comment_pb.rb +49 -0
  21. data/lib/google/cloud/support/v2/comment_service/client.rb +502 -0
  22. data/lib/google/cloud/support/v2/comment_service/credentials.rb +47 -0
  23. data/lib/google/cloud/support/v2/comment_service/paths.rb +115 -0
  24. data/lib/google/cloud/support/v2/comment_service.rb +49 -0
  25. data/lib/google/cloud/support/v2/comment_service_pb.rb +51 -0
  26. data/lib/google/cloud/support/v2/comment_service_services_pb.rb +48 -0
  27. data/lib/google/cloud/support/v2/escalation_pb.rb +45 -0
  28. data/lib/google/cloud/support/v2/version.rb +7 -2
  29. data/lib/google/cloud/support/v2.rb +42 -0
  30. data/lib/google-cloud-support-v2.rb +21 -0
  31. data/proto_docs/README.md +4 -0
  32. data/proto_docs/google/api/client.rb +381 -0
  33. data/proto_docs/google/api/field_behavior.rb +71 -0
  34. data/proto_docs/google/api/launch_stage.rb +71 -0
  35. data/proto_docs/google/api/resource.rb +222 -0
  36. data/proto_docs/google/cloud/support/v2/actor.rb +49 -0
  37. data/proto_docs/google/cloud/support/v2/attachment.rb +51 -0
  38. data/proto_docs/google/cloud/support/v2/attachment_service.rb +59 -0
  39. data/proto_docs/google/cloud/support/v2/case.rb +152 -0
  40. data/proto_docs/google/cloud/support/v2/case_service.rb +240 -0
  41. data/proto_docs/google/cloud/support/v2/comment.rb +49 -0
  42. data/proto_docs/google/cloud/support/v2/comment_service.rb +69 -0
  43. data/proto_docs/google/cloud/support/v2/escalation.rb +55 -0
  44. data/proto_docs/google/protobuf/duration.rb +98 -0
  45. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  46. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  47. metadata +200 -12
@@ -0,0 +1,1171 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/case_service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Support
25
+ module V2
26
+ module CaseService
27
+ ##
28
+ # Client for the CaseService service.
29
+ #
30
+ # A service to manage Google Cloud support cases.
31
+ #
32
+ class Client
33
+ include Paths
34
+
35
+ # @private
36
+ attr_reader :case_service_stub
37
+
38
+ ##
39
+ # Configure the CaseService Client class.
40
+ #
41
+ # See {::Google::Cloud::Support::V2::CaseService::Client::Configuration}
42
+ # for a description of the configuration fields.
43
+ #
44
+ # @example
45
+ #
46
+ # # Modify the configuration for all CaseService clients
47
+ # ::Google::Cloud::Support::V2::CaseService::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
50
+ #
51
+ # @yield [config] Configure the Client client.
52
+ # @yieldparam config [Client::Configuration]
53
+ #
54
+ # @return [Client::Configuration]
55
+ #
56
+ def self.configure
57
+ @configure ||= begin
58
+ namespace = ["Google", "Cloud", "Support", "V2"]
59
+ parent_config = while namespace.any?
60
+ parent_name = namespace.join "::"
61
+ parent_const = const_get parent_name
62
+ break parent_const.configure if parent_const.respond_to? :configure
63
+ namespace.pop
64
+ end
65
+ default_config = Client::Configuration.new parent_config
66
+
67
+ default_config.rpcs.get_case.timeout = 60.0
68
+ default_config.rpcs.get_case.retry_policy = {
69
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
70
+ }
71
+
72
+ default_config.rpcs.list_cases.timeout = 60.0
73
+ default_config.rpcs.list_cases.retry_policy = {
74
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
75
+ }
76
+
77
+ default_config.rpcs.search_cases.timeout = 60.0
78
+ default_config.rpcs.search_cases.retry_policy = {
79
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
80
+ }
81
+
82
+ default_config.rpcs.create_case.timeout = 60.0
83
+
84
+ default_config.rpcs.update_case.timeout = 60.0
85
+
86
+ default_config.rpcs.escalate_case.timeout = 60.0
87
+
88
+ default_config.rpcs.close_case.timeout = 60.0
89
+
90
+ default_config.rpcs.search_case_classifications.timeout = 60.0
91
+ default_config.rpcs.search_case_classifications.retry_policy = {
92
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
93
+ }
94
+
95
+ default_config
96
+ end
97
+ yield @configure if block_given?
98
+ @configure
99
+ end
100
+
101
+ ##
102
+ # Configure the CaseService Client instance.
103
+ #
104
+ # The configuration is set to the derived mode, meaning that values can be changed,
105
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
106
+ # should be made on {Client.configure}.
107
+ #
108
+ # See {::Google::Cloud::Support::V2::CaseService::Client::Configuration}
109
+ # for a description of the configuration fields.
110
+ #
111
+ # @yield [config] Configure the Client client.
112
+ # @yieldparam config [Client::Configuration]
113
+ #
114
+ # @return [Client::Configuration]
115
+ #
116
+ def configure
117
+ yield @config if block_given?
118
+ @config
119
+ end
120
+
121
+ ##
122
+ # Create a new CaseService client object.
123
+ #
124
+ # @example
125
+ #
126
+ # # Create a client using the default configuration
127
+ # client = ::Google::Cloud::Support::V2::CaseService::Client.new
128
+ #
129
+ # # Create a client using a custom configuration
130
+ # client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config|
131
+ # config.timeout = 10.0
132
+ # end
133
+ #
134
+ # @yield [config] Configure the CaseService client.
135
+ # @yieldparam config [Client::Configuration]
136
+ #
137
+ def initialize
138
+ # These require statements are intentionally placed here to initialize
139
+ # the gRPC module only when it's required.
140
+ # See https://github.com/googleapis/toolkit/issues/446
141
+ require "gapic/grpc"
142
+ require "google/cloud/support/v2/case_service_services_pb"
143
+
144
+ # Create the configuration object
145
+ @config = Configuration.new Client.configure
146
+
147
+ # Yield the configuration if needed
148
+ yield @config if block_given?
149
+
150
+ # Create credentials
151
+ credentials = @config.credentials
152
+ # Use self-signed JWT if the endpoint is unchanged from default,
153
+ # but only if the default endpoint does not have a region prefix.
154
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
155
+ !@config.endpoint.split(".").first.include?("-")
156
+ credentials ||= Credentials.default scope: @config.scope,
157
+ enable_self_signed_jwt: enable_self_signed_jwt
158
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
159
+ credentials = Credentials.new credentials, scope: @config.scope
160
+ end
161
+ @quota_project_id = @config.quota_project
162
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
163
+
164
+ @case_service_stub = ::Gapic::ServiceStub.new(
165
+ ::Google::Cloud::Support::V2::CaseService::Stub,
166
+ credentials: credentials,
167
+ endpoint: @config.endpoint,
168
+ channel_args: @config.channel_args,
169
+ interceptors: @config.interceptors
170
+ )
171
+ end
172
+
173
+ # Service calls
174
+
175
+ ##
176
+ # Retrieve the specified case.
177
+ #
178
+ # @overload get_case(request, options = nil)
179
+ # Pass arguments to `get_case` via a request object, either of type
180
+ # {::Google::Cloud::Support::V2::GetCaseRequest} or an equivalent Hash.
181
+ #
182
+ # @param request [::Google::Cloud::Support::V2::GetCaseRequest, ::Hash]
183
+ # A request object representing the call parameters. Required. To specify no
184
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
185
+ # @param options [::Gapic::CallOptions, ::Hash]
186
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
187
+ #
188
+ # @overload get_case(name: nil)
189
+ # Pass arguments to `get_case` via keyword arguments. Note that at
190
+ # least one keyword argument is required. To specify no parameters, or to keep all
191
+ # the default parameter values, pass an empty Hash as a request object (see above).
192
+ #
193
+ # @param name [::String]
194
+ # Required. The fully qualified name of a case to be retrieved.
195
+ #
196
+ # @yield [response, operation] Access the result along with the RPC operation
197
+ # @yieldparam response [::Google::Cloud::Support::V2::Case]
198
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
199
+ #
200
+ # @return [::Google::Cloud::Support::V2::Case]
201
+ #
202
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
203
+ #
204
+ # @example Basic example
205
+ # require "google/cloud/support/v2"
206
+ #
207
+ # # Create a client object. The client can be reused for multiple calls.
208
+ # client = Google::Cloud::Support::V2::CaseService::Client.new
209
+ #
210
+ # # Create a request. To set request fields, pass in keyword arguments.
211
+ # request = Google::Cloud::Support::V2::GetCaseRequest.new
212
+ #
213
+ # # Call the get_case method.
214
+ # result = client.get_case request
215
+ #
216
+ # # The returned object is of type Google::Cloud::Support::V2::Case.
217
+ # p result
218
+ #
219
+ def get_case request, options = nil
220
+ raise ::ArgumentError, "request must be provided" if request.nil?
221
+
222
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::GetCaseRequest
223
+
224
+ # Converts hash and nil to an options object
225
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
226
+
227
+ # Customize the options with defaults
228
+ metadata = @config.rpcs.get_case.metadata.to_h
229
+
230
+ # Set x-goog-api-client and x-goog-user-project headers
231
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
232
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
233
+ gapic_version: ::Google::Cloud::Support::V2::VERSION
234
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
235
+
236
+ header_params = {}
237
+ if request.name
238
+ header_params["name"] = request.name
239
+ end
240
+
241
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
242
+ metadata[:"x-goog-request-params"] ||= request_params_header
243
+
244
+ options.apply_defaults timeout: @config.rpcs.get_case.timeout,
245
+ metadata: metadata,
246
+ retry_policy: @config.rpcs.get_case.retry_policy
247
+
248
+ options.apply_defaults timeout: @config.timeout,
249
+ metadata: @config.metadata,
250
+ retry_policy: @config.retry_policy
251
+
252
+ @case_service_stub.call_rpc :get_case, request, options: options do |response, operation|
253
+ yield response, operation if block_given?
254
+ return response
255
+ end
256
+ rescue ::GRPC::BadStatus => e
257
+ raise ::Google::Cloud::Error.from_error(e)
258
+ end
259
+
260
+ ##
261
+ # Retrieve all cases under the specified parent.
262
+ #
263
+ # Note: Listing cases under an Organization returns only the cases directly
264
+ # parented by that organization. To retrieve all cases under an organization,
265
+ # including cases parented by projects under that organization, use
266
+ # `cases.search`.
267
+ #
268
+ # @overload list_cases(request, options = nil)
269
+ # Pass arguments to `list_cases` via a request object, either of type
270
+ # {::Google::Cloud::Support::V2::ListCasesRequest} or an equivalent Hash.
271
+ #
272
+ # @param request [::Google::Cloud::Support::V2::ListCasesRequest, ::Hash]
273
+ # A request object representing the call parameters. Required. To specify no
274
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
275
+ # @param options [::Gapic::CallOptions, ::Hash]
276
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
277
+ #
278
+ # @overload list_cases(parent: nil, filter: nil, page_size: nil, page_token: nil)
279
+ # Pass arguments to `list_cases` via keyword arguments. Note that at
280
+ # least one keyword argument is required. To specify no parameters, or to keep all
281
+ # the default parameter values, pass an empty Hash as a request object (see above).
282
+ #
283
+ # @param parent [::String]
284
+ # Required. The fully qualified name of parent resource to list cases under.
285
+ # @param filter [::String]
286
+ # An expression written in filter language. If non-empty, the query returns
287
+ # the cases that match the filter. Else, the query doesn't filter the cases.
288
+ #
289
+ # Filter expressions use the following fields with the operators equals (`=`)
290
+ # and `AND`:
291
+ #
292
+ # - `state`: The accepted values are `OPEN` or `CLOSED`.
293
+ # - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You
294
+ # can specify multiple values for priority using the `OR` operator. For
295
+ # example, `priority=P1 OR priority=P2`.
296
+ # - `creator.email`: The email address of the case creator.
297
+ #
298
+ # Examples:
299
+ #
300
+ # - `state=CLOSED`
301
+ # - `state=OPEN AND creator.email="tester@example.com"`
302
+ # - `state=OPEN AND (priority=P0 OR priority=P1)`
303
+ # @param page_size [::Integer]
304
+ # The maximum number of cases fetched with each request. Defaults to 10.
305
+ # @param page_token [::String]
306
+ # A token identifying the page of results to return. If unspecified, the
307
+ # first page is retrieved.
308
+ #
309
+ # @yield [response, operation] Access the result along with the RPC operation
310
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>]
311
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
312
+ #
313
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>]
314
+ #
315
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
316
+ #
317
+ # @example Basic example
318
+ # require "google/cloud/support/v2"
319
+ #
320
+ # # Create a client object. The client can be reused for multiple calls.
321
+ # client = Google::Cloud::Support::V2::CaseService::Client.new
322
+ #
323
+ # # Create a request. To set request fields, pass in keyword arguments.
324
+ # request = Google::Cloud::Support::V2::ListCasesRequest.new
325
+ #
326
+ # # Call the list_cases method.
327
+ # result = client.list_cases request
328
+ #
329
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
330
+ # # over elements, and API calls will be issued to fetch pages as needed.
331
+ # result.each do |item|
332
+ # # Each element is of type ::Google::Cloud::Support::V2::Case.
333
+ # p item
334
+ # end
335
+ #
336
+ def list_cases request, options = nil
337
+ raise ::ArgumentError, "request must be provided" if request.nil?
338
+
339
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::ListCasesRequest
340
+
341
+ # Converts hash and nil to an options object
342
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
343
+
344
+ # Customize the options with defaults
345
+ metadata = @config.rpcs.list_cases.metadata.to_h
346
+
347
+ # Set x-goog-api-client and x-goog-user-project headers
348
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
349
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
350
+ gapic_version: ::Google::Cloud::Support::V2::VERSION
351
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
352
+
353
+ header_params = {}
354
+ if request.parent
355
+ header_params["parent"] = request.parent
356
+ end
357
+
358
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
359
+ metadata[:"x-goog-request-params"] ||= request_params_header
360
+
361
+ options.apply_defaults timeout: @config.rpcs.list_cases.timeout,
362
+ metadata: metadata,
363
+ retry_policy: @config.rpcs.list_cases.retry_policy
364
+
365
+ options.apply_defaults timeout: @config.timeout,
366
+ metadata: @config.metadata,
367
+ retry_policy: @config.retry_policy
368
+
369
+ @case_service_stub.call_rpc :list_cases, request, options: options do |response, operation|
370
+ response = ::Gapic::PagedEnumerable.new @case_service_stub, :list_cases, request, response, operation, options
371
+ yield response, operation if block_given?
372
+ return response
373
+ end
374
+ rescue ::GRPC::BadStatus => e
375
+ raise ::Google::Cloud::Error.from_error(e)
376
+ end
377
+
378
+ ##
379
+ # Search cases using the specified query.
380
+ #
381
+ # @overload search_cases(request, options = nil)
382
+ # Pass arguments to `search_cases` via a request object, either of type
383
+ # {::Google::Cloud::Support::V2::SearchCasesRequest} or an equivalent Hash.
384
+ #
385
+ # @param request [::Google::Cloud::Support::V2::SearchCasesRequest, ::Hash]
386
+ # A request object representing the call parameters. Required. To specify no
387
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
388
+ # @param options [::Gapic::CallOptions, ::Hash]
389
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
390
+ #
391
+ # @overload search_cases(parent: nil, query: nil, page_size: nil, page_token: nil)
392
+ # Pass arguments to `search_cases` via keyword arguments. Note that at
393
+ # least one keyword argument is required. To specify no parameters, or to keep all
394
+ # the default parameter values, pass an empty Hash as a request object (see above).
395
+ #
396
+ # @param parent [::String]
397
+ # The fully qualified name of parent resource to search cases under.
398
+ # @param query [::String]
399
+ # An expression written in filter language.
400
+ #
401
+ # A query uses the following fields with the operators equals (`=`) and
402
+ # `AND`:
403
+ #
404
+ # - `organization`: An organization name in the form
405
+ # `organizations/<organization_id>`.
406
+ # - `project`: A project name in the form `projects/<project_id>`.
407
+ # - `state`: The accepted values are `OPEN` or `CLOSED`.
408
+ # - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You
409
+ # can specify multiple values for priority using the `OR` operator. For
410
+ # example, `priority=P1 OR priority=P2`.
411
+ # - `creator.email`: The email address of the case creator.
412
+ # - `billingAccount`: A billing account in the form
413
+ # `billingAccounts/<billing_account_id>`
414
+ #
415
+ # You must specify either `organization` or `project`.
416
+ #
417
+ # To search across `displayName`, `description`, and comments, use a global
418
+ # restriction with no keyword or operator. For example, `"my search"`.
419
+ #
420
+ # To search only cases updated after a certain date, use `update_time`
421
+ # restricted with that particular date, time, and timezone in ISO datetime
422
+ # format. For example, `update_time>"2020-01-01T00:00:00-05:00"`.
423
+ # `update_time` only supports the greater than operator (`>`).
424
+ #
425
+ # Examples:
426
+ #
427
+ # - `organization="organizations/123456789"`
428
+ # - `project="projects/my-project-id"`
429
+ # - `project="projects/123456789"`
430
+ # - `billing_account="billingAccounts/123456-A0B0C0-CUZ789"`
431
+ # - `organization="organizations/123456789" AND state=CLOSED`
432
+ # - `project="projects/my-project-id" AND creator.email="tester@example.com"`
433
+ # - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)`
434
+ # @param page_size [::Integer]
435
+ # The maximum number of cases fetched with each request. The default page
436
+ # size is 10.
437
+ # @param page_token [::String]
438
+ # A token identifying the page of results to return. If unspecified, the
439
+ # first page is retrieved.
440
+ #
441
+ # @yield [response, operation] Access the result along with the RPC operation
442
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>]
443
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
444
+ #
445
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>]
446
+ #
447
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
448
+ #
449
+ # @example Basic example
450
+ # require "google/cloud/support/v2"
451
+ #
452
+ # # Create a client object. The client can be reused for multiple calls.
453
+ # client = Google::Cloud::Support::V2::CaseService::Client.new
454
+ #
455
+ # # Create a request. To set request fields, pass in keyword arguments.
456
+ # request = Google::Cloud::Support::V2::SearchCasesRequest.new
457
+ #
458
+ # # Call the search_cases method.
459
+ # result = client.search_cases request
460
+ #
461
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
462
+ # # over elements, and API calls will be issued to fetch pages as needed.
463
+ # result.each do |item|
464
+ # # Each element is of type ::Google::Cloud::Support::V2::Case.
465
+ # p item
466
+ # end
467
+ #
468
+ def search_cases request, options = nil
469
+ raise ::ArgumentError, "request must be provided" if request.nil?
470
+
471
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::SearchCasesRequest
472
+
473
+ # Converts hash and nil to an options object
474
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
475
+
476
+ # Customize the options with defaults
477
+ metadata = @config.rpcs.search_cases.metadata.to_h
478
+
479
+ # Set x-goog-api-client and x-goog-user-project headers
480
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
481
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
482
+ gapic_version: ::Google::Cloud::Support::V2::VERSION
483
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
484
+
485
+ header_params = {}
486
+ if request.parent
487
+ header_params["parent"] = request.parent
488
+ end
489
+
490
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
491
+ metadata[:"x-goog-request-params"] ||= request_params_header
492
+
493
+ options.apply_defaults timeout: @config.rpcs.search_cases.timeout,
494
+ metadata: metadata,
495
+ retry_policy: @config.rpcs.search_cases.retry_policy
496
+
497
+ options.apply_defaults timeout: @config.timeout,
498
+ metadata: @config.metadata,
499
+ retry_policy: @config.retry_policy
500
+
501
+ @case_service_stub.call_rpc :search_cases, request, options: options do |response, operation|
502
+ response = ::Gapic::PagedEnumerable.new @case_service_stub, :search_cases, request, response, operation, options
503
+ yield response, operation if block_given?
504
+ return response
505
+ end
506
+ rescue ::GRPC::BadStatus => e
507
+ raise ::Google::Cloud::Error.from_error(e)
508
+ end
509
+
510
+ ##
511
+ # Create a new case and associate it with the given Google Cloud Resource.
512
+ # The case object must have the following fields set: `display_name`,
513
+ # `description`, `classification`, and `priority`.
514
+ #
515
+ # @overload create_case(request, options = nil)
516
+ # Pass arguments to `create_case` via a request object, either of type
517
+ # {::Google::Cloud::Support::V2::CreateCaseRequest} or an equivalent Hash.
518
+ #
519
+ # @param request [::Google::Cloud::Support::V2::CreateCaseRequest, ::Hash]
520
+ # A request object representing the call parameters. Required. To specify no
521
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
522
+ # @param options [::Gapic::CallOptions, ::Hash]
523
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
524
+ #
525
+ # @overload create_case(parent: nil, case: nil)
526
+ # Pass arguments to `create_case` via keyword arguments. Note that at
527
+ # least one keyword argument is required. To specify no parameters, or to keep all
528
+ # the default parameter values, pass an empty Hash as a request object (see above).
529
+ #
530
+ # @param parent [::String]
531
+ # Required. The name of the Google Cloud Resource under which the case should
532
+ # be created.
533
+ # @param case [::Google::Cloud::Support::V2::Case, ::Hash]
534
+ # Required. The case to be created.
535
+ #
536
+ # @yield [response, operation] Access the result along with the RPC operation
537
+ # @yieldparam response [::Google::Cloud::Support::V2::Case]
538
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
539
+ #
540
+ # @return [::Google::Cloud::Support::V2::Case]
541
+ #
542
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
543
+ #
544
+ # @example Basic example
545
+ # require "google/cloud/support/v2"
546
+ #
547
+ # # Create a client object. The client can be reused for multiple calls.
548
+ # client = Google::Cloud::Support::V2::CaseService::Client.new
549
+ #
550
+ # # Create a request. To set request fields, pass in keyword arguments.
551
+ # request = Google::Cloud::Support::V2::CreateCaseRequest.new
552
+ #
553
+ # # Call the create_case method.
554
+ # result = client.create_case request
555
+ #
556
+ # # The returned object is of type Google::Cloud::Support::V2::Case.
557
+ # p result
558
+ #
559
+ def create_case request, options = nil
560
+ raise ::ArgumentError, "request must be provided" if request.nil?
561
+
562
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::CreateCaseRequest
563
+
564
+ # Converts hash and nil to an options object
565
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
566
+
567
+ # Customize the options with defaults
568
+ metadata = @config.rpcs.create_case.metadata.to_h
569
+
570
+ # Set x-goog-api-client and x-goog-user-project headers
571
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
572
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
573
+ gapic_version: ::Google::Cloud::Support::V2::VERSION
574
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
575
+
576
+ header_params = {}
577
+ if request.parent
578
+ header_params["parent"] = request.parent
579
+ end
580
+
581
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
582
+ metadata[:"x-goog-request-params"] ||= request_params_header
583
+
584
+ options.apply_defaults timeout: @config.rpcs.create_case.timeout,
585
+ metadata: metadata,
586
+ retry_policy: @config.rpcs.create_case.retry_policy
587
+
588
+ options.apply_defaults timeout: @config.timeout,
589
+ metadata: @config.metadata,
590
+ retry_policy: @config.retry_policy
591
+
592
+ @case_service_stub.call_rpc :create_case, request, options: options do |response, operation|
593
+ yield response, operation if block_given?
594
+ return response
595
+ end
596
+ rescue ::GRPC::BadStatus => e
597
+ raise ::Google::Cloud::Error.from_error(e)
598
+ end
599
+
600
+ ##
601
+ # Update the specified case. Only a subset of fields can be updated.
602
+ #
603
+ # @overload update_case(request, options = nil)
604
+ # Pass arguments to `update_case` via a request object, either of type
605
+ # {::Google::Cloud::Support::V2::UpdateCaseRequest} or an equivalent Hash.
606
+ #
607
+ # @param request [::Google::Cloud::Support::V2::UpdateCaseRequest, ::Hash]
608
+ # A request object representing the call parameters. Required. To specify no
609
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
610
+ # @param options [::Gapic::CallOptions, ::Hash]
611
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
612
+ #
613
+ # @overload update_case(case: nil, update_mask: nil)
614
+ # Pass arguments to `update_case` via keyword arguments. Note that at
615
+ # least one keyword argument is required. To specify no parameters, or to keep all
616
+ # the default parameter values, pass an empty Hash as a request object (see above).
617
+ #
618
+ # @param case [::Google::Cloud::Support::V2::Case, ::Hash]
619
+ # Required. The case object to update.
620
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
621
+ # A list of attributes of the case object that should be updated
622
+ # as part of this request. Supported values are `priority`, `display_name`,
623
+ # and `subscriber_email_addresses`. If no fields are specified, all supported
624
+ # fields are updated.
625
+ #
626
+ # WARNING: If you do not provide a field mask, then you might accidentally
627
+ # clear some fields. For example, if you leave the field mask empty and do
628
+ # not provide a value for `subscriber_email_addresses`, then
629
+ # `subscriber_email_addresses` is updated to empty.
630
+ #
631
+ # @yield [response, operation] Access the result along with the RPC operation
632
+ # @yieldparam response [::Google::Cloud::Support::V2::Case]
633
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
634
+ #
635
+ # @return [::Google::Cloud::Support::V2::Case]
636
+ #
637
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
638
+ #
639
+ # @example Basic example
640
+ # require "google/cloud/support/v2"
641
+ #
642
+ # # Create a client object. The client can be reused for multiple calls.
643
+ # client = Google::Cloud::Support::V2::CaseService::Client.new
644
+ #
645
+ # # Create a request. To set request fields, pass in keyword arguments.
646
+ # request = Google::Cloud::Support::V2::UpdateCaseRequest.new
647
+ #
648
+ # # Call the update_case method.
649
+ # result = client.update_case request
650
+ #
651
+ # # The returned object is of type Google::Cloud::Support::V2::Case.
652
+ # p result
653
+ #
654
+ def update_case request, options = nil
655
+ raise ::ArgumentError, "request must be provided" if request.nil?
656
+
657
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::UpdateCaseRequest
658
+
659
+ # Converts hash and nil to an options object
660
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
661
+
662
+ # Customize the options with defaults
663
+ metadata = @config.rpcs.update_case.metadata.to_h
664
+
665
+ # Set x-goog-api-client and x-goog-user-project headers
666
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
667
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
668
+ gapic_version: ::Google::Cloud::Support::V2::VERSION
669
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
670
+
671
+ header_params = {}
672
+ if request.case&.name
673
+ header_params["case.name"] = request.case.name
674
+ end
675
+
676
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
677
+ metadata[:"x-goog-request-params"] ||= request_params_header
678
+
679
+ options.apply_defaults timeout: @config.rpcs.update_case.timeout,
680
+ metadata: metadata,
681
+ retry_policy: @config.rpcs.update_case.retry_policy
682
+
683
+ options.apply_defaults timeout: @config.timeout,
684
+ metadata: @config.metadata,
685
+ retry_policy: @config.retry_policy
686
+
687
+ @case_service_stub.call_rpc :update_case, request, options: options do |response, operation|
688
+ yield response, operation if block_given?
689
+ return response
690
+ end
691
+ rescue ::GRPC::BadStatus => e
692
+ raise ::Google::Cloud::Error.from_error(e)
693
+ end
694
+
695
+ ##
696
+ # Escalate a case. Escalating a case will initiate the Google Cloud Support
697
+ # escalation management process.
698
+ #
699
+ # This operation is only available to certain Customer Care tiers. Go to
700
+ # https://cloud.google.com/support and look for 'Technical support
701
+ # escalations' in the feature list to find out which tiers are able to
702
+ # perform escalations.
703
+ #
704
+ # @overload escalate_case(request, options = nil)
705
+ # Pass arguments to `escalate_case` via a request object, either of type
706
+ # {::Google::Cloud::Support::V2::EscalateCaseRequest} or an equivalent Hash.
707
+ #
708
+ # @param request [::Google::Cloud::Support::V2::EscalateCaseRequest, ::Hash]
709
+ # A request object representing the call parameters. Required. To specify no
710
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
711
+ # @param options [::Gapic::CallOptions, ::Hash]
712
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
713
+ #
714
+ # @overload escalate_case(name: nil, escalation: nil)
715
+ # Pass arguments to `escalate_case` via keyword arguments. Note that at
716
+ # least one keyword argument is required. To specify no parameters, or to keep all
717
+ # the default parameter values, pass an empty Hash as a request object (see above).
718
+ #
719
+ # @param name [::String]
720
+ # Required. The fully qualified name of the Case resource to be escalated.
721
+ # @param escalation [::Google::Cloud::Support::V2::Escalation, ::Hash]
722
+ # The escalation object to be sent with the escalation request.
723
+ #
724
+ # @yield [response, operation] Access the result along with the RPC operation
725
+ # @yieldparam response [::Google::Cloud::Support::V2::Case]
726
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
727
+ #
728
+ # @return [::Google::Cloud::Support::V2::Case]
729
+ #
730
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
731
+ #
732
+ # @example Basic example
733
+ # require "google/cloud/support/v2"
734
+ #
735
+ # # Create a client object. The client can be reused for multiple calls.
736
+ # client = Google::Cloud::Support::V2::CaseService::Client.new
737
+ #
738
+ # # Create a request. To set request fields, pass in keyword arguments.
739
+ # request = Google::Cloud::Support::V2::EscalateCaseRequest.new
740
+ #
741
+ # # Call the escalate_case method.
742
+ # result = client.escalate_case request
743
+ #
744
+ # # The returned object is of type Google::Cloud::Support::V2::Case.
745
+ # p result
746
+ #
747
+ def escalate_case request, options = nil
748
+ raise ::ArgumentError, "request must be provided" if request.nil?
749
+
750
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::EscalateCaseRequest
751
+
752
+ # Converts hash and nil to an options object
753
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
754
+
755
+ # Customize the options with defaults
756
+ metadata = @config.rpcs.escalate_case.metadata.to_h
757
+
758
+ # Set x-goog-api-client and x-goog-user-project headers
759
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
760
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
761
+ gapic_version: ::Google::Cloud::Support::V2::VERSION
762
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
763
+
764
+ header_params = {}
765
+ if request.name
766
+ header_params["name"] = request.name
767
+ end
768
+
769
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
770
+ metadata[:"x-goog-request-params"] ||= request_params_header
771
+
772
+ options.apply_defaults timeout: @config.rpcs.escalate_case.timeout,
773
+ metadata: metadata,
774
+ retry_policy: @config.rpcs.escalate_case.retry_policy
775
+
776
+ options.apply_defaults timeout: @config.timeout,
777
+ metadata: @config.metadata,
778
+ retry_policy: @config.retry_policy
779
+
780
+ @case_service_stub.call_rpc :escalate_case, request, options: options do |response, operation|
781
+ yield response, operation if block_given?
782
+ return response
783
+ end
784
+ rescue ::GRPC::BadStatus => e
785
+ raise ::Google::Cloud::Error.from_error(e)
786
+ end
787
+
788
+ ##
789
+ # Close the specified case.
790
+ #
791
+ # @overload close_case(request, options = nil)
792
+ # Pass arguments to `close_case` via a request object, either of type
793
+ # {::Google::Cloud::Support::V2::CloseCaseRequest} or an equivalent Hash.
794
+ #
795
+ # @param request [::Google::Cloud::Support::V2::CloseCaseRequest, ::Hash]
796
+ # A request object representing the call parameters. Required. To specify no
797
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
798
+ # @param options [::Gapic::CallOptions, ::Hash]
799
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
800
+ #
801
+ # @overload close_case(name: nil)
802
+ # Pass arguments to `close_case` via keyword arguments. Note that at
803
+ # least one keyword argument is required. To specify no parameters, or to keep all
804
+ # the default parameter values, pass an empty Hash as a request object (see above).
805
+ #
806
+ # @param name [::String]
807
+ # Required. The fully qualified name of the case resource to be closed.
808
+ #
809
+ # @yield [response, operation] Access the result along with the RPC operation
810
+ # @yieldparam response [::Google::Cloud::Support::V2::Case]
811
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
812
+ #
813
+ # @return [::Google::Cloud::Support::V2::Case]
814
+ #
815
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
816
+ #
817
+ # @example Basic example
818
+ # require "google/cloud/support/v2"
819
+ #
820
+ # # Create a client object. The client can be reused for multiple calls.
821
+ # client = Google::Cloud::Support::V2::CaseService::Client.new
822
+ #
823
+ # # Create a request. To set request fields, pass in keyword arguments.
824
+ # request = Google::Cloud::Support::V2::CloseCaseRequest.new
825
+ #
826
+ # # Call the close_case method.
827
+ # result = client.close_case request
828
+ #
829
+ # # The returned object is of type Google::Cloud::Support::V2::Case.
830
+ # p result
831
+ #
832
+ def close_case request, options = nil
833
+ raise ::ArgumentError, "request must be provided" if request.nil?
834
+
835
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::CloseCaseRequest
836
+
837
+ # Converts hash and nil to an options object
838
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
839
+
840
+ # Customize the options with defaults
841
+ metadata = @config.rpcs.close_case.metadata.to_h
842
+
843
+ # Set x-goog-api-client and x-goog-user-project headers
844
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
845
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
846
+ gapic_version: ::Google::Cloud::Support::V2::VERSION
847
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
848
+
849
+ header_params = {}
850
+ if request.name
851
+ header_params["name"] = request.name
852
+ end
853
+
854
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
855
+ metadata[:"x-goog-request-params"] ||= request_params_header
856
+
857
+ options.apply_defaults timeout: @config.rpcs.close_case.timeout,
858
+ metadata: metadata,
859
+ retry_policy: @config.rpcs.close_case.retry_policy
860
+
861
+ options.apply_defaults timeout: @config.timeout,
862
+ metadata: @config.metadata,
863
+ retry_policy: @config.retry_policy
864
+
865
+ @case_service_stub.call_rpc :close_case, request, options: options do |response, operation|
866
+ yield response, operation if block_given?
867
+ return response
868
+ end
869
+ rescue ::GRPC::BadStatus => e
870
+ raise ::Google::Cloud::Error.from_error(e)
871
+ end
872
+
873
+ ##
874
+ # Retrieve valid classifications to be used when creating a support case.
875
+ # The classications are hierarchical, with each classification containing
876
+ # all levels of the hierarchy, separated by " > ". For example "Technical
877
+ # Issue > Compute > Compute Engine".
878
+ #
879
+ # @overload search_case_classifications(request, options = nil)
880
+ # Pass arguments to `search_case_classifications` via a request object, either of type
881
+ # {::Google::Cloud::Support::V2::SearchCaseClassificationsRequest} or an equivalent Hash.
882
+ #
883
+ # @param request [::Google::Cloud::Support::V2::SearchCaseClassificationsRequest, ::Hash]
884
+ # A request object representing the call parameters. Required. To specify no
885
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
886
+ # @param options [::Gapic::CallOptions, ::Hash]
887
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
888
+ #
889
+ # @overload search_case_classifications(query: nil, page_size: nil, page_token: nil)
890
+ # Pass arguments to `search_case_classifications` via keyword arguments. Note that at
891
+ # least one keyword argument is required. To specify no parameters, or to keep all
892
+ # the default parameter values, pass an empty Hash as a request object (see above).
893
+ #
894
+ # @param query [::String]
895
+ # An expression written in the Google Cloud filter language. If non-empty,
896
+ # then only cases whose fields match the filter are returned. If empty, then
897
+ # no messages are filtered out.
898
+ # @param page_size [::Integer]
899
+ # The maximum number of cases fetched with each request.
900
+ # @param page_token [::String]
901
+ # A token identifying the page of results to return. If unspecified, the
902
+ # first page is retrieved.
903
+ #
904
+ # @yield [response, operation] Access the result along with the RPC operation
905
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::CaseClassification>]
906
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
907
+ #
908
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::CaseClassification>]
909
+ #
910
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
911
+ #
912
+ # @example Basic example
913
+ # require "google/cloud/support/v2"
914
+ #
915
+ # # Create a client object. The client can be reused for multiple calls.
916
+ # client = Google::Cloud::Support::V2::CaseService::Client.new
917
+ #
918
+ # # Create a request. To set request fields, pass in keyword arguments.
919
+ # request = Google::Cloud::Support::V2::SearchCaseClassificationsRequest.new
920
+ #
921
+ # # Call the search_case_classifications method.
922
+ # result = client.search_case_classifications request
923
+ #
924
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
925
+ # # over elements, and API calls will be issued to fetch pages as needed.
926
+ # result.each do |item|
927
+ # # Each element is of type ::Google::Cloud::Support::V2::CaseClassification.
928
+ # p item
929
+ # end
930
+ #
931
+ def search_case_classifications request, options = nil
932
+ raise ::ArgumentError, "request must be provided" if request.nil?
933
+
934
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::SearchCaseClassificationsRequest
935
+
936
+ # Converts hash and nil to an options object
937
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
938
+
939
+ # Customize the options with defaults
940
+ metadata = @config.rpcs.search_case_classifications.metadata.to_h
941
+
942
+ # Set x-goog-api-client and x-goog-user-project headers
943
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
944
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
945
+ gapic_version: ::Google::Cloud::Support::V2::VERSION
946
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
947
+
948
+ options.apply_defaults timeout: @config.rpcs.search_case_classifications.timeout,
949
+ metadata: metadata,
950
+ retry_policy: @config.rpcs.search_case_classifications.retry_policy
951
+
952
+ options.apply_defaults timeout: @config.timeout,
953
+ metadata: @config.metadata,
954
+ retry_policy: @config.retry_policy
955
+
956
+ @case_service_stub.call_rpc :search_case_classifications, request, options: options do |response, operation|
957
+ response = ::Gapic::PagedEnumerable.new @case_service_stub, :search_case_classifications, request, response, operation, options
958
+ yield response, operation if block_given?
959
+ return response
960
+ end
961
+ rescue ::GRPC::BadStatus => e
962
+ raise ::Google::Cloud::Error.from_error(e)
963
+ end
964
+
965
+ ##
966
+ # Configuration class for the CaseService API.
967
+ #
968
+ # This class represents the configuration for CaseService,
969
+ # providing control over timeouts, retry behavior, logging, transport
970
+ # parameters, and other low-level controls. Certain parameters can also be
971
+ # applied individually to specific RPCs. See
972
+ # {::Google::Cloud::Support::V2::CaseService::Client::Configuration::Rpcs}
973
+ # for a list of RPCs that can be configured independently.
974
+ #
975
+ # Configuration can be applied globally to all clients, or to a single client
976
+ # on construction.
977
+ #
978
+ # @example
979
+ #
980
+ # # Modify the global config, setting the timeout for
981
+ # # get_case to 20 seconds,
982
+ # # and all remaining timeouts to 10 seconds.
983
+ # ::Google::Cloud::Support::V2::CaseService::Client.configure do |config|
984
+ # config.timeout = 10.0
985
+ # config.rpcs.get_case.timeout = 20.0
986
+ # end
987
+ #
988
+ # # Apply the above configuration only to a new client.
989
+ # client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config|
990
+ # config.timeout = 10.0
991
+ # config.rpcs.get_case.timeout = 20.0
992
+ # end
993
+ #
994
+ # @!attribute [rw] endpoint
995
+ # The hostname or hostname:port of the service endpoint.
996
+ # Defaults to `"cloudsupport.googleapis.com"`.
997
+ # @return [::String]
998
+ # @!attribute [rw] credentials
999
+ # Credentials to send with calls. You may provide any of the following types:
1000
+ # * (`String`) The path to a service account key file in JSON format
1001
+ # * (`Hash`) A service account key as a Hash
1002
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1003
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1004
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1005
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1006
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1007
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1008
+ # * (`nil`) indicating no credentials
1009
+ # @return [::Object]
1010
+ # @!attribute [rw] scope
1011
+ # The OAuth scopes
1012
+ # @return [::Array<::String>]
1013
+ # @!attribute [rw] lib_name
1014
+ # The library name as recorded in instrumentation and logging
1015
+ # @return [::String]
1016
+ # @!attribute [rw] lib_version
1017
+ # The library version as recorded in instrumentation and logging
1018
+ # @return [::String]
1019
+ # @!attribute [rw] channel_args
1020
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1021
+ # `GRPC::Core::Channel` object is provided as the credential.
1022
+ # @return [::Hash]
1023
+ # @!attribute [rw] interceptors
1024
+ # An array of interceptors that are run before calls are executed.
1025
+ # @return [::Array<::GRPC::ClientInterceptor>]
1026
+ # @!attribute [rw] timeout
1027
+ # The call timeout in seconds.
1028
+ # @return [::Numeric]
1029
+ # @!attribute [rw] metadata
1030
+ # Additional gRPC headers to be sent with the call.
1031
+ # @return [::Hash{::Symbol=>::String}]
1032
+ # @!attribute [rw] retry_policy
1033
+ # The retry policy. The value is a hash with the following keys:
1034
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1035
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1036
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1037
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1038
+ # trigger a retry.
1039
+ # @return [::Hash]
1040
+ # @!attribute [rw] quota_project
1041
+ # A separate project against which to charge quota.
1042
+ # @return [::String]
1043
+ #
1044
+ class Configuration
1045
+ extend ::Gapic::Config
1046
+
1047
+ DEFAULT_ENDPOINT = "cloudsupport.googleapis.com"
1048
+
1049
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1050
+ config_attr :credentials, nil do |value|
1051
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1052
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1053
+ allowed.any? { |klass| klass === value }
1054
+ end
1055
+ config_attr :scope, nil, ::String, ::Array, nil
1056
+ config_attr :lib_name, nil, ::String, nil
1057
+ config_attr :lib_version, nil, ::String, nil
1058
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1059
+ config_attr :interceptors, nil, ::Array, nil
1060
+ config_attr :timeout, nil, ::Numeric, nil
1061
+ config_attr :metadata, nil, ::Hash, nil
1062
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1063
+ config_attr :quota_project, nil, ::String, nil
1064
+
1065
+ # @private
1066
+ def initialize parent_config = nil
1067
+ @parent_config = parent_config unless parent_config.nil?
1068
+
1069
+ yield self if block_given?
1070
+ end
1071
+
1072
+ ##
1073
+ # Configurations for individual RPCs
1074
+ # @return [Rpcs]
1075
+ #
1076
+ def rpcs
1077
+ @rpcs ||= begin
1078
+ parent_rpcs = nil
1079
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1080
+ Rpcs.new parent_rpcs
1081
+ end
1082
+ end
1083
+
1084
+ ##
1085
+ # Configuration RPC class for the CaseService API.
1086
+ #
1087
+ # Includes fields providing the configuration for each RPC in this service.
1088
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1089
+ # the following configuration fields:
1090
+ #
1091
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1092
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1093
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1094
+ # include the following keys:
1095
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1096
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1097
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1098
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1099
+ # trigger a retry.
1100
+ #
1101
+ class Rpcs
1102
+ ##
1103
+ # RPC-specific configuration for `get_case`
1104
+ # @return [::Gapic::Config::Method]
1105
+ #
1106
+ attr_reader :get_case
1107
+ ##
1108
+ # RPC-specific configuration for `list_cases`
1109
+ # @return [::Gapic::Config::Method]
1110
+ #
1111
+ attr_reader :list_cases
1112
+ ##
1113
+ # RPC-specific configuration for `search_cases`
1114
+ # @return [::Gapic::Config::Method]
1115
+ #
1116
+ attr_reader :search_cases
1117
+ ##
1118
+ # RPC-specific configuration for `create_case`
1119
+ # @return [::Gapic::Config::Method]
1120
+ #
1121
+ attr_reader :create_case
1122
+ ##
1123
+ # RPC-specific configuration for `update_case`
1124
+ # @return [::Gapic::Config::Method]
1125
+ #
1126
+ attr_reader :update_case
1127
+ ##
1128
+ # RPC-specific configuration for `escalate_case`
1129
+ # @return [::Gapic::Config::Method]
1130
+ #
1131
+ attr_reader :escalate_case
1132
+ ##
1133
+ # RPC-specific configuration for `close_case`
1134
+ # @return [::Gapic::Config::Method]
1135
+ #
1136
+ attr_reader :close_case
1137
+ ##
1138
+ # RPC-specific configuration for `search_case_classifications`
1139
+ # @return [::Gapic::Config::Method]
1140
+ #
1141
+ attr_reader :search_case_classifications
1142
+
1143
+ # @private
1144
+ def initialize parent_rpcs = nil
1145
+ get_case_config = parent_rpcs.get_case if parent_rpcs.respond_to? :get_case
1146
+ @get_case = ::Gapic::Config::Method.new get_case_config
1147
+ list_cases_config = parent_rpcs.list_cases if parent_rpcs.respond_to? :list_cases
1148
+ @list_cases = ::Gapic::Config::Method.new list_cases_config
1149
+ search_cases_config = parent_rpcs.search_cases if parent_rpcs.respond_to? :search_cases
1150
+ @search_cases = ::Gapic::Config::Method.new search_cases_config
1151
+ create_case_config = parent_rpcs.create_case if parent_rpcs.respond_to? :create_case
1152
+ @create_case = ::Gapic::Config::Method.new create_case_config
1153
+ update_case_config = parent_rpcs.update_case if parent_rpcs.respond_to? :update_case
1154
+ @update_case = ::Gapic::Config::Method.new update_case_config
1155
+ escalate_case_config = parent_rpcs.escalate_case if parent_rpcs.respond_to? :escalate_case
1156
+ @escalate_case = ::Gapic::Config::Method.new escalate_case_config
1157
+ close_case_config = parent_rpcs.close_case if parent_rpcs.respond_to? :close_case
1158
+ @close_case = ::Gapic::Config::Method.new close_case_config
1159
+ search_case_classifications_config = parent_rpcs.search_case_classifications if parent_rpcs.respond_to? :search_case_classifications
1160
+ @search_case_classifications = ::Gapic::Config::Method.new search_case_classifications_config
1161
+
1162
+ yield self if block_given?
1163
+ end
1164
+ end
1165
+ end
1166
+ end
1167
+ end
1168
+ end
1169
+ end
1170
+ end
1171
+ end