google-cloud-error_reporting-v1beta1 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,6 +25,7 @@ require "google/cloud/error_reporting/v1beta1/version"
25
25
  require "google/cloud/error_reporting/v1beta1/error_group_service/credentials"
26
26
  require "google/cloud/error_reporting/v1beta1/error_group_service/paths"
27
27
  require "google/cloud/error_reporting/v1beta1/error_group_service/client"
28
+ require "google/cloud/error_reporting/v1beta1/error_group_service/rest"
28
29
 
29
30
  module Google
30
31
  module Cloud
@@ -38,6 +39,11 @@ module Google
38
39
  # require "google/cloud/error_reporting/v1beta1/error_group_service"
39
40
  # client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client.new
40
41
  #
42
+ # @example Load this service and instantiate a REST client
43
+ #
44
+ # require "google/cloud/error_reporting/v1beta1/error_group_service/rest"
45
+ # client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Rest::Client.new
46
+ #
41
47
  module ErrorGroupService
42
48
  end
43
49
  end
@@ -230,13 +230,11 @@ module Google
230
230
  # # Call the list_group_stats method.
231
231
  # result = client.list_group_stats request
232
232
  #
233
- # # The returned object is of type Gapic::PagedEnumerable. You can
234
- # # iterate over all elements by calling #each, and the enumerable
235
- # # will lazily make API calls to fetch subsequent pages. Other
236
- # # methods are also available for managing paging directly.
237
- # result.each do |response|
233
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
234
+ # # over elements, and API calls will be issued to fetch pages as needed.
235
+ # result.each do |item|
238
236
  # # Each element is of type ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupStats.
239
- # p response
237
+ # p item
240
238
  # end
241
239
  #
242
240
  def list_group_stats request, options = nil
@@ -341,13 +339,11 @@ module Google
341
339
  # # Call the list_events method.
342
340
  # result = client.list_events request
343
341
  #
344
- # # The returned object is of type Gapic::PagedEnumerable. You can
345
- # # iterate over all elements by calling #each, and the enumerable
346
- # # will lazily make API calls to fetch subsequent pages. Other
347
- # # methods are also available for managing paging directly.
348
- # result.each do |response|
342
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
343
+ # # over elements, and API calls will be issued to fetch pages as needed.
344
+ # result.each do |item|
349
345
  # # Each element is of type ::Google::Cloud::ErrorReporting::V1beta1::ErrorEvent.
350
- # p response
346
+ # p item
351
347
  # end
352
348
  #
353
349
  def list_events request, options = nil
@@ -0,0 +1,553 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/devtools/clouderrorreporting/v1beta1/error_stats_service_pb"
21
+ require "google/cloud/error_reporting/v1beta1/error_stats_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module ErrorReporting
26
+ module V1beta1
27
+ module ErrorStatsService
28
+ module Rest
29
+ ##
30
+ # REST client for the ErrorStatsService service.
31
+ #
32
+ # An API for retrieving and managing error statistics as well as data for
33
+ # individual events.
34
+ #
35
+ class Client
36
+ include Paths
37
+
38
+ # @private
39
+ attr_reader :error_stats_service_stub
40
+
41
+ ##
42
+ # Configure the ErrorStatsService Client class.
43
+ #
44
+ # See {::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Rest::Client::Configuration}
45
+ # for a description of the configuration fields.
46
+ #
47
+ # @example
48
+ #
49
+ # # Modify the configuration for all ErrorStatsService clients
50
+ # ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Rest::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
53
+ #
54
+ # @yield [config] Configure the Client client.
55
+ # @yieldparam config [Client::Configuration]
56
+ #
57
+ # @return [Client::Configuration]
58
+ #
59
+ def self.configure
60
+ @configure ||= begin
61
+ namespace = ["Google", "Cloud", "ErrorReporting", "V1beta1"]
62
+ parent_config = while namespace.any?
63
+ parent_name = namespace.join "::"
64
+ parent_const = const_get parent_name
65
+ break parent_const.configure if parent_const.respond_to? :configure
66
+ namespace.pop
67
+ end
68
+ default_config = Client::Configuration.new parent_config
69
+
70
+ default_config.timeout = 600.0
71
+ default_config.retry_policy = {
72
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
73
+ }
74
+
75
+ default_config
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the ErrorStatsService Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Rest::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # Create a new ErrorStatsService REST client object.
103
+ #
104
+ # @example
105
+ #
106
+ # # Create a client using the default configuration
107
+ # client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Rest::Client.new
108
+ #
109
+ # # Create a client using a custom configuration
110
+ # client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Rest::Client.new do |config|
111
+ # config.timeout = 10.0
112
+ # end
113
+ #
114
+ # @yield [config] Configure the ErrorStatsService client.
115
+ # @yieldparam config [Client::Configuration]
116
+ #
117
+ def initialize
118
+ # Create the configuration object
119
+ @config = Configuration.new Client.configure
120
+
121
+ # Yield the configuration if needed
122
+ yield @config if block_given?
123
+
124
+ # Create credentials
125
+ credentials = @config.credentials
126
+ # Use self-signed JWT if the endpoint is unchanged from default,
127
+ # but only if the default endpoint does not have a region prefix.
128
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
129
+ !@config.endpoint.split(".").first.include?("-")
130
+ credentials ||= Credentials.default scope: @config.scope,
131
+ enable_self_signed_jwt: enable_self_signed_jwt
132
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
133
+ credentials = Credentials.new credentials, scope: @config.scope
134
+ end
135
+
136
+ @quota_project_id = @config.quota_project
137
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
138
+
139
+ @error_stats_service_stub = ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
140
+ end
141
+
142
+ # Service calls
143
+
144
+ ##
145
+ # Lists the specified groups.
146
+ #
147
+ # @overload list_group_stats(request, options = nil)
148
+ # Pass arguments to `list_group_stats` via a request object, either of type
149
+ # {::Google::Cloud::ErrorReporting::V1beta1::ListGroupStatsRequest} or an equivalent Hash.
150
+ #
151
+ # @param request [::Google::Cloud::ErrorReporting::V1beta1::ListGroupStatsRequest, ::Hash]
152
+ # A request object representing the call parameters. Required. To specify no
153
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
154
+ # @param options [::Gapic::CallOptions, ::Hash]
155
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
156
+ #
157
+ # @overload list_group_stats(project_name: nil, group_id: nil, service_filter: nil, time_range: nil, timed_count_duration: nil, alignment: nil, alignment_time: nil, order: nil, page_size: nil, page_token: nil)
158
+ # Pass arguments to `list_group_stats` via keyword arguments. Note that at
159
+ # least one keyword argument is required. To specify no parameters, or to keep all
160
+ # the default parameter values, pass an empty Hash as a request object (see above).
161
+ #
162
+ # @param project_name [::String]
163
+ # Required. The resource name of the Google Cloud Platform project. Written
164
+ # as `projects/{projectID}` or `projects/{projectNumber}`, where `{projectID}`
165
+ # and `{projectNumber}` can be found in the
166
+ # [Google Cloud Console](https://support.google.com/cloud/answer/6158840).
167
+ #
168
+ # Examples: `projects/my-project-123`, `projects/5551234`.
169
+ # @param group_id [::Array<::String>]
170
+ # Optional. List all <code>ErrorGroupStats</code> with these IDs.
171
+ # @param service_filter [::Google::Cloud::ErrorReporting::V1beta1::ServiceContextFilter, ::Hash]
172
+ # Optional. List only <code>ErrorGroupStats</code> which belong to a service
173
+ # context that matches the filter.
174
+ # Data for all service contexts is returned if this field is not specified.
175
+ # @param time_range [::Google::Cloud::ErrorReporting::V1beta1::QueryTimeRange, ::Hash]
176
+ # Optional. List data for the given time range.
177
+ # If not set, a default time range is used. The field
178
+ # <code>time_range_begin</code> in the response will specify the beginning
179
+ # of this time range.
180
+ # Only <code>ErrorGroupStats</code> with a non-zero count in the given time
181
+ # range are returned, unless the request contains an explicit
182
+ # <code>group_id</code> list. If a <code>group_id</code> list is given, also
183
+ # <code>ErrorGroupStats</code> with zero occurrences are returned.
184
+ # @param timed_count_duration [::Google::Protobuf::Duration, ::Hash]
185
+ # Optional. The preferred duration for a single returned `TimedCount`.
186
+ # If not set, no timed counts are returned.
187
+ # @param alignment [::Google::Cloud::ErrorReporting::V1beta1::TimedCountAlignment]
188
+ # Optional. The alignment of the timed counts to be returned.
189
+ # Default is `ALIGNMENT_EQUAL_AT_END`.
190
+ # @param alignment_time [::Google::Protobuf::Timestamp, ::Hash]
191
+ # Optional. Time where the timed counts shall be aligned if rounded
192
+ # alignment is chosen. Default is 00:00 UTC.
193
+ # @param order [::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupOrder]
194
+ # Optional. The sort order in which the results are returned.
195
+ # Default is `COUNT_DESC`.
196
+ # @param page_size [::Integer]
197
+ # Optional. The maximum number of results to return per response.
198
+ # Default is 20.
199
+ # @param page_token [::String]
200
+ # Optional. A `next_page_token` provided by a previous response. To view
201
+ # additional results, pass this token along with the identical query
202
+ # parameters as the first request.
203
+ # @yield [result, operation] Access the result along with the TransportOperation object
204
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupStats>]
205
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
206
+ #
207
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupStats>]
208
+ #
209
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
210
+ def list_group_stats request, options = nil
211
+ raise ::ArgumentError, "request must be provided" if request.nil?
212
+
213
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ErrorReporting::V1beta1::ListGroupStatsRequest
214
+
215
+ # Converts hash and nil to an options object
216
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
217
+
218
+ # Customize the options with defaults
219
+ call_metadata = @config.rpcs.list_group_stats.metadata.to_h
220
+
221
+ # Set x-goog-api-client and x-goog-user-project headers
222
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
223
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
224
+ gapic_version: ::Google::Cloud::ErrorReporting::V1beta1::VERSION,
225
+ transports_version_send: [:rest]
226
+
227
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
228
+
229
+ options.apply_defaults timeout: @config.rpcs.list_group_stats.timeout,
230
+ metadata: call_metadata,
231
+ retry_policy: @config.rpcs.list_group_stats.retry_policy
232
+
233
+ options.apply_defaults timeout: @config.timeout,
234
+ metadata: @config.metadata,
235
+ retry_policy: @config.retry_policy
236
+
237
+ @error_stats_service_stub.list_group_stats request, options do |result, operation|
238
+ result = ::Gapic::Rest::PagedEnumerable.new @error_stats_service_stub, :list_group_stats, "error_group_stats", request, result, options
239
+ yield result, operation if block_given?
240
+ return result
241
+ end
242
+ rescue ::Gapic::Rest::Error => e
243
+ raise ::Google::Cloud::Error.from_error(e)
244
+ end
245
+
246
+ ##
247
+ # Lists the specified events.
248
+ #
249
+ # @overload list_events(request, options = nil)
250
+ # Pass arguments to `list_events` via a request object, either of type
251
+ # {::Google::Cloud::ErrorReporting::V1beta1::ListEventsRequest} or an equivalent Hash.
252
+ #
253
+ # @param request [::Google::Cloud::ErrorReporting::V1beta1::ListEventsRequest, ::Hash]
254
+ # A request object representing the call parameters. Required. To specify no
255
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
256
+ # @param options [::Gapic::CallOptions, ::Hash]
257
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
258
+ #
259
+ # @overload list_events(project_name: nil, group_id: nil, service_filter: nil, time_range: nil, page_size: nil, page_token: nil)
260
+ # Pass arguments to `list_events` via keyword arguments. Note that at
261
+ # least one keyword argument is required. To specify no parameters, or to keep all
262
+ # the default parameter values, pass an empty Hash as a request object (see above).
263
+ #
264
+ # @param project_name [::String]
265
+ # Required. The resource name of the Google Cloud Platform project. Written
266
+ # as `projects/{projectID}`, where `{projectID}` is the
267
+ # [Google Cloud Platform project
268
+ # ID](https://support.google.com/cloud/answer/6158840).
269
+ #
270
+ # Example: `projects/my-project-123`.
271
+ # @param group_id [::String]
272
+ # Required. The group for which events shall be returned.
273
+ # @param service_filter [::Google::Cloud::ErrorReporting::V1beta1::ServiceContextFilter, ::Hash]
274
+ # Optional. List only ErrorGroups which belong to a service context that
275
+ # matches the filter.
276
+ # Data for all service contexts is returned if this field is not specified.
277
+ # @param time_range [::Google::Cloud::ErrorReporting::V1beta1::QueryTimeRange, ::Hash]
278
+ # Optional. List only data for the given time range.
279
+ # If not set a default time range is used. The field time_range_begin
280
+ # in the response will specify the beginning of this time range.
281
+ # @param page_size [::Integer]
282
+ # Optional. The maximum number of results to return per response.
283
+ # @param page_token [::String]
284
+ # Optional. A `next_page_token` provided by a previous response.
285
+ # @yield [result, operation] Access the result along with the TransportOperation object
286
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorEvent>]
287
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
288
+ #
289
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorEvent>]
290
+ #
291
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
292
+ def list_events request, options = nil
293
+ raise ::ArgumentError, "request must be provided" if request.nil?
294
+
295
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ErrorReporting::V1beta1::ListEventsRequest
296
+
297
+ # Converts hash and nil to an options object
298
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
299
+
300
+ # Customize the options with defaults
301
+ call_metadata = @config.rpcs.list_events.metadata.to_h
302
+
303
+ # Set x-goog-api-client and x-goog-user-project headers
304
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
305
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
306
+ gapic_version: ::Google::Cloud::ErrorReporting::V1beta1::VERSION,
307
+ transports_version_send: [:rest]
308
+
309
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
310
+
311
+ options.apply_defaults timeout: @config.rpcs.list_events.timeout,
312
+ metadata: call_metadata,
313
+ retry_policy: @config.rpcs.list_events.retry_policy
314
+
315
+ options.apply_defaults timeout: @config.timeout,
316
+ metadata: @config.metadata,
317
+ retry_policy: @config.retry_policy
318
+
319
+ @error_stats_service_stub.list_events request, options do |result, operation|
320
+ result = ::Gapic::Rest::PagedEnumerable.new @error_stats_service_stub, :list_events, "error_events", request, result, options
321
+ yield result, operation if block_given?
322
+ return result
323
+ end
324
+ rescue ::Gapic::Rest::Error => e
325
+ raise ::Google::Cloud::Error.from_error(e)
326
+ end
327
+
328
+ ##
329
+ # Deletes all error events of a given project.
330
+ #
331
+ # @overload delete_events(request, options = nil)
332
+ # Pass arguments to `delete_events` via a request object, either of type
333
+ # {::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsRequest} or an equivalent Hash.
334
+ #
335
+ # @param request [::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsRequest, ::Hash]
336
+ # A request object representing the call parameters. Required. To specify no
337
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
338
+ # @param options [::Gapic::CallOptions, ::Hash]
339
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
340
+ #
341
+ # @overload delete_events(project_name: nil)
342
+ # Pass arguments to `delete_events` via keyword arguments. Note that at
343
+ # least one keyword argument is required. To specify no parameters, or to keep all
344
+ # the default parameter values, pass an empty Hash as a request object (see above).
345
+ #
346
+ # @param project_name [::String]
347
+ # Required. The resource name of the Google Cloud Platform project. Written
348
+ # as `projects/{projectID}`, where `{projectID}` is the
349
+ # [Google Cloud Platform project
350
+ # ID](https://support.google.com/cloud/answer/6158840).
351
+ #
352
+ # Example: `projects/my-project-123`.
353
+ # @yield [result, operation] Access the result along with the TransportOperation object
354
+ # @yieldparam result [::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsResponse]
355
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
356
+ #
357
+ # @return [::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsResponse]
358
+ #
359
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
360
+ def delete_events request, options = nil
361
+ raise ::ArgumentError, "request must be provided" if request.nil?
362
+
363
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsRequest
364
+
365
+ # Converts hash and nil to an options object
366
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
367
+
368
+ # Customize the options with defaults
369
+ call_metadata = @config.rpcs.delete_events.metadata.to_h
370
+
371
+ # Set x-goog-api-client and x-goog-user-project headers
372
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
373
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
374
+ gapic_version: ::Google::Cloud::ErrorReporting::V1beta1::VERSION,
375
+ transports_version_send: [:rest]
376
+
377
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
378
+
379
+ options.apply_defaults timeout: @config.rpcs.delete_events.timeout,
380
+ metadata: call_metadata,
381
+ retry_policy: @config.rpcs.delete_events.retry_policy
382
+
383
+ options.apply_defaults timeout: @config.timeout,
384
+ metadata: @config.metadata,
385
+ retry_policy: @config.retry_policy
386
+
387
+ @error_stats_service_stub.delete_events request, options do |result, operation|
388
+ yield result, operation if block_given?
389
+ return result
390
+ end
391
+ rescue ::Gapic::Rest::Error => e
392
+ raise ::Google::Cloud::Error.from_error(e)
393
+ end
394
+
395
+ ##
396
+ # Configuration class for the ErrorStatsService REST API.
397
+ #
398
+ # This class represents the configuration for ErrorStatsService REST,
399
+ # providing control over timeouts, retry behavior, logging, transport
400
+ # parameters, and other low-level controls. Certain parameters can also be
401
+ # applied individually to specific RPCs. See
402
+ # {::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Rest::Client::Configuration::Rpcs}
403
+ # for a list of RPCs that can be configured independently.
404
+ #
405
+ # Configuration can be applied globally to all clients, or to a single client
406
+ # on construction.
407
+ #
408
+ # @example
409
+ #
410
+ # # Modify the global config, setting the timeout for
411
+ # # list_group_stats to 20 seconds,
412
+ # # and all remaining timeouts to 10 seconds.
413
+ # ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Rest::Client.configure do |config|
414
+ # config.timeout = 10.0
415
+ # config.rpcs.list_group_stats.timeout = 20.0
416
+ # end
417
+ #
418
+ # # Apply the above configuration only to a new client.
419
+ # client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Rest::Client.new do |config|
420
+ # config.timeout = 10.0
421
+ # config.rpcs.list_group_stats.timeout = 20.0
422
+ # end
423
+ #
424
+ # @!attribute [rw] endpoint
425
+ # The hostname or hostname:port of the service endpoint.
426
+ # Defaults to `"clouderrorreporting.googleapis.com"`.
427
+ # @return [::String]
428
+ # @!attribute [rw] credentials
429
+ # Credentials to send with calls. You may provide any of the following types:
430
+ # * (`String`) The path to a service account key file in JSON format
431
+ # * (`Hash`) A service account key as a Hash
432
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
433
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
434
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
435
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
436
+ # * (`nil`) indicating no credentials
437
+ # @return [::Object]
438
+ # @!attribute [rw] scope
439
+ # The OAuth scopes
440
+ # @return [::Array<::String>]
441
+ # @!attribute [rw] lib_name
442
+ # The library name as recorded in instrumentation and logging
443
+ # @return [::String]
444
+ # @!attribute [rw] lib_version
445
+ # The library version as recorded in instrumentation and logging
446
+ # @return [::String]
447
+ # @!attribute [rw] timeout
448
+ # The call timeout in seconds.
449
+ # @return [::Numeric]
450
+ # @!attribute [rw] metadata
451
+ # Additional headers to be sent with the call.
452
+ # @return [::Hash{::Symbol=>::String}]
453
+ # @!attribute [rw] retry_policy
454
+ # The retry policy. The value is a hash with the following keys:
455
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
456
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
457
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
458
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
459
+ # trigger a retry.
460
+ # @return [::Hash]
461
+ # @!attribute [rw] quota_project
462
+ # A separate project against which to charge quota.
463
+ # @return [::String]
464
+ #
465
+ class Configuration
466
+ extend ::Gapic::Config
467
+
468
+ config_attr :endpoint, "clouderrorreporting.googleapis.com", ::String
469
+ config_attr :credentials, nil do |value|
470
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
471
+ allowed.any? { |klass| klass === value }
472
+ end
473
+ config_attr :scope, nil, ::String, ::Array, nil
474
+ config_attr :lib_name, nil, ::String, nil
475
+ config_attr :lib_version, nil, ::String, nil
476
+ config_attr :timeout, nil, ::Numeric, nil
477
+ config_attr :metadata, nil, ::Hash, nil
478
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
479
+ config_attr :quota_project, nil, ::String, nil
480
+
481
+ # @private
482
+ def initialize parent_config = nil
483
+ @parent_config = parent_config unless parent_config.nil?
484
+
485
+ yield self if block_given?
486
+ end
487
+
488
+ ##
489
+ # Configurations for individual RPCs
490
+ # @return [Rpcs]
491
+ #
492
+ def rpcs
493
+ @rpcs ||= begin
494
+ parent_rpcs = nil
495
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
496
+ Rpcs.new parent_rpcs
497
+ end
498
+ end
499
+
500
+ ##
501
+ # Configuration RPC class for the ErrorStatsService API.
502
+ #
503
+ # Includes fields providing the configuration for each RPC in this service.
504
+ # Each configuration object is of type `Gapic::Config::Method` and includes
505
+ # the following configuration fields:
506
+ #
507
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
508
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
509
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
510
+ # include the following keys:
511
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
512
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
513
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
514
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
515
+ # trigger a retry.
516
+ #
517
+ class Rpcs
518
+ ##
519
+ # RPC-specific configuration for `list_group_stats`
520
+ # @return [::Gapic::Config::Method]
521
+ #
522
+ attr_reader :list_group_stats
523
+ ##
524
+ # RPC-specific configuration for `list_events`
525
+ # @return [::Gapic::Config::Method]
526
+ #
527
+ attr_reader :list_events
528
+ ##
529
+ # RPC-specific configuration for `delete_events`
530
+ # @return [::Gapic::Config::Method]
531
+ #
532
+ attr_reader :delete_events
533
+
534
+ # @private
535
+ def initialize parent_rpcs = nil
536
+ list_group_stats_config = parent_rpcs.list_group_stats if parent_rpcs.respond_to? :list_group_stats
537
+ @list_group_stats = ::Gapic::Config::Method.new list_group_stats_config
538
+ list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events
539
+ @list_events = ::Gapic::Config::Method.new list_events_config
540
+ delete_events_config = parent_rpcs.delete_events if parent_rpcs.respond_to? :delete_events
541
+ @delete_events = ::Gapic::Config::Method.new delete_events_config
542
+
543
+ yield self if block_given?
544
+ end
545
+ end
546
+ end
547
+ end
548
+ end
549
+ end
550
+ end
551
+ end
552
+ end
553
+ end