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

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