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,574 @@
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/migration_service_pb"
21
+ require "google/cloud/ai_platform/v1/migration_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 MigrationService
30
+ module Rest
31
+ ##
32
+ # REST client for the MigrationService service.
33
+ #
34
+ # A service that migrates resources from automl.googleapis.com,
35
+ # datalabeling.googleapis.com and ml.googleapis.com to Vertex AI.
36
+ #
37
+ class Client
38
+ # @private
39
+ API_VERSION = ""
40
+
41
+ # @private
42
+ DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$"
43
+
44
+ include Paths
45
+
46
+ # @private
47
+ attr_reader :migration_service_stub
48
+
49
+ ##
50
+ # Configure the MigrationService Client class.
51
+ #
52
+ # See {::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client::Configuration}
53
+ # for a description of the configuration fields.
54
+ #
55
+ # @example
56
+ #
57
+ # # Modify the configuration for all MigrationService clients
58
+ # ::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client.configure do |config|
59
+ # config.timeout = 10.0
60
+ # end
61
+ #
62
+ # @yield [config] Configure the Client client.
63
+ # @yieldparam config [Client::Configuration]
64
+ #
65
+ # @return [Client::Configuration]
66
+ #
67
+ def self.configure
68
+ @configure ||= begin
69
+ namespace = ["Google", "Cloud", "AIPlatform", "V1"]
70
+ parent_config = while namespace.any?
71
+ parent_name = namespace.join "::"
72
+ parent_const = const_get parent_name
73
+ break parent_const.configure if parent_const.respond_to? :configure
74
+ namespace.pop
75
+ end
76
+ default_config = Client::Configuration.new parent_config
77
+
78
+ default_config
79
+ end
80
+ yield @configure if block_given?
81
+ @configure
82
+ end
83
+
84
+ ##
85
+ # Configure the MigrationService Client instance.
86
+ #
87
+ # The configuration is set to the derived mode, meaning that values can be changed,
88
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
89
+ # should be made on {Client.configure}.
90
+ #
91
+ # See {::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client::Configuration}
92
+ # for a description of the configuration fields.
93
+ #
94
+ # @yield [config] Configure the Client client.
95
+ # @yieldparam config [Client::Configuration]
96
+ #
97
+ # @return [Client::Configuration]
98
+ #
99
+ def configure
100
+ yield @config if block_given?
101
+ @config
102
+ end
103
+
104
+ ##
105
+ # The effective universe domain
106
+ #
107
+ # @return [String]
108
+ #
109
+ def universe_domain
110
+ @migration_service_stub.universe_domain
111
+ end
112
+
113
+ ##
114
+ # Create a new MigrationService REST client object.
115
+ #
116
+ # @example
117
+ #
118
+ # # Create a client using the default configuration
119
+ # client = ::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client.new
120
+ #
121
+ # # Create a client using a custom configuration
122
+ # client = ::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client.new do |config|
123
+ # config.timeout = 10.0
124
+ # end
125
+ #
126
+ # @yield [config] Configure the MigrationService client.
127
+ # @yieldparam config [Client::Configuration]
128
+ #
129
+ def initialize
130
+ # Create the configuration object
131
+ @config = Configuration.new Client.configure
132
+
133
+ # Yield the configuration if needed
134
+ yield @config if block_given?
135
+
136
+ # Create credentials
137
+ credentials = @config.credentials
138
+ # Use self-signed JWT if the endpoint is unchanged from default,
139
+ # but only if the default endpoint does not have a region prefix.
140
+ enable_self_signed_jwt = @config.endpoint.nil? ||
141
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
142
+ !@config.endpoint.split(".").first.include?("-"))
143
+ credentials ||= Credentials.default scope: @config.scope,
144
+ enable_self_signed_jwt: enable_self_signed_jwt
145
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
146
+ credentials = Credentials.new credentials, scope: @config.scope
147
+ end
148
+
149
+ @quota_project_id = @config.quota_project
150
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
151
+
152
+ @operations_client = ::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Operations.new do |config|
153
+ config.credentials = credentials
154
+ config.quota_project = @quota_project_id
155
+ config.endpoint = @config.endpoint
156
+ config.universe_domain = @config.universe_domain
157
+ end
158
+
159
+ @migration_service_stub = ::Google::Cloud::AIPlatform::V1::MigrationService::Rest::ServiceStub.new(
160
+ endpoint: @config.endpoint,
161
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
162
+ universe_domain: @config.universe_domain,
163
+ credentials: credentials
164
+ )
165
+
166
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
167
+ config.credentials = credentials
168
+ config.quota_project = @quota_project_id
169
+ config.endpoint = @migration_service_stub.endpoint
170
+ config.universe_domain = @migration_service_stub.universe_domain
171
+ config.bindings_override = @config.bindings_override
172
+ end
173
+
174
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
175
+ config.credentials = credentials
176
+ config.quota_project = @quota_project_id
177
+ config.endpoint = @migration_service_stub.endpoint
178
+ config.universe_domain = @migration_service_stub.universe_domain
179
+ config.bindings_override = @config.bindings_override
180
+ end
181
+ end
182
+
183
+ ##
184
+ # Get the associated client for long-running operations.
185
+ #
186
+ # @return [::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Operations]
187
+ #
188
+ attr_reader :operations_client
189
+
190
+ ##
191
+ # Get the associated client for mix-in of the Locations.
192
+ #
193
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
194
+ #
195
+ attr_reader :location_client
196
+
197
+ ##
198
+ # Get the associated client for mix-in of the IAMPolicy.
199
+ #
200
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
201
+ #
202
+ attr_reader :iam_policy_client
203
+
204
+ # Service calls
205
+
206
+ ##
207
+ # Searches all of the resources in automl.googleapis.com,
208
+ # datalabeling.googleapis.com and ml.googleapis.com that can be migrated to
209
+ # Vertex AI's given location.
210
+ #
211
+ # @overload search_migratable_resources(request, options = nil)
212
+ # Pass arguments to `search_migratable_resources` via a request object, either of type
213
+ # {::Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest} or an equivalent Hash.
214
+ #
215
+ # @param request [::Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest, ::Hash]
216
+ # A request object representing the call parameters. Required. To specify no
217
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
218
+ # @param options [::Gapic::CallOptions, ::Hash]
219
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
220
+ #
221
+ # @overload search_migratable_resources(parent: nil, page_size: nil, page_token: nil, filter: nil)
222
+ # Pass arguments to `search_migratable_resources` via keyword arguments. Note that at
223
+ # least one keyword argument is required. To specify no parameters, or to keep all
224
+ # the default parameter values, pass an empty Hash as a request object (see above).
225
+ #
226
+ # @param parent [::String]
227
+ # Required. The location that the migratable resources should be searched
228
+ # from. It's the Vertex AI location that the resources can be migrated to,
229
+ # not the resources' original location. Format:
230
+ # `projects/{project}/locations/{location}`
231
+ # @param page_size [::Integer]
232
+ # The standard page size.
233
+ # The default and maximum value is 100.
234
+ # @param page_token [::String]
235
+ # The standard page token.
236
+ # @param filter [::String]
237
+ # A filter for your search. You can use the following types of filters:
238
+ #
239
+ # * Resource type filters. The following strings filter for a specific type
240
+ # of {::Google::Cloud::AIPlatform::V1::MigratableResource MigratableResource}:
241
+ # * `ml_engine_model_version:*`
242
+ # * `automl_model:*`
243
+ # * `automl_dataset:*`
244
+ # * `data_labeling_dataset:*`
245
+ # * "Migrated or not" filters. The following strings filter for resources
246
+ # that either have or have not already been migrated:
247
+ # * `last_migrate_time:*` filters for migrated resources.
248
+ # * `NOT last_migrate_time:*` filters for not yet migrated resources.
249
+ # @yield [result, operation] Access the result along with the TransportOperation object
250
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MigratableResource>]
251
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
252
+ #
253
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MigratableResource>]
254
+ #
255
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
256
+ #
257
+ # @example Basic example
258
+ # require "google/cloud/ai_platform/v1"
259
+ #
260
+ # # Create a client object. The client can be reused for multiple calls.
261
+ # client = Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client.new
262
+ #
263
+ # # Create a request. To set request fields, pass in keyword arguments.
264
+ # request = Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest.new
265
+ #
266
+ # # Call the search_migratable_resources method.
267
+ # result = client.search_migratable_resources request
268
+ #
269
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
270
+ # # over elements, and API calls will be issued to fetch pages as needed.
271
+ # result.each do |item|
272
+ # # Each element is of type ::Google::Cloud::AIPlatform::V1::MigratableResource.
273
+ # p item
274
+ # end
275
+ #
276
+ def search_migratable_resources request, options = nil
277
+ raise ::ArgumentError, "request must be provided" if request.nil?
278
+
279
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest
280
+
281
+ # Converts hash and nil to an options object
282
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
283
+
284
+ # Customize the options with defaults
285
+ call_metadata = @config.rpcs.search_migratable_resources.metadata.to_h
286
+
287
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
288
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
289
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
290
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
291
+ transports_version_send: [:rest]
292
+
293
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
294
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
295
+
296
+ options.apply_defaults timeout: @config.rpcs.search_migratable_resources.timeout,
297
+ metadata: call_metadata,
298
+ retry_policy: @config.rpcs.search_migratable_resources.retry_policy
299
+
300
+ options.apply_defaults timeout: @config.timeout,
301
+ metadata: @config.metadata,
302
+ retry_policy: @config.retry_policy
303
+
304
+ @migration_service_stub.search_migratable_resources request, options do |result, operation|
305
+ result = ::Gapic::Rest::PagedEnumerable.new @migration_service_stub, :search_migratable_resources, "migratable_resources", request, result, options
306
+ yield result, operation if block_given?
307
+ return result
308
+ end
309
+ rescue ::Gapic::Rest::Error => e
310
+ raise ::Google::Cloud::Error.from_error(e)
311
+ end
312
+
313
+ ##
314
+ # Batch migrates resources from ml.googleapis.com, automl.googleapis.com,
315
+ # and datalabeling.googleapis.com to Vertex AI.
316
+ #
317
+ # @overload batch_migrate_resources(request, options = nil)
318
+ # Pass arguments to `batch_migrate_resources` via a request object, either of type
319
+ # {::Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest} or an equivalent Hash.
320
+ #
321
+ # @param request [::Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest, ::Hash]
322
+ # A request object representing the call parameters. Required. To specify no
323
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
324
+ # @param options [::Gapic::CallOptions, ::Hash]
325
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
326
+ #
327
+ # @overload batch_migrate_resources(parent: nil, migrate_resource_requests: nil)
328
+ # Pass arguments to `batch_migrate_resources` via keyword arguments. Note that at
329
+ # least one keyword argument is required. To specify no parameters, or to keep all
330
+ # the default parameter values, pass an empty Hash as a request object (see above).
331
+ #
332
+ # @param parent [::String]
333
+ # Required. The location of the migrated resource will live in.
334
+ # Format: `projects/{project}/locations/{location}`
335
+ # @param migrate_resource_requests [::Array<::Google::Cloud::AIPlatform::V1::MigrateResourceRequest, ::Hash>]
336
+ # Required. The request messages specifying the resources to migrate.
337
+ # They must be in the same location as the destination.
338
+ # Up to 50 resources can be migrated in one batch.
339
+ # @yield [result, operation] Access the result along with the TransportOperation object
340
+ # @yieldparam result [::Gapic::Operation]
341
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
342
+ #
343
+ # @return [::Gapic::Operation]
344
+ #
345
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
346
+ #
347
+ # @example Basic example
348
+ # require "google/cloud/ai_platform/v1"
349
+ #
350
+ # # Create a client object. The client can be reused for multiple calls.
351
+ # client = Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client.new
352
+ #
353
+ # # Create a request. To set request fields, pass in keyword arguments.
354
+ # request = Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest.new
355
+ #
356
+ # # Call the batch_migrate_resources method.
357
+ # result = client.batch_migrate_resources request
358
+ #
359
+ # # The returned object is of type Gapic::Operation. You can use it to
360
+ # # check the status of an operation, cancel it, or wait for results.
361
+ # # Here is how to wait for a response.
362
+ # result.wait_until_done! timeout: 60
363
+ # if result.response?
364
+ # p result.response
365
+ # else
366
+ # puts "No response received."
367
+ # end
368
+ #
369
+ def batch_migrate_resources request, options = nil
370
+ raise ::ArgumentError, "request must be provided" if request.nil?
371
+
372
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest
373
+
374
+ # Converts hash and nil to an options object
375
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
376
+
377
+ # Customize the options with defaults
378
+ call_metadata = @config.rpcs.batch_migrate_resources.metadata.to_h
379
+
380
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
381
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
382
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
383
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
384
+ transports_version_send: [:rest]
385
+
386
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
387
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
388
+
389
+ options.apply_defaults timeout: @config.rpcs.batch_migrate_resources.timeout,
390
+ metadata: call_metadata,
391
+ retry_policy: @config.rpcs.batch_migrate_resources.retry_policy
392
+
393
+ options.apply_defaults timeout: @config.timeout,
394
+ metadata: @config.metadata,
395
+ retry_policy: @config.retry_policy
396
+
397
+ @migration_service_stub.batch_migrate_resources request, options do |result, operation|
398
+ result = ::Gapic::Operation.new result, @operations_client, options: options
399
+ yield result, operation if block_given?
400
+ return result
401
+ end
402
+ rescue ::Gapic::Rest::Error => e
403
+ raise ::Google::Cloud::Error.from_error(e)
404
+ end
405
+
406
+ ##
407
+ # Configuration class for the MigrationService REST API.
408
+ #
409
+ # This class represents the configuration for MigrationService REST,
410
+ # providing control over timeouts, retry behavior, logging, transport
411
+ # parameters, and other low-level controls. Certain parameters can also be
412
+ # applied individually to specific RPCs. See
413
+ # {::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client::Configuration::Rpcs}
414
+ # for a list of RPCs that can be configured independently.
415
+ #
416
+ # Configuration can be applied globally to all clients, or to a single client
417
+ # on construction.
418
+ #
419
+ # @example
420
+ #
421
+ # # Modify the global config, setting the timeout for
422
+ # # search_migratable_resources to 20 seconds,
423
+ # # and all remaining timeouts to 10 seconds.
424
+ # ::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client.configure do |config|
425
+ # config.timeout = 10.0
426
+ # config.rpcs.search_migratable_resources.timeout = 20.0
427
+ # end
428
+ #
429
+ # # Apply the above configuration only to a new client.
430
+ # client = ::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client.new do |config|
431
+ # config.timeout = 10.0
432
+ # config.rpcs.search_migratable_resources.timeout = 20.0
433
+ # end
434
+ #
435
+ # @!attribute [rw] endpoint
436
+ # A custom service endpoint, as a hostname or hostname:port. The default is
437
+ # nil, indicating to use the default endpoint in the current universe domain.
438
+ # @return [::String,nil]
439
+ # @!attribute [rw] credentials
440
+ # Credentials to send with calls. You may provide any of the following types:
441
+ # * (`String`) The path to a service account key file in JSON format
442
+ # * (`Hash`) A service account key as a Hash
443
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
444
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
445
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
446
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
447
+ # * (`nil`) indicating no credentials
448
+ # @return [::Object]
449
+ # @!attribute [rw] scope
450
+ # The OAuth scopes
451
+ # @return [::Array<::String>]
452
+ # @!attribute [rw] lib_name
453
+ # The library name as recorded in instrumentation and logging
454
+ # @return [::String]
455
+ # @!attribute [rw] lib_version
456
+ # The library version as recorded in instrumentation and logging
457
+ # @return [::String]
458
+ # @!attribute [rw] timeout
459
+ # The call timeout in seconds.
460
+ # @return [::Numeric]
461
+ # @!attribute [rw] metadata
462
+ # Additional headers to be sent with the call.
463
+ # @return [::Hash{::Symbol=>::String}]
464
+ # @!attribute [rw] retry_policy
465
+ # The retry policy. The value is a hash with the following keys:
466
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
467
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
468
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
469
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
470
+ # trigger a retry.
471
+ # @return [::Hash]
472
+ # @!attribute [rw] quota_project
473
+ # A separate project against which to charge quota.
474
+ # @return [::String]
475
+ # @!attribute [rw] universe_domain
476
+ # The universe domain within which to make requests. This determines the
477
+ # default endpoint URL. The default value of nil uses the environment
478
+ # universe (usually the default "googleapis.com" universe).
479
+ # @return [::String,nil]
480
+ #
481
+ class Configuration
482
+ extend ::Gapic::Config
483
+
484
+ # @private
485
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
486
+ DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
487
+
488
+ config_attr :endpoint, nil, ::String, nil
489
+ config_attr :credentials, nil do |value|
490
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
491
+ allowed.any? { |klass| klass === value }
492
+ end
493
+ config_attr :scope, nil, ::String, ::Array, nil
494
+ config_attr :lib_name, nil, ::String, nil
495
+ config_attr :lib_version, nil, ::String, nil
496
+ config_attr :timeout, nil, ::Numeric, nil
497
+ config_attr :metadata, nil, ::Hash, nil
498
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
499
+ config_attr :quota_project, nil, ::String, nil
500
+ config_attr :universe_domain, nil, ::String, nil
501
+
502
+ # @private
503
+ # Overrides for http bindings for the RPCs of this service
504
+ # are only used when this service is used as mixin, and only
505
+ # by the host service.
506
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
507
+ config_attr :bindings_override, {}, ::Hash, nil
508
+
509
+ # @private
510
+ def initialize parent_config = nil
511
+ @parent_config = parent_config unless parent_config.nil?
512
+
513
+ yield self if block_given?
514
+ end
515
+
516
+ ##
517
+ # Configurations for individual RPCs
518
+ # @return [Rpcs]
519
+ #
520
+ def rpcs
521
+ @rpcs ||= begin
522
+ parent_rpcs = nil
523
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
524
+ Rpcs.new parent_rpcs
525
+ end
526
+ end
527
+
528
+ ##
529
+ # Configuration RPC class for the MigrationService API.
530
+ #
531
+ # Includes fields providing the configuration for each RPC in this service.
532
+ # Each configuration object is of type `Gapic::Config::Method` and includes
533
+ # the following configuration fields:
534
+ #
535
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
536
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
537
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
538
+ # include the following keys:
539
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
540
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
541
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
542
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
543
+ # trigger a retry.
544
+ #
545
+ class Rpcs
546
+ ##
547
+ # RPC-specific configuration for `search_migratable_resources`
548
+ # @return [::Gapic::Config::Method]
549
+ #
550
+ attr_reader :search_migratable_resources
551
+ ##
552
+ # RPC-specific configuration for `batch_migrate_resources`
553
+ # @return [::Gapic::Config::Method]
554
+ #
555
+ attr_reader :batch_migrate_resources
556
+
557
+ # @private
558
+ def initialize parent_rpcs = nil
559
+ search_migratable_resources_config = parent_rpcs.search_migratable_resources if parent_rpcs.respond_to? :search_migratable_resources
560
+ @search_migratable_resources = ::Gapic::Config::Method.new search_migratable_resources_config
561
+ batch_migrate_resources_config = parent_rpcs.batch_migrate_resources if parent_rpcs.respond_to? :batch_migrate_resources
562
+ @batch_migrate_resources = ::Gapic::Config::Method.new batch_migrate_resources_config
563
+
564
+ yield self if block_given?
565
+ end
566
+ end
567
+ end
568
+ end
569
+ end
570
+ end
571
+ end
572
+ end
573
+ end
574
+ end