google-cloud-ai_platform-v1 0.39.0 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) 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 +138 -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 +2280 -0
  6. data/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb +3971 -0
  7. data/lib/google/cloud/ai_platform/v1/dataset_service/rest/service_stub.rb +1196 -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 +3971 -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 +3971 -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 +3971 -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 +3971 -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 +3971 -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 +3971 -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 +3971 -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 +3971 -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 +3971 -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 +3971 -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 +3971 -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 +123 -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 +1503 -0
  120. data/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb +3971 -0
  121. data/lib/google/cloud/ai_platform/v1/notebook_service/rest/service_stub.rb +723 -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 +3971 -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 +3971 -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 +37 -15
  139. data/lib/google/cloud/ai_platform/v1/prediction_service/credentials.rb +2 -1
  140. data/lib/google/cloud/ai_platform/v1/prediction_service/rest/client.rb +1303 -0
  141. data/lib/google/cloud/ai_platform/v1/prediction_service/rest/service_stub.rb +658 -0
  142. data/lib/google/cloud/ai_platform/v1/prediction_service/rest.rb +53 -0
  143. data/lib/google/cloud/ai_platform/v1/prediction_service.rb +6 -0
  144. data/lib/google/cloud/ai_platform/v1/rest.rb +63 -0
  145. data/lib/google/cloud/ai_platform/v1/schedule_service/client.rb +17 -7
  146. data/lib/google/cloud/ai_platform/v1/schedule_service/operations.rb +13 -5
  147. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/client.rb +1076 -0
  148. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb +3971 -0
  149. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/service_stub.rb +486 -0
  150. data/lib/google/cloud/ai_platform/v1/schedule_service/rest.rb +55 -0
  151. data/lib/google/cloud/ai_platform/v1/schedule_service.rb +6 -0
  152. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb +13 -5
  153. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb +13 -5
  154. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/client.rb +847 -0
  155. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb +3971 -0
  156. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/service_stub.rb +366 -0
  157. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest.rb +59 -0
  158. data/lib/google/cloud/ai_platform/v1/specialist_pool_service.rb +6 -0
  159. data/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb +63 -30
  160. data/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb +13 -5
  161. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/client.rb +3274 -0
  162. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb +3971 -0
  163. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/service_stub.rb +1847 -0
  164. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest.rb +54 -0
  165. data/lib/google/cloud/ai_platform/v1/tensorboard_service.rb +6 -0
  166. data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
  167. data/lib/google/cloud/ai_platform/v1/vizier_service/client.rb +33 -15
  168. data/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb +13 -5
  169. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/client.rb +1788 -0
  170. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb +3971 -0
  171. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/service_stub.rb +963 -0
  172. data/lib/google/cloud/ai_platform/v1/vizier_service/rest.rb +58 -0
  173. data/lib/google/cloud/ai_platform/v1/vizier_service.rb +6 -0
  174. data/lib/google/cloud/ai_platform/v1.rb +6 -1
  175. data/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb +1 -1
  176. data/lib/google/cloud/aiplatform/v1/content_pb.rb +4 -4
  177. data/lib/google/cloud/aiplatform/v1/dataset_pb.rb +1 -1
  178. data/lib/google/cloud/aiplatform/v1/dataset_service_pb.rb +3 -2
  179. data/lib/google/cloud/aiplatform/v1/dataset_service_services_pb.rb +2 -0
  180. data/lib/google/cloud/aiplatform/v1/dataset_version_pb.rb +1 -1
  181. data/lib/google/cloud/aiplatform/v1/deployment_resource_pool_pb.rb +3 -1
  182. data/lib/google/cloud/aiplatform/v1/endpoint_pb.rb +3 -1
  183. data/lib/google/cloud/aiplatform/v1/feature_online_store_pb.rb +3 -1
  184. data/lib/google/cloud/aiplatform/v1/feature_pb.rb +1 -1
  185. data/lib/google/cloud/aiplatform/v1/featurestore_online_service_pb.rb +3 -1
  186. data/lib/google/cloud/aiplatform/v1/index_pb.rb +2 -1
  187. data/lib/google/cloud/aiplatform/v1/index_service_pb.rb +1 -1
  188. data/lib/google/cloud/aiplatform/v1/match_service_pb.rb +2 -1
  189. data/lib/google/cloud/aiplatform/v1/metadata_store_pb.rb +2 -1
  190. data/lib/google/cloud/aiplatform/v1/notebook_runtime_pb.rb +3 -1
  191. data/lib/google/cloud/aiplatform/v1/notebook_service_pb.rb +2 -1
  192. data/lib/google/cloud/aiplatform/v1/notebook_service_services_pb.rb +2 -0
  193. data/lib/google/cloud/aiplatform/v1/persistent_resource_pb.rb +2 -1
  194. data/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb +1 -1
  195. data/lib/google/cloud/aiplatform/v1/publisher_model_pb.rb +1 -1
  196. data/lib/google/cloud/aiplatform/v1/tool_pb.rb +4 -1
  197. data/proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb +3 -0
  198. data/proto_docs/google/cloud/aiplatform/v1/content.rb +26 -48
  199. data/proto_docs/google/cloud/aiplatform/v1/dataset.rb +4 -0
  200. data/proto_docs/google/cloud/aiplatform/v1/dataset_service.rb +17 -0
  201. data/proto_docs/google/cloud/aiplatform/v1/dataset_version.rb +4 -0
  202. data/proto_docs/google/cloud/aiplatform/v1/deployment_resource_pool.rb +23 -0
  203. data/proto_docs/google/cloud/aiplatform/v1/endpoint.rb +7 -0
  204. data/proto_docs/google/cloud/aiplatform/v1/feature.rb +3 -0
  205. data/proto_docs/google/cloud/aiplatform/v1/feature_group.rb +3 -3
  206. data/proto_docs/google/cloud/aiplatform/v1/feature_online_store.rb +4 -0
  207. data/proto_docs/google/cloud/aiplatform/v1/feature_registry_service.rb +1 -1
  208. data/proto_docs/google/cloud/aiplatform/v1/featurestore_online_service.rb +24 -0
  209. data/proto_docs/google/cloud/aiplatform/v1/index.rb +23 -3
  210. data/proto_docs/google/cloud/aiplatform/v1/index_service.rb +20 -2
  211. data/proto_docs/google/cloud/aiplatform/v1/match_service.rb +18 -1
  212. data/proto_docs/google/cloud/aiplatform/v1/metadata_store.rb +13 -0
  213. data/proto_docs/google/cloud/aiplatform/v1/model.rb +1 -1
  214. data/proto_docs/google/cloud/aiplatform/v1/notebook_runtime.rb +17 -2
  215. data/proto_docs/google/cloud/aiplatform/v1/notebook_service.rb +18 -0
  216. data/proto_docs/google/cloud/aiplatform/v1/persistent_resource.rb +63 -0
  217. data/proto_docs/google/cloud/aiplatform/v1/prediction_service.rb +4 -0
  218. data/proto_docs/google/cloud/aiplatform/v1/publisher_model.rb +4 -0
  219. data/proto_docs/google/cloud/aiplatform/v1/tool.rb +43 -5
  220. data/proto_docs/google/cloud/aiplatform/v1/tuning_job.rb +8 -7
  221. metadata +101 -2
@@ -0,0 +1,942 @@
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/ai_platform/v1/persistent_resource_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 PersistentResourceService
30
+ module Rest
31
+ ##
32
+ # REST client for the PersistentResourceService service.
33
+ #
34
+ # A service for managing Vertex AI's machine learning PersistentResource.
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 :persistent_resource_service_stub
47
+
48
+ ##
49
+ # Configure the PersistentResourceService Client class.
50
+ #
51
+ # See {::Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client::Configuration}
52
+ # for a description of the configuration fields.
53
+ #
54
+ # @example
55
+ #
56
+ # # Modify the configuration for all PersistentResourceService clients
57
+ # ::Google::Cloud::AIPlatform::V1::PersistentResourceService::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 PersistentResourceService 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::PersistentResourceService::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
+ @persistent_resource_service_stub.universe_domain
110
+ end
111
+
112
+ ##
113
+ # Create a new PersistentResourceService REST client object.
114
+ #
115
+ # @example
116
+ #
117
+ # # Create a client using the default configuration
118
+ # client = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.new
119
+ #
120
+ # # Create a client using a custom configuration
121
+ # client = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.new do |config|
122
+ # config.timeout = 10.0
123
+ # end
124
+ #
125
+ # @yield [config] Configure the PersistentResourceService 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::PersistentResourceService::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
+ @persistent_resource_service_stub = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::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 = @persistent_resource_service_stub.endpoint
169
+ config.universe_domain = @persistent_resource_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 = @persistent_resource_service_stub.endpoint
177
+ config.universe_domain = @persistent_resource_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::PersistentResourceService::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 PersistentResource.
207
+ #
208
+ # @overload create_persistent_resource(request, options = nil)
209
+ # Pass arguments to `create_persistent_resource` via a request object, either of type
210
+ # {::Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest} or an equivalent Hash.
211
+ #
212
+ # @param request [::Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest, ::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_persistent_resource(parent: nil, persistent_resource: nil, persistent_resource_id: nil)
219
+ # Pass arguments to `create_persistent_resource` 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
+ # PersistentResource in. Format: `projects/{project}/locations/{location}`
226
+ # @param persistent_resource [::Google::Cloud::AIPlatform::V1::PersistentResource, ::Hash]
227
+ # Required. The PersistentResource to create.
228
+ # @param persistent_resource_id [::String]
229
+ # Required. The ID to use for the PersistentResource, which become the final
230
+ # component of the PersistentResource's resource name.
231
+ #
232
+ # The maximum length is 63 characters, and valid characters
233
+ # are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`.
234
+ # @yield [result, operation] Access the result along with the TransportOperation object
235
+ # @yieldparam result [::Gapic::Operation]
236
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
237
+ #
238
+ # @return [::Gapic::Operation]
239
+ #
240
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
241
+ #
242
+ # @example Basic example
243
+ # require "google/cloud/ai_platform/v1"
244
+ #
245
+ # # Create a client object. The client can be reused for multiple calls.
246
+ # client = Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.new
247
+ #
248
+ # # Create a request. To set request fields, pass in keyword arguments.
249
+ # request = Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest.new
250
+ #
251
+ # # Call the create_persistent_resource method.
252
+ # result = client.create_persistent_resource request
253
+ #
254
+ # # The returned object is of type Gapic::Operation. You can use it to
255
+ # # check the status of an operation, cancel it, or wait for results.
256
+ # # Here is how to wait for a response.
257
+ # result.wait_until_done! timeout: 60
258
+ # if result.response?
259
+ # p result.response
260
+ # else
261
+ # puts "No response received."
262
+ # end
263
+ #
264
+ def create_persistent_resource request, options = nil
265
+ raise ::ArgumentError, "request must be provided" if request.nil?
266
+
267
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest
268
+
269
+ # Converts hash and nil to an options object
270
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
271
+
272
+ # Customize the options with defaults
273
+ call_metadata = @config.rpcs.create_persistent_resource.metadata.to_h
274
+
275
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
276
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
277
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
278
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
279
+ transports_version_send: [:rest]
280
+
281
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
282
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
283
+
284
+ options.apply_defaults timeout: @config.rpcs.create_persistent_resource.timeout,
285
+ metadata: call_metadata,
286
+ retry_policy: @config.rpcs.create_persistent_resource.retry_policy
287
+
288
+ options.apply_defaults timeout: @config.timeout,
289
+ metadata: @config.metadata,
290
+ retry_policy: @config.retry_policy
291
+
292
+ @persistent_resource_service_stub.create_persistent_resource request, options do |result, operation|
293
+ result = ::Gapic::Operation.new result, @operations_client, options: options
294
+ yield result, operation if block_given?
295
+ return result
296
+ end
297
+ rescue ::Gapic::Rest::Error => e
298
+ raise ::Google::Cloud::Error.from_error(e)
299
+ end
300
+
301
+ ##
302
+ # Gets a PersistentResource.
303
+ #
304
+ # @overload get_persistent_resource(request, options = nil)
305
+ # Pass arguments to `get_persistent_resource` via a request object, either of type
306
+ # {::Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest} or an equivalent Hash.
307
+ #
308
+ # @param request [::Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest, ::Hash]
309
+ # A request object representing the call parameters. Required. To specify no
310
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
311
+ # @param options [::Gapic::CallOptions, ::Hash]
312
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
313
+ #
314
+ # @overload get_persistent_resource(name: nil)
315
+ # Pass arguments to `get_persistent_resource` via keyword arguments. Note that at
316
+ # least one keyword argument is required. To specify no parameters, or to keep all
317
+ # the default parameter values, pass an empty Hash as a request object (see above).
318
+ #
319
+ # @param name [::String]
320
+ # Required. The name of the PersistentResource resource.
321
+ # Format:
322
+ # `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}`
323
+ # @yield [result, operation] Access the result along with the TransportOperation object
324
+ # @yieldparam result [::Google::Cloud::AIPlatform::V1::PersistentResource]
325
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
326
+ #
327
+ # @return [::Google::Cloud::AIPlatform::V1::PersistentResource]
328
+ #
329
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
330
+ #
331
+ # @example Basic example
332
+ # require "google/cloud/ai_platform/v1"
333
+ #
334
+ # # Create a client object. The client can be reused for multiple calls.
335
+ # client = Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.new
336
+ #
337
+ # # Create a request. To set request fields, pass in keyword arguments.
338
+ # request = Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest.new
339
+ #
340
+ # # Call the get_persistent_resource method.
341
+ # result = client.get_persistent_resource request
342
+ #
343
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::PersistentResource.
344
+ # p result
345
+ #
346
+ def get_persistent_resource request, options = nil
347
+ raise ::ArgumentError, "request must be provided" if request.nil?
348
+
349
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest
350
+
351
+ # Converts hash and nil to an options object
352
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
353
+
354
+ # Customize the options with defaults
355
+ call_metadata = @config.rpcs.get_persistent_resource.metadata.to_h
356
+
357
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
358
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
359
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
360
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
361
+ transports_version_send: [:rest]
362
+
363
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
364
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
365
+
366
+ options.apply_defaults timeout: @config.rpcs.get_persistent_resource.timeout,
367
+ metadata: call_metadata,
368
+ retry_policy: @config.rpcs.get_persistent_resource.retry_policy
369
+
370
+ options.apply_defaults timeout: @config.timeout,
371
+ metadata: @config.metadata,
372
+ retry_policy: @config.retry_policy
373
+
374
+ @persistent_resource_service_stub.get_persistent_resource request, options do |result, operation|
375
+ yield result, operation if block_given?
376
+ return result
377
+ end
378
+ rescue ::Gapic::Rest::Error => e
379
+ raise ::Google::Cloud::Error.from_error(e)
380
+ end
381
+
382
+ ##
383
+ # Lists PersistentResources in a Location.
384
+ #
385
+ # @overload list_persistent_resources(request, options = nil)
386
+ # Pass arguments to `list_persistent_resources` via a request object, either of type
387
+ # {::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest} or an equivalent Hash.
388
+ #
389
+ # @param request [::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest, ::Hash]
390
+ # A request object representing the call parameters. Required. To specify no
391
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
392
+ # @param options [::Gapic::CallOptions, ::Hash]
393
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
394
+ #
395
+ # @overload list_persistent_resources(parent: nil, page_size: nil, page_token: nil)
396
+ # Pass arguments to `list_persistent_resources` via keyword arguments. Note that at
397
+ # least one keyword argument is required. To specify no parameters, or to keep all
398
+ # the default parameter values, pass an empty Hash as a request object (see above).
399
+ #
400
+ # @param parent [::String]
401
+ # Required. The resource name of the Location to list the PersistentResources
402
+ # from. Format: `projects/{project}/locations/{location}`
403
+ # @param page_size [::Integer]
404
+ # Optional. The standard list page size.
405
+ # @param page_token [::String]
406
+ # Optional. The standard list page token.
407
+ # Typically obtained via
408
+ # [ListPersistentResourceResponse.next_page_token][] of the previous
409
+ # [PersistentResourceService.ListPersistentResource][] call.
410
+ # @yield [result, operation] Access the result along with the TransportOperation object
411
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::PersistentResource>]
412
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
413
+ #
414
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::PersistentResource>]
415
+ #
416
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
417
+ #
418
+ # @example Basic example
419
+ # require "google/cloud/ai_platform/v1"
420
+ #
421
+ # # Create a client object. The client can be reused for multiple calls.
422
+ # client = Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.new
423
+ #
424
+ # # Create a request. To set request fields, pass in keyword arguments.
425
+ # request = Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest.new
426
+ #
427
+ # # Call the list_persistent_resources method.
428
+ # result = client.list_persistent_resources request
429
+ #
430
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
431
+ # # over elements, and API calls will be issued to fetch pages as needed.
432
+ # result.each do |item|
433
+ # # Each element is of type ::Google::Cloud::AIPlatform::V1::PersistentResource.
434
+ # p item
435
+ # end
436
+ #
437
+ def list_persistent_resources request, options = nil
438
+ raise ::ArgumentError, "request must be provided" if request.nil?
439
+
440
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest
441
+
442
+ # Converts hash and nil to an options object
443
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
444
+
445
+ # Customize the options with defaults
446
+ call_metadata = @config.rpcs.list_persistent_resources.metadata.to_h
447
+
448
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
449
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
450
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
451
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
452
+ transports_version_send: [:rest]
453
+
454
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
455
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
456
+
457
+ options.apply_defaults timeout: @config.rpcs.list_persistent_resources.timeout,
458
+ metadata: call_metadata,
459
+ retry_policy: @config.rpcs.list_persistent_resources.retry_policy
460
+
461
+ options.apply_defaults timeout: @config.timeout,
462
+ metadata: @config.metadata,
463
+ retry_policy: @config.retry_policy
464
+
465
+ @persistent_resource_service_stub.list_persistent_resources request, options do |result, operation|
466
+ result = ::Gapic::Rest::PagedEnumerable.new @persistent_resource_service_stub, :list_persistent_resources, "persistent_resources", request, result, options
467
+ yield result, operation if block_given?
468
+ return result
469
+ end
470
+ rescue ::Gapic::Rest::Error => e
471
+ raise ::Google::Cloud::Error.from_error(e)
472
+ end
473
+
474
+ ##
475
+ # Deletes a PersistentResource.
476
+ #
477
+ # @overload delete_persistent_resource(request, options = nil)
478
+ # Pass arguments to `delete_persistent_resource` via a request object, either of type
479
+ # {::Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest} or an equivalent Hash.
480
+ #
481
+ # @param request [::Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest, ::Hash]
482
+ # A request object representing the call parameters. Required. To specify no
483
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
484
+ # @param options [::Gapic::CallOptions, ::Hash]
485
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
486
+ #
487
+ # @overload delete_persistent_resource(name: nil)
488
+ # Pass arguments to `delete_persistent_resource` via keyword arguments. Note that at
489
+ # least one keyword argument is required. To specify no parameters, or to keep all
490
+ # the default parameter values, pass an empty Hash as a request object (see above).
491
+ #
492
+ # @param name [::String]
493
+ # Required. The name of the PersistentResource to be deleted.
494
+ # Format:
495
+ # `projects/{project}/locations/{location}/persistentResources/{persistent_resource}`
496
+ # @yield [result, operation] Access the result along with the TransportOperation object
497
+ # @yieldparam result [::Gapic::Operation]
498
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
499
+ #
500
+ # @return [::Gapic::Operation]
501
+ #
502
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
503
+ #
504
+ # @example Basic example
505
+ # require "google/cloud/ai_platform/v1"
506
+ #
507
+ # # Create a client object. The client can be reused for multiple calls.
508
+ # client = Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.new
509
+ #
510
+ # # Create a request. To set request fields, pass in keyword arguments.
511
+ # request = Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest.new
512
+ #
513
+ # # Call the delete_persistent_resource method.
514
+ # result = client.delete_persistent_resource request
515
+ #
516
+ # # The returned object is of type Gapic::Operation. You can use it to
517
+ # # check the status of an operation, cancel it, or wait for results.
518
+ # # Here is how to wait for a response.
519
+ # result.wait_until_done! timeout: 60
520
+ # if result.response?
521
+ # p result.response
522
+ # else
523
+ # puts "No response received."
524
+ # end
525
+ #
526
+ def delete_persistent_resource request, options = nil
527
+ raise ::ArgumentError, "request must be provided" if request.nil?
528
+
529
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest
530
+
531
+ # Converts hash and nil to an options object
532
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
533
+
534
+ # Customize the options with defaults
535
+ call_metadata = @config.rpcs.delete_persistent_resource.metadata.to_h
536
+
537
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
538
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
539
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
540
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
541
+ transports_version_send: [:rest]
542
+
543
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
544
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
545
+
546
+ options.apply_defaults timeout: @config.rpcs.delete_persistent_resource.timeout,
547
+ metadata: call_metadata,
548
+ retry_policy: @config.rpcs.delete_persistent_resource.retry_policy
549
+
550
+ options.apply_defaults timeout: @config.timeout,
551
+ metadata: @config.metadata,
552
+ retry_policy: @config.retry_policy
553
+
554
+ @persistent_resource_service_stub.delete_persistent_resource request, options do |result, operation|
555
+ result = ::Gapic::Operation.new result, @operations_client, options: options
556
+ yield result, operation if block_given?
557
+ return result
558
+ end
559
+ rescue ::Gapic::Rest::Error => e
560
+ raise ::Google::Cloud::Error.from_error(e)
561
+ end
562
+
563
+ ##
564
+ # Updates a PersistentResource.
565
+ #
566
+ # @overload update_persistent_resource(request, options = nil)
567
+ # Pass arguments to `update_persistent_resource` via a request object, either of type
568
+ # {::Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest} or an equivalent Hash.
569
+ #
570
+ # @param request [::Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest, ::Hash]
571
+ # A request object representing the call parameters. Required. To specify no
572
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
573
+ # @param options [::Gapic::CallOptions, ::Hash]
574
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
575
+ #
576
+ # @overload update_persistent_resource(persistent_resource: nil, update_mask: nil)
577
+ # Pass arguments to `update_persistent_resource` via keyword arguments. Note that at
578
+ # least one keyword argument is required. To specify no parameters, or to keep all
579
+ # the default parameter values, pass an empty Hash as a request object (see above).
580
+ #
581
+ # @param persistent_resource [::Google::Cloud::AIPlatform::V1::PersistentResource, ::Hash]
582
+ # Required. The PersistentResource to update.
583
+ #
584
+ # The PersistentResource's `name` field is used to identify the
585
+ # PersistentResource to update. Format:
586
+ # `projects/{project}/locations/{location}/persistentResources/{persistent_resource}`
587
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
588
+ # Required. Specify the fields to be overwritten in the PersistentResource by
589
+ # the update method.
590
+ # @yield [result, operation] Access the result along with the TransportOperation object
591
+ # @yieldparam result [::Gapic::Operation]
592
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
593
+ #
594
+ # @return [::Gapic::Operation]
595
+ #
596
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
597
+ #
598
+ # @example Basic example
599
+ # require "google/cloud/ai_platform/v1"
600
+ #
601
+ # # Create a client object. The client can be reused for multiple calls.
602
+ # client = Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.new
603
+ #
604
+ # # Create a request. To set request fields, pass in keyword arguments.
605
+ # request = Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest.new
606
+ #
607
+ # # Call the update_persistent_resource method.
608
+ # result = client.update_persistent_resource request
609
+ #
610
+ # # The returned object is of type Gapic::Operation. You can use it to
611
+ # # check the status of an operation, cancel it, or wait for results.
612
+ # # Here is how to wait for a response.
613
+ # result.wait_until_done! timeout: 60
614
+ # if result.response?
615
+ # p result.response
616
+ # else
617
+ # puts "No response received."
618
+ # end
619
+ #
620
+ def update_persistent_resource request, options = nil
621
+ raise ::ArgumentError, "request must be provided" if request.nil?
622
+
623
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest
624
+
625
+ # Converts hash and nil to an options object
626
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
627
+
628
+ # Customize the options with defaults
629
+ call_metadata = @config.rpcs.update_persistent_resource.metadata.to_h
630
+
631
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
632
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
633
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
634
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
635
+ transports_version_send: [:rest]
636
+
637
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
638
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
639
+
640
+ options.apply_defaults timeout: @config.rpcs.update_persistent_resource.timeout,
641
+ metadata: call_metadata,
642
+ retry_policy: @config.rpcs.update_persistent_resource.retry_policy
643
+
644
+ options.apply_defaults timeout: @config.timeout,
645
+ metadata: @config.metadata,
646
+ retry_policy: @config.retry_policy
647
+
648
+ @persistent_resource_service_stub.update_persistent_resource request, options do |result, operation|
649
+ result = ::Gapic::Operation.new result, @operations_client, options: options
650
+ yield result, operation if block_given?
651
+ return result
652
+ end
653
+ rescue ::Gapic::Rest::Error => e
654
+ raise ::Google::Cloud::Error.from_error(e)
655
+ end
656
+
657
+ ##
658
+ # Reboots a PersistentResource.
659
+ #
660
+ # @overload reboot_persistent_resource(request, options = nil)
661
+ # Pass arguments to `reboot_persistent_resource` via a request object, either of type
662
+ # {::Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest} or an equivalent Hash.
663
+ #
664
+ # @param request [::Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest, ::Hash]
665
+ # A request object representing the call parameters. Required. To specify no
666
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
667
+ # @param options [::Gapic::CallOptions, ::Hash]
668
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
669
+ #
670
+ # @overload reboot_persistent_resource(name: nil)
671
+ # Pass arguments to `reboot_persistent_resource` via keyword arguments. Note that at
672
+ # least one keyword argument is required. To specify no parameters, or to keep all
673
+ # the default parameter values, pass an empty Hash as a request object (see above).
674
+ #
675
+ # @param name [::String]
676
+ # Required. The name of the PersistentResource resource.
677
+ # Format:
678
+ # `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}`
679
+ # @yield [result, operation] Access the result along with the TransportOperation object
680
+ # @yieldparam result [::Gapic::Operation]
681
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
682
+ #
683
+ # @return [::Gapic::Operation]
684
+ #
685
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
686
+ #
687
+ # @example Basic example
688
+ # require "google/cloud/ai_platform/v1"
689
+ #
690
+ # # Create a client object. The client can be reused for multiple calls.
691
+ # client = Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.new
692
+ #
693
+ # # Create a request. To set request fields, pass in keyword arguments.
694
+ # request = Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest.new
695
+ #
696
+ # # Call the reboot_persistent_resource method.
697
+ # result = client.reboot_persistent_resource request
698
+ #
699
+ # # The returned object is of type Gapic::Operation. You can use it to
700
+ # # check the status of an operation, cancel it, or wait for results.
701
+ # # Here is how to wait for a response.
702
+ # result.wait_until_done! timeout: 60
703
+ # if result.response?
704
+ # p result.response
705
+ # else
706
+ # puts "No response received."
707
+ # end
708
+ #
709
+ def reboot_persistent_resource request, options = nil
710
+ raise ::ArgumentError, "request must be provided" if request.nil?
711
+
712
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest
713
+
714
+ # Converts hash and nil to an options object
715
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
716
+
717
+ # Customize the options with defaults
718
+ call_metadata = @config.rpcs.reboot_persistent_resource.metadata.to_h
719
+
720
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
721
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
722
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
723
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
724
+ transports_version_send: [:rest]
725
+
726
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
727
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
728
+
729
+ options.apply_defaults timeout: @config.rpcs.reboot_persistent_resource.timeout,
730
+ metadata: call_metadata,
731
+ retry_policy: @config.rpcs.reboot_persistent_resource.retry_policy
732
+
733
+ options.apply_defaults timeout: @config.timeout,
734
+ metadata: @config.metadata,
735
+ retry_policy: @config.retry_policy
736
+
737
+ @persistent_resource_service_stub.reboot_persistent_resource request, options do |result, operation|
738
+ result = ::Gapic::Operation.new result, @operations_client, options: options
739
+ yield result, operation if block_given?
740
+ return result
741
+ end
742
+ rescue ::Gapic::Rest::Error => e
743
+ raise ::Google::Cloud::Error.from_error(e)
744
+ end
745
+
746
+ ##
747
+ # Configuration class for the PersistentResourceService REST API.
748
+ #
749
+ # This class represents the configuration for PersistentResourceService REST,
750
+ # providing control over timeouts, retry behavior, logging, transport
751
+ # parameters, and other low-level controls. Certain parameters can also be
752
+ # applied individually to specific RPCs. See
753
+ # {::Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client::Configuration::Rpcs}
754
+ # for a list of RPCs that can be configured independently.
755
+ #
756
+ # Configuration can be applied globally to all clients, or to a single client
757
+ # on construction.
758
+ #
759
+ # @example
760
+ #
761
+ # # Modify the global config, setting the timeout for
762
+ # # create_persistent_resource to 20 seconds,
763
+ # # and all remaining timeouts to 10 seconds.
764
+ # ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.configure do |config|
765
+ # config.timeout = 10.0
766
+ # config.rpcs.create_persistent_resource.timeout = 20.0
767
+ # end
768
+ #
769
+ # # Apply the above configuration only to a new client.
770
+ # client = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.new do |config|
771
+ # config.timeout = 10.0
772
+ # config.rpcs.create_persistent_resource.timeout = 20.0
773
+ # end
774
+ #
775
+ # @!attribute [rw] endpoint
776
+ # A custom service endpoint, as a hostname or hostname:port. The default is
777
+ # nil, indicating to use the default endpoint in the current universe domain.
778
+ # @return [::String,nil]
779
+ # @!attribute [rw] credentials
780
+ # Credentials to send with calls. You may provide any of the following types:
781
+ # * (`String`) The path to a service account key file in JSON format
782
+ # * (`Hash`) A service account key as a Hash
783
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
784
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
785
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
786
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
787
+ # * (`nil`) indicating no credentials
788
+ # @return [::Object]
789
+ # @!attribute [rw] scope
790
+ # The OAuth scopes
791
+ # @return [::Array<::String>]
792
+ # @!attribute [rw] lib_name
793
+ # The library name as recorded in instrumentation and logging
794
+ # @return [::String]
795
+ # @!attribute [rw] lib_version
796
+ # The library version as recorded in instrumentation and logging
797
+ # @return [::String]
798
+ # @!attribute [rw] timeout
799
+ # The call timeout in seconds.
800
+ # @return [::Numeric]
801
+ # @!attribute [rw] metadata
802
+ # Additional headers to be sent with the call.
803
+ # @return [::Hash{::Symbol=>::String}]
804
+ # @!attribute [rw] retry_policy
805
+ # The retry policy. The value is a hash with the following keys:
806
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
807
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
808
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
809
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
810
+ # trigger a retry.
811
+ # @return [::Hash]
812
+ # @!attribute [rw] quota_project
813
+ # A separate project against which to charge quota.
814
+ # @return [::String]
815
+ # @!attribute [rw] universe_domain
816
+ # The universe domain within which to make requests. This determines the
817
+ # default endpoint URL. The default value of nil uses the environment
818
+ # universe (usually the default "googleapis.com" universe).
819
+ # @return [::String,nil]
820
+ #
821
+ class Configuration
822
+ extend ::Gapic::Config
823
+
824
+ # @private
825
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
826
+ DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
827
+
828
+ config_attr :endpoint, nil, ::String, nil
829
+ config_attr :credentials, nil do |value|
830
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
831
+ allowed.any? { |klass| klass === value }
832
+ end
833
+ config_attr :scope, nil, ::String, ::Array, nil
834
+ config_attr :lib_name, nil, ::String, nil
835
+ config_attr :lib_version, nil, ::String, nil
836
+ config_attr :timeout, nil, ::Numeric, nil
837
+ config_attr :metadata, nil, ::Hash, nil
838
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
839
+ config_attr :quota_project, nil, ::String, nil
840
+ config_attr :universe_domain, nil, ::String, nil
841
+
842
+ # @private
843
+ # Overrides for http bindings for the RPCs of this service
844
+ # are only used when this service is used as mixin, and only
845
+ # by the host service.
846
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
847
+ config_attr :bindings_override, {}, ::Hash, nil
848
+
849
+ # @private
850
+ def initialize parent_config = nil
851
+ @parent_config = parent_config unless parent_config.nil?
852
+
853
+ yield self if block_given?
854
+ end
855
+
856
+ ##
857
+ # Configurations for individual RPCs
858
+ # @return [Rpcs]
859
+ #
860
+ def rpcs
861
+ @rpcs ||= begin
862
+ parent_rpcs = nil
863
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
864
+ Rpcs.new parent_rpcs
865
+ end
866
+ end
867
+
868
+ ##
869
+ # Configuration RPC class for the PersistentResourceService API.
870
+ #
871
+ # Includes fields providing the configuration for each RPC in this service.
872
+ # Each configuration object is of type `Gapic::Config::Method` and includes
873
+ # the following configuration fields:
874
+ #
875
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
876
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
877
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
878
+ # include the following keys:
879
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
880
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
881
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
882
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
883
+ # trigger a retry.
884
+ #
885
+ class Rpcs
886
+ ##
887
+ # RPC-specific configuration for `create_persistent_resource`
888
+ # @return [::Gapic::Config::Method]
889
+ #
890
+ attr_reader :create_persistent_resource
891
+ ##
892
+ # RPC-specific configuration for `get_persistent_resource`
893
+ # @return [::Gapic::Config::Method]
894
+ #
895
+ attr_reader :get_persistent_resource
896
+ ##
897
+ # RPC-specific configuration for `list_persistent_resources`
898
+ # @return [::Gapic::Config::Method]
899
+ #
900
+ attr_reader :list_persistent_resources
901
+ ##
902
+ # RPC-specific configuration for `delete_persistent_resource`
903
+ # @return [::Gapic::Config::Method]
904
+ #
905
+ attr_reader :delete_persistent_resource
906
+ ##
907
+ # RPC-specific configuration for `update_persistent_resource`
908
+ # @return [::Gapic::Config::Method]
909
+ #
910
+ attr_reader :update_persistent_resource
911
+ ##
912
+ # RPC-specific configuration for `reboot_persistent_resource`
913
+ # @return [::Gapic::Config::Method]
914
+ #
915
+ attr_reader :reboot_persistent_resource
916
+
917
+ # @private
918
+ def initialize parent_rpcs = nil
919
+ create_persistent_resource_config = parent_rpcs.create_persistent_resource if parent_rpcs.respond_to? :create_persistent_resource
920
+ @create_persistent_resource = ::Gapic::Config::Method.new create_persistent_resource_config
921
+ get_persistent_resource_config = parent_rpcs.get_persistent_resource if parent_rpcs.respond_to? :get_persistent_resource
922
+ @get_persistent_resource = ::Gapic::Config::Method.new get_persistent_resource_config
923
+ list_persistent_resources_config = parent_rpcs.list_persistent_resources if parent_rpcs.respond_to? :list_persistent_resources
924
+ @list_persistent_resources = ::Gapic::Config::Method.new list_persistent_resources_config
925
+ delete_persistent_resource_config = parent_rpcs.delete_persistent_resource if parent_rpcs.respond_to? :delete_persistent_resource
926
+ @delete_persistent_resource = ::Gapic::Config::Method.new delete_persistent_resource_config
927
+ update_persistent_resource_config = parent_rpcs.update_persistent_resource if parent_rpcs.respond_to? :update_persistent_resource
928
+ @update_persistent_resource = ::Gapic::Config::Method.new update_persistent_resource_config
929
+ reboot_persistent_resource_config = parent_rpcs.reboot_persistent_resource if parent_rpcs.respond_to? :reboot_persistent_resource
930
+ @reboot_persistent_resource = ::Gapic::Config::Method.new reboot_persistent_resource_config
931
+
932
+ yield self if block_given?
933
+ end
934
+ end
935
+ end
936
+ end
937
+ end
938
+ end
939
+ end
940
+ end
941
+ end
942
+ end