google-cloud-support-v2beta 0.a → 0.1.1

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