google-cloud-ai_platform-v1 0.38.0 → 0.40.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) 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 +21 -11
  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 +765 -0
  56. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/credentials.rb +47 -0
  57. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/paths.rb +154 -0
  58. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/client.rb +720 -0
  59. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/service_stub.rb +307 -0
  60. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest.rb +53 -0
  61. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service.rb +55 -0
  62. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/client.rb +19 -8
  63. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/operations.rb +13 -5
  64. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/client.rb +1151 -0
  65. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb +3901 -0
  66. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/service_stub.rb +546 -0
  67. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest.rb +54 -0
  68. data/lib/google/cloud/ai_platform/v1/index_endpoint_service.rb +6 -0
  69. data/lib/google/cloud/ai_platform/v1/index_service/client.rb +17 -7
  70. data/lib/google/cloud/ai_platform/v1/index_service/operations.rb +13 -5
  71. data/lib/google/cloud/ai_platform/v1/index_service/rest/client.rb +1034 -0
  72. data/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb +3901 -0
  73. data/lib/google/cloud/ai_platform/v1/index_service/rest/service_stub.rb +486 -0
  74. data/lib/google/cloud/ai_platform/v1/index_service/rest.rb +54 -0
  75. data/lib/google/cloud/ai_platform/v1/index_service.rb +6 -0
  76. data/lib/google/cloud/ai_platform/v1/job_service/client.rb +73 -35
  77. data/lib/google/cloud/ai_platform/v1/job_service/operations.rb +13 -5
  78. data/lib/google/cloud/ai_platform/v1/job_service/paths.rb +19 -0
  79. data/lib/google/cloud/ai_platform/v1/job_service/rest/client.rb +3841 -0
  80. data/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb +3901 -0
  81. data/lib/google/cloud/ai_platform/v1/job_service/rest/service_stub.rb +2149 -0
  82. data/lib/google/cloud/ai_platform/v1/job_service/rest.rb +54 -0
  83. data/lib/google/cloud/ai_platform/v1/job_service.rb +6 -0
  84. data/lib/google/cloud/ai_platform/v1/llm_utility_service/client.rb +7 -2
  85. data/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/client.rb +533 -0
  86. data/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/service_stub.rb +205 -0
  87. data/lib/google/cloud/ai_platform/v1/llm_utility_service/rest.rb +53 -0
  88. data/lib/google/cloud/ai_platform/v1/llm_utility_service.rb +6 -0
  89. data/lib/google/cloud/ai_platform/v1/match_service/client.rb +7 -2
  90. data/lib/google/cloud/ai_platform/v1/match_service/rest/client.rb +541 -0
  91. data/lib/google/cloud/ai_platform/v1/match_service/rest/service_stub.rb +189 -0
  92. data/lib/google/cloud/ai_platform/v1/match_service/rest.rb +54 -0
  93. data/lib/google/cloud/ai_platform/v1/match_service.rb +6 -0
  94. data/lib/google/cloud/ai_platform/v1/metadata_service/client.rb +67 -32
  95. data/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb +13 -5
  96. data/lib/google/cloud/ai_platform/v1/metadata_service/rest/client.rb +3634 -0
  97. data/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb +3901 -0
  98. data/lib/google/cloud/ai_platform/v1/metadata_service/rest/service_stub.rb +1972 -0
  99. data/lib/google/cloud/ai_platform/v1/metadata_service/rest.rb +54 -0
  100. data/lib/google/cloud/ai_platform/v1/metadata_service.rb +6 -0
  101. data/lib/google/cloud/ai_platform/v1/migration_service/client.rb +7 -2
  102. data/lib/google/cloud/ai_platform/v1/migration_service/operations.rb +13 -5
  103. data/lib/google/cloud/ai_platform/v1/migration_service/rest/client.rb +574 -0
  104. data/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb +3901 -0
  105. data/lib/google/cloud/ai_platform/v1/migration_service/rest/service_stub.rb +189 -0
  106. data/lib/google/cloud/ai_platform/v1/migration_service/rest.rb +55 -0
  107. data/lib/google/cloud/ai_platform/v1/migration_service.rb +6 -0
  108. data/lib/google/cloud/ai_platform/v1/model_garden_service/client.rb +5 -1
  109. data/lib/google/cloud/ai_platform/v1/model_garden_service/rest/client.rb +438 -0
  110. data/lib/google/cloud/ai_platform/v1/model_garden_service/rest/service_stub.rb +128 -0
  111. data/lib/google/cloud/ai_platform/v1/model_garden_service/rest.rb +53 -0
  112. data/lib/google/cloud/ai_platform/v1/model_garden_service.rb +6 -0
  113. data/lib/google/cloud/ai_platform/v1/model_service/client.rb +39 -18
  114. data/lib/google/cloud/ai_platform/v1/model_service/operations.rb +13 -5
  115. data/lib/google/cloud/ai_platform/v1/model_service/rest/client.rb +2213 -0
  116. data/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb +3901 -0
  117. data/lib/google/cloud/ai_platform/v1/model_service/rest/service_stub.rb +1140 -0
  118. data/lib/google/cloud/ai_platform/v1/model_service/rest.rb +54 -0
  119. data/lib/google/cloud/ai_platform/v1/model_service.rb +6 -0
  120. data/lib/google/cloud/ai_platform/v1/notebook_service/client.rb +1497 -0
  121. data/lib/google/cloud/ai_platform/v1/notebook_service/credentials.rb +47 -0
  122. data/lib/google/cloud/ai_platform/v1/notebook_service/operations.rb +817 -0
  123. data/lib/google/cloud/ai_platform/v1/notebook_service/paths.rb +124 -0
  124. data/lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb +1410 -0
  125. data/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb +3901 -0
  126. data/lib/google/cloud/ai_platform/v1/notebook_service/rest/service_stub.rb +663 -0
  127. data/lib/google/cloud/ai_platform/v1/notebook_service/rest.rb +54 -0
  128. data/lib/google/cloud/ai_platform/v1/notebook_service.rb +56 -0
  129. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/client.rb +1001 -0
  130. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/credentials.rb +47 -0
  131. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/operations.rb +817 -0
  132. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/paths.rb +86 -0
  133. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/client.rb +942 -0
  134. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb +3901 -0
  135. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/service_stub.rb +426 -0
  136. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest.rb +54 -0
  137. data/lib/google/cloud/ai_platform/v1/persistent_resource_service.rb +56 -0
  138. data/lib/google/cloud/ai_platform/v1/pipeline_service/client.rb +27 -12
  139. data/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb +13 -5
  140. data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/client.rb +1600 -0
  141. data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb +3901 -0
  142. data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/service_stub.rb +783 -0
  143. data/lib/google/cloud/ai_platform/v1/pipeline_service/rest.rb +56 -0
  144. data/lib/google/cloud/ai_platform/v1/pipeline_service.rb +6 -0
  145. data/lib/google/cloud/ai_platform/v1/prediction_service/client.rb +39 -15
  146. data/lib/google/cloud/ai_platform/v1/prediction_service/rest/client.rb +1297 -0
  147. data/lib/google/cloud/ai_platform/v1/prediction_service/rest/service_stub.rb +642 -0
  148. data/lib/google/cloud/ai_platform/v1/prediction_service/rest.rb +53 -0
  149. data/lib/google/cloud/ai_platform/v1/prediction_service.rb +6 -0
  150. data/lib/google/cloud/ai_platform/v1/rest.rb +63 -0
  151. data/lib/google/cloud/ai_platform/v1/schedule_service/client.rb +17 -7
  152. data/lib/google/cloud/ai_platform/v1/schedule_service/operations.rb +13 -5
  153. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/client.rb +1076 -0
  154. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb +3901 -0
  155. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/service_stub.rb +486 -0
  156. data/lib/google/cloud/ai_platform/v1/schedule_service/rest.rb +55 -0
  157. data/lib/google/cloud/ai_platform/v1/schedule_service.rb +6 -0
  158. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb +13 -5
  159. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb +13 -5
  160. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/client.rb +847 -0
  161. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb +3901 -0
  162. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/service_stub.rb +366 -0
  163. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest.rb +59 -0
  164. data/lib/google/cloud/ai_platform/v1/specialist_pool_service.rb +6 -0
  165. data/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb +63 -30
  166. data/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb +13 -5
  167. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/client.rb +3274 -0
  168. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb +3901 -0
  169. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/service_stub.rb +1847 -0
  170. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest.rb +54 -0
  171. data/lib/google/cloud/ai_platform/v1/tensorboard_service.rb +6 -0
  172. data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
  173. data/lib/google/cloud/ai_platform/v1/vizier_service/client.rb +33 -15
  174. data/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb +13 -5
  175. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/client.rb +1788 -0
  176. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb +3901 -0
  177. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/service_stub.rb +963 -0
  178. data/lib/google/cloud/ai_platform/v1/vizier_service/rest.rb +58 -0
  179. data/lib/google/cloud/ai_platform/v1/vizier_service.rb +6 -0
  180. data/lib/google/cloud/ai_platform/v1.rb +9 -1
  181. data/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb +1 -1
  182. data/lib/google/cloud/aiplatform/v1/content_pb.rb +3 -1
  183. data/lib/google/cloud/aiplatform/v1/custom_job_pb.rb +1 -1
  184. data/lib/google/cloud/aiplatform/v1/endpoint_pb.rb +3 -1
  185. data/lib/google/cloud/aiplatform/v1/feature_online_store_pb.rb +3 -1
  186. data/lib/google/cloud/aiplatform/v1/feature_online_store_service_pb.rb +1 -1
  187. data/lib/google/cloud/aiplatform/v1/feature_view_pb.rb +5 -1
  188. data/lib/google/cloud/aiplatform/v1/genai_tuning_service_pb.rb +54 -0
  189. data/lib/google/cloud/aiplatform/v1/genai_tuning_service_services_pb.rb +63 -0
  190. data/lib/google/cloud/aiplatform/v1/index_service_pb.rb +1 -1
  191. data/lib/google/cloud/aiplatform/v1/machine_resources_pb.rb +2 -1
  192. data/lib/google/cloud/aiplatform/v1/network_spec_pb.rb +44 -0
  193. data/lib/google/cloud/aiplatform/v1/notebook_euc_config_pb.rb +44 -0
  194. data/lib/google/cloud/aiplatform/v1/notebook_idle_shutdown_config_pb.rb +46 -0
  195. data/lib/google/cloud/aiplatform/v1/notebook_runtime_pb.rb +61 -0
  196. data/lib/google/cloud/aiplatform/v1/notebook_runtime_template_ref_pb.rb +45 -0
  197. data/lib/google/cloud/aiplatform/v1/notebook_service_pb.rb +72 -0
  198. data/lib/google/cloud/aiplatform/v1/notebook_service_services_pb.rb +64 -0
  199. data/lib/google/cloud/aiplatform/v1/openapi_pb.rb +1 -1
  200. data/lib/google/cloud/aiplatform/v1/persistent_resource_pb.rb +60 -0
  201. data/lib/google/cloud/aiplatform/v1/persistent_resource_service_pb.rb +64 -0
  202. data/lib/google/cloud/aiplatform/v1/persistent_resource_service_services_pb.rb +55 -0
  203. data/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb +1 -1
  204. data/lib/google/cloud/aiplatform/v1/publisher_model_pb.rb +1 -1
  205. data/lib/google/cloud/aiplatform/v1/tuning_job_pb.rb +60 -0
  206. data/proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb +3 -0
  207. data/proto_docs/google/cloud/aiplatform/v1/content.rb +52 -3
  208. data/proto_docs/google/cloud/aiplatform/v1/custom_job.rb +9 -0
  209. data/proto_docs/google/cloud/aiplatform/v1/endpoint.rb +14 -0
  210. data/proto_docs/google/cloud/aiplatform/v1/endpoint_service.rb +2 -3
  211. data/proto_docs/google/cloud/aiplatform/v1/feature_online_store.rb +29 -0
  212. data/proto_docs/google/cloud/aiplatform/v1/feature_online_store_service.rb +5 -0
  213. data/proto_docs/google/cloud/aiplatform/v1/feature_registry_service.rb +1 -1
  214. data/proto_docs/google/cloud/aiplatform/v1/feature_view.rb +86 -0
  215. data/proto_docs/google/cloud/aiplatform/v1/genai_tuning_service.rb +100 -0
  216. data/proto_docs/google/cloud/aiplatform/v1/index_service.rb +3 -0
  217. data/proto_docs/google/cloud/aiplatform/v1/machine_resources.rb +17 -0
  218. data/proto_docs/google/cloud/aiplatform/v1/network_spec.rb +44 -0
  219. data/proto_docs/google/cloud/aiplatform/v1/notebook_euc_config.rb +46 -0
  220. data/proto_docs/google/cloud/aiplatform/v1/notebook_idle_shutdown_config.rb +41 -0
  221. data/proto_docs/google/cloud/aiplatform/v1/notebook_runtime.rb +263 -0
  222. data/proto_docs/google/cloud/aiplatform/v1/notebook_runtime_template_ref.rb +35 -0
  223. data/proto_docs/google/cloud/aiplatform/v1/notebook_service.rb +371 -0
  224. data/proto_docs/google/cloud/aiplatform/v1/openapi.rb +43 -4
  225. data/proto_docs/google/cloud/aiplatform/v1/persistent_resource.rb +248 -0
  226. data/proto_docs/google/cloud/aiplatform/v1/persistent_resource_service.rb +170 -0
  227. data/proto_docs/google/cloud/aiplatform/v1/prediction_service.rb +12 -0
  228. data/proto_docs/google/cloud/aiplatform/v1/publisher_model.rb +4 -0
  229. data/proto_docs/google/cloud/aiplatform/v1/tool.rb +7 -5
  230. data/proto_docs/google/cloud/aiplatform/v1/tuning_job.rb +262 -0
  231. metadata +138 -2
@@ -0,0 +1,1001 @@
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/persistent_resource_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 PersistentResourceService
29
+ ##
30
+ # Client for the PersistentResourceService service.
31
+ #
32
+ # A service for managing Vertex AI's machine learning PersistentResource.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :persistent_resource_service_stub
45
+
46
+ ##
47
+ # Configure the PersistentResourceService Client class.
48
+ #
49
+ # See {::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all PersistentResourceService clients
55
+ # ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "AIPlatform", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the PersistentResourceService Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # The effective universe domain
103
+ #
104
+ # @return [String]
105
+ #
106
+ def universe_domain
107
+ @persistent_resource_service_stub.universe_domain
108
+ end
109
+
110
+ ##
111
+ # Create a new PersistentResourceService client object.
112
+ #
113
+ # @example
114
+ #
115
+ # # Create a client using the default configuration
116
+ # client = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.new
117
+ #
118
+ # # Create a client using a custom configuration
119
+ # client = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.new do |config|
120
+ # config.timeout = 10.0
121
+ # end
122
+ #
123
+ # @yield [config] Configure the PersistentResourceService client.
124
+ # @yieldparam config [Client::Configuration]
125
+ #
126
+ def initialize
127
+ # These require statements are intentionally placed here to initialize
128
+ # the gRPC module only when it's required.
129
+ # See https://github.com/googleapis/toolkit/issues/446
130
+ require "gapic/grpc"
131
+ require "google/cloud/aiplatform/v1/persistent_resource_service_services_pb"
132
+
133
+ # Create the configuration object
134
+ @config = Configuration.new Client.configure
135
+
136
+ # Yield the configuration if needed
137
+ yield @config if block_given?
138
+
139
+ # Create credentials
140
+ credentials = @config.credentials
141
+ # Use self-signed JWT if the endpoint is unchanged from default,
142
+ # but only if the default endpoint does not have a region prefix.
143
+ enable_self_signed_jwt = @config.endpoint.nil? ||
144
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
+ !@config.endpoint.split(".").first.include?("-"))
146
+ credentials ||= Credentials.default scope: @config.scope,
147
+ enable_self_signed_jwt: enable_self_signed_jwt
148
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
149
+ credentials = Credentials.new credentials, scope: @config.scope
150
+ end
151
+ @quota_project_id = @config.quota_project
152
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
153
+
154
+ @operations_client = Operations.new do |config|
155
+ config.credentials = credentials
156
+ config.quota_project = @quota_project_id
157
+ config.endpoint = @config.endpoint
158
+ config.universe_domain = @config.universe_domain
159
+ end
160
+
161
+ @persistent_resource_service_stub = ::Gapic::ServiceStub.new(
162
+ ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Stub,
163
+ credentials: credentials,
164
+ endpoint: @config.endpoint,
165
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
166
+ universe_domain: @config.universe_domain,
167
+ channel_args: @config.channel_args,
168
+ interceptors: @config.interceptors,
169
+ channel_pool_config: @config.channel_pool
170
+ )
171
+
172
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
173
+ config.credentials = credentials
174
+ config.quota_project = @quota_project_id
175
+ config.endpoint = @persistent_resource_service_stub.endpoint
176
+ config.universe_domain = @persistent_resource_service_stub.universe_domain
177
+ end
178
+
179
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
180
+ config.credentials = credentials
181
+ config.quota_project = @quota_project_id
182
+ config.endpoint = @persistent_resource_service_stub.endpoint
183
+ config.universe_domain = @persistent_resource_service_stub.universe_domain
184
+ end
185
+ end
186
+
187
+ ##
188
+ # Get the associated client for long-running operations.
189
+ #
190
+ # @return [::Google::Cloud::AIPlatform::V1::PersistentResourceService::Operations]
191
+ #
192
+ attr_reader :operations_client
193
+
194
+ ##
195
+ # Get the associated client for mix-in of the Locations.
196
+ #
197
+ # @return [Google::Cloud::Location::Locations::Client]
198
+ #
199
+ attr_reader :location_client
200
+
201
+ ##
202
+ # Get the associated client for mix-in of the IAMPolicy.
203
+ #
204
+ # @return [Google::Iam::V1::IAMPolicy::Client]
205
+ #
206
+ attr_reader :iam_policy_client
207
+
208
+ # Service calls
209
+
210
+ ##
211
+ # Creates a PersistentResource.
212
+ #
213
+ # @overload create_persistent_resource(request, options = nil)
214
+ # Pass arguments to `create_persistent_resource` via a request object, either of type
215
+ # {::Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest} or an equivalent Hash.
216
+ #
217
+ # @param request [::Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest, ::Hash]
218
+ # A request object representing the call parameters. Required. To specify no
219
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
220
+ # @param options [::Gapic::CallOptions, ::Hash]
221
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
222
+ #
223
+ # @overload create_persistent_resource(parent: nil, persistent_resource: nil, persistent_resource_id: nil)
224
+ # Pass arguments to `create_persistent_resource` via keyword arguments. Note that at
225
+ # least one keyword argument is required. To specify no parameters, or to keep all
226
+ # the default parameter values, pass an empty Hash as a request object (see above).
227
+ #
228
+ # @param parent [::String]
229
+ # Required. The resource name of the Location to create the
230
+ # PersistentResource in. Format: `projects/{project}/locations/{location}`
231
+ # @param persistent_resource [::Google::Cloud::AIPlatform::V1::PersistentResource, ::Hash]
232
+ # Required. The PersistentResource to create.
233
+ # @param persistent_resource_id [::String]
234
+ # Required. The ID to use for the PersistentResource, which become the final
235
+ # component of the PersistentResource's resource name.
236
+ #
237
+ # The maximum length is 63 characters, and valid characters
238
+ # are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`.
239
+ #
240
+ # @yield [response, operation] Access the result along with the RPC operation
241
+ # @yieldparam response [::Gapic::Operation]
242
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
243
+ #
244
+ # @return [::Gapic::Operation]
245
+ #
246
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
247
+ #
248
+ # @example Basic example
249
+ # require "google/cloud/ai_platform/v1"
250
+ #
251
+ # # Create a client object. The client can be reused for multiple calls.
252
+ # client = Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.new
253
+ #
254
+ # # Create a request. To set request fields, pass in keyword arguments.
255
+ # request = Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest.new
256
+ #
257
+ # # Call the create_persistent_resource method.
258
+ # result = client.create_persistent_resource request
259
+ #
260
+ # # The returned object is of type Gapic::Operation. You can use it to
261
+ # # check the status of an operation, cancel it, or wait for results.
262
+ # # Here is how to wait for a response.
263
+ # result.wait_until_done! timeout: 60
264
+ # if result.response?
265
+ # p result.response
266
+ # else
267
+ # puts "No response received."
268
+ # end
269
+ #
270
+ def create_persistent_resource request, options = nil
271
+ raise ::ArgumentError, "request must be provided" if request.nil?
272
+
273
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest
274
+
275
+ # Converts hash and nil to an options object
276
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
277
+
278
+ # Customize the options with defaults
279
+ metadata = @config.rpcs.create_persistent_resource.metadata.to_h
280
+
281
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
282
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
283
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
284
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
285
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
286
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
287
+
288
+ header_params = {}
289
+ if request.parent
290
+ header_params["parent"] = request.parent
291
+ end
292
+
293
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
294
+ metadata[:"x-goog-request-params"] ||= request_params_header
295
+
296
+ options.apply_defaults timeout: @config.rpcs.create_persistent_resource.timeout,
297
+ metadata: metadata,
298
+ retry_policy: @config.rpcs.create_persistent_resource.retry_policy
299
+
300
+ options.apply_defaults timeout: @config.timeout,
301
+ metadata: @config.metadata,
302
+ retry_policy: @config.retry_policy
303
+
304
+ @persistent_resource_service_stub.call_rpc :create_persistent_resource, request, options: options do |response, operation|
305
+ response = ::Gapic::Operation.new response, @operations_client, options: options
306
+ yield response, operation if block_given?
307
+ return response
308
+ end
309
+ rescue ::GRPC::BadStatus => e
310
+ raise ::Google::Cloud::Error.from_error(e)
311
+ end
312
+
313
+ ##
314
+ # Gets a PersistentResource.
315
+ #
316
+ # @overload get_persistent_resource(request, options = nil)
317
+ # Pass arguments to `get_persistent_resource` via a request object, either of type
318
+ # {::Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest} or an equivalent Hash.
319
+ #
320
+ # @param request [::Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest, ::Hash]
321
+ # A request object representing the call parameters. Required. To specify no
322
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
323
+ # @param options [::Gapic::CallOptions, ::Hash]
324
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
325
+ #
326
+ # @overload get_persistent_resource(name: nil)
327
+ # Pass arguments to `get_persistent_resource` via keyword arguments. Note that at
328
+ # least one keyword argument is required. To specify no parameters, or to keep all
329
+ # the default parameter values, pass an empty Hash as a request object (see above).
330
+ #
331
+ # @param name [::String]
332
+ # Required. The name of the PersistentResource resource.
333
+ # Format:
334
+ # `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}`
335
+ #
336
+ # @yield [response, operation] Access the result along with the RPC operation
337
+ # @yieldparam response [::Google::Cloud::AIPlatform::V1::PersistentResource]
338
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
339
+ #
340
+ # @return [::Google::Cloud::AIPlatform::V1::PersistentResource]
341
+ #
342
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
343
+ #
344
+ # @example Basic example
345
+ # require "google/cloud/ai_platform/v1"
346
+ #
347
+ # # Create a client object. The client can be reused for multiple calls.
348
+ # client = Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.new
349
+ #
350
+ # # Create a request. To set request fields, pass in keyword arguments.
351
+ # request = Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest.new
352
+ #
353
+ # # Call the get_persistent_resource method.
354
+ # result = client.get_persistent_resource request
355
+ #
356
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::PersistentResource.
357
+ # p result
358
+ #
359
+ def get_persistent_resource request, options = nil
360
+ raise ::ArgumentError, "request must be provided" if request.nil?
361
+
362
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest
363
+
364
+ # Converts hash and nil to an options object
365
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
366
+
367
+ # Customize the options with defaults
368
+ metadata = @config.rpcs.get_persistent_resource.metadata.to_h
369
+
370
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
371
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
372
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
373
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
374
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
375
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
376
+
377
+ header_params = {}
378
+ if request.name
379
+ header_params["name"] = request.name
380
+ end
381
+
382
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
383
+ metadata[:"x-goog-request-params"] ||= request_params_header
384
+
385
+ options.apply_defaults timeout: @config.rpcs.get_persistent_resource.timeout,
386
+ metadata: metadata,
387
+ retry_policy: @config.rpcs.get_persistent_resource.retry_policy
388
+
389
+ options.apply_defaults timeout: @config.timeout,
390
+ metadata: @config.metadata,
391
+ retry_policy: @config.retry_policy
392
+
393
+ @persistent_resource_service_stub.call_rpc :get_persistent_resource, request, options: options do |response, operation|
394
+ yield response, operation if block_given?
395
+ return response
396
+ end
397
+ rescue ::GRPC::BadStatus => e
398
+ raise ::Google::Cloud::Error.from_error(e)
399
+ end
400
+
401
+ ##
402
+ # Lists PersistentResources in a Location.
403
+ #
404
+ # @overload list_persistent_resources(request, options = nil)
405
+ # Pass arguments to `list_persistent_resources` via a request object, either of type
406
+ # {::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest} or an equivalent Hash.
407
+ #
408
+ # @param request [::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest, ::Hash]
409
+ # A request object representing the call parameters. Required. To specify no
410
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
411
+ # @param options [::Gapic::CallOptions, ::Hash]
412
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
413
+ #
414
+ # @overload list_persistent_resources(parent: nil, page_size: nil, page_token: nil)
415
+ # Pass arguments to `list_persistent_resources` via keyword arguments. Note that at
416
+ # least one keyword argument is required. To specify no parameters, or to keep all
417
+ # the default parameter values, pass an empty Hash as a request object (see above).
418
+ #
419
+ # @param parent [::String]
420
+ # Required. The resource name of the Location to list the PersistentResources
421
+ # from. Format: `projects/{project}/locations/{location}`
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
+ # [ListPersistentResourceResponse.next_page_token][] of the previous
428
+ # [PersistentResourceService.ListPersistentResource][] call.
429
+ #
430
+ # @yield [response, operation] Access the result along with the RPC operation
431
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::PersistentResource>]
432
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
433
+ #
434
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::PersistentResource>]
435
+ #
436
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
437
+ #
438
+ # @example Basic example
439
+ # require "google/cloud/ai_platform/v1"
440
+ #
441
+ # # Create a client object. The client can be reused for multiple calls.
442
+ # client = Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.new
443
+ #
444
+ # # Create a request. To set request fields, pass in keyword arguments.
445
+ # request = Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest.new
446
+ #
447
+ # # Call the list_persistent_resources method.
448
+ # result = client.list_persistent_resources request
449
+ #
450
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
451
+ # # over elements, and API calls will be issued to fetch pages as needed.
452
+ # result.each do |item|
453
+ # # Each element is of type ::Google::Cloud::AIPlatform::V1::PersistentResource.
454
+ # p item
455
+ # end
456
+ #
457
+ def list_persistent_resources request, options = nil
458
+ raise ::ArgumentError, "request must be provided" if request.nil?
459
+
460
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest
461
+
462
+ # Converts hash and nil to an options object
463
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
464
+
465
+ # Customize the options with defaults
466
+ metadata = @config.rpcs.list_persistent_resources.metadata.to_h
467
+
468
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
469
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
470
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
471
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
472
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
473
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
474
+
475
+ header_params = {}
476
+ if request.parent
477
+ header_params["parent"] = request.parent
478
+ end
479
+
480
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
481
+ metadata[:"x-goog-request-params"] ||= request_params_header
482
+
483
+ options.apply_defaults timeout: @config.rpcs.list_persistent_resources.timeout,
484
+ metadata: metadata,
485
+ retry_policy: @config.rpcs.list_persistent_resources.retry_policy
486
+
487
+ options.apply_defaults timeout: @config.timeout,
488
+ metadata: @config.metadata,
489
+ retry_policy: @config.retry_policy
490
+
491
+ @persistent_resource_service_stub.call_rpc :list_persistent_resources, request, options: options do |response, operation|
492
+ response = ::Gapic::PagedEnumerable.new @persistent_resource_service_stub, :list_persistent_resources, request, response, operation, options
493
+ yield response, operation if block_given?
494
+ return response
495
+ end
496
+ rescue ::GRPC::BadStatus => e
497
+ raise ::Google::Cloud::Error.from_error(e)
498
+ end
499
+
500
+ ##
501
+ # Deletes a PersistentResource.
502
+ #
503
+ # @overload delete_persistent_resource(request, options = nil)
504
+ # Pass arguments to `delete_persistent_resource` via a request object, either of type
505
+ # {::Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest} or an equivalent Hash.
506
+ #
507
+ # @param request [::Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest, ::Hash]
508
+ # A request object representing the call parameters. Required. To specify no
509
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
510
+ # @param options [::Gapic::CallOptions, ::Hash]
511
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
512
+ #
513
+ # @overload delete_persistent_resource(name: nil)
514
+ # Pass arguments to `delete_persistent_resource` via keyword arguments. Note that at
515
+ # least one keyword argument is required. To specify no parameters, or to keep all
516
+ # the default parameter values, pass an empty Hash as a request object (see above).
517
+ #
518
+ # @param name [::String]
519
+ # Required. The name of the PersistentResource to be deleted.
520
+ # Format:
521
+ # `projects/{project}/locations/{location}/persistentResources/{persistent_resource}`
522
+ #
523
+ # @yield [response, operation] Access the result along with the RPC operation
524
+ # @yieldparam response [::Gapic::Operation]
525
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
526
+ #
527
+ # @return [::Gapic::Operation]
528
+ #
529
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
530
+ #
531
+ # @example Basic example
532
+ # require "google/cloud/ai_platform/v1"
533
+ #
534
+ # # Create a client object. The client can be reused for multiple calls.
535
+ # client = Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.new
536
+ #
537
+ # # Create a request. To set request fields, pass in keyword arguments.
538
+ # request = Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest.new
539
+ #
540
+ # # Call the delete_persistent_resource method.
541
+ # result = client.delete_persistent_resource request
542
+ #
543
+ # # The returned object is of type Gapic::Operation. You can use it to
544
+ # # check the status of an operation, cancel it, or wait for results.
545
+ # # Here is how to wait for a response.
546
+ # result.wait_until_done! timeout: 60
547
+ # if result.response?
548
+ # p result.response
549
+ # else
550
+ # puts "No response received."
551
+ # end
552
+ #
553
+ def delete_persistent_resource request, options = nil
554
+ raise ::ArgumentError, "request must be provided" if request.nil?
555
+
556
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest
557
+
558
+ # Converts hash and nil to an options object
559
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
560
+
561
+ # Customize the options with defaults
562
+ metadata = @config.rpcs.delete_persistent_resource.metadata.to_h
563
+
564
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
565
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
566
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
567
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
568
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
569
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
570
+
571
+ header_params = {}
572
+ if request.name
573
+ header_params["name"] = request.name
574
+ end
575
+
576
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
577
+ metadata[:"x-goog-request-params"] ||= request_params_header
578
+
579
+ options.apply_defaults timeout: @config.rpcs.delete_persistent_resource.timeout,
580
+ metadata: metadata,
581
+ retry_policy: @config.rpcs.delete_persistent_resource.retry_policy
582
+
583
+ options.apply_defaults timeout: @config.timeout,
584
+ metadata: @config.metadata,
585
+ retry_policy: @config.retry_policy
586
+
587
+ @persistent_resource_service_stub.call_rpc :delete_persistent_resource, request, options: options do |response, operation|
588
+ response = ::Gapic::Operation.new response, @operations_client, options: options
589
+ yield response, operation if block_given?
590
+ return response
591
+ end
592
+ rescue ::GRPC::BadStatus => e
593
+ raise ::Google::Cloud::Error.from_error(e)
594
+ end
595
+
596
+ ##
597
+ # Updates a PersistentResource.
598
+ #
599
+ # @overload update_persistent_resource(request, options = nil)
600
+ # Pass arguments to `update_persistent_resource` via a request object, either of type
601
+ # {::Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest} or an equivalent Hash.
602
+ #
603
+ # @param request [::Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest, ::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 update_persistent_resource(persistent_resource: nil, update_mask: nil)
610
+ # Pass arguments to `update_persistent_resource` 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 persistent_resource [::Google::Cloud::AIPlatform::V1::PersistentResource, ::Hash]
615
+ # Required. The PersistentResource to update.
616
+ #
617
+ # The PersistentResource's `name` field is used to identify the
618
+ # PersistentResource to update. Format:
619
+ # `projects/{project}/locations/{location}/persistentResources/{persistent_resource}`
620
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
621
+ # Required. Specify the fields to be overwritten in the PersistentResource by
622
+ # the update method.
623
+ #
624
+ # @yield [response, operation] Access the result along with the RPC operation
625
+ # @yieldparam response [::Gapic::Operation]
626
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
627
+ #
628
+ # @return [::Gapic::Operation]
629
+ #
630
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
631
+ #
632
+ # @example Basic example
633
+ # require "google/cloud/ai_platform/v1"
634
+ #
635
+ # # Create a client object. The client can be reused for multiple calls.
636
+ # client = Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.new
637
+ #
638
+ # # Create a request. To set request fields, pass in keyword arguments.
639
+ # request = Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest.new
640
+ #
641
+ # # Call the update_persistent_resource method.
642
+ # result = client.update_persistent_resource request
643
+ #
644
+ # # The returned object is of type Gapic::Operation. You can use it to
645
+ # # check the status of an operation, cancel it, or wait for results.
646
+ # # Here is how to wait for a response.
647
+ # result.wait_until_done! timeout: 60
648
+ # if result.response?
649
+ # p result.response
650
+ # else
651
+ # puts "No response received."
652
+ # end
653
+ #
654
+ def update_persistent_resource request, options = nil
655
+ raise ::ArgumentError, "request must be provided" if request.nil?
656
+
657
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest
658
+
659
+ # Converts hash and nil to an options object
660
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
661
+
662
+ # Customize the options with defaults
663
+ metadata = @config.rpcs.update_persistent_resource.metadata.to_h
664
+
665
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
666
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
667
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
668
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
669
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
670
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
671
+
672
+ header_params = {}
673
+ if request.persistent_resource&.name
674
+ header_params["persistent_resource.name"] = request.persistent_resource.name
675
+ end
676
+
677
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
678
+ metadata[:"x-goog-request-params"] ||= request_params_header
679
+
680
+ options.apply_defaults timeout: @config.rpcs.update_persistent_resource.timeout,
681
+ metadata: metadata,
682
+ retry_policy: @config.rpcs.update_persistent_resource.retry_policy
683
+
684
+ options.apply_defaults timeout: @config.timeout,
685
+ metadata: @config.metadata,
686
+ retry_policy: @config.retry_policy
687
+
688
+ @persistent_resource_service_stub.call_rpc :update_persistent_resource, request, options: options do |response, operation|
689
+ response = ::Gapic::Operation.new response, @operations_client, options: options
690
+ yield response, operation if block_given?
691
+ return response
692
+ end
693
+ rescue ::GRPC::BadStatus => e
694
+ raise ::Google::Cloud::Error.from_error(e)
695
+ end
696
+
697
+ ##
698
+ # Reboots a PersistentResource.
699
+ #
700
+ # @overload reboot_persistent_resource(request, options = nil)
701
+ # Pass arguments to `reboot_persistent_resource` via a request object, either of type
702
+ # {::Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest} or an equivalent Hash.
703
+ #
704
+ # @param request [::Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest, ::Hash]
705
+ # A request object representing the call parameters. Required. To specify no
706
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
707
+ # @param options [::Gapic::CallOptions, ::Hash]
708
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
709
+ #
710
+ # @overload reboot_persistent_resource(name: nil)
711
+ # Pass arguments to `reboot_persistent_resource` via keyword arguments. Note that at
712
+ # least one keyword argument is required. To specify no parameters, or to keep all
713
+ # the default parameter values, pass an empty Hash as a request object (see above).
714
+ #
715
+ # @param name [::String]
716
+ # Required. The name of the PersistentResource resource.
717
+ # Format:
718
+ # `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}`
719
+ #
720
+ # @yield [response, operation] Access the result along with the RPC operation
721
+ # @yieldparam response [::Gapic::Operation]
722
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
723
+ #
724
+ # @return [::Gapic::Operation]
725
+ #
726
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
727
+ #
728
+ # @example Basic example
729
+ # require "google/cloud/ai_platform/v1"
730
+ #
731
+ # # Create a client object. The client can be reused for multiple calls.
732
+ # client = Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.new
733
+ #
734
+ # # Create a request. To set request fields, pass in keyword arguments.
735
+ # request = Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest.new
736
+ #
737
+ # # Call the reboot_persistent_resource method.
738
+ # result = client.reboot_persistent_resource request
739
+ #
740
+ # # The returned object is of type Gapic::Operation. You can use it to
741
+ # # check the status of an operation, cancel it, or wait for results.
742
+ # # Here is how to wait for a response.
743
+ # result.wait_until_done! timeout: 60
744
+ # if result.response?
745
+ # p result.response
746
+ # else
747
+ # puts "No response received."
748
+ # end
749
+ #
750
+ def reboot_persistent_resource request, options = nil
751
+ raise ::ArgumentError, "request must be provided" if request.nil?
752
+
753
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest
754
+
755
+ # Converts hash and nil to an options object
756
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
757
+
758
+ # Customize the options with defaults
759
+ metadata = @config.rpcs.reboot_persistent_resource.metadata.to_h
760
+
761
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
762
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
763
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
764
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
765
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
766
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
767
+
768
+ header_params = {}
769
+ if request.name
770
+ header_params["name"] = request.name
771
+ end
772
+
773
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
774
+ metadata[:"x-goog-request-params"] ||= request_params_header
775
+
776
+ options.apply_defaults timeout: @config.rpcs.reboot_persistent_resource.timeout,
777
+ metadata: metadata,
778
+ retry_policy: @config.rpcs.reboot_persistent_resource.retry_policy
779
+
780
+ options.apply_defaults timeout: @config.timeout,
781
+ metadata: @config.metadata,
782
+ retry_policy: @config.retry_policy
783
+
784
+ @persistent_resource_service_stub.call_rpc :reboot_persistent_resource, request, options: options do |response, operation|
785
+ response = ::Gapic::Operation.new response, @operations_client, options: options
786
+ yield response, operation if block_given?
787
+ return response
788
+ end
789
+ rescue ::GRPC::BadStatus => e
790
+ raise ::Google::Cloud::Error.from_error(e)
791
+ end
792
+
793
+ ##
794
+ # Configuration class for the PersistentResourceService API.
795
+ #
796
+ # This class represents the configuration for PersistentResourceService,
797
+ # providing control over timeouts, retry behavior, logging, transport
798
+ # parameters, and other low-level controls. Certain parameters can also be
799
+ # applied individually to specific RPCs. See
800
+ # {::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client::Configuration::Rpcs}
801
+ # for a list of RPCs that can be configured independently.
802
+ #
803
+ # Configuration can be applied globally to all clients, or to a single client
804
+ # on construction.
805
+ #
806
+ # @example
807
+ #
808
+ # # Modify the global config, setting the timeout for
809
+ # # create_persistent_resource to 20 seconds,
810
+ # # and all remaining timeouts to 10 seconds.
811
+ # ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.configure do |config|
812
+ # config.timeout = 10.0
813
+ # config.rpcs.create_persistent_resource.timeout = 20.0
814
+ # end
815
+ #
816
+ # # Apply the above configuration only to a new client.
817
+ # client = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.new do |config|
818
+ # config.timeout = 10.0
819
+ # config.rpcs.create_persistent_resource.timeout = 20.0
820
+ # end
821
+ #
822
+ # @!attribute [rw] endpoint
823
+ # A custom service endpoint, as a hostname or hostname:port. The default is
824
+ # nil, indicating to use the default endpoint in the current universe domain.
825
+ # @return [::String,nil]
826
+ # @!attribute [rw] credentials
827
+ # Credentials to send with calls. You may provide any of the following types:
828
+ # * (`String`) The path to a service account key file in JSON format
829
+ # * (`Hash`) A service account key as a Hash
830
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
831
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
832
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
833
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
834
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
835
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
836
+ # * (`nil`) indicating no credentials
837
+ # @return [::Object]
838
+ # @!attribute [rw] scope
839
+ # The OAuth scopes
840
+ # @return [::Array<::String>]
841
+ # @!attribute [rw] lib_name
842
+ # The library name as recorded in instrumentation and logging
843
+ # @return [::String]
844
+ # @!attribute [rw] lib_version
845
+ # The library version as recorded in instrumentation and logging
846
+ # @return [::String]
847
+ # @!attribute [rw] channel_args
848
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
849
+ # `GRPC::Core::Channel` object is provided as the credential.
850
+ # @return [::Hash]
851
+ # @!attribute [rw] interceptors
852
+ # An array of interceptors that are run before calls are executed.
853
+ # @return [::Array<::GRPC::ClientInterceptor>]
854
+ # @!attribute [rw] timeout
855
+ # The call timeout in seconds.
856
+ # @return [::Numeric]
857
+ # @!attribute [rw] metadata
858
+ # Additional gRPC headers to be sent with the call.
859
+ # @return [::Hash{::Symbol=>::String}]
860
+ # @!attribute [rw] retry_policy
861
+ # The retry policy. The value is a hash with the following keys:
862
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
863
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
864
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
865
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
866
+ # trigger a retry.
867
+ # @return [::Hash]
868
+ # @!attribute [rw] quota_project
869
+ # A separate project against which to charge quota.
870
+ # @return [::String]
871
+ # @!attribute [rw] universe_domain
872
+ # The universe domain within which to make requests. This determines the
873
+ # default endpoint URL. The default value of nil uses the environment
874
+ # universe (usually the default "googleapis.com" universe).
875
+ # @return [::String,nil]
876
+ #
877
+ class Configuration
878
+ extend ::Gapic::Config
879
+
880
+ # @private
881
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
882
+ DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
883
+
884
+ config_attr :endpoint, nil, ::String, nil
885
+ config_attr :credentials, nil do |value|
886
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
887
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
888
+ allowed.any? { |klass| klass === value }
889
+ end
890
+ config_attr :scope, nil, ::String, ::Array, nil
891
+ config_attr :lib_name, nil, ::String, nil
892
+ config_attr :lib_version, nil, ::String, nil
893
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
894
+ config_attr :interceptors, nil, ::Array, nil
895
+ config_attr :timeout, nil, ::Numeric, nil
896
+ config_attr :metadata, nil, ::Hash, nil
897
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
898
+ config_attr :quota_project, nil, ::String, nil
899
+ config_attr :universe_domain, nil, ::String, nil
900
+
901
+ # @private
902
+ def initialize parent_config = nil
903
+ @parent_config = parent_config unless parent_config.nil?
904
+
905
+ yield self if block_given?
906
+ end
907
+
908
+ ##
909
+ # Configurations for individual RPCs
910
+ # @return [Rpcs]
911
+ #
912
+ def rpcs
913
+ @rpcs ||= begin
914
+ parent_rpcs = nil
915
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
916
+ Rpcs.new parent_rpcs
917
+ end
918
+ end
919
+
920
+ ##
921
+ # Configuration for the channel pool
922
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
923
+ #
924
+ def channel_pool
925
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
926
+ end
927
+
928
+ ##
929
+ # Configuration RPC class for the PersistentResourceService API.
930
+ #
931
+ # Includes fields providing the configuration for each RPC in this service.
932
+ # Each configuration object is of type `Gapic::Config::Method` and includes
933
+ # the following configuration fields:
934
+ #
935
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
936
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
937
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
938
+ # include the following keys:
939
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
940
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
941
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
942
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
943
+ # trigger a retry.
944
+ #
945
+ class Rpcs
946
+ ##
947
+ # RPC-specific configuration for `create_persistent_resource`
948
+ # @return [::Gapic::Config::Method]
949
+ #
950
+ attr_reader :create_persistent_resource
951
+ ##
952
+ # RPC-specific configuration for `get_persistent_resource`
953
+ # @return [::Gapic::Config::Method]
954
+ #
955
+ attr_reader :get_persistent_resource
956
+ ##
957
+ # RPC-specific configuration for `list_persistent_resources`
958
+ # @return [::Gapic::Config::Method]
959
+ #
960
+ attr_reader :list_persistent_resources
961
+ ##
962
+ # RPC-specific configuration for `delete_persistent_resource`
963
+ # @return [::Gapic::Config::Method]
964
+ #
965
+ attr_reader :delete_persistent_resource
966
+ ##
967
+ # RPC-specific configuration for `update_persistent_resource`
968
+ # @return [::Gapic::Config::Method]
969
+ #
970
+ attr_reader :update_persistent_resource
971
+ ##
972
+ # RPC-specific configuration for `reboot_persistent_resource`
973
+ # @return [::Gapic::Config::Method]
974
+ #
975
+ attr_reader :reboot_persistent_resource
976
+
977
+ # @private
978
+ def initialize parent_rpcs = nil
979
+ create_persistent_resource_config = parent_rpcs.create_persistent_resource if parent_rpcs.respond_to? :create_persistent_resource
980
+ @create_persistent_resource = ::Gapic::Config::Method.new create_persistent_resource_config
981
+ get_persistent_resource_config = parent_rpcs.get_persistent_resource if parent_rpcs.respond_to? :get_persistent_resource
982
+ @get_persistent_resource = ::Gapic::Config::Method.new get_persistent_resource_config
983
+ list_persistent_resources_config = parent_rpcs.list_persistent_resources if parent_rpcs.respond_to? :list_persistent_resources
984
+ @list_persistent_resources = ::Gapic::Config::Method.new list_persistent_resources_config
985
+ delete_persistent_resource_config = parent_rpcs.delete_persistent_resource if parent_rpcs.respond_to? :delete_persistent_resource
986
+ @delete_persistent_resource = ::Gapic::Config::Method.new delete_persistent_resource_config
987
+ update_persistent_resource_config = parent_rpcs.update_persistent_resource if parent_rpcs.respond_to? :update_persistent_resource
988
+ @update_persistent_resource = ::Gapic::Config::Method.new update_persistent_resource_config
989
+ reboot_persistent_resource_config = parent_rpcs.reboot_persistent_resource if parent_rpcs.respond_to? :reboot_persistent_resource
990
+ @reboot_persistent_resource = ::Gapic::Config::Method.new reboot_persistent_resource_config
991
+
992
+ yield self if block_given?
993
+ end
994
+ end
995
+ end
996
+ end
997
+ end
998
+ end
999
+ end
1000
+ end
1001
+ end