google-cloud-support-v2 0.a → 0.2.0

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