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