google-cloud-ai_platform-v1 0.39.0 → 0.41.0

Sign up to get free protection for your applications and to get access to all the features.
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,1788 @@
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/vizier_service_pb"
21
+ require "google/cloud/ai_platform/v1/vizier_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 VizierService
30
+ module Rest
31
+ ##
32
+ # REST client for the VizierService service.
33
+ #
34
+ # Vertex AI Vizier API.
35
+ #
36
+ # Vertex AI Vizier is a service to solve blackbox optimization problems,
37
+ # such as tuning machine learning hyperparameters and searching over deep
38
+ # learning architectures.
39
+ #
40
+ class Client
41
+ # @private
42
+ API_VERSION = ""
43
+
44
+ # @private
45
+ DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$"
46
+
47
+ include Paths
48
+
49
+ # @private
50
+ attr_reader :vizier_service_stub
51
+
52
+ ##
53
+ # Configure the VizierService Client class.
54
+ #
55
+ # See {::Google::Cloud::AIPlatform::V1::VizierService::Rest::Client::Configuration}
56
+ # for a description of the configuration fields.
57
+ #
58
+ # @example
59
+ #
60
+ # # Modify the configuration for all VizierService clients
61
+ # ::Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.configure do |config|
62
+ # config.timeout = 10.0
63
+ # end
64
+ #
65
+ # @yield [config] Configure the Client client.
66
+ # @yieldparam config [Client::Configuration]
67
+ #
68
+ # @return [Client::Configuration]
69
+ #
70
+ def self.configure
71
+ @configure ||= begin
72
+ namespace = ["Google", "Cloud", "AIPlatform", "V1"]
73
+ parent_config = while namespace.any?
74
+ parent_name = namespace.join "::"
75
+ parent_const = const_get parent_name
76
+ break parent_const.configure if parent_const.respond_to? :configure
77
+ namespace.pop
78
+ end
79
+ default_config = Client::Configuration.new parent_config
80
+
81
+ default_config
82
+ end
83
+ yield @configure if block_given?
84
+ @configure
85
+ end
86
+
87
+ ##
88
+ # Configure the VizierService Client instance.
89
+ #
90
+ # The configuration is set to the derived mode, meaning that values can be changed,
91
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
92
+ # should be made on {Client.configure}.
93
+ #
94
+ # See {::Google::Cloud::AIPlatform::V1::VizierService::Rest::Client::Configuration}
95
+ # for a description of the configuration fields.
96
+ #
97
+ # @yield [config] Configure the Client client.
98
+ # @yieldparam config [Client::Configuration]
99
+ #
100
+ # @return [Client::Configuration]
101
+ #
102
+ def configure
103
+ yield @config if block_given?
104
+ @config
105
+ end
106
+
107
+ ##
108
+ # The effective universe domain
109
+ #
110
+ # @return [String]
111
+ #
112
+ def universe_domain
113
+ @vizier_service_stub.universe_domain
114
+ end
115
+
116
+ ##
117
+ # Create a new VizierService REST client object.
118
+ #
119
+ # @example
120
+ #
121
+ # # Create a client using the default configuration
122
+ # client = ::Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
123
+ #
124
+ # # Create a client using a custom configuration
125
+ # client = ::Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new do |config|
126
+ # config.timeout = 10.0
127
+ # end
128
+ #
129
+ # @yield [config] Configure the VizierService client.
130
+ # @yieldparam config [Client::Configuration]
131
+ #
132
+ def initialize
133
+ # Create the configuration object
134
+ @config = Configuration.new Client.configure
135
+
136
+ # Yield the configuration if needed
137
+ yield @config if block_given?
138
+
139
+ # Create credentials
140
+ credentials = @config.credentials
141
+ # Use self-signed JWT if the endpoint is unchanged from default,
142
+ # but only if the default endpoint does not have a region prefix.
143
+ enable_self_signed_jwt = @config.endpoint.nil? ||
144
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
+ !@config.endpoint.split(".").first.include?("-"))
146
+ credentials ||= Credentials.default scope: @config.scope,
147
+ enable_self_signed_jwt: enable_self_signed_jwt
148
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
149
+ credentials = Credentials.new credentials, scope: @config.scope
150
+ end
151
+
152
+ @quota_project_id = @config.quota_project
153
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
154
+
155
+ @operations_client = ::Google::Cloud::AIPlatform::V1::VizierService::Rest::Operations.new do |config|
156
+ config.credentials = credentials
157
+ config.quota_project = @quota_project_id
158
+ config.endpoint = @config.endpoint
159
+ config.universe_domain = @config.universe_domain
160
+ end
161
+
162
+ @vizier_service_stub = ::Google::Cloud::AIPlatform::V1::VizierService::Rest::ServiceStub.new(
163
+ endpoint: @config.endpoint,
164
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
165
+ universe_domain: @config.universe_domain,
166
+ credentials: credentials
167
+ )
168
+
169
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
170
+ config.credentials = credentials
171
+ config.quota_project = @quota_project_id
172
+ config.endpoint = @vizier_service_stub.endpoint
173
+ config.universe_domain = @vizier_service_stub.universe_domain
174
+ config.bindings_override = @config.bindings_override
175
+ end
176
+
177
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
178
+ config.credentials = credentials
179
+ config.quota_project = @quota_project_id
180
+ config.endpoint = @vizier_service_stub.endpoint
181
+ config.universe_domain = @vizier_service_stub.universe_domain
182
+ config.bindings_override = @config.bindings_override
183
+ end
184
+ end
185
+
186
+ ##
187
+ # Get the associated client for long-running operations.
188
+ #
189
+ # @return [::Google::Cloud::AIPlatform::V1::VizierService::Rest::Operations]
190
+ #
191
+ attr_reader :operations_client
192
+
193
+ ##
194
+ # Get the associated client for mix-in of the Locations.
195
+ #
196
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
197
+ #
198
+ attr_reader :location_client
199
+
200
+ ##
201
+ # Get the associated client for mix-in of the IAMPolicy.
202
+ #
203
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
204
+ #
205
+ attr_reader :iam_policy_client
206
+
207
+ # Service calls
208
+
209
+ ##
210
+ # Creates a Study. A resource name will be generated after creation of the
211
+ # Study.
212
+ #
213
+ # @overload create_study(request, options = nil)
214
+ # Pass arguments to `create_study` via a request object, either of type
215
+ # {::Google::Cloud::AIPlatform::V1::CreateStudyRequest} or an equivalent Hash.
216
+ #
217
+ # @param request [::Google::Cloud::AIPlatform::V1::CreateStudyRequest, ::Hash]
218
+ # A request object representing the call parameters. Required. To specify no
219
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
220
+ # @param options [::Gapic::CallOptions, ::Hash]
221
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
222
+ #
223
+ # @overload create_study(parent: nil, study: nil)
224
+ # Pass arguments to `create_study` via keyword arguments. Note that at
225
+ # least one keyword argument is required. To specify no parameters, or to keep all
226
+ # the default parameter values, pass an empty Hash as a request object (see above).
227
+ #
228
+ # @param parent [::String]
229
+ # Required. The resource name of the Location to create the CustomJob in.
230
+ # Format: `projects/{project}/locations/{location}`
231
+ # @param study [::Google::Cloud::AIPlatform::V1::Study, ::Hash]
232
+ # Required. The Study configuration used to create the Study.
233
+ # @yield [result, operation] Access the result along with the TransportOperation object
234
+ # @yieldparam result [::Google::Cloud::AIPlatform::V1::Study]
235
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
236
+ #
237
+ # @return [::Google::Cloud::AIPlatform::V1::Study]
238
+ #
239
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
240
+ #
241
+ # @example Basic example
242
+ # require "google/cloud/ai_platform/v1"
243
+ #
244
+ # # Create a client object. The client can be reused for multiple calls.
245
+ # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
246
+ #
247
+ # # Create a request. To set request fields, pass in keyword arguments.
248
+ # request = Google::Cloud::AIPlatform::V1::CreateStudyRequest.new
249
+ #
250
+ # # Call the create_study method.
251
+ # result = client.create_study request
252
+ #
253
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::Study.
254
+ # p result
255
+ #
256
+ def create_study request, options = nil
257
+ raise ::ArgumentError, "request must be provided" if request.nil?
258
+
259
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateStudyRequest
260
+
261
+ # Converts hash and nil to an options object
262
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
263
+
264
+ # Customize the options with defaults
265
+ call_metadata = @config.rpcs.create_study.metadata.to_h
266
+
267
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
268
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
269
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
270
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
271
+ transports_version_send: [:rest]
272
+
273
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
274
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
275
+
276
+ options.apply_defaults timeout: @config.rpcs.create_study.timeout,
277
+ metadata: call_metadata,
278
+ retry_policy: @config.rpcs.create_study.retry_policy
279
+
280
+ options.apply_defaults timeout: @config.timeout,
281
+ metadata: @config.metadata,
282
+ retry_policy: @config.retry_policy
283
+
284
+ @vizier_service_stub.create_study request, options do |result, operation|
285
+ yield result, operation if block_given?
286
+ return result
287
+ end
288
+ rescue ::Gapic::Rest::Error => e
289
+ raise ::Google::Cloud::Error.from_error(e)
290
+ end
291
+
292
+ ##
293
+ # Gets a Study by name.
294
+ #
295
+ # @overload get_study(request, options = nil)
296
+ # Pass arguments to `get_study` via a request object, either of type
297
+ # {::Google::Cloud::AIPlatform::V1::GetStudyRequest} or an equivalent Hash.
298
+ #
299
+ # @param request [::Google::Cloud::AIPlatform::V1::GetStudyRequest, ::Hash]
300
+ # A request object representing the call parameters. Required. To specify no
301
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
302
+ # @param options [::Gapic::CallOptions, ::Hash]
303
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
304
+ #
305
+ # @overload get_study(name: nil)
306
+ # Pass arguments to `get_study` via keyword arguments. Note that at
307
+ # least one keyword argument is required. To specify no parameters, or to keep all
308
+ # the default parameter values, pass an empty Hash as a request object (see above).
309
+ #
310
+ # @param name [::String]
311
+ # Required. The name of the Study resource.
312
+ # Format: `projects/{project}/locations/{location}/studies/{study}`
313
+ # @yield [result, operation] Access the result along with the TransportOperation object
314
+ # @yieldparam result [::Google::Cloud::AIPlatform::V1::Study]
315
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
316
+ #
317
+ # @return [::Google::Cloud::AIPlatform::V1::Study]
318
+ #
319
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
320
+ #
321
+ # @example Basic example
322
+ # require "google/cloud/ai_platform/v1"
323
+ #
324
+ # # Create a client object. The client can be reused for multiple calls.
325
+ # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
326
+ #
327
+ # # Create a request. To set request fields, pass in keyword arguments.
328
+ # request = Google::Cloud::AIPlatform::V1::GetStudyRequest.new
329
+ #
330
+ # # Call the get_study method.
331
+ # result = client.get_study request
332
+ #
333
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::Study.
334
+ # p result
335
+ #
336
+ def get_study request, options = nil
337
+ raise ::ArgumentError, "request must be provided" if request.nil?
338
+
339
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetStudyRequest
340
+
341
+ # Converts hash and nil to an options object
342
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
343
+
344
+ # Customize the options with defaults
345
+ call_metadata = @config.rpcs.get_study.metadata.to_h
346
+
347
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
348
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
349
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
350
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
351
+ transports_version_send: [:rest]
352
+
353
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
354
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
355
+
356
+ options.apply_defaults timeout: @config.rpcs.get_study.timeout,
357
+ metadata: call_metadata,
358
+ retry_policy: @config.rpcs.get_study.retry_policy
359
+
360
+ options.apply_defaults timeout: @config.timeout,
361
+ metadata: @config.metadata,
362
+ retry_policy: @config.retry_policy
363
+
364
+ @vizier_service_stub.get_study request, options do |result, operation|
365
+ yield result, operation if block_given?
366
+ return result
367
+ end
368
+ rescue ::Gapic::Rest::Error => e
369
+ raise ::Google::Cloud::Error.from_error(e)
370
+ end
371
+
372
+ ##
373
+ # Lists all the studies in a region for an associated project.
374
+ #
375
+ # @overload list_studies(request, options = nil)
376
+ # Pass arguments to `list_studies` via a request object, either of type
377
+ # {::Google::Cloud::AIPlatform::V1::ListStudiesRequest} or an equivalent Hash.
378
+ #
379
+ # @param request [::Google::Cloud::AIPlatform::V1::ListStudiesRequest, ::Hash]
380
+ # A request object representing the call parameters. Required. To specify no
381
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
382
+ # @param options [::Gapic::CallOptions, ::Hash]
383
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
384
+ #
385
+ # @overload list_studies(parent: nil, page_token: nil, page_size: nil)
386
+ # Pass arguments to `list_studies` via keyword arguments. Note that at
387
+ # least one keyword argument is required. To specify no parameters, or to keep all
388
+ # the default parameter values, pass an empty Hash as a request object (see above).
389
+ #
390
+ # @param parent [::String]
391
+ # Required. The resource name of the Location to list the Study from.
392
+ # Format: `projects/{project}/locations/{location}`
393
+ # @param page_token [::String]
394
+ # Optional. A page token to request the next page of results.
395
+ # If unspecified, there are no subsequent pages.
396
+ # @param page_size [::Integer]
397
+ # Optional. The maximum number of studies to return per "page" of results.
398
+ # If unspecified, service will pick an appropriate default.
399
+ # @yield [result, operation] Access the result along with the TransportOperation object
400
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Study>]
401
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
402
+ #
403
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Study>]
404
+ #
405
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
406
+ #
407
+ # @example Basic example
408
+ # require "google/cloud/ai_platform/v1"
409
+ #
410
+ # # Create a client object. The client can be reused for multiple calls.
411
+ # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
412
+ #
413
+ # # Create a request. To set request fields, pass in keyword arguments.
414
+ # request = Google::Cloud::AIPlatform::V1::ListStudiesRequest.new
415
+ #
416
+ # # Call the list_studies method.
417
+ # result = client.list_studies request
418
+ #
419
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
420
+ # # over elements, and API calls will be issued to fetch pages as needed.
421
+ # result.each do |item|
422
+ # # Each element is of type ::Google::Cloud::AIPlatform::V1::Study.
423
+ # p item
424
+ # end
425
+ #
426
+ def list_studies request, options = nil
427
+ raise ::ArgumentError, "request must be provided" if request.nil?
428
+
429
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListStudiesRequest
430
+
431
+ # Converts hash and nil to an options object
432
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
433
+
434
+ # Customize the options with defaults
435
+ call_metadata = @config.rpcs.list_studies.metadata.to_h
436
+
437
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
438
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
439
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
440
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
441
+ transports_version_send: [:rest]
442
+
443
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
444
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
445
+
446
+ options.apply_defaults timeout: @config.rpcs.list_studies.timeout,
447
+ metadata: call_metadata,
448
+ retry_policy: @config.rpcs.list_studies.retry_policy
449
+
450
+ options.apply_defaults timeout: @config.timeout,
451
+ metadata: @config.metadata,
452
+ retry_policy: @config.retry_policy
453
+
454
+ @vizier_service_stub.list_studies request, options do |result, operation|
455
+ result = ::Gapic::Rest::PagedEnumerable.new @vizier_service_stub, :list_studies, "studies", request, result, options
456
+ yield result, operation if block_given?
457
+ return result
458
+ end
459
+ rescue ::Gapic::Rest::Error => e
460
+ raise ::Google::Cloud::Error.from_error(e)
461
+ end
462
+
463
+ ##
464
+ # Deletes a Study.
465
+ #
466
+ # @overload delete_study(request, options = nil)
467
+ # Pass arguments to `delete_study` via a request object, either of type
468
+ # {::Google::Cloud::AIPlatform::V1::DeleteStudyRequest} or an equivalent Hash.
469
+ #
470
+ # @param request [::Google::Cloud::AIPlatform::V1::DeleteStudyRequest, ::Hash]
471
+ # A request object representing the call parameters. Required. To specify no
472
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
473
+ # @param options [::Gapic::CallOptions, ::Hash]
474
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
475
+ #
476
+ # @overload delete_study(name: nil)
477
+ # Pass arguments to `delete_study` via keyword arguments. Note that at
478
+ # least one keyword argument is required. To specify no parameters, or to keep all
479
+ # the default parameter values, pass an empty Hash as a request object (see above).
480
+ #
481
+ # @param name [::String]
482
+ # Required. The name of the Study resource to be deleted.
483
+ # Format: `projects/{project}/locations/{location}/studies/{study}`
484
+ # @yield [result, operation] Access the result along with the TransportOperation object
485
+ # @yieldparam result [::Google::Protobuf::Empty]
486
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
487
+ #
488
+ # @return [::Google::Protobuf::Empty]
489
+ #
490
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
491
+ #
492
+ # @example Basic example
493
+ # require "google/cloud/ai_platform/v1"
494
+ #
495
+ # # Create a client object. The client can be reused for multiple calls.
496
+ # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
497
+ #
498
+ # # Create a request. To set request fields, pass in keyword arguments.
499
+ # request = Google::Cloud::AIPlatform::V1::DeleteStudyRequest.new
500
+ #
501
+ # # Call the delete_study method.
502
+ # result = client.delete_study request
503
+ #
504
+ # # The returned object is of type Google::Protobuf::Empty.
505
+ # p result
506
+ #
507
+ def delete_study request, options = nil
508
+ raise ::ArgumentError, "request must be provided" if request.nil?
509
+
510
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteStudyRequest
511
+
512
+ # Converts hash and nil to an options object
513
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
514
+
515
+ # Customize the options with defaults
516
+ call_metadata = @config.rpcs.delete_study.metadata.to_h
517
+
518
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
519
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
520
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
521
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
522
+ transports_version_send: [:rest]
523
+
524
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
525
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
526
+
527
+ options.apply_defaults timeout: @config.rpcs.delete_study.timeout,
528
+ metadata: call_metadata,
529
+ retry_policy: @config.rpcs.delete_study.retry_policy
530
+
531
+ options.apply_defaults timeout: @config.timeout,
532
+ metadata: @config.metadata,
533
+ retry_policy: @config.retry_policy
534
+
535
+ @vizier_service_stub.delete_study request, options do |result, operation|
536
+ yield result, operation if block_given?
537
+ return result
538
+ end
539
+ rescue ::Gapic::Rest::Error => e
540
+ raise ::Google::Cloud::Error.from_error(e)
541
+ end
542
+
543
+ ##
544
+ # Looks a study up using the user-defined display_name field instead of the
545
+ # fully qualified resource name.
546
+ #
547
+ # @overload lookup_study(request, options = nil)
548
+ # Pass arguments to `lookup_study` via a request object, either of type
549
+ # {::Google::Cloud::AIPlatform::V1::LookupStudyRequest} or an equivalent Hash.
550
+ #
551
+ # @param request [::Google::Cloud::AIPlatform::V1::LookupStudyRequest, ::Hash]
552
+ # A request object representing the call parameters. Required. To specify no
553
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
554
+ # @param options [::Gapic::CallOptions, ::Hash]
555
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
556
+ #
557
+ # @overload lookup_study(parent: nil, display_name: nil)
558
+ # Pass arguments to `lookup_study` via keyword arguments. Note that at
559
+ # least one keyword argument is required. To specify no parameters, or to keep all
560
+ # the default parameter values, pass an empty Hash as a request object (see above).
561
+ #
562
+ # @param parent [::String]
563
+ # Required. The resource name of the Location to get the Study from.
564
+ # Format: `projects/{project}/locations/{location}`
565
+ # @param display_name [::String]
566
+ # Required. The user-defined display name of the Study
567
+ # @yield [result, operation] Access the result along with the TransportOperation object
568
+ # @yieldparam result [::Google::Cloud::AIPlatform::V1::Study]
569
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
570
+ #
571
+ # @return [::Google::Cloud::AIPlatform::V1::Study]
572
+ #
573
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
574
+ #
575
+ # @example Basic example
576
+ # require "google/cloud/ai_platform/v1"
577
+ #
578
+ # # Create a client object. The client can be reused for multiple calls.
579
+ # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
580
+ #
581
+ # # Create a request. To set request fields, pass in keyword arguments.
582
+ # request = Google::Cloud::AIPlatform::V1::LookupStudyRequest.new
583
+ #
584
+ # # Call the lookup_study method.
585
+ # result = client.lookup_study request
586
+ #
587
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::Study.
588
+ # p result
589
+ #
590
+ def lookup_study request, options = nil
591
+ raise ::ArgumentError, "request must be provided" if request.nil?
592
+
593
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::LookupStudyRequest
594
+
595
+ # Converts hash and nil to an options object
596
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
597
+
598
+ # Customize the options with defaults
599
+ call_metadata = @config.rpcs.lookup_study.metadata.to_h
600
+
601
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
602
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
603
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
604
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
605
+ transports_version_send: [:rest]
606
+
607
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
608
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
609
+
610
+ options.apply_defaults timeout: @config.rpcs.lookup_study.timeout,
611
+ metadata: call_metadata,
612
+ retry_policy: @config.rpcs.lookup_study.retry_policy
613
+
614
+ options.apply_defaults timeout: @config.timeout,
615
+ metadata: @config.metadata,
616
+ retry_policy: @config.retry_policy
617
+
618
+ @vizier_service_stub.lookup_study request, options do |result, operation|
619
+ yield result, operation if block_given?
620
+ return result
621
+ end
622
+ rescue ::Gapic::Rest::Error => e
623
+ raise ::Google::Cloud::Error.from_error(e)
624
+ end
625
+
626
+ ##
627
+ # Adds one or more Trials to a Study, with parameter values
628
+ # suggested by Vertex AI Vizier. Returns a long-running
629
+ # operation associated with the generation of Trial suggestions.
630
+ # When this long-running operation succeeds, it will contain
631
+ # a
632
+ # {::Google::Cloud::AIPlatform::V1::SuggestTrialsResponse SuggestTrialsResponse}.
633
+ #
634
+ # @overload suggest_trials(request, options = nil)
635
+ # Pass arguments to `suggest_trials` via a request object, either of type
636
+ # {::Google::Cloud::AIPlatform::V1::SuggestTrialsRequest} or an equivalent Hash.
637
+ #
638
+ # @param request [::Google::Cloud::AIPlatform::V1::SuggestTrialsRequest, ::Hash]
639
+ # A request object representing the call parameters. Required. To specify no
640
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
641
+ # @param options [::Gapic::CallOptions, ::Hash]
642
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
643
+ #
644
+ # @overload suggest_trials(parent: nil, suggestion_count: nil, client_id: nil, contexts: nil)
645
+ # Pass arguments to `suggest_trials` via keyword arguments. Note that at
646
+ # least one keyword argument is required. To specify no parameters, or to keep all
647
+ # the default parameter values, pass an empty Hash as a request object (see above).
648
+ #
649
+ # @param parent [::String]
650
+ # Required. The project and location that the Study belongs to.
651
+ # Format: `projects/{project}/locations/{location}/studies/{study}`
652
+ # @param suggestion_count [::Integer]
653
+ # Required. The number of suggestions requested. It must be positive.
654
+ # @param client_id [::String]
655
+ # Required. The identifier of the client that is requesting the suggestion.
656
+ #
657
+ # If multiple SuggestTrialsRequests have the same `client_id`,
658
+ # the service will return the identical suggested Trial if the Trial is
659
+ # pending, and provide a new Trial if the last suggested Trial was completed.
660
+ # @param contexts [::Array<::Google::Cloud::AIPlatform::V1::TrialContext, ::Hash>]
661
+ # Optional. This allows you to specify the "context" for a Trial; a context
662
+ # is a slice (a subspace) of the search space.
663
+ #
664
+ # Typical uses for contexts:
665
+ # 1) You are using Vizier to tune a server for best performance, but there's
666
+ # a strong weekly cycle. The context specifies the day-of-week.
667
+ # This allows Tuesday to generalize from Wednesday without assuming that
668
+ # everything is identical.
669
+ # 2) Imagine you're optimizing some medical treatment for people.
670
+ # As they walk in the door, you know certain facts about them
671
+ # (e.g. sex, weight, height, blood-pressure). Put that information in the
672
+ # context, and Vizier will adapt its suggestions to the patient.
673
+ # 3) You want to do a fair A/B test efficiently. Specify the "A" and "B"
674
+ # conditions as contexts, and Vizier will generalize between "A" and "B"
675
+ # conditions. If they are similar, this will allow Vizier to converge
676
+ # to the optimum faster than if "A" and "B" were separate Studies.
677
+ # NOTE: You can also enter contexts as REQUESTED Trials, e.g. via the
678
+ # CreateTrial() RPC; that's the asynchronous option where you don't need a
679
+ # close association between contexts and suggestions.
680
+ #
681
+ # NOTE: All the Parameters you set in a context MUST be defined in the
682
+ # Study.
683
+ # NOTE: You must supply 0 or $suggestion_count contexts.
684
+ # If you don't supply any contexts, Vizier will make suggestions
685
+ # from the full search space specified in the StudySpec; if you supply
686
+ # a full set of context, each suggestion will match the corresponding
687
+ # context.
688
+ # NOTE: A Context with no features set matches anything, and allows
689
+ # suggestions from the full search space.
690
+ # NOTE: Contexts MUST lie within the search space specified in the
691
+ # StudySpec. It's an error if they don't.
692
+ # NOTE: Contexts preferentially match ACTIVE then REQUESTED trials before
693
+ # new suggestions are generated.
694
+ # NOTE: Generation of suggestions involves a match between a Context and
695
+ # (optionally) a REQUESTED trial; if that match is not fully specified, a
696
+ # suggestion will be geneated in the merged subspace.
697
+ # @yield [result, operation] Access the result along with the TransportOperation object
698
+ # @yieldparam result [::Gapic::Operation]
699
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
700
+ #
701
+ # @return [::Gapic::Operation]
702
+ #
703
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
704
+ #
705
+ # @example Basic example
706
+ # require "google/cloud/ai_platform/v1"
707
+ #
708
+ # # Create a client object. The client can be reused for multiple calls.
709
+ # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
710
+ #
711
+ # # Create a request. To set request fields, pass in keyword arguments.
712
+ # request = Google::Cloud::AIPlatform::V1::SuggestTrialsRequest.new
713
+ #
714
+ # # Call the suggest_trials method.
715
+ # result = client.suggest_trials request
716
+ #
717
+ # # The returned object is of type Gapic::Operation. You can use it to
718
+ # # check the status of an operation, cancel it, or wait for results.
719
+ # # Here is how to wait for a response.
720
+ # result.wait_until_done! timeout: 60
721
+ # if result.response?
722
+ # p result.response
723
+ # else
724
+ # puts "No response received."
725
+ # end
726
+ #
727
+ def suggest_trials request, options = nil
728
+ raise ::ArgumentError, "request must be provided" if request.nil?
729
+
730
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SuggestTrialsRequest
731
+
732
+ # Converts hash and nil to an options object
733
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
734
+
735
+ # Customize the options with defaults
736
+ call_metadata = @config.rpcs.suggest_trials.metadata.to_h
737
+
738
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
739
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
740
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
741
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
742
+ transports_version_send: [:rest]
743
+
744
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
745
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
746
+
747
+ options.apply_defaults timeout: @config.rpcs.suggest_trials.timeout,
748
+ metadata: call_metadata,
749
+ retry_policy: @config.rpcs.suggest_trials.retry_policy
750
+
751
+ options.apply_defaults timeout: @config.timeout,
752
+ metadata: @config.metadata,
753
+ retry_policy: @config.retry_policy
754
+
755
+ @vizier_service_stub.suggest_trials request, options do |result, operation|
756
+ result = ::Gapic::Operation.new result, @operations_client, options: options
757
+ yield result, operation if block_given?
758
+ return result
759
+ end
760
+ rescue ::Gapic::Rest::Error => e
761
+ raise ::Google::Cloud::Error.from_error(e)
762
+ end
763
+
764
+ ##
765
+ # Adds a user provided Trial to a Study.
766
+ #
767
+ # @overload create_trial(request, options = nil)
768
+ # Pass arguments to `create_trial` via a request object, either of type
769
+ # {::Google::Cloud::AIPlatform::V1::CreateTrialRequest} or an equivalent Hash.
770
+ #
771
+ # @param request [::Google::Cloud::AIPlatform::V1::CreateTrialRequest, ::Hash]
772
+ # A request object representing the call parameters. Required. To specify no
773
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
774
+ # @param options [::Gapic::CallOptions, ::Hash]
775
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
776
+ #
777
+ # @overload create_trial(parent: nil, trial: nil)
778
+ # Pass arguments to `create_trial` via keyword arguments. Note that at
779
+ # least one keyword argument is required. To specify no parameters, or to keep all
780
+ # the default parameter values, pass an empty Hash as a request object (see above).
781
+ #
782
+ # @param parent [::String]
783
+ # Required. The resource name of the Study to create the Trial in.
784
+ # Format: `projects/{project}/locations/{location}/studies/{study}`
785
+ # @param trial [::Google::Cloud::AIPlatform::V1::Trial, ::Hash]
786
+ # Required. The Trial to create.
787
+ # @yield [result, operation] Access the result along with the TransportOperation object
788
+ # @yieldparam result [::Google::Cloud::AIPlatform::V1::Trial]
789
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
790
+ #
791
+ # @return [::Google::Cloud::AIPlatform::V1::Trial]
792
+ #
793
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
794
+ #
795
+ # @example Basic example
796
+ # require "google/cloud/ai_platform/v1"
797
+ #
798
+ # # Create a client object. The client can be reused for multiple calls.
799
+ # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
800
+ #
801
+ # # Create a request. To set request fields, pass in keyword arguments.
802
+ # request = Google::Cloud::AIPlatform::V1::CreateTrialRequest.new
803
+ #
804
+ # # Call the create_trial method.
805
+ # result = client.create_trial request
806
+ #
807
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::Trial.
808
+ # p result
809
+ #
810
+ def create_trial request, options = nil
811
+ raise ::ArgumentError, "request must be provided" if request.nil?
812
+
813
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTrialRequest
814
+
815
+ # Converts hash and nil to an options object
816
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
817
+
818
+ # Customize the options with defaults
819
+ call_metadata = @config.rpcs.create_trial.metadata.to_h
820
+
821
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
822
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
823
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
824
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
825
+ transports_version_send: [:rest]
826
+
827
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
828
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
829
+
830
+ options.apply_defaults timeout: @config.rpcs.create_trial.timeout,
831
+ metadata: call_metadata,
832
+ retry_policy: @config.rpcs.create_trial.retry_policy
833
+
834
+ options.apply_defaults timeout: @config.timeout,
835
+ metadata: @config.metadata,
836
+ retry_policy: @config.retry_policy
837
+
838
+ @vizier_service_stub.create_trial request, options do |result, operation|
839
+ yield result, operation if block_given?
840
+ return result
841
+ end
842
+ rescue ::Gapic::Rest::Error => e
843
+ raise ::Google::Cloud::Error.from_error(e)
844
+ end
845
+
846
+ ##
847
+ # Gets a Trial.
848
+ #
849
+ # @overload get_trial(request, options = nil)
850
+ # Pass arguments to `get_trial` via a request object, either of type
851
+ # {::Google::Cloud::AIPlatform::V1::GetTrialRequest} or an equivalent Hash.
852
+ #
853
+ # @param request [::Google::Cloud::AIPlatform::V1::GetTrialRequest, ::Hash]
854
+ # A request object representing the call parameters. Required. To specify no
855
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
856
+ # @param options [::Gapic::CallOptions, ::Hash]
857
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
858
+ #
859
+ # @overload get_trial(name: nil)
860
+ # Pass arguments to `get_trial` via keyword arguments. Note that at
861
+ # least one keyword argument is required. To specify no parameters, or to keep all
862
+ # the default parameter values, pass an empty Hash as a request object (see above).
863
+ #
864
+ # @param name [::String]
865
+ # Required. The name of the Trial resource.
866
+ # Format:
867
+ # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
868
+ # @yield [result, operation] Access the result along with the TransportOperation object
869
+ # @yieldparam result [::Google::Cloud::AIPlatform::V1::Trial]
870
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
871
+ #
872
+ # @return [::Google::Cloud::AIPlatform::V1::Trial]
873
+ #
874
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
875
+ #
876
+ # @example Basic example
877
+ # require "google/cloud/ai_platform/v1"
878
+ #
879
+ # # Create a client object. The client can be reused for multiple calls.
880
+ # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
881
+ #
882
+ # # Create a request. To set request fields, pass in keyword arguments.
883
+ # request = Google::Cloud::AIPlatform::V1::GetTrialRequest.new
884
+ #
885
+ # # Call the get_trial method.
886
+ # result = client.get_trial request
887
+ #
888
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::Trial.
889
+ # p result
890
+ #
891
+ def get_trial request, options = nil
892
+ raise ::ArgumentError, "request must be provided" if request.nil?
893
+
894
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTrialRequest
895
+
896
+ # Converts hash and nil to an options object
897
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
898
+
899
+ # Customize the options with defaults
900
+ call_metadata = @config.rpcs.get_trial.metadata.to_h
901
+
902
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
903
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
904
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
905
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
906
+ transports_version_send: [:rest]
907
+
908
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
909
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
910
+
911
+ options.apply_defaults timeout: @config.rpcs.get_trial.timeout,
912
+ metadata: call_metadata,
913
+ retry_policy: @config.rpcs.get_trial.retry_policy
914
+
915
+ options.apply_defaults timeout: @config.timeout,
916
+ metadata: @config.metadata,
917
+ retry_policy: @config.retry_policy
918
+
919
+ @vizier_service_stub.get_trial request, options do |result, operation|
920
+ yield result, operation if block_given?
921
+ return result
922
+ end
923
+ rescue ::Gapic::Rest::Error => e
924
+ raise ::Google::Cloud::Error.from_error(e)
925
+ end
926
+
927
+ ##
928
+ # Lists the Trials associated with a Study.
929
+ #
930
+ # @overload list_trials(request, options = nil)
931
+ # Pass arguments to `list_trials` via a request object, either of type
932
+ # {::Google::Cloud::AIPlatform::V1::ListTrialsRequest} or an equivalent Hash.
933
+ #
934
+ # @param request [::Google::Cloud::AIPlatform::V1::ListTrialsRequest, ::Hash]
935
+ # A request object representing the call parameters. Required. To specify no
936
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
937
+ # @param options [::Gapic::CallOptions, ::Hash]
938
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
939
+ #
940
+ # @overload list_trials(parent: nil, page_token: nil, page_size: nil)
941
+ # Pass arguments to `list_trials` via keyword arguments. Note that at
942
+ # least one keyword argument is required. To specify no parameters, or to keep all
943
+ # the default parameter values, pass an empty Hash as a request object (see above).
944
+ #
945
+ # @param parent [::String]
946
+ # Required. The resource name of the Study to list the Trial from.
947
+ # Format: `projects/{project}/locations/{location}/studies/{study}`
948
+ # @param page_token [::String]
949
+ # Optional. A page token to request the next page of results.
950
+ # If unspecified, there are no subsequent pages.
951
+ # @param page_size [::Integer]
952
+ # Optional. The number of Trials to retrieve per "page" of results.
953
+ # If unspecified, the service will pick an appropriate default.
954
+ # @yield [result, operation] Access the result along with the TransportOperation object
955
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Trial>]
956
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
957
+ #
958
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Trial>]
959
+ #
960
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
961
+ #
962
+ # @example Basic example
963
+ # require "google/cloud/ai_platform/v1"
964
+ #
965
+ # # Create a client object. The client can be reused for multiple calls.
966
+ # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
967
+ #
968
+ # # Create a request. To set request fields, pass in keyword arguments.
969
+ # request = Google::Cloud::AIPlatform::V1::ListTrialsRequest.new
970
+ #
971
+ # # Call the list_trials method.
972
+ # result = client.list_trials request
973
+ #
974
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
975
+ # # over elements, and API calls will be issued to fetch pages as needed.
976
+ # result.each do |item|
977
+ # # Each element is of type ::Google::Cloud::AIPlatform::V1::Trial.
978
+ # p item
979
+ # end
980
+ #
981
+ def list_trials request, options = nil
982
+ raise ::ArgumentError, "request must be provided" if request.nil?
983
+
984
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTrialsRequest
985
+
986
+ # Converts hash and nil to an options object
987
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
988
+
989
+ # Customize the options with defaults
990
+ call_metadata = @config.rpcs.list_trials.metadata.to_h
991
+
992
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
993
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
994
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
995
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
996
+ transports_version_send: [:rest]
997
+
998
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
999
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1000
+
1001
+ options.apply_defaults timeout: @config.rpcs.list_trials.timeout,
1002
+ metadata: call_metadata,
1003
+ retry_policy: @config.rpcs.list_trials.retry_policy
1004
+
1005
+ options.apply_defaults timeout: @config.timeout,
1006
+ metadata: @config.metadata,
1007
+ retry_policy: @config.retry_policy
1008
+
1009
+ @vizier_service_stub.list_trials request, options do |result, operation|
1010
+ result = ::Gapic::Rest::PagedEnumerable.new @vizier_service_stub, :list_trials, "trials", request, result, options
1011
+ yield result, operation if block_given?
1012
+ return result
1013
+ end
1014
+ rescue ::Gapic::Rest::Error => e
1015
+ raise ::Google::Cloud::Error.from_error(e)
1016
+ end
1017
+
1018
+ ##
1019
+ # Adds a measurement of the objective metrics to a Trial. This measurement
1020
+ # is assumed to have been taken before the Trial is complete.
1021
+ #
1022
+ # @overload add_trial_measurement(request, options = nil)
1023
+ # Pass arguments to `add_trial_measurement` via a request object, either of type
1024
+ # {::Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest} or an equivalent Hash.
1025
+ #
1026
+ # @param request [::Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest, ::Hash]
1027
+ # A request object representing the call parameters. Required. To specify no
1028
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1029
+ # @param options [::Gapic::CallOptions, ::Hash]
1030
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1031
+ #
1032
+ # @overload add_trial_measurement(trial_name: nil, measurement: nil)
1033
+ # Pass arguments to `add_trial_measurement` via keyword arguments. Note that at
1034
+ # least one keyword argument is required. To specify no parameters, or to keep all
1035
+ # the default parameter values, pass an empty Hash as a request object (see above).
1036
+ #
1037
+ # @param trial_name [::String]
1038
+ # Required. The name of the trial to add measurement.
1039
+ # Format:
1040
+ # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
1041
+ # @param measurement [::Google::Cloud::AIPlatform::V1::Measurement, ::Hash]
1042
+ # Required. The measurement to be added to a Trial.
1043
+ # @yield [result, operation] Access the result along with the TransportOperation object
1044
+ # @yieldparam result [::Google::Cloud::AIPlatform::V1::Trial]
1045
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1046
+ #
1047
+ # @return [::Google::Cloud::AIPlatform::V1::Trial]
1048
+ #
1049
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1050
+ #
1051
+ # @example Basic example
1052
+ # require "google/cloud/ai_platform/v1"
1053
+ #
1054
+ # # Create a client object. The client can be reused for multiple calls.
1055
+ # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
1056
+ #
1057
+ # # Create a request. To set request fields, pass in keyword arguments.
1058
+ # request = Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest.new
1059
+ #
1060
+ # # Call the add_trial_measurement method.
1061
+ # result = client.add_trial_measurement request
1062
+ #
1063
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::Trial.
1064
+ # p result
1065
+ #
1066
+ def add_trial_measurement request, options = nil
1067
+ raise ::ArgumentError, "request must be provided" if request.nil?
1068
+
1069
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest
1070
+
1071
+ # Converts hash and nil to an options object
1072
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1073
+
1074
+ # Customize the options with defaults
1075
+ call_metadata = @config.rpcs.add_trial_measurement.metadata.to_h
1076
+
1077
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1078
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1079
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1080
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
1081
+ transports_version_send: [:rest]
1082
+
1083
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1084
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1085
+
1086
+ options.apply_defaults timeout: @config.rpcs.add_trial_measurement.timeout,
1087
+ metadata: call_metadata,
1088
+ retry_policy: @config.rpcs.add_trial_measurement.retry_policy
1089
+
1090
+ options.apply_defaults timeout: @config.timeout,
1091
+ metadata: @config.metadata,
1092
+ retry_policy: @config.retry_policy
1093
+
1094
+ @vizier_service_stub.add_trial_measurement request, options do |result, operation|
1095
+ yield result, operation if block_given?
1096
+ return result
1097
+ end
1098
+ rescue ::Gapic::Rest::Error => e
1099
+ raise ::Google::Cloud::Error.from_error(e)
1100
+ end
1101
+
1102
+ ##
1103
+ # Marks a Trial as complete.
1104
+ #
1105
+ # @overload complete_trial(request, options = nil)
1106
+ # Pass arguments to `complete_trial` via a request object, either of type
1107
+ # {::Google::Cloud::AIPlatform::V1::CompleteTrialRequest} or an equivalent Hash.
1108
+ #
1109
+ # @param request [::Google::Cloud::AIPlatform::V1::CompleteTrialRequest, ::Hash]
1110
+ # A request object representing the call parameters. Required. To specify no
1111
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1112
+ # @param options [::Gapic::CallOptions, ::Hash]
1113
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1114
+ #
1115
+ # @overload complete_trial(name: nil, final_measurement: nil, trial_infeasible: nil, infeasible_reason: nil)
1116
+ # Pass arguments to `complete_trial` via keyword arguments. Note that at
1117
+ # least one keyword argument is required. To specify no parameters, or to keep all
1118
+ # the default parameter values, pass an empty Hash as a request object (see above).
1119
+ #
1120
+ # @param name [::String]
1121
+ # Required. The Trial's name.
1122
+ # Format:
1123
+ # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
1124
+ # @param final_measurement [::Google::Cloud::AIPlatform::V1::Measurement, ::Hash]
1125
+ # Optional. If provided, it will be used as the completed Trial's
1126
+ # final_measurement; Otherwise, the service will auto-select a
1127
+ # previously reported measurement as the final-measurement
1128
+ # @param trial_infeasible [::Boolean]
1129
+ # Optional. True if the Trial cannot be run with the given Parameter, and
1130
+ # final_measurement will be ignored.
1131
+ # @param infeasible_reason [::String]
1132
+ # Optional. A human readable reason why the trial was infeasible. This should
1133
+ # only be provided if `trial_infeasible` is true.
1134
+ # @yield [result, operation] Access the result along with the TransportOperation object
1135
+ # @yieldparam result [::Google::Cloud::AIPlatform::V1::Trial]
1136
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1137
+ #
1138
+ # @return [::Google::Cloud::AIPlatform::V1::Trial]
1139
+ #
1140
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1141
+ #
1142
+ # @example Basic example
1143
+ # require "google/cloud/ai_platform/v1"
1144
+ #
1145
+ # # Create a client object. The client can be reused for multiple calls.
1146
+ # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
1147
+ #
1148
+ # # Create a request. To set request fields, pass in keyword arguments.
1149
+ # request = Google::Cloud::AIPlatform::V1::CompleteTrialRequest.new
1150
+ #
1151
+ # # Call the complete_trial method.
1152
+ # result = client.complete_trial request
1153
+ #
1154
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::Trial.
1155
+ # p result
1156
+ #
1157
+ def complete_trial request, options = nil
1158
+ raise ::ArgumentError, "request must be provided" if request.nil?
1159
+
1160
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CompleteTrialRequest
1161
+
1162
+ # Converts hash and nil to an options object
1163
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1164
+
1165
+ # Customize the options with defaults
1166
+ call_metadata = @config.rpcs.complete_trial.metadata.to_h
1167
+
1168
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1169
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1170
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1171
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
1172
+ transports_version_send: [:rest]
1173
+
1174
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1175
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1176
+
1177
+ options.apply_defaults timeout: @config.rpcs.complete_trial.timeout,
1178
+ metadata: call_metadata,
1179
+ retry_policy: @config.rpcs.complete_trial.retry_policy
1180
+
1181
+ options.apply_defaults timeout: @config.timeout,
1182
+ metadata: @config.metadata,
1183
+ retry_policy: @config.retry_policy
1184
+
1185
+ @vizier_service_stub.complete_trial request, options do |result, operation|
1186
+ yield result, operation if block_given?
1187
+ return result
1188
+ end
1189
+ rescue ::Gapic::Rest::Error => e
1190
+ raise ::Google::Cloud::Error.from_error(e)
1191
+ end
1192
+
1193
+ ##
1194
+ # Deletes a Trial.
1195
+ #
1196
+ # @overload delete_trial(request, options = nil)
1197
+ # Pass arguments to `delete_trial` via a request object, either of type
1198
+ # {::Google::Cloud::AIPlatform::V1::DeleteTrialRequest} or an equivalent Hash.
1199
+ #
1200
+ # @param request [::Google::Cloud::AIPlatform::V1::DeleteTrialRequest, ::Hash]
1201
+ # A request object representing the call parameters. Required. To specify no
1202
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1203
+ # @param options [::Gapic::CallOptions, ::Hash]
1204
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1205
+ #
1206
+ # @overload delete_trial(name: nil)
1207
+ # Pass arguments to `delete_trial` via keyword arguments. Note that at
1208
+ # least one keyword argument is required. To specify no parameters, or to keep all
1209
+ # the default parameter values, pass an empty Hash as a request object (see above).
1210
+ #
1211
+ # @param name [::String]
1212
+ # Required. The Trial's name.
1213
+ # Format:
1214
+ # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
1215
+ # @yield [result, operation] Access the result along with the TransportOperation object
1216
+ # @yieldparam result [::Google::Protobuf::Empty]
1217
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1218
+ #
1219
+ # @return [::Google::Protobuf::Empty]
1220
+ #
1221
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1222
+ #
1223
+ # @example Basic example
1224
+ # require "google/cloud/ai_platform/v1"
1225
+ #
1226
+ # # Create a client object. The client can be reused for multiple calls.
1227
+ # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
1228
+ #
1229
+ # # Create a request. To set request fields, pass in keyword arguments.
1230
+ # request = Google::Cloud::AIPlatform::V1::DeleteTrialRequest.new
1231
+ #
1232
+ # # Call the delete_trial method.
1233
+ # result = client.delete_trial request
1234
+ #
1235
+ # # The returned object is of type Google::Protobuf::Empty.
1236
+ # p result
1237
+ #
1238
+ def delete_trial request, options = nil
1239
+ raise ::ArgumentError, "request must be provided" if request.nil?
1240
+
1241
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteTrialRequest
1242
+
1243
+ # Converts hash and nil to an options object
1244
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1245
+
1246
+ # Customize the options with defaults
1247
+ call_metadata = @config.rpcs.delete_trial.metadata.to_h
1248
+
1249
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1250
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1251
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1252
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
1253
+ transports_version_send: [:rest]
1254
+
1255
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1256
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1257
+
1258
+ options.apply_defaults timeout: @config.rpcs.delete_trial.timeout,
1259
+ metadata: call_metadata,
1260
+ retry_policy: @config.rpcs.delete_trial.retry_policy
1261
+
1262
+ options.apply_defaults timeout: @config.timeout,
1263
+ metadata: @config.metadata,
1264
+ retry_policy: @config.retry_policy
1265
+
1266
+ @vizier_service_stub.delete_trial request, options do |result, operation|
1267
+ yield result, operation if block_given?
1268
+ return result
1269
+ end
1270
+ rescue ::Gapic::Rest::Error => e
1271
+ raise ::Google::Cloud::Error.from_error(e)
1272
+ end
1273
+
1274
+ ##
1275
+ # Checks whether a Trial should stop or not. Returns a
1276
+ # long-running operation. When the operation is successful,
1277
+ # it will contain a
1278
+ # {::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateResponse CheckTrialEarlyStoppingStateResponse}.
1279
+ #
1280
+ # @overload check_trial_early_stopping_state(request, options = nil)
1281
+ # Pass arguments to `check_trial_early_stopping_state` via a request object, either of type
1282
+ # {::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest} or an equivalent Hash.
1283
+ #
1284
+ # @param request [::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest, ::Hash]
1285
+ # A request object representing the call parameters. Required. To specify no
1286
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1287
+ # @param options [::Gapic::CallOptions, ::Hash]
1288
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1289
+ #
1290
+ # @overload check_trial_early_stopping_state(trial_name: nil)
1291
+ # Pass arguments to `check_trial_early_stopping_state` via keyword arguments. Note that at
1292
+ # least one keyword argument is required. To specify no parameters, or to keep all
1293
+ # the default parameter values, pass an empty Hash as a request object (see above).
1294
+ #
1295
+ # @param trial_name [::String]
1296
+ # Required. The Trial's name.
1297
+ # Format:
1298
+ # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
1299
+ # @yield [result, operation] Access the result along with the TransportOperation object
1300
+ # @yieldparam result [::Gapic::Operation]
1301
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1302
+ #
1303
+ # @return [::Gapic::Operation]
1304
+ #
1305
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1306
+ #
1307
+ # @example Basic example
1308
+ # require "google/cloud/ai_platform/v1"
1309
+ #
1310
+ # # Create a client object. The client can be reused for multiple calls.
1311
+ # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
1312
+ #
1313
+ # # Create a request. To set request fields, pass in keyword arguments.
1314
+ # request = Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest.new
1315
+ #
1316
+ # # Call the check_trial_early_stopping_state method.
1317
+ # result = client.check_trial_early_stopping_state request
1318
+ #
1319
+ # # The returned object is of type Gapic::Operation. You can use it to
1320
+ # # check the status of an operation, cancel it, or wait for results.
1321
+ # # Here is how to wait for a response.
1322
+ # result.wait_until_done! timeout: 60
1323
+ # if result.response?
1324
+ # p result.response
1325
+ # else
1326
+ # puts "No response received."
1327
+ # end
1328
+ #
1329
+ def check_trial_early_stopping_state request, options = nil
1330
+ raise ::ArgumentError, "request must be provided" if request.nil?
1331
+
1332
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest
1333
+
1334
+ # Converts hash and nil to an options object
1335
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1336
+
1337
+ # Customize the options with defaults
1338
+ call_metadata = @config.rpcs.check_trial_early_stopping_state.metadata.to_h
1339
+
1340
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1341
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1342
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1343
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
1344
+ transports_version_send: [:rest]
1345
+
1346
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1347
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1348
+
1349
+ options.apply_defaults timeout: @config.rpcs.check_trial_early_stopping_state.timeout,
1350
+ metadata: call_metadata,
1351
+ retry_policy: @config.rpcs.check_trial_early_stopping_state.retry_policy
1352
+
1353
+ options.apply_defaults timeout: @config.timeout,
1354
+ metadata: @config.metadata,
1355
+ retry_policy: @config.retry_policy
1356
+
1357
+ @vizier_service_stub.check_trial_early_stopping_state request, options do |result, operation|
1358
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1359
+ yield result, operation if block_given?
1360
+ return result
1361
+ end
1362
+ rescue ::Gapic::Rest::Error => e
1363
+ raise ::Google::Cloud::Error.from_error(e)
1364
+ end
1365
+
1366
+ ##
1367
+ # Stops a Trial.
1368
+ #
1369
+ # @overload stop_trial(request, options = nil)
1370
+ # Pass arguments to `stop_trial` via a request object, either of type
1371
+ # {::Google::Cloud::AIPlatform::V1::StopTrialRequest} or an equivalent Hash.
1372
+ #
1373
+ # @param request [::Google::Cloud::AIPlatform::V1::StopTrialRequest, ::Hash]
1374
+ # A request object representing the call parameters. Required. To specify no
1375
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1376
+ # @param options [::Gapic::CallOptions, ::Hash]
1377
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1378
+ #
1379
+ # @overload stop_trial(name: nil)
1380
+ # Pass arguments to `stop_trial` via keyword arguments. Note that at
1381
+ # least one keyword argument is required. To specify no parameters, or to keep all
1382
+ # the default parameter values, pass an empty Hash as a request object (see above).
1383
+ #
1384
+ # @param name [::String]
1385
+ # Required. The Trial's name.
1386
+ # Format:
1387
+ # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
1388
+ # @yield [result, operation] Access the result along with the TransportOperation object
1389
+ # @yieldparam result [::Google::Cloud::AIPlatform::V1::Trial]
1390
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1391
+ #
1392
+ # @return [::Google::Cloud::AIPlatform::V1::Trial]
1393
+ #
1394
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1395
+ #
1396
+ # @example Basic example
1397
+ # require "google/cloud/ai_platform/v1"
1398
+ #
1399
+ # # Create a client object. The client can be reused for multiple calls.
1400
+ # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
1401
+ #
1402
+ # # Create a request. To set request fields, pass in keyword arguments.
1403
+ # request = Google::Cloud::AIPlatform::V1::StopTrialRequest.new
1404
+ #
1405
+ # # Call the stop_trial method.
1406
+ # result = client.stop_trial request
1407
+ #
1408
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::Trial.
1409
+ # p result
1410
+ #
1411
+ def stop_trial request, options = nil
1412
+ raise ::ArgumentError, "request must be provided" if request.nil?
1413
+
1414
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StopTrialRequest
1415
+
1416
+ # Converts hash and nil to an options object
1417
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1418
+
1419
+ # Customize the options with defaults
1420
+ call_metadata = @config.rpcs.stop_trial.metadata.to_h
1421
+
1422
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1423
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1424
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1425
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
1426
+ transports_version_send: [:rest]
1427
+
1428
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1429
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1430
+
1431
+ options.apply_defaults timeout: @config.rpcs.stop_trial.timeout,
1432
+ metadata: call_metadata,
1433
+ retry_policy: @config.rpcs.stop_trial.retry_policy
1434
+
1435
+ options.apply_defaults timeout: @config.timeout,
1436
+ metadata: @config.metadata,
1437
+ retry_policy: @config.retry_policy
1438
+
1439
+ @vizier_service_stub.stop_trial request, options do |result, operation|
1440
+ yield result, operation if block_given?
1441
+ return result
1442
+ end
1443
+ rescue ::Gapic::Rest::Error => e
1444
+ raise ::Google::Cloud::Error.from_error(e)
1445
+ end
1446
+
1447
+ ##
1448
+ # Lists the pareto-optimal Trials for multi-objective Study or the
1449
+ # optimal Trials for single-objective Study. The definition of
1450
+ # pareto-optimal can be checked in wiki page.
1451
+ # https://en.wikipedia.org/wiki/Pareto_efficiency
1452
+ #
1453
+ # @overload list_optimal_trials(request, options = nil)
1454
+ # Pass arguments to `list_optimal_trials` via a request object, either of type
1455
+ # {::Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest} or an equivalent Hash.
1456
+ #
1457
+ # @param request [::Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest, ::Hash]
1458
+ # A request object representing the call parameters. Required. To specify no
1459
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1460
+ # @param options [::Gapic::CallOptions, ::Hash]
1461
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1462
+ #
1463
+ # @overload list_optimal_trials(parent: nil)
1464
+ # Pass arguments to `list_optimal_trials` via keyword arguments. Note that at
1465
+ # least one keyword argument is required. To specify no parameters, or to keep all
1466
+ # the default parameter values, pass an empty Hash as a request object (see above).
1467
+ #
1468
+ # @param parent [::String]
1469
+ # Required. The name of the Study that the optimal Trial belongs to.
1470
+ # @yield [result, operation] Access the result along with the TransportOperation object
1471
+ # @yieldparam result [::Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse]
1472
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1473
+ #
1474
+ # @return [::Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse]
1475
+ #
1476
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1477
+ #
1478
+ # @example Basic example
1479
+ # require "google/cloud/ai_platform/v1"
1480
+ #
1481
+ # # Create a client object. The client can be reused for multiple calls.
1482
+ # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new
1483
+ #
1484
+ # # Create a request. To set request fields, pass in keyword arguments.
1485
+ # request = Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest.new
1486
+ #
1487
+ # # Call the list_optimal_trials method.
1488
+ # result = client.list_optimal_trials request
1489
+ #
1490
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse.
1491
+ # p result
1492
+ #
1493
+ def list_optimal_trials request, options = nil
1494
+ raise ::ArgumentError, "request must be provided" if request.nil?
1495
+
1496
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest
1497
+
1498
+ # Converts hash and nil to an options object
1499
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1500
+
1501
+ # Customize the options with defaults
1502
+ call_metadata = @config.rpcs.list_optimal_trials.metadata.to_h
1503
+
1504
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1505
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1506
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1507
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
1508
+ transports_version_send: [:rest]
1509
+
1510
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1511
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1512
+
1513
+ options.apply_defaults timeout: @config.rpcs.list_optimal_trials.timeout,
1514
+ metadata: call_metadata,
1515
+ retry_policy: @config.rpcs.list_optimal_trials.retry_policy
1516
+
1517
+ options.apply_defaults timeout: @config.timeout,
1518
+ metadata: @config.metadata,
1519
+ retry_policy: @config.retry_policy
1520
+
1521
+ @vizier_service_stub.list_optimal_trials request, options do |result, operation|
1522
+ yield result, operation if block_given?
1523
+ return result
1524
+ end
1525
+ rescue ::Gapic::Rest::Error => e
1526
+ raise ::Google::Cloud::Error.from_error(e)
1527
+ end
1528
+
1529
+ ##
1530
+ # Configuration class for the VizierService REST API.
1531
+ #
1532
+ # This class represents the configuration for VizierService REST,
1533
+ # providing control over timeouts, retry behavior, logging, transport
1534
+ # parameters, and other low-level controls. Certain parameters can also be
1535
+ # applied individually to specific RPCs. See
1536
+ # {::Google::Cloud::AIPlatform::V1::VizierService::Rest::Client::Configuration::Rpcs}
1537
+ # for a list of RPCs that can be configured independently.
1538
+ #
1539
+ # Configuration can be applied globally to all clients, or to a single client
1540
+ # on construction.
1541
+ #
1542
+ # @example
1543
+ #
1544
+ # # Modify the global config, setting the timeout for
1545
+ # # create_study to 20 seconds,
1546
+ # # and all remaining timeouts to 10 seconds.
1547
+ # ::Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.configure do |config|
1548
+ # config.timeout = 10.0
1549
+ # config.rpcs.create_study.timeout = 20.0
1550
+ # end
1551
+ #
1552
+ # # Apply the above configuration only to a new client.
1553
+ # client = ::Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new do |config|
1554
+ # config.timeout = 10.0
1555
+ # config.rpcs.create_study.timeout = 20.0
1556
+ # end
1557
+ #
1558
+ # @!attribute [rw] endpoint
1559
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1560
+ # nil, indicating to use the default endpoint in the current universe domain.
1561
+ # @return [::String,nil]
1562
+ # @!attribute [rw] credentials
1563
+ # Credentials to send with calls. You may provide any of the following types:
1564
+ # * (`String`) The path to a service account key file in JSON format
1565
+ # * (`Hash`) A service account key as a Hash
1566
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1567
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1568
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1569
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1570
+ # * (`nil`) indicating no credentials
1571
+ # @return [::Object]
1572
+ # @!attribute [rw] scope
1573
+ # The OAuth scopes
1574
+ # @return [::Array<::String>]
1575
+ # @!attribute [rw] lib_name
1576
+ # The library name as recorded in instrumentation and logging
1577
+ # @return [::String]
1578
+ # @!attribute [rw] lib_version
1579
+ # The library version as recorded in instrumentation and logging
1580
+ # @return [::String]
1581
+ # @!attribute [rw] timeout
1582
+ # The call timeout in seconds.
1583
+ # @return [::Numeric]
1584
+ # @!attribute [rw] metadata
1585
+ # Additional headers to be sent with the call.
1586
+ # @return [::Hash{::Symbol=>::String}]
1587
+ # @!attribute [rw] retry_policy
1588
+ # The retry policy. The value is a hash with the following keys:
1589
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1590
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1591
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1592
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1593
+ # trigger a retry.
1594
+ # @return [::Hash]
1595
+ # @!attribute [rw] quota_project
1596
+ # A separate project against which to charge quota.
1597
+ # @return [::String]
1598
+ # @!attribute [rw] universe_domain
1599
+ # The universe domain within which to make requests. This determines the
1600
+ # default endpoint URL. The default value of nil uses the environment
1601
+ # universe (usually the default "googleapis.com" universe).
1602
+ # @return [::String,nil]
1603
+ #
1604
+ class Configuration
1605
+ extend ::Gapic::Config
1606
+
1607
+ # @private
1608
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1609
+ DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
1610
+
1611
+ config_attr :endpoint, nil, ::String, nil
1612
+ config_attr :credentials, nil do |value|
1613
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1614
+ allowed.any? { |klass| klass === value }
1615
+ end
1616
+ config_attr :scope, nil, ::String, ::Array, nil
1617
+ config_attr :lib_name, nil, ::String, nil
1618
+ config_attr :lib_version, nil, ::String, nil
1619
+ config_attr :timeout, nil, ::Numeric, nil
1620
+ config_attr :metadata, nil, ::Hash, nil
1621
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1622
+ config_attr :quota_project, nil, ::String, nil
1623
+ config_attr :universe_domain, nil, ::String, nil
1624
+
1625
+ # @private
1626
+ # Overrides for http bindings for the RPCs of this service
1627
+ # are only used when this service is used as mixin, and only
1628
+ # by the host service.
1629
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1630
+ config_attr :bindings_override, {}, ::Hash, nil
1631
+
1632
+ # @private
1633
+ def initialize parent_config = nil
1634
+ @parent_config = parent_config unless parent_config.nil?
1635
+
1636
+ yield self if block_given?
1637
+ end
1638
+
1639
+ ##
1640
+ # Configurations for individual RPCs
1641
+ # @return [Rpcs]
1642
+ #
1643
+ def rpcs
1644
+ @rpcs ||= begin
1645
+ parent_rpcs = nil
1646
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1647
+ Rpcs.new parent_rpcs
1648
+ end
1649
+ end
1650
+
1651
+ ##
1652
+ # Configuration RPC class for the VizierService API.
1653
+ #
1654
+ # Includes fields providing the configuration for each RPC in this service.
1655
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1656
+ # the following configuration fields:
1657
+ #
1658
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1659
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1660
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1661
+ # include the following keys:
1662
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1663
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1664
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1665
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1666
+ # trigger a retry.
1667
+ #
1668
+ class Rpcs
1669
+ ##
1670
+ # RPC-specific configuration for `create_study`
1671
+ # @return [::Gapic::Config::Method]
1672
+ #
1673
+ attr_reader :create_study
1674
+ ##
1675
+ # RPC-specific configuration for `get_study`
1676
+ # @return [::Gapic::Config::Method]
1677
+ #
1678
+ attr_reader :get_study
1679
+ ##
1680
+ # RPC-specific configuration for `list_studies`
1681
+ # @return [::Gapic::Config::Method]
1682
+ #
1683
+ attr_reader :list_studies
1684
+ ##
1685
+ # RPC-specific configuration for `delete_study`
1686
+ # @return [::Gapic::Config::Method]
1687
+ #
1688
+ attr_reader :delete_study
1689
+ ##
1690
+ # RPC-specific configuration for `lookup_study`
1691
+ # @return [::Gapic::Config::Method]
1692
+ #
1693
+ attr_reader :lookup_study
1694
+ ##
1695
+ # RPC-specific configuration for `suggest_trials`
1696
+ # @return [::Gapic::Config::Method]
1697
+ #
1698
+ attr_reader :suggest_trials
1699
+ ##
1700
+ # RPC-specific configuration for `create_trial`
1701
+ # @return [::Gapic::Config::Method]
1702
+ #
1703
+ attr_reader :create_trial
1704
+ ##
1705
+ # RPC-specific configuration for `get_trial`
1706
+ # @return [::Gapic::Config::Method]
1707
+ #
1708
+ attr_reader :get_trial
1709
+ ##
1710
+ # RPC-specific configuration for `list_trials`
1711
+ # @return [::Gapic::Config::Method]
1712
+ #
1713
+ attr_reader :list_trials
1714
+ ##
1715
+ # RPC-specific configuration for `add_trial_measurement`
1716
+ # @return [::Gapic::Config::Method]
1717
+ #
1718
+ attr_reader :add_trial_measurement
1719
+ ##
1720
+ # RPC-specific configuration for `complete_trial`
1721
+ # @return [::Gapic::Config::Method]
1722
+ #
1723
+ attr_reader :complete_trial
1724
+ ##
1725
+ # RPC-specific configuration for `delete_trial`
1726
+ # @return [::Gapic::Config::Method]
1727
+ #
1728
+ attr_reader :delete_trial
1729
+ ##
1730
+ # RPC-specific configuration for `check_trial_early_stopping_state`
1731
+ # @return [::Gapic::Config::Method]
1732
+ #
1733
+ attr_reader :check_trial_early_stopping_state
1734
+ ##
1735
+ # RPC-specific configuration for `stop_trial`
1736
+ # @return [::Gapic::Config::Method]
1737
+ #
1738
+ attr_reader :stop_trial
1739
+ ##
1740
+ # RPC-specific configuration for `list_optimal_trials`
1741
+ # @return [::Gapic::Config::Method]
1742
+ #
1743
+ attr_reader :list_optimal_trials
1744
+
1745
+ # @private
1746
+ def initialize parent_rpcs = nil
1747
+ create_study_config = parent_rpcs.create_study if parent_rpcs.respond_to? :create_study
1748
+ @create_study = ::Gapic::Config::Method.new create_study_config
1749
+ get_study_config = parent_rpcs.get_study if parent_rpcs.respond_to? :get_study
1750
+ @get_study = ::Gapic::Config::Method.new get_study_config
1751
+ list_studies_config = parent_rpcs.list_studies if parent_rpcs.respond_to? :list_studies
1752
+ @list_studies = ::Gapic::Config::Method.new list_studies_config
1753
+ delete_study_config = parent_rpcs.delete_study if parent_rpcs.respond_to? :delete_study
1754
+ @delete_study = ::Gapic::Config::Method.new delete_study_config
1755
+ lookup_study_config = parent_rpcs.lookup_study if parent_rpcs.respond_to? :lookup_study
1756
+ @lookup_study = ::Gapic::Config::Method.new lookup_study_config
1757
+ suggest_trials_config = parent_rpcs.suggest_trials if parent_rpcs.respond_to? :suggest_trials
1758
+ @suggest_trials = ::Gapic::Config::Method.new suggest_trials_config
1759
+ create_trial_config = parent_rpcs.create_trial if parent_rpcs.respond_to? :create_trial
1760
+ @create_trial = ::Gapic::Config::Method.new create_trial_config
1761
+ get_trial_config = parent_rpcs.get_trial if parent_rpcs.respond_to? :get_trial
1762
+ @get_trial = ::Gapic::Config::Method.new get_trial_config
1763
+ list_trials_config = parent_rpcs.list_trials if parent_rpcs.respond_to? :list_trials
1764
+ @list_trials = ::Gapic::Config::Method.new list_trials_config
1765
+ add_trial_measurement_config = parent_rpcs.add_trial_measurement if parent_rpcs.respond_to? :add_trial_measurement
1766
+ @add_trial_measurement = ::Gapic::Config::Method.new add_trial_measurement_config
1767
+ complete_trial_config = parent_rpcs.complete_trial if parent_rpcs.respond_to? :complete_trial
1768
+ @complete_trial = ::Gapic::Config::Method.new complete_trial_config
1769
+ delete_trial_config = parent_rpcs.delete_trial if parent_rpcs.respond_to? :delete_trial
1770
+ @delete_trial = ::Gapic::Config::Method.new delete_trial_config
1771
+ check_trial_early_stopping_state_config = parent_rpcs.check_trial_early_stopping_state if parent_rpcs.respond_to? :check_trial_early_stopping_state
1772
+ @check_trial_early_stopping_state = ::Gapic::Config::Method.new check_trial_early_stopping_state_config
1773
+ stop_trial_config = parent_rpcs.stop_trial if parent_rpcs.respond_to? :stop_trial
1774
+ @stop_trial = ::Gapic::Config::Method.new stop_trial_config
1775
+ list_optimal_trials_config = parent_rpcs.list_optimal_trials if parent_rpcs.respond_to? :list_optimal_trials
1776
+ @list_optimal_trials = ::Gapic::Config::Method.new list_optimal_trials_config
1777
+
1778
+ yield self if block_given?
1779
+ end
1780
+ end
1781
+ end
1782
+ end
1783
+ end
1784
+ end
1785
+ end
1786
+ end
1787
+ end
1788
+ end