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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/google/cloud/error_reporting/v1beta1/error_group_service/rest/client.rb +424 -0
- data/lib/google/cloud/error_reporting/v1beta1/error_group_service/rest/service_stub.rb +167 -0
- data/lib/google/cloud/error_reporting/v1beta1/error_group_service/rest.rb +52 -0
- data/lib/google/cloud/error_reporting/v1beta1/error_group_service.rb +6 -0
- data/lib/google/cloud/error_reporting/v1beta1/error_stats_service/client.rb +8 -12
- data/lib/google/cloud/error_reporting/v1beta1/error_stats_service/rest/client.rb +553 -0
- data/lib/google/cloud/error_reporting/v1beta1/error_stats_service/rest/service_stub.rb +225 -0
- data/lib/google/cloud/error_reporting/v1beta1/error_stats_service/rest.rb +53 -0
- data/lib/google/cloud/error_reporting/v1beta1/error_stats_service.rb +6 -0
- data/lib/google/cloud/error_reporting/v1beta1/report_errors_service/rest/client.rb +365 -0
- data/lib/google/cloud/error_reporting/v1beta1/report_errors_service/rest/service_stub.rb +108 -0
- data/lib/google/cloud/error_reporting/v1beta1/report_errors_service/rest.rb +52 -0
- data/lib/google/cloud/error_reporting/v1beta1/report_errors_service.rb +6 -0
- data/lib/google/cloud/error_reporting/v1beta1/rest.rb +39 -0
- data/lib/google/cloud/error_reporting/v1beta1/version.rb +1 -1
- data/lib/google/cloud/error_reporting/v1beta1.rb +5 -0
- metadata +18 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6307db3d2a3cfa87730b76fb325396d3c54526f47f5008cffc3efc784c801a2
|
4
|
+
data.tar.gz: 4ce86a718da1ad50ca45a4f7fac4622711b55d2b53e0f01b2ec0c023b7a72269
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ffda37786ba62c57cb77df526749362cb0a228a2778142fcafdc1fc46b695f0ba3ade46032ef69550ee9945b7e82bd575e91f09c87d21005432c16a7da7e6fb
|
7
|
+
data.tar.gz: e75b69a38d9c6da3741aabcbc97832d5314afa005924816163a38b0c008a2a5e8737f3c87c2f9c7a8407664038c9fce9070ab55068e805cc06d67c53fb34949b
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Ruby Client for the Error Reporting V1beta1 API
|
2
2
|
|
3
|
-
|
3
|
+
Groups and counts similar errors from cloud services and applications, reports new errors, and provides access to error groups and their associated errors.
|
4
4
|
|
5
5
|
The Error Reporting API provides a simple endpoint to report errors from your running service, and read access to error groups and their associated errors.
|
6
6
|
|
@@ -0,0 +1,424 @@
|
|
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_group_service_pb"
|
21
|
+
require "google/cloud/error_reporting/v1beta1/error_group_service/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module ErrorReporting
|
26
|
+
module V1beta1
|
27
|
+
module ErrorGroupService
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST client for the ErrorGroupService service.
|
31
|
+
#
|
32
|
+
# Service for retrieving and updating individual error groups.
|
33
|
+
#
|
34
|
+
class Client
|
35
|
+
include Paths
|
36
|
+
|
37
|
+
# @private
|
38
|
+
attr_reader :error_group_service_stub
|
39
|
+
|
40
|
+
##
|
41
|
+
# Configure the ErrorGroupService Client class.
|
42
|
+
#
|
43
|
+
# See {::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Rest::Client::Configuration}
|
44
|
+
# for a description of the configuration fields.
|
45
|
+
#
|
46
|
+
# @example
|
47
|
+
#
|
48
|
+
# # Modify the configuration for all ErrorGroupService clients
|
49
|
+
# ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::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
|
+
default_config.retry_policy = {
|
71
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
72
|
+
}
|
73
|
+
|
74
|
+
default_config
|
75
|
+
end
|
76
|
+
yield @configure if block_given?
|
77
|
+
@configure
|
78
|
+
end
|
79
|
+
|
80
|
+
##
|
81
|
+
# Configure the ErrorGroupService Client instance.
|
82
|
+
#
|
83
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
84
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
85
|
+
# should be made on {Client.configure}.
|
86
|
+
#
|
87
|
+
# See {::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Rest::Client::Configuration}
|
88
|
+
# for a description of the configuration fields.
|
89
|
+
#
|
90
|
+
# @yield [config] Configure the Client client.
|
91
|
+
# @yieldparam config [Client::Configuration]
|
92
|
+
#
|
93
|
+
# @return [Client::Configuration]
|
94
|
+
#
|
95
|
+
def configure
|
96
|
+
yield @config if block_given?
|
97
|
+
@config
|
98
|
+
end
|
99
|
+
|
100
|
+
##
|
101
|
+
# Create a new ErrorGroupService REST client object.
|
102
|
+
#
|
103
|
+
# @example
|
104
|
+
#
|
105
|
+
# # Create a client using the default configuration
|
106
|
+
# client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Rest::Client.new
|
107
|
+
#
|
108
|
+
# # Create a client using a custom configuration
|
109
|
+
# client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Rest::Client.new do |config|
|
110
|
+
# config.timeout = 10.0
|
111
|
+
# end
|
112
|
+
#
|
113
|
+
# @yield [config] Configure the ErrorGroupService client.
|
114
|
+
# @yieldparam config [Client::Configuration]
|
115
|
+
#
|
116
|
+
def initialize
|
117
|
+
# Create the configuration object
|
118
|
+
@config = Configuration.new Client.configure
|
119
|
+
|
120
|
+
# Yield the configuration if needed
|
121
|
+
yield @config if block_given?
|
122
|
+
|
123
|
+
# Create credentials
|
124
|
+
credentials = @config.credentials
|
125
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
126
|
+
# but only if the default endpoint does not have a region prefix.
|
127
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
128
|
+
!@config.endpoint.split(".").first.include?("-")
|
129
|
+
credentials ||= Credentials.default scope: @config.scope,
|
130
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
131
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
132
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
133
|
+
end
|
134
|
+
|
135
|
+
@quota_project_id = @config.quota_project
|
136
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
137
|
+
|
138
|
+
@error_group_service_stub = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
139
|
+
end
|
140
|
+
|
141
|
+
# Service calls
|
142
|
+
|
143
|
+
##
|
144
|
+
# Get the specified group.
|
145
|
+
#
|
146
|
+
# @overload get_group(request, options = nil)
|
147
|
+
# Pass arguments to `get_group` via a request object, either of type
|
148
|
+
# {::Google::Cloud::ErrorReporting::V1beta1::GetGroupRequest} or an equivalent Hash.
|
149
|
+
#
|
150
|
+
# @param request [::Google::Cloud::ErrorReporting::V1beta1::GetGroupRequest, ::Hash]
|
151
|
+
# A request object representing the call parameters. Required. To specify no
|
152
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
153
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
154
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
155
|
+
#
|
156
|
+
# @overload get_group(group_name: nil)
|
157
|
+
# Pass arguments to `get_group` via keyword arguments. Note that at
|
158
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
159
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
160
|
+
#
|
161
|
+
# @param group_name [::String]
|
162
|
+
# Required. The group resource name. Written as
|
163
|
+
# `projects/{projectID}/groups/{group_name}`. Call
|
164
|
+
# [`groupStats.list`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.groupStats/list)
|
165
|
+
# to return a list of groups belonging to this project.
|
166
|
+
#
|
167
|
+
# Example: `projects/my-project-123/groups/my-group`
|
168
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
169
|
+
# @yieldparam result [::Google::Cloud::ErrorReporting::V1beta1::ErrorGroup]
|
170
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
171
|
+
#
|
172
|
+
# @return [::Google::Cloud::ErrorReporting::V1beta1::ErrorGroup]
|
173
|
+
#
|
174
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
175
|
+
def get_group request, options = nil
|
176
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
177
|
+
|
178
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ErrorReporting::V1beta1::GetGroupRequest
|
179
|
+
|
180
|
+
# Converts hash and nil to an options object
|
181
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
182
|
+
|
183
|
+
# Customize the options with defaults
|
184
|
+
call_metadata = @config.rpcs.get_group.metadata.to_h
|
185
|
+
|
186
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
187
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
188
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
189
|
+
gapic_version: ::Google::Cloud::ErrorReporting::V1beta1::VERSION,
|
190
|
+
transports_version_send: [:rest]
|
191
|
+
|
192
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
193
|
+
|
194
|
+
options.apply_defaults timeout: @config.rpcs.get_group.timeout,
|
195
|
+
metadata: call_metadata,
|
196
|
+
retry_policy: @config.rpcs.get_group.retry_policy
|
197
|
+
|
198
|
+
options.apply_defaults timeout: @config.timeout,
|
199
|
+
metadata: @config.metadata,
|
200
|
+
retry_policy: @config.retry_policy
|
201
|
+
|
202
|
+
@error_group_service_stub.get_group request, options do |result, operation|
|
203
|
+
yield result, operation if block_given?
|
204
|
+
return result
|
205
|
+
end
|
206
|
+
rescue ::Gapic::Rest::Error => e
|
207
|
+
raise ::Google::Cloud::Error.from_error(e)
|
208
|
+
end
|
209
|
+
|
210
|
+
##
|
211
|
+
# Replace the data for the specified group.
|
212
|
+
# Fails if the group does not exist.
|
213
|
+
#
|
214
|
+
# @overload update_group(request, options = nil)
|
215
|
+
# Pass arguments to `update_group` via a request object, either of type
|
216
|
+
# {::Google::Cloud::ErrorReporting::V1beta1::UpdateGroupRequest} or an equivalent Hash.
|
217
|
+
#
|
218
|
+
# @param request [::Google::Cloud::ErrorReporting::V1beta1::UpdateGroupRequest, ::Hash]
|
219
|
+
# A request object representing the call parameters. Required. To specify no
|
220
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
221
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
222
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
223
|
+
#
|
224
|
+
# @overload update_group(group: nil)
|
225
|
+
# Pass arguments to `update_group` via keyword arguments. Note that at
|
226
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
227
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
228
|
+
#
|
229
|
+
# @param group [::Google::Cloud::ErrorReporting::V1beta1::ErrorGroup, ::Hash]
|
230
|
+
# Required. The group which replaces the resource on the server.
|
231
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
232
|
+
# @yieldparam result [::Google::Cloud::ErrorReporting::V1beta1::ErrorGroup]
|
233
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
234
|
+
#
|
235
|
+
# @return [::Google::Cloud::ErrorReporting::V1beta1::ErrorGroup]
|
236
|
+
#
|
237
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
238
|
+
def update_group request, options = nil
|
239
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
240
|
+
|
241
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ErrorReporting::V1beta1::UpdateGroupRequest
|
242
|
+
|
243
|
+
# Converts hash and nil to an options object
|
244
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
245
|
+
|
246
|
+
# Customize the options with defaults
|
247
|
+
call_metadata = @config.rpcs.update_group.metadata.to_h
|
248
|
+
|
249
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
250
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
251
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
252
|
+
gapic_version: ::Google::Cloud::ErrorReporting::V1beta1::VERSION,
|
253
|
+
transports_version_send: [:rest]
|
254
|
+
|
255
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
256
|
+
|
257
|
+
options.apply_defaults timeout: @config.rpcs.update_group.timeout,
|
258
|
+
metadata: call_metadata,
|
259
|
+
retry_policy: @config.rpcs.update_group.retry_policy
|
260
|
+
|
261
|
+
options.apply_defaults timeout: @config.timeout,
|
262
|
+
metadata: @config.metadata,
|
263
|
+
retry_policy: @config.retry_policy
|
264
|
+
|
265
|
+
@error_group_service_stub.update_group request, options do |result, operation|
|
266
|
+
yield result, operation if block_given?
|
267
|
+
return result
|
268
|
+
end
|
269
|
+
rescue ::Gapic::Rest::Error => e
|
270
|
+
raise ::Google::Cloud::Error.from_error(e)
|
271
|
+
end
|
272
|
+
|
273
|
+
##
|
274
|
+
# Configuration class for the ErrorGroupService REST API.
|
275
|
+
#
|
276
|
+
# This class represents the configuration for ErrorGroupService REST,
|
277
|
+
# providing control over timeouts, retry behavior, logging, transport
|
278
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
279
|
+
# applied individually to specific RPCs. See
|
280
|
+
# {::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Rest::Client::Configuration::Rpcs}
|
281
|
+
# for a list of RPCs that can be configured independently.
|
282
|
+
#
|
283
|
+
# Configuration can be applied globally to all clients, or to a single client
|
284
|
+
# on construction.
|
285
|
+
#
|
286
|
+
# @example
|
287
|
+
#
|
288
|
+
# # Modify the global config, setting the timeout for
|
289
|
+
# # get_group to 20 seconds,
|
290
|
+
# # and all remaining timeouts to 10 seconds.
|
291
|
+
# ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Rest::Client.configure do |config|
|
292
|
+
# config.timeout = 10.0
|
293
|
+
# config.rpcs.get_group.timeout = 20.0
|
294
|
+
# end
|
295
|
+
#
|
296
|
+
# # Apply the above configuration only to a new client.
|
297
|
+
# client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Rest::Client.new do |config|
|
298
|
+
# config.timeout = 10.0
|
299
|
+
# config.rpcs.get_group.timeout = 20.0
|
300
|
+
# end
|
301
|
+
#
|
302
|
+
# @!attribute [rw] endpoint
|
303
|
+
# The hostname or hostname:port of the service endpoint.
|
304
|
+
# Defaults to `"clouderrorreporting.googleapis.com"`.
|
305
|
+
# @return [::String]
|
306
|
+
# @!attribute [rw] credentials
|
307
|
+
# Credentials to send with calls. You may provide any of the following types:
|
308
|
+
# * (`String`) The path to a service account key file in JSON format
|
309
|
+
# * (`Hash`) A service account key as a Hash
|
310
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
311
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
312
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
313
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
314
|
+
# * (`nil`) indicating no credentials
|
315
|
+
# @return [::Object]
|
316
|
+
# @!attribute [rw] scope
|
317
|
+
# The OAuth scopes
|
318
|
+
# @return [::Array<::String>]
|
319
|
+
# @!attribute [rw] lib_name
|
320
|
+
# The library name as recorded in instrumentation and logging
|
321
|
+
# @return [::String]
|
322
|
+
# @!attribute [rw] lib_version
|
323
|
+
# The library version as recorded in instrumentation and logging
|
324
|
+
# @return [::String]
|
325
|
+
# @!attribute [rw] timeout
|
326
|
+
# The call timeout in seconds.
|
327
|
+
# @return [::Numeric]
|
328
|
+
# @!attribute [rw] metadata
|
329
|
+
# Additional headers to be sent with the call.
|
330
|
+
# @return [::Hash{::Symbol=>::String}]
|
331
|
+
# @!attribute [rw] retry_policy
|
332
|
+
# The retry policy. The value is a hash with the following keys:
|
333
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
334
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
335
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
336
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
337
|
+
# trigger a retry.
|
338
|
+
# @return [::Hash]
|
339
|
+
# @!attribute [rw] quota_project
|
340
|
+
# A separate project against which to charge quota.
|
341
|
+
# @return [::String]
|
342
|
+
#
|
343
|
+
class Configuration
|
344
|
+
extend ::Gapic::Config
|
345
|
+
|
346
|
+
config_attr :endpoint, "clouderrorreporting.googleapis.com", ::String
|
347
|
+
config_attr :credentials, nil do |value|
|
348
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
349
|
+
allowed.any? { |klass| klass === value }
|
350
|
+
end
|
351
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
352
|
+
config_attr :lib_name, nil, ::String, nil
|
353
|
+
config_attr :lib_version, nil, ::String, nil
|
354
|
+
config_attr :timeout, nil, ::Numeric, nil
|
355
|
+
config_attr :metadata, nil, ::Hash, nil
|
356
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
357
|
+
config_attr :quota_project, nil, ::String, nil
|
358
|
+
|
359
|
+
# @private
|
360
|
+
def initialize parent_config = nil
|
361
|
+
@parent_config = parent_config unless parent_config.nil?
|
362
|
+
|
363
|
+
yield self if block_given?
|
364
|
+
end
|
365
|
+
|
366
|
+
##
|
367
|
+
# Configurations for individual RPCs
|
368
|
+
# @return [Rpcs]
|
369
|
+
#
|
370
|
+
def rpcs
|
371
|
+
@rpcs ||= begin
|
372
|
+
parent_rpcs = nil
|
373
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
374
|
+
Rpcs.new parent_rpcs
|
375
|
+
end
|
376
|
+
end
|
377
|
+
|
378
|
+
##
|
379
|
+
# Configuration RPC class for the ErrorGroupService API.
|
380
|
+
#
|
381
|
+
# Includes fields providing the configuration for each RPC in this service.
|
382
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
383
|
+
# the following configuration fields:
|
384
|
+
#
|
385
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
386
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
387
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
388
|
+
# include the following keys:
|
389
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
390
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
391
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
392
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
393
|
+
# trigger a retry.
|
394
|
+
#
|
395
|
+
class Rpcs
|
396
|
+
##
|
397
|
+
# RPC-specific configuration for `get_group`
|
398
|
+
# @return [::Gapic::Config::Method]
|
399
|
+
#
|
400
|
+
attr_reader :get_group
|
401
|
+
##
|
402
|
+
# RPC-specific configuration for `update_group`
|
403
|
+
# @return [::Gapic::Config::Method]
|
404
|
+
#
|
405
|
+
attr_reader :update_group
|
406
|
+
|
407
|
+
# @private
|
408
|
+
def initialize parent_rpcs = nil
|
409
|
+
get_group_config = parent_rpcs.get_group if parent_rpcs.respond_to? :get_group
|
410
|
+
@get_group = ::Gapic::Config::Method.new get_group_config
|
411
|
+
update_group_config = parent_rpcs.update_group if parent_rpcs.respond_to? :update_group
|
412
|
+
@update_group = ::Gapic::Config::Method.new update_group_config
|
413
|
+
|
414
|
+
yield self if block_given?
|
415
|
+
end
|
416
|
+
end
|
417
|
+
end
|
418
|
+
end
|
419
|
+
end
|
420
|
+
end
|
421
|
+
end
|
422
|
+
end
|
423
|
+
end
|
424
|
+
end
|
@@ -0,0 +1,167 @@
|
|
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_group_service_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module ErrorReporting
|
24
|
+
module V1beta1
|
25
|
+
module ErrorGroupService
|
26
|
+
module Rest
|
27
|
+
##
|
28
|
+
# REST service stub for the ErrorGroupService 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 get_group REST call
|
45
|
+
#
|
46
|
+
# @param request_pb [::Google::Cloud::ErrorReporting::V1beta1::GetGroupRequest]
|
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::ErrorGroup]
|
53
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
54
|
+
#
|
55
|
+
# @return [::Google::Cloud::ErrorReporting::V1beta1::ErrorGroup]
|
56
|
+
# A result object deserialized from the server's reply
|
57
|
+
def get_group 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_get_group_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::ErrorGroup.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 update_group REST call
|
83
|
+
#
|
84
|
+
# @param request_pb [::Google::Cloud::ErrorReporting::V1beta1::UpdateGroupRequest]
|
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::ErrorGroup]
|
91
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
92
|
+
#
|
93
|
+
# @return [::Google::Cloud::ErrorReporting::V1beta1::ErrorGroup]
|
94
|
+
# A result object deserialized from the server's reply
|
95
|
+
def update_group 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_update_group_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::ErrorGroup.decode_json response.body, ignore_unknown_fields: true
|
114
|
+
|
115
|
+
yield result, operation if block_given?
|
116
|
+
result
|
117
|
+
end
|
118
|
+
|
119
|
+
##
|
120
|
+
# @private
|
121
|
+
#
|
122
|
+
# GRPC transcoding helper method for the get_group REST call
|
123
|
+
#
|
124
|
+
# @param request_pb [::Google::Cloud::ErrorReporting::V1beta1::GetGroupRequest]
|
125
|
+
# A request object representing the call parameters. Required.
|
126
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
127
|
+
# Uri, Body, Query string parameters
|
128
|
+
def self.transcode_get_group_request request_pb
|
129
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
130
|
+
.with_bindings(
|
131
|
+
uri_method: :get,
|
132
|
+
uri_template: "/v1beta1/{group_name}",
|
133
|
+
matches: [
|
134
|
+
["group_name", %r{^projects/[^/]+/groups/[^/]+/?$}, false]
|
135
|
+
]
|
136
|
+
)
|
137
|
+
transcoder.transcode request_pb
|
138
|
+
end
|
139
|
+
|
140
|
+
##
|
141
|
+
# @private
|
142
|
+
#
|
143
|
+
# GRPC transcoding helper method for the update_group REST call
|
144
|
+
#
|
145
|
+
# @param request_pb [::Google::Cloud::ErrorReporting::V1beta1::UpdateGroupRequest]
|
146
|
+
# A request object representing the call parameters. Required.
|
147
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
148
|
+
# Uri, Body, Query string parameters
|
149
|
+
def self.transcode_update_group_request request_pb
|
150
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
151
|
+
.with_bindings(
|
152
|
+
uri_method: :put,
|
153
|
+
uri_template: "/v1beta1/{group.name}",
|
154
|
+
body: "group",
|
155
|
+
matches: [
|
156
|
+
["group.name", %r{^projects/[^/]+/groups/[^/]+/?$}, false]
|
157
|
+
]
|
158
|
+
)
|
159
|
+
transcoder.transcode request_pb
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
@@ -0,0 +1,52 @@
|
|
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_group_service/credentials"
|
26
|
+
require "google/cloud/error_reporting/v1beta1/error_group_service/paths"
|
27
|
+
require "google/cloud/error_reporting/v1beta1/error_group_service/rest/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module ErrorReporting
|
32
|
+
module V1beta1
|
33
|
+
##
|
34
|
+
# Service for retrieving and updating individual error groups.
|
35
|
+
#
|
36
|
+
# To load this service and instantiate a REST client:
|
37
|
+
#
|
38
|
+
# require "google/cloud/error_reporting/v1beta1/error_group_service/rest"
|
39
|
+
# client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Rest::Client.new
|
40
|
+
#
|
41
|
+
module ErrorGroupService
|
42
|
+
# Client for the REST transport
|
43
|
+
module Rest
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
52
|
+
require "google/cloud/error_reporting/v1beta1/error_group_service/rest/helpers" if ::File.file? helper_path
|