google-cloud-chronicle-v1 0.8.0 → 0.9.0

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