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,1034 @@
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/index_service_pb"
21
+ require "google/cloud/ai_platform/v1/index_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 IndexService
30
+ module Rest
31
+ ##
32
+ # REST client for the IndexService service.
33
+ #
34
+ # A service for creating and managing Vertex AI's Index resources.
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 :index_service_stub
47
+
48
+ ##
49
+ # Configure the IndexService Client class.
50
+ #
51
+ # See {::Google::Cloud::AIPlatform::V1::IndexService::Rest::Client::Configuration}
52
+ # for a description of the configuration fields.
53
+ #
54
+ # @example
55
+ #
56
+ # # Modify the configuration for all IndexService clients
57
+ # ::Google::Cloud::AIPlatform::V1::IndexService::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 IndexService 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::IndexService::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
+ @index_service_stub.universe_domain
110
+ end
111
+
112
+ ##
113
+ # Create a new IndexService REST client object.
114
+ #
115
+ # @example
116
+ #
117
+ # # Create a client using the default configuration
118
+ # client = ::Google::Cloud::AIPlatform::V1::IndexService::Rest::Client.new
119
+ #
120
+ # # Create a client using a custom configuration
121
+ # client = ::Google::Cloud::AIPlatform::V1::IndexService::Rest::Client.new do |config|
122
+ # config.timeout = 10.0
123
+ # end
124
+ #
125
+ # @yield [config] Configure the IndexService 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::IndexService::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
+ @index_service_stub = ::Google::Cloud::AIPlatform::V1::IndexService::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 = @index_service_stub.endpoint
169
+ config.universe_domain = @index_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 = @index_service_stub.endpoint
177
+ config.universe_domain = @index_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::IndexService::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 an Index.
207
+ #
208
+ # @overload create_index(request, options = nil)
209
+ # Pass arguments to `create_index` via a request object, either of type
210
+ # {::Google::Cloud::AIPlatform::V1::CreateIndexRequest} or an equivalent Hash.
211
+ #
212
+ # @param request [::Google::Cloud::AIPlatform::V1::CreateIndexRequest, ::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_index(parent: nil, index: nil)
219
+ # Pass arguments to `create_index` 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 Index in.
225
+ # Format: `projects/{project}/locations/{location}`
226
+ # @param index [::Google::Cloud::AIPlatform::V1::Index, ::Hash]
227
+ # Required. The Index to create.
228
+ # @yield [result, operation] Access the result along with the TransportOperation object
229
+ # @yieldparam result [::Gapic::Operation]
230
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
231
+ #
232
+ # @return [::Gapic::Operation]
233
+ #
234
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
235
+ #
236
+ # @example Basic example
237
+ # require "google/cloud/ai_platform/v1"
238
+ #
239
+ # # Create a client object. The client can be reused for multiple calls.
240
+ # client = Google::Cloud::AIPlatform::V1::IndexService::Rest::Client.new
241
+ #
242
+ # # Create a request. To set request fields, pass in keyword arguments.
243
+ # request = Google::Cloud::AIPlatform::V1::CreateIndexRequest.new
244
+ #
245
+ # # Call the create_index method.
246
+ # result = client.create_index request
247
+ #
248
+ # # The returned object is of type Gapic::Operation. You can use it to
249
+ # # check the status of an operation, cancel it, or wait for results.
250
+ # # Here is how to wait for a response.
251
+ # result.wait_until_done! timeout: 60
252
+ # if result.response?
253
+ # p result.response
254
+ # else
255
+ # puts "No response received."
256
+ # end
257
+ #
258
+ def create_index request, options = nil
259
+ raise ::ArgumentError, "request must be provided" if request.nil?
260
+
261
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateIndexRequest
262
+
263
+ # Converts hash and nil to an options object
264
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
265
+
266
+ # Customize the options with defaults
267
+ call_metadata = @config.rpcs.create_index.metadata.to_h
268
+
269
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
270
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
271
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
272
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
273
+ transports_version_send: [:rest]
274
+
275
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
276
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
277
+
278
+ options.apply_defaults timeout: @config.rpcs.create_index.timeout,
279
+ metadata: call_metadata,
280
+ retry_policy: @config.rpcs.create_index.retry_policy
281
+
282
+ options.apply_defaults timeout: @config.timeout,
283
+ metadata: @config.metadata,
284
+ retry_policy: @config.retry_policy
285
+
286
+ @index_service_stub.create_index request, options do |result, operation|
287
+ result = ::Gapic::Operation.new result, @operations_client, options: options
288
+ yield result, operation if block_given?
289
+ return result
290
+ end
291
+ rescue ::Gapic::Rest::Error => e
292
+ raise ::Google::Cloud::Error.from_error(e)
293
+ end
294
+
295
+ ##
296
+ # Gets an Index.
297
+ #
298
+ # @overload get_index(request, options = nil)
299
+ # Pass arguments to `get_index` via a request object, either of type
300
+ # {::Google::Cloud::AIPlatform::V1::GetIndexRequest} or an equivalent Hash.
301
+ #
302
+ # @param request [::Google::Cloud::AIPlatform::V1::GetIndexRequest, ::Hash]
303
+ # A request object representing the call parameters. Required. To specify no
304
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
305
+ # @param options [::Gapic::CallOptions, ::Hash]
306
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
307
+ #
308
+ # @overload get_index(name: nil)
309
+ # Pass arguments to `get_index` via keyword arguments. Note that at
310
+ # least one keyword argument is required. To specify no parameters, or to keep all
311
+ # the default parameter values, pass an empty Hash as a request object (see above).
312
+ #
313
+ # @param name [::String]
314
+ # Required. The name of the Index resource.
315
+ # Format:
316
+ # `projects/{project}/locations/{location}/indexes/{index}`
317
+ # @yield [result, operation] Access the result along with the TransportOperation object
318
+ # @yieldparam result [::Google::Cloud::AIPlatform::V1::Index]
319
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
320
+ #
321
+ # @return [::Google::Cloud::AIPlatform::V1::Index]
322
+ #
323
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
324
+ #
325
+ # @example Basic example
326
+ # require "google/cloud/ai_platform/v1"
327
+ #
328
+ # # Create a client object. The client can be reused for multiple calls.
329
+ # client = Google::Cloud::AIPlatform::V1::IndexService::Rest::Client.new
330
+ #
331
+ # # Create a request. To set request fields, pass in keyword arguments.
332
+ # request = Google::Cloud::AIPlatform::V1::GetIndexRequest.new
333
+ #
334
+ # # Call the get_index method.
335
+ # result = client.get_index request
336
+ #
337
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::Index.
338
+ # p result
339
+ #
340
+ def get_index request, options = nil
341
+ raise ::ArgumentError, "request must be provided" if request.nil?
342
+
343
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetIndexRequest
344
+
345
+ # Converts hash and nil to an options object
346
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
347
+
348
+ # Customize the options with defaults
349
+ call_metadata = @config.rpcs.get_index.metadata.to_h
350
+
351
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
352
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
353
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
354
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
355
+ transports_version_send: [:rest]
356
+
357
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
358
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
359
+
360
+ options.apply_defaults timeout: @config.rpcs.get_index.timeout,
361
+ metadata: call_metadata,
362
+ retry_policy: @config.rpcs.get_index.retry_policy
363
+
364
+ options.apply_defaults timeout: @config.timeout,
365
+ metadata: @config.metadata,
366
+ retry_policy: @config.retry_policy
367
+
368
+ @index_service_stub.get_index request, options do |result, operation|
369
+ yield result, operation if block_given?
370
+ return result
371
+ end
372
+ rescue ::Gapic::Rest::Error => e
373
+ raise ::Google::Cloud::Error.from_error(e)
374
+ end
375
+
376
+ ##
377
+ # Lists Indexes in a Location.
378
+ #
379
+ # @overload list_indexes(request, options = nil)
380
+ # Pass arguments to `list_indexes` via a request object, either of type
381
+ # {::Google::Cloud::AIPlatform::V1::ListIndexesRequest} or an equivalent Hash.
382
+ #
383
+ # @param request [::Google::Cloud::AIPlatform::V1::ListIndexesRequest, ::Hash]
384
+ # A request object representing the call parameters. Required. To specify no
385
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
386
+ # @param options [::Gapic::CallOptions, ::Hash]
387
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
388
+ #
389
+ # @overload list_indexes(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil)
390
+ # Pass arguments to `list_indexes` via keyword arguments. Note that at
391
+ # least one keyword argument is required. To specify no parameters, or to keep all
392
+ # the default parameter values, pass an empty Hash as a request object (see above).
393
+ #
394
+ # @param parent [::String]
395
+ # Required. The resource name of the Location from which to list the Indexes.
396
+ # Format: `projects/{project}/locations/{location}`
397
+ # @param filter [::String]
398
+ # The standard list filter.
399
+ # @param page_size [::Integer]
400
+ # The standard list page size.
401
+ # @param page_token [::String]
402
+ # The standard list page token.
403
+ # Typically obtained via
404
+ # {::Google::Cloud::AIPlatform::V1::ListIndexesResponse#next_page_token ListIndexesResponse.next_page_token}
405
+ # of the previous
406
+ # {::Google::Cloud::AIPlatform::V1::IndexService::Rest::Client#list_indexes IndexService.ListIndexes}
407
+ # call.
408
+ # @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
409
+ # Mask specifying which fields to read.
410
+ # @yield [result, operation] Access the result along with the TransportOperation object
411
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Index>]
412
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
413
+ #
414
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Index>]
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::IndexService::Rest::Client.new
423
+ #
424
+ # # Create a request. To set request fields, pass in keyword arguments.
425
+ # request = Google::Cloud::AIPlatform::V1::ListIndexesRequest.new
426
+ #
427
+ # # Call the list_indexes method.
428
+ # result = client.list_indexes 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::Index.
434
+ # p item
435
+ # end
436
+ #
437
+ def list_indexes 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::ListIndexesRequest
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_indexes.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_indexes.timeout,
458
+ metadata: call_metadata,
459
+ retry_policy: @config.rpcs.list_indexes.retry_policy
460
+
461
+ options.apply_defaults timeout: @config.timeout,
462
+ metadata: @config.metadata,
463
+ retry_policy: @config.retry_policy
464
+
465
+ @index_service_stub.list_indexes request, options do |result, operation|
466
+ result = ::Gapic::Rest::PagedEnumerable.new @index_service_stub, :list_indexes, "indexes", 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
+ # Updates an Index.
476
+ #
477
+ # @overload update_index(request, options = nil)
478
+ # Pass arguments to `update_index` via a request object, either of type
479
+ # {::Google::Cloud::AIPlatform::V1::UpdateIndexRequest} or an equivalent Hash.
480
+ #
481
+ # @param request [::Google::Cloud::AIPlatform::V1::UpdateIndexRequest, ::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 update_index(index: nil, update_mask: nil)
488
+ # Pass arguments to `update_index` 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 index [::Google::Cloud::AIPlatform::V1::Index, ::Hash]
493
+ # Required. The Index which updates the resource on the server.
494
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
495
+ # The update mask applies to the resource.
496
+ # For the `FieldMask` definition, see
497
+ # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}.
498
+ # @yield [result, operation] Access the result along with the TransportOperation object
499
+ # @yieldparam result [::Gapic::Operation]
500
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
501
+ #
502
+ # @return [::Gapic::Operation]
503
+ #
504
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
505
+ #
506
+ # @example Basic example
507
+ # require "google/cloud/ai_platform/v1"
508
+ #
509
+ # # Create a client object. The client can be reused for multiple calls.
510
+ # client = Google::Cloud::AIPlatform::V1::IndexService::Rest::Client.new
511
+ #
512
+ # # Create a request. To set request fields, pass in keyword arguments.
513
+ # request = Google::Cloud::AIPlatform::V1::UpdateIndexRequest.new
514
+ #
515
+ # # Call the update_index method.
516
+ # result = client.update_index request
517
+ #
518
+ # # The returned object is of type Gapic::Operation. You can use it to
519
+ # # check the status of an operation, cancel it, or wait for results.
520
+ # # Here is how to wait for a response.
521
+ # result.wait_until_done! timeout: 60
522
+ # if result.response?
523
+ # p result.response
524
+ # else
525
+ # puts "No response received."
526
+ # end
527
+ #
528
+ def update_index request, options = nil
529
+ raise ::ArgumentError, "request must be provided" if request.nil?
530
+
531
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateIndexRequest
532
+
533
+ # Converts hash and nil to an options object
534
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
535
+
536
+ # Customize the options with defaults
537
+ call_metadata = @config.rpcs.update_index.metadata.to_h
538
+
539
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
540
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
541
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
542
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
543
+ transports_version_send: [:rest]
544
+
545
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
546
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
547
+
548
+ options.apply_defaults timeout: @config.rpcs.update_index.timeout,
549
+ metadata: call_metadata,
550
+ retry_policy: @config.rpcs.update_index.retry_policy
551
+
552
+ options.apply_defaults timeout: @config.timeout,
553
+ metadata: @config.metadata,
554
+ retry_policy: @config.retry_policy
555
+
556
+ @index_service_stub.update_index request, options do |result, operation|
557
+ result = ::Gapic::Operation.new result, @operations_client, options: options
558
+ yield result, operation if block_given?
559
+ return result
560
+ end
561
+ rescue ::Gapic::Rest::Error => e
562
+ raise ::Google::Cloud::Error.from_error(e)
563
+ end
564
+
565
+ ##
566
+ # Deletes an Index.
567
+ # An Index can only be deleted when all its
568
+ # {::Google::Cloud::AIPlatform::V1::Index#deployed_indexes DeployedIndexes} had
569
+ # been undeployed.
570
+ #
571
+ # @overload delete_index(request, options = nil)
572
+ # Pass arguments to `delete_index` via a request object, either of type
573
+ # {::Google::Cloud::AIPlatform::V1::DeleteIndexRequest} or an equivalent Hash.
574
+ #
575
+ # @param request [::Google::Cloud::AIPlatform::V1::DeleteIndexRequest, ::Hash]
576
+ # A request object representing the call parameters. Required. To specify no
577
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
578
+ # @param options [::Gapic::CallOptions, ::Hash]
579
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
580
+ #
581
+ # @overload delete_index(name: nil)
582
+ # Pass arguments to `delete_index` via keyword arguments. Note that at
583
+ # least one keyword argument is required. To specify no parameters, or to keep all
584
+ # the default parameter values, pass an empty Hash as a request object (see above).
585
+ #
586
+ # @param name [::String]
587
+ # Required. The name of the Index resource to be deleted.
588
+ # Format:
589
+ # `projects/{project}/locations/{location}/indexes/{index}`
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::IndexService::Rest::Client.new
603
+ #
604
+ # # Create a request. To set request fields, pass in keyword arguments.
605
+ # request = Google::Cloud::AIPlatform::V1::DeleteIndexRequest.new
606
+ #
607
+ # # Call the delete_index method.
608
+ # result = client.delete_index 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 delete_index 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::DeleteIndexRequest
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.delete_index.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.delete_index.timeout,
641
+ metadata: call_metadata,
642
+ retry_policy: @config.rpcs.delete_index.retry_policy
643
+
644
+ options.apply_defaults timeout: @config.timeout,
645
+ metadata: @config.metadata,
646
+ retry_policy: @config.retry_policy
647
+
648
+ @index_service_stub.delete_index 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
+ # Add/update Datapoints into an Index.
659
+ #
660
+ # @overload upsert_datapoints(request, options = nil)
661
+ # Pass arguments to `upsert_datapoints` via a request object, either of type
662
+ # {::Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest} or an equivalent Hash.
663
+ #
664
+ # @param request [::Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest, ::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 upsert_datapoints(index: nil, datapoints: nil, update_mask: nil)
671
+ # Pass arguments to `upsert_datapoints` 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 index [::String]
676
+ # Required. The name of the Index resource to be updated.
677
+ # Format:
678
+ # `projects/{project}/locations/{location}/indexes/{index}`
679
+ # @param datapoints [::Array<::Google::Cloud::AIPlatform::V1::IndexDatapoint, ::Hash>]
680
+ # A list of datapoints to be created/updated.
681
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
682
+ # Optional. Update mask is used to specify the fields to be overwritten in
683
+ # the datapoints by the update. The fields specified in the update_mask are
684
+ # relative to each IndexDatapoint inside datapoints, not the full request.
685
+ #
686
+ # Updatable fields:
687
+ #
688
+ # * Use `all_restricts` to update both restricts and numeric_restricts.
689
+ # @yield [result, operation] Access the result along with the TransportOperation object
690
+ # @yieldparam result [::Google::Cloud::AIPlatform::V1::UpsertDatapointsResponse]
691
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
692
+ #
693
+ # @return [::Google::Cloud::AIPlatform::V1::UpsertDatapointsResponse]
694
+ #
695
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
696
+ #
697
+ # @example Basic example
698
+ # require "google/cloud/ai_platform/v1"
699
+ #
700
+ # # Create a client object. The client can be reused for multiple calls.
701
+ # client = Google::Cloud::AIPlatform::V1::IndexService::Rest::Client.new
702
+ #
703
+ # # Create a request. To set request fields, pass in keyword arguments.
704
+ # request = Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest.new
705
+ #
706
+ # # Call the upsert_datapoints method.
707
+ # result = client.upsert_datapoints request
708
+ #
709
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::UpsertDatapointsResponse.
710
+ # p result
711
+ #
712
+ def upsert_datapoints request, options = nil
713
+ raise ::ArgumentError, "request must be provided" if request.nil?
714
+
715
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest
716
+
717
+ # Converts hash and nil to an options object
718
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
719
+
720
+ # Customize the options with defaults
721
+ call_metadata = @config.rpcs.upsert_datapoints.metadata.to_h
722
+
723
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
724
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
725
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
726
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
727
+ transports_version_send: [:rest]
728
+
729
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
730
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
731
+
732
+ options.apply_defaults timeout: @config.rpcs.upsert_datapoints.timeout,
733
+ metadata: call_metadata,
734
+ retry_policy: @config.rpcs.upsert_datapoints.retry_policy
735
+
736
+ options.apply_defaults timeout: @config.timeout,
737
+ metadata: @config.metadata,
738
+ retry_policy: @config.retry_policy
739
+
740
+ @index_service_stub.upsert_datapoints request, options do |result, operation|
741
+ yield result, operation if block_given?
742
+ return result
743
+ end
744
+ rescue ::Gapic::Rest::Error => e
745
+ raise ::Google::Cloud::Error.from_error(e)
746
+ end
747
+
748
+ ##
749
+ # Remove Datapoints from an Index.
750
+ #
751
+ # @overload remove_datapoints(request, options = nil)
752
+ # Pass arguments to `remove_datapoints` via a request object, either of type
753
+ # {::Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest} or an equivalent Hash.
754
+ #
755
+ # @param request [::Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest, ::Hash]
756
+ # A request object representing the call parameters. Required. To specify no
757
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
758
+ # @param options [::Gapic::CallOptions, ::Hash]
759
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
760
+ #
761
+ # @overload remove_datapoints(index: nil, datapoint_ids: nil)
762
+ # Pass arguments to `remove_datapoints` via keyword arguments. Note that at
763
+ # least one keyword argument is required. To specify no parameters, or to keep all
764
+ # the default parameter values, pass an empty Hash as a request object (see above).
765
+ #
766
+ # @param index [::String]
767
+ # Required. The name of the Index resource to be updated.
768
+ # Format:
769
+ # `projects/{project}/locations/{location}/indexes/{index}`
770
+ # @param datapoint_ids [::Array<::String>]
771
+ # A list of datapoint ids to be deleted.
772
+ # @yield [result, operation] Access the result along with the TransportOperation object
773
+ # @yieldparam result [::Google::Cloud::AIPlatform::V1::RemoveDatapointsResponse]
774
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
775
+ #
776
+ # @return [::Google::Cloud::AIPlatform::V1::RemoveDatapointsResponse]
777
+ #
778
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
779
+ #
780
+ # @example Basic example
781
+ # require "google/cloud/ai_platform/v1"
782
+ #
783
+ # # Create a client object. The client can be reused for multiple calls.
784
+ # client = Google::Cloud::AIPlatform::V1::IndexService::Rest::Client.new
785
+ #
786
+ # # Create a request. To set request fields, pass in keyword arguments.
787
+ # request = Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest.new
788
+ #
789
+ # # Call the remove_datapoints method.
790
+ # result = client.remove_datapoints request
791
+ #
792
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::RemoveDatapointsResponse.
793
+ # p result
794
+ #
795
+ def remove_datapoints request, options = nil
796
+ raise ::ArgumentError, "request must be provided" if request.nil?
797
+
798
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest
799
+
800
+ # Converts hash and nil to an options object
801
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
802
+
803
+ # Customize the options with defaults
804
+ call_metadata = @config.rpcs.remove_datapoints.metadata.to_h
805
+
806
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
807
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
808
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
809
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
810
+ transports_version_send: [:rest]
811
+
812
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
813
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
814
+
815
+ options.apply_defaults timeout: @config.rpcs.remove_datapoints.timeout,
816
+ metadata: call_metadata,
817
+ retry_policy: @config.rpcs.remove_datapoints.retry_policy
818
+
819
+ options.apply_defaults timeout: @config.timeout,
820
+ metadata: @config.metadata,
821
+ retry_policy: @config.retry_policy
822
+
823
+ @index_service_stub.remove_datapoints request, options do |result, operation|
824
+ yield result, operation if block_given?
825
+ return result
826
+ end
827
+ rescue ::Gapic::Rest::Error => e
828
+ raise ::Google::Cloud::Error.from_error(e)
829
+ end
830
+
831
+ ##
832
+ # Configuration class for the IndexService REST API.
833
+ #
834
+ # This class represents the configuration for IndexService REST,
835
+ # providing control over timeouts, retry behavior, logging, transport
836
+ # parameters, and other low-level controls. Certain parameters can also be
837
+ # applied individually to specific RPCs. See
838
+ # {::Google::Cloud::AIPlatform::V1::IndexService::Rest::Client::Configuration::Rpcs}
839
+ # for a list of RPCs that can be configured independently.
840
+ #
841
+ # Configuration can be applied globally to all clients, or to a single client
842
+ # on construction.
843
+ #
844
+ # @example
845
+ #
846
+ # # Modify the global config, setting the timeout for
847
+ # # create_index to 20 seconds,
848
+ # # and all remaining timeouts to 10 seconds.
849
+ # ::Google::Cloud::AIPlatform::V1::IndexService::Rest::Client.configure do |config|
850
+ # config.timeout = 10.0
851
+ # config.rpcs.create_index.timeout = 20.0
852
+ # end
853
+ #
854
+ # # Apply the above configuration only to a new client.
855
+ # client = ::Google::Cloud::AIPlatform::V1::IndexService::Rest::Client.new do |config|
856
+ # config.timeout = 10.0
857
+ # config.rpcs.create_index.timeout = 20.0
858
+ # end
859
+ #
860
+ # @!attribute [rw] endpoint
861
+ # A custom service endpoint, as a hostname or hostname:port. The default is
862
+ # nil, indicating to use the default endpoint in the current universe domain.
863
+ # @return [::String,nil]
864
+ # @!attribute [rw] credentials
865
+ # Credentials to send with calls. You may provide any of the following types:
866
+ # * (`String`) The path to a service account key file in JSON format
867
+ # * (`Hash`) A service account key as a Hash
868
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
869
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
870
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
871
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
872
+ # * (`nil`) indicating no credentials
873
+ # @return [::Object]
874
+ # @!attribute [rw] scope
875
+ # The OAuth scopes
876
+ # @return [::Array<::String>]
877
+ # @!attribute [rw] lib_name
878
+ # The library name as recorded in instrumentation and logging
879
+ # @return [::String]
880
+ # @!attribute [rw] lib_version
881
+ # The library version as recorded in instrumentation and logging
882
+ # @return [::String]
883
+ # @!attribute [rw] timeout
884
+ # The call timeout in seconds.
885
+ # @return [::Numeric]
886
+ # @!attribute [rw] metadata
887
+ # Additional headers to be sent with the call.
888
+ # @return [::Hash{::Symbol=>::String}]
889
+ # @!attribute [rw] retry_policy
890
+ # The retry policy. The value is a hash with the following keys:
891
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
892
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
893
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
894
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
895
+ # trigger a retry.
896
+ # @return [::Hash]
897
+ # @!attribute [rw] quota_project
898
+ # A separate project against which to charge quota.
899
+ # @return [::String]
900
+ # @!attribute [rw] universe_domain
901
+ # The universe domain within which to make requests. This determines the
902
+ # default endpoint URL. The default value of nil uses the environment
903
+ # universe (usually the default "googleapis.com" universe).
904
+ # @return [::String,nil]
905
+ #
906
+ class Configuration
907
+ extend ::Gapic::Config
908
+
909
+ # @private
910
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
911
+ DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
912
+
913
+ config_attr :endpoint, nil, ::String, nil
914
+ config_attr :credentials, nil do |value|
915
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
916
+ allowed.any? { |klass| klass === value }
917
+ end
918
+ config_attr :scope, nil, ::String, ::Array, nil
919
+ config_attr :lib_name, nil, ::String, nil
920
+ config_attr :lib_version, nil, ::String, nil
921
+ config_attr :timeout, nil, ::Numeric, nil
922
+ config_attr :metadata, nil, ::Hash, nil
923
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
924
+ config_attr :quota_project, nil, ::String, nil
925
+ config_attr :universe_domain, nil, ::String, nil
926
+
927
+ # @private
928
+ # Overrides for http bindings for the RPCs of this service
929
+ # are only used when this service is used as mixin, and only
930
+ # by the host service.
931
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
932
+ config_attr :bindings_override, {}, ::Hash, nil
933
+
934
+ # @private
935
+ def initialize parent_config = nil
936
+ @parent_config = parent_config unless parent_config.nil?
937
+
938
+ yield self if block_given?
939
+ end
940
+
941
+ ##
942
+ # Configurations for individual RPCs
943
+ # @return [Rpcs]
944
+ #
945
+ def rpcs
946
+ @rpcs ||= begin
947
+ parent_rpcs = nil
948
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
949
+ Rpcs.new parent_rpcs
950
+ end
951
+ end
952
+
953
+ ##
954
+ # Configuration RPC class for the IndexService API.
955
+ #
956
+ # Includes fields providing the configuration for each RPC in this service.
957
+ # Each configuration object is of type `Gapic::Config::Method` and includes
958
+ # the following configuration fields:
959
+ #
960
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
961
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
962
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
963
+ # include the following keys:
964
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
965
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
966
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
967
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
968
+ # trigger a retry.
969
+ #
970
+ class Rpcs
971
+ ##
972
+ # RPC-specific configuration for `create_index`
973
+ # @return [::Gapic::Config::Method]
974
+ #
975
+ attr_reader :create_index
976
+ ##
977
+ # RPC-specific configuration for `get_index`
978
+ # @return [::Gapic::Config::Method]
979
+ #
980
+ attr_reader :get_index
981
+ ##
982
+ # RPC-specific configuration for `list_indexes`
983
+ # @return [::Gapic::Config::Method]
984
+ #
985
+ attr_reader :list_indexes
986
+ ##
987
+ # RPC-specific configuration for `update_index`
988
+ # @return [::Gapic::Config::Method]
989
+ #
990
+ attr_reader :update_index
991
+ ##
992
+ # RPC-specific configuration for `delete_index`
993
+ # @return [::Gapic::Config::Method]
994
+ #
995
+ attr_reader :delete_index
996
+ ##
997
+ # RPC-specific configuration for `upsert_datapoints`
998
+ # @return [::Gapic::Config::Method]
999
+ #
1000
+ attr_reader :upsert_datapoints
1001
+ ##
1002
+ # RPC-specific configuration for `remove_datapoints`
1003
+ # @return [::Gapic::Config::Method]
1004
+ #
1005
+ attr_reader :remove_datapoints
1006
+
1007
+ # @private
1008
+ def initialize parent_rpcs = nil
1009
+ create_index_config = parent_rpcs.create_index if parent_rpcs.respond_to? :create_index
1010
+ @create_index = ::Gapic::Config::Method.new create_index_config
1011
+ get_index_config = parent_rpcs.get_index if parent_rpcs.respond_to? :get_index
1012
+ @get_index = ::Gapic::Config::Method.new get_index_config
1013
+ list_indexes_config = parent_rpcs.list_indexes if parent_rpcs.respond_to? :list_indexes
1014
+ @list_indexes = ::Gapic::Config::Method.new list_indexes_config
1015
+ update_index_config = parent_rpcs.update_index if parent_rpcs.respond_to? :update_index
1016
+ @update_index = ::Gapic::Config::Method.new update_index_config
1017
+ delete_index_config = parent_rpcs.delete_index if parent_rpcs.respond_to? :delete_index
1018
+ @delete_index = ::Gapic::Config::Method.new delete_index_config
1019
+ upsert_datapoints_config = parent_rpcs.upsert_datapoints if parent_rpcs.respond_to? :upsert_datapoints
1020
+ @upsert_datapoints = ::Gapic::Config::Method.new upsert_datapoints_config
1021
+ remove_datapoints_config = parent_rpcs.remove_datapoints if parent_rpcs.respond_to? :remove_datapoints
1022
+ @remove_datapoints = ::Gapic::Config::Method.new remove_datapoints_config
1023
+
1024
+ yield self if block_given?
1025
+ end
1026
+ end
1027
+ end
1028
+ end
1029
+ end
1030
+ end
1031
+ end
1032
+ end
1033
+ end
1034
+ end