google-cloud-observability-v1 0.a → 0.1.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 (34) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +153 -8
  5. data/lib/google/cloud/observability/v1/bindings_override.rb +107 -0
  6. data/lib/google/cloud/observability/v1/observability/client.rb +2738 -0
  7. data/lib/google/cloud/observability/v1/observability/credentials.rb +47 -0
  8. data/lib/google/cloud/observability/v1/observability/operations.rb +843 -0
  9. data/lib/google/cloud/observability/v1/observability/paths.rb +226 -0
  10. data/lib/google/cloud/observability/v1/observability/rest/client.rb +2549 -0
  11. data/lib/google/cloud/observability/v1/observability/rest/operations.rb +985 -0
  12. data/lib/google/cloud/observability/v1/observability/rest/service_stub.rb +1461 -0
  13. data/lib/google/cloud/observability/v1/observability/rest.rb +54 -0
  14. data/lib/google/cloud/observability/v1/observability.rb +56 -0
  15. data/lib/google/cloud/observability/v1/observability_pb.rb +65 -0
  16. data/lib/google/cloud/observability/v1/observability_services_pb.rb +87 -0
  17. data/lib/google/cloud/observability/v1/rest.rb +38 -0
  18. data/lib/google/cloud/observability/v1/version.rb +7 -2
  19. data/lib/google/cloud/observability/v1.rb +45 -0
  20. data/lib/google-cloud-observability-v1.rb +21 -0
  21. data/proto_docs/README.md +4 -0
  22. data/proto_docs/google/api/client.rb +593 -0
  23. data/proto_docs/google/api/field_behavior.rb +85 -0
  24. data/proto_docs/google/api/launch_stage.rb +71 -0
  25. data/proto_docs/google/api/resource.rb +227 -0
  26. data/proto_docs/google/cloud/observability/v1/observability.rb +709 -0
  27. data/proto_docs/google/longrunning/operations.rb +191 -0
  28. data/proto_docs/google/protobuf/any.rb +145 -0
  29. data/proto_docs/google/protobuf/duration.rb +98 -0
  30. data/proto_docs/google/protobuf/empty.rb +34 -0
  31. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  32. data/proto_docs/google/protobuf/timestamp.rb +128 -0
  33. data/proto_docs/google/rpc/status.rb +48 -0
  34. metadata +82 -9
@@ -0,0 +1,2738 @@
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/observability/v1/observability_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Observability
26
+ module V1
27
+ module Observability
28
+ ##
29
+ # Client for the Observability service.
30
+ #
31
+ # Service describing handlers for resources
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "observability.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :observability_stub
44
+
45
+ ##
46
+ # Configure the Observability Client class.
47
+ #
48
+ # See {::Google::Cloud::Observability::V1::Observability::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all Observability clients
54
+ # ::Google::Cloud::Observability::V1::Observability::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "Observability", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.rpcs.get_scope.timeout = 60.0
75
+ default_config.rpcs.get_scope.retry_policy = {
76
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
77
+ }
78
+
79
+ default_config.rpcs.update_scope.timeout = 60.0
80
+
81
+ default_config.rpcs.get_bucket.timeout = 60.0
82
+ default_config.rpcs.get_bucket.retry_policy = {
83
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
84
+ }
85
+
86
+ default_config.rpcs.list_buckets.timeout = 60.0
87
+ default_config.rpcs.list_buckets.retry_policy = {
88
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
89
+ }
90
+
91
+ default_config.rpcs.create_bucket.timeout = 60.0
92
+
93
+ default_config.rpcs.update_bucket.timeout = 60.0
94
+
95
+ default_config.rpcs.get_dataset.timeout = 60.0
96
+ default_config.rpcs.get_dataset.retry_policy = {
97
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
98
+ }
99
+
100
+ default_config.rpcs.list_datasets.timeout = 60.0
101
+ default_config.rpcs.list_datasets.retry_policy = {
102
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
103
+ }
104
+
105
+ default_config.rpcs.get_view.timeout = 60.0
106
+ default_config.rpcs.get_view.retry_policy = {
107
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
108
+ }
109
+
110
+ default_config.rpcs.list_views.timeout = 60.0
111
+ default_config.rpcs.list_views.retry_policy = {
112
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
113
+ }
114
+
115
+ default_config.rpcs.get_link.timeout = 60.0
116
+ default_config.rpcs.get_link.retry_policy = {
117
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
118
+ }
119
+
120
+ default_config.rpcs.list_links.timeout = 60.0
121
+ default_config.rpcs.list_links.retry_policy = {
122
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
123
+ }
124
+
125
+ default_config.rpcs.create_link.timeout = 60.0
126
+
127
+ default_config.rpcs.update_link.timeout = 60.0
128
+
129
+ default_config.rpcs.delete_link.timeout = 60.0
130
+
131
+ default_config.rpcs.get_trace_scope.timeout = 60.0
132
+ default_config.rpcs.get_trace_scope.retry_policy = {
133
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
134
+ }
135
+
136
+ default_config.rpcs.list_trace_scopes.timeout = 60.0
137
+ default_config.rpcs.list_trace_scopes.retry_policy = {
138
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
139
+ }
140
+
141
+ default_config.rpcs.create_trace_scope.timeout = 60.0
142
+
143
+ default_config.rpcs.update_trace_scope.timeout = 60.0
144
+
145
+ default_config.rpcs.delete_trace_scope.timeout = 60.0
146
+
147
+ default_config.rpcs.get_settings.timeout = 60.0
148
+ default_config.rpcs.get_settings.retry_policy = {
149
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
150
+ }
151
+
152
+ default_config.rpcs.update_settings.timeout = 60.0
153
+
154
+ default_config
155
+ end
156
+ yield @configure if block_given?
157
+ @configure
158
+ end
159
+
160
+ ##
161
+ # Configure the Observability Client instance.
162
+ #
163
+ # The configuration is set to the derived mode, meaning that values can be changed,
164
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
165
+ # should be made on {Client.configure}.
166
+ #
167
+ # See {::Google::Cloud::Observability::V1::Observability::Client::Configuration}
168
+ # for a description of the configuration fields.
169
+ #
170
+ # @yield [config] Configure the Client client.
171
+ # @yieldparam config [Client::Configuration]
172
+ #
173
+ # @return [Client::Configuration]
174
+ #
175
+ def configure
176
+ yield @config if block_given?
177
+ @config
178
+ end
179
+
180
+ ##
181
+ # The effective universe domain
182
+ #
183
+ # @return [String]
184
+ #
185
+ def universe_domain
186
+ @observability_stub.universe_domain
187
+ end
188
+
189
+ ##
190
+ # Create a new Observability client object.
191
+ #
192
+ # @example
193
+ #
194
+ # # Create a client using the default configuration
195
+ # client = ::Google::Cloud::Observability::V1::Observability::Client.new
196
+ #
197
+ # # Create a client using a custom configuration
198
+ # client = ::Google::Cloud::Observability::V1::Observability::Client.new do |config|
199
+ # config.timeout = 10.0
200
+ # end
201
+ #
202
+ # @yield [config] Configure the Observability client.
203
+ # @yieldparam config [Client::Configuration]
204
+ #
205
+ def initialize
206
+ # These require statements are intentionally placed here to initialize
207
+ # the gRPC module only when it's required.
208
+ # See https://github.com/googleapis/toolkit/issues/446
209
+ require "gapic/grpc"
210
+ require "google/cloud/observability/v1/observability_services_pb"
211
+
212
+ # Create the configuration object
213
+ @config = Configuration.new Client.configure
214
+
215
+ # Yield the configuration if needed
216
+ yield @config if block_given?
217
+
218
+ # Create credentials
219
+ credentials = @config.credentials
220
+ # Use self-signed JWT if the endpoint is unchanged from default,
221
+ # but only if the default endpoint does not have a region prefix.
222
+ enable_self_signed_jwt = @config.endpoint.nil? ||
223
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
224
+ !@config.endpoint.split(".").first.include?("-"))
225
+ credentials ||= Credentials.default scope: @config.scope,
226
+ enable_self_signed_jwt: enable_self_signed_jwt
227
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
228
+ credentials = Credentials.new credentials, scope: @config.scope
229
+ end
230
+ @quota_project_id = @config.quota_project
231
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
232
+
233
+ @operations_client = Operations.new do |config|
234
+ config.credentials = credentials
235
+ config.quota_project = @quota_project_id
236
+ config.endpoint = @config.endpoint
237
+ config.universe_domain = @config.universe_domain
238
+ end
239
+
240
+ @observability_stub = ::Gapic::ServiceStub.new(
241
+ ::Google::Cloud::Observability::V1::Observability::Stub,
242
+ credentials: credentials,
243
+ endpoint: @config.endpoint,
244
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
245
+ universe_domain: @config.universe_domain,
246
+ channel_args: @config.channel_args,
247
+ interceptors: @config.interceptors,
248
+ channel_pool_config: @config.channel_pool,
249
+ logger: @config.logger
250
+ )
251
+
252
+ @observability_stub.stub_logger&.info do |entry|
253
+ entry.set_system_name
254
+ entry.set_service
255
+ entry.message = "Created client for #{entry.service}"
256
+ entry.set_credentials_fields credentials
257
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
258
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
259
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
260
+ end
261
+
262
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
263
+ config.credentials = credentials
264
+ config.quota_project = @quota_project_id
265
+ config.endpoint = @observability_stub.endpoint
266
+ config.universe_domain = @observability_stub.universe_domain
267
+ config.logger = @observability_stub.logger if config.respond_to? :logger=
268
+ end
269
+ end
270
+
271
+ ##
272
+ # Get the associated client for long-running operations.
273
+ #
274
+ # @return [::Google::Cloud::Observability::V1::Observability::Operations]
275
+ #
276
+ attr_reader :operations_client
277
+
278
+ ##
279
+ # Get the associated client for mix-in of the Locations.
280
+ #
281
+ # @return [Google::Cloud::Location::Locations::Client]
282
+ #
283
+ attr_reader :location_client
284
+
285
+ ##
286
+ # The logger used for request/response debug logging.
287
+ #
288
+ # @return [Logger]
289
+ #
290
+ def logger
291
+ @observability_stub.logger
292
+ end
293
+
294
+ # Service calls
295
+
296
+ ##
297
+ # Gets details of a single Scope.
298
+ #
299
+ # @overload get_scope(request, options = nil)
300
+ # Pass arguments to `get_scope` via a request object, either of type
301
+ # {::Google::Cloud::Observability::V1::GetScopeRequest} or an equivalent Hash.
302
+ #
303
+ # @param request [::Google::Cloud::Observability::V1::GetScopeRequest, ::Hash]
304
+ # A request object representing the call parameters. Required. To specify no
305
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
306
+ # @param options [::Gapic::CallOptions, ::Hash]
307
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
308
+ #
309
+ # @overload get_scope(name: nil)
310
+ # Pass arguments to `get_scope` via keyword arguments. Note that at
311
+ # least one keyword argument is required. To specify no parameters, or to keep all
312
+ # the default parameter values, pass an empty Hash as a request object (see above).
313
+ #
314
+ # @param name [::String]
315
+ # Required. Name of the resource. The format is:
316
+ #
317
+ # projects/\\{project}/locations/\\{location}/scopes/\\{scope}
318
+ #
319
+ # The `{location}` field must be set to `global`. The `{scope}` field must
320
+ # be set to `_Default`.
321
+ #
322
+ # @yield [response, operation] Access the result along with the RPC operation
323
+ # @yieldparam response [::Google::Cloud::Observability::V1::Scope]
324
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
325
+ #
326
+ # @return [::Google::Cloud::Observability::V1::Scope]
327
+ #
328
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
329
+ #
330
+ # @example Basic example
331
+ # require "google/cloud/observability/v1"
332
+ #
333
+ # # Create a client object. The client can be reused for multiple calls.
334
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
335
+ #
336
+ # # Create a request. To set request fields, pass in keyword arguments.
337
+ # request = Google::Cloud::Observability::V1::GetScopeRequest.new
338
+ #
339
+ # # Call the get_scope method.
340
+ # result = client.get_scope request
341
+ #
342
+ # # The returned object is of type Google::Cloud::Observability::V1::Scope.
343
+ # p result
344
+ #
345
+ def get_scope request, options = nil
346
+ raise ::ArgumentError, "request must be provided" if request.nil?
347
+
348
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::GetScopeRequest
349
+
350
+ # Converts hash and nil to an options object
351
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
352
+
353
+ # Customize the options with defaults
354
+ metadata = @config.rpcs.get_scope.metadata.to_h
355
+
356
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
357
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
358
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
359
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
360
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
361
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
362
+
363
+ header_params = {}
364
+ if request.name
365
+ header_params["name"] = request.name
366
+ end
367
+
368
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
369
+ metadata[:"x-goog-request-params"] ||= request_params_header
370
+
371
+ options.apply_defaults timeout: @config.rpcs.get_scope.timeout,
372
+ metadata: metadata,
373
+ retry_policy: @config.rpcs.get_scope.retry_policy
374
+
375
+ options.apply_defaults timeout: @config.timeout,
376
+ metadata: @config.metadata,
377
+ retry_policy: @config.retry_policy
378
+
379
+ @observability_stub.call_rpc :get_scope, request, options: options do |response, operation|
380
+ yield response, operation if block_given?
381
+ end
382
+ rescue ::GRPC::BadStatus => e
383
+ raise ::Google::Cloud::Error.from_error(e)
384
+ end
385
+
386
+ ##
387
+ # Updates the parameters of a single Scope.
388
+ #
389
+ # @overload update_scope(request, options = nil)
390
+ # Pass arguments to `update_scope` via a request object, either of type
391
+ # {::Google::Cloud::Observability::V1::UpdateScopeRequest} or an equivalent Hash.
392
+ #
393
+ # @param request [::Google::Cloud::Observability::V1::UpdateScopeRequest, ::Hash]
394
+ # A request object representing the call parameters. Required. To specify no
395
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
396
+ # @param options [::Gapic::CallOptions, ::Hash]
397
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
398
+ #
399
+ # @overload update_scope(update_mask: nil, scope: nil)
400
+ # Pass arguments to `update_scope` via keyword arguments. Note that at
401
+ # least one keyword argument is required. To specify no parameters, or to keep all
402
+ # the default parameter values, pass an empty Hash as a request object (see above).
403
+ #
404
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
405
+ # Optional. Field mask is used to specify the fields to be overwritten in the
406
+ # Scope resource by the update.
407
+ # The fields specified in the update_mask are relative to the resource, not
408
+ # the full request. A field is overwritten when it is in the mask. If the
409
+ # user does not provide a mask, then all fields present in the request are
410
+ # overwritten.
411
+ # @param scope [::Google::Cloud::Observability::V1::Scope, ::Hash]
412
+ # Required. The resource being updated.
413
+ #
414
+ # @yield [response, operation] Access the result along with the RPC operation
415
+ # @yieldparam response [::Google::Cloud::Observability::V1::Scope]
416
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
417
+ #
418
+ # @return [::Google::Cloud::Observability::V1::Scope]
419
+ #
420
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
421
+ #
422
+ # @example Basic example
423
+ # require "google/cloud/observability/v1"
424
+ #
425
+ # # Create a client object. The client can be reused for multiple calls.
426
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
427
+ #
428
+ # # Create a request. To set request fields, pass in keyword arguments.
429
+ # request = Google::Cloud::Observability::V1::UpdateScopeRequest.new
430
+ #
431
+ # # Call the update_scope method.
432
+ # result = client.update_scope request
433
+ #
434
+ # # The returned object is of type Google::Cloud::Observability::V1::Scope.
435
+ # p result
436
+ #
437
+ def update_scope request, options = nil
438
+ raise ::ArgumentError, "request must be provided" if request.nil?
439
+
440
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::UpdateScopeRequest
441
+
442
+ # Converts hash and nil to an options object
443
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
444
+
445
+ # Customize the options with defaults
446
+ metadata = @config.rpcs.update_scope.metadata.to_h
447
+
448
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
449
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
450
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
451
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
452
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
453
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
454
+
455
+ header_params = {}
456
+ if request.scope&.name
457
+ header_params["scope.name"] = request.scope.name
458
+ end
459
+
460
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
461
+ metadata[:"x-goog-request-params"] ||= request_params_header
462
+
463
+ options.apply_defaults timeout: @config.rpcs.update_scope.timeout,
464
+ metadata: metadata,
465
+ retry_policy: @config.rpcs.update_scope.retry_policy
466
+
467
+ options.apply_defaults timeout: @config.timeout,
468
+ metadata: @config.metadata,
469
+ retry_policy: @config.retry_policy
470
+
471
+ @observability_stub.call_rpc :update_scope, request, options: options do |response, operation|
472
+ yield response, operation if block_given?
473
+ end
474
+ rescue ::GRPC::BadStatus => e
475
+ raise ::Google::Cloud::Error.from_error(e)
476
+ end
477
+
478
+ ##
479
+ # Get bucket resource.
480
+ #
481
+ # @overload get_bucket(request, options = nil)
482
+ # Pass arguments to `get_bucket` via a request object, either of type
483
+ # {::Google::Cloud::Observability::V1::GetBucketRequest} or an equivalent Hash.
484
+ #
485
+ # @param request [::Google::Cloud::Observability::V1::GetBucketRequest, ::Hash]
486
+ # A request object representing the call parameters. Required. To specify no
487
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
488
+ # @param options [::Gapic::CallOptions, ::Hash]
489
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
490
+ #
491
+ # @overload get_bucket(name: nil)
492
+ # Pass arguments to `get_bucket` via keyword arguments. Note that at
493
+ # least one keyword argument is required. To specify no parameters, or to keep all
494
+ # the default parameter values, pass an empty Hash as a request object (see above).
495
+ #
496
+ # @param name [::String]
497
+ # Required. Name of the bucket to retrieve. The format is:
498
+ #
499
+ # projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
500
+ #
501
+ # @yield [response, operation] Access the result along with the RPC operation
502
+ # @yieldparam response [::Google::Cloud::Observability::V1::Bucket]
503
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
504
+ #
505
+ # @return [::Google::Cloud::Observability::V1::Bucket]
506
+ #
507
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
508
+ #
509
+ # @example Basic example
510
+ # require "google/cloud/observability/v1"
511
+ #
512
+ # # Create a client object. The client can be reused for multiple calls.
513
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
514
+ #
515
+ # # Create a request. To set request fields, pass in keyword arguments.
516
+ # request = Google::Cloud::Observability::V1::GetBucketRequest.new
517
+ #
518
+ # # Call the get_bucket method.
519
+ # result = client.get_bucket request
520
+ #
521
+ # # The returned object is of type Google::Cloud::Observability::V1::Bucket.
522
+ # p result
523
+ #
524
+ def get_bucket request, options = nil
525
+ raise ::ArgumentError, "request must be provided" if request.nil?
526
+
527
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::GetBucketRequest
528
+
529
+ # Converts hash and nil to an options object
530
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
531
+
532
+ # Customize the options with defaults
533
+ metadata = @config.rpcs.get_bucket.metadata.to_h
534
+
535
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
536
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
537
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
538
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
539
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
540
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
541
+
542
+ header_params = {}
543
+ if request.name
544
+ header_params["name"] = request.name
545
+ end
546
+
547
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
548
+ metadata[:"x-goog-request-params"] ||= request_params_header
549
+
550
+ options.apply_defaults timeout: @config.rpcs.get_bucket.timeout,
551
+ metadata: metadata,
552
+ retry_policy: @config.rpcs.get_bucket.retry_policy
553
+
554
+ options.apply_defaults timeout: @config.timeout,
555
+ metadata: @config.metadata,
556
+ retry_policy: @config.retry_policy
557
+
558
+ @observability_stub.call_rpc :get_bucket, request, options: options do |response, operation|
559
+ yield response, operation if block_given?
560
+ end
561
+ rescue ::GRPC::BadStatus => e
562
+ raise ::Google::Cloud::Error.from_error(e)
563
+ end
564
+
565
+ ##
566
+ # List buckets of a project in a particular location.
567
+ #
568
+ # @overload list_buckets(request, options = nil)
569
+ # Pass arguments to `list_buckets` via a request object, either of type
570
+ # {::Google::Cloud::Observability::V1::ListBucketsRequest} or an equivalent Hash.
571
+ #
572
+ # @param request [::Google::Cloud::Observability::V1::ListBucketsRequest, ::Hash]
573
+ # A request object representing the call parameters. Required. To specify no
574
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
575
+ # @param options [::Gapic::CallOptions, ::Hash]
576
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
577
+ #
578
+ # @overload list_buckets(parent: nil, page_size: nil, page_token: nil, show_deleted: nil)
579
+ # Pass arguments to `list_buckets` via keyword arguments. Note that at
580
+ # least one keyword argument is required. To specify no parameters, or to keep all
581
+ # the default parameter values, pass an empty Hash as a request object (see above).
582
+ #
583
+ # @param parent [::String]
584
+ # Required. The parent, which owns this collection of buckets. The format is:
585
+ #
586
+ # projects/[PROJECT_ID]/locations/[LOCATION]
587
+ # @param page_size [::Integer]
588
+ # Optional. The maximum number of buckets to return. If unspecified, then at
589
+ # most 100 buckets are returned. The maximum value is 1000; values above 1000
590
+ # are coerced to 1000.
591
+ # @param page_token [::String]
592
+ # Optional. A page token, received from a previous `ListBuckets` call.
593
+ # Provide this to retrieve the subsequent page.
594
+ # @param show_deleted [::Boolean]
595
+ # Optional. If true, then the response will include deleted buckets.
596
+ #
597
+ # @yield [response, operation] Access the result along with the RPC operation
598
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Observability::V1::Bucket>]
599
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
600
+ #
601
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Observability::V1::Bucket>]
602
+ #
603
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
604
+ #
605
+ # @example Basic example
606
+ # require "google/cloud/observability/v1"
607
+ #
608
+ # # Create a client object. The client can be reused for multiple calls.
609
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
610
+ #
611
+ # # Create a request. To set request fields, pass in keyword arguments.
612
+ # request = Google::Cloud::Observability::V1::ListBucketsRequest.new
613
+ #
614
+ # # Call the list_buckets method.
615
+ # result = client.list_buckets request
616
+ #
617
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
618
+ # # over elements, and API calls will be issued to fetch pages as needed.
619
+ # result.each do |item|
620
+ # # Each element is of type ::Google::Cloud::Observability::V1::Bucket.
621
+ # p item
622
+ # end
623
+ #
624
+ def list_buckets request, options = nil
625
+ raise ::ArgumentError, "request must be provided" if request.nil?
626
+
627
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::ListBucketsRequest
628
+
629
+ # Converts hash and nil to an options object
630
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
631
+
632
+ # Customize the options with defaults
633
+ metadata = @config.rpcs.list_buckets.metadata.to_h
634
+
635
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
636
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
637
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
638
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
639
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
640
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
641
+
642
+ header_params = {}
643
+ if request.parent
644
+ header_params["parent"] = request.parent
645
+ end
646
+
647
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
648
+ metadata[:"x-goog-request-params"] ||= request_params_header
649
+
650
+ options.apply_defaults timeout: @config.rpcs.list_buckets.timeout,
651
+ metadata: metadata,
652
+ retry_policy: @config.rpcs.list_buckets.retry_policy
653
+
654
+ options.apply_defaults timeout: @config.timeout,
655
+ metadata: @config.metadata,
656
+ retry_policy: @config.retry_policy
657
+
658
+ @observability_stub.call_rpc :list_buckets, request, options: options do |response, operation|
659
+ response = ::Gapic::PagedEnumerable.new @observability_stub, :list_buckets, request, response, operation, options
660
+ yield response, operation if block_given?
661
+ throw :response, response
662
+ end
663
+ rescue ::GRPC::BadStatus => e
664
+ raise ::Google::Cloud::Error.from_error(e)
665
+ end
666
+
667
+ ##
668
+ # Create a new bucket.
669
+ #
670
+ # @overload create_bucket(request, options = nil)
671
+ # Pass arguments to `create_bucket` via a request object, either of type
672
+ # {::Google::Cloud::Observability::V1::CreateBucketRequest} or an equivalent Hash.
673
+ #
674
+ # @param request [::Google::Cloud::Observability::V1::CreateBucketRequest, ::Hash]
675
+ # A request object representing the call parameters. Required. To specify no
676
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
677
+ # @param options [::Gapic::CallOptions, ::Hash]
678
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
679
+ #
680
+ # @overload create_bucket(parent: nil, bucket_id: nil, bucket: nil)
681
+ # Pass arguments to `create_bucket` via keyword arguments. Note that at
682
+ # least one keyword argument is required. To specify no parameters, or to keep all
683
+ # the default parameter values, pass an empty Hash as a request object (see above).
684
+ #
685
+ # @param parent [::String]
686
+ # Required. Name of the project and location for the bucket. The format is:
687
+ #
688
+ # projects/[PROJECT_ID]/locations/[LOCATION]
689
+ # @param bucket_id [::String]
690
+ # Required. Id of the bucket to create.
691
+ # @param bucket [::Google::Cloud::Observability::V1::Bucket, ::Hash]
692
+ # Required. Bucket to create.
693
+ #
694
+ # @yield [response, operation] Access the result along with the RPC operation
695
+ # @yieldparam response [::Gapic::Operation]
696
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
697
+ #
698
+ # @return [::Gapic::Operation]
699
+ #
700
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
701
+ #
702
+ # @example Basic example
703
+ # require "google/cloud/observability/v1"
704
+ #
705
+ # # Create a client object. The client can be reused for multiple calls.
706
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
707
+ #
708
+ # # Create a request. To set request fields, pass in keyword arguments.
709
+ # request = Google::Cloud::Observability::V1::CreateBucketRequest.new
710
+ #
711
+ # # Call the create_bucket method.
712
+ # result = client.create_bucket request
713
+ #
714
+ # # The returned object is of type Gapic::Operation. You can use it to
715
+ # # check the status of an operation, cancel it, or wait for results.
716
+ # # Here is how to wait for a response.
717
+ # result.wait_until_done! timeout: 60
718
+ # if result.response?
719
+ # p result.response
720
+ # else
721
+ # puts "No response received."
722
+ # end
723
+ #
724
+ def create_bucket request, options = nil
725
+ raise ::ArgumentError, "request must be provided" if request.nil?
726
+
727
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::CreateBucketRequest
728
+
729
+ # Converts hash and nil to an options object
730
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
731
+
732
+ # Customize the options with defaults
733
+ metadata = @config.rpcs.create_bucket.metadata.to_h
734
+
735
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
736
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
737
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
738
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
739
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
740
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
741
+
742
+ header_params = {}
743
+ if request.parent
744
+ header_params["parent"] = request.parent
745
+ end
746
+
747
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
748
+ metadata[:"x-goog-request-params"] ||= request_params_header
749
+
750
+ options.apply_defaults timeout: @config.rpcs.create_bucket.timeout,
751
+ metadata: metadata,
752
+ retry_policy: @config.rpcs.create_bucket.retry_policy
753
+
754
+ options.apply_defaults timeout: @config.timeout,
755
+ metadata: @config.metadata,
756
+ retry_policy: @config.retry_policy
757
+
758
+ @observability_stub.call_rpc :create_bucket, request, options: options do |response, operation|
759
+ response = ::Gapic::Operation.new response, @operations_client, options: options
760
+ yield response, operation if block_given?
761
+ throw :response, response
762
+ end
763
+ rescue ::GRPC::BadStatus => e
764
+ raise ::Google::Cloud::Error.from_error(e)
765
+ end
766
+
767
+ ##
768
+ # Update a bucket.
769
+ #
770
+ # @overload update_bucket(request, options = nil)
771
+ # Pass arguments to `update_bucket` via a request object, either of type
772
+ # {::Google::Cloud::Observability::V1::UpdateBucketRequest} or an equivalent Hash.
773
+ #
774
+ # @param request [::Google::Cloud::Observability::V1::UpdateBucketRequest, ::Hash]
775
+ # A request object representing the call parameters. Required. To specify no
776
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
777
+ # @param options [::Gapic::CallOptions, ::Hash]
778
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
779
+ #
780
+ # @overload update_bucket(bucket: nil, update_mask: nil)
781
+ # Pass arguments to `update_bucket` via keyword arguments. Note that at
782
+ # least one keyword argument is required. To specify no parameters, or to keep all
783
+ # the default parameter values, pass an empty Hash as a request object (see above).
784
+ #
785
+ # @param bucket [::Google::Cloud::Observability::V1::Bucket, ::Hash]
786
+ # Required. The bucket to update.
787
+ #
788
+ # The name field of bucket identifies the resource to update.
789
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
790
+ # Optional. The list of fields to update.
791
+ #
792
+ # @yield [response, operation] Access the result along with the RPC operation
793
+ # @yieldparam response [::Gapic::Operation]
794
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
795
+ #
796
+ # @return [::Gapic::Operation]
797
+ #
798
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
799
+ #
800
+ # @example Basic example
801
+ # require "google/cloud/observability/v1"
802
+ #
803
+ # # Create a client object. The client can be reused for multiple calls.
804
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
805
+ #
806
+ # # Create a request. To set request fields, pass in keyword arguments.
807
+ # request = Google::Cloud::Observability::V1::UpdateBucketRequest.new
808
+ #
809
+ # # Call the update_bucket method.
810
+ # result = client.update_bucket request
811
+ #
812
+ # # The returned object is of type Gapic::Operation. You can use it to
813
+ # # check the status of an operation, cancel it, or wait for results.
814
+ # # Here is how to wait for a response.
815
+ # result.wait_until_done! timeout: 60
816
+ # if result.response?
817
+ # p result.response
818
+ # else
819
+ # puts "No response received."
820
+ # end
821
+ #
822
+ def update_bucket request, options = nil
823
+ raise ::ArgumentError, "request must be provided" if request.nil?
824
+
825
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::UpdateBucketRequest
826
+
827
+ # Converts hash and nil to an options object
828
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
829
+
830
+ # Customize the options with defaults
831
+ metadata = @config.rpcs.update_bucket.metadata.to_h
832
+
833
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
834
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
835
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
836
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
837
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
838
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
839
+
840
+ header_params = {}
841
+ if request.bucket&.name
842
+ header_params["bucket.name"] = request.bucket.name
843
+ end
844
+
845
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
846
+ metadata[:"x-goog-request-params"] ||= request_params_header
847
+
848
+ options.apply_defaults timeout: @config.rpcs.update_bucket.timeout,
849
+ metadata: metadata,
850
+ retry_policy: @config.rpcs.update_bucket.retry_policy
851
+
852
+ options.apply_defaults timeout: @config.timeout,
853
+ metadata: @config.metadata,
854
+ retry_policy: @config.retry_policy
855
+
856
+ @observability_stub.call_rpc :update_bucket, request, options: options do |response, operation|
857
+ response = ::Gapic::Operation.new response, @operations_client, options: options
858
+ yield response, operation if block_given?
859
+ throw :response, response
860
+ end
861
+ rescue ::GRPC::BadStatus => e
862
+ raise ::Google::Cloud::Error.from_error(e)
863
+ end
864
+
865
+ ##
866
+ # Get a dataset.
867
+ #
868
+ # @overload get_dataset(request, options = nil)
869
+ # Pass arguments to `get_dataset` via a request object, either of type
870
+ # {::Google::Cloud::Observability::V1::GetDatasetRequest} or an equivalent Hash.
871
+ #
872
+ # @param request [::Google::Cloud::Observability::V1::GetDatasetRequest, ::Hash]
873
+ # A request object representing the call parameters. Required. To specify no
874
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
875
+ # @param options [::Gapic::CallOptions, ::Hash]
876
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
877
+ #
878
+ # @overload get_dataset(name: nil)
879
+ # Pass arguments to `get_dataset` via keyword arguments. Note that at
880
+ # least one keyword argument is required. To specify no parameters, or to keep all
881
+ # the default parameter values, pass an empty Hash as a request object (see above).
882
+ #
883
+ # @param name [::String]
884
+ # Required. Name of the dataset to retrieve. The format is:
885
+ #
886
+ # projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]
887
+ #
888
+ # @yield [response, operation] Access the result along with the RPC operation
889
+ # @yieldparam response [::Google::Cloud::Observability::V1::Dataset]
890
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
891
+ #
892
+ # @return [::Google::Cloud::Observability::V1::Dataset]
893
+ #
894
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
895
+ #
896
+ # @example Basic example
897
+ # require "google/cloud/observability/v1"
898
+ #
899
+ # # Create a client object. The client can be reused for multiple calls.
900
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
901
+ #
902
+ # # Create a request. To set request fields, pass in keyword arguments.
903
+ # request = Google::Cloud::Observability::V1::GetDatasetRequest.new
904
+ #
905
+ # # Call the get_dataset method.
906
+ # result = client.get_dataset request
907
+ #
908
+ # # The returned object is of type Google::Cloud::Observability::V1::Dataset.
909
+ # p result
910
+ #
911
+ def get_dataset request, options = nil
912
+ raise ::ArgumentError, "request must be provided" if request.nil?
913
+
914
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::GetDatasetRequest
915
+
916
+ # Converts hash and nil to an options object
917
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
918
+
919
+ # Customize the options with defaults
920
+ metadata = @config.rpcs.get_dataset.metadata.to_h
921
+
922
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
923
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
924
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
925
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
926
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
927
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
928
+
929
+ header_params = {}
930
+ if request.name
931
+ header_params["name"] = request.name
932
+ end
933
+
934
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
935
+ metadata[:"x-goog-request-params"] ||= request_params_header
936
+
937
+ options.apply_defaults timeout: @config.rpcs.get_dataset.timeout,
938
+ metadata: metadata,
939
+ retry_policy: @config.rpcs.get_dataset.retry_policy
940
+
941
+ options.apply_defaults timeout: @config.timeout,
942
+ metadata: @config.metadata,
943
+ retry_policy: @config.retry_policy
944
+
945
+ @observability_stub.call_rpc :get_dataset, request, options: options do |response, operation|
946
+ yield response, operation if block_given?
947
+ end
948
+ rescue ::GRPC::BadStatus => e
949
+ raise ::Google::Cloud::Error.from_error(e)
950
+ end
951
+
952
+ ##
953
+ # List datasets of a bucket.
954
+ #
955
+ # @overload list_datasets(request, options = nil)
956
+ # Pass arguments to `list_datasets` via a request object, either of type
957
+ # {::Google::Cloud::Observability::V1::ListDatasetsRequest} or an equivalent Hash.
958
+ #
959
+ # @param request [::Google::Cloud::Observability::V1::ListDatasetsRequest, ::Hash]
960
+ # A request object representing the call parameters. Required. To specify no
961
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
962
+ # @param options [::Gapic::CallOptions, ::Hash]
963
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
964
+ #
965
+ # @overload list_datasets(parent: nil, page_size: nil, page_token: nil, show_deleted: nil)
966
+ # Pass arguments to `list_datasets` via keyword arguments. Note that at
967
+ # least one keyword argument is required. To specify no parameters, or to keep all
968
+ # the default parameter values, pass an empty Hash as a request object (see above).
969
+ #
970
+ # @param parent [::String]
971
+ # Required. The parent bucket that owns this collection of datasets. The
972
+ # format is:
973
+ #
974
+ # projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
975
+ # @param page_size [::Integer]
976
+ # Optional. The maximum number of datasets to return. If unspecified, then at
977
+ # most 100 datasets are returned. The maximum value is 1000; values above
978
+ # 1000 are coerced to 1000.
979
+ # @param page_token [::String]
980
+ # Optional. A page token, received from a previous `ListDatasets` call.
981
+ # Provide this to retrieve the subsequent page.
982
+ # @param show_deleted [::Boolean]
983
+ # Optional. If true, then the response will include deleted datasets.
984
+ #
985
+ # @yield [response, operation] Access the result along with the RPC operation
986
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Observability::V1::Dataset>]
987
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
988
+ #
989
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Observability::V1::Dataset>]
990
+ #
991
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
992
+ #
993
+ # @example Basic example
994
+ # require "google/cloud/observability/v1"
995
+ #
996
+ # # Create a client object. The client can be reused for multiple calls.
997
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
998
+ #
999
+ # # Create a request. To set request fields, pass in keyword arguments.
1000
+ # request = Google::Cloud::Observability::V1::ListDatasetsRequest.new
1001
+ #
1002
+ # # Call the list_datasets method.
1003
+ # result = client.list_datasets request
1004
+ #
1005
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1006
+ # # over elements, and API calls will be issued to fetch pages as needed.
1007
+ # result.each do |item|
1008
+ # # Each element is of type ::Google::Cloud::Observability::V1::Dataset.
1009
+ # p item
1010
+ # end
1011
+ #
1012
+ def list_datasets request, options = nil
1013
+ raise ::ArgumentError, "request must be provided" if request.nil?
1014
+
1015
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::ListDatasetsRequest
1016
+
1017
+ # Converts hash and nil to an options object
1018
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1019
+
1020
+ # Customize the options with defaults
1021
+ metadata = @config.rpcs.list_datasets.metadata.to_h
1022
+
1023
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1024
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1025
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1026
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
1027
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1028
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1029
+
1030
+ header_params = {}
1031
+ if request.parent
1032
+ header_params["parent"] = request.parent
1033
+ end
1034
+
1035
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1036
+ metadata[:"x-goog-request-params"] ||= request_params_header
1037
+
1038
+ options.apply_defaults timeout: @config.rpcs.list_datasets.timeout,
1039
+ metadata: metadata,
1040
+ retry_policy: @config.rpcs.list_datasets.retry_policy
1041
+
1042
+ options.apply_defaults timeout: @config.timeout,
1043
+ metadata: @config.metadata,
1044
+ retry_policy: @config.retry_policy
1045
+
1046
+ @observability_stub.call_rpc :list_datasets, request, options: options do |response, operation|
1047
+ response = ::Gapic::PagedEnumerable.new @observability_stub, :list_datasets, request, response, operation, options
1048
+ yield response, operation if block_given?
1049
+ throw :response, response
1050
+ end
1051
+ rescue ::GRPC::BadStatus => e
1052
+ raise ::Google::Cloud::Error.from_error(e)
1053
+ end
1054
+
1055
+ ##
1056
+ # Get a view.
1057
+ #
1058
+ # @overload get_view(request, options = nil)
1059
+ # Pass arguments to `get_view` via a request object, either of type
1060
+ # {::Google::Cloud::Observability::V1::GetViewRequest} or an equivalent Hash.
1061
+ #
1062
+ # @param request [::Google::Cloud::Observability::V1::GetViewRequest, ::Hash]
1063
+ # A request object representing the call parameters. Required. To specify no
1064
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1065
+ # @param options [::Gapic::CallOptions, ::Hash]
1066
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1067
+ #
1068
+ # @overload get_view(name: nil)
1069
+ # Pass arguments to `get_view` via keyword arguments. Note that at
1070
+ # least one keyword argument is required. To specify no parameters, or to keep all
1071
+ # the default parameter values, pass an empty Hash as a request object (see above).
1072
+ #
1073
+ # @param name [::String]
1074
+ # Required. Name of the view to retrieve. The format is:
1075
+ #
1076
+ # projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/views/[VIEW_ID]
1077
+ #
1078
+ # @yield [response, operation] Access the result along with the RPC operation
1079
+ # @yieldparam response [::Google::Cloud::Observability::V1::View]
1080
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1081
+ #
1082
+ # @return [::Google::Cloud::Observability::V1::View]
1083
+ #
1084
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1085
+ #
1086
+ # @example Basic example
1087
+ # require "google/cloud/observability/v1"
1088
+ #
1089
+ # # Create a client object. The client can be reused for multiple calls.
1090
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
1091
+ #
1092
+ # # Create a request. To set request fields, pass in keyword arguments.
1093
+ # request = Google::Cloud::Observability::V1::GetViewRequest.new
1094
+ #
1095
+ # # Call the get_view method.
1096
+ # result = client.get_view request
1097
+ #
1098
+ # # The returned object is of type Google::Cloud::Observability::V1::View.
1099
+ # p result
1100
+ #
1101
+ def get_view request, options = nil
1102
+ raise ::ArgumentError, "request must be provided" if request.nil?
1103
+
1104
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::GetViewRequest
1105
+
1106
+ # Converts hash and nil to an options object
1107
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1108
+
1109
+ # Customize the options with defaults
1110
+ metadata = @config.rpcs.get_view.metadata.to_h
1111
+
1112
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1113
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1114
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1115
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
1116
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1117
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1118
+
1119
+ header_params = {}
1120
+ if request.name
1121
+ header_params["name"] = request.name
1122
+ end
1123
+
1124
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1125
+ metadata[:"x-goog-request-params"] ||= request_params_header
1126
+
1127
+ options.apply_defaults timeout: @config.rpcs.get_view.timeout,
1128
+ metadata: metadata,
1129
+ retry_policy: @config.rpcs.get_view.retry_policy
1130
+
1131
+ options.apply_defaults timeout: @config.timeout,
1132
+ metadata: @config.metadata,
1133
+ retry_policy: @config.retry_policy
1134
+
1135
+ @observability_stub.call_rpc :get_view, request, options: options do |response, operation|
1136
+ yield response, operation if block_given?
1137
+ end
1138
+ rescue ::GRPC::BadStatus => e
1139
+ raise ::Google::Cloud::Error.from_error(e)
1140
+ end
1141
+
1142
+ ##
1143
+ # List views of a dataset.
1144
+ #
1145
+ # @overload list_views(request, options = nil)
1146
+ # Pass arguments to `list_views` via a request object, either of type
1147
+ # {::Google::Cloud::Observability::V1::ListViewsRequest} or an equivalent Hash.
1148
+ #
1149
+ # @param request [::Google::Cloud::Observability::V1::ListViewsRequest, ::Hash]
1150
+ # A request object representing the call parameters. Required. To specify no
1151
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1152
+ # @param options [::Gapic::CallOptions, ::Hash]
1153
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1154
+ #
1155
+ # @overload list_views(parent: nil, page_size: nil, page_token: nil)
1156
+ # Pass arguments to `list_views` via keyword arguments. Note that at
1157
+ # least one keyword argument is required. To specify no parameters, or to keep all
1158
+ # the default parameter values, pass an empty Hash as a request object (see above).
1159
+ #
1160
+ # @param parent [::String]
1161
+ # Required. Dataset whose views are to be listed. The format is:
1162
+ #
1163
+ # projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]
1164
+ # @param page_size [::Integer]
1165
+ # Optional. The maximum number of views to return. If unspecified, then at
1166
+ # most 100 views are returned. The maximum value is 1000; values above 1000
1167
+ # are coerced to 1000.
1168
+ # @param page_token [::String]
1169
+ # Optional. A page token, received from a previous `ListViews` call. Provide
1170
+ # this to retrieve the subsequent page.
1171
+ #
1172
+ # @yield [response, operation] Access the result along with the RPC operation
1173
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Observability::V1::View>]
1174
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1175
+ #
1176
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Observability::V1::View>]
1177
+ #
1178
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1179
+ #
1180
+ # @example Basic example
1181
+ # require "google/cloud/observability/v1"
1182
+ #
1183
+ # # Create a client object. The client can be reused for multiple calls.
1184
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
1185
+ #
1186
+ # # Create a request. To set request fields, pass in keyword arguments.
1187
+ # request = Google::Cloud::Observability::V1::ListViewsRequest.new
1188
+ #
1189
+ # # Call the list_views method.
1190
+ # result = client.list_views request
1191
+ #
1192
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1193
+ # # over elements, and API calls will be issued to fetch pages as needed.
1194
+ # result.each do |item|
1195
+ # # Each element is of type ::Google::Cloud::Observability::V1::View.
1196
+ # p item
1197
+ # end
1198
+ #
1199
+ def list_views request, options = nil
1200
+ raise ::ArgumentError, "request must be provided" if request.nil?
1201
+
1202
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::ListViewsRequest
1203
+
1204
+ # Converts hash and nil to an options object
1205
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1206
+
1207
+ # Customize the options with defaults
1208
+ metadata = @config.rpcs.list_views.metadata.to_h
1209
+
1210
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1211
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1212
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1213
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
1214
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1215
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1216
+
1217
+ header_params = {}
1218
+ if request.parent
1219
+ header_params["parent"] = request.parent
1220
+ end
1221
+
1222
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1223
+ metadata[:"x-goog-request-params"] ||= request_params_header
1224
+
1225
+ options.apply_defaults timeout: @config.rpcs.list_views.timeout,
1226
+ metadata: metadata,
1227
+ retry_policy: @config.rpcs.list_views.retry_policy
1228
+
1229
+ options.apply_defaults timeout: @config.timeout,
1230
+ metadata: @config.metadata,
1231
+ retry_policy: @config.retry_policy
1232
+
1233
+ @observability_stub.call_rpc :list_views, request, options: options do |response, operation|
1234
+ response = ::Gapic::PagedEnumerable.new @observability_stub, :list_views, request, response, operation, options
1235
+ yield response, operation if block_given?
1236
+ throw :response, response
1237
+ end
1238
+ rescue ::GRPC::BadStatus => e
1239
+ raise ::Google::Cloud::Error.from_error(e)
1240
+ end
1241
+
1242
+ ##
1243
+ # Get a link.
1244
+ #
1245
+ # @overload get_link(request, options = nil)
1246
+ # Pass arguments to `get_link` via a request object, either of type
1247
+ # {::Google::Cloud::Observability::V1::GetLinkRequest} or an equivalent Hash.
1248
+ #
1249
+ # @param request [::Google::Cloud::Observability::V1::GetLinkRequest, ::Hash]
1250
+ # A request object representing the call parameters. Required. To specify no
1251
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1252
+ # @param options [::Gapic::CallOptions, ::Hash]
1253
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1254
+ #
1255
+ # @overload get_link(name: nil)
1256
+ # Pass arguments to `get_link` via keyword arguments. Note that at
1257
+ # least one keyword argument is required. To specify no parameters, or to keep all
1258
+ # the default parameter values, pass an empty Hash as a request object (see above).
1259
+ #
1260
+ # @param name [::String]
1261
+ # Required. Name of the link to retrieve. The format is:
1262
+ #
1263
+ # projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/links/[LINK_ID]
1264
+ #
1265
+ # @yield [response, operation] Access the result along with the RPC operation
1266
+ # @yieldparam response [::Google::Cloud::Observability::V1::Link]
1267
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1268
+ #
1269
+ # @return [::Google::Cloud::Observability::V1::Link]
1270
+ #
1271
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1272
+ #
1273
+ # @example Basic example
1274
+ # require "google/cloud/observability/v1"
1275
+ #
1276
+ # # Create a client object. The client can be reused for multiple calls.
1277
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
1278
+ #
1279
+ # # Create a request. To set request fields, pass in keyword arguments.
1280
+ # request = Google::Cloud::Observability::V1::GetLinkRequest.new
1281
+ #
1282
+ # # Call the get_link method.
1283
+ # result = client.get_link request
1284
+ #
1285
+ # # The returned object is of type Google::Cloud::Observability::V1::Link.
1286
+ # p result
1287
+ #
1288
+ def get_link request, options = nil
1289
+ raise ::ArgumentError, "request must be provided" if request.nil?
1290
+
1291
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::GetLinkRequest
1292
+
1293
+ # Converts hash and nil to an options object
1294
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1295
+
1296
+ # Customize the options with defaults
1297
+ metadata = @config.rpcs.get_link.metadata.to_h
1298
+
1299
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1300
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1301
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1302
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
1303
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1304
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1305
+
1306
+ header_params = {}
1307
+ if request.name
1308
+ header_params["name"] = request.name
1309
+ end
1310
+
1311
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1312
+ metadata[:"x-goog-request-params"] ||= request_params_header
1313
+
1314
+ options.apply_defaults timeout: @config.rpcs.get_link.timeout,
1315
+ metadata: metadata,
1316
+ retry_policy: @config.rpcs.get_link.retry_policy
1317
+
1318
+ options.apply_defaults timeout: @config.timeout,
1319
+ metadata: @config.metadata,
1320
+ retry_policy: @config.retry_policy
1321
+
1322
+ @observability_stub.call_rpc :get_link, request, options: options do |response, operation|
1323
+ yield response, operation if block_given?
1324
+ end
1325
+ rescue ::GRPC::BadStatus => e
1326
+ raise ::Google::Cloud::Error.from_error(e)
1327
+ end
1328
+
1329
+ ##
1330
+ # List links of a dataset.
1331
+ #
1332
+ # @overload list_links(request, options = nil)
1333
+ # Pass arguments to `list_links` via a request object, either of type
1334
+ # {::Google::Cloud::Observability::V1::ListLinksRequest} or an equivalent Hash.
1335
+ #
1336
+ # @param request [::Google::Cloud::Observability::V1::ListLinksRequest, ::Hash]
1337
+ # A request object representing the call parameters. Required. To specify no
1338
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1339
+ # @param options [::Gapic::CallOptions, ::Hash]
1340
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1341
+ #
1342
+ # @overload list_links(parent: nil, page_size: nil, page_token: nil)
1343
+ # Pass arguments to `list_links` via keyword arguments. Note that at
1344
+ # least one keyword argument is required. To specify no parameters, or to keep all
1345
+ # the default parameter values, pass an empty Hash as a request object (see above).
1346
+ #
1347
+ # @param parent [::String]
1348
+ # Required. The parent dataset that owns this collection of links. The format
1349
+ # is:
1350
+ #
1351
+ # projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]
1352
+ # @param page_size [::Integer]
1353
+ # Optional. The maximum number of links to return. If unspecified, then at
1354
+ # most 100 links are returned. The maximum value is 1000; values above 1000
1355
+ # are coerced to 1000.
1356
+ # @param page_token [::String]
1357
+ # Optional. A page token, received from a previous `ListLinks` call. Provide
1358
+ # this to retrieve the subsequent page.
1359
+ #
1360
+ # @yield [response, operation] Access the result along with the RPC operation
1361
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Observability::V1::Link>]
1362
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1363
+ #
1364
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Observability::V1::Link>]
1365
+ #
1366
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1367
+ #
1368
+ # @example Basic example
1369
+ # require "google/cloud/observability/v1"
1370
+ #
1371
+ # # Create a client object. The client can be reused for multiple calls.
1372
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
1373
+ #
1374
+ # # Create a request. To set request fields, pass in keyword arguments.
1375
+ # request = Google::Cloud::Observability::V1::ListLinksRequest.new
1376
+ #
1377
+ # # Call the list_links method.
1378
+ # result = client.list_links request
1379
+ #
1380
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1381
+ # # over elements, and API calls will be issued to fetch pages as needed.
1382
+ # result.each do |item|
1383
+ # # Each element is of type ::Google::Cloud::Observability::V1::Link.
1384
+ # p item
1385
+ # end
1386
+ #
1387
+ def list_links request, options = nil
1388
+ raise ::ArgumentError, "request must be provided" if request.nil?
1389
+
1390
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::ListLinksRequest
1391
+
1392
+ # Converts hash and nil to an options object
1393
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1394
+
1395
+ # Customize the options with defaults
1396
+ metadata = @config.rpcs.list_links.metadata.to_h
1397
+
1398
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1399
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1400
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1401
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
1402
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1403
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1404
+
1405
+ header_params = {}
1406
+ if request.parent
1407
+ header_params["parent"] = request.parent
1408
+ end
1409
+
1410
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1411
+ metadata[:"x-goog-request-params"] ||= request_params_header
1412
+
1413
+ options.apply_defaults timeout: @config.rpcs.list_links.timeout,
1414
+ metadata: metadata,
1415
+ retry_policy: @config.rpcs.list_links.retry_policy
1416
+
1417
+ options.apply_defaults timeout: @config.timeout,
1418
+ metadata: @config.metadata,
1419
+ retry_policy: @config.retry_policy
1420
+
1421
+ @observability_stub.call_rpc :list_links, request, options: options do |response, operation|
1422
+ response = ::Gapic::PagedEnumerable.new @observability_stub, :list_links, request, response, operation, options
1423
+ yield response, operation if block_given?
1424
+ throw :response, response
1425
+ end
1426
+ rescue ::GRPC::BadStatus => e
1427
+ raise ::Google::Cloud::Error.from_error(e)
1428
+ end
1429
+
1430
+ ##
1431
+ # Create a new link.
1432
+ #
1433
+ # @overload create_link(request, options = nil)
1434
+ # Pass arguments to `create_link` via a request object, either of type
1435
+ # {::Google::Cloud::Observability::V1::CreateLinkRequest} or an equivalent Hash.
1436
+ #
1437
+ # @param request [::Google::Cloud::Observability::V1::CreateLinkRequest, ::Hash]
1438
+ # A request object representing the call parameters. Required. To specify no
1439
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1440
+ # @param options [::Gapic::CallOptions, ::Hash]
1441
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1442
+ #
1443
+ # @overload create_link(parent: nil, link_id: nil, link: nil)
1444
+ # Pass arguments to `create_link` via keyword arguments. Note that at
1445
+ # least one keyword argument is required. To specify no parameters, or to keep all
1446
+ # the default parameter values, pass an empty Hash as a request object (see above).
1447
+ #
1448
+ # @param parent [::String]
1449
+ # Required. Name of the containing dataset for this link. The format is:
1450
+ #
1451
+ # projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]
1452
+ # @param link_id [::String]
1453
+ # Required. Id of the link to create.
1454
+ # @param link [::Google::Cloud::Observability::V1::Link, ::Hash]
1455
+ # Required. Link to create.
1456
+ #
1457
+ # @yield [response, operation] Access the result along with the RPC operation
1458
+ # @yieldparam response [::Gapic::Operation]
1459
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1460
+ #
1461
+ # @return [::Gapic::Operation]
1462
+ #
1463
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1464
+ #
1465
+ # @example Basic example
1466
+ # require "google/cloud/observability/v1"
1467
+ #
1468
+ # # Create a client object. The client can be reused for multiple calls.
1469
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
1470
+ #
1471
+ # # Create a request. To set request fields, pass in keyword arguments.
1472
+ # request = Google::Cloud::Observability::V1::CreateLinkRequest.new
1473
+ #
1474
+ # # Call the create_link method.
1475
+ # result = client.create_link request
1476
+ #
1477
+ # # The returned object is of type Gapic::Operation. You can use it to
1478
+ # # check the status of an operation, cancel it, or wait for results.
1479
+ # # Here is how to wait for a response.
1480
+ # result.wait_until_done! timeout: 60
1481
+ # if result.response?
1482
+ # p result.response
1483
+ # else
1484
+ # puts "No response received."
1485
+ # end
1486
+ #
1487
+ def create_link request, options = nil
1488
+ raise ::ArgumentError, "request must be provided" if request.nil?
1489
+
1490
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::CreateLinkRequest
1491
+
1492
+ # Converts hash and nil to an options object
1493
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1494
+
1495
+ # Customize the options with defaults
1496
+ metadata = @config.rpcs.create_link.metadata.to_h
1497
+
1498
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1499
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1500
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1501
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
1502
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1503
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1504
+
1505
+ header_params = {}
1506
+ if request.parent
1507
+ header_params["parent"] = request.parent
1508
+ end
1509
+
1510
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1511
+ metadata[:"x-goog-request-params"] ||= request_params_header
1512
+
1513
+ options.apply_defaults timeout: @config.rpcs.create_link.timeout,
1514
+ metadata: metadata,
1515
+ retry_policy: @config.rpcs.create_link.retry_policy
1516
+
1517
+ options.apply_defaults timeout: @config.timeout,
1518
+ metadata: @config.metadata,
1519
+ retry_policy: @config.retry_policy
1520
+
1521
+ @observability_stub.call_rpc :create_link, request, options: options do |response, operation|
1522
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1523
+ yield response, operation if block_given?
1524
+ throw :response, response
1525
+ end
1526
+ rescue ::GRPC::BadStatus => e
1527
+ raise ::Google::Cloud::Error.from_error(e)
1528
+ end
1529
+
1530
+ ##
1531
+ # Update a link.
1532
+ #
1533
+ # @overload update_link(request, options = nil)
1534
+ # Pass arguments to `update_link` via a request object, either of type
1535
+ # {::Google::Cloud::Observability::V1::UpdateLinkRequest} or an equivalent Hash.
1536
+ #
1537
+ # @param request [::Google::Cloud::Observability::V1::UpdateLinkRequest, ::Hash]
1538
+ # A request object representing the call parameters. Required. To specify no
1539
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1540
+ # @param options [::Gapic::CallOptions, ::Hash]
1541
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1542
+ #
1543
+ # @overload update_link(link: nil, update_mask: nil)
1544
+ # Pass arguments to `update_link` via keyword arguments. Note that at
1545
+ # least one keyword argument is required. To specify no parameters, or to keep all
1546
+ # the default parameter values, pass an empty Hash as a request object (see above).
1547
+ #
1548
+ # @param link [::Google::Cloud::Observability::V1::Link, ::Hash]
1549
+ # Required. Link to update.
1550
+ #
1551
+ # The name field of link identifies the resource to update.
1552
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1553
+ # Optional. The list of fields to update.
1554
+ #
1555
+ # @yield [response, operation] Access the result along with the RPC operation
1556
+ # @yieldparam response [::Gapic::Operation]
1557
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1558
+ #
1559
+ # @return [::Gapic::Operation]
1560
+ #
1561
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1562
+ #
1563
+ # @example Basic example
1564
+ # require "google/cloud/observability/v1"
1565
+ #
1566
+ # # Create a client object. The client can be reused for multiple calls.
1567
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
1568
+ #
1569
+ # # Create a request. To set request fields, pass in keyword arguments.
1570
+ # request = Google::Cloud::Observability::V1::UpdateLinkRequest.new
1571
+ #
1572
+ # # Call the update_link method.
1573
+ # result = client.update_link request
1574
+ #
1575
+ # # The returned object is of type Gapic::Operation. You can use it to
1576
+ # # check the status of an operation, cancel it, or wait for results.
1577
+ # # Here is how to wait for a response.
1578
+ # result.wait_until_done! timeout: 60
1579
+ # if result.response?
1580
+ # p result.response
1581
+ # else
1582
+ # puts "No response received."
1583
+ # end
1584
+ #
1585
+ def update_link request, options = nil
1586
+ raise ::ArgumentError, "request must be provided" if request.nil?
1587
+
1588
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::UpdateLinkRequest
1589
+
1590
+ # Converts hash and nil to an options object
1591
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1592
+
1593
+ # Customize the options with defaults
1594
+ metadata = @config.rpcs.update_link.metadata.to_h
1595
+
1596
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1597
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1598
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1599
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
1600
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1601
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1602
+
1603
+ header_params = {}
1604
+ if request.link&.name
1605
+ header_params["link.name"] = request.link.name
1606
+ end
1607
+
1608
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1609
+ metadata[:"x-goog-request-params"] ||= request_params_header
1610
+
1611
+ options.apply_defaults timeout: @config.rpcs.update_link.timeout,
1612
+ metadata: metadata,
1613
+ retry_policy: @config.rpcs.update_link.retry_policy
1614
+
1615
+ options.apply_defaults timeout: @config.timeout,
1616
+ metadata: @config.metadata,
1617
+ retry_policy: @config.retry_policy
1618
+
1619
+ @observability_stub.call_rpc :update_link, request, options: options do |response, operation|
1620
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1621
+ yield response, operation if block_given?
1622
+ throw :response, response
1623
+ end
1624
+ rescue ::GRPC::BadStatus => e
1625
+ raise ::Google::Cloud::Error.from_error(e)
1626
+ end
1627
+
1628
+ ##
1629
+ # Delete a link.
1630
+ #
1631
+ # @overload delete_link(request, options = nil)
1632
+ # Pass arguments to `delete_link` via a request object, either of type
1633
+ # {::Google::Cloud::Observability::V1::DeleteLinkRequest} or an equivalent Hash.
1634
+ #
1635
+ # @param request [::Google::Cloud::Observability::V1::DeleteLinkRequest, ::Hash]
1636
+ # A request object representing the call parameters. Required. To specify no
1637
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1638
+ # @param options [::Gapic::CallOptions, ::Hash]
1639
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1640
+ #
1641
+ # @overload delete_link(name: nil)
1642
+ # Pass arguments to `delete_link` via keyword arguments. Note that at
1643
+ # least one keyword argument is required. To specify no parameters, or to keep all
1644
+ # the default parameter values, pass an empty Hash as a request object (see above).
1645
+ #
1646
+ # @param name [::String]
1647
+ # Required. Name of the link to delete. The format is:
1648
+ #
1649
+ # projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/links/[LINK_ID]
1650
+ #
1651
+ # @yield [response, operation] Access the result along with the RPC operation
1652
+ # @yieldparam response [::Gapic::Operation]
1653
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1654
+ #
1655
+ # @return [::Gapic::Operation]
1656
+ #
1657
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1658
+ #
1659
+ # @example Basic example
1660
+ # require "google/cloud/observability/v1"
1661
+ #
1662
+ # # Create a client object. The client can be reused for multiple calls.
1663
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
1664
+ #
1665
+ # # Create a request. To set request fields, pass in keyword arguments.
1666
+ # request = Google::Cloud::Observability::V1::DeleteLinkRequest.new
1667
+ #
1668
+ # # Call the delete_link method.
1669
+ # result = client.delete_link request
1670
+ #
1671
+ # # The returned object is of type Gapic::Operation. You can use it to
1672
+ # # check the status of an operation, cancel it, or wait for results.
1673
+ # # Here is how to wait for a response.
1674
+ # result.wait_until_done! timeout: 60
1675
+ # if result.response?
1676
+ # p result.response
1677
+ # else
1678
+ # puts "No response received."
1679
+ # end
1680
+ #
1681
+ def delete_link request, options = nil
1682
+ raise ::ArgumentError, "request must be provided" if request.nil?
1683
+
1684
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::DeleteLinkRequest
1685
+
1686
+ # Converts hash and nil to an options object
1687
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1688
+
1689
+ # Customize the options with defaults
1690
+ metadata = @config.rpcs.delete_link.metadata.to_h
1691
+
1692
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1693
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1694
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1695
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
1696
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1697
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1698
+
1699
+ header_params = {}
1700
+ if request.name
1701
+ header_params["name"] = request.name
1702
+ end
1703
+
1704
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1705
+ metadata[:"x-goog-request-params"] ||= request_params_header
1706
+
1707
+ options.apply_defaults timeout: @config.rpcs.delete_link.timeout,
1708
+ metadata: metadata,
1709
+ retry_policy: @config.rpcs.delete_link.retry_policy
1710
+
1711
+ options.apply_defaults timeout: @config.timeout,
1712
+ metadata: @config.metadata,
1713
+ retry_policy: @config.retry_policy
1714
+
1715
+ @observability_stub.call_rpc :delete_link, request, options: options do |response, operation|
1716
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1717
+ yield response, operation if block_given?
1718
+ throw :response, response
1719
+ end
1720
+ rescue ::GRPC::BadStatus => e
1721
+ raise ::Google::Cloud::Error.from_error(e)
1722
+ end
1723
+
1724
+ ##
1725
+ # Get TraceScope resource.
1726
+ #
1727
+ # @overload get_trace_scope(request, options = nil)
1728
+ # Pass arguments to `get_trace_scope` via a request object, either of type
1729
+ # {::Google::Cloud::Observability::V1::GetTraceScopeRequest} or an equivalent Hash.
1730
+ #
1731
+ # @param request [::Google::Cloud::Observability::V1::GetTraceScopeRequest, ::Hash]
1732
+ # A request object representing the call parameters. Required. To specify no
1733
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1734
+ # @param options [::Gapic::CallOptions, ::Hash]
1735
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1736
+ #
1737
+ # @overload get_trace_scope(name: nil)
1738
+ # Pass arguments to `get_trace_scope` via keyword arguments. Note that at
1739
+ # least one keyword argument is required. To specify no parameters, or to keep all
1740
+ # the default parameter values, pass an empty Hash as a request object (see above).
1741
+ #
1742
+ # @param name [::String]
1743
+ # Required. The resource name of the trace scope:
1744
+ #
1745
+ # projects/[PROJECT_ID]/locations/[LOCATION_ID]/traceScopes/[TRACE_SCOPE_ID]
1746
+ #
1747
+ # For example:
1748
+ #
1749
+ # projects/my-project/locations/global/traceScopes/my-trace-scope
1750
+ #
1751
+ # @yield [response, operation] Access the result along with the RPC operation
1752
+ # @yieldparam response [::Google::Cloud::Observability::V1::TraceScope]
1753
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1754
+ #
1755
+ # @return [::Google::Cloud::Observability::V1::TraceScope]
1756
+ #
1757
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1758
+ #
1759
+ # @example Basic example
1760
+ # require "google/cloud/observability/v1"
1761
+ #
1762
+ # # Create a client object. The client can be reused for multiple calls.
1763
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
1764
+ #
1765
+ # # Create a request. To set request fields, pass in keyword arguments.
1766
+ # request = Google::Cloud::Observability::V1::GetTraceScopeRequest.new
1767
+ #
1768
+ # # Call the get_trace_scope method.
1769
+ # result = client.get_trace_scope request
1770
+ #
1771
+ # # The returned object is of type Google::Cloud::Observability::V1::TraceScope.
1772
+ # p result
1773
+ #
1774
+ def get_trace_scope request, options = nil
1775
+ raise ::ArgumentError, "request must be provided" if request.nil?
1776
+
1777
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::GetTraceScopeRequest
1778
+
1779
+ # Converts hash and nil to an options object
1780
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1781
+
1782
+ # Customize the options with defaults
1783
+ metadata = @config.rpcs.get_trace_scope.metadata.to_h
1784
+
1785
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1786
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1787
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1788
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
1789
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1790
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1791
+
1792
+ header_params = {}
1793
+ if request.name
1794
+ header_params["name"] = request.name
1795
+ end
1796
+
1797
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1798
+ metadata[:"x-goog-request-params"] ||= request_params_header
1799
+
1800
+ options.apply_defaults timeout: @config.rpcs.get_trace_scope.timeout,
1801
+ metadata: metadata,
1802
+ retry_policy: @config.rpcs.get_trace_scope.retry_policy
1803
+
1804
+ options.apply_defaults timeout: @config.timeout,
1805
+ metadata: @config.metadata,
1806
+ retry_policy: @config.retry_policy
1807
+
1808
+ @observability_stub.call_rpc :get_trace_scope, request, options: options do |response, operation|
1809
+ yield response, operation if block_given?
1810
+ end
1811
+ rescue ::GRPC::BadStatus => e
1812
+ raise ::Google::Cloud::Error.from_error(e)
1813
+ end
1814
+
1815
+ ##
1816
+ # List TraceScopes of a project in a particular location.
1817
+ #
1818
+ # @overload list_trace_scopes(request, options = nil)
1819
+ # Pass arguments to `list_trace_scopes` via a request object, either of type
1820
+ # {::Google::Cloud::Observability::V1::ListTraceScopesRequest} or an equivalent Hash.
1821
+ #
1822
+ # @param request [::Google::Cloud::Observability::V1::ListTraceScopesRequest, ::Hash]
1823
+ # A request object representing the call parameters. Required. To specify no
1824
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1825
+ # @param options [::Gapic::CallOptions, ::Hash]
1826
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1827
+ #
1828
+ # @overload list_trace_scopes(parent: nil, page_size: nil, page_token: nil)
1829
+ # Pass arguments to `list_trace_scopes` via keyword arguments. Note that at
1830
+ # least one keyword argument is required. To specify no parameters, or to keep all
1831
+ # the default parameter values, pass an empty Hash as a request object (see above).
1832
+ #
1833
+ # @param parent [::String]
1834
+ # Required. The full resource name of the location to look for trace scopes:
1835
+ #
1836
+ # projects/[PROJECT_ID]/locations/[LOCATION_ID]
1837
+ #
1838
+ # For example:
1839
+ #
1840
+ # projects/my-project/locations/global
1841
+ # @param page_size [::Integer]
1842
+ # Optional. The maximum number of results to return from this request.
1843
+ #
1844
+ # Non-positive values are ignored. The presence of `next_page_token` in the
1845
+ # response indicates that more results might be available.
1846
+ # @param page_token [::String]
1847
+ # Optional. If present, then retrieve the next batch of results from the
1848
+ # preceding call to this method. `page_token` must be the value of
1849
+ # `next_page_token` from the previous response. The values of other method
1850
+ # parameters should be identical to those in the previous call.
1851
+ #
1852
+ # @yield [response, operation] Access the result along with the RPC operation
1853
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Observability::V1::TraceScope>]
1854
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1855
+ #
1856
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Observability::V1::TraceScope>]
1857
+ #
1858
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1859
+ #
1860
+ # @example Basic example
1861
+ # require "google/cloud/observability/v1"
1862
+ #
1863
+ # # Create a client object. The client can be reused for multiple calls.
1864
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
1865
+ #
1866
+ # # Create a request. To set request fields, pass in keyword arguments.
1867
+ # request = Google::Cloud::Observability::V1::ListTraceScopesRequest.new
1868
+ #
1869
+ # # Call the list_trace_scopes method.
1870
+ # result = client.list_trace_scopes request
1871
+ #
1872
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1873
+ # # over elements, and API calls will be issued to fetch pages as needed.
1874
+ # result.each do |item|
1875
+ # # Each element is of type ::Google::Cloud::Observability::V1::TraceScope.
1876
+ # p item
1877
+ # end
1878
+ #
1879
+ def list_trace_scopes request, options = nil
1880
+ raise ::ArgumentError, "request must be provided" if request.nil?
1881
+
1882
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::ListTraceScopesRequest
1883
+
1884
+ # Converts hash and nil to an options object
1885
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1886
+
1887
+ # Customize the options with defaults
1888
+ metadata = @config.rpcs.list_trace_scopes.metadata.to_h
1889
+
1890
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1891
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1892
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1893
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
1894
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1895
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1896
+
1897
+ header_params = {}
1898
+ if request.parent
1899
+ header_params["parent"] = request.parent
1900
+ end
1901
+
1902
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1903
+ metadata[:"x-goog-request-params"] ||= request_params_header
1904
+
1905
+ options.apply_defaults timeout: @config.rpcs.list_trace_scopes.timeout,
1906
+ metadata: metadata,
1907
+ retry_policy: @config.rpcs.list_trace_scopes.retry_policy
1908
+
1909
+ options.apply_defaults timeout: @config.timeout,
1910
+ metadata: @config.metadata,
1911
+ retry_policy: @config.retry_policy
1912
+
1913
+ @observability_stub.call_rpc :list_trace_scopes, request, options: options do |response, operation|
1914
+ response = ::Gapic::PagedEnumerable.new @observability_stub, :list_trace_scopes, request, response, operation, options
1915
+ yield response, operation if block_given?
1916
+ throw :response, response
1917
+ end
1918
+ rescue ::GRPC::BadStatus => e
1919
+ raise ::Google::Cloud::Error.from_error(e)
1920
+ end
1921
+
1922
+ ##
1923
+ # Create a new TraceScope.
1924
+ #
1925
+ # @overload create_trace_scope(request, options = nil)
1926
+ # Pass arguments to `create_trace_scope` via a request object, either of type
1927
+ # {::Google::Cloud::Observability::V1::CreateTraceScopeRequest} or an equivalent Hash.
1928
+ #
1929
+ # @param request [::Google::Cloud::Observability::V1::CreateTraceScopeRequest, ::Hash]
1930
+ # A request object representing the call parameters. Required. To specify no
1931
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1932
+ # @param options [::Gapic::CallOptions, ::Hash]
1933
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1934
+ #
1935
+ # @overload create_trace_scope(parent: nil, trace_scope_id: nil, trace_scope: nil)
1936
+ # Pass arguments to `create_trace_scope` via keyword arguments. Note that at
1937
+ # least one keyword argument is required. To specify no parameters, or to keep all
1938
+ # the default parameter values, pass an empty Hash as a request object (see above).
1939
+ #
1940
+ # @param parent [::String]
1941
+ # Required. The full resource name of the location where the trace scope
1942
+ # should be created
1943
+ #
1944
+ # projects/[PROJECT_ID]/locations/[LOCATION_ID]
1945
+ #
1946
+ # For example:
1947
+ #
1948
+ # projects/my-project/locations/global
1949
+ # @param trace_scope_id [::String]
1950
+ # Required. A client-assigned identifier for the trace scope.
1951
+ # @param trace_scope [::Google::Cloud::Observability::V1::TraceScope, ::Hash]
1952
+ # Required. The new trace scope.
1953
+ #
1954
+ # @yield [response, operation] Access the result along with the RPC operation
1955
+ # @yieldparam response [::Google::Cloud::Observability::V1::TraceScope]
1956
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1957
+ #
1958
+ # @return [::Google::Cloud::Observability::V1::TraceScope]
1959
+ #
1960
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1961
+ #
1962
+ # @example Basic example
1963
+ # require "google/cloud/observability/v1"
1964
+ #
1965
+ # # Create a client object. The client can be reused for multiple calls.
1966
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
1967
+ #
1968
+ # # Create a request. To set request fields, pass in keyword arguments.
1969
+ # request = Google::Cloud::Observability::V1::CreateTraceScopeRequest.new
1970
+ #
1971
+ # # Call the create_trace_scope method.
1972
+ # result = client.create_trace_scope request
1973
+ #
1974
+ # # The returned object is of type Google::Cloud::Observability::V1::TraceScope.
1975
+ # p result
1976
+ #
1977
+ def create_trace_scope request, options = nil
1978
+ raise ::ArgumentError, "request must be provided" if request.nil?
1979
+
1980
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::CreateTraceScopeRequest
1981
+
1982
+ # Converts hash and nil to an options object
1983
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1984
+
1985
+ # Customize the options with defaults
1986
+ metadata = @config.rpcs.create_trace_scope.metadata.to_h
1987
+
1988
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1989
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1990
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1991
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
1992
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1993
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1994
+
1995
+ header_params = {}
1996
+ if request.parent
1997
+ header_params["parent"] = request.parent
1998
+ end
1999
+
2000
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2001
+ metadata[:"x-goog-request-params"] ||= request_params_header
2002
+
2003
+ options.apply_defaults timeout: @config.rpcs.create_trace_scope.timeout,
2004
+ metadata: metadata,
2005
+ retry_policy: @config.rpcs.create_trace_scope.retry_policy
2006
+
2007
+ options.apply_defaults timeout: @config.timeout,
2008
+ metadata: @config.metadata,
2009
+ retry_policy: @config.retry_policy
2010
+
2011
+ @observability_stub.call_rpc :create_trace_scope, request, options: options do |response, operation|
2012
+ yield response, operation if block_given?
2013
+ end
2014
+ rescue ::GRPC::BadStatus => e
2015
+ raise ::Google::Cloud::Error.from_error(e)
2016
+ end
2017
+
2018
+ ##
2019
+ # Update a TraceScope.
2020
+ #
2021
+ # @overload update_trace_scope(request, options = nil)
2022
+ # Pass arguments to `update_trace_scope` via a request object, either of type
2023
+ # {::Google::Cloud::Observability::V1::UpdateTraceScopeRequest} or an equivalent Hash.
2024
+ #
2025
+ # @param request [::Google::Cloud::Observability::V1::UpdateTraceScopeRequest, ::Hash]
2026
+ # A request object representing the call parameters. Required. To specify no
2027
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2028
+ # @param options [::Gapic::CallOptions, ::Hash]
2029
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2030
+ #
2031
+ # @overload update_trace_scope(trace_scope: nil, update_mask: nil)
2032
+ # Pass arguments to `update_trace_scope` via keyword arguments. Note that at
2033
+ # least one keyword argument is required. To specify no parameters, or to keep all
2034
+ # the default parameter values, pass an empty Hash as a request object (see above).
2035
+ #
2036
+ # @param trace_scope [::Google::Cloud::Observability::V1::TraceScope, ::Hash]
2037
+ # Required. The updated trace scope.
2038
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2039
+ # Optional. The list of fields to update.
2040
+ #
2041
+ # @yield [response, operation] Access the result along with the RPC operation
2042
+ # @yieldparam response [::Google::Cloud::Observability::V1::TraceScope]
2043
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2044
+ #
2045
+ # @return [::Google::Cloud::Observability::V1::TraceScope]
2046
+ #
2047
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2048
+ #
2049
+ # @example Basic example
2050
+ # require "google/cloud/observability/v1"
2051
+ #
2052
+ # # Create a client object. The client can be reused for multiple calls.
2053
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
2054
+ #
2055
+ # # Create a request. To set request fields, pass in keyword arguments.
2056
+ # request = Google::Cloud::Observability::V1::UpdateTraceScopeRequest.new
2057
+ #
2058
+ # # Call the update_trace_scope method.
2059
+ # result = client.update_trace_scope request
2060
+ #
2061
+ # # The returned object is of type Google::Cloud::Observability::V1::TraceScope.
2062
+ # p result
2063
+ #
2064
+ def update_trace_scope request, options = nil
2065
+ raise ::ArgumentError, "request must be provided" if request.nil?
2066
+
2067
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::UpdateTraceScopeRequest
2068
+
2069
+ # Converts hash and nil to an options object
2070
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2071
+
2072
+ # Customize the options with defaults
2073
+ metadata = @config.rpcs.update_trace_scope.metadata.to_h
2074
+
2075
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2076
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2077
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2078
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
2079
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2080
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2081
+
2082
+ header_params = {}
2083
+ if request.trace_scope&.name
2084
+ header_params["trace_scope.name"] = request.trace_scope.name
2085
+ end
2086
+
2087
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2088
+ metadata[:"x-goog-request-params"] ||= request_params_header
2089
+
2090
+ options.apply_defaults timeout: @config.rpcs.update_trace_scope.timeout,
2091
+ metadata: metadata,
2092
+ retry_policy: @config.rpcs.update_trace_scope.retry_policy
2093
+
2094
+ options.apply_defaults timeout: @config.timeout,
2095
+ metadata: @config.metadata,
2096
+ retry_policy: @config.retry_policy
2097
+
2098
+ @observability_stub.call_rpc :update_trace_scope, request, options: options do |response, operation|
2099
+ yield response, operation if block_given?
2100
+ end
2101
+ rescue ::GRPC::BadStatus => e
2102
+ raise ::Google::Cloud::Error.from_error(e)
2103
+ end
2104
+
2105
+ ##
2106
+ # Delete a TraceScope.
2107
+ #
2108
+ # @overload delete_trace_scope(request, options = nil)
2109
+ # Pass arguments to `delete_trace_scope` via a request object, either of type
2110
+ # {::Google::Cloud::Observability::V1::DeleteTraceScopeRequest} or an equivalent Hash.
2111
+ #
2112
+ # @param request [::Google::Cloud::Observability::V1::DeleteTraceScopeRequest, ::Hash]
2113
+ # A request object representing the call parameters. Required. To specify no
2114
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2115
+ # @param options [::Gapic::CallOptions, ::Hash]
2116
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2117
+ #
2118
+ # @overload delete_trace_scope(name: nil)
2119
+ # Pass arguments to `delete_trace_scope` via keyword arguments. Note that at
2120
+ # least one keyword argument is required. To specify no parameters, or to keep all
2121
+ # the default parameter values, pass an empty Hash as a request object (see above).
2122
+ #
2123
+ # @param name [::String]
2124
+ # Required. The full resource name of the trace scope to delete:
2125
+ #
2126
+ # projects/[PROJECT_ID]/locations/[LOCATION_ID]/traceScopes/[TRACE_SCOPE_ID]
2127
+ #
2128
+ # For example:
2129
+ #
2130
+ # projects/my-project/locations/global/traceScopes/my-trace-scope
2131
+ #
2132
+ # @yield [response, operation] Access the result along with the RPC operation
2133
+ # @yieldparam response [::Google::Protobuf::Empty]
2134
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2135
+ #
2136
+ # @return [::Google::Protobuf::Empty]
2137
+ #
2138
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2139
+ #
2140
+ # @example Basic example
2141
+ # require "google/cloud/observability/v1"
2142
+ #
2143
+ # # Create a client object. The client can be reused for multiple calls.
2144
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
2145
+ #
2146
+ # # Create a request. To set request fields, pass in keyword arguments.
2147
+ # request = Google::Cloud::Observability::V1::DeleteTraceScopeRequest.new
2148
+ #
2149
+ # # Call the delete_trace_scope method.
2150
+ # result = client.delete_trace_scope request
2151
+ #
2152
+ # # The returned object is of type Google::Protobuf::Empty.
2153
+ # p result
2154
+ #
2155
+ def delete_trace_scope request, options = nil
2156
+ raise ::ArgumentError, "request must be provided" if request.nil?
2157
+
2158
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::DeleteTraceScopeRequest
2159
+
2160
+ # Converts hash and nil to an options object
2161
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2162
+
2163
+ # Customize the options with defaults
2164
+ metadata = @config.rpcs.delete_trace_scope.metadata.to_h
2165
+
2166
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2167
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2168
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2169
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
2170
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2171
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2172
+
2173
+ header_params = {}
2174
+ if request.name
2175
+ header_params["name"] = request.name
2176
+ end
2177
+
2178
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2179
+ metadata[:"x-goog-request-params"] ||= request_params_header
2180
+
2181
+ options.apply_defaults timeout: @config.rpcs.delete_trace_scope.timeout,
2182
+ metadata: metadata,
2183
+ retry_policy: @config.rpcs.delete_trace_scope.retry_policy
2184
+
2185
+ options.apply_defaults timeout: @config.timeout,
2186
+ metadata: @config.metadata,
2187
+ retry_policy: @config.retry_policy
2188
+
2189
+ @observability_stub.call_rpc :delete_trace_scope, request, options: options do |response, operation|
2190
+ yield response, operation if block_given?
2191
+ end
2192
+ rescue ::GRPC::BadStatus => e
2193
+ raise ::Google::Cloud::Error.from_error(e)
2194
+ end
2195
+
2196
+ ##
2197
+ # Get Settings
2198
+ #
2199
+ # @overload get_settings(request, options = nil)
2200
+ # Pass arguments to `get_settings` via a request object, either of type
2201
+ # {::Google::Cloud::Observability::V1::GetSettingsRequest} or an equivalent Hash.
2202
+ #
2203
+ # @param request [::Google::Cloud::Observability::V1::GetSettingsRequest, ::Hash]
2204
+ # A request object representing the call parameters. Required. To specify no
2205
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2206
+ # @param options [::Gapic::CallOptions, ::Hash]
2207
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2208
+ #
2209
+ # @overload get_settings(name: nil)
2210
+ # Pass arguments to `get_settings` via keyword arguments. Note that at
2211
+ # least one keyword argument is required. To specify no parameters, or to keep all
2212
+ # the default parameter values, pass an empty Hash as a request object (see above).
2213
+ #
2214
+ # @param name [::String]
2215
+ # Required. Name of the settings to retrieve.
2216
+ #
2217
+ # Name format:
2218
+ #
2219
+ # "projects/[PROJECT_ID]/locations/[LOCATION]/settings"
2220
+ # "folders/[FOLDER_ID]/locations/[LOCATION]/settings"
2221
+ # "organizations/[ORGANIZATION_ID]/locations/[LOCATION]/settings"
2222
+ #
2223
+ # @yield [response, operation] Access the result along with the RPC operation
2224
+ # @yieldparam response [::Google::Cloud::Observability::V1::Settings]
2225
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2226
+ #
2227
+ # @return [::Google::Cloud::Observability::V1::Settings]
2228
+ #
2229
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2230
+ #
2231
+ # @example Basic example
2232
+ # require "google/cloud/observability/v1"
2233
+ #
2234
+ # # Create a client object. The client can be reused for multiple calls.
2235
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
2236
+ #
2237
+ # # Create a request. To set request fields, pass in keyword arguments.
2238
+ # request = Google::Cloud::Observability::V1::GetSettingsRequest.new
2239
+ #
2240
+ # # Call the get_settings method.
2241
+ # result = client.get_settings request
2242
+ #
2243
+ # # The returned object is of type Google::Cloud::Observability::V1::Settings.
2244
+ # p result
2245
+ #
2246
+ def get_settings request, options = nil
2247
+ raise ::ArgumentError, "request must be provided" if request.nil?
2248
+
2249
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::GetSettingsRequest
2250
+
2251
+ # Converts hash and nil to an options object
2252
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2253
+
2254
+ # Customize the options with defaults
2255
+ metadata = @config.rpcs.get_settings.metadata.to_h
2256
+
2257
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2258
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2259
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2260
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
2261
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2262
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2263
+
2264
+ header_params = {}
2265
+ if request.name
2266
+ header_params["name"] = request.name
2267
+ end
2268
+
2269
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2270
+ metadata[:"x-goog-request-params"] ||= request_params_header
2271
+
2272
+ options.apply_defaults timeout: @config.rpcs.get_settings.timeout,
2273
+ metadata: metadata,
2274
+ retry_policy: @config.rpcs.get_settings.retry_policy
2275
+
2276
+ options.apply_defaults timeout: @config.timeout,
2277
+ metadata: @config.metadata,
2278
+ retry_policy: @config.retry_policy
2279
+
2280
+ @observability_stub.call_rpc :get_settings, request, options: options do |response, operation|
2281
+ yield response, operation if block_given?
2282
+ end
2283
+ rescue ::GRPC::BadStatus => e
2284
+ raise ::Google::Cloud::Error.from_error(e)
2285
+ end
2286
+
2287
+ ##
2288
+ # Update Settings
2289
+ #
2290
+ # @overload update_settings(request, options = nil)
2291
+ # Pass arguments to `update_settings` via a request object, either of type
2292
+ # {::Google::Cloud::Observability::V1::UpdateSettingsRequest} or an equivalent Hash.
2293
+ #
2294
+ # @param request [::Google::Cloud::Observability::V1::UpdateSettingsRequest, ::Hash]
2295
+ # A request object representing the call parameters. Required. To specify no
2296
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2297
+ # @param options [::Gapic::CallOptions, ::Hash]
2298
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2299
+ #
2300
+ # @overload update_settings(settings: nil, update_mask: nil)
2301
+ # Pass arguments to `update_settings` via keyword arguments. Note that at
2302
+ # least one keyword argument is required. To specify no parameters, or to keep all
2303
+ # the default parameter values, pass an empty Hash as a request object (see above).
2304
+ #
2305
+ # @param settings [::Google::Cloud::Observability::V1::Settings, ::Hash]
2306
+ # Required. The settings to update.
2307
+ #
2308
+ # The name field of settings is used to identify the resource to be updated.
2309
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2310
+ # Optional. The field mask specifying which fields of the settings are to be
2311
+ # updated.
2312
+ #
2313
+ # @yield [response, operation] Access the result along with the RPC operation
2314
+ # @yieldparam response [::Gapic::Operation]
2315
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2316
+ #
2317
+ # @return [::Gapic::Operation]
2318
+ #
2319
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2320
+ #
2321
+ # @example Basic example
2322
+ # require "google/cloud/observability/v1"
2323
+ #
2324
+ # # Create a client object. The client can be reused for multiple calls.
2325
+ # client = Google::Cloud::Observability::V1::Observability::Client.new
2326
+ #
2327
+ # # Create a request. To set request fields, pass in keyword arguments.
2328
+ # request = Google::Cloud::Observability::V1::UpdateSettingsRequest.new
2329
+ #
2330
+ # # Call the update_settings method.
2331
+ # result = client.update_settings request
2332
+ #
2333
+ # # The returned object is of type Gapic::Operation. You can use it to
2334
+ # # check the status of an operation, cancel it, or wait for results.
2335
+ # # Here is how to wait for a response.
2336
+ # result.wait_until_done! timeout: 60
2337
+ # if result.response?
2338
+ # p result.response
2339
+ # else
2340
+ # puts "No response received."
2341
+ # end
2342
+ #
2343
+ def update_settings request, options = nil
2344
+ raise ::ArgumentError, "request must be provided" if request.nil?
2345
+
2346
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::UpdateSettingsRequest
2347
+
2348
+ # Converts hash and nil to an options object
2349
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2350
+
2351
+ # Customize the options with defaults
2352
+ metadata = @config.rpcs.update_settings.metadata.to_h
2353
+
2354
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2355
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2356
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2357
+ gapic_version: ::Google::Cloud::Observability::V1::VERSION
2358
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2359
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2360
+
2361
+ header_params = {}
2362
+ if request.settings&.name
2363
+ header_params["settings.name"] = request.settings.name
2364
+ end
2365
+
2366
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2367
+ metadata[:"x-goog-request-params"] ||= request_params_header
2368
+
2369
+ options.apply_defaults timeout: @config.rpcs.update_settings.timeout,
2370
+ metadata: metadata,
2371
+ retry_policy: @config.rpcs.update_settings.retry_policy
2372
+
2373
+ options.apply_defaults timeout: @config.timeout,
2374
+ metadata: @config.metadata,
2375
+ retry_policy: @config.retry_policy
2376
+
2377
+ @observability_stub.call_rpc :update_settings, request, options: options do |response, operation|
2378
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2379
+ yield response, operation if block_given?
2380
+ throw :response, response
2381
+ end
2382
+ rescue ::GRPC::BadStatus => e
2383
+ raise ::Google::Cloud::Error.from_error(e)
2384
+ end
2385
+
2386
+ ##
2387
+ # Configuration class for the Observability API.
2388
+ #
2389
+ # This class represents the configuration for Observability,
2390
+ # providing control over timeouts, retry behavior, logging, transport
2391
+ # parameters, and other low-level controls. Certain parameters can also be
2392
+ # applied individually to specific RPCs. See
2393
+ # {::Google::Cloud::Observability::V1::Observability::Client::Configuration::Rpcs}
2394
+ # for a list of RPCs that can be configured independently.
2395
+ #
2396
+ # Configuration can be applied globally to all clients, or to a single client
2397
+ # on construction.
2398
+ #
2399
+ # @example
2400
+ #
2401
+ # # Modify the global config, setting the timeout for
2402
+ # # get_scope to 20 seconds,
2403
+ # # and all remaining timeouts to 10 seconds.
2404
+ # ::Google::Cloud::Observability::V1::Observability::Client.configure do |config|
2405
+ # config.timeout = 10.0
2406
+ # config.rpcs.get_scope.timeout = 20.0
2407
+ # end
2408
+ #
2409
+ # # Apply the above configuration only to a new client.
2410
+ # client = ::Google::Cloud::Observability::V1::Observability::Client.new do |config|
2411
+ # config.timeout = 10.0
2412
+ # config.rpcs.get_scope.timeout = 20.0
2413
+ # end
2414
+ #
2415
+ # @!attribute [rw] endpoint
2416
+ # A custom service endpoint, as a hostname or hostname:port. The default is
2417
+ # nil, indicating to use the default endpoint in the current universe domain.
2418
+ # @return [::String,nil]
2419
+ # @!attribute [rw] credentials
2420
+ # Credentials to send with calls. You may provide any of the following types:
2421
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2422
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2423
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2424
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2425
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2426
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2427
+ # * (`nil`) indicating no credentials
2428
+ #
2429
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
2430
+ # is deprecated. Providing an unvalidated credential configuration to
2431
+ # Google APIs can compromise the security of your systems and data.
2432
+ #
2433
+ # @example
2434
+ #
2435
+ # # The recommended way to provide credentials is to use the `make_creds` method
2436
+ # # on the appropriate credentials class for your environment.
2437
+ #
2438
+ # require "googleauth"
2439
+ #
2440
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
2441
+ # json_key_io: ::File.open("/path/to/keyfile.json")
2442
+ # )
2443
+ #
2444
+ # client = ::Google::Cloud::Observability::V1::Observability::Client.new do |config|
2445
+ # config.credentials = credentials
2446
+ # end
2447
+ #
2448
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
2449
+ # external source for authentication to Google Cloud, you must validate it before
2450
+ # providing it to a Google API client library. Providing an unvalidated credential
2451
+ # configuration to Google APIs can compromise the security of your systems and data.
2452
+ # For more information, refer to [Validate credential configurations from external
2453
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
2454
+ # @return [::Object]
2455
+ # @!attribute [rw] scope
2456
+ # The OAuth scopes
2457
+ # @return [::Array<::String>]
2458
+ # @!attribute [rw] lib_name
2459
+ # The library name as recorded in instrumentation and logging
2460
+ # @return [::String]
2461
+ # @!attribute [rw] lib_version
2462
+ # The library version as recorded in instrumentation and logging
2463
+ # @return [::String]
2464
+ # @!attribute [rw] channel_args
2465
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
2466
+ # `GRPC::Core::Channel` object is provided as the credential.
2467
+ # @return [::Hash]
2468
+ # @!attribute [rw] interceptors
2469
+ # An array of interceptors that are run before calls are executed.
2470
+ # @return [::Array<::GRPC::ClientInterceptor>]
2471
+ # @!attribute [rw] timeout
2472
+ # The call timeout in seconds.
2473
+ # @return [::Numeric]
2474
+ # @!attribute [rw] metadata
2475
+ # Additional gRPC headers to be sent with the call.
2476
+ # @return [::Hash{::Symbol=>::String}]
2477
+ # @!attribute [rw] retry_policy
2478
+ # The retry policy. The value is a hash with the following keys:
2479
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2480
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2481
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2482
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
2483
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2484
+ # trigger a retry.
2485
+ # @return [::Hash]
2486
+ # @!attribute [rw] quota_project
2487
+ # A separate project against which to charge quota.
2488
+ # @return [::String]
2489
+ # @!attribute [rw] universe_domain
2490
+ # The universe domain within which to make requests. This determines the
2491
+ # default endpoint URL. The default value of nil uses the environment
2492
+ # universe (usually the default "googleapis.com" universe).
2493
+ # @return [::String,nil]
2494
+ # @!attribute [rw] logger
2495
+ # A custom logger to use for request/response debug logging, or the value
2496
+ # `:default` (the default) to construct a default logger, or `nil` to
2497
+ # explicitly disable logging.
2498
+ # @return [::Logger,:default,nil]
2499
+ #
2500
+ class Configuration
2501
+ extend ::Gapic::Config
2502
+
2503
+ # @private
2504
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
2505
+ DEFAULT_ENDPOINT = "observability.googleapis.com"
2506
+
2507
+ config_attr :endpoint, nil, ::String, nil
2508
+ config_attr :credentials, nil do |value|
2509
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
2510
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
2511
+ allowed.any? { |klass| klass === value }
2512
+ end
2513
+ config_attr :scope, nil, ::String, ::Array, nil
2514
+ config_attr :lib_name, nil, ::String, nil
2515
+ config_attr :lib_version, nil, ::String, nil
2516
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
2517
+ config_attr :interceptors, nil, ::Array, nil
2518
+ config_attr :timeout, nil, ::Numeric, nil
2519
+ config_attr :metadata, nil, ::Hash, nil
2520
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2521
+ config_attr :quota_project, nil, ::String, nil
2522
+ config_attr :universe_domain, nil, ::String, nil
2523
+ config_attr :logger, :default, ::Logger, nil, :default
2524
+
2525
+ # @private
2526
+ def initialize parent_config = nil
2527
+ @parent_config = parent_config unless parent_config.nil?
2528
+
2529
+ yield self if block_given?
2530
+ end
2531
+
2532
+ ##
2533
+ # Configurations for individual RPCs
2534
+ # @return [Rpcs]
2535
+ #
2536
+ def rpcs
2537
+ @rpcs ||= begin
2538
+ parent_rpcs = nil
2539
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2540
+ Rpcs.new parent_rpcs
2541
+ end
2542
+ end
2543
+
2544
+ ##
2545
+ # Configuration for the channel pool
2546
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
2547
+ #
2548
+ def channel_pool
2549
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
2550
+ end
2551
+
2552
+ ##
2553
+ # Configuration RPC class for the Observability API.
2554
+ #
2555
+ # Includes fields providing the configuration for each RPC in this service.
2556
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2557
+ # the following configuration fields:
2558
+ #
2559
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2560
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
2561
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2562
+ # include the following keys:
2563
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2564
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2565
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2566
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
2567
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2568
+ # trigger a retry.
2569
+ #
2570
+ class Rpcs
2571
+ ##
2572
+ # RPC-specific configuration for `get_scope`
2573
+ # @return [::Gapic::Config::Method]
2574
+ #
2575
+ attr_reader :get_scope
2576
+ ##
2577
+ # RPC-specific configuration for `update_scope`
2578
+ # @return [::Gapic::Config::Method]
2579
+ #
2580
+ attr_reader :update_scope
2581
+ ##
2582
+ # RPC-specific configuration for `get_bucket`
2583
+ # @return [::Gapic::Config::Method]
2584
+ #
2585
+ attr_reader :get_bucket
2586
+ ##
2587
+ # RPC-specific configuration for `list_buckets`
2588
+ # @return [::Gapic::Config::Method]
2589
+ #
2590
+ attr_reader :list_buckets
2591
+ ##
2592
+ # RPC-specific configuration for `create_bucket`
2593
+ # @return [::Gapic::Config::Method]
2594
+ #
2595
+ attr_reader :create_bucket
2596
+ ##
2597
+ # RPC-specific configuration for `update_bucket`
2598
+ # @return [::Gapic::Config::Method]
2599
+ #
2600
+ attr_reader :update_bucket
2601
+ ##
2602
+ # RPC-specific configuration for `get_dataset`
2603
+ # @return [::Gapic::Config::Method]
2604
+ #
2605
+ attr_reader :get_dataset
2606
+ ##
2607
+ # RPC-specific configuration for `list_datasets`
2608
+ # @return [::Gapic::Config::Method]
2609
+ #
2610
+ attr_reader :list_datasets
2611
+ ##
2612
+ # RPC-specific configuration for `get_view`
2613
+ # @return [::Gapic::Config::Method]
2614
+ #
2615
+ attr_reader :get_view
2616
+ ##
2617
+ # RPC-specific configuration for `list_views`
2618
+ # @return [::Gapic::Config::Method]
2619
+ #
2620
+ attr_reader :list_views
2621
+ ##
2622
+ # RPC-specific configuration for `get_link`
2623
+ # @return [::Gapic::Config::Method]
2624
+ #
2625
+ attr_reader :get_link
2626
+ ##
2627
+ # RPC-specific configuration for `list_links`
2628
+ # @return [::Gapic::Config::Method]
2629
+ #
2630
+ attr_reader :list_links
2631
+ ##
2632
+ # RPC-specific configuration for `create_link`
2633
+ # @return [::Gapic::Config::Method]
2634
+ #
2635
+ attr_reader :create_link
2636
+ ##
2637
+ # RPC-specific configuration for `update_link`
2638
+ # @return [::Gapic::Config::Method]
2639
+ #
2640
+ attr_reader :update_link
2641
+ ##
2642
+ # RPC-specific configuration for `delete_link`
2643
+ # @return [::Gapic::Config::Method]
2644
+ #
2645
+ attr_reader :delete_link
2646
+ ##
2647
+ # RPC-specific configuration for `get_trace_scope`
2648
+ # @return [::Gapic::Config::Method]
2649
+ #
2650
+ attr_reader :get_trace_scope
2651
+ ##
2652
+ # RPC-specific configuration for `list_trace_scopes`
2653
+ # @return [::Gapic::Config::Method]
2654
+ #
2655
+ attr_reader :list_trace_scopes
2656
+ ##
2657
+ # RPC-specific configuration for `create_trace_scope`
2658
+ # @return [::Gapic::Config::Method]
2659
+ #
2660
+ attr_reader :create_trace_scope
2661
+ ##
2662
+ # RPC-specific configuration for `update_trace_scope`
2663
+ # @return [::Gapic::Config::Method]
2664
+ #
2665
+ attr_reader :update_trace_scope
2666
+ ##
2667
+ # RPC-specific configuration for `delete_trace_scope`
2668
+ # @return [::Gapic::Config::Method]
2669
+ #
2670
+ attr_reader :delete_trace_scope
2671
+ ##
2672
+ # RPC-specific configuration for `get_settings`
2673
+ # @return [::Gapic::Config::Method]
2674
+ #
2675
+ attr_reader :get_settings
2676
+ ##
2677
+ # RPC-specific configuration for `update_settings`
2678
+ # @return [::Gapic::Config::Method]
2679
+ #
2680
+ attr_reader :update_settings
2681
+
2682
+ # @private
2683
+ def initialize parent_rpcs = nil
2684
+ get_scope_config = parent_rpcs.get_scope if parent_rpcs.respond_to? :get_scope
2685
+ @get_scope = ::Gapic::Config::Method.new get_scope_config
2686
+ update_scope_config = parent_rpcs.update_scope if parent_rpcs.respond_to? :update_scope
2687
+ @update_scope = ::Gapic::Config::Method.new update_scope_config
2688
+ get_bucket_config = parent_rpcs.get_bucket if parent_rpcs.respond_to? :get_bucket
2689
+ @get_bucket = ::Gapic::Config::Method.new get_bucket_config
2690
+ list_buckets_config = parent_rpcs.list_buckets if parent_rpcs.respond_to? :list_buckets
2691
+ @list_buckets = ::Gapic::Config::Method.new list_buckets_config
2692
+ create_bucket_config = parent_rpcs.create_bucket if parent_rpcs.respond_to? :create_bucket
2693
+ @create_bucket = ::Gapic::Config::Method.new create_bucket_config
2694
+ update_bucket_config = parent_rpcs.update_bucket if parent_rpcs.respond_to? :update_bucket
2695
+ @update_bucket = ::Gapic::Config::Method.new update_bucket_config
2696
+ get_dataset_config = parent_rpcs.get_dataset if parent_rpcs.respond_to? :get_dataset
2697
+ @get_dataset = ::Gapic::Config::Method.new get_dataset_config
2698
+ list_datasets_config = parent_rpcs.list_datasets if parent_rpcs.respond_to? :list_datasets
2699
+ @list_datasets = ::Gapic::Config::Method.new list_datasets_config
2700
+ get_view_config = parent_rpcs.get_view if parent_rpcs.respond_to? :get_view
2701
+ @get_view = ::Gapic::Config::Method.new get_view_config
2702
+ list_views_config = parent_rpcs.list_views if parent_rpcs.respond_to? :list_views
2703
+ @list_views = ::Gapic::Config::Method.new list_views_config
2704
+ get_link_config = parent_rpcs.get_link if parent_rpcs.respond_to? :get_link
2705
+ @get_link = ::Gapic::Config::Method.new get_link_config
2706
+ list_links_config = parent_rpcs.list_links if parent_rpcs.respond_to? :list_links
2707
+ @list_links = ::Gapic::Config::Method.new list_links_config
2708
+ create_link_config = parent_rpcs.create_link if parent_rpcs.respond_to? :create_link
2709
+ @create_link = ::Gapic::Config::Method.new create_link_config
2710
+ update_link_config = parent_rpcs.update_link if parent_rpcs.respond_to? :update_link
2711
+ @update_link = ::Gapic::Config::Method.new update_link_config
2712
+ delete_link_config = parent_rpcs.delete_link if parent_rpcs.respond_to? :delete_link
2713
+ @delete_link = ::Gapic::Config::Method.new delete_link_config
2714
+ get_trace_scope_config = parent_rpcs.get_trace_scope if parent_rpcs.respond_to? :get_trace_scope
2715
+ @get_trace_scope = ::Gapic::Config::Method.new get_trace_scope_config
2716
+ list_trace_scopes_config = parent_rpcs.list_trace_scopes if parent_rpcs.respond_to? :list_trace_scopes
2717
+ @list_trace_scopes = ::Gapic::Config::Method.new list_trace_scopes_config
2718
+ create_trace_scope_config = parent_rpcs.create_trace_scope if parent_rpcs.respond_to? :create_trace_scope
2719
+ @create_trace_scope = ::Gapic::Config::Method.new create_trace_scope_config
2720
+ update_trace_scope_config = parent_rpcs.update_trace_scope if parent_rpcs.respond_to? :update_trace_scope
2721
+ @update_trace_scope = ::Gapic::Config::Method.new update_trace_scope_config
2722
+ delete_trace_scope_config = parent_rpcs.delete_trace_scope if parent_rpcs.respond_to? :delete_trace_scope
2723
+ @delete_trace_scope = ::Gapic::Config::Method.new delete_trace_scope_config
2724
+ get_settings_config = parent_rpcs.get_settings if parent_rpcs.respond_to? :get_settings
2725
+ @get_settings = ::Gapic::Config::Method.new get_settings_config
2726
+ update_settings_config = parent_rpcs.update_settings if parent_rpcs.respond_to? :update_settings
2727
+ @update_settings = ::Gapic::Config::Method.new update_settings_config
2728
+
2729
+ yield self if block_given?
2730
+ end
2731
+ end
2732
+ end
2733
+ end
2734
+ end
2735
+ end
2736
+ end
2737
+ end
2738
+ end