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,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/debugger/v2"
@@ -0,0 +1,36 @@
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/debugger/v2/controller"
20
+ require "google/cloud/debugger/v2/debugger"
21
+ require "google/cloud/debugger/v2/version"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Debugger
26
+ ##
27
+ # To load this package, including all its services, and instantiate a client:
28
+ #
29
+ # require "google/cloud/debugger/v2"
30
+ # client = ::Google::Cloud::Debugger::V2::Controller::Client.new
31
+ #
32
+ module V2
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,67 @@
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/controller/credentials"
26
+ require "google/cloud/debugger/v2/controller/client"
27
+
28
+ module Google
29
+ module Cloud
30
+ module Debugger
31
+ module V2
32
+ ##
33
+ # The Controller service provides the API for orchestrating a collection of
34
+ # debugger agents to perform debugging tasks. These agents are each attached
35
+ # to a process of an application which may include one or more replicas.
36
+ #
37
+ # The debugger agents register with the Controller to identify the application
38
+ # being debugged, the Debuggee. All agents that register with the same data,
39
+ # represent the same Debuggee, and are assigned the same `debuggee_id`.
40
+ #
41
+ # The debugger agents call the Controller to retrieve the list of active
42
+ # Breakpoints. Agents with the same `debuggee_id` get the same breakpoints
43
+ # list. An agent that can fulfill the breakpoint request updates the
44
+ # Controller with the breakpoint result. The controller selects the first
45
+ # result received and discards the rest of the results.
46
+ # Agents that poll again for active breakpoints will no longer have
47
+ # the completed breakpoint in the list and should remove that breakpoint from
48
+ # their attached process.
49
+ #
50
+ # The Controller service does not provide a way to retrieve the results of
51
+ # a completed breakpoint. This functionality is available using the Debugger
52
+ # service.
53
+ #
54
+ # To load this service and instantiate a client:
55
+ #
56
+ # require "google/cloud/debugger/v2/controller"
57
+ # client = ::Google::Cloud::Debugger::V2::Controller::Client.new
58
+ #
59
+ module Controller
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+
66
+ helper_path = ::File.join __dir__, "controller", "helpers.rb"
67
+ require "google/cloud/debugger/v2/controller/helpers" if ::File.file? helper_path
@@ -0,0 +1,591 @@
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/controller_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Debugger
25
+ module V2
26
+ module Controller
27
+ ##
28
+ # Client for the Controller service.
29
+ #
30
+ # The Controller service provides the API for orchestrating a collection of
31
+ # debugger agents to perform debugging tasks. These agents are each attached
32
+ # to a process of an application which may include one or more replicas.
33
+ #
34
+ # The debugger agents register with the Controller to identify the application
35
+ # being debugged, the Debuggee. All agents that register with the same data,
36
+ # represent the same Debuggee, and are assigned the same `debuggee_id`.
37
+ #
38
+ # The debugger agents call the Controller to retrieve the list of active
39
+ # Breakpoints. Agents with the same `debuggee_id` get the same breakpoints
40
+ # list. An agent that can fulfill the breakpoint request updates the
41
+ # Controller with the breakpoint result. The controller selects the first
42
+ # result received and discards the rest of the results.
43
+ # Agents that poll again for active breakpoints will no longer have
44
+ # the completed breakpoint in the list and should remove that breakpoint from
45
+ # their attached process.
46
+ #
47
+ # The Controller service does not provide a way to retrieve the results of
48
+ # a completed breakpoint. This functionality is available using the Debugger
49
+ # service.
50
+ #
51
+ class Client
52
+ # @private
53
+ attr_reader :controller_stub
54
+
55
+ ##
56
+ # Configure the Controller Client class.
57
+ #
58
+ # See {::Google::Cloud::Debugger::V2::Controller::Client::Configuration}
59
+ # for a description of the configuration fields.
60
+ #
61
+ # ## Example
62
+ #
63
+ # To modify the configuration for all Controller clients:
64
+ #
65
+ # ::Google::Cloud::Debugger::V2::Controller::Client.configure do |config|
66
+ # config.timeout = 10.0
67
+ # end
68
+ #
69
+ # @yield [config] Configure the Client client.
70
+ # @yieldparam config [Client::Configuration]
71
+ #
72
+ # @return [Client::Configuration]
73
+ #
74
+ def self.configure
75
+ @configure ||= begin
76
+ namespace = ["Google", "Cloud", "Debugger", "V2"]
77
+ parent_config = while namespace.any?
78
+ parent_name = namespace.join "::"
79
+ parent_const = const_get parent_name
80
+ break parent_const.configure if parent_const&.respond_to? :configure
81
+ namespace.pop
82
+ end
83
+ default_config = Client::Configuration.new parent_config
84
+
85
+ default_config.rpcs.register_debuggee.timeout = 600.0
86
+
87
+ default_config.rpcs.list_active_breakpoints.timeout = 600.0
88
+ default_config.rpcs.list_active_breakpoints.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.update_active_breakpoint.timeout = 600.0
96
+ default_config.rpcs.update_active_breakpoint.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
104
+ end
105
+ yield @configure if block_given?
106
+ @configure
107
+ end
108
+
109
+ ##
110
+ # Configure the Controller Client instance.
111
+ #
112
+ # The configuration is set to the derived mode, meaning that values can be changed,
113
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
114
+ # should be made on {Client.configure}.
115
+ #
116
+ # See {::Google::Cloud::Debugger::V2::Controller::Client::Configuration}
117
+ # for a description of the configuration fields.
118
+ #
119
+ # @yield [config] Configure the Client client.
120
+ # @yieldparam config [Client::Configuration]
121
+ #
122
+ # @return [Client::Configuration]
123
+ #
124
+ def configure
125
+ yield @config if block_given?
126
+ @config
127
+ end
128
+
129
+ ##
130
+ # Create a new Controller client object.
131
+ #
132
+ # ## Examples
133
+ #
134
+ # To create a new Controller client with the default
135
+ # configuration:
136
+ #
137
+ # client = ::Google::Cloud::Debugger::V2::Controller::Client.new
138
+ #
139
+ # To create a new Controller client with a custom
140
+ # configuration:
141
+ #
142
+ # client = ::Google::Cloud::Debugger::V2::Controller::Client.new do |config|
143
+ # config.timeout = 10.0
144
+ # end
145
+ #
146
+ # @yield [config] Configure the Controller client.
147
+ # @yieldparam config [Client::Configuration]
148
+ #
149
+ def initialize
150
+ # These require statements are intentionally placed here to initialize
151
+ # the gRPC module only when it's required.
152
+ # See https://github.com/googleapis/toolkit/issues/446
153
+ require "gapic/grpc"
154
+ require "google/devtools/clouddebugger/v2/controller_services_pb"
155
+
156
+ # Create the configuration object
157
+ @config = Configuration.new Client.configure
158
+
159
+ # Yield the configuration if needed
160
+ yield @config if block_given?
161
+
162
+ # Create credentials
163
+ credentials = @config.credentials
164
+ credentials ||= Credentials.default scope: @config.scope
165
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
166
+ credentials = Credentials.new credentials, scope: @config.scope
167
+ end
168
+ @quota_project_id = @config.quota_project
169
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
170
+
171
+ @controller_stub = ::Gapic::ServiceStub.new(
172
+ ::Google::Cloud::Debugger::V2::Controller2::Stub,
173
+ credentials: credentials,
174
+ endpoint: @config.endpoint,
175
+ channel_args: @config.channel_args,
176
+ interceptors: @config.interceptors
177
+ )
178
+ end
179
+
180
+ # Service calls
181
+
182
+ ##
183
+ # Registers the debuggee with the controller service.
184
+ #
185
+ # All agents attached to the same application must call this method with
186
+ # exactly the same request content to get back the same stable `debuggee_id`.
187
+ # Agents should call this method again whenever `google.rpc.Code.NOT_FOUND`
188
+ # is returned from any controller method.
189
+ #
190
+ # This protocol allows the controller service to disable debuggees, recover
191
+ # from data loss, or change the `debuggee_id` format. Agents must handle
192
+ # `debuggee_id` value changing upon re-registration.
193
+ #
194
+ # @overload register_debuggee(request, options = nil)
195
+ # Pass arguments to `register_debuggee` via a request object, either of type
196
+ # {::Google::Cloud::Debugger::V2::RegisterDebuggeeRequest} or an equivalent Hash.
197
+ #
198
+ # @param request [::Google::Cloud::Debugger::V2::RegisterDebuggeeRequest, ::Hash]
199
+ # A request object representing the call parameters. Required. To specify no
200
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
201
+ # @param options [::Gapic::CallOptions, ::Hash]
202
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
203
+ #
204
+ # @overload register_debuggee(debuggee: nil)
205
+ # Pass arguments to `register_debuggee` via keyword arguments. Note that at
206
+ # least one keyword argument is required. To specify no parameters, or to keep all
207
+ # the default parameter values, pass an empty Hash as a request object (see above).
208
+ #
209
+ # @param debuggee [::Google::Cloud::Debugger::V2::Debuggee, ::Hash]
210
+ # Required. Debuggee information to register.
211
+ # The fields `project`, `uniquifier`, `description` and `agent_version`
212
+ # of the debuggee must be set.
213
+ #
214
+ # @yield [response, operation] Access the result along with the RPC operation
215
+ # @yieldparam response [::Google::Cloud::Debugger::V2::RegisterDebuggeeResponse]
216
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
217
+ #
218
+ # @return [::Google::Cloud::Debugger::V2::RegisterDebuggeeResponse]
219
+ #
220
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
221
+ #
222
+ def register_debuggee request, options = nil
223
+ raise ::ArgumentError, "request must be provided" if request.nil?
224
+
225
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Debugger::V2::RegisterDebuggeeRequest
226
+
227
+ # Converts hash and nil to an options object
228
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
229
+
230
+ # Customize the options with defaults
231
+ metadata = @config.rpcs.register_debuggee.metadata.to_h
232
+
233
+ # Set x-goog-api-client and x-goog-user-project headers
234
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
235
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
236
+ gapic_version: ::Google::Cloud::Debugger::V2::VERSION
237
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
238
+
239
+ options.apply_defaults timeout: @config.rpcs.register_debuggee.timeout,
240
+ metadata: metadata,
241
+ retry_policy: @config.rpcs.register_debuggee.retry_policy
242
+ options.apply_defaults metadata: @config.metadata,
243
+ retry_policy: @config.retry_policy
244
+
245
+ @controller_stub.call_rpc :register_debuggee, request, options: options do |response, operation|
246
+ yield response, operation if block_given?
247
+ return response
248
+ end
249
+ rescue ::GRPC::BadStatus => e
250
+ raise ::Google::Cloud::Error.from_error(e)
251
+ end
252
+
253
+ ##
254
+ # Returns the list of all active breakpoints for the debuggee.
255
+ #
256
+ # The breakpoint specification (`location`, `condition`, and `expressions`
257
+ # fields) is semantically immutable, although the field values may
258
+ # change. For example, an agent may update the location line number
259
+ # to reflect the actual line where the breakpoint was set, but this
260
+ # doesn't change the breakpoint semantics.
261
+ #
262
+ # This means that an agent does not need to check if a breakpoint has changed
263
+ # when it encounters the same breakpoint on a successive call.
264
+ # Moreover, an agent should remember the breakpoints that are completed
265
+ # until the controller removes them from the active list to avoid
266
+ # setting those breakpoints again.
267
+ #
268
+ # @overload list_active_breakpoints(request, options = nil)
269
+ # Pass arguments to `list_active_breakpoints` via a request object, either of type
270
+ # {::Google::Cloud::Debugger::V2::ListActiveBreakpointsRequest} or an equivalent Hash.
271
+ #
272
+ # @param request [::Google::Cloud::Debugger::V2::ListActiveBreakpointsRequest, ::Hash]
273
+ # A request object representing the call parameters. Required. To specify no
274
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
275
+ # @param options [::Gapic::CallOptions, ::Hash]
276
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
277
+ #
278
+ # @overload list_active_breakpoints(debuggee_id: nil, wait_token: nil, success_on_timeout: nil)
279
+ # Pass arguments to `list_active_breakpoints` via keyword arguments. Note that at
280
+ # least one keyword argument is required. To specify no parameters, or to keep all
281
+ # the default parameter values, pass an empty Hash as a request object (see above).
282
+ #
283
+ # @param debuggee_id [::String]
284
+ # Required. Identifies the debuggee.
285
+ # @param wait_token [::String]
286
+ # A token that, if specified, blocks the method call until the list
287
+ # of active breakpoints has changed, or a server-selected timeout has
288
+ # expired. The value should be set from the `next_wait_token` field in
289
+ # the last response. The initial value should be set to `"init"`.
290
+ # @param success_on_timeout [::Boolean]
291
+ # If set to `true` (recommended), returns `google.rpc.Code.OK` status and
292
+ # sets the `wait_expired` response field to `true` when the server-selected
293
+ # timeout has expired.
294
+ #
295
+ # If set to `false` (deprecated), returns `google.rpc.Code.ABORTED` status
296
+ # when the server-selected timeout has expired.
297
+ #
298
+ # @yield [response, operation] Access the result along with the RPC operation
299
+ # @yieldparam response [::Google::Cloud::Debugger::V2::ListActiveBreakpointsResponse]
300
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
301
+ #
302
+ # @return [::Google::Cloud::Debugger::V2::ListActiveBreakpointsResponse]
303
+ #
304
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
305
+ #
306
+ def list_active_breakpoints request, options = nil
307
+ raise ::ArgumentError, "request must be provided" if request.nil?
308
+
309
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Debugger::V2::ListActiveBreakpointsRequest
310
+
311
+ # Converts hash and nil to an options object
312
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
313
+
314
+ # Customize the options with defaults
315
+ metadata = @config.rpcs.list_active_breakpoints.metadata.to_h
316
+
317
+ # Set x-goog-api-client and x-goog-user-project headers
318
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
319
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
320
+ gapic_version: ::Google::Cloud::Debugger::V2::VERSION
321
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
322
+
323
+ header_params = {
324
+ "debuggee_id" => request.debuggee_id
325
+ }
326
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
327
+ metadata[:"x-goog-request-params"] ||= request_params_header
328
+
329
+ options.apply_defaults timeout: @config.rpcs.list_active_breakpoints.timeout,
330
+ metadata: metadata,
331
+ retry_policy: @config.rpcs.list_active_breakpoints.retry_policy
332
+ options.apply_defaults metadata: @config.metadata,
333
+ retry_policy: @config.retry_policy
334
+
335
+ @controller_stub.call_rpc :list_active_breakpoints, request, options: options do |response, operation|
336
+ yield response, operation if block_given?
337
+ return response
338
+ end
339
+ rescue ::GRPC::BadStatus => e
340
+ raise ::Google::Cloud::Error.from_error(e)
341
+ end
342
+
343
+ ##
344
+ # Updates the breakpoint state or mutable fields.
345
+ # The entire Breakpoint message must be sent back to the controller service.
346
+ #
347
+ # Updates to active breakpoint fields are only allowed if the new value
348
+ # does not change the breakpoint specification. Updates to the `location`,
349
+ # `condition` and `expressions` fields should not alter the breakpoint
350
+ # semantics. These may only make changes such as canonicalizing a value
351
+ # or snapping the location to the correct line of code.
352
+ #
353
+ # @overload update_active_breakpoint(request, options = nil)
354
+ # Pass arguments to `update_active_breakpoint` via a request object, either of type
355
+ # {::Google::Cloud::Debugger::V2::UpdateActiveBreakpointRequest} or an equivalent Hash.
356
+ #
357
+ # @param request [::Google::Cloud::Debugger::V2::UpdateActiveBreakpointRequest, ::Hash]
358
+ # A request object representing the call parameters. Required. To specify no
359
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
360
+ # @param options [::Gapic::CallOptions, ::Hash]
361
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
362
+ #
363
+ # @overload update_active_breakpoint(debuggee_id: nil, breakpoint: nil)
364
+ # Pass arguments to `update_active_breakpoint` via keyword arguments. Note that at
365
+ # least one keyword argument is required. To specify no parameters, or to keep all
366
+ # the default parameter values, pass an empty Hash as a request object (see above).
367
+ #
368
+ # @param debuggee_id [::String]
369
+ # Required. Identifies the debuggee being debugged.
370
+ # @param breakpoint [::Google::Cloud::Debugger::V2::Breakpoint, ::Hash]
371
+ # Required. Updated breakpoint information.
372
+ # The field `id` must be set.
373
+ # The agent must echo all Breakpoint specification fields in the update.
374
+ #
375
+ # @yield [response, operation] Access the result along with the RPC operation
376
+ # @yieldparam response [::Google::Cloud::Debugger::V2::UpdateActiveBreakpointResponse]
377
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
378
+ #
379
+ # @return [::Google::Cloud::Debugger::V2::UpdateActiveBreakpointResponse]
380
+ #
381
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
382
+ #
383
+ def update_active_breakpoint request, options = nil
384
+ raise ::ArgumentError, "request must be provided" if request.nil?
385
+
386
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Debugger::V2::UpdateActiveBreakpointRequest
387
+
388
+ # Converts hash and nil to an options object
389
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
390
+
391
+ # Customize the options with defaults
392
+ metadata = @config.rpcs.update_active_breakpoint.metadata.to_h
393
+
394
+ # Set x-goog-api-client and x-goog-user-project headers
395
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
396
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
397
+ gapic_version: ::Google::Cloud::Debugger::V2::VERSION
398
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
399
+
400
+ header_params = {
401
+ "debuggee_id" => request.debuggee_id,
402
+ "breakpoint.id" => request.breakpoint.id
403
+ }
404
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
405
+ metadata[:"x-goog-request-params"] ||= request_params_header
406
+
407
+ options.apply_defaults timeout: @config.rpcs.update_active_breakpoint.timeout,
408
+ metadata: metadata,
409
+ retry_policy: @config.rpcs.update_active_breakpoint.retry_policy
410
+ options.apply_defaults metadata: @config.metadata,
411
+ retry_policy: @config.retry_policy
412
+
413
+ @controller_stub.call_rpc :update_active_breakpoint, request, options: options do |response, operation|
414
+ yield response, operation if block_given?
415
+ return response
416
+ end
417
+ rescue ::GRPC::BadStatus => e
418
+ raise ::Google::Cloud::Error.from_error(e)
419
+ end
420
+
421
+ ##
422
+ # Configuration class for the Controller API.
423
+ #
424
+ # This class represents the configuration for Controller,
425
+ # providing control over timeouts, retry behavior, logging, transport
426
+ # parameters, and other low-level controls. Certain parameters can also be
427
+ # applied individually to specific RPCs. See
428
+ # {::Google::Cloud::Debugger::V2::Controller::Client::Configuration::Rpcs}
429
+ # for a list of RPCs that can be configured independently.
430
+ #
431
+ # Configuration can be applied globally to all clients, or to a single client
432
+ # on construction.
433
+ #
434
+ # # Examples
435
+ #
436
+ # To modify the global config, setting the timeout for register_debuggee
437
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
438
+ #
439
+ # ::Google::Cloud::Debugger::V2::Controller::Client.configure do |config|
440
+ # config.timeout = 10.0
441
+ # config.rpcs.register_debuggee.timeout = 20.0
442
+ # end
443
+ #
444
+ # To apply the above configuration only to a new client:
445
+ #
446
+ # client = ::Google::Cloud::Debugger::V2::Controller::Client.new do |config|
447
+ # config.timeout = 10.0
448
+ # config.rpcs.register_debuggee.timeout = 20.0
449
+ # end
450
+ #
451
+ # @!attribute [rw] endpoint
452
+ # The hostname or hostname:port of the service endpoint.
453
+ # Defaults to `"clouddebugger.googleapis.com"`.
454
+ # @return [::String]
455
+ # @!attribute [rw] credentials
456
+ # Credentials to send with calls. You may provide any of the following types:
457
+ # * (`String`) The path to a service account key file in JSON format
458
+ # * (`Hash`) A service account key as a Hash
459
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
460
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
461
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
462
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
463
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
464
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
465
+ # * (`nil`) indicating no credentials
466
+ # @return [::Object]
467
+ # @!attribute [rw] scope
468
+ # The OAuth scopes
469
+ # @return [::Array<::String>]
470
+ # @!attribute [rw] lib_name
471
+ # The library name as recorded in instrumentation and logging
472
+ # @return [::String]
473
+ # @!attribute [rw] lib_version
474
+ # The library version as recorded in instrumentation and logging
475
+ # @return [::String]
476
+ # @!attribute [rw] channel_args
477
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
478
+ # `GRPC::Core::Channel` object is provided as the credential.
479
+ # @return [::Hash]
480
+ # @!attribute [rw] interceptors
481
+ # An array of interceptors that are run before calls are executed.
482
+ # @return [::Array<::GRPC::ClientInterceptor>]
483
+ # @!attribute [rw] timeout
484
+ # The call timeout in seconds.
485
+ # @return [::Numeric]
486
+ # @!attribute [rw] metadata
487
+ # Additional gRPC headers to be sent with the call.
488
+ # @return [::Hash{::Symbol=>::String}]
489
+ # @!attribute [rw] retry_policy
490
+ # The retry policy. The value is a hash with the following keys:
491
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
492
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
493
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
494
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
495
+ # trigger a retry.
496
+ # @return [::Hash]
497
+ # @!attribute [rw] quota_project
498
+ # A separate project against which to charge quota.
499
+ # @return [::String]
500
+ #
501
+ class Configuration
502
+ extend ::Gapic::Config
503
+
504
+ config_attr :endpoint, "clouddebugger.googleapis.com", ::String
505
+ config_attr :credentials, nil do |value|
506
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
507
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
508
+ allowed.any? { |klass| klass === value }
509
+ end
510
+ config_attr :scope, nil, ::String, ::Array, nil
511
+ config_attr :lib_name, nil, ::String, nil
512
+ config_attr :lib_version, nil, ::String, nil
513
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
514
+ config_attr :interceptors, nil, ::Array, nil
515
+ config_attr :timeout, nil, ::Numeric, nil
516
+ config_attr :metadata, nil, ::Hash, nil
517
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
518
+ config_attr :quota_project, nil, ::String, nil
519
+
520
+ # @private
521
+ def initialize parent_config = nil
522
+ @parent_config = parent_config unless parent_config.nil?
523
+
524
+ yield self if block_given?
525
+ end
526
+
527
+ ##
528
+ # Configurations for individual RPCs
529
+ # @return [Rpcs]
530
+ #
531
+ def rpcs
532
+ @rpcs ||= begin
533
+ parent_rpcs = nil
534
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
535
+ Rpcs.new parent_rpcs
536
+ end
537
+ end
538
+
539
+ ##
540
+ # Configuration RPC class for the Controller API.
541
+ #
542
+ # Includes fields providing the configuration for each RPC in this service.
543
+ # Each configuration object is of type `Gapic::Config::Method` and includes
544
+ # the following configuration fields:
545
+ #
546
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
547
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
548
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
549
+ # include the following keys:
550
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
551
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
552
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
553
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
554
+ # trigger a retry.
555
+ #
556
+ class Rpcs
557
+ ##
558
+ # RPC-specific configuration for `register_debuggee`
559
+ # @return [::Gapic::Config::Method]
560
+ #
561
+ attr_reader :register_debuggee
562
+ ##
563
+ # RPC-specific configuration for `list_active_breakpoints`
564
+ # @return [::Gapic::Config::Method]
565
+ #
566
+ attr_reader :list_active_breakpoints
567
+ ##
568
+ # RPC-specific configuration for `update_active_breakpoint`
569
+ # @return [::Gapic::Config::Method]
570
+ #
571
+ attr_reader :update_active_breakpoint
572
+
573
+ # @private
574
+ def initialize parent_rpcs = nil
575
+ register_debuggee_config = parent_rpcs&.register_debuggee if parent_rpcs&.respond_to? :register_debuggee
576
+ @register_debuggee = ::Gapic::Config::Method.new register_debuggee_config
577
+ list_active_breakpoints_config = parent_rpcs&.list_active_breakpoints if parent_rpcs&.respond_to? :list_active_breakpoints
578
+ @list_active_breakpoints = ::Gapic::Config::Method.new list_active_breakpoints_config
579
+ update_active_breakpoint_config = parent_rpcs&.update_active_breakpoint if parent_rpcs&.respond_to? :update_active_breakpoint
580
+ @update_active_breakpoint = ::Gapic::Config::Method.new update_active_breakpoint_config
581
+
582
+ yield self if block_given?
583
+ end
584
+ end
585
+ end
586
+ end
587
+ end
588
+ end
589
+ end
590
+ end
591
+ end