google-cloud-error_reporting-v1beta1 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +203 -0
- data/README.md +75 -0
- data/lib/google-cloud-error_reporting-v1beta1.rb +21 -0
- data/lib/google/cloud/error_reporting/v1beta1.rb +37 -0
- data/lib/google/cloud/error_reporting/v1beta1/error_group_service.rb +49 -0
- data/lib/google/cloud/error_reporting/v1beta1/error_group_service/client.rb +456 -0
- data/lib/google/cloud/error_reporting/v1beta1/error_group_service/credentials.rb +51 -0
- data/lib/google/cloud/error_reporting/v1beta1/error_group_service/paths.rb +50 -0
- data/lib/google/cloud/error_reporting/v1beta1/error_stats_service.rb +50 -0
- data/lib/google/cloud/error_reporting/v1beta1/error_stats_service/client.rb +587 -0
- data/lib/google/cloud/error_reporting/v1beta1/error_stats_service/credentials.rb +51 -0
- data/lib/google/cloud/error_reporting/v1beta1/error_stats_service/paths.rb +47 -0
- data/lib/google/cloud/error_reporting/v1beta1/report_errors_service.rb +49 -0
- data/lib/google/cloud/error_reporting/v1beta1/report_errors_service/client.rb +385 -0
- data/lib/google/cloud/error_reporting/v1beta1/report_errors_service/credentials.rb +51 -0
- data/lib/google/cloud/error_reporting/v1beta1/report_errors_service/paths.rb +47 -0
- data/lib/google/cloud/error_reporting/v1beta1/version.rb +28 -0
- data/lib/google/devtools/clouderrorreporting/v1beta1/common_pb.rb +65 -0
- data/lib/google/devtools/clouderrorreporting/v1beta1/error_group_service_pb.rb +31 -0
- data/lib/google/devtools/clouderrorreporting/v1beta1/error_group_service_services_pb.rb +49 -0
- data/lib/google/devtools/clouderrorreporting/v1beta1/error_stats_service_pb.rb +117 -0
- data/lib/google/devtools/clouderrorreporting/v1beta1/error_stats_service_services_pb.rb +51 -0
- data/lib/google/devtools/clouderrorreporting/v1beta1/report_errors_service_pb.rb +39 -0
- data/lib/google/devtools/clouderrorreporting/v1beta1/report_errors_service_services_pb.rb +54 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +59 -0
- data/proto_docs/google/api/resource.rb +247 -0
- data/proto_docs/google/devtools/clouderrorreporting/v1beta1/common.rb +183 -0
- data/proto_docs/google/devtools/clouderrorreporting/v1beta1/error_group_service.rb +49 -0
- data/proto_docs/google/devtools/clouderrorreporting/v1beta1/error_stats_service.rb +348 -0
- data/proto_docs/google/devtools/clouderrorreporting/v1beta1/report_errors_service.rb +92 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/timestamp.rb +120 -0
- metadata +218 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 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
|
+
# This gem does not autoload during Bundler.require. To load this gem,
|
20
|
+
# issue explicit require statements for the packages desired, e.g.:
|
21
|
+
# require "google/cloud/error_reporting/v1beta1"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 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/error_reporting/v1beta1/error_group_service"
|
20
|
+
require "google/cloud/error_reporting/v1beta1/error_stats_service"
|
21
|
+
require "google/cloud/error_reporting/v1beta1/report_errors_service"
|
22
|
+
require "google/cloud/error_reporting/v1beta1/version"
|
23
|
+
|
24
|
+
module Google
|
25
|
+
module Cloud
|
26
|
+
module ErrorReporting
|
27
|
+
##
|
28
|
+
# To load this package, including all its services, and instantiate a client:
|
29
|
+
#
|
30
|
+
# require "google/cloud/error_reporting/v1beta1"
|
31
|
+
# client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client.new
|
32
|
+
#
|
33
|
+
module V1beta1
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 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/common"
|
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/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 client:
|
37
|
+
#
|
38
|
+
# require "google/cloud/error_reporting/v1beta1/error_group_service"
|
39
|
+
# client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client.new
|
40
|
+
#
|
41
|
+
module ErrorGroupService
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
helper_path = ::File.join __dir__, "error_group_service", "helpers.rb"
|
49
|
+
require "google/cloud/error_reporting/v1beta1/error_group_service/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,456 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 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
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module ErrorReporting
|
25
|
+
module V1beta1
|
26
|
+
module ErrorGroupService
|
27
|
+
##
|
28
|
+
# Client for the ErrorGroupService service.
|
29
|
+
#
|
30
|
+
# Service for retrieving and updating individual error groups.
|
31
|
+
#
|
32
|
+
class Client
|
33
|
+
include Paths
|
34
|
+
|
35
|
+
# @private
|
36
|
+
attr_reader :error_group_service_stub
|
37
|
+
|
38
|
+
##
|
39
|
+
# Configure the ErrorGroupService Client class.
|
40
|
+
#
|
41
|
+
# See {::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client::Configuration}
|
42
|
+
# for a description of the configuration fields.
|
43
|
+
#
|
44
|
+
# ## Example
|
45
|
+
#
|
46
|
+
# To modify the configuration for all ErrorGroupService clients:
|
47
|
+
#
|
48
|
+
# ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client.configure do |config|
|
49
|
+
# config.timeout = 10.0
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# @yield [config] Configure the Client client.
|
53
|
+
# @yieldparam config [Client::Configuration]
|
54
|
+
#
|
55
|
+
# @return [Client::Configuration]
|
56
|
+
#
|
57
|
+
def self.configure
|
58
|
+
@configure ||= begin
|
59
|
+
namespace = ["Google", "Cloud", "ErrorReporting", "V1beta1"]
|
60
|
+
parent_config = while namespace.any?
|
61
|
+
parent_name = namespace.join "::"
|
62
|
+
parent_const = const_get parent_name
|
63
|
+
break parent_const.configure if parent_const&.respond_to? :configure
|
64
|
+
namespace.pop
|
65
|
+
end
|
66
|
+
default_config = Client::Configuration.new parent_config
|
67
|
+
|
68
|
+
default_config.timeout = 600.0
|
69
|
+
default_config.retry_policy = {
|
70
|
+
initial_delay: 0.1,
|
71
|
+
max_delay: 60.0,
|
72
|
+
multiplier: 1.3,
|
73
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
74
|
+
}
|
75
|
+
|
76
|
+
default_config
|
77
|
+
end
|
78
|
+
yield @configure if block_given?
|
79
|
+
@configure
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# Configure the ErrorGroupService Client instance.
|
84
|
+
#
|
85
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
86
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
87
|
+
# should be made on {Client.configure}.
|
88
|
+
#
|
89
|
+
# See {::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client::Configuration}
|
90
|
+
# for a description of the configuration fields.
|
91
|
+
#
|
92
|
+
# @yield [config] Configure the Client client.
|
93
|
+
# @yieldparam config [Client::Configuration]
|
94
|
+
#
|
95
|
+
# @return [Client::Configuration]
|
96
|
+
#
|
97
|
+
def configure
|
98
|
+
yield @config if block_given?
|
99
|
+
@config
|
100
|
+
end
|
101
|
+
|
102
|
+
##
|
103
|
+
# Create a new ErrorGroupService client object.
|
104
|
+
#
|
105
|
+
# ## Examples
|
106
|
+
#
|
107
|
+
# To create a new ErrorGroupService client with the default
|
108
|
+
# configuration:
|
109
|
+
#
|
110
|
+
# client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client.new
|
111
|
+
#
|
112
|
+
# To create a new ErrorGroupService client with a custom
|
113
|
+
# configuration:
|
114
|
+
#
|
115
|
+
# client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client.new do |config|
|
116
|
+
# config.timeout = 10.0
|
117
|
+
# end
|
118
|
+
#
|
119
|
+
# @yield [config] Configure the ErrorGroupService client.
|
120
|
+
# @yieldparam config [Client::Configuration]
|
121
|
+
#
|
122
|
+
def initialize
|
123
|
+
# These require statements are intentionally placed here to initialize
|
124
|
+
# the gRPC module only when it's required.
|
125
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
126
|
+
require "gapic/grpc"
|
127
|
+
require "google/devtools/clouderrorreporting/v1beta1/error_group_service_services_pb"
|
128
|
+
|
129
|
+
# Create the configuration object
|
130
|
+
@config = Configuration.new Client.configure
|
131
|
+
|
132
|
+
# Yield the configuration if needed
|
133
|
+
yield @config if block_given?
|
134
|
+
|
135
|
+
# Create credentials
|
136
|
+
credentials = @config.credentials
|
137
|
+
credentials ||= Credentials.default scope: @config.scope
|
138
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
139
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
140
|
+
end
|
141
|
+
@quota_project_id = @config.quota_project
|
142
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
143
|
+
|
144
|
+
@error_group_service_stub = ::Gapic::ServiceStub.new(
|
145
|
+
::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Stub,
|
146
|
+
credentials: credentials,
|
147
|
+
endpoint: @config.endpoint,
|
148
|
+
channel_args: @config.channel_args,
|
149
|
+
interceptors: @config.interceptors
|
150
|
+
)
|
151
|
+
end
|
152
|
+
|
153
|
+
# Service calls
|
154
|
+
|
155
|
+
##
|
156
|
+
# Get the specified group.
|
157
|
+
#
|
158
|
+
# @overload get_group(request, options = nil)
|
159
|
+
# Pass arguments to `get_group` via a request object, either of type
|
160
|
+
# {::Google::Cloud::ErrorReporting::V1beta1::GetGroupRequest} or an equivalent Hash.
|
161
|
+
#
|
162
|
+
# @param request [::Google::Cloud::ErrorReporting::V1beta1::GetGroupRequest, ::Hash]
|
163
|
+
# A request object representing the call parameters. Required. To specify no
|
164
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
165
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
166
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
167
|
+
#
|
168
|
+
# @overload get_group(group_name: nil)
|
169
|
+
# Pass arguments to `get_group` via keyword arguments. Note that at
|
170
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
171
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
172
|
+
#
|
173
|
+
# @param group_name [::String]
|
174
|
+
# The group resource name. Written as
|
175
|
+
# `projects/{projectID}/groups/{group_name}`. Call
|
176
|
+
# [`groupStats.list`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.groupStats/list)
|
177
|
+
# to return a list of groups belonging to this project.
|
178
|
+
#
|
179
|
+
# Example: `projects/my-project-123/groups/my-group`
|
180
|
+
#
|
181
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
182
|
+
# @yieldparam response [::Google::Cloud::ErrorReporting::V1beta1::ErrorGroup]
|
183
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
184
|
+
#
|
185
|
+
# @return [::Google::Cloud::ErrorReporting::V1beta1::ErrorGroup]
|
186
|
+
#
|
187
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
188
|
+
#
|
189
|
+
def get_group request, options = nil
|
190
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
191
|
+
|
192
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ErrorReporting::V1beta1::GetGroupRequest
|
193
|
+
|
194
|
+
# Converts hash and nil to an options object
|
195
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
196
|
+
|
197
|
+
# Customize the options with defaults
|
198
|
+
metadata = @config.rpcs.get_group.metadata.to_h
|
199
|
+
|
200
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
201
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
202
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
203
|
+
gapic_version: ::Google::Cloud::ErrorReporting::V1beta1::VERSION
|
204
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
205
|
+
|
206
|
+
header_params = {
|
207
|
+
"group_name" => request.group_name
|
208
|
+
}
|
209
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
210
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
211
|
+
|
212
|
+
options.apply_defaults timeout: @config.rpcs.get_group.timeout,
|
213
|
+
metadata: metadata,
|
214
|
+
retry_policy: @config.rpcs.get_group.retry_policy
|
215
|
+
options.apply_defaults metadata: @config.metadata,
|
216
|
+
retry_policy: @config.retry_policy
|
217
|
+
|
218
|
+
@error_group_service_stub.call_rpc :get_group, request, options: options do |response, operation|
|
219
|
+
yield response, operation if block_given?
|
220
|
+
return response
|
221
|
+
end
|
222
|
+
rescue ::GRPC::BadStatus => e
|
223
|
+
raise ::Google::Cloud::Error.from_error(e)
|
224
|
+
end
|
225
|
+
|
226
|
+
##
|
227
|
+
# Replace the data for the specified group.
|
228
|
+
# Fails if the group does not exist.
|
229
|
+
#
|
230
|
+
# @overload update_group(request, options = nil)
|
231
|
+
# Pass arguments to `update_group` via a request object, either of type
|
232
|
+
# {::Google::Cloud::ErrorReporting::V1beta1::UpdateGroupRequest} or an equivalent Hash.
|
233
|
+
#
|
234
|
+
# @param request [::Google::Cloud::ErrorReporting::V1beta1::UpdateGroupRequest, ::Hash]
|
235
|
+
# A request object representing the call parameters. Required. To specify no
|
236
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
237
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
238
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
239
|
+
#
|
240
|
+
# @overload update_group(group: nil)
|
241
|
+
# Pass arguments to `update_group` via keyword arguments. Note that at
|
242
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
243
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
244
|
+
#
|
245
|
+
# @param group [::Google::Cloud::ErrorReporting::V1beta1::ErrorGroup, ::Hash]
|
246
|
+
# Required. The group which replaces the resource on the server.
|
247
|
+
#
|
248
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
249
|
+
# @yieldparam response [::Google::Cloud::ErrorReporting::V1beta1::ErrorGroup]
|
250
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
251
|
+
#
|
252
|
+
# @return [::Google::Cloud::ErrorReporting::V1beta1::ErrorGroup]
|
253
|
+
#
|
254
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
255
|
+
#
|
256
|
+
def update_group request, options = nil
|
257
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
258
|
+
|
259
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ErrorReporting::V1beta1::UpdateGroupRequest
|
260
|
+
|
261
|
+
# Converts hash and nil to an options object
|
262
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
263
|
+
|
264
|
+
# Customize the options with defaults
|
265
|
+
metadata = @config.rpcs.update_group.metadata.to_h
|
266
|
+
|
267
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
268
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
269
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
270
|
+
gapic_version: ::Google::Cloud::ErrorReporting::V1beta1::VERSION
|
271
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
272
|
+
|
273
|
+
header_params = {
|
274
|
+
"group.name" => request.group.name
|
275
|
+
}
|
276
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
277
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
278
|
+
|
279
|
+
options.apply_defaults timeout: @config.rpcs.update_group.timeout,
|
280
|
+
metadata: metadata,
|
281
|
+
retry_policy: @config.rpcs.update_group.retry_policy
|
282
|
+
options.apply_defaults metadata: @config.metadata,
|
283
|
+
retry_policy: @config.retry_policy
|
284
|
+
|
285
|
+
@error_group_service_stub.call_rpc :update_group, request, options: options do |response, operation|
|
286
|
+
yield response, operation if block_given?
|
287
|
+
return response
|
288
|
+
end
|
289
|
+
rescue ::GRPC::BadStatus => e
|
290
|
+
raise ::Google::Cloud::Error.from_error(e)
|
291
|
+
end
|
292
|
+
|
293
|
+
##
|
294
|
+
# Configuration class for the ErrorGroupService API.
|
295
|
+
#
|
296
|
+
# This class represents the configuration for ErrorGroupService,
|
297
|
+
# providing control over timeouts, retry behavior, logging, transport
|
298
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
299
|
+
# applied individually to specific RPCs. See
|
300
|
+
# {::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client::Configuration::Rpcs}
|
301
|
+
# for a list of RPCs that can be configured independently.
|
302
|
+
#
|
303
|
+
# Configuration can be applied globally to all clients, or to a single client
|
304
|
+
# on construction.
|
305
|
+
#
|
306
|
+
# # Examples
|
307
|
+
#
|
308
|
+
# To modify the global config, setting the timeout for get_group
|
309
|
+
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
310
|
+
#
|
311
|
+
# ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client.configure do |config|
|
312
|
+
# config.timeout = 10.0
|
313
|
+
# config.rpcs.get_group.timeout = 20.0
|
314
|
+
# end
|
315
|
+
#
|
316
|
+
# To apply the above configuration only to a new client:
|
317
|
+
#
|
318
|
+
# client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client.new do |config|
|
319
|
+
# config.timeout = 10.0
|
320
|
+
# config.rpcs.get_group.timeout = 20.0
|
321
|
+
# end
|
322
|
+
#
|
323
|
+
# @!attribute [rw] endpoint
|
324
|
+
# The hostname or hostname:port of the service endpoint.
|
325
|
+
# Defaults to `"clouderrorreporting.googleapis.com"`.
|
326
|
+
# @return [::String]
|
327
|
+
# @!attribute [rw] credentials
|
328
|
+
# Credentials to send with calls. You may provide any of the following types:
|
329
|
+
# * (`String`) The path to a service account key file in JSON format
|
330
|
+
# * (`Hash`) A service account key as a Hash
|
331
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
332
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
333
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
334
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
335
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
336
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
337
|
+
# * (`nil`) indicating no credentials
|
338
|
+
# @return [::Object]
|
339
|
+
# @!attribute [rw] scope
|
340
|
+
# The OAuth scopes
|
341
|
+
# @return [::Array<::String>]
|
342
|
+
# @!attribute [rw] lib_name
|
343
|
+
# The library name as recorded in instrumentation and logging
|
344
|
+
# @return [::String]
|
345
|
+
# @!attribute [rw] lib_version
|
346
|
+
# The library version as recorded in instrumentation and logging
|
347
|
+
# @return [::String]
|
348
|
+
# @!attribute [rw] channel_args
|
349
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
350
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
351
|
+
# @return [::Hash]
|
352
|
+
# @!attribute [rw] interceptors
|
353
|
+
# An array of interceptors that are run before calls are executed.
|
354
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
355
|
+
# @!attribute [rw] timeout
|
356
|
+
# The call timeout in seconds.
|
357
|
+
# @return [::Numeric]
|
358
|
+
# @!attribute [rw] metadata
|
359
|
+
# Additional gRPC headers to be sent with the call.
|
360
|
+
# @return [::Hash{::Symbol=>::String}]
|
361
|
+
# @!attribute [rw] retry_policy
|
362
|
+
# The retry policy. The value is a hash with the following keys:
|
363
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
364
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
365
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
366
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
367
|
+
# trigger a retry.
|
368
|
+
# @return [::Hash]
|
369
|
+
# @!attribute [rw] quota_project
|
370
|
+
# A separate project against which to charge quota.
|
371
|
+
# @return [::String]
|
372
|
+
#
|
373
|
+
class Configuration
|
374
|
+
extend ::Gapic::Config
|
375
|
+
|
376
|
+
config_attr :endpoint, "clouderrorreporting.googleapis.com", ::String
|
377
|
+
config_attr :credentials, nil do |value|
|
378
|
+
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
379
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
380
|
+
allowed.any? { |klass| klass === value }
|
381
|
+
end
|
382
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
383
|
+
config_attr :lib_name, nil, ::String, nil
|
384
|
+
config_attr :lib_version, nil, ::String, nil
|
385
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
386
|
+
config_attr :interceptors, nil, ::Array, nil
|
387
|
+
config_attr :timeout, nil, ::Numeric, nil
|
388
|
+
config_attr :metadata, nil, ::Hash, nil
|
389
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
390
|
+
config_attr :quota_project, nil, ::String, nil
|
391
|
+
|
392
|
+
# @private
|
393
|
+
def initialize parent_config = nil
|
394
|
+
@parent_config = parent_config unless parent_config.nil?
|
395
|
+
|
396
|
+
yield self if block_given?
|
397
|
+
end
|
398
|
+
|
399
|
+
##
|
400
|
+
# Configurations for individual RPCs
|
401
|
+
# @return [Rpcs]
|
402
|
+
#
|
403
|
+
def rpcs
|
404
|
+
@rpcs ||= begin
|
405
|
+
parent_rpcs = nil
|
406
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
|
407
|
+
Rpcs.new parent_rpcs
|
408
|
+
end
|
409
|
+
end
|
410
|
+
|
411
|
+
##
|
412
|
+
# Configuration RPC class for the ErrorGroupService API.
|
413
|
+
#
|
414
|
+
# Includes fields providing the configuration for each RPC in this service.
|
415
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
416
|
+
# the following configuration fields:
|
417
|
+
#
|
418
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
|
419
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
420
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
421
|
+
# include the following keys:
|
422
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
423
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
424
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
425
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
426
|
+
# trigger a retry.
|
427
|
+
#
|
428
|
+
class Rpcs
|
429
|
+
##
|
430
|
+
# RPC-specific configuration for `get_group`
|
431
|
+
# @return [::Gapic::Config::Method]
|
432
|
+
#
|
433
|
+
attr_reader :get_group
|
434
|
+
##
|
435
|
+
# RPC-specific configuration for `update_group`
|
436
|
+
# @return [::Gapic::Config::Method]
|
437
|
+
#
|
438
|
+
attr_reader :update_group
|
439
|
+
|
440
|
+
# @private
|
441
|
+
def initialize parent_rpcs = nil
|
442
|
+
get_group_config = parent_rpcs&.get_group if parent_rpcs&.respond_to? :get_group
|
443
|
+
@get_group = ::Gapic::Config::Method.new get_group_config
|
444
|
+
update_group_config = parent_rpcs&.update_group if parent_rpcs&.respond_to? :update_group
|
445
|
+
@update_group = ::Gapic::Config::Method.new update_group_config
|
446
|
+
|
447
|
+
yield self if block_given?
|
448
|
+
end
|
449
|
+
end
|
450
|
+
end
|
451
|
+
end
|
452
|
+
end
|
453
|
+
end
|
454
|
+
end
|
455
|
+
end
|
456
|
+
end
|