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