google-cloud-support-v2 1.11.1 → 1.11.3

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