google-cloud-debugger-v2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +75 -0
  6. data/lib/google-cloud-debugger-v2.rb +21 -0
  7. data/lib/google/cloud/debugger/v2.rb +36 -0
  8. data/lib/google/cloud/debugger/v2/controller.rb +67 -0
  9. data/lib/google/cloud/debugger/v2/controller/client.rb +591 -0
  10. data/lib/google/cloud/debugger/v2/controller/credentials.rb +52 -0
  11. data/lib/google/cloud/debugger/v2/debugger.rb +59 -0
  12. data/lib/google/cloud/debugger/v2/debugger/client.rb +742 -0
  13. data/lib/google/cloud/debugger/v2/debugger/credentials.rb +52 -0
  14. data/lib/google/cloud/debugger/v2/version.rb +28 -0
  15. data/lib/google/devtools/clouddebugger/v2/controller_pb.rb +51 -0
  16. data/lib/google/devtools/clouddebugger/v2/controller_services_pb.rb +97 -0
  17. data/lib/google/devtools/clouddebugger/v2/data_pb.rb +109 -0
  18. data/lib/google/devtools/clouddebugger/v2/debugger_pb.rb +78 -0
  19. data/lib/google/devtools/clouddebugger/v2/debugger_services_pb.rb +65 -0
  20. data/lib/google/devtools/source/v1/source_context_pb.rb +91 -0
  21. data/proto_docs/README.md +4 -0
  22. data/proto_docs/google/api/field_behavior.rb +59 -0
  23. data/proto_docs/google/api/resource.rb +247 -0
  24. data/proto_docs/google/devtools/clouddebugger/v2/controller.rb +113 -0
  25. data/proto_docs/google/devtools/clouddebugger/v2/data.rb +486 -0
  26. data/proto_docs/google/devtools/clouddebugger/v2/debugger.rb +185 -0
  27. data/proto_docs/google/devtools/source/v1/source_context.rb +205 -0
  28. data/proto_docs/google/protobuf/empty.rb +36 -0
  29. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  30. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  31. metadata +218 -0
@@ -0,0 +1,52 @@
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 "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Debugger
24
+ module V2
25
+ module Controller
26
+ # Credentials for the Controller API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform",
30
+ "https://www.googleapis.com/auth/cloud_debugger"
31
+ ]
32
+ self.env_vars = [
33
+ "DEBUGGER_CREDENTIALS",
34
+ "DEBUGGER_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS",
36
+ "GOOGLE_CLOUD_KEYFILE",
37
+ "GCLOUD_KEYFILE",
38
+ "DEBUGGER_CREDENTIALS_JSON",
39
+ "DEBUGGER_KEYFILE_JSON",
40
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
41
+ "GOOGLE_CLOUD_KEYFILE_JSON",
42
+ "GCLOUD_KEYFILE_JSON"
43
+ ]
44
+ self.paths = [
45
+ "~/.config/google_cloud/application_default_credentials.json"
46
+ ]
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,59 @@
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/debugger/v2/version"
24
+
25
+ require "google/cloud/debugger/v2/debugger/credentials"
26
+ require "google/cloud/debugger/v2/debugger/client"
27
+
28
+ module Google
29
+ module Cloud
30
+ module Debugger
31
+ module V2
32
+ ##
33
+ # The Debugger service provides the API that allows users to collect run-time
34
+ # information from a running application, without stopping or slowing it down
35
+ # and without modifying its state. An application may include one or
36
+ # more replicated processes performing the same work.
37
+ #
38
+ # A debugged application is represented using the Debuggee concept. The
39
+ # Debugger service provides a way to query for available debuggees, but does
40
+ # not provide a way to create one. A debuggee is created using the Controller
41
+ # service, usually by running a debugger agent with the application.
42
+ #
43
+ # The Debugger service enables the client to set one or more Breakpoints on a
44
+ # Debuggee and collect the results of the set Breakpoints.
45
+ #
46
+ # To load this service and instantiate a client:
47
+ #
48
+ # require "google/cloud/debugger/v2/debugger"
49
+ # client = ::Google::Cloud::Debugger::V2::Debugger::Client.new
50
+ #
51
+ module Debugger
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+
58
+ helper_path = ::File.join __dir__, "debugger", "helpers.rb"
59
+ require "google/cloud/debugger/v2/debugger/helpers" if ::File.file? helper_path
@@ -0,0 +1,742 @@
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/clouddebugger/v2/debugger_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Debugger
25
+ module V2
26
+ module Debugger
27
+ ##
28
+ # Client for the Debugger service.
29
+ #
30
+ # The Debugger service provides the API that allows users to collect run-time
31
+ # information from a running application, without stopping or slowing it down
32
+ # and without modifying its state. An application may include one or
33
+ # more replicated processes performing the same work.
34
+ #
35
+ # A debugged application is represented using the Debuggee concept. The
36
+ # Debugger service provides a way to query for available debuggees, but does
37
+ # not provide a way to create one. A debuggee is created using the Controller
38
+ # service, usually by running a debugger agent with the application.
39
+ #
40
+ # The Debugger service enables the client to set one or more Breakpoints on a
41
+ # Debuggee and collect the results of the set Breakpoints.
42
+ #
43
+ class Client
44
+ # @private
45
+ attr_reader :debugger_stub
46
+
47
+ ##
48
+ # Configure the Debugger Client class.
49
+ #
50
+ # See {::Google::Cloud::Debugger::V2::Debugger::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # ## Example
54
+ #
55
+ # To modify the configuration for all Debugger clients:
56
+ #
57
+ # ::Google::Cloud::Debugger::V2::Debugger::Client.configure do |config|
58
+ # config.timeout = 10.0
59
+ # end
60
+ #
61
+ # @yield [config] Configure the Client client.
62
+ # @yieldparam config [Client::Configuration]
63
+ #
64
+ # @return [Client::Configuration]
65
+ #
66
+ def self.configure
67
+ @configure ||= begin
68
+ namespace = ["Google", "Cloud", "Debugger", "V2"]
69
+ parent_config = while namespace.any?
70
+ parent_name = namespace.join "::"
71
+ parent_const = const_get parent_name
72
+ break parent_const.configure if parent_const&.respond_to? :configure
73
+ namespace.pop
74
+ end
75
+ default_config = Client::Configuration.new parent_config
76
+
77
+ default_config.rpcs.set_breakpoint.timeout = 600.0
78
+
79
+ default_config.rpcs.get_breakpoint.timeout = 600.0
80
+ default_config.rpcs.get_breakpoint.retry_policy = {
81
+ initial_delay: 0.1,
82
+ max_delay: 60.0,
83
+ multiplier: 1.3,
84
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
85
+ }
86
+
87
+ default_config.rpcs.delete_breakpoint.timeout = 600.0
88
+ default_config.rpcs.delete_breakpoint.retry_policy = {
89
+ initial_delay: 0.1,
90
+ max_delay: 60.0,
91
+ multiplier: 1.3,
92
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
93
+ }
94
+
95
+ default_config.rpcs.list_breakpoints.timeout = 600.0
96
+ default_config.rpcs.list_breakpoints.retry_policy = {
97
+ initial_delay: 0.1,
98
+ max_delay: 60.0,
99
+ multiplier: 1.3,
100
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
101
+ }
102
+
103
+ default_config.rpcs.list_debuggees.timeout = 600.0
104
+ default_config.rpcs.list_debuggees.retry_policy = {
105
+ initial_delay: 0.1,
106
+ max_delay: 60.0,
107
+ multiplier: 1.3,
108
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
109
+ }
110
+
111
+ default_config
112
+ end
113
+ yield @configure if block_given?
114
+ @configure
115
+ end
116
+
117
+ ##
118
+ # Configure the Debugger Client instance.
119
+ #
120
+ # The configuration is set to the derived mode, meaning that values can be changed,
121
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
122
+ # should be made on {Client.configure}.
123
+ #
124
+ # See {::Google::Cloud::Debugger::V2::Debugger::Client::Configuration}
125
+ # for a description of the configuration fields.
126
+ #
127
+ # @yield [config] Configure the Client client.
128
+ # @yieldparam config [Client::Configuration]
129
+ #
130
+ # @return [Client::Configuration]
131
+ #
132
+ def configure
133
+ yield @config if block_given?
134
+ @config
135
+ end
136
+
137
+ ##
138
+ # Create a new Debugger client object.
139
+ #
140
+ # ## Examples
141
+ #
142
+ # To create a new Debugger client with the default
143
+ # configuration:
144
+ #
145
+ # client = ::Google::Cloud::Debugger::V2::Debugger::Client.new
146
+ #
147
+ # To create a new Debugger client with a custom
148
+ # configuration:
149
+ #
150
+ # client = ::Google::Cloud::Debugger::V2::Debugger::Client.new do |config|
151
+ # config.timeout = 10.0
152
+ # end
153
+ #
154
+ # @yield [config] Configure the Debugger client.
155
+ # @yieldparam config [Client::Configuration]
156
+ #
157
+ def initialize
158
+ # These require statements are intentionally placed here to initialize
159
+ # the gRPC module only when it's required.
160
+ # See https://github.com/googleapis/toolkit/issues/446
161
+ require "gapic/grpc"
162
+ require "google/devtools/clouddebugger/v2/debugger_services_pb"
163
+
164
+ # Create the configuration object
165
+ @config = Configuration.new Client.configure
166
+
167
+ # Yield the configuration if needed
168
+ yield @config if block_given?
169
+
170
+ # Create credentials
171
+ credentials = @config.credentials
172
+ credentials ||= Credentials.default scope: @config.scope
173
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
174
+ credentials = Credentials.new credentials, scope: @config.scope
175
+ end
176
+ @quota_project_id = @config.quota_project
177
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
178
+
179
+ @debugger_stub = ::Gapic::ServiceStub.new(
180
+ ::Google::Cloud::Debugger::V2::Debugger2::Stub,
181
+ credentials: credentials,
182
+ endpoint: @config.endpoint,
183
+ channel_args: @config.channel_args,
184
+ interceptors: @config.interceptors
185
+ )
186
+ end
187
+
188
+ # Service calls
189
+
190
+ ##
191
+ # Sets the breakpoint to the debuggee.
192
+ #
193
+ # @overload set_breakpoint(request, options = nil)
194
+ # Pass arguments to `set_breakpoint` via a request object, either of type
195
+ # {::Google::Cloud::Debugger::V2::SetBreakpointRequest} or an equivalent Hash.
196
+ #
197
+ # @param request [::Google::Cloud::Debugger::V2::SetBreakpointRequest, ::Hash]
198
+ # A request object representing the call parameters. Required. To specify no
199
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
200
+ # @param options [::Gapic::CallOptions, ::Hash]
201
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
202
+ #
203
+ # @overload set_breakpoint(debuggee_id: nil, breakpoint: nil, client_version: nil)
204
+ # Pass arguments to `set_breakpoint` via keyword arguments. Note that at
205
+ # least one keyword argument is required. To specify no parameters, or to keep all
206
+ # the default parameter values, pass an empty Hash as a request object (see above).
207
+ #
208
+ # @param debuggee_id [::String]
209
+ # Required. ID of the debuggee where the breakpoint is to be set.
210
+ # @param breakpoint [::Google::Cloud::Debugger::V2::Breakpoint, ::Hash]
211
+ # Required. Breakpoint specification to set.
212
+ # The field `location` of the breakpoint must be set.
213
+ # @param client_version [::String]
214
+ # Required. The client version making the call.
215
+ # Schema: `domain/type/version` (e.g., `google.com/intellij/v1`).
216
+ #
217
+ # @yield [response, operation] Access the result along with the RPC operation
218
+ # @yieldparam response [::Google::Cloud::Debugger::V2::SetBreakpointResponse]
219
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
220
+ #
221
+ # @return [::Google::Cloud::Debugger::V2::SetBreakpointResponse]
222
+ #
223
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
224
+ #
225
+ def set_breakpoint request, options = nil
226
+ raise ::ArgumentError, "request must be provided" if request.nil?
227
+
228
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Debugger::V2::SetBreakpointRequest
229
+
230
+ # Converts hash and nil to an options object
231
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
232
+
233
+ # Customize the options with defaults
234
+ metadata = @config.rpcs.set_breakpoint.metadata.to_h
235
+
236
+ # Set x-goog-api-client and x-goog-user-project headers
237
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
238
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
239
+ gapic_version: ::Google::Cloud::Debugger::V2::VERSION
240
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
241
+
242
+ header_params = {
243
+ "debuggee_id" => request.debuggee_id
244
+ }
245
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
246
+ metadata[:"x-goog-request-params"] ||= request_params_header
247
+
248
+ options.apply_defaults timeout: @config.rpcs.set_breakpoint.timeout,
249
+ metadata: metadata,
250
+ retry_policy: @config.rpcs.set_breakpoint.retry_policy
251
+ options.apply_defaults metadata: @config.metadata,
252
+ retry_policy: @config.retry_policy
253
+
254
+ @debugger_stub.call_rpc :set_breakpoint, request, options: options do |response, operation|
255
+ yield response, operation if block_given?
256
+ return response
257
+ end
258
+ rescue ::GRPC::BadStatus => e
259
+ raise ::Google::Cloud::Error.from_error(e)
260
+ end
261
+
262
+ ##
263
+ # Gets breakpoint information.
264
+ #
265
+ # @overload get_breakpoint(request, options = nil)
266
+ # Pass arguments to `get_breakpoint` via a request object, either of type
267
+ # {::Google::Cloud::Debugger::V2::GetBreakpointRequest} or an equivalent Hash.
268
+ #
269
+ # @param request [::Google::Cloud::Debugger::V2::GetBreakpointRequest, ::Hash]
270
+ # A request object representing the call parameters. Required. To specify no
271
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
272
+ # @param options [::Gapic::CallOptions, ::Hash]
273
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
274
+ #
275
+ # @overload get_breakpoint(debuggee_id: nil, breakpoint_id: nil, client_version: nil)
276
+ # Pass arguments to `get_breakpoint` via keyword arguments. Note that at
277
+ # least one keyword argument is required. To specify no parameters, or to keep all
278
+ # the default parameter values, pass an empty Hash as a request object (see above).
279
+ #
280
+ # @param debuggee_id [::String]
281
+ # Required. ID of the debuggee whose breakpoint to get.
282
+ # @param breakpoint_id [::String]
283
+ # Required. ID of the breakpoint to get.
284
+ # @param client_version [::String]
285
+ # Required. The client version making the call.
286
+ # Schema: `domain/type/version` (e.g., `google.com/intellij/v1`).
287
+ #
288
+ # @yield [response, operation] Access the result along with the RPC operation
289
+ # @yieldparam response [::Google::Cloud::Debugger::V2::GetBreakpointResponse]
290
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
291
+ #
292
+ # @return [::Google::Cloud::Debugger::V2::GetBreakpointResponse]
293
+ #
294
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
295
+ #
296
+ def get_breakpoint request, options = nil
297
+ raise ::ArgumentError, "request must be provided" if request.nil?
298
+
299
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Debugger::V2::GetBreakpointRequest
300
+
301
+ # Converts hash and nil to an options object
302
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
303
+
304
+ # Customize the options with defaults
305
+ metadata = @config.rpcs.get_breakpoint.metadata.to_h
306
+
307
+ # Set x-goog-api-client and x-goog-user-project headers
308
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
309
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
310
+ gapic_version: ::Google::Cloud::Debugger::V2::VERSION
311
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
312
+
313
+ header_params = {
314
+ "debuggee_id" => request.debuggee_id,
315
+ "breakpoint_id" => request.breakpoint_id
316
+ }
317
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
318
+ metadata[:"x-goog-request-params"] ||= request_params_header
319
+
320
+ options.apply_defaults timeout: @config.rpcs.get_breakpoint.timeout,
321
+ metadata: metadata,
322
+ retry_policy: @config.rpcs.get_breakpoint.retry_policy
323
+ options.apply_defaults metadata: @config.metadata,
324
+ retry_policy: @config.retry_policy
325
+
326
+ @debugger_stub.call_rpc :get_breakpoint, request, options: options do |response, operation|
327
+ yield response, operation if block_given?
328
+ return response
329
+ end
330
+ rescue ::GRPC::BadStatus => e
331
+ raise ::Google::Cloud::Error.from_error(e)
332
+ end
333
+
334
+ ##
335
+ # Deletes the breakpoint from the debuggee.
336
+ #
337
+ # @overload delete_breakpoint(request, options = nil)
338
+ # Pass arguments to `delete_breakpoint` via a request object, either of type
339
+ # {::Google::Cloud::Debugger::V2::DeleteBreakpointRequest} or an equivalent Hash.
340
+ #
341
+ # @param request [::Google::Cloud::Debugger::V2::DeleteBreakpointRequest, ::Hash]
342
+ # A request object representing the call parameters. Required. To specify no
343
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
344
+ # @param options [::Gapic::CallOptions, ::Hash]
345
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
346
+ #
347
+ # @overload delete_breakpoint(debuggee_id: nil, breakpoint_id: nil, client_version: nil)
348
+ # Pass arguments to `delete_breakpoint` via keyword arguments. Note that at
349
+ # least one keyword argument is required. To specify no parameters, or to keep all
350
+ # the default parameter values, pass an empty Hash as a request object (see above).
351
+ #
352
+ # @param debuggee_id [::String]
353
+ # Required. ID of the debuggee whose breakpoint to delete.
354
+ # @param breakpoint_id [::String]
355
+ # Required. ID of the breakpoint to delete.
356
+ # @param client_version [::String]
357
+ # Required. The client version making the call.
358
+ # Schema: `domain/type/version` (e.g., `google.com/intellij/v1`).
359
+ #
360
+ # @yield [response, operation] Access the result along with the RPC operation
361
+ # @yieldparam response [::Google::Protobuf::Empty]
362
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
363
+ #
364
+ # @return [::Google::Protobuf::Empty]
365
+ #
366
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
367
+ #
368
+ def delete_breakpoint request, options = nil
369
+ raise ::ArgumentError, "request must be provided" if request.nil?
370
+
371
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Debugger::V2::DeleteBreakpointRequest
372
+
373
+ # Converts hash and nil to an options object
374
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
375
+
376
+ # Customize the options with defaults
377
+ metadata = @config.rpcs.delete_breakpoint.metadata.to_h
378
+
379
+ # Set x-goog-api-client and x-goog-user-project headers
380
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
381
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
382
+ gapic_version: ::Google::Cloud::Debugger::V2::VERSION
383
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
384
+
385
+ header_params = {
386
+ "debuggee_id" => request.debuggee_id,
387
+ "breakpoint_id" => request.breakpoint_id
388
+ }
389
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
390
+ metadata[:"x-goog-request-params"] ||= request_params_header
391
+
392
+ options.apply_defaults timeout: @config.rpcs.delete_breakpoint.timeout,
393
+ metadata: metadata,
394
+ retry_policy: @config.rpcs.delete_breakpoint.retry_policy
395
+ options.apply_defaults metadata: @config.metadata,
396
+ retry_policy: @config.retry_policy
397
+
398
+ @debugger_stub.call_rpc :delete_breakpoint, request, options: options do |response, operation|
399
+ yield response, operation if block_given?
400
+ return response
401
+ end
402
+ rescue ::GRPC::BadStatus => e
403
+ raise ::Google::Cloud::Error.from_error(e)
404
+ end
405
+
406
+ ##
407
+ # Lists all breakpoints for the debuggee.
408
+ #
409
+ # @overload list_breakpoints(request, options = nil)
410
+ # Pass arguments to `list_breakpoints` via a request object, either of type
411
+ # {::Google::Cloud::Debugger::V2::ListBreakpointsRequest} or an equivalent Hash.
412
+ #
413
+ # @param request [::Google::Cloud::Debugger::V2::ListBreakpointsRequest, ::Hash]
414
+ # A request object representing the call parameters. Required. To specify no
415
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
416
+ # @param options [::Gapic::CallOptions, ::Hash]
417
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
418
+ #
419
+ # @overload list_breakpoints(debuggee_id: nil, include_all_users: nil, include_inactive: nil, action: nil, strip_results: nil, wait_token: nil, client_version: nil)
420
+ # Pass arguments to `list_breakpoints` via keyword arguments. Note that at
421
+ # least one keyword argument is required. To specify no parameters, or to keep all
422
+ # the default parameter values, pass an empty Hash as a request object (see above).
423
+ #
424
+ # @param debuggee_id [::String]
425
+ # Required. ID of the debuggee whose breakpoints to list.
426
+ # @param include_all_users [::Boolean]
427
+ # When set to `true`, the response includes the list of breakpoints set by
428
+ # any user. Otherwise, it includes only breakpoints set by the caller.
429
+ # @param include_inactive [::Boolean]
430
+ # When set to `true`, the response includes active and inactive
431
+ # breakpoints. Otherwise, it includes only active breakpoints.
432
+ # @param action [::Google::Cloud::Debugger::V2::ListBreakpointsRequest::BreakpointActionValue, ::Hash]
433
+ # When set, the response includes only breakpoints with the specified action.
434
+ # @param strip_results [::Boolean]
435
+ # This field is deprecated. The following fields are always stripped out of
436
+ # the result: `stack_frames`, `evaluated_expressions` and `variable_table`.
437
+ # @param wait_token [::String]
438
+ # A wait token that, if specified, blocks the call until the breakpoints
439
+ # list has changed, or a server selected timeout has expired. The value
440
+ # should be set from the last response. The error code
441
+ # `google.rpc.Code.ABORTED` (RPC) is returned on wait timeout, which
442
+ # should be called again with the same `wait_token`.
443
+ # @param client_version [::String]
444
+ # Required. The client version making the call.
445
+ # Schema: `domain/type/version` (e.g., `google.com/intellij/v1`).
446
+ #
447
+ # @yield [response, operation] Access the result along with the RPC operation
448
+ # @yieldparam response [::Google::Cloud::Debugger::V2::ListBreakpointsResponse]
449
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
450
+ #
451
+ # @return [::Google::Cloud::Debugger::V2::ListBreakpointsResponse]
452
+ #
453
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
454
+ #
455
+ def list_breakpoints request, options = nil
456
+ raise ::ArgumentError, "request must be provided" if request.nil?
457
+
458
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Debugger::V2::ListBreakpointsRequest
459
+
460
+ # Converts hash and nil to an options object
461
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
462
+
463
+ # Customize the options with defaults
464
+ metadata = @config.rpcs.list_breakpoints.metadata.to_h
465
+
466
+ # Set x-goog-api-client and x-goog-user-project headers
467
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
468
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
469
+ gapic_version: ::Google::Cloud::Debugger::V2::VERSION
470
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
471
+
472
+ header_params = {
473
+ "debuggee_id" => request.debuggee_id
474
+ }
475
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
476
+ metadata[:"x-goog-request-params"] ||= request_params_header
477
+
478
+ options.apply_defaults timeout: @config.rpcs.list_breakpoints.timeout,
479
+ metadata: metadata,
480
+ retry_policy: @config.rpcs.list_breakpoints.retry_policy
481
+ options.apply_defaults metadata: @config.metadata,
482
+ retry_policy: @config.retry_policy
483
+
484
+ @debugger_stub.call_rpc :list_breakpoints, request, options: options do |response, operation|
485
+ yield response, operation if block_given?
486
+ return response
487
+ end
488
+ rescue ::GRPC::BadStatus => e
489
+ raise ::Google::Cloud::Error.from_error(e)
490
+ end
491
+
492
+ ##
493
+ # Lists all the debuggees that the user has access to.
494
+ #
495
+ # @overload list_debuggees(request, options = nil)
496
+ # Pass arguments to `list_debuggees` via a request object, either of type
497
+ # {::Google::Cloud::Debugger::V2::ListDebuggeesRequest} or an equivalent Hash.
498
+ #
499
+ # @param request [::Google::Cloud::Debugger::V2::ListDebuggeesRequest, ::Hash]
500
+ # A request object representing the call parameters. Required. To specify no
501
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
502
+ # @param options [::Gapic::CallOptions, ::Hash]
503
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
504
+ #
505
+ # @overload list_debuggees(project: nil, include_inactive: nil, client_version: nil)
506
+ # Pass arguments to `list_debuggees` via keyword arguments. Note that at
507
+ # least one keyword argument is required. To specify no parameters, or to keep all
508
+ # the default parameter values, pass an empty Hash as a request object (see above).
509
+ #
510
+ # @param project [::String]
511
+ # Required. Project number of a Google Cloud project whose debuggees to list.
512
+ # @param include_inactive [::Boolean]
513
+ # When set to `true`, the result includes all debuggees. Otherwise, the
514
+ # result includes only debuggees that are active.
515
+ # @param client_version [::String]
516
+ # Required. The client version making the call.
517
+ # Schema: `domain/type/version` (e.g., `google.com/intellij/v1`).
518
+ #
519
+ # @yield [response, operation] Access the result along with the RPC operation
520
+ # @yieldparam response [::Google::Cloud::Debugger::V2::ListDebuggeesResponse]
521
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
522
+ #
523
+ # @return [::Google::Cloud::Debugger::V2::ListDebuggeesResponse]
524
+ #
525
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
526
+ #
527
+ def list_debuggees request, options = nil
528
+ raise ::ArgumentError, "request must be provided" if request.nil?
529
+
530
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Debugger::V2::ListDebuggeesRequest
531
+
532
+ # Converts hash and nil to an options object
533
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
534
+
535
+ # Customize the options with defaults
536
+ metadata = @config.rpcs.list_debuggees.metadata.to_h
537
+
538
+ # Set x-goog-api-client and x-goog-user-project headers
539
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
540
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
541
+ gapic_version: ::Google::Cloud::Debugger::V2::VERSION
542
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
543
+
544
+ options.apply_defaults timeout: @config.rpcs.list_debuggees.timeout,
545
+ metadata: metadata,
546
+ retry_policy: @config.rpcs.list_debuggees.retry_policy
547
+ options.apply_defaults metadata: @config.metadata,
548
+ retry_policy: @config.retry_policy
549
+
550
+ @debugger_stub.call_rpc :list_debuggees, request, options: options do |response, operation|
551
+ yield response, operation if block_given?
552
+ return response
553
+ end
554
+ rescue ::GRPC::BadStatus => e
555
+ raise ::Google::Cloud::Error.from_error(e)
556
+ end
557
+
558
+ ##
559
+ # Configuration class for the Debugger API.
560
+ #
561
+ # This class represents the configuration for Debugger,
562
+ # providing control over timeouts, retry behavior, logging, transport
563
+ # parameters, and other low-level controls. Certain parameters can also be
564
+ # applied individually to specific RPCs. See
565
+ # {::Google::Cloud::Debugger::V2::Debugger::Client::Configuration::Rpcs}
566
+ # for a list of RPCs that can be configured independently.
567
+ #
568
+ # Configuration can be applied globally to all clients, or to a single client
569
+ # on construction.
570
+ #
571
+ # # Examples
572
+ #
573
+ # To modify the global config, setting the timeout for set_breakpoint
574
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
575
+ #
576
+ # ::Google::Cloud::Debugger::V2::Debugger::Client.configure do |config|
577
+ # config.timeout = 10.0
578
+ # config.rpcs.set_breakpoint.timeout = 20.0
579
+ # end
580
+ #
581
+ # To apply the above configuration only to a new client:
582
+ #
583
+ # client = ::Google::Cloud::Debugger::V2::Debugger::Client.new do |config|
584
+ # config.timeout = 10.0
585
+ # config.rpcs.set_breakpoint.timeout = 20.0
586
+ # end
587
+ #
588
+ # @!attribute [rw] endpoint
589
+ # The hostname or hostname:port of the service endpoint.
590
+ # Defaults to `"clouddebugger.googleapis.com"`.
591
+ # @return [::String]
592
+ # @!attribute [rw] credentials
593
+ # Credentials to send with calls. You may provide any of the following types:
594
+ # * (`String`) The path to a service account key file in JSON format
595
+ # * (`Hash`) A service account key as a Hash
596
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
597
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
598
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
599
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
600
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
601
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
602
+ # * (`nil`) indicating no credentials
603
+ # @return [::Object]
604
+ # @!attribute [rw] scope
605
+ # The OAuth scopes
606
+ # @return [::Array<::String>]
607
+ # @!attribute [rw] lib_name
608
+ # The library name as recorded in instrumentation and logging
609
+ # @return [::String]
610
+ # @!attribute [rw] lib_version
611
+ # The library version as recorded in instrumentation and logging
612
+ # @return [::String]
613
+ # @!attribute [rw] channel_args
614
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
615
+ # `GRPC::Core::Channel` object is provided as the credential.
616
+ # @return [::Hash]
617
+ # @!attribute [rw] interceptors
618
+ # An array of interceptors that are run before calls are executed.
619
+ # @return [::Array<::GRPC::ClientInterceptor>]
620
+ # @!attribute [rw] timeout
621
+ # The call timeout in seconds.
622
+ # @return [::Numeric]
623
+ # @!attribute [rw] metadata
624
+ # Additional gRPC headers to be sent with the call.
625
+ # @return [::Hash{::Symbol=>::String}]
626
+ # @!attribute [rw] retry_policy
627
+ # The retry policy. The value is a hash with the following keys:
628
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
629
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
630
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
631
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
632
+ # trigger a retry.
633
+ # @return [::Hash]
634
+ # @!attribute [rw] quota_project
635
+ # A separate project against which to charge quota.
636
+ # @return [::String]
637
+ #
638
+ class Configuration
639
+ extend ::Gapic::Config
640
+
641
+ config_attr :endpoint, "clouddebugger.googleapis.com", ::String
642
+ config_attr :credentials, nil do |value|
643
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
644
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
645
+ allowed.any? { |klass| klass === value }
646
+ end
647
+ config_attr :scope, nil, ::String, ::Array, nil
648
+ config_attr :lib_name, nil, ::String, nil
649
+ config_attr :lib_version, nil, ::String, nil
650
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
651
+ config_attr :interceptors, nil, ::Array, nil
652
+ config_attr :timeout, nil, ::Numeric, nil
653
+ config_attr :metadata, nil, ::Hash, nil
654
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
655
+ config_attr :quota_project, nil, ::String, nil
656
+
657
+ # @private
658
+ def initialize parent_config = nil
659
+ @parent_config = parent_config unless parent_config.nil?
660
+
661
+ yield self if block_given?
662
+ end
663
+
664
+ ##
665
+ # Configurations for individual RPCs
666
+ # @return [Rpcs]
667
+ #
668
+ def rpcs
669
+ @rpcs ||= begin
670
+ parent_rpcs = nil
671
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
672
+ Rpcs.new parent_rpcs
673
+ end
674
+ end
675
+
676
+ ##
677
+ # Configuration RPC class for the Debugger API.
678
+ #
679
+ # Includes fields providing the configuration for each RPC in this service.
680
+ # Each configuration object is of type `Gapic::Config::Method` and includes
681
+ # the following configuration fields:
682
+ #
683
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
684
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
685
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
686
+ # include the following keys:
687
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
688
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
689
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
690
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
691
+ # trigger a retry.
692
+ #
693
+ class Rpcs
694
+ ##
695
+ # RPC-specific configuration for `set_breakpoint`
696
+ # @return [::Gapic::Config::Method]
697
+ #
698
+ attr_reader :set_breakpoint
699
+ ##
700
+ # RPC-specific configuration for `get_breakpoint`
701
+ # @return [::Gapic::Config::Method]
702
+ #
703
+ attr_reader :get_breakpoint
704
+ ##
705
+ # RPC-specific configuration for `delete_breakpoint`
706
+ # @return [::Gapic::Config::Method]
707
+ #
708
+ attr_reader :delete_breakpoint
709
+ ##
710
+ # RPC-specific configuration for `list_breakpoints`
711
+ # @return [::Gapic::Config::Method]
712
+ #
713
+ attr_reader :list_breakpoints
714
+ ##
715
+ # RPC-specific configuration for `list_debuggees`
716
+ # @return [::Gapic::Config::Method]
717
+ #
718
+ attr_reader :list_debuggees
719
+
720
+ # @private
721
+ def initialize parent_rpcs = nil
722
+ set_breakpoint_config = parent_rpcs&.set_breakpoint if parent_rpcs&.respond_to? :set_breakpoint
723
+ @set_breakpoint = ::Gapic::Config::Method.new set_breakpoint_config
724
+ get_breakpoint_config = parent_rpcs&.get_breakpoint if parent_rpcs&.respond_to? :get_breakpoint
725
+ @get_breakpoint = ::Gapic::Config::Method.new get_breakpoint_config
726
+ delete_breakpoint_config = parent_rpcs&.delete_breakpoint if parent_rpcs&.respond_to? :delete_breakpoint
727
+ @delete_breakpoint = ::Gapic::Config::Method.new delete_breakpoint_config
728
+ list_breakpoints_config = parent_rpcs&.list_breakpoints if parent_rpcs&.respond_to? :list_breakpoints
729
+ @list_breakpoints = ::Gapic::Config::Method.new list_breakpoints_config
730
+ list_debuggees_config = parent_rpcs&.list_debuggees if parent_rpcs&.respond_to? :list_debuggees
731
+ @list_debuggees = ::Gapic::Config::Method.new list_debuggees_config
732
+
733
+ yield self if block_given?
734
+ end
735
+ end
736
+ end
737
+ end
738
+ end
739
+ end
740
+ end
741
+ end
742
+ end