google-cloud-ai_platform-v1 0.39.0 → 0.40.0

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