google-cloud-chronicle-v1 1.3.0 → 1.4.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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/chronicle/v1/entity_pb.rb +6 -1
  3. data/lib/google/cloud/chronicle/v1/event_pb.rb +24 -0
  4. data/lib/google/cloud/chronicle/v1/rest.rb +1 -0
  5. data/lib/google/cloud/chronicle/v1/search_pb.rb +64 -0
  6. data/lib/google/cloud/chronicle/v1/search_service/client.rb +643 -0
  7. data/lib/google/cloud/chronicle/v1/search_service/credentials.rb +49 -0
  8. data/lib/google/cloud/chronicle/v1/search_service/operations.rb +843 -0
  9. data/lib/google/cloud/chronicle/v1/search_service/paths.rb +94 -0
  10. data/lib/google/cloud/chronicle/v1/search_service/rest/client.rb +586 -0
  11. data/lib/google/cloud/chronicle/v1/search_service/rest/operations.rb +927 -0
  12. data/lib/google/cloud/chronicle/v1/search_service/rest/service_stub.rb +204 -0
  13. data/lib/google/cloud/chronicle/v1/search_service/rest.rb +53 -0
  14. data/lib/google/cloud/chronicle/v1/search_service.rb +56 -0
  15. data/lib/google/cloud/chronicle/v1/search_services_pb.rb +47 -0
  16. data/lib/google/cloud/chronicle/v1/simulated_data_pb.rb +21 -0
  17. data/lib/google/cloud/chronicle/v1/version.rb +1 -1
  18. data/lib/google/cloud/chronicle/v1.rb +1 -0
  19. data/proto_docs/backstory/collection.rb +371 -0
  20. data/proto_docs/backstory/data_access.rb +59 -0
  21. data/proto_docs/backstory/entity.rb +639 -0
  22. data/proto_docs/backstory/entity_risk.rb +98 -0
  23. data/proto_docs/backstory/id.rb +73 -0
  24. data/proto_docs/backstory/udm.rb +7008 -0
  25. data/proto_docs/google/cloud/chronicle/v1/entity.rb +38 -0
  26. data/proto_docs/google/cloud/chronicle/v1/event.rb +42 -0
  27. data/proto_docs/google/cloud/chronicle/v1/search.rb +593 -0
  28. data/proto_docs/google/cloud/chronicle/v1/simulated_data.rb +40 -0
  29. data/proto_docs/google/protobuf/struct.rb +108 -0
  30. data/proto_docs/google/type/latlng.rb +38 -0
  31. metadata +45 -1
@@ -0,0 +1,643 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/chronicle/v1/search_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Chronicle
25
+ module V1
26
+ module SearchService
27
+ ##
28
+ # Client for the SearchService service.
29
+ #
30
+ # SearchService provides methods for searching data in Chronicle.
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 :search_service_stub
43
+
44
+ ##
45
+ # Configure the SearchService Client class.
46
+ #
47
+ # See {::Google::Cloud::Chronicle::V1::SearchService::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all SearchService clients
53
+ # ::Google::Cloud::Chronicle::V1::SearchService::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.search.timeout = 60.0
74
+
75
+ default_config.rpcs.list_searched_results.timeout = 600.0
76
+ default_config.rpcs.list_searched_results.retry_policy = {
77
+ initial_delay: 1.0, max_delay: 600.0, multiplier: 1.3, retry_codes: [14]
78
+ }
79
+
80
+ default_config
81
+ end
82
+ yield @configure if block_given?
83
+ @configure
84
+ end
85
+
86
+ ##
87
+ # Configure the SearchService Client instance.
88
+ #
89
+ # The configuration is set to the derived mode, meaning that values can be changed,
90
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
91
+ # should be made on {Client.configure}.
92
+ #
93
+ # See {::Google::Cloud::Chronicle::V1::SearchService::Client::Configuration}
94
+ # for a description of the configuration fields.
95
+ #
96
+ # @yield [config] Configure the Client client.
97
+ # @yieldparam config [Client::Configuration]
98
+ #
99
+ # @return [Client::Configuration]
100
+ #
101
+ def configure
102
+ yield @config if block_given?
103
+ @config
104
+ end
105
+
106
+ ##
107
+ # The effective universe domain
108
+ #
109
+ # @return [String]
110
+ #
111
+ def universe_domain
112
+ @search_service_stub.universe_domain
113
+ end
114
+
115
+ ##
116
+ # Create a new SearchService client object.
117
+ #
118
+ # @example
119
+ #
120
+ # # Create a client using the default configuration
121
+ # client = ::Google::Cloud::Chronicle::V1::SearchService::Client.new
122
+ #
123
+ # # Create a client using a custom configuration
124
+ # client = ::Google::Cloud::Chronicle::V1::SearchService::Client.new do |config|
125
+ # config.timeout = 10.0
126
+ # end
127
+ #
128
+ # @yield [config] Configure the SearchService client.
129
+ # @yieldparam config [Client::Configuration]
130
+ #
131
+ def initialize
132
+ # These require statements are intentionally placed here to initialize
133
+ # the gRPC module only when it's required.
134
+ # See https://github.com/googleapis/toolkit/issues/446
135
+ require "gapic/grpc"
136
+ require "google/cloud/chronicle/v1/search_services_pb"
137
+
138
+ # Create the configuration object
139
+ @config = Configuration.new Client.configure
140
+
141
+ # Yield the configuration if needed
142
+ yield @config if block_given?
143
+
144
+ # Create credentials
145
+ credentials = @config.credentials
146
+ # Use self-signed JWT if the endpoint is unchanged from default,
147
+ # but only if the default endpoint does not have a region prefix.
148
+ enable_self_signed_jwt = @config.endpoint.nil? ||
149
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
150
+ !@config.endpoint.split(".").first.include?("-"))
151
+ credentials ||= Credentials.default scope: @config.scope,
152
+ enable_self_signed_jwt: enable_self_signed_jwt
153
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
154
+ credentials = Credentials.new credentials, scope: @config.scope
155
+ end
156
+ @quota_project_id = @config.quota_project
157
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
158
+
159
+ @operations_client = Operations.new do |config|
160
+ config.credentials = credentials
161
+ config.quota_project = @quota_project_id
162
+ config.endpoint = @config.endpoint
163
+ config.universe_domain = @config.universe_domain
164
+ end
165
+
166
+ @search_service_stub = ::Gapic::ServiceStub.new(
167
+ ::Google::Cloud::Chronicle::V1::SearchService::Stub,
168
+ credentials: credentials,
169
+ endpoint: @config.endpoint,
170
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
171
+ universe_domain: @config.universe_domain,
172
+ channel_args: @config.channel_args,
173
+ interceptors: @config.interceptors,
174
+ channel_pool_config: @config.channel_pool,
175
+ logger: @config.logger
176
+ )
177
+
178
+ @search_service_stub.stub_logger&.info do |entry|
179
+ entry.set_system_name
180
+ entry.set_service
181
+ entry.message = "Created client for #{entry.service}"
182
+ entry.set_credentials_fields credentials
183
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
184
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
185
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
186
+ end
187
+ end
188
+
189
+ ##
190
+ # Get the associated client for long-running operations.
191
+ #
192
+ # @return [::Google::Cloud::Chronicle::V1::SearchService::Operations]
193
+ #
194
+ attr_reader :operations_client
195
+
196
+ ##
197
+ # The logger used for request/response debug logging.
198
+ #
199
+ # @return [Logger]
200
+ #
201
+ def logger
202
+ @search_service_stub.logger
203
+ end
204
+
205
+ # Service calls
206
+
207
+ ##
208
+ # Initiates a long-running search operation.
209
+ #
210
+ # @overload search(request, options = nil)
211
+ # Pass arguments to `search` via a request object, either of type
212
+ # {::Google::Cloud::Chronicle::V1::SearchRequest} or an equivalent Hash.
213
+ #
214
+ # @param request [::Google::Cloud::Chronicle::V1::SearchRequest, ::Hash]
215
+ # A request object representing the call parameters. Required. To specify no
216
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
217
+ # @param options [::Gapic::CallOptions, ::Hash]
218
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
219
+ #
220
+ # @overload search(parent: nil, query: nil, time_range: nil, dialect: nil, draft_data_access_scope: nil, result_limit: nil, simulated_data_visibility: nil)
221
+ # Pass arguments to `search` via keyword arguments. Note that at
222
+ # least one keyword argument is required. To specify no parameters, or to keep all
223
+ # the default parameter values, pass an empty Hash as a request object (see above).
224
+ #
225
+ # @param parent [::String]
226
+ # Required. The resource name of the instance on which to perform the search.
227
+ # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
228
+ # @param query [::String]
229
+ # Required. The search query, in the dialect set in `dialect`.
230
+ # Example: 'ip=/172.*/ AND metadata.event_type!="NETWORK_CONNECTION" AND (
231
+ # target.ip = "3.225.179.73" OR target.ip = "23.47.48.70")'
232
+ # @param time_range [::Google::Type::Interval, ::Hash]
233
+ # Required. Time range to search for [Inclusive start time, exclusive end
234
+ # time).
235
+ # @param dialect [::Google::Cloud::Chronicle::V1::QueryDialect]
236
+ # Optional. Specifies the dialect the Search Query is written in. If not
237
+ # specified, the query will be parsed as YL2.
238
+ # @param draft_data_access_scope [::Google::Cloud::Chronicle::V1::DataAccessScope, ::Hash]
239
+ # Optional. Data access scope used to filter events. This is intended to be
240
+ # used by admins to preview in-development scopes. Should only be called by
241
+ # users with global access. If the caller does not have global access, the
242
+ # request will fail.
243
+ # @param result_limit [::Integer]
244
+ # Optional. Requested maximum number of rows to materialize. The service may
245
+ # return fewer. If unspecified, a server-side default of 10,000 is used. The
246
+ # maximum value is 1,000,000. Some dialects have a lower maximum; see
247
+ # `QueryDialect`.
248
+ # @param simulated_data_visibility [::Google::Cloud::Chronicle::V1::SimulatedDataVisibility]
249
+ # Optional. Specifies visibility of simulated data to include in search
250
+ # results.
251
+ #
252
+ # @yield [response, operation] Access the result along with the RPC operation
253
+ # @yieldparam response [::Gapic::Operation]
254
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
255
+ #
256
+ # @return [::Gapic::Operation]
257
+ #
258
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
259
+ #
260
+ # @example Basic example
261
+ # require "google/cloud/chronicle/v1"
262
+ #
263
+ # # Create a client object. The client can be reused for multiple calls.
264
+ # client = Google::Cloud::Chronicle::V1::SearchService::Client.new
265
+ #
266
+ # # Create a request. To set request fields, pass in keyword arguments.
267
+ # request = Google::Cloud::Chronicle::V1::SearchRequest.new
268
+ #
269
+ # # Call the search method.
270
+ # result = client.search request
271
+ #
272
+ # # The returned object is of type Gapic::Operation. You can use it to
273
+ # # check the status of an operation, cancel it, or wait for results.
274
+ # # Here is how to wait for a response.
275
+ # result.wait_until_done! timeout: 60
276
+ # if result.response?
277
+ # p result.response
278
+ # else
279
+ # puts "No response received."
280
+ # end
281
+ #
282
+ def search request, options = nil
283
+ raise ::ArgumentError, "request must be provided" if request.nil?
284
+
285
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::SearchRequest
286
+
287
+ # Converts hash and nil to an options object
288
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
289
+
290
+ # Customize the options with defaults
291
+ metadata = @config.rpcs.search.metadata.to_h
292
+
293
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
294
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
295
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
296
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION
297
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
298
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
299
+
300
+ header_params = {}
301
+ if request.parent
302
+ header_params["parent"] = request.parent
303
+ end
304
+
305
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
306
+ metadata[:"x-goog-request-params"] ||= request_params_header
307
+
308
+ options.apply_defaults timeout: @config.rpcs.search.timeout,
309
+ metadata: metadata,
310
+ retry_policy: @config.rpcs.search.retry_policy
311
+
312
+ options.apply_defaults timeout: @config.timeout,
313
+ metadata: @config.metadata,
314
+ retry_policy: @config.retry_policy
315
+
316
+ @search_service_stub.call_rpc :search, request, options: options do |response, operation|
317
+ response = ::Gapic::Operation.new response, @operations_client, options: options
318
+ yield response, operation if block_given?
319
+ throw :response, response
320
+ end
321
+ rescue ::GRPC::BadStatus => e
322
+ raise ::Google::Cloud::Error.from_error(e)
323
+ end
324
+
325
+ ##
326
+ # Retrieves results from a completed Search operation.
327
+ #
328
+ # @overload list_searched_results(request, options = nil)
329
+ # Pass arguments to `list_searched_results` via a request object, either of type
330
+ # {::Google::Cloud::Chronicle::V1::ListSearchedResultsRequest} or an equivalent Hash.
331
+ #
332
+ # @param request [::Google::Cloud::Chronicle::V1::ListSearchedResultsRequest, ::Hash]
333
+ # A request object representing the call parameters. Required. To specify no
334
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
335
+ # @param options [::Gapic::CallOptions, ::Hash]
336
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
337
+ #
338
+ # @overload list_searched_results(parent: nil, page_size: nil, page_token: nil, order_by: nil, skip: nil)
339
+ # Pass arguments to `list_searched_results` via keyword arguments. Note that at
340
+ # least one keyword argument is required. To specify no parameters, or to keep all
341
+ # the default parameter values, pass an empty Hash as a request object (see above).
342
+ #
343
+ # @param parent [::String]
344
+ # Required. The parent SearchSession resource name.
345
+ # Format:
346
+ # projects/\\{project}/locations/\\{location}/instances/\\{instance}/searchSessions/\\{search_session}
347
+ # @param page_size [::Integer]
348
+ # Optional. The maximum number of results to return. The service may return
349
+ # fewer. If unspecified, at most 100 results will be returned. The maximum
350
+ # value is 1000.
351
+ # @param page_token [::String]
352
+ # Optional. A page token, received from a previous `ListSearchedResults`
353
+ # call. Provide this to retrieve the subsequent page.
354
+ # @param order_by [::String]
355
+ # Optional. The column to sort the results on. Example: "event_timestamp
356
+ # desc", "principal.hostname asc". Multi-columnar sorting is not supported.
357
+ # @param skip [::Integer]
358
+ # Optional. The number of results to skip before starting to return results.
359
+ # This field should not be used in conjunction with page_token.
360
+ #
361
+ # @yield [response, operation] Access the result along with the RPC operation
362
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Chronicle::V1::SearchedResult>]
363
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
364
+ #
365
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Chronicle::V1::SearchedResult>]
366
+ #
367
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
368
+ #
369
+ # @example Basic example
370
+ # require "google/cloud/chronicle/v1"
371
+ #
372
+ # # Create a client object. The client can be reused for multiple calls.
373
+ # client = Google::Cloud::Chronicle::V1::SearchService::Client.new
374
+ #
375
+ # # Create a request. To set request fields, pass in keyword arguments.
376
+ # request = Google::Cloud::Chronicle::V1::ListSearchedResultsRequest.new
377
+ #
378
+ # # Call the list_searched_results method.
379
+ # result = client.list_searched_results request
380
+ #
381
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
382
+ # # over elements, and API calls will be issued to fetch pages as needed.
383
+ # result.each do |item|
384
+ # # Each element is of type ::Google::Cloud::Chronicle::V1::SearchedResult.
385
+ # p item
386
+ # end
387
+ #
388
+ def list_searched_results request, options = nil
389
+ raise ::ArgumentError, "request must be provided" if request.nil?
390
+
391
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListSearchedResultsRequest
392
+
393
+ # Converts hash and nil to an options object
394
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
395
+
396
+ # Customize the options with defaults
397
+ metadata = @config.rpcs.list_searched_results.metadata.to_h
398
+
399
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
400
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
401
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
402
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION
403
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
404
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
405
+
406
+ header_params = {}
407
+ if request.parent
408
+ header_params["parent"] = request.parent
409
+ end
410
+
411
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
412
+ metadata[:"x-goog-request-params"] ||= request_params_header
413
+
414
+ options.apply_defaults timeout: @config.rpcs.list_searched_results.timeout,
415
+ metadata: metadata,
416
+ retry_policy: @config.rpcs.list_searched_results.retry_policy
417
+
418
+ options.apply_defaults timeout: @config.timeout,
419
+ metadata: @config.metadata,
420
+ retry_policy: @config.retry_policy
421
+
422
+ @search_service_stub.call_rpc :list_searched_results, request, options: options do |response, operation|
423
+ response = ::Gapic::PagedEnumerable.new @search_service_stub, :list_searched_results, request, response, operation, options
424
+ yield response, operation if block_given?
425
+ throw :response, response
426
+ end
427
+ rescue ::GRPC::BadStatus => e
428
+ raise ::Google::Cloud::Error.from_error(e)
429
+ end
430
+
431
+ ##
432
+ # Configuration class for the SearchService API.
433
+ #
434
+ # This class represents the configuration for SearchService,
435
+ # providing control over timeouts, retry behavior, logging, transport
436
+ # parameters, and other low-level controls. Certain parameters can also be
437
+ # applied individually to specific RPCs. See
438
+ # {::Google::Cloud::Chronicle::V1::SearchService::Client::Configuration::Rpcs}
439
+ # for a list of RPCs that can be configured independently.
440
+ #
441
+ # Configuration can be applied globally to all clients, or to a single client
442
+ # on construction.
443
+ #
444
+ # @example
445
+ #
446
+ # # Modify the global config, setting the timeout for
447
+ # # search to 20 seconds,
448
+ # # and all remaining timeouts to 10 seconds.
449
+ # ::Google::Cloud::Chronicle::V1::SearchService::Client.configure do |config|
450
+ # config.timeout = 10.0
451
+ # config.rpcs.search.timeout = 20.0
452
+ # end
453
+ #
454
+ # # Apply the above configuration only to a new client.
455
+ # client = ::Google::Cloud::Chronicle::V1::SearchService::Client.new do |config|
456
+ # config.timeout = 10.0
457
+ # config.rpcs.search.timeout = 20.0
458
+ # end
459
+ #
460
+ # @!attribute [rw] endpoint
461
+ # A custom service endpoint, as a hostname or hostname:port. The default is
462
+ # nil, indicating to use the default endpoint in the current universe domain.
463
+ # @return [::String,nil]
464
+ # @!attribute [rw] credentials
465
+ # Credentials to send with calls. You may provide any of the following types:
466
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
467
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
468
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
469
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
470
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
471
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
472
+ # * (`nil`) indicating no credentials
473
+ #
474
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
475
+ # is deprecated. Providing an unvalidated credential configuration to
476
+ # Google APIs can compromise the security of your systems and data.
477
+ #
478
+ # @example
479
+ #
480
+ # # The recommended way to provide credentials is to use the `make_creds` method
481
+ # # on the appropriate credentials class for your environment.
482
+ #
483
+ # require "googleauth"
484
+ #
485
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
486
+ # json_key_io: ::File.open("/path/to/keyfile.json")
487
+ # )
488
+ #
489
+ # client = ::Google::Cloud::Chronicle::V1::SearchService::Client.new do |config|
490
+ # config.credentials = credentials
491
+ # end
492
+ #
493
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
494
+ # external source for authentication to Google Cloud, you must validate it before
495
+ # providing it to a Google API client library. Providing an unvalidated credential
496
+ # configuration to Google APIs can compromise the security of your systems and data.
497
+ # For more information, refer to [Validate credential configurations from external
498
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
499
+ # @return [::Object]
500
+ # @!attribute [rw] scope
501
+ # The OAuth scopes
502
+ # @return [::Array<::String>]
503
+ # @!attribute [rw] lib_name
504
+ # The library name as recorded in instrumentation and logging
505
+ # @return [::String]
506
+ # @!attribute [rw] lib_version
507
+ # The library version as recorded in instrumentation and logging
508
+ # @return [::String]
509
+ # @!attribute [rw] channel_args
510
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
511
+ # `GRPC::Core::Channel` object is provided as the credential.
512
+ # @return [::Hash]
513
+ # @!attribute [rw] interceptors
514
+ # An array of interceptors that are run before calls are executed.
515
+ # @return [::Array<::GRPC::ClientInterceptor>]
516
+ # @!attribute [rw] timeout
517
+ # The call timeout in seconds.
518
+ # @return [::Numeric]
519
+ # @!attribute [rw] metadata
520
+ # Additional gRPC headers to be sent with the call.
521
+ # @return [::Hash{::Symbol=>::String}]
522
+ # @!attribute [rw] retry_policy
523
+ # The retry policy. The value is a hash with the following keys:
524
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
525
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
526
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
527
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
528
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
529
+ # trigger a retry.
530
+ # @return [::Hash]
531
+ # @!attribute [rw] quota_project
532
+ # A separate project against which to charge quota.
533
+ # @return [::String]
534
+ # @!attribute [rw] universe_domain
535
+ # The universe domain within which to make requests. This determines the
536
+ # default endpoint URL. The default value of nil uses the environment
537
+ # universe (usually the default "googleapis.com" universe).
538
+ # @return [::String,nil]
539
+ # @!attribute [rw] logger
540
+ # A custom logger to use for request/response debug logging, or the value
541
+ # `:default` (the default) to construct a default logger, or `nil` to
542
+ # explicitly disable logging.
543
+ # @return [::Logger,:default,nil]
544
+ #
545
+ class Configuration
546
+ extend ::Gapic::Config
547
+
548
+ # @private
549
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
550
+ DEFAULT_ENDPOINT = "chronicle.googleapis.com"
551
+
552
+ config_attr :endpoint, nil, ::String, nil
553
+ config_attr :credentials, nil do |value|
554
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
555
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
556
+ allowed.any? { |klass| klass === value }
557
+ end
558
+ config_attr :scope, nil, ::String, ::Array, nil
559
+ config_attr :lib_name, nil, ::String, nil
560
+ config_attr :lib_version, nil, ::String, nil
561
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
562
+ config_attr :interceptors, nil, ::Array, nil
563
+ config_attr :timeout, nil, ::Numeric, nil
564
+ config_attr :metadata, nil, ::Hash, nil
565
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
566
+ config_attr :quota_project, nil, ::String, nil
567
+ config_attr :universe_domain, nil, ::String, nil
568
+ config_attr :logger, :default, ::Logger, nil, :default
569
+
570
+ # @private
571
+ def initialize parent_config = nil
572
+ @parent_config = parent_config unless parent_config.nil?
573
+
574
+ yield self if block_given?
575
+ end
576
+
577
+ ##
578
+ # Configurations for individual RPCs
579
+ # @return [Rpcs]
580
+ #
581
+ def rpcs
582
+ @rpcs ||= begin
583
+ parent_rpcs = nil
584
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
585
+ Rpcs.new parent_rpcs
586
+ end
587
+ end
588
+
589
+ ##
590
+ # Configuration for the channel pool
591
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
592
+ #
593
+ def channel_pool
594
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
595
+ end
596
+
597
+ ##
598
+ # Configuration RPC class for the SearchService API.
599
+ #
600
+ # Includes fields providing the configuration for each RPC in this service.
601
+ # Each configuration object is of type `Gapic::Config::Method` and includes
602
+ # the following configuration fields:
603
+ #
604
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
605
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
606
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
607
+ # include the following keys:
608
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
609
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
610
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
611
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
612
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
613
+ # trigger a retry.
614
+ #
615
+ class Rpcs
616
+ ##
617
+ # RPC-specific configuration for `search`
618
+ # @return [::Gapic::Config::Method]
619
+ #
620
+ attr_reader :search
621
+ ##
622
+ # RPC-specific configuration for `list_searched_results`
623
+ # @return [::Gapic::Config::Method]
624
+ #
625
+ attr_reader :list_searched_results
626
+
627
+ # @private
628
+ def initialize parent_rpcs = nil
629
+ search_config = parent_rpcs.search if parent_rpcs.respond_to? :search
630
+ @search = ::Gapic::Config::Method.new search_config
631
+ list_searched_results_config = parent_rpcs.list_searched_results if parent_rpcs.respond_to? :list_searched_results
632
+ @list_searched_results = ::Gapic::Config::Method.new list_searched_results_config
633
+
634
+ yield self if block_given?
635
+ end
636
+ end
637
+ end
638
+ end
639
+ end
640
+ end
641
+ end
642
+ end
643
+ end