google-cloud-ai_platform-v1 0.39.0 → 0.40.0

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