google-cloud-error_reporting-v1beta1 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,225 @@
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/devtools/clouderrorreporting/v1beta1/error_stats_service_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module ErrorReporting
24
+ module V1beta1
25
+ module ErrorStatsService
26
+ module Rest
27
+ ##
28
+ # REST service stub for the ErrorStatsService service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
39
+ numeric_enums: true,
40
+ raise_faraday_errors: false
41
+ end
42
+
43
+ ##
44
+ # Baseline implementation for the list_group_stats REST call
45
+ #
46
+ # @param request_pb [::Google::Cloud::ErrorReporting::V1beta1::ListGroupStatsRequest]
47
+ # A request object representing the call parameters. Required.
48
+ # @param options [::Gapic::CallOptions]
49
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
50
+ #
51
+ # @yield [result, operation] Access the result along with the TransportOperation object
52
+ # @yieldparam result [::Google::Cloud::ErrorReporting::V1beta1::ListGroupStatsResponse]
53
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
54
+ #
55
+ # @return [::Google::Cloud::ErrorReporting::V1beta1::ListGroupStatsResponse]
56
+ # A result object deserialized from the server's reply
57
+ def list_group_stats request_pb, options = nil
58
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
59
+
60
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_group_stats_request request_pb
61
+ query_string_params = if query_string_params.any?
62
+ query_string_params.to_h { |p| p.split("=", 2) }
63
+ else
64
+ {}
65
+ end
66
+
67
+ response = @client_stub.make_http_request(
68
+ verb,
69
+ uri: uri,
70
+ body: body || "",
71
+ params: query_string_params,
72
+ options: options
73
+ )
74
+ operation = ::Gapic::Rest::TransportOperation.new response
75
+ result = ::Google::Cloud::ErrorReporting::V1beta1::ListGroupStatsResponse.decode_json response.body, ignore_unknown_fields: true
76
+
77
+ yield result, operation if block_given?
78
+ result
79
+ end
80
+
81
+ ##
82
+ # Baseline implementation for the list_events REST call
83
+ #
84
+ # @param request_pb [::Google::Cloud::ErrorReporting::V1beta1::ListEventsRequest]
85
+ # A request object representing the call parameters. Required.
86
+ # @param options [::Gapic::CallOptions]
87
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
88
+ #
89
+ # @yield [result, operation] Access the result along with the TransportOperation object
90
+ # @yieldparam result [::Google::Cloud::ErrorReporting::V1beta1::ListEventsResponse]
91
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
92
+ #
93
+ # @return [::Google::Cloud::ErrorReporting::V1beta1::ListEventsResponse]
94
+ # A result object deserialized from the server's reply
95
+ def list_events request_pb, options = nil
96
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
97
+
98
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_events_request request_pb
99
+ query_string_params = if query_string_params.any?
100
+ query_string_params.to_h { |p| p.split("=", 2) }
101
+ else
102
+ {}
103
+ end
104
+
105
+ response = @client_stub.make_http_request(
106
+ verb,
107
+ uri: uri,
108
+ body: body || "",
109
+ params: query_string_params,
110
+ options: options
111
+ )
112
+ operation = ::Gapic::Rest::TransportOperation.new response
113
+ result = ::Google::Cloud::ErrorReporting::V1beta1::ListEventsResponse.decode_json response.body, ignore_unknown_fields: true
114
+
115
+ yield result, operation if block_given?
116
+ result
117
+ end
118
+
119
+ ##
120
+ # Baseline implementation for the delete_events REST call
121
+ #
122
+ # @param request_pb [::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsRequest]
123
+ # A request object representing the call parameters. Required.
124
+ # @param options [::Gapic::CallOptions]
125
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
126
+ #
127
+ # @yield [result, operation] Access the result along with the TransportOperation object
128
+ # @yieldparam result [::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsResponse]
129
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
130
+ #
131
+ # @return [::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsResponse]
132
+ # A result object deserialized from the server's reply
133
+ def delete_events request_pb, options = nil
134
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
135
+
136
+ verb, uri, query_string_params, body = ServiceStub.transcode_delete_events_request request_pb
137
+ query_string_params = if query_string_params.any?
138
+ query_string_params.to_h { |p| p.split("=", 2) }
139
+ else
140
+ {}
141
+ end
142
+
143
+ response = @client_stub.make_http_request(
144
+ verb,
145
+ uri: uri,
146
+ body: body || "",
147
+ params: query_string_params,
148
+ options: options
149
+ )
150
+ operation = ::Gapic::Rest::TransportOperation.new response
151
+ result = ::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsResponse.decode_json response.body, ignore_unknown_fields: true
152
+
153
+ yield result, operation if block_given?
154
+ result
155
+ end
156
+
157
+ ##
158
+ # @private
159
+ #
160
+ # GRPC transcoding helper method for the list_group_stats REST call
161
+ #
162
+ # @param request_pb [::Google::Cloud::ErrorReporting::V1beta1::ListGroupStatsRequest]
163
+ # A request object representing the call parameters. Required.
164
+ # @return [Array(String, [String, nil], Hash{String => String})]
165
+ # Uri, Body, Query string parameters
166
+ def self.transcode_list_group_stats_request request_pb
167
+ transcoder = Gapic::Rest::GrpcTranscoder.new
168
+ .with_bindings(
169
+ uri_method: :get,
170
+ uri_template: "/v1beta1/{project_name}/groupStats",
171
+ matches: [
172
+ ["project_name", %r{^projects/[^/]+/?$}, false]
173
+ ]
174
+ )
175
+ transcoder.transcode request_pb
176
+ end
177
+
178
+ ##
179
+ # @private
180
+ #
181
+ # GRPC transcoding helper method for the list_events REST call
182
+ #
183
+ # @param request_pb [::Google::Cloud::ErrorReporting::V1beta1::ListEventsRequest]
184
+ # A request object representing the call parameters. Required.
185
+ # @return [Array(String, [String, nil], Hash{String => String})]
186
+ # Uri, Body, Query string parameters
187
+ def self.transcode_list_events_request request_pb
188
+ transcoder = Gapic::Rest::GrpcTranscoder.new
189
+ .with_bindings(
190
+ uri_method: :get,
191
+ uri_template: "/v1beta1/{project_name}/events",
192
+ matches: [
193
+ ["project_name", %r{^projects/[^/]+/?$}, false]
194
+ ]
195
+ )
196
+ transcoder.transcode request_pb
197
+ end
198
+
199
+ ##
200
+ # @private
201
+ #
202
+ # GRPC transcoding helper method for the delete_events REST call
203
+ #
204
+ # @param request_pb [::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsRequest]
205
+ # A request object representing the call parameters. Required.
206
+ # @return [Array(String, [String, nil], Hash{String => String})]
207
+ # Uri, Body, Query string parameters
208
+ def self.transcode_delete_events_request request_pb
209
+ transcoder = Gapic::Rest::GrpcTranscoder.new
210
+ .with_bindings(
211
+ uri_method: :delete,
212
+ uri_template: "/v1beta1/{project_name}/events",
213
+ matches: [
214
+ ["project_name", %r{^projects/[^/]+/?$}, false]
215
+ ]
216
+ )
217
+ transcoder.transcode request_pb
218
+ end
219
+ end
220
+ end
221
+ end
222
+ end
223
+ end
224
+ end
225
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/error_reporting/v1beta1/version"
24
+
25
+ require "google/cloud/error_reporting/v1beta1/error_stats_service/credentials"
26
+ require "google/cloud/error_reporting/v1beta1/error_stats_service/paths"
27
+ require "google/cloud/error_reporting/v1beta1/error_stats_service/rest/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module ErrorReporting
32
+ module V1beta1
33
+ ##
34
+ # An API for retrieving and managing error statistics as well as data for
35
+ # individual events.
36
+ #
37
+ # To load this service and instantiate a REST client:
38
+ #
39
+ # require "google/cloud/error_reporting/v1beta1/error_stats_service/rest"
40
+ # client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Rest::Client.new
41
+ #
42
+ module ErrorStatsService
43
+ # Client for the REST transport
44
+ module Rest
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
53
+ require "google/cloud/error_reporting/v1beta1/error_stats_service/rest/helpers" if ::File.file? helper_path
@@ -25,6 +25,7 @@ require "google/cloud/error_reporting/v1beta1/version"
25
25
  require "google/cloud/error_reporting/v1beta1/error_stats_service/credentials"
26
26
  require "google/cloud/error_reporting/v1beta1/error_stats_service/paths"
27
27
  require "google/cloud/error_reporting/v1beta1/error_stats_service/client"
28
+ require "google/cloud/error_reporting/v1beta1/error_stats_service/rest"
28
29
 
29
30
  module Google
30
31
  module Cloud
@@ -39,6 +40,11 @@ module Google
39
40
  # require "google/cloud/error_reporting/v1beta1/error_stats_service"
40
41
  # client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client.new
41
42
  #
43
+ # @example Load this service and instantiate a REST client
44
+ #
45
+ # require "google/cloud/error_reporting/v1beta1/error_stats_service/rest"
46
+ # client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Rest::Client.new
47
+ #
42
48
  module ErrorStatsService
43
49
  end
44
50
  end
@@ -0,0 +1,365 @@
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/report_errors_service_pb"
21
+ require "google/cloud/error_reporting/v1beta1/report_errors_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module ErrorReporting
26
+ module V1beta1
27
+ module ReportErrorsService
28
+ module Rest
29
+ ##
30
+ # REST client for the ReportErrorsService service.
31
+ #
32
+ # An API for reporting error events.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :report_errors_service_stub
39
+
40
+ ##
41
+ # Configure the ReportErrorsService Client class.
42
+ #
43
+ # See {::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Rest::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all ReportErrorsService clients
49
+ # ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Rest::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "ErrorReporting", "V1beta1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.timeout = 600.0
70
+
71
+ default_config
72
+ end
73
+ yield @configure if block_given?
74
+ @configure
75
+ end
76
+
77
+ ##
78
+ # Configure the ReportErrorsService Client instance.
79
+ #
80
+ # The configuration is set to the derived mode, meaning that values can be changed,
81
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
82
+ # should be made on {Client.configure}.
83
+ #
84
+ # See {::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Rest::Client::Configuration}
85
+ # for a description of the configuration fields.
86
+ #
87
+ # @yield [config] Configure the Client client.
88
+ # @yieldparam config [Client::Configuration]
89
+ #
90
+ # @return [Client::Configuration]
91
+ #
92
+ def configure
93
+ yield @config if block_given?
94
+ @config
95
+ end
96
+
97
+ ##
98
+ # Create a new ReportErrorsService REST client object.
99
+ #
100
+ # @example
101
+ #
102
+ # # Create a client using the default configuration
103
+ # client = ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Rest::Client.new
104
+ #
105
+ # # Create a client using a custom configuration
106
+ # client = ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Rest::Client.new do |config|
107
+ # config.timeout = 10.0
108
+ # end
109
+ #
110
+ # @yield [config] Configure the ReportErrorsService client.
111
+ # @yieldparam config [Client::Configuration]
112
+ #
113
+ def initialize
114
+ # Create the configuration object
115
+ @config = Configuration.new Client.configure
116
+
117
+ # Yield the configuration if needed
118
+ yield @config if block_given?
119
+
120
+ # Create credentials
121
+ credentials = @config.credentials
122
+ # Use self-signed JWT if the endpoint is unchanged from default,
123
+ # but only if the default endpoint does not have a region prefix.
124
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
125
+ !@config.endpoint.split(".").first.include?("-")
126
+ credentials ||= Credentials.default scope: @config.scope,
127
+ enable_self_signed_jwt: enable_self_signed_jwt
128
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
129
+ credentials = Credentials.new credentials, scope: @config.scope
130
+ end
131
+
132
+ @quota_project_id = @config.quota_project
133
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
134
+
135
+ @report_errors_service_stub = ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
136
+ end
137
+
138
+ # Service calls
139
+
140
+ ##
141
+ # Report an individual error event and record the event to a log.
142
+ #
143
+ # This endpoint accepts **either** an OAuth token,
144
+ # **or** an [API key](https://support.google.com/cloud/answer/6158862)
145
+ # for authentication. To use an API key, append it to the URL as the value of
146
+ # a `key` parameter. For example:
147
+ #
148
+ # `POST
149
+ # https://clouderrorreporting.googleapis.com/v1beta1/\\{projectName}/events:report?key=123ABC456`
150
+ #
151
+ # **Note:** [Error Reporting](/error-reporting) is a global service built
152
+ # on Cloud Logging and doesn't analyze logs stored
153
+ # in regional log buckets or logs routed to other Google Cloud projects.
154
+ #
155
+ # @overload report_error_event(request, options = nil)
156
+ # Pass arguments to `report_error_event` via a request object, either of type
157
+ # {::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventRequest} or an equivalent Hash.
158
+ #
159
+ # @param request [::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventRequest, ::Hash]
160
+ # A request object representing the call parameters. Required. To specify no
161
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
162
+ # @param options [::Gapic::CallOptions, ::Hash]
163
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
164
+ #
165
+ # @overload report_error_event(project_name: nil, event: nil)
166
+ # Pass arguments to `report_error_event` via keyword arguments. Note that at
167
+ # least one keyword argument is required. To specify no parameters, or to keep all
168
+ # the default parameter values, pass an empty Hash as a request object (see above).
169
+ #
170
+ # @param project_name [::String]
171
+ # Required. The resource name of the Google Cloud Platform project. Written
172
+ # as `projects/{projectId}`, where `{projectId}` is the
173
+ # [Google Cloud Platform project
174
+ # ID](https://support.google.com/cloud/answer/6158840).
175
+ #
176
+ # Example: // `projects/my-project-123`.
177
+ # @param event [::Google::Cloud::ErrorReporting::V1beta1::ReportedErrorEvent, ::Hash]
178
+ # Required. The error event to be reported.
179
+ # @yield [result, operation] Access the result along with the TransportOperation object
180
+ # @yieldparam result [::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse]
181
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
182
+ #
183
+ # @return [::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse]
184
+ #
185
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
186
+ def report_error_event request, options = nil
187
+ raise ::ArgumentError, "request must be provided" if request.nil?
188
+
189
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventRequest
190
+
191
+ # Converts hash and nil to an options object
192
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
193
+
194
+ # Customize the options with defaults
195
+ call_metadata = @config.rpcs.report_error_event.metadata.to_h
196
+
197
+ # Set x-goog-api-client and x-goog-user-project headers
198
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
199
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
200
+ gapic_version: ::Google::Cloud::ErrorReporting::V1beta1::VERSION,
201
+ transports_version_send: [:rest]
202
+
203
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
204
+
205
+ options.apply_defaults timeout: @config.rpcs.report_error_event.timeout,
206
+ metadata: call_metadata,
207
+ retry_policy: @config.rpcs.report_error_event.retry_policy
208
+
209
+ options.apply_defaults timeout: @config.timeout,
210
+ metadata: @config.metadata,
211
+ retry_policy: @config.retry_policy
212
+
213
+ @report_errors_service_stub.report_error_event request, options do |result, operation|
214
+ yield result, operation if block_given?
215
+ return result
216
+ end
217
+ rescue ::Gapic::Rest::Error => e
218
+ raise ::Google::Cloud::Error.from_error(e)
219
+ end
220
+
221
+ ##
222
+ # Configuration class for the ReportErrorsService REST API.
223
+ #
224
+ # This class represents the configuration for ReportErrorsService REST,
225
+ # providing control over timeouts, retry behavior, logging, transport
226
+ # parameters, and other low-level controls. Certain parameters can also be
227
+ # applied individually to specific RPCs. See
228
+ # {::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Rest::Client::Configuration::Rpcs}
229
+ # for a list of RPCs that can be configured independently.
230
+ #
231
+ # Configuration can be applied globally to all clients, or to a single client
232
+ # on construction.
233
+ #
234
+ # @example
235
+ #
236
+ # # Modify the global config, setting the timeout for
237
+ # # report_error_event to 20 seconds,
238
+ # # and all remaining timeouts to 10 seconds.
239
+ # ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Rest::Client.configure do |config|
240
+ # config.timeout = 10.0
241
+ # config.rpcs.report_error_event.timeout = 20.0
242
+ # end
243
+ #
244
+ # # Apply the above configuration only to a new client.
245
+ # client = ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Rest::Client.new do |config|
246
+ # config.timeout = 10.0
247
+ # config.rpcs.report_error_event.timeout = 20.0
248
+ # end
249
+ #
250
+ # @!attribute [rw] endpoint
251
+ # The hostname or hostname:port of the service endpoint.
252
+ # Defaults to `"clouderrorreporting.googleapis.com"`.
253
+ # @return [::String]
254
+ # @!attribute [rw] credentials
255
+ # Credentials to send with calls. You may provide any of the following types:
256
+ # * (`String`) The path to a service account key file in JSON format
257
+ # * (`Hash`) A service account key as a Hash
258
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
259
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
260
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
261
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
262
+ # * (`nil`) indicating no credentials
263
+ # @return [::Object]
264
+ # @!attribute [rw] scope
265
+ # The OAuth scopes
266
+ # @return [::Array<::String>]
267
+ # @!attribute [rw] lib_name
268
+ # The library name as recorded in instrumentation and logging
269
+ # @return [::String]
270
+ # @!attribute [rw] lib_version
271
+ # The library version as recorded in instrumentation and logging
272
+ # @return [::String]
273
+ # @!attribute [rw] timeout
274
+ # The call timeout in seconds.
275
+ # @return [::Numeric]
276
+ # @!attribute [rw] metadata
277
+ # Additional headers to be sent with the call.
278
+ # @return [::Hash{::Symbol=>::String}]
279
+ # @!attribute [rw] retry_policy
280
+ # The retry policy. The value is a hash with the following keys:
281
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
282
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
283
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
284
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
285
+ # trigger a retry.
286
+ # @return [::Hash]
287
+ # @!attribute [rw] quota_project
288
+ # A separate project against which to charge quota.
289
+ # @return [::String]
290
+ #
291
+ class Configuration
292
+ extend ::Gapic::Config
293
+
294
+ config_attr :endpoint, "clouderrorreporting.googleapis.com", ::String
295
+ config_attr :credentials, nil do |value|
296
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
297
+ allowed.any? { |klass| klass === value }
298
+ end
299
+ config_attr :scope, nil, ::String, ::Array, nil
300
+ config_attr :lib_name, nil, ::String, nil
301
+ config_attr :lib_version, nil, ::String, nil
302
+ config_attr :timeout, nil, ::Numeric, nil
303
+ config_attr :metadata, nil, ::Hash, nil
304
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
305
+ config_attr :quota_project, nil, ::String, nil
306
+
307
+ # @private
308
+ def initialize parent_config = nil
309
+ @parent_config = parent_config unless parent_config.nil?
310
+
311
+ yield self if block_given?
312
+ end
313
+
314
+ ##
315
+ # Configurations for individual RPCs
316
+ # @return [Rpcs]
317
+ #
318
+ def rpcs
319
+ @rpcs ||= begin
320
+ parent_rpcs = nil
321
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
322
+ Rpcs.new parent_rpcs
323
+ end
324
+ end
325
+
326
+ ##
327
+ # Configuration RPC class for the ReportErrorsService API.
328
+ #
329
+ # Includes fields providing the configuration for each RPC in this service.
330
+ # Each configuration object is of type `Gapic::Config::Method` and includes
331
+ # the following configuration fields:
332
+ #
333
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
334
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
335
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
336
+ # include the following keys:
337
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
338
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
339
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
340
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
341
+ # trigger a retry.
342
+ #
343
+ class Rpcs
344
+ ##
345
+ # RPC-specific configuration for `report_error_event`
346
+ # @return [::Gapic::Config::Method]
347
+ #
348
+ attr_reader :report_error_event
349
+
350
+ # @private
351
+ def initialize parent_rpcs = nil
352
+ report_error_event_config = parent_rpcs.report_error_event if parent_rpcs.respond_to? :report_error_event
353
+ @report_error_event = ::Gapic::Config::Method.new report_error_event_config
354
+
355
+ yield self if block_given?
356
+ end
357
+ end
358
+ end
359
+ end
360
+ end
361
+ end
362
+ end
363
+ end
364
+ end
365
+ end