google-cloud-chronicle-v1 0.5.0 → 0.7.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/AUTHENTICATION.md +4 -4
  3. data/README.md +5 -5
  4. data/lib/google/cloud/chronicle/v1/big_query_export_pb.rb +34 -0
  5. data/lib/google/cloud/chronicle/v1/big_query_export_service/client.rb +684 -0
  6. data/lib/google/cloud/chronicle/v1/big_query_export_service/credentials.rb +49 -0
  7. data/lib/google/cloud/chronicle/v1/big_query_export_service/paths.rb +71 -0
  8. data/lib/google/cloud/chronicle/v1/big_query_export_service/rest/client.rb +620 -0
  9. data/lib/google/cloud/chronicle/v1/big_query_export_service/rest/service_stub.rb +266 -0
  10. data/lib/google/cloud/chronicle/v1/big_query_export_service/rest.rb +52 -0
  11. data/lib/google/cloud/chronicle/v1/big_query_export_service.rb +55 -0
  12. data/lib/google/cloud/chronicle/v1/big_query_export_services_pb.rb +51 -0
  13. data/lib/google/cloud/chronicle/v1/dashboard_chart_pb.rb +83 -0
  14. data/lib/google/cloud/chronicle/v1/dashboard_chart_service/client.rb +586 -0
  15. data/lib/google/cloud/chronicle/v1/dashboard_chart_service/credentials.rb +49 -0
  16. data/lib/google/cloud/chronicle/v1/dashboard_chart_service/paths.rb +73 -0
  17. data/lib/google/cloud/chronicle/v1/dashboard_chart_service/rest/client.rb +529 -0
  18. data/lib/google/cloud/chronicle/v1/dashboard_chart_service/rest/service_stub.rb +203 -0
  19. data/lib/google/cloud/chronicle/v1/dashboard_chart_service/rest.rb +52 -0
  20. data/lib/google/cloud/chronicle/v1/dashboard_chart_service.rb +55 -0
  21. data/lib/google/cloud/chronicle/v1/dashboard_chart_services_pb.rb +47 -0
  22. data/lib/google/cloud/chronicle/v1/dashboard_query_pb.rb +58 -0
  23. data/lib/google/cloud/chronicle/v1/dashboard_query_service/client.rb +591 -0
  24. data/lib/google/cloud/chronicle/v1/dashboard_query_service/credentials.rb +49 -0
  25. data/lib/google/cloud/chronicle/v1/dashboard_query_service/paths.rb +94 -0
  26. data/lib/google/cloud/chronicle/v1/dashboard_query_service/rest/client.rb +534 -0
  27. data/lib/google/cloud/chronicle/v1/dashboard_query_service/rest/service_stub.rb +204 -0
  28. data/lib/google/cloud/chronicle/v1/dashboard_query_service/rest.rb +52 -0
  29. data/lib/google/cloud/chronicle/v1/dashboard_query_service.rb +55 -0
  30. data/lib/google/cloud/chronicle/v1/dashboard_query_services_pb.rb +47 -0
  31. data/lib/google/cloud/chronicle/v1/data_access_control_service/client.rb +2 -0
  32. data/lib/google/cloud/chronicle/v1/data_access_control_service/rest/client.rb +2 -0
  33. data/lib/google/cloud/chronicle/v1/data_table_service/client.rb +2 -0
  34. data/lib/google/cloud/chronicle/v1/data_table_service/rest/client.rb +2 -0
  35. data/lib/google/cloud/chronicle/v1/entity_service/client.rb +2 -0
  36. data/lib/google/cloud/chronicle/v1/entity_service/rest/client.rb +2 -0
  37. data/lib/google/cloud/chronicle/v1/featured_content_metadata_pb.rb +25 -0
  38. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_pb.rb +33 -0
  39. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/client.rb +719 -0
  40. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/credentials.rb +49 -0
  41. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/paths.rb +136 -0
  42. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest/client.rb +655 -0
  43. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest/service_stub.rb +265 -0
  44. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest.rb +53 -0
  45. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service.rb +56 -0
  46. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_services_pb.rb +50 -0
  47. data/lib/google/cloud/chronicle/v1/instance_service/client.rb +2 -0
  48. data/lib/google/cloud/chronicle/v1/instance_service/rest/client.rb +2 -0
  49. data/lib/google/cloud/chronicle/v1/native_dashboard_pb.rb +61 -0
  50. data/lib/google/cloud/chronicle/v1/native_dashboard_service/client.rb +1613 -0
  51. data/lib/google/cloud/chronicle/v1/native_dashboard_service/credentials.rb +49 -0
  52. data/lib/google/cloud/chronicle/v1/native_dashboard_service/paths.rb +115 -0
  53. data/lib/google/cloud/chronicle/v1/native_dashboard_service/rest/client.rb +1486 -0
  54. data/lib/google/cloud/chronicle/v1/native_dashboard_service/rest/service_stub.rb +822 -0
  55. data/lib/google/cloud/chronicle/v1/native_dashboard_service/rest.rb +52 -0
  56. data/lib/google/cloud/chronicle/v1/native_dashboard_service.rb +55 -0
  57. data/lib/google/cloud/chronicle/v1/native_dashboard_services_pb.rb +67 -0
  58. data/lib/google/cloud/chronicle/v1/reference_list_service/client.rb +2 -0
  59. data/lib/google/cloud/chronicle/v1/reference_list_service/rest/client.rb +2 -0
  60. data/lib/google/cloud/chronicle/v1/rest.rb +6 -1
  61. data/lib/google/cloud/chronicle/v1/rule_service/client.rb +2 -0
  62. data/lib/google/cloud/chronicle/v1/rule_service/operations.rb +2 -0
  63. data/lib/google/cloud/chronicle/v1/rule_service/rest/client.rb +2 -0
  64. data/lib/google/cloud/chronicle/v1/rule_service/rest/operations.rb +2 -0
  65. data/lib/google/cloud/chronicle/v1/version.rb +1 -1
  66. data/lib/google/cloud/chronicle/v1.rb +7 -2
  67. data/proto_docs/google/cloud/chronicle/v1/big_query_export.rb +142 -0
  68. data/proto_docs/google/cloud/chronicle/v1/dashboard_chart.rb +923 -0
  69. data/proto_docs/google/cloud/chronicle/v1/dashboard_query.rb +653 -0
  70. data/proto_docs/google/cloud/chronicle/v1/featured_content_metadata.rb +82 -0
  71. data/proto_docs/google/cloud/chronicle/v1/featured_content_native_dashboard.rb +141 -0
  72. data/proto_docs/google/cloud/chronicle/v1/native_dashboard.rb +502 -0
  73. data/proto_docs/google/type/date.rb +56 -0
  74. metadata +56 -3
@@ -0,0 +1,591 @@
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/dashboard_query_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Chronicle
25
+ module V1
26
+ module DashboardQueryService
27
+ ##
28
+ # Client for the DashboardQueryService service.
29
+ #
30
+ # A service providing functionality for managing dashboards' queries.
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 :dashboard_query_service_stub
43
+
44
+ ##
45
+ # Configure the DashboardQueryService Client class.
46
+ #
47
+ # See {::Google::Cloud::Chronicle::V1::DashboardQueryService::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all DashboardQueryService clients
53
+ # ::Google::Cloud::Chronicle::V1::DashboardQueryService::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_dashboard_query.timeout = 60.0
74
+ default_config.rpcs.get_dashboard_query.retry_policy = {
75
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
76
+ }
77
+
78
+ default_config.rpcs.execute_dashboard_query.timeout = 1800.0
79
+
80
+ default_config
81
+ end
82
+ yield @configure if block_given?
83
+ @configure
84
+ end
85
+
86
+ ##
87
+ # Configure the DashboardQueryService 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::DashboardQueryService::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
+ @dashboard_query_service_stub.universe_domain
113
+ end
114
+
115
+ ##
116
+ # Create a new DashboardQueryService client object.
117
+ #
118
+ # @example
119
+ #
120
+ # # Create a client using the default configuration
121
+ # client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new
122
+ #
123
+ # # Create a client using a custom configuration
124
+ # client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new do |config|
125
+ # config.timeout = 10.0
126
+ # end
127
+ #
128
+ # @yield [config] Configure the DashboardQueryService 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/dashboard_query_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
+ @dashboard_query_service_stub = ::Gapic::ServiceStub.new(
160
+ ::Google::Cloud::Chronicle::V1::DashboardQueryService::Stub,
161
+ credentials: credentials,
162
+ endpoint: @config.endpoint,
163
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
164
+ universe_domain: @config.universe_domain,
165
+ channel_args: @config.channel_args,
166
+ interceptors: @config.interceptors,
167
+ channel_pool_config: @config.channel_pool,
168
+ logger: @config.logger
169
+ )
170
+
171
+ @dashboard_query_service_stub.stub_logger&.info do |entry|
172
+ entry.set_system_name
173
+ entry.set_service
174
+ entry.message = "Created client for #{entry.service}"
175
+ entry.set_credentials_fields credentials
176
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
177
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
178
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
179
+ end
180
+ end
181
+
182
+ ##
183
+ # The logger used for request/response debug logging.
184
+ #
185
+ # @return [Logger]
186
+ #
187
+ def logger
188
+ @dashboard_query_service_stub.logger
189
+ end
190
+
191
+ # Service calls
192
+
193
+ ##
194
+ # Get a dashboard query.
195
+ #
196
+ # @overload get_dashboard_query(request, options = nil)
197
+ # Pass arguments to `get_dashboard_query` via a request object, either of type
198
+ # {::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest} or an equivalent Hash.
199
+ #
200
+ # @param request [::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest, ::Hash]
201
+ # A request object representing the call parameters. Required. To specify no
202
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
203
+ # @param options [::Gapic::CallOptions, ::Hash]
204
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
205
+ #
206
+ # @overload get_dashboard_query(name: nil)
207
+ # Pass arguments to `get_dashboard_query` via keyword arguments. Note that at
208
+ # least one keyword argument is required. To specify no parameters, or to keep all
209
+ # the default parameter values, pass an empty Hash as a request object (see above).
210
+ #
211
+ # @param name [::String]
212
+ # Required. The name of the dashboardQuery to retrieve.
213
+ # Format:
214
+ # projects/\\{project}/locations/\\{location}/instances/\\{instance}/dashboardQueries/\\{query}
215
+ #
216
+ # @yield [response, operation] Access the result along with the RPC operation
217
+ # @yieldparam response [::Google::Cloud::Chronicle::V1::DashboardQuery]
218
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
219
+ #
220
+ # @return [::Google::Cloud::Chronicle::V1::DashboardQuery]
221
+ #
222
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
223
+ #
224
+ # @example Basic example
225
+ # require "google/cloud/chronicle/v1"
226
+ #
227
+ # # Create a client object. The client can be reused for multiple calls.
228
+ # client = Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new
229
+ #
230
+ # # Create a request. To set request fields, pass in keyword arguments.
231
+ # request = Google::Cloud::Chronicle::V1::GetDashboardQueryRequest.new
232
+ #
233
+ # # Call the get_dashboard_query method.
234
+ # result = client.get_dashboard_query request
235
+ #
236
+ # # The returned object is of type Google::Cloud::Chronicle::V1::DashboardQuery.
237
+ # p result
238
+ #
239
+ def get_dashboard_query request, options = nil
240
+ raise ::ArgumentError, "request must be provided" if request.nil?
241
+
242
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetDashboardQueryRequest
243
+
244
+ # Converts hash and nil to an options object
245
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
246
+
247
+ # Customize the options with defaults
248
+ metadata = @config.rpcs.get_dashboard_query.metadata.to_h
249
+
250
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
251
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
252
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
253
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION
254
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
255
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
256
+
257
+ header_params = {}
258
+ if request.name
259
+ header_params["name"] = request.name
260
+ end
261
+
262
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
263
+ metadata[:"x-goog-request-params"] ||= request_params_header
264
+
265
+ options.apply_defaults timeout: @config.rpcs.get_dashboard_query.timeout,
266
+ metadata: metadata,
267
+ retry_policy: @config.rpcs.get_dashboard_query.retry_policy
268
+
269
+ options.apply_defaults timeout: @config.timeout,
270
+ metadata: @config.metadata,
271
+ retry_policy: @config.retry_policy
272
+
273
+ @dashboard_query_service_stub.call_rpc :get_dashboard_query, request, options: options do |response, operation|
274
+ yield response, operation if block_given?
275
+ end
276
+ rescue ::GRPC::BadStatus => e
277
+ raise ::Google::Cloud::Error.from_error(e)
278
+ end
279
+
280
+ ##
281
+ # Execute a query and return the data.
282
+ #
283
+ # @overload execute_dashboard_query(request, options = nil)
284
+ # Pass arguments to `execute_dashboard_query` via a request object, either of type
285
+ # {::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest} or an equivalent Hash.
286
+ #
287
+ # @param request [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest, ::Hash]
288
+ # A request object representing the call parameters. Required. To specify no
289
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
290
+ # @param options [::Gapic::CallOptions, ::Hash]
291
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
292
+ #
293
+ # @overload execute_dashboard_query(parent: nil, query: nil, filters: nil, clear_cache: nil, use_previous_time_range: nil)
294
+ # Pass arguments to `execute_dashboard_query` via keyword arguments. Note that at
295
+ # least one keyword argument is required. To specify no parameters, or to keep all
296
+ # the default parameter values, pass an empty Hash as a request object (see above).
297
+ #
298
+ # @param parent [::String]
299
+ # Required. The parent, under which to run this dashboardQuery.
300
+ # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
301
+ # @param query [::Google::Cloud::Chronicle::V1::DashboardQuery, ::Hash]
302
+ # Required. The query to execute and get results back for.
303
+ # QueryID or 'query', 'input.time_window' fields will be used. Use
304
+ # 'native_dashboard' and 'dashboard_chart' fields if it is an in-dashboard
305
+ # query.
306
+ # @param filters [::Array<::Google::Cloud::Chronicle::V1::DashboardFilter, ::Hash>]
307
+ # Optional. Dashboard level filters other than query string.
308
+ # @param clear_cache [::Boolean]
309
+ # Optional. When true, the backend would read from the database, rather than
310
+ # fetching data directly from the cache.
311
+ # @param use_previous_time_range [::Boolean]
312
+ # Optional. When true, the backend will execute the query against the
313
+ # previous time range of the query.
314
+ #
315
+ # @yield [response, operation] Access the result along with the RPC operation
316
+ # @yieldparam response [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse]
317
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
318
+ #
319
+ # @return [::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse]
320
+ #
321
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
322
+ #
323
+ # @example Basic example
324
+ # require "google/cloud/chronicle/v1"
325
+ #
326
+ # # Create a client object. The client can be reused for multiple calls.
327
+ # client = Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new
328
+ #
329
+ # # Create a request. To set request fields, pass in keyword arguments.
330
+ # request = Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest.new
331
+ #
332
+ # # Call the execute_dashboard_query method.
333
+ # result = client.execute_dashboard_query request
334
+ #
335
+ # # The returned object is of type Google::Cloud::Chronicle::V1::ExecuteDashboardQueryResponse.
336
+ # p result
337
+ #
338
+ def execute_dashboard_query request, options = nil
339
+ raise ::ArgumentError, "request must be provided" if request.nil?
340
+
341
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ExecuteDashboardQueryRequest
342
+
343
+ # Converts hash and nil to an options object
344
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
345
+
346
+ # Customize the options with defaults
347
+ metadata = @config.rpcs.execute_dashboard_query.metadata.to_h
348
+
349
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
350
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
351
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
352
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION
353
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
354
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
355
+
356
+ header_params = {}
357
+ if request.parent
358
+ header_params["parent"] = request.parent
359
+ end
360
+
361
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
362
+ metadata[:"x-goog-request-params"] ||= request_params_header
363
+
364
+ options.apply_defaults timeout: @config.rpcs.execute_dashboard_query.timeout,
365
+ metadata: metadata,
366
+ retry_policy: @config.rpcs.execute_dashboard_query.retry_policy
367
+
368
+ options.apply_defaults timeout: @config.timeout,
369
+ metadata: @config.metadata,
370
+ retry_policy: @config.retry_policy
371
+
372
+ @dashboard_query_service_stub.call_rpc :execute_dashboard_query, request, options: options do |response, operation|
373
+ yield response, operation if block_given?
374
+ end
375
+ rescue ::GRPC::BadStatus => e
376
+ raise ::Google::Cloud::Error.from_error(e)
377
+ end
378
+
379
+ ##
380
+ # Configuration class for the DashboardQueryService API.
381
+ #
382
+ # This class represents the configuration for DashboardQueryService,
383
+ # providing control over timeouts, retry behavior, logging, transport
384
+ # parameters, and other low-level controls. Certain parameters can also be
385
+ # applied individually to specific RPCs. See
386
+ # {::Google::Cloud::Chronicle::V1::DashboardQueryService::Client::Configuration::Rpcs}
387
+ # for a list of RPCs that can be configured independently.
388
+ #
389
+ # Configuration can be applied globally to all clients, or to a single client
390
+ # on construction.
391
+ #
392
+ # @example
393
+ #
394
+ # # Modify the global config, setting the timeout for
395
+ # # get_dashboard_query to 20 seconds,
396
+ # # and all remaining timeouts to 10 seconds.
397
+ # ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.configure do |config|
398
+ # config.timeout = 10.0
399
+ # config.rpcs.get_dashboard_query.timeout = 20.0
400
+ # end
401
+ #
402
+ # # Apply the above configuration only to a new client.
403
+ # client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new do |config|
404
+ # config.timeout = 10.0
405
+ # config.rpcs.get_dashboard_query.timeout = 20.0
406
+ # end
407
+ #
408
+ # @!attribute [rw] endpoint
409
+ # A custom service endpoint, as a hostname or hostname:port. The default is
410
+ # nil, indicating to use the default endpoint in the current universe domain.
411
+ # @return [::String,nil]
412
+ # @!attribute [rw] credentials
413
+ # Credentials to send with calls. You may provide any of the following types:
414
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
415
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
416
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
417
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
418
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
419
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
420
+ # * (`nil`) indicating no credentials
421
+ #
422
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
423
+ # is deprecated. Providing an unvalidated credential configuration to
424
+ # Google APIs can compromise the security of your systems and data.
425
+ #
426
+ # @example
427
+ #
428
+ # # The recommended way to provide credentials is to use the `make_creds` method
429
+ # # on the appropriate credentials class for your environment.
430
+ #
431
+ # require "googleauth"
432
+ #
433
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
434
+ # json_key_io: ::File.open("/path/to/keyfile.json")
435
+ # )
436
+ #
437
+ # client = ::Google::Cloud::Chronicle::V1::DashboardQueryService::Client.new do |config|
438
+ # config.credentials = credentials
439
+ # end
440
+ #
441
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
442
+ # external source for authentication to Google Cloud, you must validate it before
443
+ # providing it to a Google API client library. Providing an unvalidated credential
444
+ # configuration to Google APIs can compromise the security of your systems and data.
445
+ # For more information, refer to [Validate credential configurations from external
446
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
447
+ # @return [::Object]
448
+ # @!attribute [rw] scope
449
+ # The OAuth scopes
450
+ # @return [::Array<::String>]
451
+ # @!attribute [rw] lib_name
452
+ # The library name as recorded in instrumentation and logging
453
+ # @return [::String]
454
+ # @!attribute [rw] lib_version
455
+ # The library version as recorded in instrumentation and logging
456
+ # @return [::String]
457
+ # @!attribute [rw] channel_args
458
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
459
+ # `GRPC::Core::Channel` object is provided as the credential.
460
+ # @return [::Hash]
461
+ # @!attribute [rw] interceptors
462
+ # An array of interceptors that are run before calls are executed.
463
+ # @return [::Array<::GRPC::ClientInterceptor>]
464
+ # @!attribute [rw] timeout
465
+ # The call timeout in seconds.
466
+ # @return [::Numeric]
467
+ # @!attribute [rw] metadata
468
+ # Additional gRPC headers to be sent with the call.
469
+ # @return [::Hash{::Symbol=>::String}]
470
+ # @!attribute [rw] retry_policy
471
+ # The retry policy. The value is a hash with the following keys:
472
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
473
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
474
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
475
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
476
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
477
+ # trigger a retry.
478
+ # @return [::Hash]
479
+ # @!attribute [rw] quota_project
480
+ # A separate project against which to charge quota.
481
+ # @return [::String]
482
+ # @!attribute [rw] universe_domain
483
+ # The universe domain within which to make requests. This determines the
484
+ # default endpoint URL. The default value of nil uses the environment
485
+ # universe (usually the default "googleapis.com" universe).
486
+ # @return [::String,nil]
487
+ # @!attribute [rw] logger
488
+ # A custom logger to use for request/response debug logging, or the value
489
+ # `:default` (the default) to construct a default logger, or `nil` to
490
+ # explicitly disable logging.
491
+ # @return [::Logger,:default,nil]
492
+ #
493
+ class Configuration
494
+ extend ::Gapic::Config
495
+
496
+ # @private
497
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
498
+ DEFAULT_ENDPOINT = "chronicle.googleapis.com"
499
+
500
+ config_attr :endpoint, nil, ::String, nil
501
+ config_attr :credentials, nil do |value|
502
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
503
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
504
+ allowed.any? { |klass| klass === value }
505
+ end
506
+ config_attr :scope, nil, ::String, ::Array, nil
507
+ config_attr :lib_name, nil, ::String, nil
508
+ config_attr :lib_version, nil, ::String, nil
509
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
510
+ config_attr :interceptors, nil, ::Array, nil
511
+ config_attr :timeout, nil, ::Numeric, nil
512
+ config_attr :metadata, nil, ::Hash, nil
513
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
514
+ config_attr :quota_project, nil, ::String, nil
515
+ config_attr :universe_domain, nil, ::String, nil
516
+ config_attr :logger, :default, ::Logger, nil, :default
517
+
518
+ # @private
519
+ def initialize parent_config = nil
520
+ @parent_config = parent_config unless parent_config.nil?
521
+
522
+ yield self if block_given?
523
+ end
524
+
525
+ ##
526
+ # Configurations for individual RPCs
527
+ # @return [Rpcs]
528
+ #
529
+ def rpcs
530
+ @rpcs ||= begin
531
+ parent_rpcs = nil
532
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
533
+ Rpcs.new parent_rpcs
534
+ end
535
+ end
536
+
537
+ ##
538
+ # Configuration for the channel pool
539
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
540
+ #
541
+ def channel_pool
542
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
543
+ end
544
+
545
+ ##
546
+ # Configuration RPC class for the DashboardQueryService API.
547
+ #
548
+ # Includes fields providing the configuration for each RPC in this service.
549
+ # Each configuration object is of type `Gapic::Config::Method` and includes
550
+ # the following configuration fields:
551
+ #
552
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
553
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
554
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
555
+ # include the following keys:
556
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
557
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
558
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
559
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
560
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
561
+ # trigger a retry.
562
+ #
563
+ class Rpcs
564
+ ##
565
+ # RPC-specific configuration for `get_dashboard_query`
566
+ # @return [::Gapic::Config::Method]
567
+ #
568
+ attr_reader :get_dashboard_query
569
+ ##
570
+ # RPC-specific configuration for `execute_dashboard_query`
571
+ # @return [::Gapic::Config::Method]
572
+ #
573
+ attr_reader :execute_dashboard_query
574
+
575
+ # @private
576
+ def initialize parent_rpcs = nil
577
+ get_dashboard_query_config = parent_rpcs.get_dashboard_query if parent_rpcs.respond_to? :get_dashboard_query
578
+ @get_dashboard_query = ::Gapic::Config::Method.new get_dashboard_query_config
579
+ execute_dashboard_query_config = parent_rpcs.execute_dashboard_query if parent_rpcs.respond_to? :execute_dashboard_query
580
+ @execute_dashboard_query = ::Gapic::Config::Method.new execute_dashboard_query_config
581
+
582
+ yield self if block_given?
583
+ end
584
+ end
585
+ end
586
+ end
587
+ end
588
+ end
589
+ end
590
+ end
591
+ end
@@ -0,0 +1,49 @@
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 "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Chronicle
24
+ module V1
25
+ module DashboardQueryService
26
+ # Credentials for the DashboardQueryService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/chronicle",
30
+ "https://www.googleapis.com/auth/chronicle.readonly",
31
+ "https://www.googleapis.com/auth/cloud-platform"
32
+ ]
33
+ self.env_vars = [
34
+ "GOOGLE_CLOUD_CREDENTIALS",
35
+ "GOOGLE_CLOUD_KEYFILE",
36
+ "GCLOUD_KEYFILE",
37
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
38
+ "GOOGLE_CLOUD_KEYFILE_JSON",
39
+ "GCLOUD_KEYFILE_JSON"
40
+ ]
41
+ self.paths = [
42
+ "~/.config/google_cloud/application_default_credentials.json"
43
+ ]
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end