google-cloud-chronicle-v1 0.4.0 → 0.6.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 (71) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +4 -4
  3. data/README.md +6 -6
  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 +682 -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 +618 -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 +584 -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 +527 -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 +589 -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 +532 -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_table_pb.rb +57 -0
  32. data/lib/google/cloud/chronicle/v1/data_table_service/client.rb +1915 -0
  33. data/lib/google/cloud/chronicle/v1/data_table_service/credentials.rb +49 -0
  34. data/lib/google/cloud/chronicle/v1/data_table_service/paths.rb +138 -0
  35. data/lib/google/cloud/chronicle/v1/data_table_service/rest/client.rb +1767 -0
  36. data/lib/google/cloud/chronicle/v1/data_table_service/rest/service_stub.rb +1004 -0
  37. data/lib/google/cloud/chronicle/v1/data_table_service/rest.rb +52 -0
  38. data/lib/google/cloud/chronicle/v1/data_table_service.rb +55 -0
  39. data/lib/google/cloud/chronicle/v1/data_table_services_pb.rb +73 -0
  40. data/lib/google/cloud/chronicle/v1/featured_content_metadata_pb.rb +25 -0
  41. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_pb.rb +33 -0
  42. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/client.rb +717 -0
  43. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/credentials.rb +49 -0
  44. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/paths.rb +136 -0
  45. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest/client.rb +653 -0
  46. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest/service_stub.rb +265 -0
  47. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service/rest.rb +53 -0
  48. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_service.rb +56 -0
  49. data/lib/google/cloud/chronicle/v1/featured_content_native_dashboard_services_pb.rb +50 -0
  50. data/lib/google/cloud/chronicle/v1/native_dashboard_pb.rb +61 -0
  51. data/lib/google/cloud/chronicle/v1/native_dashboard_service/client.rb +1611 -0
  52. data/lib/google/cloud/chronicle/v1/native_dashboard_service/credentials.rb +49 -0
  53. data/lib/google/cloud/chronicle/v1/native_dashboard_service/paths.rb +115 -0
  54. data/lib/google/cloud/chronicle/v1/native_dashboard_service/rest/client.rb +1484 -0
  55. data/lib/google/cloud/chronicle/v1/native_dashboard_service/rest/service_stub.rb +822 -0
  56. data/lib/google/cloud/chronicle/v1/native_dashboard_service/rest.rb +52 -0
  57. data/lib/google/cloud/chronicle/v1/native_dashboard_service.rb +55 -0
  58. data/lib/google/cloud/chronicle/v1/native_dashboard_services_pb.rb +67 -0
  59. data/lib/google/cloud/chronicle/v1/rest.rb +7 -1
  60. data/lib/google/cloud/chronicle/v1/version.rb +1 -1
  61. data/lib/google/cloud/chronicle/v1.rb +8 -2
  62. data/proto_docs/google/api/client.rb +149 -29
  63. data/proto_docs/google/cloud/chronicle/v1/big_query_export.rb +142 -0
  64. data/proto_docs/google/cloud/chronicle/v1/dashboard_chart.rb +923 -0
  65. data/proto_docs/google/cloud/chronicle/v1/dashboard_query.rb +653 -0
  66. data/proto_docs/google/cloud/chronicle/v1/data_table.rb +512 -0
  67. data/proto_docs/google/cloud/chronicle/v1/featured_content_metadata.rb +82 -0
  68. data/proto_docs/google/cloud/chronicle/v1/featured_content_native_dashboard.rb +141 -0
  69. data/proto_docs/google/cloud/chronicle/v1/native_dashboard.rb +502 -0
  70. data/proto_docs/google/type/date.rb +56 -0
  71. metadata +71 -9
@@ -0,0 +1,73 @@
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
+
20
+ module Google
21
+ module Cloud
22
+ module Chronicle
23
+ module V1
24
+ module DashboardChartService
25
+ # Path helper methods for the DashboardChartService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified DashboardChart resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/instances/{instance}/dashboardCharts/{chart}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param instance [String]
37
+ # @param chart [String]
38
+ #
39
+ # @return [::String]
40
+ def dashboard_chart_path project:, location:, instance:, chart:
41
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
42
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
43
+ raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/"
44
+
45
+ "projects/#{project}/locations/#{location}/instances/#{instance}/dashboardCharts/#{chart}"
46
+ end
47
+
48
+ ##
49
+ # Create a fully-qualified Instance resource string.
50
+ #
51
+ # The resource will be in the following format:
52
+ #
53
+ # `projects/{project}/locations/{location}/instances/{instance}`
54
+ #
55
+ # @param project [String]
56
+ # @param location [String]
57
+ # @param instance [String]
58
+ #
59
+ # @return [::String]
60
+ def instance_path project:, location:, instance:
61
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
62
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
63
+
64
+ "projects/#{project}/locations/#{location}/instances/#{instance}"
65
+ end
66
+
67
+ extend self
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,527 @@
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_chart_pb"
21
+ require "google/cloud/chronicle/v1/dashboard_chart_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Chronicle
26
+ module V1
27
+ module DashboardChartService
28
+ module Rest
29
+ ##
30
+ # REST client for the DashboardChartService service.
31
+ #
32
+ # A service providing functionality for managing dashboards' charts.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "chronicle.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :dashboard_chart_service_stub
45
+
46
+ ##
47
+ # Configure the DashboardChartService Client class.
48
+ #
49
+ # See {::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all DashboardChartService clients
55
+ # ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "Chronicle", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.rpcs.get_dashboard_chart.timeout = 60.0
76
+ default_config.rpcs.get_dashboard_chart.retry_policy = {
77
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
78
+ }
79
+
80
+ default_config.rpcs.batch_get_dashboard_charts.timeout = 60.0
81
+ default_config.rpcs.batch_get_dashboard_charts.retry_policy = {
82
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
83
+ }
84
+
85
+ default_config
86
+ end
87
+ yield @configure if block_given?
88
+ @configure
89
+ end
90
+
91
+ ##
92
+ # Configure the DashboardChartService Client instance.
93
+ #
94
+ # The configuration is set to the derived mode, meaning that values can be changed,
95
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
96
+ # should be made on {Client.configure}.
97
+ #
98
+ # See {::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client::Configuration}
99
+ # for a description of the configuration fields.
100
+ #
101
+ # @yield [config] Configure the Client client.
102
+ # @yieldparam config [Client::Configuration]
103
+ #
104
+ # @return [Client::Configuration]
105
+ #
106
+ def configure
107
+ yield @config if block_given?
108
+ @config
109
+ end
110
+
111
+ ##
112
+ # The effective universe domain
113
+ #
114
+ # @return [String]
115
+ #
116
+ def universe_domain
117
+ @dashboard_chart_service_stub.universe_domain
118
+ end
119
+
120
+ ##
121
+ # Create a new DashboardChartService REST client object.
122
+ #
123
+ # @example
124
+ #
125
+ # # Create a client using the default configuration
126
+ # client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.new
127
+ #
128
+ # # Create a client using a custom configuration
129
+ # client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.new do |config|
130
+ # config.timeout = 10.0
131
+ # end
132
+ #
133
+ # @yield [config] Configure the DashboardChartService client.
134
+ # @yieldparam config [Client::Configuration]
135
+ #
136
+ def initialize
137
+ # Create the configuration object
138
+ @config = Configuration.new Client.configure
139
+
140
+ # Yield the configuration if needed
141
+ yield @config if block_given?
142
+
143
+ # Create credentials
144
+ credentials = @config.credentials
145
+ # Use self-signed JWT if the endpoint is unchanged from default,
146
+ # but only if the default endpoint does not have a region prefix.
147
+ enable_self_signed_jwt = @config.endpoint.nil? ||
148
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
149
+ !@config.endpoint.split(".").first.include?("-"))
150
+ credentials ||= Credentials.default scope: @config.scope,
151
+ enable_self_signed_jwt: enable_self_signed_jwt
152
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
153
+ credentials = Credentials.new credentials, scope: @config.scope
154
+ end
155
+
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_chart_service_stub = ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::ServiceStub.new(
160
+ endpoint: @config.endpoint,
161
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
162
+ universe_domain: @config.universe_domain,
163
+ credentials: credentials,
164
+ logger: @config.logger
165
+ )
166
+
167
+ @dashboard_chart_service_stub.logger(stub: true)&.info do |entry|
168
+ entry.set_system_name
169
+ entry.set_service
170
+ entry.message = "Created client for #{entry.service}"
171
+ entry.set_credentials_fields credentials
172
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
173
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
174
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
175
+ end
176
+ end
177
+
178
+ ##
179
+ # The logger used for request/response debug logging.
180
+ #
181
+ # @return [Logger]
182
+ #
183
+ def logger
184
+ @dashboard_chart_service_stub.logger
185
+ end
186
+
187
+ # Service calls
188
+
189
+ ##
190
+ # Get a dashboard chart.
191
+ #
192
+ # @overload get_dashboard_chart(request, options = nil)
193
+ # Pass arguments to `get_dashboard_chart` via a request object, either of type
194
+ # {::Google::Cloud::Chronicle::V1::GetDashboardChartRequest} or an equivalent Hash.
195
+ #
196
+ # @param request [::Google::Cloud::Chronicle::V1::GetDashboardChartRequest, ::Hash]
197
+ # A request object representing the call parameters. Required. To specify no
198
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
199
+ # @param options [::Gapic::CallOptions, ::Hash]
200
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
201
+ #
202
+ # @overload get_dashboard_chart(name: nil)
203
+ # Pass arguments to `get_dashboard_chart` via keyword arguments. Note that at
204
+ # least one keyword argument is required. To specify no parameters, or to keep all
205
+ # the default parameter values, pass an empty Hash as a request object (see above).
206
+ #
207
+ # @param name [::String]
208
+ # Required. The name of the dashboardChart to retrieve.
209
+ # Format:
210
+ # projects/\\{project}/locations/\\{location}/instances/\\{instance}/dashboardCharts/\\{chart}
211
+ # @yield [result, operation] Access the result along with the TransportOperation object
212
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::DashboardChart]
213
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
214
+ #
215
+ # @return [::Google::Cloud::Chronicle::V1::DashboardChart]
216
+ #
217
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
218
+ #
219
+ # @example Basic example
220
+ # require "google/cloud/chronicle/v1"
221
+ #
222
+ # # Create a client object. The client can be reused for multiple calls.
223
+ # client = Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.new
224
+ #
225
+ # # Create a request. To set request fields, pass in keyword arguments.
226
+ # request = Google::Cloud::Chronicle::V1::GetDashboardChartRequest.new
227
+ #
228
+ # # Call the get_dashboard_chart method.
229
+ # result = client.get_dashboard_chart request
230
+ #
231
+ # # The returned object is of type Google::Cloud::Chronicle::V1::DashboardChart.
232
+ # p result
233
+ #
234
+ def get_dashboard_chart request, options = nil
235
+ raise ::ArgumentError, "request must be provided" if request.nil?
236
+
237
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetDashboardChartRequest
238
+
239
+ # Converts hash and nil to an options object
240
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
241
+
242
+ # Customize the options with defaults
243
+ call_metadata = @config.rpcs.get_dashboard_chart.metadata.to_h
244
+
245
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
246
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
247
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
248
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
249
+ transports_version_send: [:rest]
250
+
251
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
252
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
253
+
254
+ options.apply_defaults timeout: @config.rpcs.get_dashboard_chart.timeout,
255
+ metadata: call_metadata,
256
+ retry_policy: @config.rpcs.get_dashboard_chart.retry_policy
257
+
258
+ options.apply_defaults timeout: @config.timeout,
259
+ metadata: @config.metadata,
260
+ retry_policy: @config.retry_policy
261
+
262
+ @dashboard_chart_service_stub.get_dashboard_chart request, options do |result, operation|
263
+ yield result, operation if block_given?
264
+ end
265
+ rescue ::Gapic::Rest::Error => e
266
+ raise ::Google::Cloud::Error.from_error(e)
267
+ end
268
+
269
+ ##
270
+ # Get dashboard charts in batches.
271
+ #
272
+ # @overload batch_get_dashboard_charts(request, options = nil)
273
+ # Pass arguments to `batch_get_dashboard_charts` via a request object, either of type
274
+ # {::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest} or an equivalent Hash.
275
+ #
276
+ # @param request [::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest, ::Hash]
277
+ # A request object representing the call parameters. Required. To specify no
278
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
279
+ # @param options [::Gapic::CallOptions, ::Hash]
280
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
281
+ #
282
+ # @overload batch_get_dashboard_charts(parent: nil, names: nil)
283
+ # Pass arguments to `batch_get_dashboard_charts` via keyword arguments. Note that at
284
+ # least one keyword argument is required. To specify no parameters, or to keep all
285
+ # the default parameter values, pass an empty Hash as a request object (see above).
286
+ #
287
+ # @param parent [::String]
288
+ # Required. The parent resource shared by all dashboard charts being
289
+ # retrieved. Format:
290
+ # projects/\\{project}/locations/\\{location}/instances/\\{instance} If this is
291
+ # set, the parent of all of the dashboard charts specified in `names` must
292
+ # match this field.
293
+ # @param names [::Array<::String>]
294
+ # Required. The names of the dashboard charts to get.
295
+ # @yield [result, operation] Access the result along with the TransportOperation object
296
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse]
297
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
298
+ #
299
+ # @return [::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse]
300
+ #
301
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
302
+ #
303
+ # @example Basic example
304
+ # require "google/cloud/chronicle/v1"
305
+ #
306
+ # # Create a client object. The client can be reused for multiple calls.
307
+ # client = Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.new
308
+ #
309
+ # # Create a request. To set request fields, pass in keyword arguments.
310
+ # request = Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest.new
311
+ #
312
+ # # Call the batch_get_dashboard_charts method.
313
+ # result = client.batch_get_dashboard_charts request
314
+ #
315
+ # # The returned object is of type Google::Cloud::Chronicle::V1::BatchGetDashboardChartsResponse.
316
+ # p result
317
+ #
318
+ def batch_get_dashboard_charts request, options = nil
319
+ raise ::ArgumentError, "request must be provided" if request.nil?
320
+
321
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::BatchGetDashboardChartsRequest
322
+
323
+ # Converts hash and nil to an options object
324
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
325
+
326
+ # Customize the options with defaults
327
+ call_metadata = @config.rpcs.batch_get_dashboard_charts.metadata.to_h
328
+
329
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
330
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
331
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
332
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
333
+ transports_version_send: [:rest]
334
+
335
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
336
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
337
+
338
+ options.apply_defaults timeout: @config.rpcs.batch_get_dashboard_charts.timeout,
339
+ metadata: call_metadata,
340
+ retry_policy: @config.rpcs.batch_get_dashboard_charts.retry_policy
341
+
342
+ options.apply_defaults timeout: @config.timeout,
343
+ metadata: @config.metadata,
344
+ retry_policy: @config.retry_policy
345
+
346
+ @dashboard_chart_service_stub.batch_get_dashboard_charts request, options do |result, operation|
347
+ yield result, operation if block_given?
348
+ end
349
+ rescue ::Gapic::Rest::Error => e
350
+ raise ::Google::Cloud::Error.from_error(e)
351
+ end
352
+
353
+ ##
354
+ # Configuration class for the DashboardChartService REST API.
355
+ #
356
+ # This class represents the configuration for DashboardChartService REST,
357
+ # providing control over timeouts, retry behavior, logging, transport
358
+ # parameters, and other low-level controls. Certain parameters can also be
359
+ # applied individually to specific RPCs. See
360
+ # {::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client::Configuration::Rpcs}
361
+ # for a list of RPCs that can be configured independently.
362
+ #
363
+ # Configuration can be applied globally to all clients, or to a single client
364
+ # on construction.
365
+ #
366
+ # @example
367
+ #
368
+ # # Modify the global config, setting the timeout for
369
+ # # get_dashboard_chart to 20 seconds,
370
+ # # and all remaining timeouts to 10 seconds.
371
+ # ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.configure do |config|
372
+ # config.timeout = 10.0
373
+ # config.rpcs.get_dashboard_chart.timeout = 20.0
374
+ # end
375
+ #
376
+ # # Apply the above configuration only to a new client.
377
+ # client = ::Google::Cloud::Chronicle::V1::DashboardChartService::Rest::Client.new do |config|
378
+ # config.timeout = 10.0
379
+ # config.rpcs.get_dashboard_chart.timeout = 20.0
380
+ # end
381
+ #
382
+ # @!attribute [rw] endpoint
383
+ # A custom service endpoint, as a hostname or hostname:port. The default is
384
+ # nil, indicating to use the default endpoint in the current universe domain.
385
+ # @return [::String,nil]
386
+ # @!attribute [rw] credentials
387
+ # Credentials to send with calls. You may provide any of the following types:
388
+ # * (`String`) The path to a service account key file in JSON format
389
+ # * (`Hash`) A service account key as a Hash
390
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
391
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
392
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
393
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
394
+ # * (`nil`) indicating no credentials
395
+ #
396
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
397
+ # external source for authentication to Google Cloud, you must validate it before
398
+ # providing it to a Google API client library. Providing an unvalidated credential
399
+ # configuration to Google APIs can compromise the security of your systems and data.
400
+ # For more information, refer to [Validate credential configurations from external
401
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
402
+ # @return [::Object]
403
+ # @!attribute [rw] scope
404
+ # The OAuth scopes
405
+ # @return [::Array<::String>]
406
+ # @!attribute [rw] lib_name
407
+ # The library name as recorded in instrumentation and logging
408
+ # @return [::String]
409
+ # @!attribute [rw] lib_version
410
+ # The library version as recorded in instrumentation and logging
411
+ # @return [::String]
412
+ # @!attribute [rw] timeout
413
+ # The call timeout in seconds.
414
+ # @return [::Numeric]
415
+ # @!attribute [rw] metadata
416
+ # Additional headers to be sent with the call.
417
+ # @return [::Hash{::Symbol=>::String}]
418
+ # @!attribute [rw] retry_policy
419
+ # The retry policy. The value is a hash with the following keys:
420
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
421
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
422
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
423
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
424
+ # trigger a retry.
425
+ # @return [::Hash]
426
+ # @!attribute [rw] quota_project
427
+ # A separate project against which to charge quota.
428
+ # @return [::String]
429
+ # @!attribute [rw] universe_domain
430
+ # The universe domain within which to make requests. This determines the
431
+ # default endpoint URL. The default value of nil uses the environment
432
+ # universe (usually the default "googleapis.com" universe).
433
+ # @return [::String,nil]
434
+ # @!attribute [rw] logger
435
+ # A custom logger to use for request/response debug logging, or the value
436
+ # `:default` (the default) to construct a default logger, or `nil` to
437
+ # explicitly disable logging.
438
+ # @return [::Logger,:default,nil]
439
+ #
440
+ class Configuration
441
+ extend ::Gapic::Config
442
+
443
+ # @private
444
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
445
+ DEFAULT_ENDPOINT = "chronicle.googleapis.com"
446
+
447
+ config_attr :endpoint, nil, ::String, nil
448
+ config_attr :credentials, nil do |value|
449
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
450
+ allowed.any? { |klass| klass === value }
451
+ end
452
+ config_attr :scope, nil, ::String, ::Array, nil
453
+ config_attr :lib_name, nil, ::String, nil
454
+ config_attr :lib_version, nil, ::String, nil
455
+ config_attr :timeout, nil, ::Numeric, nil
456
+ config_attr :metadata, nil, ::Hash, nil
457
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
458
+ config_attr :quota_project, nil, ::String, nil
459
+ config_attr :universe_domain, nil, ::String, nil
460
+ config_attr :logger, :default, ::Logger, nil, :default
461
+
462
+ # @private
463
+ def initialize parent_config = nil
464
+ @parent_config = parent_config unless parent_config.nil?
465
+
466
+ yield self if block_given?
467
+ end
468
+
469
+ ##
470
+ # Configurations for individual RPCs
471
+ # @return [Rpcs]
472
+ #
473
+ def rpcs
474
+ @rpcs ||= begin
475
+ parent_rpcs = nil
476
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
477
+ Rpcs.new parent_rpcs
478
+ end
479
+ end
480
+
481
+ ##
482
+ # Configuration RPC class for the DashboardChartService API.
483
+ #
484
+ # Includes fields providing the configuration for each RPC in this service.
485
+ # Each configuration object is of type `Gapic::Config::Method` and includes
486
+ # the following configuration fields:
487
+ #
488
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
489
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
490
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
491
+ # include the following keys:
492
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
493
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
494
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
495
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
496
+ # trigger a retry.
497
+ #
498
+ class Rpcs
499
+ ##
500
+ # RPC-specific configuration for `get_dashboard_chart`
501
+ # @return [::Gapic::Config::Method]
502
+ #
503
+ attr_reader :get_dashboard_chart
504
+ ##
505
+ # RPC-specific configuration for `batch_get_dashboard_charts`
506
+ # @return [::Gapic::Config::Method]
507
+ #
508
+ attr_reader :batch_get_dashboard_charts
509
+
510
+ # @private
511
+ def initialize parent_rpcs = nil
512
+ get_dashboard_chart_config = parent_rpcs.get_dashboard_chart if parent_rpcs.respond_to? :get_dashboard_chart
513
+ @get_dashboard_chart = ::Gapic::Config::Method.new get_dashboard_chart_config
514
+ batch_get_dashboard_charts_config = parent_rpcs.batch_get_dashboard_charts if parent_rpcs.respond_to? :batch_get_dashboard_charts
515
+ @batch_get_dashboard_charts = ::Gapic::Config::Method.new batch_get_dashboard_charts_config
516
+
517
+ yield self if block_given?
518
+ end
519
+ end
520
+ end
521
+ end
522
+ end
523
+ end
524
+ end
525
+ end
526
+ end
527
+ end