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