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,891 @@
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/entity_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Chronicle
25
+ module V1
26
+ module EntityService
27
+ ##
28
+ # Client for the EntityService service.
29
+ #
30
+ # EntityService contains apis for finding entities.
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 :entity_service_stub
43
+
44
+ ##
45
+ # Configure the EntityService Client class.
46
+ #
47
+ # See {::Google::Cloud::Chronicle::V1::EntityService::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all EntityService clients
53
+ # ::Google::Cloud::Chronicle::V1::EntityService::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.get_watchlist.timeout = 90.0
74
+ default_config.rpcs.get_watchlist.retry_policy = {
75
+ initial_delay: 1.0, max_delay: 90.0, multiplier: 1.3, retry_codes: [14]
76
+ }
77
+
78
+ default_config.rpcs.list_watchlists.timeout = 90.0
79
+ default_config.rpcs.list_watchlists.retry_policy = {
80
+ initial_delay: 1.0, max_delay: 90.0, multiplier: 1.3, retry_codes: [14]
81
+ }
82
+
83
+ default_config.rpcs.create_watchlist.timeout = 90.0
84
+
85
+ default_config.rpcs.update_watchlist.timeout = 90.0
86
+
87
+ default_config.rpcs.delete_watchlist.timeout = 90.0
88
+
89
+ default_config
90
+ end
91
+ yield @configure if block_given?
92
+ @configure
93
+ end
94
+
95
+ ##
96
+ # Configure the EntityService Client instance.
97
+ #
98
+ # The configuration is set to the derived mode, meaning that values can be changed,
99
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
100
+ # should be made on {Client.configure}.
101
+ #
102
+ # See {::Google::Cloud::Chronicle::V1::EntityService::Client::Configuration}
103
+ # for a description of the configuration fields.
104
+ #
105
+ # @yield [config] Configure the Client client.
106
+ # @yieldparam config [Client::Configuration]
107
+ #
108
+ # @return [Client::Configuration]
109
+ #
110
+ def configure
111
+ yield @config if block_given?
112
+ @config
113
+ end
114
+
115
+ ##
116
+ # The effective universe domain
117
+ #
118
+ # @return [String]
119
+ #
120
+ def universe_domain
121
+ @entity_service_stub.universe_domain
122
+ end
123
+
124
+ ##
125
+ # Create a new EntityService client object.
126
+ #
127
+ # @example
128
+ #
129
+ # # Create a client using the default configuration
130
+ # client = ::Google::Cloud::Chronicle::V1::EntityService::Client.new
131
+ #
132
+ # # Create a client using a custom configuration
133
+ # client = ::Google::Cloud::Chronicle::V1::EntityService::Client.new do |config|
134
+ # config.timeout = 10.0
135
+ # end
136
+ #
137
+ # @yield [config] Configure the EntityService client.
138
+ # @yieldparam config [Client::Configuration]
139
+ #
140
+ def initialize
141
+ # These require statements are intentionally placed here to initialize
142
+ # the gRPC module only when it's required.
143
+ # See https://github.com/googleapis/toolkit/issues/446
144
+ require "gapic/grpc"
145
+ require "google/cloud/chronicle/v1/entity_services_pb"
146
+
147
+ # Create the configuration object
148
+ @config = Configuration.new Client.configure
149
+
150
+ # Yield the configuration if needed
151
+ yield @config if block_given?
152
+
153
+ # Create credentials
154
+ credentials = @config.credentials
155
+ # Use self-signed JWT if the endpoint is unchanged from default,
156
+ # but only if the default endpoint does not have a region prefix.
157
+ enable_self_signed_jwt = @config.endpoint.nil? ||
158
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
159
+ !@config.endpoint.split(".").first.include?("-"))
160
+ credentials ||= Credentials.default scope: @config.scope,
161
+ enable_self_signed_jwt: enable_self_signed_jwt
162
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
163
+ credentials = Credentials.new credentials, scope: @config.scope
164
+ end
165
+ @quota_project_id = @config.quota_project
166
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
167
+
168
+ @entity_service_stub = ::Gapic::ServiceStub.new(
169
+ ::Google::Cloud::Chronicle::V1::EntityService::Stub,
170
+ credentials: credentials,
171
+ endpoint: @config.endpoint,
172
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
173
+ universe_domain: @config.universe_domain,
174
+ channel_args: @config.channel_args,
175
+ interceptors: @config.interceptors,
176
+ channel_pool_config: @config.channel_pool,
177
+ logger: @config.logger
178
+ )
179
+
180
+ @entity_service_stub.stub_logger&.info do |entry|
181
+ entry.set_system_name
182
+ entry.set_service
183
+ entry.message = "Created client for #{entry.service}"
184
+ entry.set_credentials_fields credentials
185
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
186
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
187
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
188
+ end
189
+ end
190
+
191
+ ##
192
+ # The logger used for request/response debug logging.
193
+ #
194
+ # @return [Logger]
195
+ #
196
+ def logger
197
+ @entity_service_stub.logger
198
+ end
199
+
200
+ # Service calls
201
+
202
+ ##
203
+ # Gets watchlist details for the given watchlist ID.
204
+ #
205
+ # @overload get_watchlist(request, options = nil)
206
+ # Pass arguments to `get_watchlist` via a request object, either of type
207
+ # {::Google::Cloud::Chronicle::V1::GetWatchlistRequest} or an equivalent Hash.
208
+ #
209
+ # @param request [::Google::Cloud::Chronicle::V1::GetWatchlistRequest, ::Hash]
210
+ # A request object representing the call parameters. Required. To specify no
211
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
212
+ # @param options [::Gapic::CallOptions, ::Hash]
213
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
214
+ #
215
+ # @overload get_watchlist(name: nil)
216
+ # Pass arguments to `get_watchlist` via keyword arguments. Note that at
217
+ # least one keyword argument is required. To specify no parameters, or to keep all
218
+ # the default parameter values, pass an empty Hash as a request object (see above).
219
+ #
220
+ # @param name [::String]
221
+ # Required. The parent, which owns this collection of watchlists.
222
+ # The name of the watchlist to retrieve.
223
+ # Format:
224
+ # `projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}`
225
+ #
226
+ # @yield [response, operation] Access the result along with the RPC operation
227
+ # @yieldparam response [::Google::Cloud::Chronicle::V1::Watchlist]
228
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
229
+ #
230
+ # @return [::Google::Cloud::Chronicle::V1::Watchlist]
231
+ #
232
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
233
+ #
234
+ # @example Basic example
235
+ # require "google/cloud/chronicle/v1"
236
+ #
237
+ # # Create a client object. The client can be reused for multiple calls.
238
+ # client = Google::Cloud::Chronicle::V1::EntityService::Client.new
239
+ #
240
+ # # Create a request. To set request fields, pass in keyword arguments.
241
+ # request = Google::Cloud::Chronicle::V1::GetWatchlistRequest.new
242
+ #
243
+ # # Call the get_watchlist method.
244
+ # result = client.get_watchlist request
245
+ #
246
+ # # The returned object is of type Google::Cloud::Chronicle::V1::Watchlist.
247
+ # p result
248
+ #
249
+ def get_watchlist request, options = nil
250
+ raise ::ArgumentError, "request must be provided" if request.nil?
251
+
252
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetWatchlistRequest
253
+
254
+ # Converts hash and nil to an options object
255
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
256
+
257
+ # Customize the options with defaults
258
+ metadata = @config.rpcs.get_watchlist.metadata.to_h
259
+
260
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
261
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
262
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
263
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION
264
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
265
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
266
+
267
+ header_params = {}
268
+ if request.name
269
+ header_params["name"] = request.name
270
+ end
271
+
272
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
273
+ metadata[:"x-goog-request-params"] ||= request_params_header
274
+
275
+ options.apply_defaults timeout: @config.rpcs.get_watchlist.timeout,
276
+ metadata: metadata,
277
+ retry_policy: @config.rpcs.get_watchlist.retry_policy
278
+
279
+ options.apply_defaults timeout: @config.timeout,
280
+ metadata: @config.metadata,
281
+ retry_policy: @config.retry_policy
282
+
283
+ @entity_service_stub.call_rpc :get_watchlist, request, options: options do |response, operation|
284
+ yield response, operation if block_given?
285
+ end
286
+ rescue ::GRPC::BadStatus => e
287
+ raise ::Google::Cloud::Error.from_error(e)
288
+ end
289
+
290
+ ##
291
+ # Lists all watchlists for the given instance.
292
+ #
293
+ # @overload list_watchlists(request, options = nil)
294
+ # Pass arguments to `list_watchlists` via a request object, either of type
295
+ # {::Google::Cloud::Chronicle::V1::ListWatchlistsRequest} or an equivalent Hash.
296
+ #
297
+ # @param request [::Google::Cloud::Chronicle::V1::ListWatchlistsRequest, ::Hash]
298
+ # A request object representing the call parameters. Required. To specify no
299
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
300
+ # @param options [::Gapic::CallOptions, ::Hash]
301
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
302
+ #
303
+ # @overload list_watchlists(parent: nil, page_size: nil, page_token: nil, filter: nil)
304
+ # Pass arguments to `list_watchlists` via keyword arguments. Note that at
305
+ # least one keyword argument is required. To specify no parameters, or to keep all
306
+ # the default parameter values, pass an empty Hash as a request object (see above).
307
+ #
308
+ # @param parent [::String]
309
+ # Required. The parent, which owns this collection of watchlists.
310
+ # Format: `projects/{project}/locations/{location}/instances/{instance}`
311
+ # @param page_size [::Integer]
312
+ # Optional. The maximum number of watchlists to return.
313
+ # The service may return fewer than this value.
314
+ # If unspecified, at most 200 watchlists will be returned.
315
+ # The maximum value is 200; values above 200 will be coerced to 200.
316
+ # @param page_token [::String]
317
+ # Optional. A page token, received from a previous `ListWatchlists` call.
318
+ # Provide this to retrieve the subsequent page.
319
+ #
320
+ # When paginating, all other parameters provided to
321
+ # `ListWatchlists` must match the call that provided the page
322
+ # token.
323
+ # @param filter [::String]
324
+ # Optional. Which watchlist to return in aip.dev/160 form.
325
+ # Currently, only the following filters are supported:
326
+ # - `watchlist_user_preferences.pinned=true`
327
+ # - `has_entity([ENTITY_INDICATOR],[ENTITY_TYPE])`
328
+ # - `has_entity([ENTITY_INDICATOR],[ENTITY_TYPE],[NAMESPACE])`
329
+ #
330
+ # @yield [response, operation] Access the result along with the RPC operation
331
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Chronicle::V1::Watchlist>]
332
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
333
+ #
334
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Chronicle::V1::Watchlist>]
335
+ #
336
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
337
+ #
338
+ # @example Basic example
339
+ # require "google/cloud/chronicle/v1"
340
+ #
341
+ # # Create a client object. The client can be reused for multiple calls.
342
+ # client = Google::Cloud::Chronicle::V1::EntityService::Client.new
343
+ #
344
+ # # Create a request. To set request fields, pass in keyword arguments.
345
+ # request = Google::Cloud::Chronicle::V1::ListWatchlistsRequest.new
346
+ #
347
+ # # Call the list_watchlists method.
348
+ # result = client.list_watchlists request
349
+ #
350
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
351
+ # # over elements, and API calls will be issued to fetch pages as needed.
352
+ # result.each do |item|
353
+ # # Each element is of type ::Google::Cloud::Chronicle::V1::Watchlist.
354
+ # p item
355
+ # end
356
+ #
357
+ def list_watchlists request, options = nil
358
+ raise ::ArgumentError, "request must be provided" if request.nil?
359
+
360
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListWatchlistsRequest
361
+
362
+ # Converts hash and nil to an options object
363
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
364
+
365
+ # Customize the options with defaults
366
+ metadata = @config.rpcs.list_watchlists.metadata.to_h
367
+
368
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
369
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
370
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
371
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION
372
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
373
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
374
+
375
+ header_params = {}
376
+ if request.parent
377
+ header_params["parent"] = request.parent
378
+ end
379
+
380
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
381
+ metadata[:"x-goog-request-params"] ||= request_params_header
382
+
383
+ options.apply_defaults timeout: @config.rpcs.list_watchlists.timeout,
384
+ metadata: metadata,
385
+ retry_policy: @config.rpcs.list_watchlists.retry_policy
386
+
387
+ options.apply_defaults timeout: @config.timeout,
388
+ metadata: @config.metadata,
389
+ retry_policy: @config.retry_policy
390
+
391
+ @entity_service_stub.call_rpc :list_watchlists, request, options: options do |response, operation|
392
+ response = ::Gapic::PagedEnumerable.new @entity_service_stub, :list_watchlists, request, response, operation, options
393
+ yield response, operation if block_given?
394
+ throw :response, response
395
+ end
396
+ rescue ::GRPC::BadStatus => e
397
+ raise ::Google::Cloud::Error.from_error(e)
398
+ end
399
+
400
+ ##
401
+ # Creates a watchlist for the given instance.
402
+ # Note that there can be at most 200 watchlists per instance.
403
+ #
404
+ # @overload create_watchlist(request, options = nil)
405
+ # Pass arguments to `create_watchlist` via a request object, either of type
406
+ # {::Google::Cloud::Chronicle::V1::CreateWatchlistRequest} or an equivalent Hash.
407
+ #
408
+ # @param request [::Google::Cloud::Chronicle::V1::CreateWatchlistRequest, ::Hash]
409
+ # A request object representing the call parameters. Required. To specify no
410
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
411
+ # @param options [::Gapic::CallOptions, ::Hash]
412
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
413
+ #
414
+ # @overload create_watchlist(parent: nil, watchlist_id: nil, watchlist: nil)
415
+ # Pass arguments to `create_watchlist` via keyword arguments. Note that at
416
+ # least one keyword argument is required. To specify no parameters, or to keep all
417
+ # the default parameter values, pass an empty Hash as a request object (see above).
418
+ #
419
+ # @param parent [::String]
420
+ # Required. The parent resource where this watchlist will be created.
421
+ # Format: `projects/{project}/locations/{location}/instances/{instance}`
422
+ # @param watchlist_id [::String]
423
+ # Optional. The ID to use for the watchlist,
424
+ # which will become the final component of the watchlist's resource name.
425
+ #
426
+ # This value should be 4-63 characters, and valid characters
427
+ # are /[a-z][0-9]-/.
428
+ # @param watchlist [::Google::Cloud::Chronicle::V1::Watchlist, ::Hash]
429
+ # Required. The watchlist to create.
430
+ #
431
+ # @yield [response, operation] Access the result along with the RPC operation
432
+ # @yieldparam response [::Google::Cloud::Chronicle::V1::Watchlist]
433
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
434
+ #
435
+ # @return [::Google::Cloud::Chronicle::V1::Watchlist]
436
+ #
437
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
438
+ #
439
+ # @example Basic example
440
+ # require "google/cloud/chronicle/v1"
441
+ #
442
+ # # Create a client object. The client can be reused for multiple calls.
443
+ # client = Google::Cloud::Chronicle::V1::EntityService::Client.new
444
+ #
445
+ # # Create a request. To set request fields, pass in keyword arguments.
446
+ # request = Google::Cloud::Chronicle::V1::CreateWatchlistRequest.new
447
+ #
448
+ # # Call the create_watchlist method.
449
+ # result = client.create_watchlist request
450
+ #
451
+ # # The returned object is of type Google::Cloud::Chronicle::V1::Watchlist.
452
+ # p result
453
+ #
454
+ def create_watchlist request, options = nil
455
+ raise ::ArgumentError, "request must be provided" if request.nil?
456
+
457
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::CreateWatchlistRequest
458
+
459
+ # Converts hash and nil to an options object
460
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
461
+
462
+ # Customize the options with defaults
463
+ metadata = @config.rpcs.create_watchlist.metadata.to_h
464
+
465
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
466
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
467
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
468
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION
469
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
470
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
471
+
472
+ header_params = {}
473
+ if request.parent
474
+ header_params["parent"] = request.parent
475
+ end
476
+
477
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
478
+ metadata[:"x-goog-request-params"] ||= request_params_header
479
+
480
+ options.apply_defaults timeout: @config.rpcs.create_watchlist.timeout,
481
+ metadata: metadata,
482
+ retry_policy: @config.rpcs.create_watchlist.retry_policy
483
+
484
+ options.apply_defaults timeout: @config.timeout,
485
+ metadata: @config.metadata,
486
+ retry_policy: @config.retry_policy
487
+
488
+ @entity_service_stub.call_rpc :create_watchlist, request, options: options do |response, operation|
489
+ yield response, operation if block_given?
490
+ end
491
+ rescue ::GRPC::BadStatus => e
492
+ raise ::Google::Cloud::Error.from_error(e)
493
+ end
494
+
495
+ ##
496
+ # Updates the watchlist for the given instance.
497
+ #
498
+ # @overload update_watchlist(request, options = nil)
499
+ # Pass arguments to `update_watchlist` via a request object, either of type
500
+ # {::Google::Cloud::Chronicle::V1::UpdateWatchlistRequest} or an equivalent Hash.
501
+ #
502
+ # @param request [::Google::Cloud::Chronicle::V1::UpdateWatchlistRequest, ::Hash]
503
+ # A request object representing the call parameters. Required. To specify no
504
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
505
+ # @param options [::Gapic::CallOptions, ::Hash]
506
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
507
+ #
508
+ # @overload update_watchlist(watchlist: nil, update_mask: nil)
509
+ # Pass arguments to `update_watchlist` via keyword arguments. Note that at
510
+ # least one keyword argument is required. To specify no parameters, or to keep all
511
+ # the default parameter values, pass an empty Hash as a request object (see above).
512
+ #
513
+ # @param watchlist [::Google::Cloud::Chronicle::V1::Watchlist, ::Hash]
514
+ # Required. The watchlist to update.
515
+ #
516
+ # The watchlist's `name` field is used to identify the watchlist to update.
517
+ # Format:
518
+ # `projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}`
519
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
520
+ # Optional. The list of fields to update.
521
+ #
522
+ # @yield [response, operation] Access the result along with the RPC operation
523
+ # @yieldparam response [::Google::Cloud::Chronicle::V1::Watchlist]
524
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
525
+ #
526
+ # @return [::Google::Cloud::Chronicle::V1::Watchlist]
527
+ #
528
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
529
+ #
530
+ # @example Basic example
531
+ # require "google/cloud/chronicle/v1"
532
+ #
533
+ # # Create a client object. The client can be reused for multiple calls.
534
+ # client = Google::Cloud::Chronicle::V1::EntityService::Client.new
535
+ #
536
+ # # Create a request. To set request fields, pass in keyword arguments.
537
+ # request = Google::Cloud::Chronicle::V1::UpdateWatchlistRequest.new
538
+ #
539
+ # # Call the update_watchlist method.
540
+ # result = client.update_watchlist request
541
+ #
542
+ # # The returned object is of type Google::Cloud::Chronicle::V1::Watchlist.
543
+ # p result
544
+ #
545
+ def update_watchlist request, options = nil
546
+ raise ::ArgumentError, "request must be provided" if request.nil?
547
+
548
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::UpdateWatchlistRequest
549
+
550
+ # Converts hash and nil to an options object
551
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
552
+
553
+ # Customize the options with defaults
554
+ metadata = @config.rpcs.update_watchlist.metadata.to_h
555
+
556
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
557
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
558
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
559
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION
560
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
561
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
562
+
563
+ header_params = {}
564
+ if request.watchlist&.name
565
+ header_params["watchlist.name"] = request.watchlist.name
566
+ end
567
+
568
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
569
+ metadata[:"x-goog-request-params"] ||= request_params_header
570
+
571
+ options.apply_defaults timeout: @config.rpcs.update_watchlist.timeout,
572
+ metadata: metadata,
573
+ retry_policy: @config.rpcs.update_watchlist.retry_policy
574
+
575
+ options.apply_defaults timeout: @config.timeout,
576
+ metadata: @config.metadata,
577
+ retry_policy: @config.retry_policy
578
+
579
+ @entity_service_stub.call_rpc :update_watchlist, request, options: options do |response, operation|
580
+ yield response, operation if block_given?
581
+ end
582
+ rescue ::GRPC::BadStatus => e
583
+ raise ::Google::Cloud::Error.from_error(e)
584
+ end
585
+
586
+ ##
587
+ # Deletes the watchlist for the given instance.
588
+ #
589
+ # @overload delete_watchlist(request, options = nil)
590
+ # Pass arguments to `delete_watchlist` via a request object, either of type
591
+ # {::Google::Cloud::Chronicle::V1::DeleteWatchlistRequest} or an equivalent Hash.
592
+ #
593
+ # @param request [::Google::Cloud::Chronicle::V1::DeleteWatchlistRequest, ::Hash]
594
+ # A request object representing the call parameters. Required. To specify no
595
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
596
+ # @param options [::Gapic::CallOptions, ::Hash]
597
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
598
+ #
599
+ # @overload delete_watchlist(name: nil, force: nil)
600
+ # Pass arguments to `delete_watchlist` via keyword arguments. Note that at
601
+ # least one keyword argument is required. To specify no parameters, or to keep all
602
+ # the default parameter values, pass an empty Hash as a request object (see above).
603
+ #
604
+ # @param name [::String]
605
+ # Required. The name of the watchlist to delete.
606
+ # Format:
607
+ # `projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}`
608
+ # @param force [::Boolean]
609
+ # Optional. If set to true, any entities under this watchlist will also be
610
+ # deleted. (Otherwise, the request will only work if the watchlist has no
611
+ # entities.)
612
+ #
613
+ # @yield [response, operation] Access the result along with the RPC operation
614
+ # @yieldparam response [::Google::Protobuf::Empty]
615
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
616
+ #
617
+ # @return [::Google::Protobuf::Empty]
618
+ #
619
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
620
+ #
621
+ # @example Basic example
622
+ # require "google/cloud/chronicle/v1"
623
+ #
624
+ # # Create a client object. The client can be reused for multiple calls.
625
+ # client = Google::Cloud::Chronicle::V1::EntityService::Client.new
626
+ #
627
+ # # Create a request. To set request fields, pass in keyword arguments.
628
+ # request = Google::Cloud::Chronicle::V1::DeleteWatchlistRequest.new
629
+ #
630
+ # # Call the delete_watchlist method.
631
+ # result = client.delete_watchlist request
632
+ #
633
+ # # The returned object is of type Google::Protobuf::Empty.
634
+ # p result
635
+ #
636
+ def delete_watchlist request, options = nil
637
+ raise ::ArgumentError, "request must be provided" if request.nil?
638
+
639
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::DeleteWatchlistRequest
640
+
641
+ # Converts hash and nil to an options object
642
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
643
+
644
+ # Customize the options with defaults
645
+ metadata = @config.rpcs.delete_watchlist.metadata.to_h
646
+
647
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
648
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
649
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
650
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION
651
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
652
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
653
+
654
+ header_params = {}
655
+ if request.name
656
+ header_params["name"] = request.name
657
+ end
658
+
659
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
660
+ metadata[:"x-goog-request-params"] ||= request_params_header
661
+
662
+ options.apply_defaults timeout: @config.rpcs.delete_watchlist.timeout,
663
+ metadata: metadata,
664
+ retry_policy: @config.rpcs.delete_watchlist.retry_policy
665
+
666
+ options.apply_defaults timeout: @config.timeout,
667
+ metadata: @config.metadata,
668
+ retry_policy: @config.retry_policy
669
+
670
+ @entity_service_stub.call_rpc :delete_watchlist, request, options: options do |response, operation|
671
+ yield response, operation if block_given?
672
+ end
673
+ rescue ::GRPC::BadStatus => e
674
+ raise ::Google::Cloud::Error.from_error(e)
675
+ end
676
+
677
+ ##
678
+ # Configuration class for the EntityService API.
679
+ #
680
+ # This class represents the configuration for EntityService,
681
+ # providing control over timeouts, retry behavior, logging, transport
682
+ # parameters, and other low-level controls. Certain parameters can also be
683
+ # applied individually to specific RPCs. See
684
+ # {::Google::Cloud::Chronicle::V1::EntityService::Client::Configuration::Rpcs}
685
+ # for a list of RPCs that can be configured independently.
686
+ #
687
+ # Configuration can be applied globally to all clients, or to a single client
688
+ # on construction.
689
+ #
690
+ # @example
691
+ #
692
+ # # Modify the global config, setting the timeout for
693
+ # # get_watchlist to 20 seconds,
694
+ # # and all remaining timeouts to 10 seconds.
695
+ # ::Google::Cloud::Chronicle::V1::EntityService::Client.configure do |config|
696
+ # config.timeout = 10.0
697
+ # config.rpcs.get_watchlist.timeout = 20.0
698
+ # end
699
+ #
700
+ # # Apply the above configuration only to a new client.
701
+ # client = ::Google::Cloud::Chronicle::V1::EntityService::Client.new do |config|
702
+ # config.timeout = 10.0
703
+ # config.rpcs.get_watchlist.timeout = 20.0
704
+ # end
705
+ #
706
+ # @!attribute [rw] endpoint
707
+ # A custom service endpoint, as a hostname or hostname:port. The default is
708
+ # nil, indicating to use the default endpoint in the current universe domain.
709
+ # @return [::String,nil]
710
+ # @!attribute [rw] credentials
711
+ # Credentials to send with calls. You may provide any of the following types:
712
+ # * (`String`) The path to a service account key file in JSON format
713
+ # * (`Hash`) A service account key as a Hash
714
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
715
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
716
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
717
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
718
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
719
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
720
+ # * (`nil`) indicating no credentials
721
+ #
722
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
723
+ # external source for authentication to Google Cloud, you must validate it before
724
+ # providing it to a Google API client library. Providing an unvalidated credential
725
+ # configuration to Google APIs can compromise the security of your systems and data.
726
+ # For more information, refer to [Validate credential configurations from external
727
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
728
+ # @return [::Object]
729
+ # @!attribute [rw] scope
730
+ # The OAuth scopes
731
+ # @return [::Array<::String>]
732
+ # @!attribute [rw] lib_name
733
+ # The library name as recorded in instrumentation and logging
734
+ # @return [::String]
735
+ # @!attribute [rw] lib_version
736
+ # The library version as recorded in instrumentation and logging
737
+ # @return [::String]
738
+ # @!attribute [rw] channel_args
739
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
740
+ # `GRPC::Core::Channel` object is provided as the credential.
741
+ # @return [::Hash]
742
+ # @!attribute [rw] interceptors
743
+ # An array of interceptors that are run before calls are executed.
744
+ # @return [::Array<::GRPC::ClientInterceptor>]
745
+ # @!attribute [rw] timeout
746
+ # The call timeout in seconds.
747
+ # @return [::Numeric]
748
+ # @!attribute [rw] metadata
749
+ # Additional gRPC headers to be sent with the call.
750
+ # @return [::Hash{::Symbol=>::String}]
751
+ # @!attribute [rw] retry_policy
752
+ # The retry policy. The value is a hash with the following keys:
753
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
754
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
755
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
756
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
757
+ # trigger a retry.
758
+ # @return [::Hash]
759
+ # @!attribute [rw] quota_project
760
+ # A separate project against which to charge quota.
761
+ # @return [::String]
762
+ # @!attribute [rw] universe_domain
763
+ # The universe domain within which to make requests. This determines the
764
+ # default endpoint URL. The default value of nil uses the environment
765
+ # universe (usually the default "googleapis.com" universe).
766
+ # @return [::String,nil]
767
+ # @!attribute [rw] logger
768
+ # A custom logger to use for request/response debug logging, or the value
769
+ # `:default` (the default) to construct a default logger, or `nil` to
770
+ # explicitly disable logging.
771
+ # @return [::Logger,:default,nil]
772
+ #
773
+ class Configuration
774
+ extend ::Gapic::Config
775
+
776
+ # @private
777
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
778
+ DEFAULT_ENDPOINT = "chronicle.googleapis.com"
779
+
780
+ config_attr :endpoint, nil, ::String, nil
781
+ config_attr :credentials, nil do |value|
782
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
783
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
784
+ allowed.any? { |klass| klass === value }
785
+ end
786
+ config_attr :scope, nil, ::String, ::Array, nil
787
+ config_attr :lib_name, nil, ::String, nil
788
+ config_attr :lib_version, nil, ::String, nil
789
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
790
+ config_attr :interceptors, nil, ::Array, nil
791
+ config_attr :timeout, nil, ::Numeric, nil
792
+ config_attr :metadata, nil, ::Hash, nil
793
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
794
+ config_attr :quota_project, nil, ::String, nil
795
+ config_attr :universe_domain, nil, ::String, nil
796
+ config_attr :logger, :default, ::Logger, nil, :default
797
+
798
+ # @private
799
+ def initialize parent_config = nil
800
+ @parent_config = parent_config unless parent_config.nil?
801
+
802
+ yield self if block_given?
803
+ end
804
+
805
+ ##
806
+ # Configurations for individual RPCs
807
+ # @return [Rpcs]
808
+ #
809
+ def rpcs
810
+ @rpcs ||= begin
811
+ parent_rpcs = nil
812
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
813
+ Rpcs.new parent_rpcs
814
+ end
815
+ end
816
+
817
+ ##
818
+ # Configuration for the channel pool
819
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
820
+ #
821
+ def channel_pool
822
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
823
+ end
824
+
825
+ ##
826
+ # Configuration RPC class for the EntityService API.
827
+ #
828
+ # Includes fields providing the configuration for each RPC in this service.
829
+ # Each configuration object is of type `Gapic::Config::Method` and includes
830
+ # the following configuration fields:
831
+ #
832
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
833
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
834
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
835
+ # include the following keys:
836
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
837
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
838
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
839
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
840
+ # trigger a retry.
841
+ #
842
+ class Rpcs
843
+ ##
844
+ # RPC-specific configuration for `get_watchlist`
845
+ # @return [::Gapic::Config::Method]
846
+ #
847
+ attr_reader :get_watchlist
848
+ ##
849
+ # RPC-specific configuration for `list_watchlists`
850
+ # @return [::Gapic::Config::Method]
851
+ #
852
+ attr_reader :list_watchlists
853
+ ##
854
+ # RPC-specific configuration for `create_watchlist`
855
+ # @return [::Gapic::Config::Method]
856
+ #
857
+ attr_reader :create_watchlist
858
+ ##
859
+ # RPC-specific configuration for `update_watchlist`
860
+ # @return [::Gapic::Config::Method]
861
+ #
862
+ attr_reader :update_watchlist
863
+ ##
864
+ # RPC-specific configuration for `delete_watchlist`
865
+ # @return [::Gapic::Config::Method]
866
+ #
867
+ attr_reader :delete_watchlist
868
+
869
+ # @private
870
+ def initialize parent_rpcs = nil
871
+ get_watchlist_config = parent_rpcs.get_watchlist if parent_rpcs.respond_to? :get_watchlist
872
+ @get_watchlist = ::Gapic::Config::Method.new get_watchlist_config
873
+ list_watchlists_config = parent_rpcs.list_watchlists if parent_rpcs.respond_to? :list_watchlists
874
+ @list_watchlists = ::Gapic::Config::Method.new list_watchlists_config
875
+ create_watchlist_config = parent_rpcs.create_watchlist if parent_rpcs.respond_to? :create_watchlist
876
+ @create_watchlist = ::Gapic::Config::Method.new create_watchlist_config
877
+ update_watchlist_config = parent_rpcs.update_watchlist if parent_rpcs.respond_to? :update_watchlist
878
+ @update_watchlist = ::Gapic::Config::Method.new update_watchlist_config
879
+ delete_watchlist_config = parent_rpcs.delete_watchlist if parent_rpcs.respond_to? :delete_watchlist
880
+ @delete_watchlist = ::Gapic::Config::Method.new delete_watchlist_config
881
+
882
+ yield self if block_given?
883
+ end
884
+ end
885
+ end
886
+ end
887
+ end
888
+ end
889
+ end
890
+ end
891
+ end