google-cloud-monitoring-dashboard-v1 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 534037815cd333f832767b65a352ed53f1296971d3ddbb811ff9cd02a8873767
4
- data.tar.gz: 1574c4078a076fb9cf6dee73ceedfa81481b50dde9c1fce7900d2ba8a4f02bbf
3
+ metadata.gz: 834738583afd3b562ac26caee728ef7bc8c869d4df3ed557e32214257e26c4b0
4
+ data.tar.gz: c7000214d87afcd3d22de839d9d5f69ad6ea25720b913714e0f0fec470b5a006
5
5
  SHA512:
6
- metadata.gz: bf98cb8d25ae0603861d0204acd8c5cb60d9b2e3ceea39af14df0b7c3c2b63f7b59f0788d34228cfdeaee106ed383e95e35df57676d42e1034328beefaf51b4a
7
- data.tar.gz: ee962b989ae7f566c6cb4aa447965d56263caa2f7cc9270d6e03c0d4c71e00ed665f861db1d00148eaeb606a219298e55fd3abd91307b8368b88d19ddb9d79b7
6
+ metadata.gz: 0cd91046136fd564994c8958801c5cc66833a50fadcdb1b0c6c82ffa3bc4ce9a1b3d3b8d2e32b0c42106427c5d6bbc52c6cd4c59dfa6623d52f1cda956b91282
7
+ data.tar.gz: 83cecc2a72d9d9b3d59c3b05f93160deb61e4c74807b0a335f691828ad575d95e082be04c2eac1cc3accf8714da127de08802f86a6ed172e7687f410bf93b649
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruby Client for the Cloud Monitoring Dashboards V1 API
2
2
 
3
- API Client library for the Cloud Monitoring Dashboards V1 API
3
+ Manages your Cloud Monitoring data and configurations.
4
4
 
5
5
  Cloud Monitoring collects metrics, events, and metadata from Google Cloud, Amazon Web Services (AWS), hosted uptime probes, and application instrumentation. The Dashboards API manages arrangements of display widgets.
6
6
 
@@ -310,13 +310,11 @@ module Google
310
310
  # # Call the list_dashboards method.
311
311
  # result = client.list_dashboards request
312
312
  #
313
- # # The returned object is of type Gapic::PagedEnumerable. You can
314
- # # iterate over all elements by calling #each, and the enumerable
315
- # # will lazily make API calls to fetch subsequent pages. Other
316
- # # methods are also available for managing paging directly.
317
- # result.each do |response|
313
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
314
+ # # over elements, and API calls will be issued to fetch pages as needed.
315
+ # result.each do |item|
318
316
  # # Each element is of type ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard.
319
- # p response
317
+ # p item
320
318
  # end
321
319
  #
322
320
  def list_dashboards request, options = nil
@@ -0,0 +1,683 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/monitoring/dashboard/v1/dashboards_service_pb"
21
+ require "google/cloud/monitoring/dashboard/v1/dashboards_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Monitoring
26
+ module Dashboard
27
+ module V1
28
+ module DashboardsService
29
+ module Rest
30
+ ##
31
+ # REST client for the DashboardsService service.
32
+ #
33
+ # Manages Stackdriver dashboards. A dashboard is an arrangement of data display
34
+ # widgets in a specific layout.
35
+ #
36
+ class Client
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :dashboards_service_stub
41
+
42
+ ##
43
+ # Configure the DashboardsService Client class.
44
+ #
45
+ # See {::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Rest::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all DashboardsService clients
51
+ # ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Rest::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "Monitoring", "Dashboard", "V1"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config.timeout = 30.0
72
+ default_config.retry_policy = {
73
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 2]
74
+ }
75
+
76
+ default_config.rpcs.create_dashboard.timeout = 30.0
77
+
78
+ default_config.rpcs.delete_dashboard.timeout = 30.0
79
+
80
+ default_config.rpcs.update_dashboard.timeout = 30.0
81
+
82
+ default_config
83
+ end
84
+ yield @configure if block_given?
85
+ @configure
86
+ end
87
+
88
+ ##
89
+ # Configure the DashboardsService Client instance.
90
+ #
91
+ # The configuration is set to the derived mode, meaning that values can be changed,
92
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
93
+ # should be made on {Client.configure}.
94
+ #
95
+ # See {::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Rest::Client::Configuration}
96
+ # for a description of the configuration fields.
97
+ #
98
+ # @yield [config] Configure the Client client.
99
+ # @yieldparam config [Client::Configuration]
100
+ #
101
+ # @return [Client::Configuration]
102
+ #
103
+ def configure
104
+ yield @config if block_given?
105
+ @config
106
+ end
107
+
108
+ ##
109
+ # Create a new DashboardsService REST client object.
110
+ #
111
+ # @example
112
+ #
113
+ # # Create a client using the default configuration
114
+ # client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Rest::Client.new
115
+ #
116
+ # # Create a client using a custom configuration
117
+ # client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Rest::Client.new do |config|
118
+ # config.timeout = 10.0
119
+ # end
120
+ #
121
+ # @yield [config] Configure the DashboardsService client.
122
+ # @yieldparam config [Client::Configuration]
123
+ #
124
+ def initialize
125
+ # Create the configuration object
126
+ @config = Configuration.new Client.configure
127
+
128
+ # Yield the configuration if needed
129
+ yield @config if block_given?
130
+
131
+ # Create credentials
132
+ credentials = @config.credentials
133
+ # Use self-signed JWT if the endpoint is unchanged from default,
134
+ # but only if the default endpoint does not have a region prefix.
135
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
136
+ !@config.endpoint.split(".").first.include?("-")
137
+ credentials ||= Credentials.default scope: @config.scope,
138
+ enable_self_signed_jwt: enable_self_signed_jwt
139
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
140
+ credentials = Credentials.new credentials, scope: @config.scope
141
+ end
142
+
143
+ @quota_project_id = @config.quota_project
144
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
145
+
146
+ @dashboards_service_stub = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
147
+ end
148
+
149
+ # Service calls
150
+
151
+ ##
152
+ # Creates a new custom dashboard. For examples on how you can use this API to
153
+ # create dashboards, see [Managing dashboards by
154
+ # API](https://cloud.google.com/monitoring/dashboards/api-dashboard). This
155
+ # method requires the `monitoring.dashboards.create` permission on the
156
+ # specified project. For more information about permissions, see [Cloud
157
+ # Identity and Access Management](https://cloud.google.com/iam).
158
+ #
159
+ # @overload create_dashboard(request, options = nil)
160
+ # Pass arguments to `create_dashboard` via a request object, either of type
161
+ # {::Google::Cloud::Monitoring::Dashboard::V1::CreateDashboardRequest} or an equivalent Hash.
162
+ #
163
+ # @param request [::Google::Cloud::Monitoring::Dashboard::V1::CreateDashboardRequest, ::Hash]
164
+ # A request object representing the call parameters. Required. To specify no
165
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
166
+ # @param options [::Gapic::CallOptions, ::Hash]
167
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
168
+ #
169
+ # @overload create_dashboard(parent: nil, dashboard: nil, validate_only: nil)
170
+ # Pass arguments to `create_dashboard` via keyword arguments. Note that at
171
+ # least one keyword argument is required. To specify no parameters, or to keep all
172
+ # the default parameter values, pass an empty Hash as a request object (see above).
173
+ #
174
+ # @param parent [::String]
175
+ # Required. The project on which to execute the request. The format is:
176
+ #
177
+ # projects/[PROJECT_ID_OR_NUMBER]
178
+ #
179
+ # The `[PROJECT_ID_OR_NUMBER]` must match the dashboard resource name.
180
+ # @param dashboard [::Google::Cloud::Monitoring::Dashboard::V1::Dashboard, ::Hash]
181
+ # Required. The initial dashboard specification.
182
+ # @param validate_only [::Boolean]
183
+ # If set, validate the request and preview the review, but do not actually
184
+ # save it.
185
+ # @yield [result, operation] Access the result along with the TransportOperation object
186
+ # @yieldparam result [::Google::Cloud::Monitoring::Dashboard::V1::Dashboard]
187
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
188
+ #
189
+ # @return [::Google::Cloud::Monitoring::Dashboard::V1::Dashboard]
190
+ #
191
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
192
+ def create_dashboard request, options = nil
193
+ raise ::ArgumentError, "request must be provided" if request.nil?
194
+
195
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::Dashboard::V1::CreateDashboardRequest
196
+
197
+ # Converts hash and nil to an options object
198
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
199
+
200
+ # Customize the options with defaults
201
+ call_metadata = @config.rpcs.create_dashboard.metadata.to_h
202
+
203
+ # Set x-goog-api-client and x-goog-user-project headers
204
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
205
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
206
+ gapic_version: ::Google::Cloud::Monitoring::Dashboard::V1::VERSION,
207
+ transports_version_send: [:rest]
208
+
209
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
210
+
211
+ options.apply_defaults timeout: @config.rpcs.create_dashboard.timeout,
212
+ metadata: call_metadata,
213
+ retry_policy: @config.rpcs.create_dashboard.retry_policy
214
+
215
+ options.apply_defaults timeout: @config.timeout,
216
+ metadata: @config.metadata,
217
+ retry_policy: @config.retry_policy
218
+
219
+ @dashboards_service_stub.create_dashboard request, options do |result, operation|
220
+ yield result, operation if block_given?
221
+ return result
222
+ end
223
+ rescue ::Gapic::Rest::Error => e
224
+ raise ::Google::Cloud::Error.from_error(e)
225
+ end
226
+
227
+ ##
228
+ # Lists the existing dashboards.
229
+ #
230
+ # This method requires the `monitoring.dashboards.list` permission
231
+ # on the specified project. For more information, see
232
+ # [Cloud Identity and Access Management](https://cloud.google.com/iam).
233
+ #
234
+ # @overload list_dashboards(request, options = nil)
235
+ # Pass arguments to `list_dashboards` via a request object, either of type
236
+ # {::Google::Cloud::Monitoring::Dashboard::V1::ListDashboardsRequest} or an equivalent Hash.
237
+ #
238
+ # @param request [::Google::Cloud::Monitoring::Dashboard::V1::ListDashboardsRequest, ::Hash]
239
+ # A request object representing the call parameters. Required. To specify no
240
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
241
+ # @param options [::Gapic::CallOptions, ::Hash]
242
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
243
+ #
244
+ # @overload list_dashboards(parent: nil, page_size: nil, page_token: nil)
245
+ # Pass arguments to `list_dashboards` via keyword arguments. Note that at
246
+ # least one keyword argument is required. To specify no parameters, or to keep all
247
+ # the default parameter values, pass an empty Hash as a request object (see above).
248
+ #
249
+ # @param parent [::String]
250
+ # Required. The scope of the dashboards to list. The format is:
251
+ #
252
+ # projects/[PROJECT_ID_OR_NUMBER]
253
+ # @param page_size [::Integer]
254
+ # A positive number that is the maximum number of results to return.
255
+ # If unspecified, a default of 1000 is used.
256
+ # @param page_token [::String]
257
+ # If this field is not empty then it must contain the `nextPageToken` value
258
+ # returned by a previous call to this method. Using this field causes the
259
+ # method to return additional results from the previous method call.
260
+ # @yield [result, operation] Access the result along with the TransportOperation object
261
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Monitoring::Dashboard::V1::Dashboard>]
262
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
263
+ #
264
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Monitoring::Dashboard::V1::Dashboard>]
265
+ #
266
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
267
+ def list_dashboards request, options = nil
268
+ raise ::ArgumentError, "request must be provided" if request.nil?
269
+
270
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::Dashboard::V1::ListDashboardsRequest
271
+
272
+ # Converts hash and nil to an options object
273
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
274
+
275
+ # Customize the options with defaults
276
+ call_metadata = @config.rpcs.list_dashboards.metadata.to_h
277
+
278
+ # Set x-goog-api-client and x-goog-user-project headers
279
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
280
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
281
+ gapic_version: ::Google::Cloud::Monitoring::Dashboard::V1::VERSION,
282
+ transports_version_send: [:rest]
283
+
284
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
285
+
286
+ options.apply_defaults timeout: @config.rpcs.list_dashboards.timeout,
287
+ metadata: call_metadata,
288
+ retry_policy: @config.rpcs.list_dashboards.retry_policy
289
+
290
+ options.apply_defaults timeout: @config.timeout,
291
+ metadata: @config.metadata,
292
+ retry_policy: @config.retry_policy
293
+
294
+ @dashboards_service_stub.list_dashboards request, options do |result, operation|
295
+ result = ::Gapic::Rest::PagedEnumerable.new @dashboards_service_stub, :list_dashboards, "dashboards", request, result, options
296
+ yield result, operation if block_given?
297
+ return result
298
+ end
299
+ rescue ::Gapic::Rest::Error => e
300
+ raise ::Google::Cloud::Error.from_error(e)
301
+ end
302
+
303
+ ##
304
+ # Fetches a specific dashboard.
305
+ #
306
+ # This method requires the `monitoring.dashboards.get` permission
307
+ # on the specified dashboard. For more information, see
308
+ # [Cloud Identity and Access Management](https://cloud.google.com/iam).
309
+ #
310
+ # @overload get_dashboard(request, options = nil)
311
+ # Pass arguments to `get_dashboard` via a request object, either of type
312
+ # {::Google::Cloud::Monitoring::Dashboard::V1::GetDashboardRequest} or an equivalent Hash.
313
+ #
314
+ # @param request [::Google::Cloud::Monitoring::Dashboard::V1::GetDashboardRequest, ::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_dashboard(name: nil)
321
+ # Pass arguments to `get_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 resource name of the Dashboard. The format is one of:
327
+ #
328
+ # - `dashboards/[DASHBOARD_ID]` (for system dashboards)
329
+ # - `projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]`
330
+ # (for custom dashboards).
331
+ # @yield [result, operation] Access the result along with the TransportOperation object
332
+ # @yieldparam result [::Google::Cloud::Monitoring::Dashboard::V1::Dashboard]
333
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
334
+ #
335
+ # @return [::Google::Cloud::Monitoring::Dashboard::V1::Dashboard]
336
+ #
337
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
338
+ def get_dashboard request, options = nil
339
+ raise ::ArgumentError, "request must be provided" if request.nil?
340
+
341
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::Dashboard::V1::GetDashboardRequest
342
+
343
+ # Converts hash and nil to an options object
344
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
345
+
346
+ # Customize the options with defaults
347
+ call_metadata = @config.rpcs.get_dashboard.metadata.to_h
348
+
349
+ # Set x-goog-api-client and x-goog-user-project headers
350
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
351
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
352
+ gapic_version: ::Google::Cloud::Monitoring::Dashboard::V1::VERSION,
353
+ transports_version_send: [:rest]
354
+
355
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
356
+
357
+ options.apply_defaults timeout: @config.rpcs.get_dashboard.timeout,
358
+ metadata: call_metadata,
359
+ retry_policy: @config.rpcs.get_dashboard.retry_policy
360
+
361
+ options.apply_defaults timeout: @config.timeout,
362
+ metadata: @config.metadata,
363
+ retry_policy: @config.retry_policy
364
+
365
+ @dashboards_service_stub.get_dashboard request, options do |result, operation|
366
+ yield result, operation if block_given?
367
+ return result
368
+ end
369
+ rescue ::Gapic::Rest::Error => e
370
+ raise ::Google::Cloud::Error.from_error(e)
371
+ end
372
+
373
+ ##
374
+ # Deletes an existing custom dashboard.
375
+ #
376
+ # This method requires the `monitoring.dashboards.delete` permission
377
+ # on the specified dashboard. For more information, see
378
+ # [Cloud Identity and Access Management](https://cloud.google.com/iam).
379
+ #
380
+ # @overload delete_dashboard(request, options = nil)
381
+ # Pass arguments to `delete_dashboard` via a request object, either of type
382
+ # {::Google::Cloud::Monitoring::Dashboard::V1::DeleteDashboardRequest} or an equivalent Hash.
383
+ #
384
+ # @param request [::Google::Cloud::Monitoring::Dashboard::V1::DeleteDashboardRequest, ::Hash]
385
+ # A request object representing the call parameters. Required. To specify no
386
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
387
+ # @param options [::Gapic::CallOptions, ::Hash]
388
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
389
+ #
390
+ # @overload delete_dashboard(name: nil)
391
+ # Pass arguments to `delete_dashboard` via keyword arguments. Note that at
392
+ # least one keyword argument is required. To specify no parameters, or to keep all
393
+ # the default parameter values, pass an empty Hash as a request object (see above).
394
+ #
395
+ # @param name [::String]
396
+ # Required. The resource name of the Dashboard. The format is:
397
+ #
398
+ # projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]
399
+ # @yield [result, operation] Access the result along with the TransportOperation object
400
+ # @yieldparam result [::Google::Protobuf::Empty]
401
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
402
+ #
403
+ # @return [::Google::Protobuf::Empty]
404
+ #
405
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
406
+ def delete_dashboard request, options = nil
407
+ raise ::ArgumentError, "request must be provided" if request.nil?
408
+
409
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::Dashboard::V1::DeleteDashboardRequest
410
+
411
+ # Converts hash and nil to an options object
412
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
413
+
414
+ # Customize the options with defaults
415
+ call_metadata = @config.rpcs.delete_dashboard.metadata.to_h
416
+
417
+ # Set x-goog-api-client and x-goog-user-project headers
418
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
419
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
420
+ gapic_version: ::Google::Cloud::Monitoring::Dashboard::V1::VERSION,
421
+ transports_version_send: [:rest]
422
+
423
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
424
+
425
+ options.apply_defaults timeout: @config.rpcs.delete_dashboard.timeout,
426
+ metadata: call_metadata,
427
+ retry_policy: @config.rpcs.delete_dashboard.retry_policy
428
+
429
+ options.apply_defaults timeout: @config.timeout,
430
+ metadata: @config.metadata,
431
+ retry_policy: @config.retry_policy
432
+
433
+ @dashboards_service_stub.delete_dashboard request, options do |result, operation|
434
+ yield result, operation if block_given?
435
+ return result
436
+ end
437
+ rescue ::Gapic::Rest::Error => e
438
+ raise ::Google::Cloud::Error.from_error(e)
439
+ end
440
+
441
+ ##
442
+ # Replaces an existing custom dashboard with a new definition.
443
+ #
444
+ # This method requires the `monitoring.dashboards.update` permission
445
+ # on the specified dashboard. For more information, see
446
+ # [Cloud Identity and Access Management](https://cloud.google.com/iam).
447
+ #
448
+ # @overload update_dashboard(request, options = nil)
449
+ # Pass arguments to `update_dashboard` via a request object, either of type
450
+ # {::Google::Cloud::Monitoring::Dashboard::V1::UpdateDashboardRequest} or an equivalent Hash.
451
+ #
452
+ # @param request [::Google::Cloud::Monitoring::Dashboard::V1::UpdateDashboardRequest, ::Hash]
453
+ # A request object representing the call parameters. Required. To specify no
454
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
455
+ # @param options [::Gapic::CallOptions, ::Hash]
456
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
457
+ #
458
+ # @overload update_dashboard(dashboard: nil, validate_only: nil)
459
+ # Pass arguments to `update_dashboard` via keyword arguments. Note that at
460
+ # least one keyword argument is required. To specify no parameters, or to keep all
461
+ # the default parameter values, pass an empty Hash as a request object (see above).
462
+ #
463
+ # @param dashboard [::Google::Cloud::Monitoring::Dashboard::V1::Dashboard, ::Hash]
464
+ # Required. The dashboard that will replace the existing dashboard.
465
+ # @param validate_only [::Boolean]
466
+ # If set, validate the request and preview the review, but do not actually
467
+ # save it.
468
+ # @yield [result, operation] Access the result along with the TransportOperation object
469
+ # @yieldparam result [::Google::Cloud::Monitoring::Dashboard::V1::Dashboard]
470
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
471
+ #
472
+ # @return [::Google::Cloud::Monitoring::Dashboard::V1::Dashboard]
473
+ #
474
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
475
+ def update_dashboard request, options = nil
476
+ raise ::ArgumentError, "request must be provided" if request.nil?
477
+
478
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::Dashboard::V1::UpdateDashboardRequest
479
+
480
+ # Converts hash and nil to an options object
481
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
482
+
483
+ # Customize the options with defaults
484
+ call_metadata = @config.rpcs.update_dashboard.metadata.to_h
485
+
486
+ # Set x-goog-api-client and x-goog-user-project headers
487
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
488
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
489
+ gapic_version: ::Google::Cloud::Monitoring::Dashboard::V1::VERSION,
490
+ transports_version_send: [:rest]
491
+
492
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
493
+
494
+ options.apply_defaults timeout: @config.rpcs.update_dashboard.timeout,
495
+ metadata: call_metadata,
496
+ retry_policy: @config.rpcs.update_dashboard.retry_policy
497
+
498
+ options.apply_defaults timeout: @config.timeout,
499
+ metadata: @config.metadata,
500
+ retry_policy: @config.retry_policy
501
+
502
+ @dashboards_service_stub.update_dashboard request, options do |result, operation|
503
+ yield result, operation if block_given?
504
+ return result
505
+ end
506
+ rescue ::Gapic::Rest::Error => e
507
+ raise ::Google::Cloud::Error.from_error(e)
508
+ end
509
+
510
+ ##
511
+ # Configuration class for the DashboardsService REST API.
512
+ #
513
+ # This class represents the configuration for DashboardsService REST,
514
+ # providing control over timeouts, retry behavior, logging, transport
515
+ # parameters, and other low-level controls. Certain parameters can also be
516
+ # applied individually to specific RPCs. See
517
+ # {::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Rest::Client::Configuration::Rpcs}
518
+ # for a list of RPCs that can be configured independently.
519
+ #
520
+ # Configuration can be applied globally to all clients, or to a single client
521
+ # on construction.
522
+ #
523
+ # @example
524
+ #
525
+ # # Modify the global config, setting the timeout for
526
+ # # create_dashboard to 20 seconds,
527
+ # # and all remaining timeouts to 10 seconds.
528
+ # ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Rest::Client.configure do |config|
529
+ # config.timeout = 10.0
530
+ # config.rpcs.create_dashboard.timeout = 20.0
531
+ # end
532
+ #
533
+ # # Apply the above configuration only to a new client.
534
+ # client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Rest::Client.new do |config|
535
+ # config.timeout = 10.0
536
+ # config.rpcs.create_dashboard.timeout = 20.0
537
+ # end
538
+ #
539
+ # @!attribute [rw] endpoint
540
+ # The hostname or hostname:port of the service endpoint.
541
+ # Defaults to `"monitoring.googleapis.com"`.
542
+ # @return [::String]
543
+ # @!attribute [rw] credentials
544
+ # Credentials to send with calls. You may provide any of the following types:
545
+ # * (`String`) The path to a service account key file in JSON format
546
+ # * (`Hash`) A service account key as a Hash
547
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
548
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
549
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
550
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
551
+ # * (`nil`) indicating no credentials
552
+ # @return [::Object]
553
+ # @!attribute [rw] scope
554
+ # The OAuth scopes
555
+ # @return [::Array<::String>]
556
+ # @!attribute [rw] lib_name
557
+ # The library name as recorded in instrumentation and logging
558
+ # @return [::String]
559
+ # @!attribute [rw] lib_version
560
+ # The library version as recorded in instrumentation and logging
561
+ # @return [::String]
562
+ # @!attribute [rw] timeout
563
+ # The call timeout in seconds.
564
+ # @return [::Numeric]
565
+ # @!attribute [rw] metadata
566
+ # Additional headers to be sent with the call.
567
+ # @return [::Hash{::Symbol=>::String}]
568
+ # @!attribute [rw] retry_policy
569
+ # The retry policy. The value is a hash with the following keys:
570
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
571
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
572
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
573
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
574
+ # trigger a retry.
575
+ # @return [::Hash]
576
+ # @!attribute [rw] quota_project
577
+ # A separate project against which to charge quota.
578
+ # @return [::String]
579
+ #
580
+ class Configuration
581
+ extend ::Gapic::Config
582
+
583
+ config_attr :endpoint, "monitoring.googleapis.com", ::String
584
+ config_attr :credentials, nil do |value|
585
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
586
+ allowed.any? { |klass| klass === value }
587
+ end
588
+ config_attr :scope, nil, ::String, ::Array, nil
589
+ config_attr :lib_name, nil, ::String, nil
590
+ config_attr :lib_version, nil, ::String, nil
591
+ config_attr :timeout, nil, ::Numeric, nil
592
+ config_attr :metadata, nil, ::Hash, nil
593
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
594
+ config_attr :quota_project, nil, ::String, nil
595
+
596
+ # @private
597
+ def initialize parent_config = nil
598
+ @parent_config = parent_config unless parent_config.nil?
599
+
600
+ yield self if block_given?
601
+ end
602
+
603
+ ##
604
+ # Configurations for individual RPCs
605
+ # @return [Rpcs]
606
+ #
607
+ def rpcs
608
+ @rpcs ||= begin
609
+ parent_rpcs = nil
610
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
611
+ Rpcs.new parent_rpcs
612
+ end
613
+ end
614
+
615
+ ##
616
+ # Configuration RPC class for the DashboardsService API.
617
+ #
618
+ # Includes fields providing the configuration for each RPC in this service.
619
+ # Each configuration object is of type `Gapic::Config::Method` and includes
620
+ # the following configuration fields:
621
+ #
622
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
623
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
624
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
625
+ # include the following keys:
626
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
627
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
628
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
629
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
630
+ # trigger a retry.
631
+ #
632
+ class Rpcs
633
+ ##
634
+ # RPC-specific configuration for `create_dashboard`
635
+ # @return [::Gapic::Config::Method]
636
+ #
637
+ attr_reader :create_dashboard
638
+ ##
639
+ # RPC-specific configuration for `list_dashboards`
640
+ # @return [::Gapic::Config::Method]
641
+ #
642
+ attr_reader :list_dashboards
643
+ ##
644
+ # RPC-specific configuration for `get_dashboard`
645
+ # @return [::Gapic::Config::Method]
646
+ #
647
+ attr_reader :get_dashboard
648
+ ##
649
+ # RPC-specific configuration for `delete_dashboard`
650
+ # @return [::Gapic::Config::Method]
651
+ #
652
+ attr_reader :delete_dashboard
653
+ ##
654
+ # RPC-specific configuration for `update_dashboard`
655
+ # @return [::Gapic::Config::Method]
656
+ #
657
+ attr_reader :update_dashboard
658
+
659
+ # @private
660
+ def initialize parent_rpcs = nil
661
+ create_dashboard_config = parent_rpcs.create_dashboard if parent_rpcs.respond_to? :create_dashboard
662
+ @create_dashboard = ::Gapic::Config::Method.new create_dashboard_config
663
+ list_dashboards_config = parent_rpcs.list_dashboards if parent_rpcs.respond_to? :list_dashboards
664
+ @list_dashboards = ::Gapic::Config::Method.new list_dashboards_config
665
+ get_dashboard_config = parent_rpcs.get_dashboard if parent_rpcs.respond_to? :get_dashboard
666
+ @get_dashboard = ::Gapic::Config::Method.new get_dashboard_config
667
+ delete_dashboard_config = parent_rpcs.delete_dashboard if parent_rpcs.respond_to? :delete_dashboard
668
+ @delete_dashboard = ::Gapic::Config::Method.new delete_dashboard_config
669
+ update_dashboard_config = parent_rpcs.update_dashboard if parent_rpcs.respond_to? :update_dashboard
670
+ @update_dashboard = ::Gapic::Config::Method.new update_dashboard_config
671
+
672
+ yield self if block_given?
673
+ end
674
+ end
675
+ end
676
+ end
677
+ end
678
+ end
679
+ end
680
+ end
681
+ end
682
+ end
683
+ end
@@ -0,0 +1,347 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/monitoring/dashboard/v1/dashboards_service_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Monitoring
24
+ module Dashboard
25
+ module V1
26
+ module DashboardsService
27
+ module Rest
28
+ ##
29
+ # REST service stub for the DashboardsService service.
30
+ # Service stub contains baseline method implementations
31
+ # including transcoding, making the REST call, and deserialing the response.
32
+ #
33
+ class ServiceStub
34
+ def initialize endpoint:, credentials:
35
+ # These require statements are intentionally placed here to initialize
36
+ # the REST modules only when it's required.
37
+ require "gapic/rest"
38
+
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
40
+ numeric_enums: true,
41
+ raise_faraday_errors: false
42
+ end
43
+
44
+ ##
45
+ # Baseline implementation for the create_dashboard REST call
46
+ #
47
+ # @param request_pb [::Google::Cloud::Monitoring::Dashboard::V1::CreateDashboardRequest]
48
+ # A request object representing the call parameters. Required.
49
+ # @param options [::Gapic::CallOptions]
50
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
51
+ #
52
+ # @yield [result, operation] Access the result along with the TransportOperation object
53
+ # @yieldparam result [::Google::Cloud::Monitoring::Dashboard::V1::Dashboard]
54
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
55
+ #
56
+ # @return [::Google::Cloud::Monitoring::Dashboard::V1::Dashboard]
57
+ # A result object deserialized from the server's reply
58
+ def create_dashboard request_pb, options = nil
59
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
60
+
61
+ verb, uri, query_string_params, body = ServiceStub.transcode_create_dashboard_request request_pb
62
+ query_string_params = if query_string_params.any?
63
+ query_string_params.to_h { |p| p.split("=", 2) }
64
+ else
65
+ {}
66
+ end
67
+
68
+ response = @client_stub.make_http_request(
69
+ verb,
70
+ uri: uri,
71
+ body: body || "",
72
+ params: query_string_params,
73
+ options: options
74
+ )
75
+ operation = ::Gapic::Rest::TransportOperation.new response
76
+ result = ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard.decode_json response.body, ignore_unknown_fields: true
77
+
78
+ yield result, operation if block_given?
79
+ result
80
+ end
81
+
82
+ ##
83
+ # Baseline implementation for the list_dashboards REST call
84
+ #
85
+ # @param request_pb [::Google::Cloud::Monitoring::Dashboard::V1::ListDashboardsRequest]
86
+ # A request object representing the call parameters. Required.
87
+ # @param options [::Gapic::CallOptions]
88
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
89
+ #
90
+ # @yield [result, operation] Access the result along with the TransportOperation object
91
+ # @yieldparam result [::Google::Cloud::Monitoring::Dashboard::V1::ListDashboardsResponse]
92
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
93
+ #
94
+ # @return [::Google::Cloud::Monitoring::Dashboard::V1::ListDashboardsResponse]
95
+ # A result object deserialized from the server's reply
96
+ def list_dashboards request_pb, options = nil
97
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
98
+
99
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_dashboards_request request_pb
100
+ query_string_params = if query_string_params.any?
101
+ query_string_params.to_h { |p| p.split("=", 2) }
102
+ else
103
+ {}
104
+ end
105
+
106
+ response = @client_stub.make_http_request(
107
+ verb,
108
+ uri: uri,
109
+ body: body || "",
110
+ params: query_string_params,
111
+ options: options
112
+ )
113
+ operation = ::Gapic::Rest::TransportOperation.new response
114
+ result = ::Google::Cloud::Monitoring::Dashboard::V1::ListDashboardsResponse.decode_json response.body, ignore_unknown_fields: true
115
+
116
+ yield result, operation if block_given?
117
+ result
118
+ end
119
+
120
+ ##
121
+ # Baseline implementation for the get_dashboard REST call
122
+ #
123
+ # @param request_pb [::Google::Cloud::Monitoring::Dashboard::V1::GetDashboardRequest]
124
+ # A request object representing the call parameters. Required.
125
+ # @param options [::Gapic::CallOptions]
126
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
127
+ #
128
+ # @yield [result, operation] Access the result along with the TransportOperation object
129
+ # @yieldparam result [::Google::Cloud::Monitoring::Dashboard::V1::Dashboard]
130
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
131
+ #
132
+ # @return [::Google::Cloud::Monitoring::Dashboard::V1::Dashboard]
133
+ # A result object deserialized from the server's reply
134
+ def get_dashboard request_pb, options = nil
135
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
136
+
137
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_dashboard_request request_pb
138
+ query_string_params = if query_string_params.any?
139
+ query_string_params.to_h { |p| p.split("=", 2) }
140
+ else
141
+ {}
142
+ end
143
+
144
+ response = @client_stub.make_http_request(
145
+ verb,
146
+ uri: uri,
147
+ body: body || "",
148
+ params: query_string_params,
149
+ options: options
150
+ )
151
+ operation = ::Gapic::Rest::TransportOperation.new response
152
+ result = ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard.decode_json response.body, ignore_unknown_fields: true
153
+
154
+ yield result, operation if block_given?
155
+ result
156
+ end
157
+
158
+ ##
159
+ # Baseline implementation for the delete_dashboard REST call
160
+ #
161
+ # @param request_pb [::Google::Cloud::Monitoring::Dashboard::V1::DeleteDashboardRequest]
162
+ # A request object representing the call parameters. Required.
163
+ # @param options [::Gapic::CallOptions]
164
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
165
+ #
166
+ # @yield [result, operation] Access the result along with the TransportOperation object
167
+ # @yieldparam result [::Google::Protobuf::Empty]
168
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
169
+ #
170
+ # @return [::Google::Protobuf::Empty]
171
+ # A result object deserialized from the server's reply
172
+ def delete_dashboard request_pb, options = nil
173
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
174
+
175
+ verb, uri, query_string_params, body = ServiceStub.transcode_delete_dashboard_request request_pb
176
+ query_string_params = if query_string_params.any?
177
+ query_string_params.to_h { |p| p.split("=", 2) }
178
+ else
179
+ {}
180
+ end
181
+
182
+ response = @client_stub.make_http_request(
183
+ verb,
184
+ uri: uri,
185
+ body: body || "",
186
+ params: query_string_params,
187
+ options: options
188
+ )
189
+ operation = ::Gapic::Rest::TransportOperation.new response
190
+ result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
191
+
192
+ yield result, operation if block_given?
193
+ result
194
+ end
195
+
196
+ ##
197
+ # Baseline implementation for the update_dashboard REST call
198
+ #
199
+ # @param request_pb [::Google::Cloud::Monitoring::Dashboard::V1::UpdateDashboardRequest]
200
+ # A request object representing the call parameters. Required.
201
+ # @param options [::Gapic::CallOptions]
202
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
203
+ #
204
+ # @yield [result, operation] Access the result along with the TransportOperation object
205
+ # @yieldparam result [::Google::Cloud::Monitoring::Dashboard::V1::Dashboard]
206
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
207
+ #
208
+ # @return [::Google::Cloud::Monitoring::Dashboard::V1::Dashboard]
209
+ # A result object deserialized from the server's reply
210
+ def update_dashboard request_pb, options = nil
211
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
212
+
213
+ verb, uri, query_string_params, body = ServiceStub.transcode_update_dashboard_request request_pb
214
+ query_string_params = if query_string_params.any?
215
+ query_string_params.to_h { |p| p.split("=", 2) }
216
+ else
217
+ {}
218
+ end
219
+
220
+ response = @client_stub.make_http_request(
221
+ verb,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ options: options
226
+ )
227
+ operation = ::Gapic::Rest::TransportOperation.new response
228
+ result = ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard.decode_json response.body, ignore_unknown_fields: true
229
+
230
+ yield result, operation if block_given?
231
+ result
232
+ end
233
+
234
+ ##
235
+ # @private
236
+ #
237
+ # GRPC transcoding helper method for the create_dashboard REST call
238
+ #
239
+ # @param request_pb [::Google::Cloud::Monitoring::Dashboard::V1::CreateDashboardRequest]
240
+ # A request object representing the call parameters. Required.
241
+ # @return [Array(String, [String, nil], Hash{String => String})]
242
+ # Uri, Body, Query string parameters
243
+ def self.transcode_create_dashboard_request request_pb
244
+ transcoder = Gapic::Rest::GrpcTranscoder.new
245
+ .with_bindings(
246
+ uri_method: :post,
247
+ uri_template: "/v1/{parent}/dashboards",
248
+ body: "dashboard",
249
+ matches: [
250
+ ["parent", %r{^projects/[^/]+/?$}, false]
251
+ ]
252
+ )
253
+ transcoder.transcode request_pb
254
+ end
255
+
256
+ ##
257
+ # @private
258
+ #
259
+ # GRPC transcoding helper method for the list_dashboards REST call
260
+ #
261
+ # @param request_pb [::Google::Cloud::Monitoring::Dashboard::V1::ListDashboardsRequest]
262
+ # A request object representing the call parameters. Required.
263
+ # @return [Array(String, [String, nil], Hash{String => String})]
264
+ # Uri, Body, Query string parameters
265
+ def self.transcode_list_dashboards_request request_pb
266
+ transcoder = Gapic::Rest::GrpcTranscoder.new
267
+ .with_bindings(
268
+ uri_method: :get,
269
+ uri_template: "/v1/{parent}/dashboards",
270
+ matches: [
271
+ ["parent", %r{^projects/[^/]+/?$}, false]
272
+ ]
273
+ )
274
+ transcoder.transcode request_pb
275
+ end
276
+
277
+ ##
278
+ # @private
279
+ #
280
+ # GRPC transcoding helper method for the get_dashboard REST call
281
+ #
282
+ # @param request_pb [::Google::Cloud::Monitoring::Dashboard::V1::GetDashboardRequest]
283
+ # A request object representing the call parameters. Required.
284
+ # @return [Array(String, [String, nil], Hash{String => String})]
285
+ # Uri, Body, Query string parameters
286
+ def self.transcode_get_dashboard_request request_pb
287
+ transcoder = Gapic::Rest::GrpcTranscoder.new
288
+ .with_bindings(
289
+ uri_method: :get,
290
+ uri_template: "/v1/{name}",
291
+ matches: [
292
+ ["name", %r{^projects/[^/]+/dashboards/[^/]+/?$}, false]
293
+ ]
294
+ )
295
+ transcoder.transcode request_pb
296
+ end
297
+
298
+ ##
299
+ # @private
300
+ #
301
+ # GRPC transcoding helper method for the delete_dashboard REST call
302
+ #
303
+ # @param request_pb [::Google::Cloud::Monitoring::Dashboard::V1::DeleteDashboardRequest]
304
+ # A request object representing the call parameters. Required.
305
+ # @return [Array(String, [String, nil], Hash{String => String})]
306
+ # Uri, Body, Query string parameters
307
+ def self.transcode_delete_dashboard_request request_pb
308
+ transcoder = Gapic::Rest::GrpcTranscoder.new
309
+ .with_bindings(
310
+ uri_method: :delete,
311
+ uri_template: "/v1/{name}",
312
+ matches: [
313
+ ["name", %r{^projects/[^/]+/dashboards/[^/]+/?$}, false]
314
+ ]
315
+ )
316
+ transcoder.transcode request_pb
317
+ end
318
+
319
+ ##
320
+ # @private
321
+ #
322
+ # GRPC transcoding helper method for the update_dashboard REST call
323
+ #
324
+ # @param request_pb [::Google::Cloud::Monitoring::Dashboard::V1::UpdateDashboardRequest]
325
+ # A request object representing the call parameters. Required.
326
+ # @return [Array(String, [String, nil], Hash{String => String})]
327
+ # Uri, Body, Query string parameters
328
+ def self.transcode_update_dashboard_request request_pb
329
+ transcoder = Gapic::Rest::GrpcTranscoder.new
330
+ .with_bindings(
331
+ uri_method: :patch,
332
+ uri_template: "/v1/{dashboard.name}",
333
+ body: "dashboard",
334
+ matches: [
335
+ ["dashboard.name", %r{^projects/[^/]+/dashboards/[^/]+/?$}, false]
336
+ ]
337
+ )
338
+ transcoder.transcode request_pb
339
+ end
340
+ end
341
+ end
342
+ end
343
+ end
344
+ end
345
+ end
346
+ end
347
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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 "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/monitoring/dashboard/v1/version"
24
+
25
+ require "google/cloud/monitoring/dashboard/v1/dashboards_service/credentials"
26
+ require "google/cloud/monitoring/dashboard/v1/dashboards_service/paths"
27
+ require "google/cloud/monitoring/dashboard/v1/dashboards_service/rest/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Monitoring
32
+ module Dashboard
33
+ module V1
34
+ ##
35
+ # Manages Stackdriver dashboards. A dashboard is an arrangement of data display
36
+ # widgets in a specific layout.
37
+ #
38
+ # To load this service and instantiate a REST client:
39
+ #
40
+ # require "google/cloud/monitoring/dashboard/v1/dashboards_service/rest"
41
+ # client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Rest::Client.new
42
+ #
43
+ module DashboardsService
44
+ # Client for the REST transport
45
+ module Rest
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+
54
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
55
+ require "google/cloud/monitoring/dashboard/v1/dashboards_service/rest/helpers" if ::File.file? helper_path
@@ -25,6 +25,7 @@ require "google/cloud/monitoring/dashboard/v1/version"
25
25
  require "google/cloud/monitoring/dashboard/v1/dashboards_service/credentials"
26
26
  require "google/cloud/monitoring/dashboard/v1/dashboards_service/paths"
27
27
  require "google/cloud/monitoring/dashboard/v1/dashboards_service/client"
28
+ require "google/cloud/monitoring/dashboard/v1/dashboards_service/rest"
28
29
 
29
30
  module Google
30
31
  module Cloud
@@ -40,6 +41,11 @@ module Google
40
41
  # require "google/cloud/monitoring/dashboard/v1/dashboards_service"
41
42
  # client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new
42
43
  #
44
+ # @example Load this service and instantiate a REST client
45
+ #
46
+ # require "google/cloud/monitoring/dashboard/v1/dashboards_service/rest"
47
+ # client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Rest::Client.new
48
+ #
43
49
  module DashboardsService
44
50
  end
45
51
  end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/monitoring/dashboard/v1/dashboards_service/rest"
20
+ require "google/cloud/monitoring/dashboard/v1/version"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Monitoring
25
+ module Dashboard
26
+ ##
27
+ # To load just the REST part of this package, including all its services, and instantiate a REST client:
28
+ #
29
+ # @example
30
+ #
31
+ # require "google/cloud/monitoring/dashboard/v1/rest"
32
+ # client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Rest::Client.new
33
+ #
34
+ module V1
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -22,7 +22,7 @@ module Google
22
22
  module Monitoring
23
23
  module Dashboard
24
24
  module V1
25
- VERSION = "0.10.0"
25
+ VERSION = "0.11.0"
26
26
  end
27
27
  end
28
28
  end
@@ -31,6 +31,11 @@ module Google
31
31
  # require "google/cloud/monitoring/dashboard/v1"
32
32
  # client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new
33
33
  #
34
+ # @example Load this package, including all its services, and instantiate a REST client
35
+ #
36
+ # require "google/cloud/monitoring/dashboard/v1"
37
+ # client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Rest::Client.new
38
+ #
34
39
  module V1
35
40
  end
36
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-monitoring-dashboard-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-12 00:00:00.000000000 Z
11
+ date: 2023-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.16.0
19
+ version: 0.18.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.16.0
29
+ version: 0.18.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -50,14 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 1.26.1
53
+ version: 1.26.3
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 1.26.1
60
+ version: 1.26.3
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: minitest
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -176,6 +176,10 @@ files:
176
176
  - lib/google/cloud/monitoring/dashboard/v1/dashboards_service/client.rb
177
177
  - lib/google/cloud/monitoring/dashboard/v1/dashboards_service/credentials.rb
178
178
  - lib/google/cloud/monitoring/dashboard/v1/dashboards_service/paths.rb
179
+ - lib/google/cloud/monitoring/dashboard/v1/dashboards_service/rest.rb
180
+ - lib/google/cloud/monitoring/dashboard/v1/dashboards_service/rest/client.rb
181
+ - lib/google/cloud/monitoring/dashboard/v1/dashboards_service/rest/service_stub.rb
182
+ - lib/google/cloud/monitoring/dashboard/v1/rest.rb
179
183
  - lib/google/cloud/monitoring/dashboard/v1/version.rb
180
184
  - lib/google/monitoring/dashboard/v1/alertchart_pb.rb
181
185
  - lib/google/monitoring/dashboard/v1/collapsible_group_pb.rb
@@ -239,5 +243,5 @@ requirements: []
239
243
  rubygems_version: 3.4.2
240
244
  signing_key:
241
245
  specification_version: 4
242
- summary: API Client library for the Cloud Monitoring Dashboards V1 API
246
+ summary: Manages your Cloud Monitoring data and configurations.
243
247
  test_files: []