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