google-cloud-ai_platform-v1 0.38.0 → 0.39.0

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