google-cloud-chronicle-v1 0.a → 0.1.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.
Files changed (74) 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/chronicle/v1/data_access_control_pb.rb +67 -0
  6. data/lib/google/cloud/chronicle/v1/data_access_control_service/client.rb +1414 -0
  7. data/lib/google/cloud/chronicle/v1/data_access_control_service/credentials.rb +47 -0
  8. data/lib/google/cloud/chronicle/v1/data_access_control_service/paths.rb +94 -0
  9. data/lib/google/cloud/chronicle/v1/data_access_control_service/rest/client.rb +1318 -0
  10. data/lib/google/cloud/chronicle/v1/data_access_control_service/rest/service_stub.rb +695 -0
  11. data/lib/google/cloud/chronicle/v1/data_access_control_service/rest.rb +53 -0
  12. data/lib/google/cloud/chronicle/v1/data_access_control_service.rb +56 -0
  13. data/lib/google/cloud/chronicle/v1/data_access_control_services_pb.rb +76 -0
  14. data/lib/google/cloud/chronicle/v1/entity_pb.rb +62 -0
  15. data/lib/google/cloud/chronicle/v1/entity_service/client.rb +891 -0
  16. data/lib/google/cloud/chronicle/v1/entity_service/credentials.rb +47 -0
  17. data/lib/google/cloud/chronicle/v1/entity_service/paths.rb +73 -0
  18. data/lib/google/cloud/chronicle/v1/entity_service/rest/client.rb +830 -0
  19. data/lib/google/cloud/chronicle/v1/entity_service/rest/service_stub.rb +388 -0
  20. data/lib/google/cloud/chronicle/v1/entity_service/rest.rb +52 -0
  21. data/lib/google/cloud/chronicle/v1/entity_service.rb +55 -0
  22. data/lib/google/cloud/chronicle/v1/entity_services_pb.rb +54 -0
  23. data/lib/google/cloud/chronicle/v1/instance_pb.rb +48 -0
  24. data/lib/google/cloud/chronicle/v1/instance_service/client.rb +464 -0
  25. data/lib/google/cloud/chronicle/v1/instance_service/credentials.rb +47 -0
  26. data/lib/google/cloud/chronicle/v1/instance_service/paths.rb +52 -0
  27. data/lib/google/cloud/chronicle/v1/instance_service/rest/client.rb +431 -0
  28. data/lib/google/cloud/chronicle/v1/instance_service/rest/service_stub.rb +142 -0
  29. data/lib/google/cloud/chronicle/v1/instance_service/rest.rb +52 -0
  30. data/lib/google/cloud/chronicle/v1/instance_service.rb +55 -0
  31. data/lib/google/cloud/chronicle/v1/instance_services_pb.rb +45 -0
  32. data/lib/google/cloud/chronicle/v1/reference_list_pb.rb +61 -0
  33. data/lib/google/cloud/chronicle/v1/reference_list_service/client.rb +792 -0
  34. data/lib/google/cloud/chronicle/v1/reference_list_service/credentials.rb +47 -0
  35. data/lib/google/cloud/chronicle/v1/reference_list_service/paths.rb +73 -0
  36. data/lib/google/cloud/chronicle/v1/reference_list_service/rest/client.rb +738 -0
  37. data/lib/google/cloud/chronicle/v1/reference_list_service/rest/service_stub.rb +327 -0
  38. data/lib/google/cloud/chronicle/v1/reference_list_service/rest.rb +52 -0
  39. data/lib/google/cloud/chronicle/v1/reference_list_service.rb +55 -0
  40. data/lib/google/cloud/chronicle/v1/reference_list_services_pb.rb +51 -0
  41. data/lib/google/cloud/chronicle/v1/rest.rb +41 -0
  42. data/lib/google/cloud/chronicle/v1/rule_pb.rb +85 -0
  43. data/lib/google/cloud/chronicle/v1/rule_service/client.rb +1674 -0
  44. data/lib/google/cloud/chronicle/v1/rule_service/credentials.rb +47 -0
  45. data/lib/google/cloud/chronicle/v1/rule_service/operations.rb +813 -0
  46. data/lib/google/cloud/chronicle/v1/rule_service/paths.rb +159 -0
  47. data/lib/google/cloud/chronicle/v1/rule_service/rest/client.rb +1564 -0
  48. data/lib/google/cloud/chronicle/v1/rule_service/rest/operations.rb +914 -0
  49. data/lib/google/cloud/chronicle/v1/rule_service/rest/service_stub.rb +817 -0
  50. data/lib/google/cloud/chronicle/v1/rule_service/rest.rb +53 -0
  51. data/lib/google/cloud/chronicle/v1/rule_service.rb +56 -0
  52. data/lib/google/cloud/chronicle/v1/rule_services_pb.rb +70 -0
  53. data/lib/google/cloud/chronicle/v1/version.rb +7 -2
  54. data/lib/google/cloud/chronicle/v1.rb +49 -0
  55. data/lib/google-cloud-chronicle-v1.rb +21 -0
  56. data/proto_docs/README.md +4 -0
  57. data/proto_docs/google/api/client.rb +473 -0
  58. data/proto_docs/google/api/field_behavior.rb +85 -0
  59. data/proto_docs/google/api/launch_stage.rb +71 -0
  60. data/proto_docs/google/api/resource.rb +227 -0
  61. data/proto_docs/google/cloud/chronicle/v1/data_access_control.rb +364 -0
  62. data/proto_docs/google/cloud/chronicle/v1/entity.rb +210 -0
  63. data/proto_docs/google/cloud/chronicle/v1/instance.rb +47 -0
  64. data/proto_docs/google/cloud/chronicle/v1/reference_list.rb +232 -0
  65. data/proto_docs/google/cloud/chronicle/v1/rule.rb +701 -0
  66. data/proto_docs/google/longrunning/operations.rb +173 -0
  67. data/proto_docs/google/protobuf/any.rb +145 -0
  68. data/proto_docs/google/protobuf/duration.rb +98 -0
  69. data/proto_docs/google/protobuf/empty.rb +34 -0
  70. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  71. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  72. data/proto_docs/google/rpc/status.rb +48 -0
  73. data/proto_docs/google/type/interval.rb +45 -0
  74. metadata +110 -10
@@ -0,0 +1,1564 @@
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/chronicle/v1/rule_pb"
21
+ require "google/cloud/chronicle/v1/rule_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Chronicle
26
+ module V1
27
+ module RuleService
28
+ module Rest
29
+ ##
30
+ # REST client for the RuleService service.
31
+ #
32
+ # RuleService provides interface for user-created rules.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "chronicle.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :rule_service_stub
45
+
46
+ ##
47
+ # Configure the RuleService Client class.
48
+ #
49
+ # See {::Google::Cloud::Chronicle::V1::RuleService::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all RuleService clients
55
+ # ::Google::Cloud::Chronicle::V1::RuleService::Rest::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "Chronicle", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.rpcs.create_rule.timeout = 60.0
76
+
77
+ default_config.rpcs.get_rule.timeout = 60.0
78
+ default_config.rpcs.get_rule.retry_policy = {
79
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
80
+ }
81
+
82
+ default_config.rpcs.list_rules.timeout = 600.0
83
+ default_config.rpcs.list_rules.retry_policy = {
84
+ initial_delay: 1.0, max_delay: 600.0, multiplier: 1.3, retry_codes: [14]
85
+ }
86
+
87
+ default_config.rpcs.update_rule.timeout = 600.0
88
+
89
+ default_config.rpcs.delete_rule.timeout = 60.0
90
+
91
+ default_config.rpcs.list_rule_revisions.timeout = 600.0
92
+ default_config.rpcs.list_rule_revisions.retry_policy = {
93
+ initial_delay: 1.0, max_delay: 600.0, multiplier: 1.3, retry_codes: [14]
94
+ }
95
+
96
+ default_config.rpcs.create_retrohunt.timeout = 600.0
97
+
98
+ default_config.rpcs.get_retrohunt.timeout = 60.0
99
+ default_config.rpcs.get_retrohunt.retry_policy = {
100
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
101
+ }
102
+
103
+ default_config.rpcs.list_retrohunts.timeout = 60.0
104
+ default_config.rpcs.list_retrohunts.retry_policy = {
105
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
106
+ }
107
+
108
+ default_config.rpcs.get_rule_deployment.timeout = 600.0
109
+ default_config.rpcs.get_rule_deployment.retry_policy = {
110
+ initial_delay: 1.0, max_delay: 600.0, multiplier: 1.3, retry_codes: [14]
111
+ }
112
+
113
+ default_config.rpcs.list_rule_deployments.timeout = 600.0
114
+ default_config.rpcs.list_rule_deployments.retry_policy = {
115
+ initial_delay: 1.0, max_delay: 600.0, multiplier: 1.3, retry_codes: [14]
116
+ }
117
+
118
+ default_config.rpcs.update_rule_deployment.timeout = 600.0
119
+
120
+ default_config
121
+ end
122
+ yield @configure if block_given?
123
+ @configure
124
+ end
125
+
126
+ ##
127
+ # Configure the RuleService Client instance.
128
+ #
129
+ # The configuration is set to the derived mode, meaning that values can be changed,
130
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
131
+ # should be made on {Client.configure}.
132
+ #
133
+ # See {::Google::Cloud::Chronicle::V1::RuleService::Rest::Client::Configuration}
134
+ # for a description of the configuration fields.
135
+ #
136
+ # @yield [config] Configure the Client client.
137
+ # @yieldparam config [Client::Configuration]
138
+ #
139
+ # @return [Client::Configuration]
140
+ #
141
+ def configure
142
+ yield @config if block_given?
143
+ @config
144
+ end
145
+
146
+ ##
147
+ # The effective universe domain
148
+ #
149
+ # @return [String]
150
+ #
151
+ def universe_domain
152
+ @rule_service_stub.universe_domain
153
+ end
154
+
155
+ ##
156
+ # Create a new RuleService REST client object.
157
+ #
158
+ # @example
159
+ #
160
+ # # Create a client using the default configuration
161
+ # client = ::Google::Cloud::Chronicle::V1::RuleService::Rest::Client.new
162
+ #
163
+ # # Create a client using a custom configuration
164
+ # client = ::Google::Cloud::Chronicle::V1::RuleService::Rest::Client.new do |config|
165
+ # config.timeout = 10.0
166
+ # end
167
+ #
168
+ # @yield [config] Configure the RuleService client.
169
+ # @yieldparam config [Client::Configuration]
170
+ #
171
+ def initialize
172
+ # Create the configuration object
173
+ @config = Configuration.new Client.configure
174
+
175
+ # Yield the configuration if needed
176
+ yield @config if block_given?
177
+
178
+ # Create credentials
179
+ credentials = @config.credentials
180
+ # Use self-signed JWT if the endpoint is unchanged from default,
181
+ # but only if the default endpoint does not have a region prefix.
182
+ enable_self_signed_jwt = @config.endpoint.nil? ||
183
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
184
+ !@config.endpoint.split(".").first.include?("-"))
185
+ credentials ||= Credentials.default scope: @config.scope,
186
+ enable_self_signed_jwt: enable_self_signed_jwt
187
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
188
+ credentials = Credentials.new credentials, scope: @config.scope
189
+ end
190
+
191
+ @quota_project_id = @config.quota_project
192
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
193
+
194
+ @operations_client = ::Google::Cloud::Chronicle::V1::RuleService::Rest::Operations.new do |config|
195
+ config.credentials = credentials
196
+ config.quota_project = @quota_project_id
197
+ config.endpoint = @config.endpoint
198
+ config.universe_domain = @config.universe_domain
199
+ end
200
+
201
+ @rule_service_stub = ::Google::Cloud::Chronicle::V1::RuleService::Rest::ServiceStub.new(
202
+ endpoint: @config.endpoint,
203
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
204
+ universe_domain: @config.universe_domain,
205
+ credentials: credentials,
206
+ logger: @config.logger
207
+ )
208
+
209
+ @rule_service_stub.logger(stub: true)&.info do |entry|
210
+ entry.set_system_name
211
+ entry.set_service
212
+ entry.message = "Created client for #{entry.service}"
213
+ entry.set_credentials_fields credentials
214
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
215
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
216
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
217
+ end
218
+ end
219
+
220
+ ##
221
+ # Get the associated client for long-running operations.
222
+ #
223
+ # @return [::Google::Cloud::Chronicle::V1::RuleService::Rest::Operations]
224
+ #
225
+ attr_reader :operations_client
226
+
227
+ ##
228
+ # The logger used for request/response debug logging.
229
+ #
230
+ # @return [Logger]
231
+ #
232
+ def logger
233
+ @rule_service_stub.logger
234
+ end
235
+
236
+ # Service calls
237
+
238
+ ##
239
+ # Creates a new Rule.
240
+ #
241
+ # @overload create_rule(request, options = nil)
242
+ # Pass arguments to `create_rule` via a request object, either of type
243
+ # {::Google::Cloud::Chronicle::V1::CreateRuleRequest} or an equivalent Hash.
244
+ #
245
+ # @param request [::Google::Cloud::Chronicle::V1::CreateRuleRequest, ::Hash]
246
+ # A request object representing the call parameters. Required. To specify no
247
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
248
+ # @param options [::Gapic::CallOptions, ::Hash]
249
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
250
+ #
251
+ # @overload create_rule(parent: nil, rule: nil)
252
+ # Pass arguments to `create_rule` via keyword arguments. Note that at
253
+ # least one keyword argument is required. To specify no parameters, or to keep all
254
+ # the default parameter values, pass an empty Hash as a request object (see above).
255
+ #
256
+ # @param parent [::String]
257
+ # Required. The parent resource where this rule will be created.
258
+ # Format: `projects/{project}/locations/{location}/instances/{instance}`
259
+ # @param rule [::Google::Cloud::Chronicle::V1::Rule, ::Hash]
260
+ # Required. The rule to create.
261
+ # @yield [result, operation] Access the result along with the TransportOperation object
262
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::Rule]
263
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
264
+ #
265
+ # @return [::Google::Cloud::Chronicle::V1::Rule]
266
+ #
267
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
268
+ #
269
+ # @example Basic example
270
+ # require "google/cloud/chronicle/v1"
271
+ #
272
+ # # Create a client object. The client can be reused for multiple calls.
273
+ # client = Google::Cloud::Chronicle::V1::RuleService::Rest::Client.new
274
+ #
275
+ # # Create a request. To set request fields, pass in keyword arguments.
276
+ # request = Google::Cloud::Chronicle::V1::CreateRuleRequest.new
277
+ #
278
+ # # Call the create_rule method.
279
+ # result = client.create_rule request
280
+ #
281
+ # # The returned object is of type Google::Cloud::Chronicle::V1::Rule.
282
+ # p result
283
+ #
284
+ def create_rule request, options = nil
285
+ raise ::ArgumentError, "request must be provided" if request.nil?
286
+
287
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::CreateRuleRequest
288
+
289
+ # Converts hash and nil to an options object
290
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
291
+
292
+ # Customize the options with defaults
293
+ call_metadata = @config.rpcs.create_rule.metadata.to_h
294
+
295
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
296
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
297
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
298
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
299
+ transports_version_send: [:rest]
300
+
301
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
302
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
303
+
304
+ options.apply_defaults timeout: @config.rpcs.create_rule.timeout,
305
+ metadata: call_metadata,
306
+ retry_policy: @config.rpcs.create_rule.retry_policy
307
+
308
+ options.apply_defaults timeout: @config.timeout,
309
+ metadata: @config.metadata,
310
+ retry_policy: @config.retry_policy
311
+
312
+ @rule_service_stub.create_rule request, options do |result, operation|
313
+ yield result, operation if block_given?
314
+ end
315
+ rescue ::Gapic::Rest::Error => e
316
+ raise ::Google::Cloud::Error.from_error(e)
317
+ end
318
+
319
+ ##
320
+ # Gets a Rule.
321
+ #
322
+ # @overload get_rule(request, options = nil)
323
+ # Pass arguments to `get_rule` via a request object, either of type
324
+ # {::Google::Cloud::Chronicle::V1::GetRuleRequest} or an equivalent Hash.
325
+ #
326
+ # @param request [::Google::Cloud::Chronicle::V1::GetRuleRequest, ::Hash]
327
+ # A request object representing the call parameters. Required. To specify no
328
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
329
+ # @param options [::Gapic::CallOptions, ::Hash]
330
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
331
+ #
332
+ # @overload get_rule(name: nil, view: nil)
333
+ # Pass arguments to `get_rule` via keyword arguments. Note that at
334
+ # least one keyword argument is required. To specify no parameters, or to keep all
335
+ # the default parameter values, pass an empty Hash as a request object (see above).
336
+ #
337
+ # @param name [::String]
338
+ # Required. The name of the rule to retrieve.
339
+ # Format:
340
+ # `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
341
+ # @param view [::Google::Cloud::Chronicle::V1::RuleView]
342
+ # The view field indicates the scope of fields to populate for the Rule being
343
+ # returned. If unspecified, defaults to FULL.
344
+ # @yield [result, operation] Access the result along with the TransportOperation object
345
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::Rule]
346
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
347
+ #
348
+ # @return [::Google::Cloud::Chronicle::V1::Rule]
349
+ #
350
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
351
+ #
352
+ # @example Basic example
353
+ # require "google/cloud/chronicle/v1"
354
+ #
355
+ # # Create a client object. The client can be reused for multiple calls.
356
+ # client = Google::Cloud::Chronicle::V1::RuleService::Rest::Client.new
357
+ #
358
+ # # Create a request. To set request fields, pass in keyword arguments.
359
+ # request = Google::Cloud::Chronicle::V1::GetRuleRequest.new
360
+ #
361
+ # # Call the get_rule method.
362
+ # result = client.get_rule request
363
+ #
364
+ # # The returned object is of type Google::Cloud::Chronicle::V1::Rule.
365
+ # p result
366
+ #
367
+ def get_rule request, options = nil
368
+ raise ::ArgumentError, "request must be provided" if request.nil?
369
+
370
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetRuleRequest
371
+
372
+ # Converts hash and nil to an options object
373
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
374
+
375
+ # Customize the options with defaults
376
+ call_metadata = @config.rpcs.get_rule.metadata.to_h
377
+
378
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
379
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
380
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
381
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
382
+ transports_version_send: [:rest]
383
+
384
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
385
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
386
+
387
+ options.apply_defaults timeout: @config.rpcs.get_rule.timeout,
388
+ metadata: call_metadata,
389
+ retry_policy: @config.rpcs.get_rule.retry_policy
390
+
391
+ options.apply_defaults timeout: @config.timeout,
392
+ metadata: @config.metadata,
393
+ retry_policy: @config.retry_policy
394
+
395
+ @rule_service_stub.get_rule request, options do |result, operation|
396
+ yield result, operation if block_given?
397
+ end
398
+ rescue ::Gapic::Rest::Error => e
399
+ raise ::Google::Cloud::Error.from_error(e)
400
+ end
401
+
402
+ ##
403
+ # Lists Rules.
404
+ #
405
+ # @overload list_rules(request, options = nil)
406
+ # Pass arguments to `list_rules` via a request object, either of type
407
+ # {::Google::Cloud::Chronicle::V1::ListRulesRequest} or an equivalent Hash.
408
+ #
409
+ # @param request [::Google::Cloud::Chronicle::V1::ListRulesRequest, ::Hash]
410
+ # A request object representing the call parameters. Required. To specify no
411
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
412
+ # @param options [::Gapic::CallOptions, ::Hash]
413
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
414
+ #
415
+ # @overload list_rules(parent: nil, page_size: nil, page_token: nil, view: nil, filter: nil)
416
+ # Pass arguments to `list_rules` via keyword arguments. Note that at
417
+ # least one keyword argument is required. To specify no parameters, or to keep all
418
+ # the default parameter values, pass an empty Hash as a request object (see above).
419
+ #
420
+ # @param parent [::String]
421
+ # Required. The parent, which owns this collection of rules.
422
+ # Format:
423
+ # `projects/{project}/locations/{location}/instances/{instance}`
424
+ # @param page_size [::Integer]
425
+ # The maximum number of rules to return. The service may return fewer than
426
+ # this value. If unspecified, at most 100 rules will be returned. The
427
+ # maximum value is 1000; values above 1000 will be coerced to 1000.
428
+ # @param page_token [::String]
429
+ # A page token, received from a previous `ListRules` call.
430
+ # Provide this to retrieve the subsequent page.
431
+ #
432
+ # When paginating, all other parameters provided to `ListRules`
433
+ # must match the call that provided the page token.
434
+ # @param view [::Google::Cloud::Chronicle::V1::RuleView]
435
+ # view indicates the scope of fields to populate for the Rule being returned.
436
+ # If unspecified, defaults to BASIC.
437
+ # @param filter [::String]
438
+ # Only the following filters are allowed:
439
+ # "reference_lists:\\{reference_list_name}"
440
+ # "data_tables:\\{data_table_name}"
441
+ # "display_name:\\{display_name}"
442
+ # @yield [result, operation] Access the result along with the TransportOperation object
443
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::Rule>]
444
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
445
+ #
446
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::Rule>]
447
+ #
448
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
449
+ #
450
+ # @example Basic example
451
+ # require "google/cloud/chronicle/v1"
452
+ #
453
+ # # Create a client object. The client can be reused for multiple calls.
454
+ # client = Google::Cloud::Chronicle::V1::RuleService::Rest::Client.new
455
+ #
456
+ # # Create a request. To set request fields, pass in keyword arguments.
457
+ # request = Google::Cloud::Chronicle::V1::ListRulesRequest.new
458
+ #
459
+ # # Call the list_rules method.
460
+ # result = client.list_rules request
461
+ #
462
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
463
+ # # over elements, and API calls will be issued to fetch pages as needed.
464
+ # result.each do |item|
465
+ # # Each element is of type ::Google::Cloud::Chronicle::V1::Rule.
466
+ # p item
467
+ # end
468
+ #
469
+ def list_rules request, options = nil
470
+ raise ::ArgumentError, "request must be provided" if request.nil?
471
+
472
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListRulesRequest
473
+
474
+ # Converts hash and nil to an options object
475
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
476
+
477
+ # Customize the options with defaults
478
+ call_metadata = @config.rpcs.list_rules.metadata.to_h
479
+
480
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
481
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
482
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
483
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
484
+ transports_version_send: [:rest]
485
+
486
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
487
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
488
+
489
+ options.apply_defaults timeout: @config.rpcs.list_rules.timeout,
490
+ metadata: call_metadata,
491
+ retry_policy: @config.rpcs.list_rules.retry_policy
492
+
493
+ options.apply_defaults timeout: @config.timeout,
494
+ metadata: @config.metadata,
495
+ retry_policy: @config.retry_policy
496
+
497
+ @rule_service_stub.list_rules request, options do |result, operation|
498
+ result = ::Gapic::Rest::PagedEnumerable.new @rule_service_stub, :list_rules, "rules", request, result, options
499
+ yield result, operation if block_given?
500
+ throw :response, result
501
+ end
502
+ rescue ::Gapic::Rest::Error => e
503
+ raise ::Google::Cloud::Error.from_error(e)
504
+ end
505
+
506
+ ##
507
+ # Updates a Rule.
508
+ #
509
+ # @overload update_rule(request, options = nil)
510
+ # Pass arguments to `update_rule` via a request object, either of type
511
+ # {::Google::Cloud::Chronicle::V1::UpdateRuleRequest} or an equivalent Hash.
512
+ #
513
+ # @param request [::Google::Cloud::Chronicle::V1::UpdateRuleRequest, ::Hash]
514
+ # A request object representing the call parameters. Required. To specify no
515
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
516
+ # @param options [::Gapic::CallOptions, ::Hash]
517
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
518
+ #
519
+ # @overload update_rule(rule: nil, update_mask: nil)
520
+ # Pass arguments to `update_rule` via keyword arguments. Note that at
521
+ # least one keyword argument is required. To specify no parameters, or to keep all
522
+ # the default parameter values, pass an empty Hash as a request object (see above).
523
+ #
524
+ # @param rule [::Google::Cloud::Chronicle::V1::Rule, ::Hash]
525
+ # Required. The rule to update.
526
+ #
527
+ # The rule's `name` field is used to identify the rule to update.
528
+ # Format:
529
+ # `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
530
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
531
+ # The list of fields to update. If not included, all fields with a non-empty
532
+ # value will be overwritten.
533
+ # @yield [result, operation] Access the result along with the TransportOperation object
534
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::Rule]
535
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
536
+ #
537
+ # @return [::Google::Cloud::Chronicle::V1::Rule]
538
+ #
539
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
540
+ #
541
+ # @example Basic example
542
+ # require "google/cloud/chronicle/v1"
543
+ #
544
+ # # Create a client object. The client can be reused for multiple calls.
545
+ # client = Google::Cloud::Chronicle::V1::RuleService::Rest::Client.new
546
+ #
547
+ # # Create a request. To set request fields, pass in keyword arguments.
548
+ # request = Google::Cloud::Chronicle::V1::UpdateRuleRequest.new
549
+ #
550
+ # # Call the update_rule method.
551
+ # result = client.update_rule request
552
+ #
553
+ # # The returned object is of type Google::Cloud::Chronicle::V1::Rule.
554
+ # p result
555
+ #
556
+ def update_rule request, options = nil
557
+ raise ::ArgumentError, "request must be provided" if request.nil?
558
+
559
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::UpdateRuleRequest
560
+
561
+ # Converts hash and nil to an options object
562
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
563
+
564
+ # Customize the options with defaults
565
+ call_metadata = @config.rpcs.update_rule.metadata.to_h
566
+
567
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
568
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
569
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
570
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
571
+ transports_version_send: [:rest]
572
+
573
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
574
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
575
+
576
+ options.apply_defaults timeout: @config.rpcs.update_rule.timeout,
577
+ metadata: call_metadata,
578
+ retry_policy: @config.rpcs.update_rule.retry_policy
579
+
580
+ options.apply_defaults timeout: @config.timeout,
581
+ metadata: @config.metadata,
582
+ retry_policy: @config.retry_policy
583
+
584
+ @rule_service_stub.update_rule request, options do |result, operation|
585
+ yield result, operation if block_given?
586
+ end
587
+ rescue ::Gapic::Rest::Error => e
588
+ raise ::Google::Cloud::Error.from_error(e)
589
+ end
590
+
591
+ ##
592
+ # Deletes a Rule.
593
+ #
594
+ # @overload delete_rule(request, options = nil)
595
+ # Pass arguments to `delete_rule` via a request object, either of type
596
+ # {::Google::Cloud::Chronicle::V1::DeleteRuleRequest} or an equivalent Hash.
597
+ #
598
+ # @param request [::Google::Cloud::Chronicle::V1::DeleteRuleRequest, ::Hash]
599
+ # A request object representing the call parameters. Required. To specify no
600
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
601
+ # @param options [::Gapic::CallOptions, ::Hash]
602
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
603
+ #
604
+ # @overload delete_rule(name: nil, force: nil)
605
+ # Pass arguments to `delete_rule` via keyword arguments. Note that at
606
+ # least one keyword argument is required. To specify no parameters, or to keep all
607
+ # the default parameter values, pass an empty Hash as a request object (see above).
608
+ #
609
+ # @param name [::String]
610
+ # Required. The name of the rule to delete. A rule revision timestamp cannot
611
+ # be specified as part of the name, as deleting specific revisions is not
612
+ # supported.
613
+ # Format:
614
+ # `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
615
+ # @param force [::Boolean]
616
+ # Optional. If set to true, any retrohunts and any detections associated with
617
+ # the rule will also be deleted. If set to false, the call will only succeed
618
+ # if the rule has no associated retrohunts, including completed retrohunts,
619
+ # and no associated detections. Regardless of this field's value, the rule
620
+ # deployment associated with this rule will also be deleted.
621
+ # @yield [result, operation] Access the result along with the TransportOperation object
622
+ # @yieldparam result [::Google::Protobuf::Empty]
623
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
624
+ #
625
+ # @return [::Google::Protobuf::Empty]
626
+ #
627
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
628
+ #
629
+ # @example Basic example
630
+ # require "google/cloud/chronicle/v1"
631
+ #
632
+ # # Create a client object. The client can be reused for multiple calls.
633
+ # client = Google::Cloud::Chronicle::V1::RuleService::Rest::Client.new
634
+ #
635
+ # # Create a request. To set request fields, pass in keyword arguments.
636
+ # request = Google::Cloud::Chronicle::V1::DeleteRuleRequest.new
637
+ #
638
+ # # Call the delete_rule method.
639
+ # result = client.delete_rule request
640
+ #
641
+ # # The returned object is of type Google::Protobuf::Empty.
642
+ # p result
643
+ #
644
+ def delete_rule request, options = nil
645
+ raise ::ArgumentError, "request must be provided" if request.nil?
646
+
647
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::DeleteRuleRequest
648
+
649
+ # Converts hash and nil to an options object
650
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
651
+
652
+ # Customize the options with defaults
653
+ call_metadata = @config.rpcs.delete_rule.metadata.to_h
654
+
655
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
656
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
657
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
658
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
659
+ transports_version_send: [:rest]
660
+
661
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
662
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
663
+
664
+ options.apply_defaults timeout: @config.rpcs.delete_rule.timeout,
665
+ metadata: call_metadata,
666
+ retry_policy: @config.rpcs.delete_rule.retry_policy
667
+
668
+ options.apply_defaults timeout: @config.timeout,
669
+ metadata: @config.metadata,
670
+ retry_policy: @config.retry_policy
671
+
672
+ @rule_service_stub.delete_rule request, options do |result, operation|
673
+ yield result, operation if block_given?
674
+ end
675
+ rescue ::Gapic::Rest::Error => e
676
+ raise ::Google::Cloud::Error.from_error(e)
677
+ end
678
+
679
+ ##
680
+ # Lists all revisions of the rule.
681
+ #
682
+ # @overload list_rule_revisions(request, options = nil)
683
+ # Pass arguments to `list_rule_revisions` via a request object, either of type
684
+ # {::Google::Cloud::Chronicle::V1::ListRuleRevisionsRequest} or an equivalent Hash.
685
+ #
686
+ # @param request [::Google::Cloud::Chronicle::V1::ListRuleRevisionsRequest, ::Hash]
687
+ # A request object representing the call parameters. Required. To specify no
688
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
689
+ # @param options [::Gapic::CallOptions, ::Hash]
690
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
691
+ #
692
+ # @overload list_rule_revisions(name: nil, page_size: nil, page_token: nil, view: nil)
693
+ # Pass arguments to `list_rule_revisions` via keyword arguments. Note that at
694
+ # least one keyword argument is required. To specify no parameters, or to keep all
695
+ # the default parameter values, pass an empty Hash as a request object (see above).
696
+ #
697
+ # @param name [::String]
698
+ # Required. The name of the rule to list revisions for.
699
+ # Format:
700
+ # `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
701
+ # @param page_size [::Integer]
702
+ # The maximum number of revisions to return per page. The service may return
703
+ # fewer than this value. If unspecified, at most 100 revisions will be
704
+ # returned. The maximum value is 1000; values above 1000 will be coerced to
705
+ # 1000.
706
+ # @param page_token [::String]
707
+ # The page token, received from a previous `ListRuleRevisions` call.
708
+ # Provide this to retrieve the subsequent page.
709
+ #
710
+ # When paginating, all other parameters provided to `ListRuleRevisions`
711
+ # must match the call that provided the page token.
712
+ # @param view [::Google::Cloud::Chronicle::V1::RuleView]
713
+ # The view field indicates the scope of fields to populate for the revision
714
+ # being returned. If unspecified, defaults to BASIC.
715
+ # @yield [result, operation] Access the result along with the TransportOperation object
716
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::Rule>]
717
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
718
+ #
719
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::Rule>]
720
+ #
721
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
722
+ #
723
+ # @example Basic example
724
+ # require "google/cloud/chronicle/v1"
725
+ #
726
+ # # Create a client object. The client can be reused for multiple calls.
727
+ # client = Google::Cloud::Chronicle::V1::RuleService::Rest::Client.new
728
+ #
729
+ # # Create a request. To set request fields, pass in keyword arguments.
730
+ # request = Google::Cloud::Chronicle::V1::ListRuleRevisionsRequest.new
731
+ #
732
+ # # Call the list_rule_revisions method.
733
+ # result = client.list_rule_revisions request
734
+ #
735
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
736
+ # # over elements, and API calls will be issued to fetch pages as needed.
737
+ # result.each do |item|
738
+ # # Each element is of type ::Google::Cloud::Chronicle::V1::Rule.
739
+ # p item
740
+ # end
741
+ #
742
+ def list_rule_revisions request, options = nil
743
+ raise ::ArgumentError, "request must be provided" if request.nil?
744
+
745
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListRuleRevisionsRequest
746
+
747
+ # Converts hash and nil to an options object
748
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
749
+
750
+ # Customize the options with defaults
751
+ call_metadata = @config.rpcs.list_rule_revisions.metadata.to_h
752
+
753
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
754
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
755
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
756
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
757
+ transports_version_send: [:rest]
758
+
759
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
760
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
761
+
762
+ options.apply_defaults timeout: @config.rpcs.list_rule_revisions.timeout,
763
+ metadata: call_metadata,
764
+ retry_policy: @config.rpcs.list_rule_revisions.retry_policy
765
+
766
+ options.apply_defaults timeout: @config.timeout,
767
+ metadata: @config.metadata,
768
+ retry_policy: @config.retry_policy
769
+
770
+ @rule_service_stub.list_rule_revisions request, options do |result, operation|
771
+ result = ::Gapic::Rest::PagedEnumerable.new @rule_service_stub, :list_rule_revisions, "rules", request, result, options
772
+ yield result, operation if block_given?
773
+ throw :response, result
774
+ end
775
+ rescue ::Gapic::Rest::Error => e
776
+ raise ::Google::Cloud::Error.from_error(e)
777
+ end
778
+
779
+ ##
780
+ # Create a Retrohunt.
781
+ #
782
+ # @overload create_retrohunt(request, options = nil)
783
+ # Pass arguments to `create_retrohunt` via a request object, either of type
784
+ # {::Google::Cloud::Chronicle::V1::CreateRetrohuntRequest} or an equivalent Hash.
785
+ #
786
+ # @param request [::Google::Cloud::Chronicle::V1::CreateRetrohuntRequest, ::Hash]
787
+ # A request object representing the call parameters. Required. To specify no
788
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
789
+ # @param options [::Gapic::CallOptions, ::Hash]
790
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
791
+ #
792
+ # @overload create_retrohunt(parent: nil, retrohunt: nil)
793
+ # Pass arguments to `create_retrohunt` via keyword arguments. Note that at
794
+ # least one keyword argument is required. To specify no parameters, or to keep all
795
+ # the default parameter values, pass an empty Hash as a request object (see above).
796
+ #
797
+ # @param parent [::String]
798
+ # Required. The parent of retrohunt, which is a rule.
799
+ # Format:
800
+ # `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
801
+ # @param retrohunt [::Google::Cloud::Chronicle::V1::Retrohunt, ::Hash]
802
+ # Required. The retrohunt to create.
803
+ # @yield [result, operation] Access the result along with the TransportOperation object
804
+ # @yieldparam result [::Gapic::Operation]
805
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
806
+ #
807
+ # @return [::Gapic::Operation]
808
+ #
809
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
810
+ #
811
+ # @example Basic example
812
+ # require "google/cloud/chronicle/v1"
813
+ #
814
+ # # Create a client object. The client can be reused for multiple calls.
815
+ # client = Google::Cloud::Chronicle::V1::RuleService::Rest::Client.new
816
+ #
817
+ # # Create a request. To set request fields, pass in keyword arguments.
818
+ # request = Google::Cloud::Chronicle::V1::CreateRetrohuntRequest.new
819
+ #
820
+ # # Call the create_retrohunt method.
821
+ # result = client.create_retrohunt request
822
+ #
823
+ # # The returned object is of type Gapic::Operation. You can use it to
824
+ # # check the status of an operation, cancel it, or wait for results.
825
+ # # Here is how to wait for a response.
826
+ # result.wait_until_done! timeout: 60
827
+ # if result.response?
828
+ # p result.response
829
+ # else
830
+ # puts "No response received."
831
+ # end
832
+ #
833
+ def create_retrohunt request, options = nil
834
+ raise ::ArgumentError, "request must be provided" if request.nil?
835
+
836
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::CreateRetrohuntRequest
837
+
838
+ # Converts hash and nil to an options object
839
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
840
+
841
+ # Customize the options with defaults
842
+ call_metadata = @config.rpcs.create_retrohunt.metadata.to_h
843
+
844
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
845
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
846
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
847
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
848
+ transports_version_send: [:rest]
849
+
850
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
851
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
852
+
853
+ options.apply_defaults timeout: @config.rpcs.create_retrohunt.timeout,
854
+ metadata: call_metadata,
855
+ retry_policy: @config.rpcs.create_retrohunt.retry_policy
856
+
857
+ options.apply_defaults timeout: @config.timeout,
858
+ metadata: @config.metadata,
859
+ retry_policy: @config.retry_policy
860
+
861
+ @rule_service_stub.create_retrohunt request, options do |result, operation|
862
+ result = ::Gapic::Operation.new result, @operations_client, options: options
863
+ yield result, operation if block_given?
864
+ throw :response, result
865
+ end
866
+ rescue ::Gapic::Rest::Error => e
867
+ raise ::Google::Cloud::Error.from_error(e)
868
+ end
869
+
870
+ ##
871
+ # Get a Retrohunt.
872
+ #
873
+ # @overload get_retrohunt(request, options = nil)
874
+ # Pass arguments to `get_retrohunt` via a request object, either of type
875
+ # {::Google::Cloud::Chronicle::V1::GetRetrohuntRequest} or an equivalent Hash.
876
+ #
877
+ # @param request [::Google::Cloud::Chronicle::V1::GetRetrohuntRequest, ::Hash]
878
+ # A request object representing the call parameters. Required. To specify no
879
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
880
+ # @param options [::Gapic::CallOptions, ::Hash]
881
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
882
+ #
883
+ # @overload get_retrohunt(name: nil)
884
+ # Pass arguments to `get_retrohunt` via keyword arguments. Note that at
885
+ # least one keyword argument is required. To specify no parameters, or to keep all
886
+ # the default parameter values, pass an empty Hash as a request object (see above).
887
+ #
888
+ # @param name [::String]
889
+ # Required. The name of the retrohunt to retrieve.
890
+ # Format:
891
+ # `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}/retrohunts/{retrohunt}`
892
+ # @yield [result, operation] Access the result along with the TransportOperation object
893
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::Retrohunt]
894
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
895
+ #
896
+ # @return [::Google::Cloud::Chronicle::V1::Retrohunt]
897
+ #
898
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
899
+ #
900
+ # @example Basic example
901
+ # require "google/cloud/chronicle/v1"
902
+ #
903
+ # # Create a client object. The client can be reused for multiple calls.
904
+ # client = Google::Cloud::Chronicle::V1::RuleService::Rest::Client.new
905
+ #
906
+ # # Create a request. To set request fields, pass in keyword arguments.
907
+ # request = Google::Cloud::Chronicle::V1::GetRetrohuntRequest.new
908
+ #
909
+ # # Call the get_retrohunt method.
910
+ # result = client.get_retrohunt request
911
+ #
912
+ # # The returned object is of type Google::Cloud::Chronicle::V1::Retrohunt.
913
+ # p result
914
+ #
915
+ def get_retrohunt request, options = nil
916
+ raise ::ArgumentError, "request must be provided" if request.nil?
917
+
918
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetRetrohuntRequest
919
+
920
+ # Converts hash and nil to an options object
921
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
922
+
923
+ # Customize the options with defaults
924
+ call_metadata = @config.rpcs.get_retrohunt.metadata.to_h
925
+
926
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
927
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
928
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
929
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
930
+ transports_version_send: [:rest]
931
+
932
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
933
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
934
+
935
+ options.apply_defaults timeout: @config.rpcs.get_retrohunt.timeout,
936
+ metadata: call_metadata,
937
+ retry_policy: @config.rpcs.get_retrohunt.retry_policy
938
+
939
+ options.apply_defaults timeout: @config.timeout,
940
+ metadata: @config.metadata,
941
+ retry_policy: @config.retry_policy
942
+
943
+ @rule_service_stub.get_retrohunt request, options do |result, operation|
944
+ yield result, operation if block_given?
945
+ end
946
+ rescue ::Gapic::Rest::Error => e
947
+ raise ::Google::Cloud::Error.from_error(e)
948
+ end
949
+
950
+ ##
951
+ # List Retrohunts.
952
+ #
953
+ # @overload list_retrohunts(request, options = nil)
954
+ # Pass arguments to `list_retrohunts` via a request object, either of type
955
+ # {::Google::Cloud::Chronicle::V1::ListRetrohuntsRequest} or an equivalent Hash.
956
+ #
957
+ # @param request [::Google::Cloud::Chronicle::V1::ListRetrohuntsRequest, ::Hash]
958
+ # A request object representing the call parameters. Required. To specify no
959
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
960
+ # @param options [::Gapic::CallOptions, ::Hash]
961
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
962
+ #
963
+ # @overload list_retrohunts(parent: nil, page_size: nil, page_token: nil, filter: nil)
964
+ # Pass arguments to `list_retrohunts` via keyword arguments. Note that at
965
+ # least one keyword argument is required. To specify no parameters, or to keep all
966
+ # the default parameter values, pass an empty Hash as a request object (see above).
967
+ #
968
+ # @param parent [::String]
969
+ # Required. The rule that the retrohunts belong to.
970
+ # Format:
971
+ # `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
972
+ # @param page_size [::Integer]
973
+ # The maximum number of retrohunt to return. The service may return fewer
974
+ # than this value. If unspecified, at most 100 retrohunts will be returned.
975
+ # The maximum value is 1000; values above 1000 will be coerced to
976
+ # 1000.
977
+ # @param page_token [::String]
978
+ # A page token, received from a previous `ListRetrohunts` call.
979
+ # Provide this to retrieve the subsequent page.
980
+ #
981
+ # When paginating, all other parameters provided to `ListRetrohunts` must
982
+ # match the call that provided the page token.
983
+ # @param filter [::String]
984
+ # A filter that can be used to retrieve specific rule deployments.
985
+ # The following fields are filterable:
986
+ # state
987
+ # @yield [result, operation] Access the result along with the TransportOperation object
988
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::Retrohunt>]
989
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
990
+ #
991
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::Retrohunt>]
992
+ #
993
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
994
+ #
995
+ # @example Basic example
996
+ # require "google/cloud/chronicle/v1"
997
+ #
998
+ # # Create a client object. The client can be reused for multiple calls.
999
+ # client = Google::Cloud::Chronicle::V1::RuleService::Rest::Client.new
1000
+ #
1001
+ # # Create a request. To set request fields, pass in keyword arguments.
1002
+ # request = Google::Cloud::Chronicle::V1::ListRetrohuntsRequest.new
1003
+ #
1004
+ # # Call the list_retrohunts method.
1005
+ # result = client.list_retrohunts request
1006
+ #
1007
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1008
+ # # over elements, and API calls will be issued to fetch pages as needed.
1009
+ # result.each do |item|
1010
+ # # Each element is of type ::Google::Cloud::Chronicle::V1::Retrohunt.
1011
+ # p item
1012
+ # end
1013
+ #
1014
+ def list_retrohunts request, options = nil
1015
+ raise ::ArgumentError, "request must be provided" if request.nil?
1016
+
1017
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListRetrohuntsRequest
1018
+
1019
+ # Converts hash and nil to an options object
1020
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1021
+
1022
+ # Customize the options with defaults
1023
+ call_metadata = @config.rpcs.list_retrohunts.metadata.to_h
1024
+
1025
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1026
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1027
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1028
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
1029
+ transports_version_send: [:rest]
1030
+
1031
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1032
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1033
+
1034
+ options.apply_defaults timeout: @config.rpcs.list_retrohunts.timeout,
1035
+ metadata: call_metadata,
1036
+ retry_policy: @config.rpcs.list_retrohunts.retry_policy
1037
+
1038
+ options.apply_defaults timeout: @config.timeout,
1039
+ metadata: @config.metadata,
1040
+ retry_policy: @config.retry_policy
1041
+
1042
+ @rule_service_stub.list_retrohunts request, options do |result, operation|
1043
+ result = ::Gapic::Rest::PagedEnumerable.new @rule_service_stub, :list_retrohunts, "retrohunts", request, result, options
1044
+ yield result, operation if block_given?
1045
+ throw :response, result
1046
+ end
1047
+ rescue ::Gapic::Rest::Error => e
1048
+ raise ::Google::Cloud::Error.from_error(e)
1049
+ end
1050
+
1051
+ ##
1052
+ # Gets a RuleDeployment.
1053
+ #
1054
+ # @overload get_rule_deployment(request, options = nil)
1055
+ # Pass arguments to `get_rule_deployment` via a request object, either of type
1056
+ # {::Google::Cloud::Chronicle::V1::GetRuleDeploymentRequest} or an equivalent Hash.
1057
+ #
1058
+ # @param request [::Google::Cloud::Chronicle::V1::GetRuleDeploymentRequest, ::Hash]
1059
+ # A request object representing the call parameters. Required. To specify no
1060
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1061
+ # @param options [::Gapic::CallOptions, ::Hash]
1062
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1063
+ #
1064
+ # @overload get_rule_deployment(name: nil)
1065
+ # Pass arguments to `get_rule_deployment` via keyword arguments. Note that at
1066
+ # least one keyword argument is required. To specify no parameters, or to keep all
1067
+ # the default parameter values, pass an empty Hash as a request object (see above).
1068
+ #
1069
+ # @param name [::String]
1070
+ # Required. The name of the rule deployment to retrieve.
1071
+ # Format:
1072
+ # `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}/deployment`
1073
+ # @yield [result, operation] Access the result along with the TransportOperation object
1074
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::RuleDeployment]
1075
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1076
+ #
1077
+ # @return [::Google::Cloud::Chronicle::V1::RuleDeployment]
1078
+ #
1079
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1080
+ #
1081
+ # @example Basic example
1082
+ # require "google/cloud/chronicle/v1"
1083
+ #
1084
+ # # Create a client object. The client can be reused for multiple calls.
1085
+ # client = Google::Cloud::Chronicle::V1::RuleService::Rest::Client.new
1086
+ #
1087
+ # # Create a request. To set request fields, pass in keyword arguments.
1088
+ # request = Google::Cloud::Chronicle::V1::GetRuleDeploymentRequest.new
1089
+ #
1090
+ # # Call the get_rule_deployment method.
1091
+ # result = client.get_rule_deployment request
1092
+ #
1093
+ # # The returned object is of type Google::Cloud::Chronicle::V1::RuleDeployment.
1094
+ # p result
1095
+ #
1096
+ def get_rule_deployment request, options = nil
1097
+ raise ::ArgumentError, "request must be provided" if request.nil?
1098
+
1099
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetRuleDeploymentRequest
1100
+
1101
+ # Converts hash and nil to an options object
1102
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1103
+
1104
+ # Customize the options with defaults
1105
+ call_metadata = @config.rpcs.get_rule_deployment.metadata.to_h
1106
+
1107
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1108
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1109
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1110
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
1111
+ transports_version_send: [:rest]
1112
+
1113
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1114
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1115
+
1116
+ options.apply_defaults timeout: @config.rpcs.get_rule_deployment.timeout,
1117
+ metadata: call_metadata,
1118
+ retry_policy: @config.rpcs.get_rule_deployment.retry_policy
1119
+
1120
+ options.apply_defaults timeout: @config.timeout,
1121
+ metadata: @config.metadata,
1122
+ retry_policy: @config.retry_policy
1123
+
1124
+ @rule_service_stub.get_rule_deployment request, options do |result, operation|
1125
+ yield result, operation if block_given?
1126
+ end
1127
+ rescue ::Gapic::Rest::Error => e
1128
+ raise ::Google::Cloud::Error.from_error(e)
1129
+ end
1130
+
1131
+ ##
1132
+ # Lists RuleDeployments across all Rules.
1133
+ #
1134
+ # @overload list_rule_deployments(request, options = nil)
1135
+ # Pass arguments to `list_rule_deployments` via a request object, either of type
1136
+ # {::Google::Cloud::Chronicle::V1::ListRuleDeploymentsRequest} or an equivalent Hash.
1137
+ #
1138
+ # @param request [::Google::Cloud::Chronicle::V1::ListRuleDeploymentsRequest, ::Hash]
1139
+ # A request object representing the call parameters. Required. To specify no
1140
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1141
+ # @param options [::Gapic::CallOptions, ::Hash]
1142
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1143
+ #
1144
+ # @overload list_rule_deployments(parent: nil, page_size: nil, page_token: nil, filter: nil)
1145
+ # Pass arguments to `list_rule_deployments` via keyword arguments. Note that at
1146
+ # least one keyword argument is required. To specify no parameters, or to keep all
1147
+ # the default parameter values, pass an empty Hash as a request object (see above).
1148
+ #
1149
+ # @param parent [::String]
1150
+ # Required. The collection of all parents which own all rule deployments. The
1151
+ # "-" wildcard token must be used as the rule identifier in the resource
1152
+ # path. Format:
1153
+ # `projects/{project}/locations/{location}/instances/{instance}/rules/-`
1154
+ # @param page_size [::Integer]
1155
+ # The maximum number of rule deployments to return. The service may return
1156
+ # fewer than this value. If unspecified, at most 100 rule deployments will be
1157
+ # returned. The maximum value is 1000; values above 1000 will be coerced to
1158
+ # 1000.
1159
+ # @param page_token [::String]
1160
+ # A page token, received from a previous `ListRuleDeployments` call.
1161
+ # Provide this to retrieve the subsequent page.
1162
+ #
1163
+ # When paginating, all other parameters provided to `ListRuleDeployments`
1164
+ # must match the call that provided the page token.
1165
+ # @param filter [::String]
1166
+ # A filter that can be used to retrieve specific rule deployments.
1167
+ # The following fields are filterable:
1168
+ # archived, name
1169
+ # @yield [result, operation] Access the result along with the TransportOperation object
1170
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::RuleDeployment>]
1171
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1172
+ #
1173
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::RuleDeployment>]
1174
+ #
1175
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1176
+ #
1177
+ # @example Basic example
1178
+ # require "google/cloud/chronicle/v1"
1179
+ #
1180
+ # # Create a client object. The client can be reused for multiple calls.
1181
+ # client = Google::Cloud::Chronicle::V1::RuleService::Rest::Client.new
1182
+ #
1183
+ # # Create a request. To set request fields, pass in keyword arguments.
1184
+ # request = Google::Cloud::Chronicle::V1::ListRuleDeploymentsRequest.new
1185
+ #
1186
+ # # Call the list_rule_deployments method.
1187
+ # result = client.list_rule_deployments request
1188
+ #
1189
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1190
+ # # over elements, and API calls will be issued to fetch pages as needed.
1191
+ # result.each do |item|
1192
+ # # Each element is of type ::Google::Cloud::Chronicle::V1::RuleDeployment.
1193
+ # p item
1194
+ # end
1195
+ #
1196
+ def list_rule_deployments request, options = nil
1197
+ raise ::ArgumentError, "request must be provided" if request.nil?
1198
+
1199
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListRuleDeploymentsRequest
1200
+
1201
+ # Converts hash and nil to an options object
1202
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1203
+
1204
+ # Customize the options with defaults
1205
+ call_metadata = @config.rpcs.list_rule_deployments.metadata.to_h
1206
+
1207
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1208
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1209
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1210
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
1211
+ transports_version_send: [:rest]
1212
+
1213
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1214
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1215
+
1216
+ options.apply_defaults timeout: @config.rpcs.list_rule_deployments.timeout,
1217
+ metadata: call_metadata,
1218
+ retry_policy: @config.rpcs.list_rule_deployments.retry_policy
1219
+
1220
+ options.apply_defaults timeout: @config.timeout,
1221
+ metadata: @config.metadata,
1222
+ retry_policy: @config.retry_policy
1223
+
1224
+ @rule_service_stub.list_rule_deployments request, options do |result, operation|
1225
+ result = ::Gapic::Rest::PagedEnumerable.new @rule_service_stub, :list_rule_deployments, "rule_deployments", request, result, options
1226
+ yield result, operation if block_given?
1227
+ throw :response, result
1228
+ end
1229
+ rescue ::Gapic::Rest::Error => e
1230
+ raise ::Google::Cloud::Error.from_error(e)
1231
+ end
1232
+
1233
+ ##
1234
+ # Updates a RuleDeployment.
1235
+ # Failures are not necessarily atomic. If there is a request to update
1236
+ # multiple fields, and any update to a single field fails, an error will be
1237
+ # returned, but other fields may remain successfully updated.
1238
+ #
1239
+ # @overload update_rule_deployment(request, options = nil)
1240
+ # Pass arguments to `update_rule_deployment` via a request object, either of type
1241
+ # {::Google::Cloud::Chronicle::V1::UpdateRuleDeploymentRequest} or an equivalent Hash.
1242
+ #
1243
+ # @param request [::Google::Cloud::Chronicle::V1::UpdateRuleDeploymentRequest, ::Hash]
1244
+ # A request object representing the call parameters. Required. To specify no
1245
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1246
+ # @param options [::Gapic::CallOptions, ::Hash]
1247
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1248
+ #
1249
+ # @overload update_rule_deployment(rule_deployment: nil, update_mask: nil)
1250
+ # Pass arguments to `update_rule_deployment` via keyword arguments. Note that at
1251
+ # least one keyword argument is required. To specify no parameters, or to keep all
1252
+ # the default parameter values, pass an empty Hash as a request object (see above).
1253
+ #
1254
+ # @param rule_deployment [::Google::Cloud::Chronicle::V1::RuleDeployment, ::Hash]
1255
+ # Required. The rule deployment to update.
1256
+ #
1257
+ # The rule deployment's `name` field is used to identify the rule deployment
1258
+ # to update. Format:
1259
+ # `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}/deployment`
1260
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1261
+ # Required. The list of fields to update.
1262
+ # @yield [result, operation] Access the result along with the TransportOperation object
1263
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::RuleDeployment]
1264
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1265
+ #
1266
+ # @return [::Google::Cloud::Chronicle::V1::RuleDeployment]
1267
+ #
1268
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1269
+ #
1270
+ # @example Basic example
1271
+ # require "google/cloud/chronicle/v1"
1272
+ #
1273
+ # # Create a client object. The client can be reused for multiple calls.
1274
+ # client = Google::Cloud::Chronicle::V1::RuleService::Rest::Client.new
1275
+ #
1276
+ # # Create a request. To set request fields, pass in keyword arguments.
1277
+ # request = Google::Cloud::Chronicle::V1::UpdateRuleDeploymentRequest.new
1278
+ #
1279
+ # # Call the update_rule_deployment method.
1280
+ # result = client.update_rule_deployment request
1281
+ #
1282
+ # # The returned object is of type Google::Cloud::Chronicle::V1::RuleDeployment.
1283
+ # p result
1284
+ #
1285
+ def update_rule_deployment request, options = nil
1286
+ raise ::ArgumentError, "request must be provided" if request.nil?
1287
+
1288
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::UpdateRuleDeploymentRequest
1289
+
1290
+ # Converts hash and nil to an options object
1291
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1292
+
1293
+ # Customize the options with defaults
1294
+ call_metadata = @config.rpcs.update_rule_deployment.metadata.to_h
1295
+
1296
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1297
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1298
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1299
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
1300
+ transports_version_send: [:rest]
1301
+
1302
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1303
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1304
+
1305
+ options.apply_defaults timeout: @config.rpcs.update_rule_deployment.timeout,
1306
+ metadata: call_metadata,
1307
+ retry_policy: @config.rpcs.update_rule_deployment.retry_policy
1308
+
1309
+ options.apply_defaults timeout: @config.timeout,
1310
+ metadata: @config.metadata,
1311
+ retry_policy: @config.retry_policy
1312
+
1313
+ @rule_service_stub.update_rule_deployment request, options do |result, operation|
1314
+ yield result, operation if block_given?
1315
+ end
1316
+ rescue ::Gapic::Rest::Error => e
1317
+ raise ::Google::Cloud::Error.from_error(e)
1318
+ end
1319
+
1320
+ ##
1321
+ # Configuration class for the RuleService REST API.
1322
+ #
1323
+ # This class represents the configuration for RuleService REST,
1324
+ # providing control over timeouts, retry behavior, logging, transport
1325
+ # parameters, and other low-level controls. Certain parameters can also be
1326
+ # applied individually to specific RPCs. See
1327
+ # {::Google::Cloud::Chronicle::V1::RuleService::Rest::Client::Configuration::Rpcs}
1328
+ # for a list of RPCs that can be configured independently.
1329
+ #
1330
+ # Configuration can be applied globally to all clients, or to a single client
1331
+ # on construction.
1332
+ #
1333
+ # @example
1334
+ #
1335
+ # # Modify the global config, setting the timeout for
1336
+ # # create_rule to 20 seconds,
1337
+ # # and all remaining timeouts to 10 seconds.
1338
+ # ::Google::Cloud::Chronicle::V1::RuleService::Rest::Client.configure do |config|
1339
+ # config.timeout = 10.0
1340
+ # config.rpcs.create_rule.timeout = 20.0
1341
+ # end
1342
+ #
1343
+ # # Apply the above configuration only to a new client.
1344
+ # client = ::Google::Cloud::Chronicle::V1::RuleService::Rest::Client.new do |config|
1345
+ # config.timeout = 10.0
1346
+ # config.rpcs.create_rule.timeout = 20.0
1347
+ # end
1348
+ #
1349
+ # @!attribute [rw] endpoint
1350
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1351
+ # nil, indicating to use the default endpoint in the current universe domain.
1352
+ # @return [::String,nil]
1353
+ # @!attribute [rw] credentials
1354
+ # Credentials to send with calls. You may provide any of the following types:
1355
+ # * (`String`) The path to a service account key file in JSON format
1356
+ # * (`Hash`) A service account key as a Hash
1357
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1358
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1359
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1360
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1361
+ # * (`nil`) indicating no credentials
1362
+ #
1363
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1364
+ # external source for authentication to Google Cloud, you must validate it before
1365
+ # providing it to a Google API client library. Providing an unvalidated credential
1366
+ # configuration to Google APIs can compromise the security of your systems and data.
1367
+ # For more information, refer to [Validate credential configurations from external
1368
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1369
+ # @return [::Object]
1370
+ # @!attribute [rw] scope
1371
+ # The OAuth scopes
1372
+ # @return [::Array<::String>]
1373
+ # @!attribute [rw] lib_name
1374
+ # The library name as recorded in instrumentation and logging
1375
+ # @return [::String]
1376
+ # @!attribute [rw] lib_version
1377
+ # The library version as recorded in instrumentation and logging
1378
+ # @return [::String]
1379
+ # @!attribute [rw] timeout
1380
+ # The call timeout in seconds.
1381
+ # @return [::Numeric]
1382
+ # @!attribute [rw] metadata
1383
+ # Additional headers to be sent with the call.
1384
+ # @return [::Hash{::Symbol=>::String}]
1385
+ # @!attribute [rw] retry_policy
1386
+ # The retry policy. The value is a hash with the following keys:
1387
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1388
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1389
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1390
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1391
+ # trigger a retry.
1392
+ # @return [::Hash]
1393
+ # @!attribute [rw] quota_project
1394
+ # A separate project against which to charge quota.
1395
+ # @return [::String]
1396
+ # @!attribute [rw] universe_domain
1397
+ # The universe domain within which to make requests. This determines the
1398
+ # default endpoint URL. The default value of nil uses the environment
1399
+ # universe (usually the default "googleapis.com" universe).
1400
+ # @return [::String,nil]
1401
+ # @!attribute [rw] logger
1402
+ # A custom logger to use for request/response debug logging, or the value
1403
+ # `:default` (the default) to construct a default logger, or `nil` to
1404
+ # explicitly disable logging.
1405
+ # @return [::Logger,:default,nil]
1406
+ #
1407
+ class Configuration
1408
+ extend ::Gapic::Config
1409
+
1410
+ # @private
1411
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1412
+ DEFAULT_ENDPOINT = "chronicle.googleapis.com"
1413
+
1414
+ config_attr :endpoint, nil, ::String, nil
1415
+ config_attr :credentials, nil do |value|
1416
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1417
+ allowed.any? { |klass| klass === value }
1418
+ end
1419
+ config_attr :scope, nil, ::String, ::Array, nil
1420
+ config_attr :lib_name, nil, ::String, nil
1421
+ config_attr :lib_version, nil, ::String, nil
1422
+ config_attr :timeout, nil, ::Numeric, nil
1423
+ config_attr :metadata, nil, ::Hash, nil
1424
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1425
+ config_attr :quota_project, nil, ::String, nil
1426
+ config_attr :universe_domain, nil, ::String, nil
1427
+ config_attr :logger, :default, ::Logger, nil, :default
1428
+
1429
+ # @private
1430
+ def initialize parent_config = nil
1431
+ @parent_config = parent_config unless parent_config.nil?
1432
+
1433
+ yield self if block_given?
1434
+ end
1435
+
1436
+ ##
1437
+ # Configurations for individual RPCs
1438
+ # @return [Rpcs]
1439
+ #
1440
+ def rpcs
1441
+ @rpcs ||= begin
1442
+ parent_rpcs = nil
1443
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1444
+ Rpcs.new parent_rpcs
1445
+ end
1446
+ end
1447
+
1448
+ ##
1449
+ # Configuration RPC class for the RuleService API.
1450
+ #
1451
+ # Includes fields providing the configuration for each RPC in this service.
1452
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1453
+ # the following configuration fields:
1454
+ #
1455
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1456
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1457
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1458
+ # include the following keys:
1459
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1460
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1461
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1462
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1463
+ # trigger a retry.
1464
+ #
1465
+ class Rpcs
1466
+ ##
1467
+ # RPC-specific configuration for `create_rule`
1468
+ # @return [::Gapic::Config::Method]
1469
+ #
1470
+ attr_reader :create_rule
1471
+ ##
1472
+ # RPC-specific configuration for `get_rule`
1473
+ # @return [::Gapic::Config::Method]
1474
+ #
1475
+ attr_reader :get_rule
1476
+ ##
1477
+ # RPC-specific configuration for `list_rules`
1478
+ # @return [::Gapic::Config::Method]
1479
+ #
1480
+ attr_reader :list_rules
1481
+ ##
1482
+ # RPC-specific configuration for `update_rule`
1483
+ # @return [::Gapic::Config::Method]
1484
+ #
1485
+ attr_reader :update_rule
1486
+ ##
1487
+ # RPC-specific configuration for `delete_rule`
1488
+ # @return [::Gapic::Config::Method]
1489
+ #
1490
+ attr_reader :delete_rule
1491
+ ##
1492
+ # RPC-specific configuration for `list_rule_revisions`
1493
+ # @return [::Gapic::Config::Method]
1494
+ #
1495
+ attr_reader :list_rule_revisions
1496
+ ##
1497
+ # RPC-specific configuration for `create_retrohunt`
1498
+ # @return [::Gapic::Config::Method]
1499
+ #
1500
+ attr_reader :create_retrohunt
1501
+ ##
1502
+ # RPC-specific configuration for `get_retrohunt`
1503
+ # @return [::Gapic::Config::Method]
1504
+ #
1505
+ attr_reader :get_retrohunt
1506
+ ##
1507
+ # RPC-specific configuration for `list_retrohunts`
1508
+ # @return [::Gapic::Config::Method]
1509
+ #
1510
+ attr_reader :list_retrohunts
1511
+ ##
1512
+ # RPC-specific configuration for `get_rule_deployment`
1513
+ # @return [::Gapic::Config::Method]
1514
+ #
1515
+ attr_reader :get_rule_deployment
1516
+ ##
1517
+ # RPC-specific configuration for `list_rule_deployments`
1518
+ # @return [::Gapic::Config::Method]
1519
+ #
1520
+ attr_reader :list_rule_deployments
1521
+ ##
1522
+ # RPC-specific configuration for `update_rule_deployment`
1523
+ # @return [::Gapic::Config::Method]
1524
+ #
1525
+ attr_reader :update_rule_deployment
1526
+
1527
+ # @private
1528
+ def initialize parent_rpcs = nil
1529
+ create_rule_config = parent_rpcs.create_rule if parent_rpcs.respond_to? :create_rule
1530
+ @create_rule = ::Gapic::Config::Method.new create_rule_config
1531
+ get_rule_config = parent_rpcs.get_rule if parent_rpcs.respond_to? :get_rule
1532
+ @get_rule = ::Gapic::Config::Method.new get_rule_config
1533
+ list_rules_config = parent_rpcs.list_rules if parent_rpcs.respond_to? :list_rules
1534
+ @list_rules = ::Gapic::Config::Method.new list_rules_config
1535
+ update_rule_config = parent_rpcs.update_rule if parent_rpcs.respond_to? :update_rule
1536
+ @update_rule = ::Gapic::Config::Method.new update_rule_config
1537
+ delete_rule_config = parent_rpcs.delete_rule if parent_rpcs.respond_to? :delete_rule
1538
+ @delete_rule = ::Gapic::Config::Method.new delete_rule_config
1539
+ list_rule_revisions_config = parent_rpcs.list_rule_revisions if parent_rpcs.respond_to? :list_rule_revisions
1540
+ @list_rule_revisions = ::Gapic::Config::Method.new list_rule_revisions_config
1541
+ create_retrohunt_config = parent_rpcs.create_retrohunt if parent_rpcs.respond_to? :create_retrohunt
1542
+ @create_retrohunt = ::Gapic::Config::Method.new create_retrohunt_config
1543
+ get_retrohunt_config = parent_rpcs.get_retrohunt if parent_rpcs.respond_to? :get_retrohunt
1544
+ @get_retrohunt = ::Gapic::Config::Method.new get_retrohunt_config
1545
+ list_retrohunts_config = parent_rpcs.list_retrohunts if parent_rpcs.respond_to? :list_retrohunts
1546
+ @list_retrohunts = ::Gapic::Config::Method.new list_retrohunts_config
1547
+ get_rule_deployment_config = parent_rpcs.get_rule_deployment if parent_rpcs.respond_to? :get_rule_deployment
1548
+ @get_rule_deployment = ::Gapic::Config::Method.new get_rule_deployment_config
1549
+ list_rule_deployments_config = parent_rpcs.list_rule_deployments if parent_rpcs.respond_to? :list_rule_deployments
1550
+ @list_rule_deployments = ::Gapic::Config::Method.new list_rule_deployments_config
1551
+ update_rule_deployment_config = parent_rpcs.update_rule_deployment if parent_rpcs.respond_to? :update_rule_deployment
1552
+ @update_rule_deployment = ::Gapic::Config::Method.new update_rule_deployment_config
1553
+
1554
+ yield self if block_given?
1555
+ end
1556
+ end
1557
+ end
1558
+ end
1559
+ end
1560
+ end
1561
+ end
1562
+ end
1563
+ end
1564
+ end