google-cloud-ai_platform-v1 0.38.0 → 0.40.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/ai_platform/v1/bindings_override.rb +399 -0
  3. data/lib/google/cloud/ai_platform/v1/dataset_service/client.rb +39 -18
  4. data/lib/google/cloud/ai_platform/v1/dataset_service/operations.rb +13 -5
  5. data/lib/google/cloud/ai_platform/v1/dataset_service/rest/client.rb +2188 -0
  6. data/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb +3901 -0
  7. data/lib/google/cloud/ai_platform/v1/dataset_service/rest/service_stub.rb +1136 -0
  8. data/lib/google/cloud/ai_platform/v1/dataset_service/rest.rb +54 -0
  9. data/lib/google/cloud/ai_platform/v1/dataset_service.rb +6 -0
  10. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/client.rb +13 -5
  11. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/operations.rb +13 -5
  12. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/client.rb +851 -0
  13. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations.rb +3901 -0
  14. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/service_stub.rb +365 -0
  15. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest.rb +54 -0
  16. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service.rb +6 -0
  17. data/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb +21 -11
  18. data/lib/google/cloud/ai_platform/v1/endpoint_service/operations.rb +13 -5
  19. data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/client.rb +1215 -0
  20. data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/operations.rb +3901 -0
  21. data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/service_stub.rb +546 -0
  22. data/lib/google/cloud/ai_platform/v1/endpoint_service/rest.rb +54 -0
  23. data/lib/google/cloud/ai_platform/v1/endpoint_service.rb +6 -0
  24. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/client.rb +29 -13
  25. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/operations.rb +13 -5
  26. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/client.rb +1732 -0
  27. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations.rb +3901 -0
  28. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/service_stub.rb +841 -0
  29. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest.rb +55 -0
  30. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service.rb +6 -0
  31. data/lib/google/cloud/ai_platform/v1/feature_online_store_service/client.rb +7 -2
  32. data/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/client.rb +534 -0
  33. data/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/service_stub.rb +189 -0
  34. data/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest.rb +53 -0
  35. data/lib/google/cloud/ai_platform/v1/feature_online_store_service.rb +6 -0
  36. data/lib/google/cloud/ai_platform/v1/feature_registry_service/client.rb +24 -11
  37. data/lib/google/cloud/ai_platform/v1/feature_registry_service/operations.rb +13 -5
  38. data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/client.rb +1450 -0
  39. data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/operations.rb +3901 -0
  40. data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/service_stub.rb +663 -0
  41. data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest.rb +55 -0
  42. data/lib/google/cloud/ai_platform/v1/feature_registry_service.rb +6 -0
  43. data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/client.rb +9 -3
  44. data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/client.rb +645 -0
  45. data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/service_stub.rb +244 -0
  46. data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest.rb +53 -0
  47. data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service.rb +6 -0
  48. data/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb +45 -21
  49. data/lib/google/cloud/ai_platform/v1/featurestore_service/operations.rb +13 -5
  50. data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/client.rb +2765 -0
  51. data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/operations.rb +3901 -0
  52. data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/service_stub.rb +1319 -0
  53. data/lib/google/cloud/ai_platform/v1/featurestore_service/rest.rb +54 -0
  54. data/lib/google/cloud/ai_platform/v1/featurestore_service.rb +6 -0
  55. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/client.rb +765 -0
  56. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/credentials.rb +47 -0
  57. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/paths.rb +154 -0
  58. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/client.rb +720 -0
  59. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/service_stub.rb +307 -0
  60. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest.rb +53 -0
  61. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service.rb +55 -0
  62. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/client.rb +19 -8
  63. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/operations.rb +13 -5
  64. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/client.rb +1151 -0
  65. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb +3901 -0
  66. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/service_stub.rb +546 -0
  67. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest.rb +54 -0
  68. data/lib/google/cloud/ai_platform/v1/index_endpoint_service.rb +6 -0
  69. data/lib/google/cloud/ai_platform/v1/index_service/client.rb +17 -7
  70. data/lib/google/cloud/ai_platform/v1/index_service/operations.rb +13 -5
  71. data/lib/google/cloud/ai_platform/v1/index_service/rest/client.rb +1034 -0
  72. data/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb +3901 -0
  73. data/lib/google/cloud/ai_platform/v1/index_service/rest/service_stub.rb +486 -0
  74. data/lib/google/cloud/ai_platform/v1/index_service/rest.rb +54 -0
  75. data/lib/google/cloud/ai_platform/v1/index_service.rb +6 -0
  76. data/lib/google/cloud/ai_platform/v1/job_service/client.rb +73 -35
  77. data/lib/google/cloud/ai_platform/v1/job_service/operations.rb +13 -5
  78. data/lib/google/cloud/ai_platform/v1/job_service/paths.rb +19 -0
  79. data/lib/google/cloud/ai_platform/v1/job_service/rest/client.rb +3841 -0
  80. data/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb +3901 -0
  81. data/lib/google/cloud/ai_platform/v1/job_service/rest/service_stub.rb +2149 -0
  82. data/lib/google/cloud/ai_platform/v1/job_service/rest.rb +54 -0
  83. data/lib/google/cloud/ai_platform/v1/job_service.rb +6 -0
  84. data/lib/google/cloud/ai_platform/v1/llm_utility_service/client.rb +7 -2
  85. data/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/client.rb +533 -0
  86. data/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/service_stub.rb +205 -0
  87. data/lib/google/cloud/ai_platform/v1/llm_utility_service/rest.rb +53 -0
  88. data/lib/google/cloud/ai_platform/v1/llm_utility_service.rb +6 -0
  89. data/lib/google/cloud/ai_platform/v1/match_service/client.rb +7 -2
  90. data/lib/google/cloud/ai_platform/v1/match_service/rest/client.rb +541 -0
  91. data/lib/google/cloud/ai_platform/v1/match_service/rest/service_stub.rb +189 -0
  92. data/lib/google/cloud/ai_platform/v1/match_service/rest.rb +54 -0
  93. data/lib/google/cloud/ai_platform/v1/match_service.rb +6 -0
  94. data/lib/google/cloud/ai_platform/v1/metadata_service/client.rb +67 -32
  95. data/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb +13 -5
  96. data/lib/google/cloud/ai_platform/v1/metadata_service/rest/client.rb +3634 -0
  97. data/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb +3901 -0
  98. data/lib/google/cloud/ai_platform/v1/metadata_service/rest/service_stub.rb +1972 -0
  99. data/lib/google/cloud/ai_platform/v1/metadata_service/rest.rb +54 -0
  100. data/lib/google/cloud/ai_platform/v1/metadata_service.rb +6 -0
  101. data/lib/google/cloud/ai_platform/v1/migration_service/client.rb +7 -2
  102. data/lib/google/cloud/ai_platform/v1/migration_service/operations.rb +13 -5
  103. data/lib/google/cloud/ai_platform/v1/migration_service/rest/client.rb +574 -0
  104. data/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb +3901 -0
  105. data/lib/google/cloud/ai_platform/v1/migration_service/rest/service_stub.rb +189 -0
  106. data/lib/google/cloud/ai_platform/v1/migration_service/rest.rb +55 -0
  107. data/lib/google/cloud/ai_platform/v1/migration_service.rb +6 -0
  108. data/lib/google/cloud/ai_platform/v1/model_garden_service/client.rb +5 -1
  109. data/lib/google/cloud/ai_platform/v1/model_garden_service/rest/client.rb +438 -0
  110. data/lib/google/cloud/ai_platform/v1/model_garden_service/rest/service_stub.rb +128 -0
  111. data/lib/google/cloud/ai_platform/v1/model_garden_service/rest.rb +53 -0
  112. data/lib/google/cloud/ai_platform/v1/model_garden_service.rb +6 -0
  113. data/lib/google/cloud/ai_platform/v1/model_service/client.rb +39 -18
  114. data/lib/google/cloud/ai_platform/v1/model_service/operations.rb +13 -5
  115. data/lib/google/cloud/ai_platform/v1/model_service/rest/client.rb +2213 -0
  116. data/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb +3901 -0
  117. data/lib/google/cloud/ai_platform/v1/model_service/rest/service_stub.rb +1140 -0
  118. data/lib/google/cloud/ai_platform/v1/model_service/rest.rb +54 -0
  119. data/lib/google/cloud/ai_platform/v1/model_service.rb +6 -0
  120. data/lib/google/cloud/ai_platform/v1/notebook_service/client.rb +1497 -0
  121. data/lib/google/cloud/ai_platform/v1/notebook_service/credentials.rb +47 -0
  122. data/lib/google/cloud/ai_platform/v1/notebook_service/operations.rb +817 -0
  123. data/lib/google/cloud/ai_platform/v1/notebook_service/paths.rb +124 -0
  124. data/lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb +1410 -0
  125. data/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb +3901 -0
  126. data/lib/google/cloud/ai_platform/v1/notebook_service/rest/service_stub.rb +663 -0
  127. data/lib/google/cloud/ai_platform/v1/notebook_service/rest.rb +54 -0
  128. data/lib/google/cloud/ai_platform/v1/notebook_service.rb +56 -0
  129. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/client.rb +1001 -0
  130. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/credentials.rb +47 -0
  131. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/operations.rb +817 -0
  132. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/paths.rb +86 -0
  133. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/client.rb +942 -0
  134. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb +3901 -0
  135. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/service_stub.rb +426 -0
  136. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest.rb +54 -0
  137. data/lib/google/cloud/ai_platform/v1/persistent_resource_service.rb +56 -0
  138. data/lib/google/cloud/ai_platform/v1/pipeline_service/client.rb +27 -12
  139. data/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb +13 -5
  140. data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/client.rb +1600 -0
  141. data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb +3901 -0
  142. data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/service_stub.rb +783 -0
  143. data/lib/google/cloud/ai_platform/v1/pipeline_service/rest.rb +56 -0
  144. data/lib/google/cloud/ai_platform/v1/pipeline_service.rb +6 -0
  145. data/lib/google/cloud/ai_platform/v1/prediction_service/client.rb +39 -15
  146. data/lib/google/cloud/ai_platform/v1/prediction_service/rest/client.rb +1297 -0
  147. data/lib/google/cloud/ai_platform/v1/prediction_service/rest/service_stub.rb +642 -0
  148. data/lib/google/cloud/ai_platform/v1/prediction_service/rest.rb +53 -0
  149. data/lib/google/cloud/ai_platform/v1/prediction_service.rb +6 -0
  150. data/lib/google/cloud/ai_platform/v1/rest.rb +63 -0
  151. data/lib/google/cloud/ai_platform/v1/schedule_service/client.rb +17 -7
  152. data/lib/google/cloud/ai_platform/v1/schedule_service/operations.rb +13 -5
  153. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/client.rb +1076 -0
  154. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb +3901 -0
  155. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/service_stub.rb +486 -0
  156. data/lib/google/cloud/ai_platform/v1/schedule_service/rest.rb +55 -0
  157. data/lib/google/cloud/ai_platform/v1/schedule_service.rb +6 -0
  158. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb +13 -5
  159. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb +13 -5
  160. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/client.rb +847 -0
  161. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb +3901 -0
  162. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/service_stub.rb +366 -0
  163. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest.rb +59 -0
  164. data/lib/google/cloud/ai_platform/v1/specialist_pool_service.rb +6 -0
  165. data/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb +63 -30
  166. data/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb +13 -5
  167. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/client.rb +3274 -0
  168. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb +3901 -0
  169. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/service_stub.rb +1847 -0
  170. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest.rb +54 -0
  171. data/lib/google/cloud/ai_platform/v1/tensorboard_service.rb +6 -0
  172. data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
  173. data/lib/google/cloud/ai_platform/v1/vizier_service/client.rb +33 -15
  174. data/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb +13 -5
  175. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/client.rb +1788 -0
  176. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb +3901 -0
  177. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/service_stub.rb +963 -0
  178. data/lib/google/cloud/ai_platform/v1/vizier_service/rest.rb +58 -0
  179. data/lib/google/cloud/ai_platform/v1/vizier_service.rb +6 -0
  180. data/lib/google/cloud/ai_platform/v1.rb +9 -1
  181. data/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb +1 -1
  182. data/lib/google/cloud/aiplatform/v1/content_pb.rb +3 -1
  183. data/lib/google/cloud/aiplatform/v1/custom_job_pb.rb +1 -1
  184. data/lib/google/cloud/aiplatform/v1/endpoint_pb.rb +3 -1
  185. data/lib/google/cloud/aiplatform/v1/feature_online_store_pb.rb +3 -1
  186. data/lib/google/cloud/aiplatform/v1/feature_online_store_service_pb.rb +1 -1
  187. data/lib/google/cloud/aiplatform/v1/feature_view_pb.rb +5 -1
  188. data/lib/google/cloud/aiplatform/v1/genai_tuning_service_pb.rb +54 -0
  189. data/lib/google/cloud/aiplatform/v1/genai_tuning_service_services_pb.rb +63 -0
  190. data/lib/google/cloud/aiplatform/v1/index_service_pb.rb +1 -1
  191. data/lib/google/cloud/aiplatform/v1/machine_resources_pb.rb +2 -1
  192. data/lib/google/cloud/aiplatform/v1/network_spec_pb.rb +44 -0
  193. data/lib/google/cloud/aiplatform/v1/notebook_euc_config_pb.rb +44 -0
  194. data/lib/google/cloud/aiplatform/v1/notebook_idle_shutdown_config_pb.rb +46 -0
  195. data/lib/google/cloud/aiplatform/v1/notebook_runtime_pb.rb +61 -0
  196. data/lib/google/cloud/aiplatform/v1/notebook_runtime_template_ref_pb.rb +45 -0
  197. data/lib/google/cloud/aiplatform/v1/notebook_service_pb.rb +72 -0
  198. data/lib/google/cloud/aiplatform/v1/notebook_service_services_pb.rb +64 -0
  199. data/lib/google/cloud/aiplatform/v1/openapi_pb.rb +1 -1
  200. data/lib/google/cloud/aiplatform/v1/persistent_resource_pb.rb +60 -0
  201. data/lib/google/cloud/aiplatform/v1/persistent_resource_service_pb.rb +64 -0
  202. data/lib/google/cloud/aiplatform/v1/persistent_resource_service_services_pb.rb +55 -0
  203. data/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb +1 -1
  204. data/lib/google/cloud/aiplatform/v1/publisher_model_pb.rb +1 -1
  205. data/lib/google/cloud/aiplatform/v1/tuning_job_pb.rb +60 -0
  206. data/proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb +3 -0
  207. data/proto_docs/google/cloud/aiplatform/v1/content.rb +52 -3
  208. data/proto_docs/google/cloud/aiplatform/v1/custom_job.rb +9 -0
  209. data/proto_docs/google/cloud/aiplatform/v1/endpoint.rb +14 -0
  210. data/proto_docs/google/cloud/aiplatform/v1/endpoint_service.rb +2 -3
  211. data/proto_docs/google/cloud/aiplatform/v1/feature_online_store.rb +29 -0
  212. data/proto_docs/google/cloud/aiplatform/v1/feature_online_store_service.rb +5 -0
  213. data/proto_docs/google/cloud/aiplatform/v1/feature_registry_service.rb +1 -1
  214. data/proto_docs/google/cloud/aiplatform/v1/feature_view.rb +86 -0
  215. data/proto_docs/google/cloud/aiplatform/v1/genai_tuning_service.rb +100 -0
  216. data/proto_docs/google/cloud/aiplatform/v1/index_service.rb +3 -0
  217. data/proto_docs/google/cloud/aiplatform/v1/machine_resources.rb +17 -0
  218. data/proto_docs/google/cloud/aiplatform/v1/network_spec.rb +44 -0
  219. data/proto_docs/google/cloud/aiplatform/v1/notebook_euc_config.rb +46 -0
  220. data/proto_docs/google/cloud/aiplatform/v1/notebook_idle_shutdown_config.rb +41 -0
  221. data/proto_docs/google/cloud/aiplatform/v1/notebook_runtime.rb +263 -0
  222. data/proto_docs/google/cloud/aiplatform/v1/notebook_runtime_template_ref.rb +35 -0
  223. data/proto_docs/google/cloud/aiplatform/v1/notebook_service.rb +371 -0
  224. data/proto_docs/google/cloud/aiplatform/v1/openapi.rb +43 -4
  225. data/proto_docs/google/cloud/aiplatform/v1/persistent_resource.rb +248 -0
  226. data/proto_docs/google/cloud/aiplatform/v1/persistent_resource_service.rb +170 -0
  227. data/proto_docs/google/cloud/aiplatform/v1/prediction_service.rb +12 -0
  228. data/proto_docs/google/cloud/aiplatform/v1/publisher_model.rb +4 -0
  229. data/proto_docs/google/cloud/aiplatform/v1/tool.rb +7 -5
  230. data/proto_docs/google/cloud/aiplatform/v1/tuning_job.rb +262 -0
  231. metadata +138 -2
@@ -0,0 +1,765 @@
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/genai_tuning_service_pb"
21
+ require "google/cloud/location"
22
+ require "google/iam/v1"
23
+
24
+ module Google
25
+ module Cloud
26
+ module AIPlatform
27
+ module V1
28
+ module GenAiTuningService
29
+ ##
30
+ # Client for the GenAiTuningService service.
31
+ #
32
+ # A service for creating and managing GenAI Tuning Jobs.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :gen_ai_tuning_service_stub
45
+
46
+ ##
47
+ # Configure the GenAiTuningService Client class.
48
+ #
49
+ # See {::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all GenAiTuningService clients
55
+ # ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "AIPlatform", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the GenAiTuningService Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # The effective universe domain
103
+ #
104
+ # @return [String]
105
+ #
106
+ def universe_domain
107
+ @gen_ai_tuning_service_stub.universe_domain
108
+ end
109
+
110
+ ##
111
+ # Create a new GenAiTuningService client object.
112
+ #
113
+ # @example
114
+ #
115
+ # # Create a client using the default configuration
116
+ # client = ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.new
117
+ #
118
+ # # Create a client using a custom configuration
119
+ # client = ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.new do |config|
120
+ # config.timeout = 10.0
121
+ # end
122
+ #
123
+ # @yield [config] Configure the GenAiTuningService client.
124
+ # @yieldparam config [Client::Configuration]
125
+ #
126
+ def initialize
127
+ # These require statements are intentionally placed here to initialize
128
+ # the gRPC module only when it's required.
129
+ # See https://github.com/googleapis/toolkit/issues/446
130
+ require "gapic/grpc"
131
+ require "google/cloud/aiplatform/v1/genai_tuning_service_services_pb"
132
+
133
+ # Create the configuration object
134
+ @config = Configuration.new Client.configure
135
+
136
+ # Yield the configuration if needed
137
+ yield @config if block_given?
138
+
139
+ # Create credentials
140
+ credentials = @config.credentials
141
+ # Use self-signed JWT if the endpoint is unchanged from default,
142
+ # but only if the default endpoint does not have a region prefix.
143
+ enable_self_signed_jwt = @config.endpoint.nil? ||
144
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
+ !@config.endpoint.split(".").first.include?("-"))
146
+ credentials ||= Credentials.default scope: @config.scope,
147
+ enable_self_signed_jwt: enable_self_signed_jwt
148
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
149
+ credentials = Credentials.new credentials, scope: @config.scope
150
+ end
151
+ @quota_project_id = @config.quota_project
152
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
153
+
154
+ @gen_ai_tuning_service_stub = ::Gapic::ServiceStub.new(
155
+ ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Stub,
156
+ credentials: credentials,
157
+ endpoint: @config.endpoint,
158
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
159
+ universe_domain: @config.universe_domain,
160
+ channel_args: @config.channel_args,
161
+ interceptors: @config.interceptors,
162
+ channel_pool_config: @config.channel_pool
163
+ )
164
+
165
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
166
+ config.credentials = credentials
167
+ config.quota_project = @quota_project_id
168
+ config.endpoint = @gen_ai_tuning_service_stub.endpoint
169
+ config.universe_domain = @gen_ai_tuning_service_stub.universe_domain
170
+ end
171
+
172
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
173
+ config.credentials = credentials
174
+ config.quota_project = @quota_project_id
175
+ config.endpoint = @gen_ai_tuning_service_stub.endpoint
176
+ config.universe_domain = @gen_ai_tuning_service_stub.universe_domain
177
+ end
178
+ end
179
+
180
+ ##
181
+ # Get the associated client for mix-in of the Locations.
182
+ #
183
+ # @return [Google::Cloud::Location::Locations::Client]
184
+ #
185
+ attr_reader :location_client
186
+
187
+ ##
188
+ # Get the associated client for mix-in of the IAMPolicy.
189
+ #
190
+ # @return [Google::Iam::V1::IAMPolicy::Client]
191
+ #
192
+ attr_reader :iam_policy_client
193
+
194
+ # Service calls
195
+
196
+ ##
197
+ # Creates a TuningJob. A created TuningJob right away will be attempted to
198
+ # be run.
199
+ #
200
+ # @overload create_tuning_job(request, options = nil)
201
+ # Pass arguments to `create_tuning_job` via a request object, either of type
202
+ # {::Google::Cloud::AIPlatform::V1::CreateTuningJobRequest} or an equivalent Hash.
203
+ #
204
+ # @param request [::Google::Cloud::AIPlatform::V1::CreateTuningJobRequest, ::Hash]
205
+ # A request object representing the call parameters. Required. To specify no
206
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
207
+ # @param options [::Gapic::CallOptions, ::Hash]
208
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
209
+ #
210
+ # @overload create_tuning_job(parent: nil, tuning_job: nil)
211
+ # Pass arguments to `create_tuning_job` via keyword arguments. Note that at
212
+ # least one keyword argument is required. To specify no parameters, or to keep all
213
+ # the default parameter values, pass an empty Hash as a request object (see above).
214
+ #
215
+ # @param parent [::String]
216
+ # Required. The resource name of the Location to create the TuningJob in.
217
+ # Format: `projects/{project}/locations/{location}`
218
+ # @param tuning_job [::Google::Cloud::AIPlatform::V1::TuningJob, ::Hash]
219
+ # Required. The TuningJob to create.
220
+ #
221
+ # @yield [response, operation] Access the result along with the RPC operation
222
+ # @yieldparam response [::Google::Cloud::AIPlatform::V1::TuningJob]
223
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
224
+ #
225
+ # @return [::Google::Cloud::AIPlatform::V1::TuningJob]
226
+ #
227
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
228
+ #
229
+ # @example Basic example
230
+ # require "google/cloud/ai_platform/v1"
231
+ #
232
+ # # Create a client object. The client can be reused for multiple calls.
233
+ # client = Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.new
234
+ #
235
+ # # Create a request. To set request fields, pass in keyword arguments.
236
+ # request = Google::Cloud::AIPlatform::V1::CreateTuningJobRequest.new
237
+ #
238
+ # # Call the create_tuning_job method.
239
+ # result = client.create_tuning_job request
240
+ #
241
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::TuningJob.
242
+ # p result
243
+ #
244
+ def create_tuning_job request, options = nil
245
+ raise ::ArgumentError, "request must be provided" if request.nil?
246
+
247
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTuningJobRequest
248
+
249
+ # Converts hash and nil to an options object
250
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
251
+
252
+ # Customize the options with defaults
253
+ metadata = @config.rpcs.create_tuning_job.metadata.to_h
254
+
255
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
256
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
257
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
258
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
259
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
260
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
261
+
262
+ header_params = {}
263
+ if request.parent
264
+ header_params["parent"] = request.parent
265
+ end
266
+
267
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
268
+ metadata[:"x-goog-request-params"] ||= request_params_header
269
+
270
+ options.apply_defaults timeout: @config.rpcs.create_tuning_job.timeout,
271
+ metadata: metadata,
272
+ retry_policy: @config.rpcs.create_tuning_job.retry_policy
273
+
274
+ options.apply_defaults timeout: @config.timeout,
275
+ metadata: @config.metadata,
276
+ retry_policy: @config.retry_policy
277
+
278
+ @gen_ai_tuning_service_stub.call_rpc :create_tuning_job, request, options: options do |response, operation|
279
+ yield response, operation if block_given?
280
+ return response
281
+ end
282
+ rescue ::GRPC::BadStatus => e
283
+ raise ::Google::Cloud::Error.from_error(e)
284
+ end
285
+
286
+ ##
287
+ # Gets a TuningJob.
288
+ #
289
+ # @overload get_tuning_job(request, options = nil)
290
+ # Pass arguments to `get_tuning_job` via a request object, either of type
291
+ # {::Google::Cloud::AIPlatform::V1::GetTuningJobRequest} or an equivalent Hash.
292
+ #
293
+ # @param request [::Google::Cloud::AIPlatform::V1::GetTuningJobRequest, ::Hash]
294
+ # A request object representing the call parameters. Required. To specify no
295
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
296
+ # @param options [::Gapic::CallOptions, ::Hash]
297
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
298
+ #
299
+ # @overload get_tuning_job(name: nil)
300
+ # Pass arguments to `get_tuning_job` via keyword arguments. Note that at
301
+ # least one keyword argument is required. To specify no parameters, or to keep all
302
+ # the default parameter values, pass an empty Hash as a request object (see above).
303
+ #
304
+ # @param name [::String]
305
+ # Required. The name of the TuningJob resource. Format:
306
+ # `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
307
+ #
308
+ # @yield [response, operation] Access the result along with the RPC operation
309
+ # @yieldparam response [::Google::Cloud::AIPlatform::V1::TuningJob]
310
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
311
+ #
312
+ # @return [::Google::Cloud::AIPlatform::V1::TuningJob]
313
+ #
314
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
315
+ #
316
+ # @example Basic example
317
+ # require "google/cloud/ai_platform/v1"
318
+ #
319
+ # # Create a client object. The client can be reused for multiple calls.
320
+ # client = Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.new
321
+ #
322
+ # # Create a request. To set request fields, pass in keyword arguments.
323
+ # request = Google::Cloud::AIPlatform::V1::GetTuningJobRequest.new
324
+ #
325
+ # # Call the get_tuning_job method.
326
+ # result = client.get_tuning_job request
327
+ #
328
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::TuningJob.
329
+ # p result
330
+ #
331
+ def get_tuning_job request, options = nil
332
+ raise ::ArgumentError, "request must be provided" if request.nil?
333
+
334
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTuningJobRequest
335
+
336
+ # Converts hash and nil to an options object
337
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
338
+
339
+ # Customize the options with defaults
340
+ metadata = @config.rpcs.get_tuning_job.metadata.to_h
341
+
342
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
343
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
344
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
345
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
346
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
347
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
348
+
349
+ header_params = {}
350
+ if request.name
351
+ header_params["name"] = request.name
352
+ end
353
+
354
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
355
+ metadata[:"x-goog-request-params"] ||= request_params_header
356
+
357
+ options.apply_defaults timeout: @config.rpcs.get_tuning_job.timeout,
358
+ metadata: metadata,
359
+ retry_policy: @config.rpcs.get_tuning_job.retry_policy
360
+
361
+ options.apply_defaults timeout: @config.timeout,
362
+ metadata: @config.metadata,
363
+ retry_policy: @config.retry_policy
364
+
365
+ @gen_ai_tuning_service_stub.call_rpc :get_tuning_job, request, options: options do |response, operation|
366
+ yield response, operation if block_given?
367
+ return response
368
+ end
369
+ rescue ::GRPC::BadStatus => e
370
+ raise ::Google::Cloud::Error.from_error(e)
371
+ end
372
+
373
+ ##
374
+ # Lists TuningJobs in a Location.
375
+ #
376
+ # @overload list_tuning_jobs(request, options = nil)
377
+ # Pass arguments to `list_tuning_jobs` via a request object, either of type
378
+ # {::Google::Cloud::AIPlatform::V1::ListTuningJobsRequest} or an equivalent Hash.
379
+ #
380
+ # @param request [::Google::Cloud::AIPlatform::V1::ListTuningJobsRequest, ::Hash]
381
+ # A request object representing the call parameters. Required. To specify no
382
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
383
+ # @param options [::Gapic::CallOptions, ::Hash]
384
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
385
+ #
386
+ # @overload list_tuning_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil)
387
+ # Pass arguments to `list_tuning_jobs` via keyword arguments. Note that at
388
+ # least one keyword argument is required. To specify no parameters, or to keep all
389
+ # the default parameter values, pass an empty Hash as a request object (see above).
390
+ #
391
+ # @param parent [::String]
392
+ # Required. The resource name of the Location to list the TuningJobs from.
393
+ # Format: `projects/{project}/locations/{location}`
394
+ # @param filter [::String]
395
+ # Optional. The standard list filter.
396
+ # @param page_size [::Integer]
397
+ # Optional. The standard list page size.
398
+ # @param page_token [::String]
399
+ # Optional. The standard list page token.
400
+ # Typically obtained via [ListTuningJob.next_page_token][] of the
401
+ # previous GenAiTuningService.ListTuningJob][] call.
402
+ #
403
+ # @yield [response, operation] Access the result along with the RPC operation
404
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TuningJob>]
405
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
406
+ #
407
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TuningJob>]
408
+ #
409
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
410
+ #
411
+ # @example Basic example
412
+ # require "google/cloud/ai_platform/v1"
413
+ #
414
+ # # Create a client object. The client can be reused for multiple calls.
415
+ # client = Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.new
416
+ #
417
+ # # Create a request. To set request fields, pass in keyword arguments.
418
+ # request = Google::Cloud::AIPlatform::V1::ListTuningJobsRequest.new
419
+ #
420
+ # # Call the list_tuning_jobs method.
421
+ # result = client.list_tuning_jobs request
422
+ #
423
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
424
+ # # over elements, and API calls will be issued to fetch pages as needed.
425
+ # result.each do |item|
426
+ # # Each element is of type ::Google::Cloud::AIPlatform::V1::TuningJob.
427
+ # p item
428
+ # end
429
+ #
430
+ def list_tuning_jobs request, options = nil
431
+ raise ::ArgumentError, "request must be provided" if request.nil?
432
+
433
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTuningJobsRequest
434
+
435
+ # Converts hash and nil to an options object
436
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
437
+
438
+ # Customize the options with defaults
439
+ metadata = @config.rpcs.list_tuning_jobs.metadata.to_h
440
+
441
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
442
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
443
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
444
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
445
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
446
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
447
+
448
+ header_params = {}
449
+ if request.parent
450
+ header_params["parent"] = request.parent
451
+ end
452
+
453
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
454
+ metadata[:"x-goog-request-params"] ||= request_params_header
455
+
456
+ options.apply_defaults timeout: @config.rpcs.list_tuning_jobs.timeout,
457
+ metadata: metadata,
458
+ retry_policy: @config.rpcs.list_tuning_jobs.retry_policy
459
+
460
+ options.apply_defaults timeout: @config.timeout,
461
+ metadata: @config.metadata,
462
+ retry_policy: @config.retry_policy
463
+
464
+ @gen_ai_tuning_service_stub.call_rpc :list_tuning_jobs, request, options: options do |response, operation|
465
+ response = ::Gapic::PagedEnumerable.new @gen_ai_tuning_service_stub, :list_tuning_jobs, request, response, operation, options
466
+ yield response, operation if block_given?
467
+ return response
468
+ end
469
+ rescue ::GRPC::BadStatus => e
470
+ raise ::Google::Cloud::Error.from_error(e)
471
+ end
472
+
473
+ ##
474
+ # Cancels a TuningJob.
475
+ # Starts asynchronous cancellation on the TuningJob. The server makes a best
476
+ # effort to cancel the job, but success is not guaranteed. Clients can use
477
+ # {::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client#get_tuning_job GenAiTuningService.GetTuningJob}
478
+ # or other methods to check whether the cancellation succeeded or whether the
479
+ # job completed despite cancellation. On successful cancellation, the
480
+ # TuningJob is not deleted; instead it becomes a job with a
481
+ # {::Google::Cloud::AIPlatform::V1::TuningJob#error TuningJob.error} value with a
482
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to
483
+ # `Code.CANCELLED`, and
484
+ # {::Google::Cloud::AIPlatform::V1::TuningJob#state TuningJob.state} is set to
485
+ # `CANCELLED`.
486
+ #
487
+ # @overload cancel_tuning_job(request, options = nil)
488
+ # Pass arguments to `cancel_tuning_job` via a request object, either of type
489
+ # {::Google::Cloud::AIPlatform::V1::CancelTuningJobRequest} or an equivalent Hash.
490
+ #
491
+ # @param request [::Google::Cloud::AIPlatform::V1::CancelTuningJobRequest, ::Hash]
492
+ # A request object representing the call parameters. Required. To specify no
493
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
494
+ # @param options [::Gapic::CallOptions, ::Hash]
495
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
496
+ #
497
+ # @overload cancel_tuning_job(name: nil)
498
+ # Pass arguments to `cancel_tuning_job` via keyword arguments. Note that at
499
+ # least one keyword argument is required. To specify no parameters, or to keep all
500
+ # the default parameter values, pass an empty Hash as a request object (see above).
501
+ #
502
+ # @param name [::String]
503
+ # Required. The name of the TuningJob to cancel. Format:
504
+ # `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
505
+ #
506
+ # @yield [response, operation] Access the result along with the RPC operation
507
+ # @yieldparam response [::Google::Protobuf::Empty]
508
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
509
+ #
510
+ # @return [::Google::Protobuf::Empty]
511
+ #
512
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
513
+ #
514
+ # @example Basic example
515
+ # require "google/cloud/ai_platform/v1"
516
+ #
517
+ # # Create a client object. The client can be reused for multiple calls.
518
+ # client = Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.new
519
+ #
520
+ # # Create a request. To set request fields, pass in keyword arguments.
521
+ # request = Google::Cloud::AIPlatform::V1::CancelTuningJobRequest.new
522
+ #
523
+ # # Call the cancel_tuning_job method.
524
+ # result = client.cancel_tuning_job request
525
+ #
526
+ # # The returned object is of type Google::Protobuf::Empty.
527
+ # p result
528
+ #
529
+ def cancel_tuning_job request, options = nil
530
+ raise ::ArgumentError, "request must be provided" if request.nil?
531
+
532
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelTuningJobRequest
533
+
534
+ # Converts hash and nil to an options object
535
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
536
+
537
+ # Customize the options with defaults
538
+ metadata = @config.rpcs.cancel_tuning_job.metadata.to_h
539
+
540
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
541
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
542
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
543
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
544
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
545
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
546
+
547
+ header_params = {}
548
+ if request.name
549
+ header_params["name"] = request.name
550
+ end
551
+
552
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
553
+ metadata[:"x-goog-request-params"] ||= request_params_header
554
+
555
+ options.apply_defaults timeout: @config.rpcs.cancel_tuning_job.timeout,
556
+ metadata: metadata,
557
+ retry_policy: @config.rpcs.cancel_tuning_job.retry_policy
558
+
559
+ options.apply_defaults timeout: @config.timeout,
560
+ metadata: @config.metadata,
561
+ retry_policy: @config.retry_policy
562
+
563
+ @gen_ai_tuning_service_stub.call_rpc :cancel_tuning_job, request, options: options do |response, operation|
564
+ yield response, operation if block_given?
565
+ return response
566
+ end
567
+ rescue ::GRPC::BadStatus => e
568
+ raise ::Google::Cloud::Error.from_error(e)
569
+ end
570
+
571
+ ##
572
+ # Configuration class for the GenAiTuningService API.
573
+ #
574
+ # This class represents the configuration for GenAiTuningService,
575
+ # providing control over timeouts, retry behavior, logging, transport
576
+ # parameters, and other low-level controls. Certain parameters can also be
577
+ # applied individually to specific RPCs. See
578
+ # {::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client::Configuration::Rpcs}
579
+ # for a list of RPCs that can be configured independently.
580
+ #
581
+ # Configuration can be applied globally to all clients, or to a single client
582
+ # on construction.
583
+ #
584
+ # @example
585
+ #
586
+ # # Modify the global config, setting the timeout for
587
+ # # create_tuning_job to 20 seconds,
588
+ # # and all remaining timeouts to 10 seconds.
589
+ # ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.configure do |config|
590
+ # config.timeout = 10.0
591
+ # config.rpcs.create_tuning_job.timeout = 20.0
592
+ # end
593
+ #
594
+ # # Apply the above configuration only to a new client.
595
+ # client = ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.new do |config|
596
+ # config.timeout = 10.0
597
+ # config.rpcs.create_tuning_job.timeout = 20.0
598
+ # end
599
+ #
600
+ # @!attribute [rw] endpoint
601
+ # A custom service endpoint, as a hostname or hostname:port. The default is
602
+ # nil, indicating to use the default endpoint in the current universe domain.
603
+ # @return [::String,nil]
604
+ # @!attribute [rw] credentials
605
+ # Credentials to send with calls. You may provide any of the following types:
606
+ # * (`String`) The path to a service account key file in JSON format
607
+ # * (`Hash`) A service account key as a Hash
608
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
609
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
610
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
611
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
612
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
613
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
614
+ # * (`nil`) indicating no credentials
615
+ # @return [::Object]
616
+ # @!attribute [rw] scope
617
+ # The OAuth scopes
618
+ # @return [::Array<::String>]
619
+ # @!attribute [rw] lib_name
620
+ # The library name as recorded in instrumentation and logging
621
+ # @return [::String]
622
+ # @!attribute [rw] lib_version
623
+ # The library version as recorded in instrumentation and logging
624
+ # @return [::String]
625
+ # @!attribute [rw] channel_args
626
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
627
+ # `GRPC::Core::Channel` object is provided as the credential.
628
+ # @return [::Hash]
629
+ # @!attribute [rw] interceptors
630
+ # An array of interceptors that are run before calls are executed.
631
+ # @return [::Array<::GRPC::ClientInterceptor>]
632
+ # @!attribute [rw] timeout
633
+ # The call timeout in seconds.
634
+ # @return [::Numeric]
635
+ # @!attribute [rw] metadata
636
+ # Additional gRPC headers to be sent with the call.
637
+ # @return [::Hash{::Symbol=>::String}]
638
+ # @!attribute [rw] retry_policy
639
+ # The retry policy. The value is a hash with the following keys:
640
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
641
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
642
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
643
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
644
+ # trigger a retry.
645
+ # @return [::Hash]
646
+ # @!attribute [rw] quota_project
647
+ # A separate project against which to charge quota.
648
+ # @return [::String]
649
+ # @!attribute [rw] universe_domain
650
+ # The universe domain within which to make requests. This determines the
651
+ # default endpoint URL. The default value of nil uses the environment
652
+ # universe (usually the default "googleapis.com" universe).
653
+ # @return [::String,nil]
654
+ #
655
+ class Configuration
656
+ extend ::Gapic::Config
657
+
658
+ # @private
659
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
660
+ DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
661
+
662
+ config_attr :endpoint, nil, ::String, nil
663
+ config_attr :credentials, nil do |value|
664
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
665
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
666
+ allowed.any? { |klass| klass === value }
667
+ end
668
+ config_attr :scope, nil, ::String, ::Array, nil
669
+ config_attr :lib_name, nil, ::String, nil
670
+ config_attr :lib_version, nil, ::String, nil
671
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
672
+ config_attr :interceptors, nil, ::Array, nil
673
+ config_attr :timeout, nil, ::Numeric, nil
674
+ config_attr :metadata, nil, ::Hash, nil
675
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
676
+ config_attr :quota_project, nil, ::String, nil
677
+ config_attr :universe_domain, nil, ::String, nil
678
+
679
+ # @private
680
+ def initialize parent_config = nil
681
+ @parent_config = parent_config unless parent_config.nil?
682
+
683
+ yield self if block_given?
684
+ end
685
+
686
+ ##
687
+ # Configurations for individual RPCs
688
+ # @return [Rpcs]
689
+ #
690
+ def rpcs
691
+ @rpcs ||= begin
692
+ parent_rpcs = nil
693
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
694
+ Rpcs.new parent_rpcs
695
+ end
696
+ end
697
+
698
+ ##
699
+ # Configuration for the channel pool
700
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
701
+ #
702
+ def channel_pool
703
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
704
+ end
705
+
706
+ ##
707
+ # Configuration RPC class for the GenAiTuningService API.
708
+ #
709
+ # Includes fields providing the configuration for each RPC in this service.
710
+ # Each configuration object is of type `Gapic::Config::Method` and includes
711
+ # the following configuration fields:
712
+ #
713
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
714
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
715
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
716
+ # include the following keys:
717
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
718
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
719
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
720
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
721
+ # trigger a retry.
722
+ #
723
+ class Rpcs
724
+ ##
725
+ # RPC-specific configuration for `create_tuning_job`
726
+ # @return [::Gapic::Config::Method]
727
+ #
728
+ attr_reader :create_tuning_job
729
+ ##
730
+ # RPC-specific configuration for `get_tuning_job`
731
+ # @return [::Gapic::Config::Method]
732
+ #
733
+ attr_reader :get_tuning_job
734
+ ##
735
+ # RPC-specific configuration for `list_tuning_jobs`
736
+ # @return [::Gapic::Config::Method]
737
+ #
738
+ attr_reader :list_tuning_jobs
739
+ ##
740
+ # RPC-specific configuration for `cancel_tuning_job`
741
+ # @return [::Gapic::Config::Method]
742
+ #
743
+ attr_reader :cancel_tuning_job
744
+
745
+ # @private
746
+ def initialize parent_rpcs = nil
747
+ create_tuning_job_config = parent_rpcs.create_tuning_job if parent_rpcs.respond_to? :create_tuning_job
748
+ @create_tuning_job = ::Gapic::Config::Method.new create_tuning_job_config
749
+ get_tuning_job_config = parent_rpcs.get_tuning_job if parent_rpcs.respond_to? :get_tuning_job
750
+ @get_tuning_job = ::Gapic::Config::Method.new get_tuning_job_config
751
+ list_tuning_jobs_config = parent_rpcs.list_tuning_jobs if parent_rpcs.respond_to? :list_tuning_jobs
752
+ @list_tuning_jobs = ::Gapic::Config::Method.new list_tuning_jobs_config
753
+ cancel_tuning_job_config = parent_rpcs.cancel_tuning_job if parent_rpcs.respond_to? :cancel_tuning_job
754
+ @cancel_tuning_job = ::Gapic::Config::Method.new cancel_tuning_job_config
755
+
756
+ yield self if block_given?
757
+ end
758
+ end
759
+ end
760
+ end
761
+ end
762
+ end
763
+ end
764
+ end
765
+ end