1 /* 2 * Copyright 2022 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 /** 18 * A client to Vertex AI API 19 * 20 * <p>The interfaces provided are listed below, along with usage samples. 21 * 22 * <p>======================= DatasetServiceClient ======================= 23 * 24 * <p>Service Description: The service that handles the CRUD of Vertex AI Dataset and its child 25 * resources. 26 * 27 * <p>Sample for DatasetServiceClient: 28 * 29 * <pre>{@code 30 * // This snippet has been automatically generated and should be regarded as a code template only. 31 * // It will require modifications to work: 32 * // - It may require correct/in-range values for request initialization. 33 * // - It may require specifying regional endpoints when creating the service client as shown in 34 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 35 * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { 36 * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); 37 * Dataset response = datasetServiceClient.getDataset(name); 38 * } 39 * }</pre> 40 * 41 * <p>======================= DeploymentResourcePoolServiceClient ======================= 42 * 43 * <p>Service Description: A service that manages the DeploymentResourcePool resource. 44 * 45 * <p>Sample for DeploymentResourcePoolServiceClient: 46 * 47 * <pre>{@code 48 * // This snippet has been automatically generated and should be regarded as a code template only. 49 * // It will require modifications to work: 50 * // - It may require correct/in-range values for request initialization. 51 * // - It may require specifying regional endpoints when creating the service client as shown in 52 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 53 * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = 54 * DeploymentResourcePoolServiceClient.create()) { 55 * DeploymentResourcePoolName name = 56 * DeploymentResourcePoolName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT_RESOURCE_POOL]"); 57 * DeploymentResourcePool response = 58 * deploymentResourcePoolServiceClient.getDeploymentResourcePool(name); 59 * } 60 * }</pre> 61 * 62 * <p>======================= EndpointServiceClient ======================= 63 * 64 * <p>Service Description: A service for managing Vertex AI's Endpoints. 65 * 66 * <p>Sample for EndpointServiceClient: 67 * 68 * <pre>{@code 69 * // This snippet has been automatically generated and should be regarded as a code template only. 70 * // It will require modifications to work: 71 * // - It may require correct/in-range values for request initialization. 72 * // - It may require specifying regional endpoints when creating the service client as shown in 73 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 74 * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { 75 * EndpointName name = 76 * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); 77 * Endpoint response = endpointServiceClient.getEndpoint(name); 78 * } 79 * }</pre> 80 * 81 * <p>======================= FeaturestoreOnlineServingServiceClient ======================= 82 * 83 * <p>Service Description: A service for serving online feature values. 84 * 85 * <p>Sample for FeaturestoreOnlineServingServiceClient: 86 * 87 * <pre>{@code 88 * // This snippet has been automatically generated and should be regarded as a code template only. 89 * // It will require modifications to work: 90 * // - It may require correct/in-range values for request initialization. 91 * // - It may require specifying regional endpoints when creating the service client as shown in 92 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 93 * try (FeaturestoreOnlineServingServiceClient featurestoreOnlineServingServiceClient = 94 * FeaturestoreOnlineServingServiceClient.create()) { 95 * EntityTypeName entityType = 96 * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]"); 97 * ReadFeatureValuesResponse response = 98 * featurestoreOnlineServingServiceClient.readFeatureValues(entityType); 99 * } 100 * }</pre> 101 * 102 * <p>======================= FeaturestoreServiceClient ======================= 103 * 104 * <p>Service Description: The service that handles CRUD and List for resources for Featurestore. 105 * 106 * <p>Sample for FeaturestoreServiceClient: 107 * 108 * <pre>{@code 109 * // This snippet has been automatically generated and should be regarded as a code template only. 110 * // It will require modifications to work: 111 * // - It may require correct/in-range values for request initialization. 112 * // - It may require specifying regional endpoints when creating the service client as shown in 113 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 114 * try (FeaturestoreServiceClient featurestoreServiceClient = FeaturestoreServiceClient.create()) { 115 * FeaturestoreName name = FeaturestoreName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]"); 116 * Featurestore response = featurestoreServiceClient.getFeaturestore(name); 117 * } 118 * }</pre> 119 * 120 * <p>======================= IndexEndpointServiceClient ======================= 121 * 122 * <p>Service Description: A service for managing Vertex AI's IndexEndpoints. 123 * 124 * <p>Sample for IndexEndpointServiceClient: 125 * 126 * <pre>{@code 127 * // This snippet has been automatically generated and should be regarded as a code template only. 128 * // It will require modifications to work: 129 * // - It may require correct/in-range values for request initialization. 130 * // - It may require specifying regional endpoints when creating the service client as shown in 131 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 132 * try (IndexEndpointServiceClient indexEndpointServiceClient = 133 * IndexEndpointServiceClient.create()) { 134 * IndexEndpointName name = IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]"); 135 * IndexEndpoint response = indexEndpointServiceClient.getIndexEndpoint(name); 136 * } 137 * }</pre> 138 * 139 * <p>======================= IndexServiceClient ======================= 140 * 141 * <p>Service Description: A service for creating and managing Vertex AI's Index resources. 142 * 143 * <p>Sample for IndexServiceClient: 144 * 145 * <pre>{@code 146 * // This snippet has been automatically generated and should be regarded as a code template only. 147 * // It will require modifications to work: 148 * // - It may require correct/in-range values for request initialization. 149 * // - It may require specifying regional endpoints when creating the service client as shown in 150 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 151 * try (IndexServiceClient indexServiceClient = IndexServiceClient.create()) { 152 * IndexName name = IndexName.of("[PROJECT]", "[LOCATION]", "[INDEX]"); 153 * Index response = indexServiceClient.getIndex(name); 154 * } 155 * }</pre> 156 * 157 * <p>======================= JobServiceClient ======================= 158 * 159 * <p>Service Description: A service for creating and managing Vertex AI's jobs. 160 * 161 * <p>Sample for JobServiceClient: 162 * 163 * <pre>{@code 164 * // This snippet has been automatically generated and should be regarded as a code template only. 165 * // It will require modifications to work: 166 * // - It may require correct/in-range values for request initialization. 167 * // - It may require specifying regional endpoints when creating the service client as shown in 168 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 169 * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { 170 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 171 * CustomJob customJob = CustomJob.newBuilder().build(); 172 * CustomJob response = jobServiceClient.createCustomJob(parent, customJob); 173 * } 174 * }</pre> 175 * 176 * <p>======================= MatchServiceClient ======================= 177 * 178 * <p>Service Description: MatchService is a Google managed service for efficient vector similarity 179 * search at scale. 180 * 181 * <p>Sample for MatchServiceClient: 182 * 183 * <pre>{@code 184 * // This snippet has been automatically generated and should be regarded as a code template only. 185 * // It will require modifications to work: 186 * // - It may require correct/in-range values for request initialization. 187 * // - It may require specifying regional endpoints when creating the service client as shown in 188 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 189 * try (MatchServiceClient matchServiceClient = MatchServiceClient.create()) { 190 * FindNeighborsRequest request = 191 * FindNeighborsRequest.newBuilder() 192 * .setIndexEndpoint( 193 * IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) 194 * .setDeployedIndexId("deployedIndexId-1101212953") 195 * .addAllQueries(new ArrayList<FindNeighborsRequest.Query>()) 196 * .setReturnFullDatapoint(true) 197 * .build(); 198 * FindNeighborsResponse response = matchServiceClient.findNeighbors(request); 199 * } 200 * }</pre> 201 * 202 * <p>======================= MetadataServiceClient ======================= 203 * 204 * <p>Service Description: Service for reading and writing metadata entries. 205 * 206 * <p>Sample for MetadataServiceClient: 207 * 208 * <pre>{@code 209 * // This snippet has been automatically generated and should be regarded as a code template only. 210 * // It will require modifications to work: 211 * // - It may require correct/in-range values for request initialization. 212 * // - It may require specifying regional endpoints when creating the service client as shown in 213 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 214 * try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { 215 * MetadataStoreName name = MetadataStoreName.of("[PROJECT]", "[LOCATION]", "[METADATA_STORE]"); 216 * MetadataStore response = metadataServiceClient.getMetadataStore(name); 217 * } 218 * }</pre> 219 * 220 * <p>======================= MigrationServiceClient ======================= 221 * 222 * <p>Service Description: A service that migrates resources from automl.googleapis.com, 223 * datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. 224 * 225 * <p>Sample for MigrationServiceClient: 226 * 227 * <pre>{@code 228 * // This snippet has been automatically generated and should be regarded as a code template only. 229 * // It will require modifications to work: 230 * // - It may require correct/in-range values for request initialization. 231 * // - It may require specifying regional endpoints when creating the service client as shown in 232 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 233 * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) { 234 * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); 235 * Location response = migrationServiceClient.getLocation(request); 236 * } 237 * }</pre> 238 * 239 * <p>======================= ModelGardenServiceClient ======================= 240 * 241 * <p>Service Description: The interface of Model Garden Service. 242 * 243 * <p>Sample for ModelGardenServiceClient: 244 * 245 * <pre>{@code 246 * // This snippet has been automatically generated and should be regarded as a code template only. 247 * // It will require modifications to work: 248 * // - It may require correct/in-range values for request initialization. 249 * // - It may require specifying regional endpoints when creating the service client as shown in 250 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 251 * try (ModelGardenServiceClient modelGardenServiceClient = ModelGardenServiceClient.create()) { 252 * PublisherModelName name = PublisherModelName.of("[PUBLISHER]", "[MODEL]"); 253 * PublisherModel response = modelGardenServiceClient.getPublisherModel(name); 254 * } 255 * }</pre> 256 * 257 * <p>======================= ModelServiceClient ======================= 258 * 259 * <p>Service Description: A service for managing Vertex AI's machine learning Models. 260 * 261 * <p>Sample for ModelServiceClient: 262 * 263 * <pre>{@code 264 * // This snippet has been automatically generated and should be regarded as a code template only. 265 * // It will require modifications to work: 266 * // - It may require correct/in-range values for request initialization. 267 * // - It may require specifying regional endpoints when creating the service client as shown in 268 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 269 * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) { 270 * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); 271 * Model response = modelServiceClient.getModel(name); 272 * } 273 * }</pre> 274 * 275 * <p>======================= PipelineServiceClient ======================= 276 * 277 * <p>Service Description: A service for creating and managing Vertex AI's pipelines. This includes 278 * both `TrainingPipeline` resources (used for AutoML and custom training) and `PipelineJob` 279 * resources (used for Vertex AI Pipelines). 280 * 281 * <p>Sample for PipelineServiceClient: 282 * 283 * <pre>{@code 284 * // This snippet has been automatically generated and should be regarded as a code template only. 285 * // It will require modifications to work: 286 * // - It may require correct/in-range values for request initialization. 287 * // - It may require specifying regional endpoints when creating the service client as shown in 288 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 289 * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { 290 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 291 * TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build(); 292 * TrainingPipeline response = 293 * pipelineServiceClient.createTrainingPipeline(parent, trainingPipeline); 294 * } 295 * }</pre> 296 * 297 * <p>======================= PredictionServiceClient ======================= 298 * 299 * <p>Service Description: A service for online predictions and explanations. 300 * 301 * <p>Sample for PredictionServiceClient: 302 * 303 * <pre>{@code 304 * // This snippet has been automatically generated and should be regarded as a code template only. 305 * // It will require modifications to work: 306 * // - It may require correct/in-range values for request initialization. 307 * // - It may require specifying regional endpoints when creating the service client as shown in 308 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 309 * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) { 310 * EndpointName endpoint = 311 * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); 312 * List<Value> instances = new ArrayList<>(); 313 * Value parameters = Value.newBuilder().setBoolValue(true).build(); 314 * PredictResponse response = predictionServiceClient.predict(endpoint, instances, parameters); 315 * } 316 * }</pre> 317 * 318 * <p>======================= ScheduleServiceClient ======================= 319 * 320 * <p>Service Description: A service for creating and managing Vertex AI's Schedule resources to 321 * periodically launch shceudled runs to make API calls. 322 * 323 * <p>Sample for ScheduleServiceClient: 324 * 325 * <pre>{@code 326 * // This snippet has been automatically generated and should be regarded as a code template only. 327 * // It will require modifications to work: 328 * // - It may require correct/in-range values for request initialization. 329 * // - It may require specifying regional endpoints when creating the service client as shown in 330 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 331 * try (ScheduleServiceClient scheduleServiceClient = ScheduleServiceClient.create()) { 332 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 333 * Schedule schedule = Schedule.newBuilder().build(); 334 * Schedule response = scheduleServiceClient.createSchedule(parent, schedule); 335 * } 336 * }</pre> 337 * 338 * <p>======================= SpecialistPoolServiceClient ======================= 339 * 340 * <p>Service Description: A service for creating and managing Customer SpecialistPools. When 341 * customers start Data Labeling jobs, they can reuse/create Specialist Pools to bring their own 342 * Specialists to label the data. Customers can add/remove Managers for the Specialist Pool on Cloud 343 * console, then Managers will get email notifications to manage Specialists and tasks on 344 * CrowdCompute console. 345 * 346 * <p>Sample for SpecialistPoolServiceClient: 347 * 348 * <pre>{@code 349 * // This snippet has been automatically generated and should be regarded as a code template only. 350 * // It will require modifications to work: 351 * // - It may require correct/in-range values for request initialization. 352 * // - It may require specifying regional endpoints when creating the service client as shown in 353 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 354 * try (SpecialistPoolServiceClient specialistPoolServiceClient = 355 * SpecialistPoolServiceClient.create()) { 356 * SpecialistPoolName name = 357 * SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]"); 358 * SpecialistPool response = specialistPoolServiceClient.getSpecialistPool(name); 359 * } 360 * }</pre> 361 * 362 * <p>======================= TensorboardServiceClient ======================= 363 * 364 * <p>Service Description: TensorboardService 365 * 366 * <p>Sample for TensorboardServiceClient: 367 * 368 * <pre>{@code 369 * // This snippet has been automatically generated and should be regarded as a code template only. 370 * // It will require modifications to work: 371 * // - It may require correct/in-range values for request initialization. 372 * // - It may require specifying regional endpoints when creating the service client as shown in 373 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 374 * try (TensorboardServiceClient tensorboardServiceClient = TensorboardServiceClient.create()) { 375 * TensorboardName name = TensorboardName.of("[PROJECT]", "[LOCATION]", "[TENSORBOARD]"); 376 * Tensorboard response = tensorboardServiceClient.getTensorboard(name); 377 * } 378 * }</pre> 379 * 380 * <p>======================= VizierServiceClient ======================= 381 * 382 * <p>Service Description: Vertex AI Vizier API. 383 * 384 * <p>Vertex AI Vizier is a service to solve blackbox optimization problems, such as tuning machine 385 * learning hyperparameters and searching over deep learning architectures. 386 * 387 * <p>Sample for VizierServiceClient: 388 * 389 * <pre>{@code 390 * // This snippet has been automatically generated and should be regarded as a code template only. 391 * // It will require modifications to work: 392 * // - It may require correct/in-range values for request initialization. 393 * // - It may require specifying regional endpoints when creating the service client as shown in 394 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 395 * try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) { 396 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 397 * Study study = Study.newBuilder().build(); 398 * Study response = vizierServiceClient.createStudy(parent, study); 399 * } 400 * }</pre> 401 */ 402 @Generated("by gapic-generator-java") 403 package com.google.cloud.aiplatform.v1beta1; 404 405 import javax.annotation.Generated; 406