google-cloud-notebooks-v2 0.a → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/notebooks/v2/bindings_override.rb +135 -0
  6. data/lib/google/cloud/notebooks/v2/diagnostic_config_pb.rb +44 -0
  7. data/lib/google/cloud/notebooks/v2/event_pb.rb +47 -0
  8. data/lib/google/cloud/notebooks/v2/gce_setup_pb.rb +57 -0
  9. data/lib/google/cloud/notebooks/v2/instance_pb.rb +54 -0
  10. data/lib/google/cloud/notebooks/v2/notebook_service/client.rb +1591 -0
  11. data/lib/google/cloud/notebooks/v2/notebook_service/credentials.rb +47 -0
  12. data/lib/google/cloud/notebooks/v2/notebook_service/operations.rb +779 -0
  13. data/lib/google/cloud/notebooks/v2/notebook_service/paths.rb +69 -0
  14. data/lib/google/cloud/notebooks/v2/notebook_service/rest/client.rb +1486 -0
  15. data/lib/google/cloud/notebooks/v2/notebook_service/rest/operations.rb +870 -0
  16. data/lib/google/cloud/notebooks/v2/notebook_service/rest/service_stub.rb +764 -0
  17. data/lib/google/cloud/notebooks/v2/notebook_service/rest.rb +54 -0
  18. data/lib/google/cloud/notebooks/v2/notebook_service.rb +56 -0
  19. data/lib/google/cloud/notebooks/v2/rest.rb +38 -0
  20. data/lib/google/cloud/notebooks/v2/service_pb.rb +71 -0
  21. data/lib/google/cloud/notebooks/v2/service_services_pb.rb +67 -0
  22. data/lib/google/cloud/notebooks/v2/version.rb +7 -2
  23. data/lib/google/cloud/notebooks/v2.rb +45 -0
  24. data/lib/google-cloud-notebooks-v2.rb +21 -0
  25. data/proto_docs/README.md +4 -0
  26. data/proto_docs/google/api/client.rb +381 -0
  27. data/proto_docs/google/api/field_behavior.rb +85 -0
  28. data/proto_docs/google/api/launch_stage.rb +71 -0
  29. data/proto_docs/google/api/resource.rb +222 -0
  30. data/proto_docs/google/cloud/notebooks/v2/diagnostic_config.rb +63 -0
  31. data/proto_docs/google/cloud/notebooks/v2/event.rb +79 -0
  32. data/proto_docs/google/cloud/notebooks/v2/gce_setup.rb +352 -0
  33. data/proto_docs/google/cloud/notebooks/v2/instance.rb +233 -0
  34. data/proto_docs/google/cloud/notebooks/v2/service.rb +263 -0
  35. data/proto_docs/google/longrunning/operations.rb +164 -0
  36. data/proto_docs/google/protobuf/any.rb +144 -0
  37. data/proto_docs/google/protobuf/duration.rb +98 -0
  38. data/proto_docs/google/protobuf/empty.rb +34 -0
  39. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  40. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  41. data/proto_docs/google/rpc/status.rb +48 -0
  42. data/proto_docs/google/type/expr.rb +75 -0
  43. metadata +237 -13
@@ -0,0 +1,1486 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/notebooks/v2/service_pb"
21
+ require "google/cloud/notebooks/v2/notebook_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+ require "google/iam/v1/rest"
24
+
25
+ module Google
26
+ module Cloud
27
+ module Notebooks
28
+ module V2
29
+ module NotebookService
30
+ module Rest
31
+ ##
32
+ # REST client for the NotebookService service.
33
+ #
34
+ # API v2 service for Workbench Notebooks Instances.
35
+ #
36
+ class Client
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :notebook_service_stub
41
+
42
+ ##
43
+ # Configure the NotebookService Client class.
44
+ #
45
+ # See {::Google::Cloud::Notebooks::V2::NotebookService::Rest::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all NotebookService clients
51
+ # ::Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "Notebooks", "V2"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config.timeout = 60.0
72
+ default_config.retry_policy = {
73
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
74
+ }
75
+
76
+ default_config.rpcs.list_instances.timeout = 60.0
77
+
78
+ default_config.rpcs.get_instance.timeout = 60.0
79
+
80
+ default_config.rpcs.create_instance.timeout = 60.0
81
+
82
+ default_config.rpcs.delete_instance.timeout = 60.0
83
+
84
+ default_config.rpcs.start_instance.timeout = 60.0
85
+
86
+ default_config.rpcs.stop_instance.timeout = 60.0
87
+
88
+ default_config.rpcs.reset_instance.timeout = 60.0
89
+
90
+ default_config.rpcs.upgrade_instance.timeout = 60.0
91
+
92
+ default_config.rpcs.rollback_instance.timeout = 60.0
93
+
94
+ default_config
95
+ end
96
+ yield @configure if block_given?
97
+ @configure
98
+ end
99
+
100
+ ##
101
+ # Configure the NotebookService Client instance.
102
+ #
103
+ # The configuration is set to the derived mode, meaning that values can be changed,
104
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
105
+ # should be made on {Client.configure}.
106
+ #
107
+ # See {::Google::Cloud::Notebooks::V2::NotebookService::Rest::Client::Configuration}
108
+ # for a description of the configuration fields.
109
+ #
110
+ # @yield [config] Configure the Client client.
111
+ # @yieldparam config [Client::Configuration]
112
+ #
113
+ # @return [Client::Configuration]
114
+ #
115
+ def configure
116
+ yield @config if block_given?
117
+ @config
118
+ end
119
+
120
+ ##
121
+ # Create a new NotebookService REST client object.
122
+ #
123
+ # @example
124
+ #
125
+ # # Create a client using the default configuration
126
+ # client = ::Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
127
+ #
128
+ # # Create a client using a custom configuration
129
+ # client = ::Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new do |config|
130
+ # config.timeout = 10.0
131
+ # end
132
+ #
133
+ # @yield [config] Configure the NotebookService client.
134
+ # @yieldparam config [Client::Configuration]
135
+ #
136
+ def initialize
137
+ # Create the configuration object
138
+ @config = Configuration.new Client.configure
139
+
140
+ # Yield the configuration if needed
141
+ yield @config if block_given?
142
+
143
+ # Create credentials
144
+ credentials = @config.credentials
145
+ # Use self-signed JWT if the endpoint is unchanged from default,
146
+ # but only if the default endpoint does not have a region prefix.
147
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
148
+ !@config.endpoint.split(".").first.include?("-")
149
+ credentials ||= Credentials.default scope: @config.scope,
150
+ enable_self_signed_jwt: enable_self_signed_jwt
151
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
152
+ credentials = Credentials.new credentials, scope: @config.scope
153
+ end
154
+
155
+ @quota_project_id = @config.quota_project
156
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
157
+
158
+ @operations_client = ::Google::Cloud::Notebooks::V2::NotebookService::Rest::Operations.new do |config|
159
+ config.credentials = credentials
160
+ config.quota_project = @quota_project_id
161
+ config.endpoint = @config.endpoint
162
+ end
163
+
164
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
165
+ config.credentials = credentials
166
+ config.quota_project = @quota_project_id
167
+ config.endpoint = @config.endpoint
168
+ config.bindings_override = @config.bindings_override
169
+ end
170
+
171
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
172
+ config.credentials = credentials
173
+ config.quota_project = @quota_project_id
174
+ config.endpoint = @config.endpoint
175
+ config.bindings_override = @config.bindings_override
176
+ end
177
+
178
+ @notebook_service_stub = ::Google::Cloud::Notebooks::V2::NotebookService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
179
+ end
180
+
181
+ ##
182
+ # Get the associated client for long-running operations.
183
+ #
184
+ # @return [::Google::Cloud::Notebooks::V2::NotebookService::Rest::Operations]
185
+ #
186
+ attr_reader :operations_client
187
+
188
+ ##
189
+ # Get the associated client for mix-in of the Locations.
190
+ #
191
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
192
+ #
193
+ attr_reader :location_client
194
+
195
+ ##
196
+ # Get the associated client for mix-in of the IAMPolicy.
197
+ #
198
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
199
+ #
200
+ attr_reader :iam_policy_client
201
+
202
+ # Service calls
203
+
204
+ ##
205
+ # Lists instances in a given project and location.
206
+ #
207
+ # @overload list_instances(request, options = nil)
208
+ # Pass arguments to `list_instances` via a request object, either of type
209
+ # {::Google::Cloud::Notebooks::V2::ListInstancesRequest} or an equivalent Hash.
210
+ #
211
+ # @param request [::Google::Cloud::Notebooks::V2::ListInstancesRequest, ::Hash]
212
+ # A request object representing the call parameters. Required. To specify no
213
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
214
+ # @param options [::Gapic::CallOptions, ::Hash]
215
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
216
+ #
217
+ # @overload list_instances(parent: nil, page_size: nil, page_token: nil, order_by: nil, filter: nil)
218
+ # Pass arguments to `list_instances` via keyword arguments. Note that at
219
+ # least one keyword argument is required. To specify no parameters, or to keep all
220
+ # the default parameter values, pass an empty Hash as a request object (see above).
221
+ #
222
+ # @param parent [::String]
223
+ # Required. Format:
224
+ # `parent=projects/{project_id}/locations/{location}`
225
+ # @param page_size [::Integer]
226
+ # Optional. Maximum return size of the list call.
227
+ # @param page_token [::String]
228
+ # Optional. A previous returned page token that can be used to continue
229
+ # listing from the last result.
230
+ # @param order_by [::String]
231
+ # Optional. Sort results. Supported values are "name", "name desc" or ""
232
+ # (unsorted).
233
+ # @param filter [::String]
234
+ # Optional. List filter.
235
+ # @yield [result, operation] Access the result along with the TransportOperation object
236
+ # @yieldparam result [::Google::Cloud::Notebooks::V2::ListInstancesResponse]
237
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
238
+ #
239
+ # @return [::Google::Cloud::Notebooks::V2::ListInstancesResponse]
240
+ #
241
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
242
+ #
243
+ # @example Basic example
244
+ # require "google/cloud/notebooks/v2"
245
+ #
246
+ # # Create a client object. The client can be reused for multiple calls.
247
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
248
+ #
249
+ # # Create a request. To set request fields, pass in keyword arguments.
250
+ # request = Google::Cloud::Notebooks::V2::ListInstancesRequest.new
251
+ #
252
+ # # Call the list_instances method.
253
+ # result = client.list_instances request
254
+ #
255
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
256
+ # # over elements, and API calls will be issued to fetch pages as needed.
257
+ # result.each do |item|
258
+ # # Each element is of type ::Google::Cloud::Notebooks::V2::Instance.
259
+ # p item
260
+ # end
261
+ #
262
+ def list_instances request, options = nil
263
+ raise ::ArgumentError, "request must be provided" if request.nil?
264
+
265
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::ListInstancesRequest
266
+
267
+ # Converts hash and nil to an options object
268
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
269
+
270
+ # Customize the options with defaults
271
+ call_metadata = @config.rpcs.list_instances.metadata.to_h
272
+
273
+ # Set x-goog-api-client and x-goog-user-project headers
274
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
275
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
276
+ gapic_version: ::Google::Cloud::Notebooks::V2::VERSION,
277
+ transports_version_send: [:rest]
278
+
279
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
280
+
281
+ options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
282
+ metadata: call_metadata,
283
+ retry_policy: @config.rpcs.list_instances.retry_policy
284
+
285
+ options.apply_defaults timeout: @config.timeout,
286
+ metadata: @config.metadata,
287
+ retry_policy: @config.retry_policy
288
+
289
+ @notebook_service_stub.list_instances request, options do |result, operation|
290
+ yield result, operation if block_given?
291
+ return result
292
+ end
293
+ rescue ::Gapic::Rest::Error => e
294
+ raise ::Google::Cloud::Error.from_error(e)
295
+ end
296
+
297
+ ##
298
+ # Gets details of a single Instance.
299
+ #
300
+ # @overload get_instance(request, options = nil)
301
+ # Pass arguments to `get_instance` via a request object, either of type
302
+ # {::Google::Cloud::Notebooks::V2::GetInstanceRequest} or an equivalent Hash.
303
+ #
304
+ # @param request [::Google::Cloud::Notebooks::V2::GetInstanceRequest, ::Hash]
305
+ # A request object representing the call parameters. Required. To specify no
306
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
307
+ # @param options [::Gapic::CallOptions, ::Hash]
308
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
309
+ #
310
+ # @overload get_instance(name: nil)
311
+ # Pass arguments to `get_instance` via keyword arguments. Note that at
312
+ # least one keyword argument is required. To specify no parameters, or to keep all
313
+ # the default parameter values, pass an empty Hash as a request object (see above).
314
+ #
315
+ # @param name [::String]
316
+ # Required. Format:
317
+ # `projects/{project_id}/locations/{location}/instances/{instance_id}`
318
+ # @yield [result, operation] Access the result along with the TransportOperation object
319
+ # @yieldparam result [::Google::Cloud::Notebooks::V2::Instance]
320
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
321
+ #
322
+ # @return [::Google::Cloud::Notebooks::V2::Instance]
323
+ #
324
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
325
+ #
326
+ # @example Basic example
327
+ # require "google/cloud/notebooks/v2"
328
+ #
329
+ # # Create a client object. The client can be reused for multiple calls.
330
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
331
+ #
332
+ # # Create a request. To set request fields, pass in keyword arguments.
333
+ # request = Google::Cloud::Notebooks::V2::GetInstanceRequest.new
334
+ #
335
+ # # Call the get_instance method.
336
+ # result = client.get_instance request
337
+ #
338
+ # # The returned object is of type Google::Cloud::Notebooks::V2::Instance.
339
+ # p result
340
+ #
341
+ def get_instance request, options = nil
342
+ raise ::ArgumentError, "request must be provided" if request.nil?
343
+
344
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::GetInstanceRequest
345
+
346
+ # Converts hash and nil to an options object
347
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
348
+
349
+ # Customize the options with defaults
350
+ call_metadata = @config.rpcs.get_instance.metadata.to_h
351
+
352
+ # Set x-goog-api-client and x-goog-user-project headers
353
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
354
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
355
+ gapic_version: ::Google::Cloud::Notebooks::V2::VERSION,
356
+ transports_version_send: [:rest]
357
+
358
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
359
+
360
+ options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
361
+ metadata: call_metadata,
362
+ retry_policy: @config.rpcs.get_instance.retry_policy
363
+
364
+ options.apply_defaults timeout: @config.timeout,
365
+ metadata: @config.metadata,
366
+ retry_policy: @config.retry_policy
367
+
368
+ @notebook_service_stub.get_instance request, options do |result, operation|
369
+ yield result, operation if block_given?
370
+ return result
371
+ end
372
+ rescue ::Gapic::Rest::Error => e
373
+ raise ::Google::Cloud::Error.from_error(e)
374
+ end
375
+
376
+ ##
377
+ # Creates a new Instance in a given project and location.
378
+ #
379
+ # @overload create_instance(request, options = nil)
380
+ # Pass arguments to `create_instance` via a request object, either of type
381
+ # {::Google::Cloud::Notebooks::V2::CreateInstanceRequest} or an equivalent Hash.
382
+ #
383
+ # @param request [::Google::Cloud::Notebooks::V2::CreateInstanceRequest, ::Hash]
384
+ # A request object representing the call parameters. Required. To specify no
385
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
386
+ # @param options [::Gapic::CallOptions, ::Hash]
387
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
388
+ #
389
+ # @overload create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil)
390
+ # Pass arguments to `create_instance` via keyword arguments. Note that at
391
+ # least one keyword argument is required. To specify no parameters, or to keep all
392
+ # the default parameter values, pass an empty Hash as a request object (see above).
393
+ #
394
+ # @param parent [::String]
395
+ # Required. Format:
396
+ # `parent=projects/{project_id}/locations/{location}`
397
+ # @param instance_id [::String]
398
+ # Required. User-defined unique ID of this instance.
399
+ # @param instance [::Google::Cloud::Notebooks::V2::Instance, ::Hash]
400
+ # Required. The instance to be created.
401
+ # @param request_id [::String]
402
+ # Optional. Idempotent request UUID.
403
+ # @yield [result, operation] Access the result along with the TransportOperation object
404
+ # @yieldparam result [::Gapic::Operation]
405
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
406
+ #
407
+ # @return [::Gapic::Operation]
408
+ #
409
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
410
+ #
411
+ # @example Basic example
412
+ # require "google/cloud/notebooks/v2"
413
+ #
414
+ # # Create a client object. The client can be reused for multiple calls.
415
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
416
+ #
417
+ # # Create a request. To set request fields, pass in keyword arguments.
418
+ # request = Google::Cloud::Notebooks::V2::CreateInstanceRequest.new
419
+ #
420
+ # # Call the create_instance method.
421
+ # result = client.create_instance request
422
+ #
423
+ # # The returned object is of type Gapic::Operation. You can use it to
424
+ # # check the status of an operation, cancel it, or wait for results.
425
+ # # Here is how to wait for a response.
426
+ # result.wait_until_done! timeout: 60
427
+ # if result.response?
428
+ # p result.response
429
+ # else
430
+ # puts "No response received."
431
+ # end
432
+ #
433
+ def create_instance request, options = nil
434
+ raise ::ArgumentError, "request must be provided" if request.nil?
435
+
436
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::CreateInstanceRequest
437
+
438
+ # Converts hash and nil to an options object
439
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
440
+
441
+ # Customize the options with defaults
442
+ call_metadata = @config.rpcs.create_instance.metadata.to_h
443
+
444
+ # Set x-goog-api-client and x-goog-user-project headers
445
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
446
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
447
+ gapic_version: ::Google::Cloud::Notebooks::V2::VERSION,
448
+ transports_version_send: [:rest]
449
+
450
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
451
+
452
+ options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
453
+ metadata: call_metadata,
454
+ retry_policy: @config.rpcs.create_instance.retry_policy
455
+
456
+ options.apply_defaults timeout: @config.timeout,
457
+ metadata: @config.metadata,
458
+ retry_policy: @config.retry_policy
459
+
460
+ @notebook_service_stub.create_instance request, options do |result, operation|
461
+ result = ::Gapic::Operation.new result, @operations_client, options: options
462
+ yield result, operation if block_given?
463
+ return result
464
+ end
465
+ rescue ::Gapic::Rest::Error => e
466
+ raise ::Google::Cloud::Error.from_error(e)
467
+ end
468
+
469
+ ##
470
+ # UpdateInstance updates an Instance.
471
+ #
472
+ # @overload update_instance(request, options = nil)
473
+ # Pass arguments to `update_instance` via a request object, either of type
474
+ # {::Google::Cloud::Notebooks::V2::UpdateInstanceRequest} or an equivalent Hash.
475
+ #
476
+ # @param request [::Google::Cloud::Notebooks::V2::UpdateInstanceRequest, ::Hash]
477
+ # A request object representing the call parameters. Required. To specify no
478
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
479
+ # @param options [::Gapic::CallOptions, ::Hash]
480
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
481
+ #
482
+ # @overload update_instance(instance: nil, update_mask: nil, request_id: nil)
483
+ # Pass arguments to `update_instance` via keyword arguments. Note that at
484
+ # least one keyword argument is required. To specify no parameters, or to keep all
485
+ # the default parameter values, pass an empty Hash as a request object (see above).
486
+ #
487
+ # @param instance [::Google::Cloud::Notebooks::V2::Instance, ::Hash]
488
+ # Required. A representation of an instance.
489
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
490
+ # Required. Mask used to update an instance
491
+ # @param request_id [::String]
492
+ # Optional. Idempotent request UUID.
493
+ # @yield [result, operation] Access the result along with the TransportOperation object
494
+ # @yieldparam result [::Gapic::Operation]
495
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
496
+ #
497
+ # @return [::Gapic::Operation]
498
+ #
499
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
500
+ #
501
+ # @example Basic example
502
+ # require "google/cloud/notebooks/v2"
503
+ #
504
+ # # Create a client object. The client can be reused for multiple calls.
505
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
506
+ #
507
+ # # Create a request. To set request fields, pass in keyword arguments.
508
+ # request = Google::Cloud::Notebooks::V2::UpdateInstanceRequest.new
509
+ #
510
+ # # Call the update_instance method.
511
+ # result = client.update_instance request
512
+ #
513
+ # # The returned object is of type Gapic::Operation. You can use it to
514
+ # # check the status of an operation, cancel it, or wait for results.
515
+ # # Here is how to wait for a response.
516
+ # result.wait_until_done! timeout: 60
517
+ # if result.response?
518
+ # p result.response
519
+ # else
520
+ # puts "No response received."
521
+ # end
522
+ #
523
+ def update_instance request, options = nil
524
+ raise ::ArgumentError, "request must be provided" if request.nil?
525
+
526
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::UpdateInstanceRequest
527
+
528
+ # Converts hash and nil to an options object
529
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
530
+
531
+ # Customize the options with defaults
532
+ call_metadata = @config.rpcs.update_instance.metadata.to_h
533
+
534
+ # Set x-goog-api-client and x-goog-user-project headers
535
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
536
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
537
+ gapic_version: ::Google::Cloud::Notebooks::V2::VERSION,
538
+ transports_version_send: [:rest]
539
+
540
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
541
+
542
+ options.apply_defaults timeout: @config.rpcs.update_instance.timeout,
543
+ metadata: call_metadata,
544
+ retry_policy: @config.rpcs.update_instance.retry_policy
545
+
546
+ options.apply_defaults timeout: @config.timeout,
547
+ metadata: @config.metadata,
548
+ retry_policy: @config.retry_policy
549
+
550
+ @notebook_service_stub.update_instance request, options do |result, operation|
551
+ result = ::Gapic::Operation.new result, @operations_client, options: options
552
+ yield result, operation if block_given?
553
+ return result
554
+ end
555
+ rescue ::Gapic::Rest::Error => e
556
+ raise ::Google::Cloud::Error.from_error(e)
557
+ end
558
+
559
+ ##
560
+ # Deletes a single Instance.
561
+ #
562
+ # @overload delete_instance(request, options = nil)
563
+ # Pass arguments to `delete_instance` via a request object, either of type
564
+ # {::Google::Cloud::Notebooks::V2::DeleteInstanceRequest} or an equivalent Hash.
565
+ #
566
+ # @param request [::Google::Cloud::Notebooks::V2::DeleteInstanceRequest, ::Hash]
567
+ # A request object representing the call parameters. Required. To specify no
568
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
569
+ # @param options [::Gapic::CallOptions, ::Hash]
570
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
571
+ #
572
+ # @overload delete_instance(name: nil, request_id: nil)
573
+ # Pass arguments to `delete_instance` via keyword arguments. Note that at
574
+ # least one keyword argument is required. To specify no parameters, or to keep all
575
+ # the default parameter values, pass an empty Hash as a request object (see above).
576
+ #
577
+ # @param name [::String]
578
+ # Required. Format:
579
+ # `projects/{project_id}/locations/{location}/instances/{instance_id}`
580
+ # @param request_id [::String]
581
+ # Optional. Idempotent request UUID.
582
+ # @yield [result, operation] Access the result along with the TransportOperation object
583
+ # @yieldparam result [::Gapic::Operation]
584
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
585
+ #
586
+ # @return [::Gapic::Operation]
587
+ #
588
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
589
+ #
590
+ # @example Basic example
591
+ # require "google/cloud/notebooks/v2"
592
+ #
593
+ # # Create a client object. The client can be reused for multiple calls.
594
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
595
+ #
596
+ # # Create a request. To set request fields, pass in keyword arguments.
597
+ # request = Google::Cloud::Notebooks::V2::DeleteInstanceRequest.new
598
+ #
599
+ # # Call the delete_instance method.
600
+ # result = client.delete_instance request
601
+ #
602
+ # # The returned object is of type Gapic::Operation. You can use it to
603
+ # # check the status of an operation, cancel it, or wait for results.
604
+ # # Here is how to wait for a response.
605
+ # result.wait_until_done! timeout: 60
606
+ # if result.response?
607
+ # p result.response
608
+ # else
609
+ # puts "No response received."
610
+ # end
611
+ #
612
+ def delete_instance request, options = nil
613
+ raise ::ArgumentError, "request must be provided" if request.nil?
614
+
615
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::DeleteInstanceRequest
616
+
617
+ # Converts hash and nil to an options object
618
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
619
+
620
+ # Customize the options with defaults
621
+ call_metadata = @config.rpcs.delete_instance.metadata.to_h
622
+
623
+ # Set x-goog-api-client and x-goog-user-project headers
624
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
625
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
626
+ gapic_version: ::Google::Cloud::Notebooks::V2::VERSION,
627
+ transports_version_send: [:rest]
628
+
629
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
630
+
631
+ options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
632
+ metadata: call_metadata,
633
+ retry_policy: @config.rpcs.delete_instance.retry_policy
634
+
635
+ options.apply_defaults timeout: @config.timeout,
636
+ metadata: @config.metadata,
637
+ retry_policy: @config.retry_policy
638
+
639
+ @notebook_service_stub.delete_instance request, options do |result, operation|
640
+ result = ::Gapic::Operation.new result, @operations_client, options: options
641
+ yield result, operation if block_given?
642
+ return result
643
+ end
644
+ rescue ::Gapic::Rest::Error => e
645
+ raise ::Google::Cloud::Error.from_error(e)
646
+ end
647
+
648
+ ##
649
+ # Starts a notebook instance.
650
+ #
651
+ # @overload start_instance(request, options = nil)
652
+ # Pass arguments to `start_instance` via a request object, either of type
653
+ # {::Google::Cloud::Notebooks::V2::StartInstanceRequest} or an equivalent Hash.
654
+ #
655
+ # @param request [::Google::Cloud::Notebooks::V2::StartInstanceRequest, ::Hash]
656
+ # A request object representing the call parameters. Required. To specify no
657
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
658
+ # @param options [::Gapic::CallOptions, ::Hash]
659
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
660
+ #
661
+ # @overload start_instance(name: nil)
662
+ # Pass arguments to `start_instance` via keyword arguments. Note that at
663
+ # least one keyword argument is required. To specify no parameters, or to keep all
664
+ # the default parameter values, pass an empty Hash as a request object (see above).
665
+ #
666
+ # @param name [::String]
667
+ # Required. Format:
668
+ # `projects/{project_id}/locations/{location}/instances/{instance_id}`
669
+ # @yield [result, operation] Access the result along with the TransportOperation object
670
+ # @yieldparam result [::Gapic::Operation]
671
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
672
+ #
673
+ # @return [::Gapic::Operation]
674
+ #
675
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
676
+ #
677
+ # @example Basic example
678
+ # require "google/cloud/notebooks/v2"
679
+ #
680
+ # # Create a client object. The client can be reused for multiple calls.
681
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
682
+ #
683
+ # # Create a request. To set request fields, pass in keyword arguments.
684
+ # request = Google::Cloud::Notebooks::V2::StartInstanceRequest.new
685
+ #
686
+ # # Call the start_instance method.
687
+ # result = client.start_instance request
688
+ #
689
+ # # The returned object is of type Gapic::Operation. You can use it to
690
+ # # check the status of an operation, cancel it, or wait for results.
691
+ # # Here is how to wait for a response.
692
+ # result.wait_until_done! timeout: 60
693
+ # if result.response?
694
+ # p result.response
695
+ # else
696
+ # puts "No response received."
697
+ # end
698
+ #
699
+ def start_instance request, options = nil
700
+ raise ::ArgumentError, "request must be provided" if request.nil?
701
+
702
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::StartInstanceRequest
703
+
704
+ # Converts hash and nil to an options object
705
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
706
+
707
+ # Customize the options with defaults
708
+ call_metadata = @config.rpcs.start_instance.metadata.to_h
709
+
710
+ # Set x-goog-api-client and x-goog-user-project headers
711
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
712
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
713
+ gapic_version: ::Google::Cloud::Notebooks::V2::VERSION,
714
+ transports_version_send: [:rest]
715
+
716
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
717
+
718
+ options.apply_defaults timeout: @config.rpcs.start_instance.timeout,
719
+ metadata: call_metadata,
720
+ retry_policy: @config.rpcs.start_instance.retry_policy
721
+
722
+ options.apply_defaults timeout: @config.timeout,
723
+ metadata: @config.metadata,
724
+ retry_policy: @config.retry_policy
725
+
726
+ @notebook_service_stub.start_instance request, options do |result, operation|
727
+ result = ::Gapic::Operation.new result, @operations_client, options: options
728
+ yield result, operation if block_given?
729
+ return result
730
+ end
731
+ rescue ::Gapic::Rest::Error => e
732
+ raise ::Google::Cloud::Error.from_error(e)
733
+ end
734
+
735
+ ##
736
+ # Stops a notebook instance.
737
+ #
738
+ # @overload stop_instance(request, options = nil)
739
+ # Pass arguments to `stop_instance` via a request object, either of type
740
+ # {::Google::Cloud::Notebooks::V2::StopInstanceRequest} or an equivalent Hash.
741
+ #
742
+ # @param request [::Google::Cloud::Notebooks::V2::StopInstanceRequest, ::Hash]
743
+ # A request object representing the call parameters. Required. To specify no
744
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
745
+ # @param options [::Gapic::CallOptions, ::Hash]
746
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
747
+ #
748
+ # @overload stop_instance(name: nil)
749
+ # Pass arguments to `stop_instance` via keyword arguments. Note that at
750
+ # least one keyword argument is required. To specify no parameters, or to keep all
751
+ # the default parameter values, pass an empty Hash as a request object (see above).
752
+ #
753
+ # @param name [::String]
754
+ # Required. Format:
755
+ # `projects/{project_id}/locations/{location}/instances/{instance_id}`
756
+ # @yield [result, operation] Access the result along with the TransportOperation object
757
+ # @yieldparam result [::Gapic::Operation]
758
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
759
+ #
760
+ # @return [::Gapic::Operation]
761
+ #
762
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
763
+ #
764
+ # @example Basic example
765
+ # require "google/cloud/notebooks/v2"
766
+ #
767
+ # # Create a client object. The client can be reused for multiple calls.
768
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
769
+ #
770
+ # # Create a request. To set request fields, pass in keyword arguments.
771
+ # request = Google::Cloud::Notebooks::V2::StopInstanceRequest.new
772
+ #
773
+ # # Call the stop_instance method.
774
+ # result = client.stop_instance request
775
+ #
776
+ # # The returned object is of type Gapic::Operation. You can use it to
777
+ # # check the status of an operation, cancel it, or wait for results.
778
+ # # Here is how to wait for a response.
779
+ # result.wait_until_done! timeout: 60
780
+ # if result.response?
781
+ # p result.response
782
+ # else
783
+ # puts "No response received."
784
+ # end
785
+ #
786
+ def stop_instance request, options = nil
787
+ raise ::ArgumentError, "request must be provided" if request.nil?
788
+
789
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::StopInstanceRequest
790
+
791
+ # Converts hash and nil to an options object
792
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
793
+
794
+ # Customize the options with defaults
795
+ call_metadata = @config.rpcs.stop_instance.metadata.to_h
796
+
797
+ # Set x-goog-api-client and x-goog-user-project headers
798
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
799
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
800
+ gapic_version: ::Google::Cloud::Notebooks::V2::VERSION,
801
+ transports_version_send: [:rest]
802
+
803
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
804
+
805
+ options.apply_defaults timeout: @config.rpcs.stop_instance.timeout,
806
+ metadata: call_metadata,
807
+ retry_policy: @config.rpcs.stop_instance.retry_policy
808
+
809
+ options.apply_defaults timeout: @config.timeout,
810
+ metadata: @config.metadata,
811
+ retry_policy: @config.retry_policy
812
+
813
+ @notebook_service_stub.stop_instance request, options do |result, operation|
814
+ result = ::Gapic::Operation.new result, @operations_client, options: options
815
+ yield result, operation if block_given?
816
+ return result
817
+ end
818
+ rescue ::Gapic::Rest::Error => e
819
+ raise ::Google::Cloud::Error.from_error(e)
820
+ end
821
+
822
+ ##
823
+ # Resets a notebook instance.
824
+ #
825
+ # @overload reset_instance(request, options = nil)
826
+ # Pass arguments to `reset_instance` via a request object, either of type
827
+ # {::Google::Cloud::Notebooks::V2::ResetInstanceRequest} or an equivalent Hash.
828
+ #
829
+ # @param request [::Google::Cloud::Notebooks::V2::ResetInstanceRequest, ::Hash]
830
+ # A request object representing the call parameters. Required. To specify no
831
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
832
+ # @param options [::Gapic::CallOptions, ::Hash]
833
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
834
+ #
835
+ # @overload reset_instance(name: nil)
836
+ # Pass arguments to `reset_instance` via keyword arguments. Note that at
837
+ # least one keyword argument is required. To specify no parameters, or to keep all
838
+ # the default parameter values, pass an empty Hash as a request object (see above).
839
+ #
840
+ # @param name [::String]
841
+ # Required. Format:
842
+ # `projects/{project_id}/locations/{location}/instances/{instance_id}`
843
+ # @yield [result, operation] Access the result along with the TransportOperation object
844
+ # @yieldparam result [::Gapic::Operation]
845
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
846
+ #
847
+ # @return [::Gapic::Operation]
848
+ #
849
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
850
+ #
851
+ # @example Basic example
852
+ # require "google/cloud/notebooks/v2"
853
+ #
854
+ # # Create a client object. The client can be reused for multiple calls.
855
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
856
+ #
857
+ # # Create a request. To set request fields, pass in keyword arguments.
858
+ # request = Google::Cloud::Notebooks::V2::ResetInstanceRequest.new
859
+ #
860
+ # # Call the reset_instance method.
861
+ # result = client.reset_instance request
862
+ #
863
+ # # The returned object is of type Gapic::Operation. You can use it to
864
+ # # check the status of an operation, cancel it, or wait for results.
865
+ # # Here is how to wait for a response.
866
+ # result.wait_until_done! timeout: 60
867
+ # if result.response?
868
+ # p result.response
869
+ # else
870
+ # puts "No response received."
871
+ # end
872
+ #
873
+ def reset_instance request, options = nil
874
+ raise ::ArgumentError, "request must be provided" if request.nil?
875
+
876
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::ResetInstanceRequest
877
+
878
+ # Converts hash and nil to an options object
879
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
880
+
881
+ # Customize the options with defaults
882
+ call_metadata = @config.rpcs.reset_instance.metadata.to_h
883
+
884
+ # Set x-goog-api-client and x-goog-user-project headers
885
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
886
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
887
+ gapic_version: ::Google::Cloud::Notebooks::V2::VERSION,
888
+ transports_version_send: [:rest]
889
+
890
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
891
+
892
+ options.apply_defaults timeout: @config.rpcs.reset_instance.timeout,
893
+ metadata: call_metadata,
894
+ retry_policy: @config.rpcs.reset_instance.retry_policy
895
+
896
+ options.apply_defaults timeout: @config.timeout,
897
+ metadata: @config.metadata,
898
+ retry_policy: @config.retry_policy
899
+
900
+ @notebook_service_stub.reset_instance request, options do |result, operation|
901
+ result = ::Gapic::Operation.new result, @operations_client, options: options
902
+ yield result, operation if block_given?
903
+ return result
904
+ end
905
+ rescue ::Gapic::Rest::Error => e
906
+ raise ::Google::Cloud::Error.from_error(e)
907
+ end
908
+
909
+ ##
910
+ # Checks whether a notebook instance is upgradable.
911
+ #
912
+ # @overload check_instance_upgradability(request, options = nil)
913
+ # Pass arguments to `check_instance_upgradability` via a request object, either of type
914
+ # {::Google::Cloud::Notebooks::V2::CheckInstanceUpgradabilityRequest} or an equivalent Hash.
915
+ #
916
+ # @param request [::Google::Cloud::Notebooks::V2::CheckInstanceUpgradabilityRequest, ::Hash]
917
+ # A request object representing the call parameters. Required. To specify no
918
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
919
+ # @param options [::Gapic::CallOptions, ::Hash]
920
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
921
+ #
922
+ # @overload check_instance_upgradability(notebook_instance: nil)
923
+ # Pass arguments to `check_instance_upgradability` via keyword arguments. Note that at
924
+ # least one keyword argument is required. To specify no parameters, or to keep all
925
+ # the default parameter values, pass an empty Hash as a request object (see above).
926
+ #
927
+ # @param notebook_instance [::String]
928
+ # Required. Format:
929
+ # `projects/{project_id}/locations/{location}/instances/{instance_id}`
930
+ # @yield [result, operation] Access the result along with the TransportOperation object
931
+ # @yieldparam result [::Google::Cloud::Notebooks::V2::CheckInstanceUpgradabilityResponse]
932
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
933
+ #
934
+ # @return [::Google::Cloud::Notebooks::V2::CheckInstanceUpgradabilityResponse]
935
+ #
936
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
937
+ #
938
+ # @example Basic example
939
+ # require "google/cloud/notebooks/v2"
940
+ #
941
+ # # Create a client object. The client can be reused for multiple calls.
942
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
943
+ #
944
+ # # Create a request. To set request fields, pass in keyword arguments.
945
+ # request = Google::Cloud::Notebooks::V2::CheckInstanceUpgradabilityRequest.new
946
+ #
947
+ # # Call the check_instance_upgradability method.
948
+ # result = client.check_instance_upgradability request
949
+ #
950
+ # # The returned object is of type Google::Cloud::Notebooks::V2::CheckInstanceUpgradabilityResponse.
951
+ # p result
952
+ #
953
+ def check_instance_upgradability request, options = nil
954
+ raise ::ArgumentError, "request must be provided" if request.nil?
955
+
956
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::CheckInstanceUpgradabilityRequest
957
+
958
+ # Converts hash and nil to an options object
959
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
960
+
961
+ # Customize the options with defaults
962
+ call_metadata = @config.rpcs.check_instance_upgradability.metadata.to_h
963
+
964
+ # Set x-goog-api-client and x-goog-user-project headers
965
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
966
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
967
+ gapic_version: ::Google::Cloud::Notebooks::V2::VERSION,
968
+ transports_version_send: [:rest]
969
+
970
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
971
+
972
+ options.apply_defaults timeout: @config.rpcs.check_instance_upgradability.timeout,
973
+ metadata: call_metadata,
974
+ retry_policy: @config.rpcs.check_instance_upgradability.retry_policy
975
+
976
+ options.apply_defaults timeout: @config.timeout,
977
+ metadata: @config.metadata,
978
+ retry_policy: @config.retry_policy
979
+
980
+ @notebook_service_stub.check_instance_upgradability request, options do |result, operation|
981
+ yield result, operation if block_given?
982
+ return result
983
+ end
984
+ rescue ::Gapic::Rest::Error => e
985
+ raise ::Google::Cloud::Error.from_error(e)
986
+ end
987
+
988
+ ##
989
+ # Upgrades a notebook instance to the latest version.
990
+ #
991
+ # @overload upgrade_instance(request, options = nil)
992
+ # Pass arguments to `upgrade_instance` via a request object, either of type
993
+ # {::Google::Cloud::Notebooks::V2::UpgradeInstanceRequest} or an equivalent Hash.
994
+ #
995
+ # @param request [::Google::Cloud::Notebooks::V2::UpgradeInstanceRequest, ::Hash]
996
+ # A request object representing the call parameters. Required. To specify no
997
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
998
+ # @param options [::Gapic::CallOptions, ::Hash]
999
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1000
+ #
1001
+ # @overload upgrade_instance(name: nil)
1002
+ # Pass arguments to `upgrade_instance` via keyword arguments. Note that at
1003
+ # least one keyword argument is required. To specify no parameters, or to keep all
1004
+ # the default parameter values, pass an empty Hash as a request object (see above).
1005
+ #
1006
+ # @param name [::String]
1007
+ # Required. Format:
1008
+ # `projects/{project_id}/locations/{location}/instances/{instance_id}`
1009
+ # @yield [result, operation] Access the result along with the TransportOperation object
1010
+ # @yieldparam result [::Gapic::Operation]
1011
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1012
+ #
1013
+ # @return [::Gapic::Operation]
1014
+ #
1015
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1016
+ #
1017
+ # @example Basic example
1018
+ # require "google/cloud/notebooks/v2"
1019
+ #
1020
+ # # Create a client object. The client can be reused for multiple calls.
1021
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
1022
+ #
1023
+ # # Create a request. To set request fields, pass in keyword arguments.
1024
+ # request = Google::Cloud::Notebooks::V2::UpgradeInstanceRequest.new
1025
+ #
1026
+ # # Call the upgrade_instance method.
1027
+ # result = client.upgrade_instance request
1028
+ #
1029
+ # # The returned object is of type Gapic::Operation. You can use it to
1030
+ # # check the status of an operation, cancel it, or wait for results.
1031
+ # # Here is how to wait for a response.
1032
+ # result.wait_until_done! timeout: 60
1033
+ # if result.response?
1034
+ # p result.response
1035
+ # else
1036
+ # puts "No response received."
1037
+ # end
1038
+ #
1039
+ def upgrade_instance request, options = nil
1040
+ raise ::ArgumentError, "request must be provided" if request.nil?
1041
+
1042
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::UpgradeInstanceRequest
1043
+
1044
+ # Converts hash and nil to an options object
1045
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1046
+
1047
+ # Customize the options with defaults
1048
+ call_metadata = @config.rpcs.upgrade_instance.metadata.to_h
1049
+
1050
+ # Set x-goog-api-client and x-goog-user-project headers
1051
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1052
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1053
+ gapic_version: ::Google::Cloud::Notebooks::V2::VERSION,
1054
+ transports_version_send: [:rest]
1055
+
1056
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1057
+
1058
+ options.apply_defaults timeout: @config.rpcs.upgrade_instance.timeout,
1059
+ metadata: call_metadata,
1060
+ retry_policy: @config.rpcs.upgrade_instance.retry_policy
1061
+
1062
+ options.apply_defaults timeout: @config.timeout,
1063
+ metadata: @config.metadata,
1064
+ retry_policy: @config.retry_policy
1065
+
1066
+ @notebook_service_stub.upgrade_instance request, options do |result, operation|
1067
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1068
+ yield result, operation if block_given?
1069
+ return result
1070
+ end
1071
+ rescue ::Gapic::Rest::Error => e
1072
+ raise ::Google::Cloud::Error.from_error(e)
1073
+ end
1074
+
1075
+ ##
1076
+ # Rollbacks a notebook instance to the previous version.
1077
+ #
1078
+ # @overload rollback_instance(request, options = nil)
1079
+ # Pass arguments to `rollback_instance` via a request object, either of type
1080
+ # {::Google::Cloud::Notebooks::V2::RollbackInstanceRequest} or an equivalent Hash.
1081
+ #
1082
+ # @param request [::Google::Cloud::Notebooks::V2::RollbackInstanceRequest, ::Hash]
1083
+ # A request object representing the call parameters. Required. To specify no
1084
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1085
+ # @param options [::Gapic::CallOptions, ::Hash]
1086
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1087
+ #
1088
+ # @overload rollback_instance(name: nil, target_snapshot: nil)
1089
+ # Pass arguments to `rollback_instance` via keyword arguments. Note that at
1090
+ # least one keyword argument is required. To specify no parameters, or to keep all
1091
+ # the default parameter values, pass an empty Hash as a request object (see above).
1092
+ #
1093
+ # @param name [::String]
1094
+ # Required. Format:
1095
+ # `projects/{project_id}/locations/{location}/instances/{instance_id}`
1096
+ # @param target_snapshot [::String]
1097
+ # Required. The snapshot for rollback.
1098
+ # Example: "projects/test-project/global/snapshots/krwlzipynril".
1099
+ # @yield [result, operation] Access the result along with the TransportOperation object
1100
+ # @yieldparam result [::Gapic::Operation]
1101
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1102
+ #
1103
+ # @return [::Gapic::Operation]
1104
+ #
1105
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1106
+ #
1107
+ # @example Basic example
1108
+ # require "google/cloud/notebooks/v2"
1109
+ #
1110
+ # # Create a client object. The client can be reused for multiple calls.
1111
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
1112
+ #
1113
+ # # Create a request. To set request fields, pass in keyword arguments.
1114
+ # request = Google::Cloud::Notebooks::V2::RollbackInstanceRequest.new
1115
+ #
1116
+ # # Call the rollback_instance method.
1117
+ # result = client.rollback_instance request
1118
+ #
1119
+ # # The returned object is of type Gapic::Operation. You can use it to
1120
+ # # check the status of an operation, cancel it, or wait for results.
1121
+ # # Here is how to wait for a response.
1122
+ # result.wait_until_done! timeout: 60
1123
+ # if result.response?
1124
+ # p result.response
1125
+ # else
1126
+ # puts "No response received."
1127
+ # end
1128
+ #
1129
+ def rollback_instance request, options = nil
1130
+ raise ::ArgumentError, "request must be provided" if request.nil?
1131
+
1132
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::RollbackInstanceRequest
1133
+
1134
+ # Converts hash and nil to an options object
1135
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1136
+
1137
+ # Customize the options with defaults
1138
+ call_metadata = @config.rpcs.rollback_instance.metadata.to_h
1139
+
1140
+ # Set x-goog-api-client and x-goog-user-project headers
1141
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1142
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1143
+ gapic_version: ::Google::Cloud::Notebooks::V2::VERSION,
1144
+ transports_version_send: [:rest]
1145
+
1146
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1147
+
1148
+ options.apply_defaults timeout: @config.rpcs.rollback_instance.timeout,
1149
+ metadata: call_metadata,
1150
+ retry_policy: @config.rpcs.rollback_instance.retry_policy
1151
+
1152
+ options.apply_defaults timeout: @config.timeout,
1153
+ metadata: @config.metadata,
1154
+ retry_policy: @config.retry_policy
1155
+
1156
+ @notebook_service_stub.rollback_instance request, options do |result, operation|
1157
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1158
+ yield result, operation if block_given?
1159
+ return result
1160
+ end
1161
+ rescue ::Gapic::Rest::Error => e
1162
+ raise ::Google::Cloud::Error.from_error(e)
1163
+ end
1164
+
1165
+ ##
1166
+ # Creates a Diagnostic File and runs Diagnostic Tool given an Instance.
1167
+ #
1168
+ # @overload diagnose_instance(request, options = nil)
1169
+ # Pass arguments to `diagnose_instance` via a request object, either of type
1170
+ # {::Google::Cloud::Notebooks::V2::DiagnoseInstanceRequest} or an equivalent Hash.
1171
+ #
1172
+ # @param request [::Google::Cloud::Notebooks::V2::DiagnoseInstanceRequest, ::Hash]
1173
+ # A request object representing the call parameters. Required. To specify no
1174
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1175
+ # @param options [::Gapic::CallOptions, ::Hash]
1176
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1177
+ #
1178
+ # @overload diagnose_instance(name: nil, diagnostic_config: nil, timeout_minutes: nil)
1179
+ # Pass arguments to `diagnose_instance` via keyword arguments. Note that at
1180
+ # least one keyword argument is required. To specify no parameters, or to keep all
1181
+ # the default parameter values, pass an empty Hash as a request object (see above).
1182
+ #
1183
+ # @param name [::String]
1184
+ # Required. Format:
1185
+ # `projects/{project_id}/locations/{location}/instances/{instance_id}`
1186
+ # @param diagnostic_config [::Google::Cloud::Notebooks::V2::DiagnosticConfig, ::Hash]
1187
+ # Required. Defines flags that are used to run the diagnostic tool
1188
+ # @param timeout_minutes [::Integer]
1189
+ # Optional. Maxmium amount of time in minutes before the operation times out.
1190
+ # @yield [result, operation] Access the result along with the TransportOperation object
1191
+ # @yieldparam result [::Gapic::Operation]
1192
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1193
+ #
1194
+ # @return [::Gapic::Operation]
1195
+ #
1196
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1197
+ #
1198
+ # @example Basic example
1199
+ # require "google/cloud/notebooks/v2"
1200
+ #
1201
+ # # Create a client object. The client can be reused for multiple calls.
1202
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
1203
+ #
1204
+ # # Create a request. To set request fields, pass in keyword arguments.
1205
+ # request = Google::Cloud::Notebooks::V2::DiagnoseInstanceRequest.new
1206
+ #
1207
+ # # Call the diagnose_instance method.
1208
+ # result = client.diagnose_instance request
1209
+ #
1210
+ # # The returned object is of type Gapic::Operation. You can use it to
1211
+ # # check the status of an operation, cancel it, or wait for results.
1212
+ # # Here is how to wait for a response.
1213
+ # result.wait_until_done! timeout: 60
1214
+ # if result.response?
1215
+ # p result.response
1216
+ # else
1217
+ # puts "No response received."
1218
+ # end
1219
+ #
1220
+ def diagnose_instance request, options = nil
1221
+ raise ::ArgumentError, "request must be provided" if request.nil?
1222
+
1223
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V2::DiagnoseInstanceRequest
1224
+
1225
+ # Converts hash and nil to an options object
1226
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1227
+
1228
+ # Customize the options with defaults
1229
+ call_metadata = @config.rpcs.diagnose_instance.metadata.to_h
1230
+
1231
+ # Set x-goog-api-client and x-goog-user-project headers
1232
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1233
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1234
+ gapic_version: ::Google::Cloud::Notebooks::V2::VERSION,
1235
+ transports_version_send: [:rest]
1236
+
1237
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1238
+
1239
+ options.apply_defaults timeout: @config.rpcs.diagnose_instance.timeout,
1240
+ metadata: call_metadata,
1241
+ retry_policy: @config.rpcs.diagnose_instance.retry_policy
1242
+
1243
+ options.apply_defaults timeout: @config.timeout,
1244
+ metadata: @config.metadata,
1245
+ retry_policy: @config.retry_policy
1246
+
1247
+ @notebook_service_stub.diagnose_instance request, options do |result, operation|
1248
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1249
+ yield result, operation if block_given?
1250
+ return result
1251
+ end
1252
+ rescue ::Gapic::Rest::Error => e
1253
+ raise ::Google::Cloud::Error.from_error(e)
1254
+ end
1255
+
1256
+ ##
1257
+ # Configuration class for the NotebookService REST API.
1258
+ #
1259
+ # This class represents the configuration for NotebookService REST,
1260
+ # providing control over timeouts, retry behavior, logging, transport
1261
+ # parameters, and other low-level controls. Certain parameters can also be
1262
+ # applied individually to specific RPCs. See
1263
+ # {::Google::Cloud::Notebooks::V2::NotebookService::Rest::Client::Configuration::Rpcs}
1264
+ # for a list of RPCs that can be configured independently.
1265
+ #
1266
+ # Configuration can be applied globally to all clients, or to a single client
1267
+ # on construction.
1268
+ #
1269
+ # @example
1270
+ #
1271
+ # # Modify the global config, setting the timeout for
1272
+ # # list_instances to 20 seconds,
1273
+ # # and all remaining timeouts to 10 seconds.
1274
+ # ::Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.configure do |config|
1275
+ # config.timeout = 10.0
1276
+ # config.rpcs.list_instances.timeout = 20.0
1277
+ # end
1278
+ #
1279
+ # # Apply the above configuration only to a new client.
1280
+ # client = ::Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new do |config|
1281
+ # config.timeout = 10.0
1282
+ # config.rpcs.list_instances.timeout = 20.0
1283
+ # end
1284
+ #
1285
+ # @!attribute [rw] endpoint
1286
+ # The hostname or hostname:port of the service endpoint.
1287
+ # Defaults to `"notebooks.googleapis.com"`.
1288
+ # @return [::String]
1289
+ # @!attribute [rw] credentials
1290
+ # Credentials to send with calls. You may provide any of the following types:
1291
+ # * (`String`) The path to a service account key file in JSON format
1292
+ # * (`Hash`) A service account key as a Hash
1293
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1294
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1295
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1296
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1297
+ # * (`nil`) indicating no credentials
1298
+ # @return [::Object]
1299
+ # @!attribute [rw] scope
1300
+ # The OAuth scopes
1301
+ # @return [::Array<::String>]
1302
+ # @!attribute [rw] lib_name
1303
+ # The library name as recorded in instrumentation and logging
1304
+ # @return [::String]
1305
+ # @!attribute [rw] lib_version
1306
+ # The library version as recorded in instrumentation and logging
1307
+ # @return [::String]
1308
+ # @!attribute [rw] timeout
1309
+ # The call timeout in seconds.
1310
+ # @return [::Numeric]
1311
+ # @!attribute [rw] metadata
1312
+ # Additional headers to be sent with the call.
1313
+ # @return [::Hash{::Symbol=>::String}]
1314
+ # @!attribute [rw] retry_policy
1315
+ # The retry policy. The value is a hash with the following keys:
1316
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1317
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1318
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1319
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1320
+ # trigger a retry.
1321
+ # @return [::Hash]
1322
+ # @!attribute [rw] quota_project
1323
+ # A separate project against which to charge quota.
1324
+ # @return [::String]
1325
+ #
1326
+ class Configuration
1327
+ extend ::Gapic::Config
1328
+
1329
+ DEFAULT_ENDPOINT = "notebooks.googleapis.com"
1330
+
1331
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1332
+ config_attr :credentials, nil do |value|
1333
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1334
+ allowed.any? { |klass| klass === value }
1335
+ end
1336
+ config_attr :scope, nil, ::String, ::Array, nil
1337
+ config_attr :lib_name, nil, ::String, nil
1338
+ config_attr :lib_version, nil, ::String, nil
1339
+ config_attr :timeout, nil, ::Numeric, nil
1340
+ config_attr :metadata, nil, ::Hash, nil
1341
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1342
+ config_attr :quota_project, nil, ::String, nil
1343
+
1344
+ # @private
1345
+ # Overrides for http bindings for the RPCs of this service
1346
+ # are only used when this service is used as mixin, and only
1347
+ # by the host service.
1348
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1349
+ config_attr :bindings_override, {}, ::Hash, nil
1350
+
1351
+ # @private
1352
+ def initialize parent_config = nil
1353
+ @parent_config = parent_config unless parent_config.nil?
1354
+
1355
+ yield self if block_given?
1356
+ end
1357
+
1358
+ ##
1359
+ # Configurations for individual RPCs
1360
+ # @return [Rpcs]
1361
+ #
1362
+ def rpcs
1363
+ @rpcs ||= begin
1364
+ parent_rpcs = nil
1365
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1366
+ Rpcs.new parent_rpcs
1367
+ end
1368
+ end
1369
+
1370
+ ##
1371
+ # Configuration RPC class for the NotebookService API.
1372
+ #
1373
+ # Includes fields providing the configuration for each RPC in this service.
1374
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1375
+ # the following configuration fields:
1376
+ #
1377
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1378
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1379
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1380
+ # include the following keys:
1381
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1382
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1383
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1384
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1385
+ # trigger a retry.
1386
+ #
1387
+ class Rpcs
1388
+ ##
1389
+ # RPC-specific configuration for `list_instances`
1390
+ # @return [::Gapic::Config::Method]
1391
+ #
1392
+ attr_reader :list_instances
1393
+ ##
1394
+ # RPC-specific configuration for `get_instance`
1395
+ # @return [::Gapic::Config::Method]
1396
+ #
1397
+ attr_reader :get_instance
1398
+ ##
1399
+ # RPC-specific configuration for `create_instance`
1400
+ # @return [::Gapic::Config::Method]
1401
+ #
1402
+ attr_reader :create_instance
1403
+ ##
1404
+ # RPC-specific configuration for `update_instance`
1405
+ # @return [::Gapic::Config::Method]
1406
+ #
1407
+ attr_reader :update_instance
1408
+ ##
1409
+ # RPC-specific configuration for `delete_instance`
1410
+ # @return [::Gapic::Config::Method]
1411
+ #
1412
+ attr_reader :delete_instance
1413
+ ##
1414
+ # RPC-specific configuration for `start_instance`
1415
+ # @return [::Gapic::Config::Method]
1416
+ #
1417
+ attr_reader :start_instance
1418
+ ##
1419
+ # RPC-specific configuration for `stop_instance`
1420
+ # @return [::Gapic::Config::Method]
1421
+ #
1422
+ attr_reader :stop_instance
1423
+ ##
1424
+ # RPC-specific configuration for `reset_instance`
1425
+ # @return [::Gapic::Config::Method]
1426
+ #
1427
+ attr_reader :reset_instance
1428
+ ##
1429
+ # RPC-specific configuration for `check_instance_upgradability`
1430
+ # @return [::Gapic::Config::Method]
1431
+ #
1432
+ attr_reader :check_instance_upgradability
1433
+ ##
1434
+ # RPC-specific configuration for `upgrade_instance`
1435
+ # @return [::Gapic::Config::Method]
1436
+ #
1437
+ attr_reader :upgrade_instance
1438
+ ##
1439
+ # RPC-specific configuration for `rollback_instance`
1440
+ # @return [::Gapic::Config::Method]
1441
+ #
1442
+ attr_reader :rollback_instance
1443
+ ##
1444
+ # RPC-specific configuration for `diagnose_instance`
1445
+ # @return [::Gapic::Config::Method]
1446
+ #
1447
+ attr_reader :diagnose_instance
1448
+
1449
+ # @private
1450
+ def initialize parent_rpcs = nil
1451
+ list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
1452
+ @list_instances = ::Gapic::Config::Method.new list_instances_config
1453
+ get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
1454
+ @get_instance = ::Gapic::Config::Method.new get_instance_config
1455
+ create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
1456
+ @create_instance = ::Gapic::Config::Method.new create_instance_config
1457
+ update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
1458
+ @update_instance = ::Gapic::Config::Method.new update_instance_config
1459
+ delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
1460
+ @delete_instance = ::Gapic::Config::Method.new delete_instance_config
1461
+ start_instance_config = parent_rpcs.start_instance if parent_rpcs.respond_to? :start_instance
1462
+ @start_instance = ::Gapic::Config::Method.new start_instance_config
1463
+ stop_instance_config = parent_rpcs.stop_instance if parent_rpcs.respond_to? :stop_instance
1464
+ @stop_instance = ::Gapic::Config::Method.new stop_instance_config
1465
+ reset_instance_config = parent_rpcs.reset_instance if parent_rpcs.respond_to? :reset_instance
1466
+ @reset_instance = ::Gapic::Config::Method.new reset_instance_config
1467
+ check_instance_upgradability_config = parent_rpcs.check_instance_upgradability if parent_rpcs.respond_to? :check_instance_upgradability
1468
+ @check_instance_upgradability = ::Gapic::Config::Method.new check_instance_upgradability_config
1469
+ upgrade_instance_config = parent_rpcs.upgrade_instance if parent_rpcs.respond_to? :upgrade_instance
1470
+ @upgrade_instance = ::Gapic::Config::Method.new upgrade_instance_config
1471
+ rollback_instance_config = parent_rpcs.rollback_instance if parent_rpcs.respond_to? :rollback_instance
1472
+ @rollback_instance = ::Gapic::Config::Method.new rollback_instance_config
1473
+ diagnose_instance_config = parent_rpcs.diagnose_instance if parent_rpcs.respond_to? :diagnose_instance
1474
+ @diagnose_instance = ::Gapic::Config::Method.new diagnose_instance_config
1475
+
1476
+ yield self if block_given?
1477
+ end
1478
+ end
1479
+ end
1480
+ end
1481
+ end
1482
+ end
1483
+ end
1484
+ end
1485
+ end
1486
+ end