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 package com.google.cloud.automl.v1beta1; 18 19 import com.google.api.core.ApiFuture; 20 import com.google.api.core.ApiFutures; 21 import com.google.api.core.BetaApi; 22 import com.google.api.gax.core.BackgroundResource; 23 import com.google.api.gax.httpjson.longrunning.OperationsClient; 24 import com.google.api.gax.longrunning.OperationFuture; 25 import com.google.api.gax.paging.AbstractFixedSizeCollection; 26 import com.google.api.gax.paging.AbstractPage; 27 import com.google.api.gax.paging.AbstractPagedListResponse; 28 import com.google.api.gax.rpc.OperationCallable; 29 import com.google.api.gax.rpc.PageContext; 30 import com.google.api.gax.rpc.UnaryCallable; 31 import com.google.cloud.automl.v1beta1.stub.AutoMlStub; 32 import com.google.cloud.automl.v1beta1.stub.AutoMlStubSettings; 33 import com.google.common.util.concurrent.MoreExecutors; 34 import com.google.longrunning.Operation; 35 import com.google.protobuf.Empty; 36 import java.io.IOException; 37 import java.util.List; 38 import java.util.concurrent.TimeUnit; 39 import javax.annotation.Generated; 40 41 // AUTO-GENERATED DOCUMENTATION AND CLASS. 42 /** 43 * Service Description: AutoML Server API. 44 * 45 * <p>The resource names are assigned by the server. The server never reuses names that it has 46 * created after the resources with those names are deleted. 47 * 48 * <p>An ID of a resource is the last element of the item's resource name. For 49 * `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then the id for the item 50 * is `{dataset_id}`. 51 * 52 * <p>Currently the only supported `location_id` is "us-central1". 53 * 54 * <p>On any input that is documented to expect a string parameter in snake_case or kebab-case, 55 * either of those cases is accepted. 56 * 57 * <p>This class provides the ability to make remote calls to the backing service through method 58 * calls that map to API methods. Sample code to get started: 59 * 60 * <pre>{@code 61 * // This snippet has been automatically generated and should be regarded as a code template only. 62 * // It will require modifications to work: 63 * // - It may require correct/in-range values for request initialization. 64 * // - It may require specifying regional endpoints when creating the service client as shown in 65 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 66 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 67 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 68 * Dataset dataset = Dataset.newBuilder().build(); 69 * Dataset response = autoMlClient.createDataset(parent, dataset); 70 * } 71 * }</pre> 72 * 73 * <p>Note: close() needs to be called on the AutoMlClient object to clean up resources such as 74 * threads. In the example above, try-with-resources is used, which automatically calls close(). 75 * 76 * <p>The surface of this class includes several types of Java methods for each of the API's 77 * methods: 78 * 79 * <ol> 80 * <li>A "flattened" method. With this type of method, the fields of the request type have been 81 * converted into function parameters. It may be the case that not all fields are available as 82 * parameters, and not every API method will have a flattened method entry point. 83 * <li>A "request object" method. This type of method only takes one parameter, a request object, 84 * which must be constructed before the call. Not every API method will have a request object 85 * method. 86 * <li>A "callable" method. This type of method takes no parameters and returns an immutable API 87 * callable object, which can be used to initiate calls to the service. 88 * </ol> 89 * 90 * <p>See the individual methods for example code. 91 * 92 * <p>Many parameters require resource names to be formatted in a particular way. To assist with 93 * these names, this class includes a format method for each type of name, and additionally a parse 94 * method to extract the individual identifiers contained within names that are returned. 95 * 96 * <p>This class can be customized by passing in a custom instance of AutoMlSettings to create(). 97 * For example: 98 * 99 * <p>To customize credentials: 100 * 101 * <pre>{@code 102 * // This snippet has been automatically generated and should be regarded as a code template only. 103 * // It will require modifications to work: 104 * // - It may require correct/in-range values for request initialization. 105 * // - It may require specifying regional endpoints when creating the service client as shown in 106 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 107 * AutoMlSettings autoMlSettings = 108 * AutoMlSettings.newBuilder() 109 * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) 110 * .build(); 111 * AutoMlClient autoMlClient = AutoMlClient.create(autoMlSettings); 112 * }</pre> 113 * 114 * <p>To customize the endpoint: 115 * 116 * <pre>{@code 117 * // This snippet has been automatically generated and should be regarded as a code template only. 118 * // It will require modifications to work: 119 * // - It may require correct/in-range values for request initialization. 120 * // - It may require specifying regional endpoints when creating the service client as shown in 121 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 122 * AutoMlSettings autoMlSettings = AutoMlSettings.newBuilder().setEndpoint(myEndpoint).build(); 123 * AutoMlClient autoMlClient = AutoMlClient.create(autoMlSettings); 124 * }</pre> 125 * 126 * <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over 127 * the wire: 128 * 129 * <pre>{@code 130 * // This snippet has been automatically generated and should be regarded as a code template only. 131 * // It will require modifications to work: 132 * // - It may require correct/in-range values for request initialization. 133 * // - It may require specifying regional endpoints when creating the service client as shown in 134 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 135 * AutoMlSettings autoMlSettings = AutoMlSettings.newHttpJsonBuilder().build(); 136 * AutoMlClient autoMlClient = AutoMlClient.create(autoMlSettings); 137 * }</pre> 138 * 139 * <p>Please refer to the GitHub repository's samples for more quickstart code snippets. 140 */ 141 @BetaApi 142 @Generated("by gapic-generator-java") 143 public class AutoMlClient implements BackgroundResource { 144 private final AutoMlSettings settings; 145 private final AutoMlStub stub; 146 private final OperationsClient httpJsonOperationsClient; 147 private final com.google.longrunning.OperationsClient operationsClient; 148 149 /** Constructs an instance of AutoMlClient with default settings. */ create()150 public static final AutoMlClient create() throws IOException { 151 return create(AutoMlSettings.newBuilder().build()); 152 } 153 154 /** 155 * Constructs an instance of AutoMlClient, using the given settings. The channels are created 156 * based on the settings passed in, or defaults for any settings that are not set. 157 */ create(AutoMlSettings settings)158 public static final AutoMlClient create(AutoMlSettings settings) throws IOException { 159 return new AutoMlClient(settings); 160 } 161 162 /** 163 * Constructs an instance of AutoMlClient, using the given stub for making calls. This is for 164 * advanced usage - prefer using create(AutoMlSettings). 165 */ create(AutoMlStub stub)166 public static final AutoMlClient create(AutoMlStub stub) { 167 return new AutoMlClient(stub); 168 } 169 170 /** 171 * Constructs an instance of AutoMlClient, using the given settings. This is protected so that it 172 * is easy to make a subclass, but otherwise, the static factory methods should be preferred. 173 */ AutoMlClient(AutoMlSettings settings)174 protected AutoMlClient(AutoMlSettings settings) throws IOException { 175 this.settings = settings; 176 this.stub = ((AutoMlStubSettings) settings.getStubSettings()).createStub(); 177 this.operationsClient = 178 com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); 179 this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); 180 } 181 AutoMlClient(AutoMlStub stub)182 protected AutoMlClient(AutoMlStub stub) { 183 this.settings = null; 184 this.stub = stub; 185 this.operationsClient = 186 com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); 187 this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); 188 } 189 getSettings()190 public final AutoMlSettings getSettings() { 191 return settings; 192 } 193 getStub()194 public AutoMlStub getStub() { 195 return stub; 196 } 197 198 /** 199 * Returns the OperationsClient that can be used to query the status of a long-running operation 200 * returned by another API method call. 201 */ getOperationsClient()202 public final com.google.longrunning.OperationsClient getOperationsClient() { 203 return operationsClient; 204 } 205 206 /** 207 * Returns the OperationsClient that can be used to query the status of a long-running operation 208 * returned by another API method call. 209 */ 210 @BetaApi getHttpJsonOperationsClient()211 public final OperationsClient getHttpJsonOperationsClient() { 212 return httpJsonOperationsClient; 213 } 214 215 // AUTO-GENERATED DOCUMENTATION AND METHOD. 216 /** 217 * Creates a dataset. 218 * 219 * <p>Sample code: 220 * 221 * <pre>{@code 222 * // This snippet has been automatically generated and should be regarded as a code template only. 223 * // It will require modifications to work: 224 * // - It may require correct/in-range values for request initialization. 225 * // - It may require specifying regional endpoints when creating the service client as shown in 226 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 227 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 228 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 229 * Dataset dataset = Dataset.newBuilder().build(); 230 * Dataset response = autoMlClient.createDataset(parent, dataset); 231 * } 232 * }</pre> 233 * 234 * @param parent Required. The resource name of the project to create the dataset for. 235 * @param dataset Required. The dataset to create. 236 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 237 */ createDataset(LocationName parent, Dataset dataset)238 public final Dataset createDataset(LocationName parent, Dataset dataset) { 239 CreateDatasetRequest request = 240 CreateDatasetRequest.newBuilder() 241 .setParent(parent == null ? null : parent.toString()) 242 .setDataset(dataset) 243 .build(); 244 return createDataset(request); 245 } 246 247 // AUTO-GENERATED DOCUMENTATION AND METHOD. 248 /** 249 * Creates a dataset. 250 * 251 * <p>Sample code: 252 * 253 * <pre>{@code 254 * // This snippet has been automatically generated and should be regarded as a code template only. 255 * // It will require modifications to work: 256 * // - It may require correct/in-range values for request initialization. 257 * // - It may require specifying regional endpoints when creating the service client as shown in 258 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 259 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 260 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 261 * Dataset dataset = Dataset.newBuilder().build(); 262 * Dataset response = autoMlClient.createDataset(parent, dataset); 263 * } 264 * }</pre> 265 * 266 * @param parent Required. The resource name of the project to create the dataset for. 267 * @param dataset Required. The dataset to create. 268 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 269 */ createDataset(String parent, Dataset dataset)270 public final Dataset createDataset(String parent, Dataset dataset) { 271 CreateDatasetRequest request = 272 CreateDatasetRequest.newBuilder().setParent(parent).setDataset(dataset).build(); 273 return createDataset(request); 274 } 275 276 // AUTO-GENERATED DOCUMENTATION AND METHOD. 277 /** 278 * Creates a dataset. 279 * 280 * <p>Sample code: 281 * 282 * <pre>{@code 283 * // This snippet has been automatically generated and should be regarded as a code template only. 284 * // It will require modifications to work: 285 * // - It may require correct/in-range values for request initialization. 286 * // - It may require specifying regional endpoints when creating the service client as shown in 287 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 288 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 289 * CreateDatasetRequest request = 290 * CreateDatasetRequest.newBuilder() 291 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 292 * .setDataset(Dataset.newBuilder().build()) 293 * .build(); 294 * Dataset response = autoMlClient.createDataset(request); 295 * } 296 * }</pre> 297 * 298 * @param request The request object containing all of the parameters for the API call. 299 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 300 */ createDataset(CreateDatasetRequest request)301 public final Dataset createDataset(CreateDatasetRequest request) { 302 return createDatasetCallable().call(request); 303 } 304 305 // AUTO-GENERATED DOCUMENTATION AND METHOD. 306 /** 307 * Creates a dataset. 308 * 309 * <p>Sample code: 310 * 311 * <pre>{@code 312 * // This snippet has been automatically generated and should be regarded as a code template only. 313 * // It will require modifications to work: 314 * // - It may require correct/in-range values for request initialization. 315 * // - It may require specifying regional endpoints when creating the service client as shown in 316 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 317 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 318 * CreateDatasetRequest request = 319 * CreateDatasetRequest.newBuilder() 320 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 321 * .setDataset(Dataset.newBuilder().build()) 322 * .build(); 323 * ApiFuture<Dataset> future = autoMlClient.createDatasetCallable().futureCall(request); 324 * // Do something. 325 * Dataset response = future.get(); 326 * } 327 * }</pre> 328 */ createDatasetCallable()329 public final UnaryCallable<CreateDatasetRequest, Dataset> createDatasetCallable() { 330 return stub.createDatasetCallable(); 331 } 332 333 // AUTO-GENERATED DOCUMENTATION AND METHOD. 334 /** 335 * Gets a dataset. 336 * 337 * <p>Sample code: 338 * 339 * <pre>{@code 340 * // This snippet has been automatically generated and should be regarded as a code template only. 341 * // It will require modifications to work: 342 * // - It may require correct/in-range values for request initialization. 343 * // - It may require specifying regional endpoints when creating the service client as shown in 344 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 345 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 346 * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); 347 * Dataset response = autoMlClient.getDataset(name); 348 * } 349 * }</pre> 350 * 351 * @param name Required. The resource name of the dataset to retrieve. 352 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 353 */ getDataset(DatasetName name)354 public final Dataset getDataset(DatasetName name) { 355 GetDatasetRequest request = 356 GetDatasetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 357 return getDataset(request); 358 } 359 360 // AUTO-GENERATED DOCUMENTATION AND METHOD. 361 /** 362 * Gets a dataset. 363 * 364 * <p>Sample code: 365 * 366 * <pre>{@code 367 * // This snippet has been automatically generated and should be regarded as a code template only. 368 * // It will require modifications to work: 369 * // - It may require correct/in-range values for request initialization. 370 * // - It may require specifying regional endpoints when creating the service client as shown in 371 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 372 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 373 * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); 374 * Dataset response = autoMlClient.getDataset(name); 375 * } 376 * }</pre> 377 * 378 * @param name Required. The resource name of the dataset to retrieve. 379 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 380 */ getDataset(String name)381 public final Dataset getDataset(String name) { 382 GetDatasetRequest request = GetDatasetRequest.newBuilder().setName(name).build(); 383 return getDataset(request); 384 } 385 386 // AUTO-GENERATED DOCUMENTATION AND METHOD. 387 /** 388 * Gets a dataset. 389 * 390 * <p>Sample code: 391 * 392 * <pre>{@code 393 * // This snippet has been automatically generated and should be regarded as a code template only. 394 * // It will require modifications to work: 395 * // - It may require correct/in-range values for request initialization. 396 * // - It may require specifying regional endpoints when creating the service client as shown in 397 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 398 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 399 * GetDatasetRequest request = 400 * GetDatasetRequest.newBuilder() 401 * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) 402 * .build(); 403 * Dataset response = autoMlClient.getDataset(request); 404 * } 405 * }</pre> 406 * 407 * @param request The request object containing all of the parameters for the API call. 408 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 409 */ getDataset(GetDatasetRequest request)410 public final Dataset getDataset(GetDatasetRequest request) { 411 return getDatasetCallable().call(request); 412 } 413 414 // AUTO-GENERATED DOCUMENTATION AND METHOD. 415 /** 416 * Gets a dataset. 417 * 418 * <p>Sample code: 419 * 420 * <pre>{@code 421 * // This snippet has been automatically generated and should be regarded as a code template only. 422 * // It will require modifications to work: 423 * // - It may require correct/in-range values for request initialization. 424 * // - It may require specifying regional endpoints when creating the service client as shown in 425 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 426 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 427 * GetDatasetRequest request = 428 * GetDatasetRequest.newBuilder() 429 * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) 430 * .build(); 431 * ApiFuture<Dataset> future = autoMlClient.getDatasetCallable().futureCall(request); 432 * // Do something. 433 * Dataset response = future.get(); 434 * } 435 * }</pre> 436 */ getDatasetCallable()437 public final UnaryCallable<GetDatasetRequest, Dataset> getDatasetCallable() { 438 return stub.getDatasetCallable(); 439 } 440 441 // AUTO-GENERATED DOCUMENTATION AND METHOD. 442 /** 443 * Lists datasets in a project. 444 * 445 * <p>Sample code: 446 * 447 * <pre>{@code 448 * // This snippet has been automatically generated and should be regarded as a code template only. 449 * // It will require modifications to work: 450 * // - It may require correct/in-range values for request initialization. 451 * // - It may require specifying regional endpoints when creating the service client as shown in 452 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 453 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 454 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 455 * for (Dataset element : autoMlClient.listDatasets(parent).iterateAll()) { 456 * // doThingsWith(element); 457 * } 458 * } 459 * }</pre> 460 * 461 * @param parent Required. The resource name of the project from which to list datasets. 462 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 463 */ listDatasets(LocationName parent)464 public final ListDatasetsPagedResponse listDatasets(LocationName parent) { 465 ListDatasetsRequest request = 466 ListDatasetsRequest.newBuilder() 467 .setParent(parent == null ? null : parent.toString()) 468 .build(); 469 return listDatasets(request); 470 } 471 472 // AUTO-GENERATED DOCUMENTATION AND METHOD. 473 /** 474 * Lists datasets in a project. 475 * 476 * <p>Sample code: 477 * 478 * <pre>{@code 479 * // This snippet has been automatically generated and should be regarded as a code template only. 480 * // It will require modifications to work: 481 * // - It may require correct/in-range values for request initialization. 482 * // - It may require specifying regional endpoints when creating the service client as shown in 483 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 484 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 485 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 486 * for (Dataset element : autoMlClient.listDatasets(parent).iterateAll()) { 487 * // doThingsWith(element); 488 * } 489 * } 490 * }</pre> 491 * 492 * @param parent Required. The resource name of the project from which to list datasets. 493 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 494 */ listDatasets(String parent)495 public final ListDatasetsPagedResponse listDatasets(String parent) { 496 ListDatasetsRequest request = ListDatasetsRequest.newBuilder().setParent(parent).build(); 497 return listDatasets(request); 498 } 499 500 // AUTO-GENERATED DOCUMENTATION AND METHOD. 501 /** 502 * Lists datasets in a project. 503 * 504 * <p>Sample code: 505 * 506 * <pre>{@code 507 * // This snippet has been automatically generated and should be regarded as a code template only. 508 * // It will require modifications to work: 509 * // - It may require correct/in-range values for request initialization. 510 * // - It may require specifying regional endpoints when creating the service client as shown in 511 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 512 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 513 * ListDatasetsRequest request = 514 * ListDatasetsRequest.newBuilder() 515 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 516 * .setFilter("filter-1274492040") 517 * .setPageSize(883849137) 518 * .setPageToken("pageToken873572522") 519 * .build(); 520 * for (Dataset element : autoMlClient.listDatasets(request).iterateAll()) { 521 * // doThingsWith(element); 522 * } 523 * } 524 * }</pre> 525 * 526 * @param request The request object containing all of the parameters for the API call. 527 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 528 */ listDatasets(ListDatasetsRequest request)529 public final ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request) { 530 return listDatasetsPagedCallable().call(request); 531 } 532 533 // AUTO-GENERATED DOCUMENTATION AND METHOD. 534 /** 535 * Lists datasets in a project. 536 * 537 * <p>Sample code: 538 * 539 * <pre>{@code 540 * // This snippet has been automatically generated and should be regarded as a code template only. 541 * // It will require modifications to work: 542 * // - It may require correct/in-range values for request initialization. 543 * // - It may require specifying regional endpoints when creating the service client as shown in 544 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 545 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 546 * ListDatasetsRequest request = 547 * ListDatasetsRequest.newBuilder() 548 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 549 * .setFilter("filter-1274492040") 550 * .setPageSize(883849137) 551 * .setPageToken("pageToken873572522") 552 * .build(); 553 * ApiFuture<Dataset> future = autoMlClient.listDatasetsPagedCallable().futureCall(request); 554 * // Do something. 555 * for (Dataset element : future.get().iterateAll()) { 556 * // doThingsWith(element); 557 * } 558 * } 559 * }</pre> 560 */ 561 public final UnaryCallable<ListDatasetsRequest, ListDatasetsPagedResponse> listDatasetsPagedCallable()562 listDatasetsPagedCallable() { 563 return stub.listDatasetsPagedCallable(); 564 } 565 566 // AUTO-GENERATED DOCUMENTATION AND METHOD. 567 /** 568 * Lists datasets in a project. 569 * 570 * <p>Sample code: 571 * 572 * <pre>{@code 573 * // This snippet has been automatically generated and should be regarded as a code template only. 574 * // It will require modifications to work: 575 * // - It may require correct/in-range values for request initialization. 576 * // - It may require specifying regional endpoints when creating the service client as shown in 577 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 578 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 579 * ListDatasetsRequest request = 580 * ListDatasetsRequest.newBuilder() 581 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 582 * .setFilter("filter-1274492040") 583 * .setPageSize(883849137) 584 * .setPageToken("pageToken873572522") 585 * .build(); 586 * while (true) { 587 * ListDatasetsResponse response = autoMlClient.listDatasetsCallable().call(request); 588 * for (Dataset element : response.getDatasetsList()) { 589 * // doThingsWith(element); 590 * } 591 * String nextPageToken = response.getNextPageToken(); 592 * if (!Strings.isNullOrEmpty(nextPageToken)) { 593 * request = request.toBuilder().setPageToken(nextPageToken).build(); 594 * } else { 595 * break; 596 * } 597 * } 598 * } 599 * }</pre> 600 */ listDatasetsCallable()601 public final UnaryCallable<ListDatasetsRequest, ListDatasetsResponse> listDatasetsCallable() { 602 return stub.listDatasetsCallable(); 603 } 604 605 // AUTO-GENERATED DOCUMENTATION AND METHOD. 606 /** 607 * Updates a dataset. 608 * 609 * <p>Sample code: 610 * 611 * <pre>{@code 612 * // This snippet has been automatically generated and should be regarded as a code template only. 613 * // It will require modifications to work: 614 * // - It may require correct/in-range values for request initialization. 615 * // - It may require specifying regional endpoints when creating the service client as shown in 616 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 617 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 618 * Dataset dataset = Dataset.newBuilder().build(); 619 * Dataset response = autoMlClient.updateDataset(dataset); 620 * } 621 * }</pre> 622 * 623 * @param dataset Required. The dataset which replaces the resource on the server. 624 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 625 */ updateDataset(Dataset dataset)626 public final Dataset updateDataset(Dataset dataset) { 627 UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder().setDataset(dataset).build(); 628 return updateDataset(request); 629 } 630 631 // AUTO-GENERATED DOCUMENTATION AND METHOD. 632 /** 633 * Updates a dataset. 634 * 635 * <p>Sample code: 636 * 637 * <pre>{@code 638 * // This snippet has been automatically generated and should be regarded as a code template only. 639 * // It will require modifications to work: 640 * // - It may require correct/in-range values for request initialization. 641 * // - It may require specifying regional endpoints when creating the service client as shown in 642 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 643 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 644 * UpdateDatasetRequest request = 645 * UpdateDatasetRequest.newBuilder() 646 * .setDataset(Dataset.newBuilder().build()) 647 * .setUpdateMask(FieldMask.newBuilder().build()) 648 * .build(); 649 * Dataset response = autoMlClient.updateDataset(request); 650 * } 651 * }</pre> 652 * 653 * @param request The request object containing all of the parameters for the API call. 654 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 655 */ updateDataset(UpdateDatasetRequest request)656 public final Dataset updateDataset(UpdateDatasetRequest request) { 657 return updateDatasetCallable().call(request); 658 } 659 660 // AUTO-GENERATED DOCUMENTATION AND METHOD. 661 /** 662 * Updates a dataset. 663 * 664 * <p>Sample code: 665 * 666 * <pre>{@code 667 * // This snippet has been automatically generated and should be regarded as a code template only. 668 * // It will require modifications to work: 669 * // - It may require correct/in-range values for request initialization. 670 * // - It may require specifying regional endpoints when creating the service client as shown in 671 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 672 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 673 * UpdateDatasetRequest request = 674 * UpdateDatasetRequest.newBuilder() 675 * .setDataset(Dataset.newBuilder().build()) 676 * .setUpdateMask(FieldMask.newBuilder().build()) 677 * .build(); 678 * ApiFuture<Dataset> future = autoMlClient.updateDatasetCallable().futureCall(request); 679 * // Do something. 680 * Dataset response = future.get(); 681 * } 682 * }</pre> 683 */ updateDatasetCallable()684 public final UnaryCallable<UpdateDatasetRequest, Dataset> updateDatasetCallable() { 685 return stub.updateDatasetCallable(); 686 } 687 688 // AUTO-GENERATED DOCUMENTATION AND METHOD. 689 /** 690 * Deletes a dataset and all of its contents. Returns empty response in the 691 * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` 692 * in the [metadata][google.longrunning.Operation.metadata] field. 693 * 694 * <p>Sample code: 695 * 696 * <pre>{@code 697 * // This snippet has been automatically generated and should be regarded as a code template only. 698 * // It will require modifications to work: 699 * // - It may require correct/in-range values for request initialization. 700 * // - It may require specifying regional endpoints when creating the service client as shown in 701 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 702 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 703 * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); 704 * autoMlClient.deleteDatasetAsync(name).get(); 705 * } 706 * }</pre> 707 * 708 * @param name Required. The resource name of the dataset to delete. 709 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 710 */ deleteDatasetAsync(DatasetName name)711 public final OperationFuture<Empty, OperationMetadata> deleteDatasetAsync(DatasetName name) { 712 DeleteDatasetRequest request = 713 DeleteDatasetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 714 return deleteDatasetAsync(request); 715 } 716 717 // AUTO-GENERATED DOCUMENTATION AND METHOD. 718 /** 719 * Deletes a dataset and all of its contents. Returns empty response in the 720 * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` 721 * in the [metadata][google.longrunning.Operation.metadata] field. 722 * 723 * <p>Sample code: 724 * 725 * <pre>{@code 726 * // This snippet has been automatically generated and should be regarded as a code template only. 727 * // It will require modifications to work: 728 * // - It may require correct/in-range values for request initialization. 729 * // - It may require specifying regional endpoints when creating the service client as shown in 730 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 731 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 732 * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); 733 * autoMlClient.deleteDatasetAsync(name).get(); 734 * } 735 * }</pre> 736 * 737 * @param name Required. The resource name of the dataset to delete. 738 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 739 */ deleteDatasetAsync(String name)740 public final OperationFuture<Empty, OperationMetadata> deleteDatasetAsync(String name) { 741 DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder().setName(name).build(); 742 return deleteDatasetAsync(request); 743 } 744 745 // AUTO-GENERATED DOCUMENTATION AND METHOD. 746 /** 747 * Deletes a dataset and all of its contents. Returns empty response in the 748 * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` 749 * in the [metadata][google.longrunning.Operation.metadata] field. 750 * 751 * <p>Sample code: 752 * 753 * <pre>{@code 754 * // This snippet has been automatically generated and should be regarded as a code template only. 755 * // It will require modifications to work: 756 * // - It may require correct/in-range values for request initialization. 757 * // - It may require specifying regional endpoints when creating the service client as shown in 758 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 759 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 760 * DeleteDatasetRequest request = 761 * DeleteDatasetRequest.newBuilder() 762 * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) 763 * .build(); 764 * autoMlClient.deleteDatasetAsync(request).get(); 765 * } 766 * }</pre> 767 * 768 * @param request The request object containing all of the parameters for the API call. 769 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 770 */ deleteDatasetAsync( DeleteDatasetRequest request)771 public final OperationFuture<Empty, OperationMetadata> deleteDatasetAsync( 772 DeleteDatasetRequest request) { 773 return deleteDatasetOperationCallable().futureCall(request); 774 } 775 776 // AUTO-GENERATED DOCUMENTATION AND METHOD. 777 /** 778 * Deletes a dataset and all of its contents. Returns empty response in the 779 * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` 780 * in the [metadata][google.longrunning.Operation.metadata] field. 781 * 782 * <p>Sample code: 783 * 784 * <pre>{@code 785 * // This snippet has been automatically generated and should be regarded as a code template only. 786 * // It will require modifications to work: 787 * // - It may require correct/in-range values for request initialization. 788 * // - It may require specifying regional endpoints when creating the service client as shown in 789 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 790 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 791 * DeleteDatasetRequest request = 792 * DeleteDatasetRequest.newBuilder() 793 * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) 794 * .build(); 795 * OperationFuture<Empty, OperationMetadata> future = 796 * autoMlClient.deleteDatasetOperationCallable().futureCall(request); 797 * // Do something. 798 * future.get(); 799 * } 800 * }</pre> 801 */ 802 public final OperationCallable<DeleteDatasetRequest, Empty, OperationMetadata> deleteDatasetOperationCallable()803 deleteDatasetOperationCallable() { 804 return stub.deleteDatasetOperationCallable(); 805 } 806 807 // AUTO-GENERATED DOCUMENTATION AND METHOD. 808 /** 809 * Deletes a dataset and all of its contents. Returns empty response in the 810 * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` 811 * in the [metadata][google.longrunning.Operation.metadata] field. 812 * 813 * <p>Sample code: 814 * 815 * <pre>{@code 816 * // This snippet has been automatically generated and should be regarded as a code template only. 817 * // It will require modifications to work: 818 * // - It may require correct/in-range values for request initialization. 819 * // - It may require specifying regional endpoints when creating the service client as shown in 820 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 821 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 822 * DeleteDatasetRequest request = 823 * DeleteDatasetRequest.newBuilder() 824 * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) 825 * .build(); 826 * ApiFuture<Operation> future = autoMlClient.deleteDatasetCallable().futureCall(request); 827 * // Do something. 828 * future.get(); 829 * } 830 * }</pre> 831 */ deleteDatasetCallable()832 public final UnaryCallable<DeleteDatasetRequest, Operation> deleteDatasetCallable() { 833 return stub.deleteDatasetCallable(); 834 } 835 836 // AUTO-GENERATED DOCUMENTATION AND METHOD. 837 /** 838 * Imports data into a dataset. For Tables this method can only be called on an empty Dataset. 839 * 840 * <p>For Tables: 841 * 842 * <ul> 843 * <li>A [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter 844 * must be explicitly set. Returns an empty response in the 845 * [response][google.longrunning.Operation.response] field when it completes. 846 * </ul> 847 * 848 * <p>Sample code: 849 * 850 * <pre>{@code 851 * // This snippet has been automatically generated and should be regarded as a code template only. 852 * // It will require modifications to work: 853 * // - It may require correct/in-range values for request initialization. 854 * // - It may require specifying regional endpoints when creating the service client as shown in 855 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 856 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 857 * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); 858 * InputConfig inputConfig = InputConfig.newBuilder().build(); 859 * autoMlClient.importDataAsync(name, inputConfig).get(); 860 * } 861 * }</pre> 862 * 863 * @param name Required. Dataset name. Dataset must already exist. All imported annotations and 864 * examples will be added. 865 * @param inputConfig Required. The desired input location and its domain specific semantics, if 866 * any. 867 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 868 */ importDataAsync( DatasetName name, InputConfig inputConfig)869 public final OperationFuture<Empty, OperationMetadata> importDataAsync( 870 DatasetName name, InputConfig inputConfig) { 871 ImportDataRequest request = 872 ImportDataRequest.newBuilder() 873 .setName(name == null ? null : name.toString()) 874 .setInputConfig(inputConfig) 875 .build(); 876 return importDataAsync(request); 877 } 878 879 // AUTO-GENERATED DOCUMENTATION AND METHOD. 880 /** 881 * Imports data into a dataset. For Tables this method can only be called on an empty Dataset. 882 * 883 * <p>For Tables: 884 * 885 * <ul> 886 * <li>A [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter 887 * must be explicitly set. Returns an empty response in the 888 * [response][google.longrunning.Operation.response] field when it completes. 889 * </ul> 890 * 891 * <p>Sample code: 892 * 893 * <pre>{@code 894 * // This snippet has been automatically generated and should be regarded as a code template only. 895 * // It will require modifications to work: 896 * // - It may require correct/in-range values for request initialization. 897 * // - It may require specifying regional endpoints when creating the service client as shown in 898 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 899 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 900 * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); 901 * InputConfig inputConfig = InputConfig.newBuilder().build(); 902 * autoMlClient.importDataAsync(name, inputConfig).get(); 903 * } 904 * }</pre> 905 * 906 * @param name Required. Dataset name. Dataset must already exist. All imported annotations and 907 * examples will be added. 908 * @param inputConfig Required. The desired input location and its domain specific semantics, if 909 * any. 910 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 911 */ importDataAsync( String name, InputConfig inputConfig)912 public final OperationFuture<Empty, OperationMetadata> importDataAsync( 913 String name, InputConfig inputConfig) { 914 ImportDataRequest request = 915 ImportDataRequest.newBuilder().setName(name).setInputConfig(inputConfig).build(); 916 return importDataAsync(request); 917 } 918 919 // AUTO-GENERATED DOCUMENTATION AND METHOD. 920 /** 921 * Imports data into a dataset. For Tables this method can only be called on an empty Dataset. 922 * 923 * <p>For Tables: 924 * 925 * <ul> 926 * <li>A [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter 927 * must be explicitly set. Returns an empty response in the 928 * [response][google.longrunning.Operation.response] field when it completes. 929 * </ul> 930 * 931 * <p>Sample code: 932 * 933 * <pre>{@code 934 * // This snippet has been automatically generated and should be regarded as a code template only. 935 * // It will require modifications to work: 936 * // - It may require correct/in-range values for request initialization. 937 * // - It may require specifying regional endpoints when creating the service client as shown in 938 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 939 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 940 * ImportDataRequest request = 941 * ImportDataRequest.newBuilder() 942 * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) 943 * .setInputConfig(InputConfig.newBuilder().build()) 944 * .build(); 945 * autoMlClient.importDataAsync(request).get(); 946 * } 947 * }</pre> 948 * 949 * @param request The request object containing all of the parameters for the API call. 950 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 951 */ importDataAsync( ImportDataRequest request)952 public final OperationFuture<Empty, OperationMetadata> importDataAsync( 953 ImportDataRequest request) { 954 return importDataOperationCallable().futureCall(request); 955 } 956 957 // AUTO-GENERATED DOCUMENTATION AND METHOD. 958 /** 959 * Imports data into a dataset. For Tables this method can only be called on an empty Dataset. 960 * 961 * <p>For Tables: 962 * 963 * <ul> 964 * <li>A [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter 965 * must be explicitly set. Returns an empty response in the 966 * [response][google.longrunning.Operation.response] field when it completes. 967 * </ul> 968 * 969 * <p>Sample code: 970 * 971 * <pre>{@code 972 * // This snippet has been automatically generated and should be regarded as a code template only. 973 * // It will require modifications to work: 974 * // - It may require correct/in-range values for request initialization. 975 * // - It may require specifying regional endpoints when creating the service client as shown in 976 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 977 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 978 * ImportDataRequest request = 979 * ImportDataRequest.newBuilder() 980 * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) 981 * .setInputConfig(InputConfig.newBuilder().build()) 982 * .build(); 983 * OperationFuture<Empty, OperationMetadata> future = 984 * autoMlClient.importDataOperationCallable().futureCall(request); 985 * // Do something. 986 * future.get(); 987 * } 988 * }</pre> 989 */ 990 public final OperationCallable<ImportDataRequest, Empty, OperationMetadata> importDataOperationCallable()991 importDataOperationCallable() { 992 return stub.importDataOperationCallable(); 993 } 994 995 // AUTO-GENERATED DOCUMENTATION AND METHOD. 996 /** 997 * Imports data into a dataset. For Tables this method can only be called on an empty Dataset. 998 * 999 * <p>For Tables: 1000 * 1001 * <ul> 1002 * <li>A [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter 1003 * must be explicitly set. Returns an empty response in the 1004 * [response][google.longrunning.Operation.response] field when it completes. 1005 * </ul> 1006 * 1007 * <p>Sample code: 1008 * 1009 * <pre>{@code 1010 * // This snippet has been automatically generated and should be regarded as a code template only. 1011 * // It will require modifications to work: 1012 * // - It may require correct/in-range values for request initialization. 1013 * // - It may require specifying regional endpoints when creating the service client as shown in 1014 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1015 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1016 * ImportDataRequest request = 1017 * ImportDataRequest.newBuilder() 1018 * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) 1019 * .setInputConfig(InputConfig.newBuilder().build()) 1020 * .build(); 1021 * ApiFuture<Operation> future = autoMlClient.importDataCallable().futureCall(request); 1022 * // Do something. 1023 * future.get(); 1024 * } 1025 * }</pre> 1026 */ importDataCallable()1027 public final UnaryCallable<ImportDataRequest, Operation> importDataCallable() { 1028 return stub.importDataCallable(); 1029 } 1030 1031 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1032 /** 1033 * Exports dataset's data to the provided output location. Returns an empty response in the 1034 * [response][google.longrunning.Operation.response] field when it completes. 1035 * 1036 * <p>Sample code: 1037 * 1038 * <pre>{@code 1039 * // This snippet has been automatically generated and should be regarded as a code template only. 1040 * // It will require modifications to work: 1041 * // - It may require correct/in-range values for request initialization. 1042 * // - It may require specifying regional endpoints when creating the service client as shown in 1043 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1044 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1045 * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); 1046 * OutputConfig outputConfig = OutputConfig.newBuilder().build(); 1047 * autoMlClient.exportDataAsync(name, outputConfig).get(); 1048 * } 1049 * }</pre> 1050 * 1051 * @param name Required. The resource name of the dataset. 1052 * @param outputConfig Required. The desired output location. 1053 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1054 */ exportDataAsync( DatasetName name, OutputConfig outputConfig)1055 public final OperationFuture<Empty, OperationMetadata> exportDataAsync( 1056 DatasetName name, OutputConfig outputConfig) { 1057 ExportDataRequest request = 1058 ExportDataRequest.newBuilder() 1059 .setName(name == null ? null : name.toString()) 1060 .setOutputConfig(outputConfig) 1061 .build(); 1062 return exportDataAsync(request); 1063 } 1064 1065 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1066 /** 1067 * Exports dataset's data to the provided output location. Returns an empty response in the 1068 * [response][google.longrunning.Operation.response] field when it completes. 1069 * 1070 * <p>Sample code: 1071 * 1072 * <pre>{@code 1073 * // This snippet has been automatically generated and should be regarded as a code template only. 1074 * // It will require modifications to work: 1075 * // - It may require correct/in-range values for request initialization. 1076 * // - It may require specifying regional endpoints when creating the service client as shown in 1077 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1078 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1079 * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); 1080 * OutputConfig outputConfig = OutputConfig.newBuilder().build(); 1081 * autoMlClient.exportDataAsync(name, outputConfig).get(); 1082 * } 1083 * }</pre> 1084 * 1085 * @param name Required. The resource name of the dataset. 1086 * @param outputConfig Required. The desired output location. 1087 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1088 */ exportDataAsync( String name, OutputConfig outputConfig)1089 public final OperationFuture<Empty, OperationMetadata> exportDataAsync( 1090 String name, OutputConfig outputConfig) { 1091 ExportDataRequest request = 1092 ExportDataRequest.newBuilder().setName(name).setOutputConfig(outputConfig).build(); 1093 return exportDataAsync(request); 1094 } 1095 1096 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1097 /** 1098 * Exports dataset's data to the provided output location. Returns an empty response in the 1099 * [response][google.longrunning.Operation.response] field when it completes. 1100 * 1101 * <p>Sample code: 1102 * 1103 * <pre>{@code 1104 * // This snippet has been automatically generated and should be regarded as a code template only. 1105 * // It will require modifications to work: 1106 * // - It may require correct/in-range values for request initialization. 1107 * // - It may require specifying regional endpoints when creating the service client as shown in 1108 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1109 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1110 * ExportDataRequest request = 1111 * ExportDataRequest.newBuilder() 1112 * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) 1113 * .setOutputConfig(OutputConfig.newBuilder().build()) 1114 * .build(); 1115 * autoMlClient.exportDataAsync(request).get(); 1116 * } 1117 * }</pre> 1118 * 1119 * @param request The request object containing all of the parameters for the API call. 1120 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1121 */ exportDataAsync( ExportDataRequest request)1122 public final OperationFuture<Empty, OperationMetadata> exportDataAsync( 1123 ExportDataRequest request) { 1124 return exportDataOperationCallable().futureCall(request); 1125 } 1126 1127 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1128 /** 1129 * Exports dataset's data to the provided output location. Returns an empty response in the 1130 * [response][google.longrunning.Operation.response] field when it completes. 1131 * 1132 * <p>Sample code: 1133 * 1134 * <pre>{@code 1135 * // This snippet has been automatically generated and should be regarded as a code template only. 1136 * // It will require modifications to work: 1137 * // - It may require correct/in-range values for request initialization. 1138 * // - It may require specifying regional endpoints when creating the service client as shown in 1139 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1140 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1141 * ExportDataRequest request = 1142 * ExportDataRequest.newBuilder() 1143 * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) 1144 * .setOutputConfig(OutputConfig.newBuilder().build()) 1145 * .build(); 1146 * OperationFuture<Empty, OperationMetadata> future = 1147 * autoMlClient.exportDataOperationCallable().futureCall(request); 1148 * // Do something. 1149 * future.get(); 1150 * } 1151 * }</pre> 1152 */ 1153 public final OperationCallable<ExportDataRequest, Empty, OperationMetadata> exportDataOperationCallable()1154 exportDataOperationCallable() { 1155 return stub.exportDataOperationCallable(); 1156 } 1157 1158 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1159 /** 1160 * Exports dataset's data to the provided output location. Returns an empty response in the 1161 * [response][google.longrunning.Operation.response] field when it completes. 1162 * 1163 * <p>Sample code: 1164 * 1165 * <pre>{@code 1166 * // This snippet has been automatically generated and should be regarded as a code template only. 1167 * // It will require modifications to work: 1168 * // - It may require correct/in-range values for request initialization. 1169 * // - It may require specifying regional endpoints when creating the service client as shown in 1170 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1171 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1172 * ExportDataRequest request = 1173 * ExportDataRequest.newBuilder() 1174 * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) 1175 * .setOutputConfig(OutputConfig.newBuilder().build()) 1176 * .build(); 1177 * ApiFuture<Operation> future = autoMlClient.exportDataCallable().futureCall(request); 1178 * // Do something. 1179 * future.get(); 1180 * } 1181 * }</pre> 1182 */ exportDataCallable()1183 public final UnaryCallable<ExportDataRequest, Operation> exportDataCallable() { 1184 return stub.exportDataCallable(); 1185 } 1186 1187 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1188 /** 1189 * Gets an annotation spec. 1190 * 1191 * <p>Sample code: 1192 * 1193 * <pre>{@code 1194 * // This snippet has been automatically generated and should be regarded as a code template only. 1195 * // It will require modifications to work: 1196 * // - It may require correct/in-range values for request initialization. 1197 * // - It may require specifying regional endpoints when creating the service client as shown in 1198 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1199 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1200 * AnnotationSpecName name = 1201 * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]"); 1202 * AnnotationSpec response = autoMlClient.getAnnotationSpec(name); 1203 * } 1204 * }</pre> 1205 * 1206 * @param name Required. The resource name of the annotation spec to retrieve. 1207 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1208 */ getAnnotationSpec(AnnotationSpecName name)1209 public final AnnotationSpec getAnnotationSpec(AnnotationSpecName name) { 1210 GetAnnotationSpecRequest request = 1211 GetAnnotationSpecRequest.newBuilder() 1212 .setName(name == null ? null : name.toString()) 1213 .build(); 1214 return getAnnotationSpec(request); 1215 } 1216 1217 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1218 /** 1219 * Gets an annotation spec. 1220 * 1221 * <p>Sample code: 1222 * 1223 * <pre>{@code 1224 * // This snippet has been automatically generated and should be regarded as a code template only. 1225 * // It will require modifications to work: 1226 * // - It may require correct/in-range values for request initialization. 1227 * // - It may require specifying regional endpoints when creating the service client as shown in 1228 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1229 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1230 * String name = 1231 * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") 1232 * .toString(); 1233 * AnnotationSpec response = autoMlClient.getAnnotationSpec(name); 1234 * } 1235 * }</pre> 1236 * 1237 * @param name Required. The resource name of the annotation spec to retrieve. 1238 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1239 */ getAnnotationSpec(String name)1240 public final AnnotationSpec getAnnotationSpec(String name) { 1241 GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder().setName(name).build(); 1242 return getAnnotationSpec(request); 1243 } 1244 1245 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1246 /** 1247 * Gets an annotation spec. 1248 * 1249 * <p>Sample code: 1250 * 1251 * <pre>{@code 1252 * // This snippet has been automatically generated and should be regarded as a code template only. 1253 * // It will require modifications to work: 1254 * // - It may require correct/in-range values for request initialization. 1255 * // - It may require specifying regional endpoints when creating the service client as shown in 1256 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1257 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1258 * GetAnnotationSpecRequest request = 1259 * GetAnnotationSpecRequest.newBuilder() 1260 * .setName( 1261 * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") 1262 * .toString()) 1263 * .build(); 1264 * AnnotationSpec response = autoMlClient.getAnnotationSpec(request); 1265 * } 1266 * }</pre> 1267 * 1268 * @param request The request object containing all of the parameters for the API call. 1269 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1270 */ getAnnotationSpec(GetAnnotationSpecRequest request)1271 public final AnnotationSpec getAnnotationSpec(GetAnnotationSpecRequest request) { 1272 return getAnnotationSpecCallable().call(request); 1273 } 1274 1275 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1276 /** 1277 * Gets an annotation spec. 1278 * 1279 * <p>Sample code: 1280 * 1281 * <pre>{@code 1282 * // This snippet has been automatically generated and should be regarded as a code template only. 1283 * // It will require modifications to work: 1284 * // - It may require correct/in-range values for request initialization. 1285 * // - It may require specifying regional endpoints when creating the service client as shown in 1286 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1287 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1288 * GetAnnotationSpecRequest request = 1289 * GetAnnotationSpecRequest.newBuilder() 1290 * .setName( 1291 * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") 1292 * .toString()) 1293 * .build(); 1294 * ApiFuture<AnnotationSpec> future = 1295 * autoMlClient.getAnnotationSpecCallable().futureCall(request); 1296 * // Do something. 1297 * AnnotationSpec response = future.get(); 1298 * } 1299 * }</pre> 1300 */ getAnnotationSpecCallable()1301 public final UnaryCallable<GetAnnotationSpecRequest, AnnotationSpec> getAnnotationSpecCallable() { 1302 return stub.getAnnotationSpecCallable(); 1303 } 1304 1305 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1306 /** 1307 * Gets a table spec. 1308 * 1309 * <p>Sample code: 1310 * 1311 * <pre>{@code 1312 * // This snippet has been automatically generated and should be regarded as a code template only. 1313 * // It will require modifications to work: 1314 * // - It may require correct/in-range values for request initialization. 1315 * // - It may require specifying regional endpoints when creating the service client as shown in 1316 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1317 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1318 * TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]"); 1319 * TableSpec response = autoMlClient.getTableSpec(name); 1320 * } 1321 * }</pre> 1322 * 1323 * @param name Required. The resource name of the table spec to retrieve. 1324 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1325 */ getTableSpec(TableSpecName name)1326 public final TableSpec getTableSpec(TableSpecName name) { 1327 GetTableSpecRequest request = 1328 GetTableSpecRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 1329 return getTableSpec(request); 1330 } 1331 1332 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1333 /** 1334 * Gets a table spec. 1335 * 1336 * <p>Sample code: 1337 * 1338 * <pre>{@code 1339 * // This snippet has been automatically generated and should be regarded as a code template only. 1340 * // It will require modifications to work: 1341 * // - It may require correct/in-range values for request initialization. 1342 * // - It may require specifying regional endpoints when creating the service client as shown in 1343 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1344 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1345 * String name = 1346 * TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]").toString(); 1347 * TableSpec response = autoMlClient.getTableSpec(name); 1348 * } 1349 * }</pre> 1350 * 1351 * @param name Required. The resource name of the table spec to retrieve. 1352 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1353 */ getTableSpec(String name)1354 public final TableSpec getTableSpec(String name) { 1355 GetTableSpecRequest request = GetTableSpecRequest.newBuilder().setName(name).build(); 1356 return getTableSpec(request); 1357 } 1358 1359 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1360 /** 1361 * Gets a table spec. 1362 * 1363 * <p>Sample code: 1364 * 1365 * <pre>{@code 1366 * // This snippet has been automatically generated and should be regarded as a code template only. 1367 * // It will require modifications to work: 1368 * // - It may require correct/in-range values for request initialization. 1369 * // - It may require specifying regional endpoints when creating the service client as shown in 1370 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1371 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1372 * GetTableSpecRequest request = 1373 * GetTableSpecRequest.newBuilder() 1374 * .setName( 1375 * TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]") 1376 * .toString()) 1377 * .setFieldMask(FieldMask.newBuilder().build()) 1378 * .build(); 1379 * TableSpec response = autoMlClient.getTableSpec(request); 1380 * } 1381 * }</pre> 1382 * 1383 * @param request The request object containing all of the parameters for the API call. 1384 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1385 */ getTableSpec(GetTableSpecRequest request)1386 public final TableSpec getTableSpec(GetTableSpecRequest request) { 1387 return getTableSpecCallable().call(request); 1388 } 1389 1390 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1391 /** 1392 * Gets a table spec. 1393 * 1394 * <p>Sample code: 1395 * 1396 * <pre>{@code 1397 * // This snippet has been automatically generated and should be regarded as a code template only. 1398 * // It will require modifications to work: 1399 * // - It may require correct/in-range values for request initialization. 1400 * // - It may require specifying regional endpoints when creating the service client as shown in 1401 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1402 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1403 * GetTableSpecRequest request = 1404 * GetTableSpecRequest.newBuilder() 1405 * .setName( 1406 * TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]") 1407 * .toString()) 1408 * .setFieldMask(FieldMask.newBuilder().build()) 1409 * .build(); 1410 * ApiFuture<TableSpec> future = autoMlClient.getTableSpecCallable().futureCall(request); 1411 * // Do something. 1412 * TableSpec response = future.get(); 1413 * } 1414 * }</pre> 1415 */ getTableSpecCallable()1416 public final UnaryCallable<GetTableSpecRequest, TableSpec> getTableSpecCallable() { 1417 return stub.getTableSpecCallable(); 1418 } 1419 1420 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1421 /** 1422 * Lists table specs in a dataset. 1423 * 1424 * <p>Sample code: 1425 * 1426 * <pre>{@code 1427 * // This snippet has been automatically generated and should be regarded as a code template only. 1428 * // It will require modifications to work: 1429 * // - It may require correct/in-range values for request initialization. 1430 * // - It may require specifying regional endpoints when creating the service client as shown in 1431 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1432 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1433 * DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); 1434 * for (TableSpec element : autoMlClient.listTableSpecs(parent).iterateAll()) { 1435 * // doThingsWith(element); 1436 * } 1437 * } 1438 * }</pre> 1439 * 1440 * @param parent Required. The resource name of the dataset to list table specs from. 1441 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1442 */ listTableSpecs(DatasetName parent)1443 public final ListTableSpecsPagedResponse listTableSpecs(DatasetName parent) { 1444 ListTableSpecsRequest request = 1445 ListTableSpecsRequest.newBuilder() 1446 .setParent(parent == null ? null : parent.toString()) 1447 .build(); 1448 return listTableSpecs(request); 1449 } 1450 1451 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1452 /** 1453 * Lists table specs in a dataset. 1454 * 1455 * <p>Sample code: 1456 * 1457 * <pre>{@code 1458 * // This snippet has been automatically generated and should be regarded as a code template only. 1459 * // It will require modifications to work: 1460 * // - It may require correct/in-range values for request initialization. 1461 * // - It may require specifying regional endpoints when creating the service client as shown in 1462 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1463 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1464 * String parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); 1465 * for (TableSpec element : autoMlClient.listTableSpecs(parent).iterateAll()) { 1466 * // doThingsWith(element); 1467 * } 1468 * } 1469 * }</pre> 1470 * 1471 * @param parent Required. The resource name of the dataset to list table specs from. 1472 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1473 */ listTableSpecs(String parent)1474 public final ListTableSpecsPagedResponse listTableSpecs(String parent) { 1475 ListTableSpecsRequest request = ListTableSpecsRequest.newBuilder().setParent(parent).build(); 1476 return listTableSpecs(request); 1477 } 1478 1479 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1480 /** 1481 * Lists table specs in a dataset. 1482 * 1483 * <p>Sample code: 1484 * 1485 * <pre>{@code 1486 * // This snippet has been automatically generated and should be regarded as a code template only. 1487 * // It will require modifications to work: 1488 * // - It may require correct/in-range values for request initialization. 1489 * // - It may require specifying regional endpoints when creating the service client as shown in 1490 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1491 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1492 * ListTableSpecsRequest request = 1493 * ListTableSpecsRequest.newBuilder() 1494 * .setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) 1495 * .setFieldMask(FieldMask.newBuilder().build()) 1496 * .setFilter("filter-1274492040") 1497 * .setPageSize(883849137) 1498 * .setPageToken("pageToken873572522") 1499 * .build(); 1500 * for (TableSpec element : autoMlClient.listTableSpecs(request).iterateAll()) { 1501 * // doThingsWith(element); 1502 * } 1503 * } 1504 * }</pre> 1505 * 1506 * @param request The request object containing all of the parameters for the API call. 1507 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1508 */ listTableSpecs(ListTableSpecsRequest request)1509 public final ListTableSpecsPagedResponse listTableSpecs(ListTableSpecsRequest request) { 1510 return listTableSpecsPagedCallable().call(request); 1511 } 1512 1513 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1514 /** 1515 * Lists table specs in a dataset. 1516 * 1517 * <p>Sample code: 1518 * 1519 * <pre>{@code 1520 * // This snippet has been automatically generated and should be regarded as a code template only. 1521 * // It will require modifications to work: 1522 * // - It may require correct/in-range values for request initialization. 1523 * // - It may require specifying regional endpoints when creating the service client as shown in 1524 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1525 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1526 * ListTableSpecsRequest request = 1527 * ListTableSpecsRequest.newBuilder() 1528 * .setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) 1529 * .setFieldMask(FieldMask.newBuilder().build()) 1530 * .setFilter("filter-1274492040") 1531 * .setPageSize(883849137) 1532 * .setPageToken("pageToken873572522") 1533 * .build(); 1534 * ApiFuture<TableSpec> future = autoMlClient.listTableSpecsPagedCallable().futureCall(request); 1535 * // Do something. 1536 * for (TableSpec element : future.get().iterateAll()) { 1537 * // doThingsWith(element); 1538 * } 1539 * } 1540 * }</pre> 1541 */ 1542 public final UnaryCallable<ListTableSpecsRequest, ListTableSpecsPagedResponse> listTableSpecsPagedCallable()1543 listTableSpecsPagedCallable() { 1544 return stub.listTableSpecsPagedCallable(); 1545 } 1546 1547 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1548 /** 1549 * Lists table specs in a dataset. 1550 * 1551 * <p>Sample code: 1552 * 1553 * <pre>{@code 1554 * // This snippet has been automatically generated and should be regarded as a code template only. 1555 * // It will require modifications to work: 1556 * // - It may require correct/in-range values for request initialization. 1557 * // - It may require specifying regional endpoints when creating the service client as shown in 1558 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1559 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1560 * ListTableSpecsRequest request = 1561 * ListTableSpecsRequest.newBuilder() 1562 * .setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) 1563 * .setFieldMask(FieldMask.newBuilder().build()) 1564 * .setFilter("filter-1274492040") 1565 * .setPageSize(883849137) 1566 * .setPageToken("pageToken873572522") 1567 * .build(); 1568 * while (true) { 1569 * ListTableSpecsResponse response = autoMlClient.listTableSpecsCallable().call(request); 1570 * for (TableSpec element : response.getTableSpecsList()) { 1571 * // doThingsWith(element); 1572 * } 1573 * String nextPageToken = response.getNextPageToken(); 1574 * if (!Strings.isNullOrEmpty(nextPageToken)) { 1575 * request = request.toBuilder().setPageToken(nextPageToken).build(); 1576 * } else { 1577 * break; 1578 * } 1579 * } 1580 * } 1581 * }</pre> 1582 */ 1583 public final UnaryCallable<ListTableSpecsRequest, ListTableSpecsResponse> listTableSpecsCallable()1584 listTableSpecsCallable() { 1585 return stub.listTableSpecsCallable(); 1586 } 1587 1588 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1589 /** 1590 * Updates a table spec. 1591 * 1592 * <p>Sample code: 1593 * 1594 * <pre>{@code 1595 * // This snippet has been automatically generated and should be regarded as a code template only. 1596 * // It will require modifications to work: 1597 * // - It may require correct/in-range values for request initialization. 1598 * // - It may require specifying regional endpoints when creating the service client as shown in 1599 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1600 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1601 * TableSpec tableSpec = TableSpec.newBuilder().build(); 1602 * TableSpec response = autoMlClient.updateTableSpec(tableSpec); 1603 * } 1604 * }</pre> 1605 * 1606 * @param tableSpec Required. The table spec which replaces the resource on the server. 1607 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1608 */ updateTableSpec(TableSpec tableSpec)1609 public final TableSpec updateTableSpec(TableSpec tableSpec) { 1610 UpdateTableSpecRequest request = 1611 UpdateTableSpecRequest.newBuilder().setTableSpec(tableSpec).build(); 1612 return updateTableSpec(request); 1613 } 1614 1615 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1616 /** 1617 * Updates a table spec. 1618 * 1619 * <p>Sample code: 1620 * 1621 * <pre>{@code 1622 * // This snippet has been automatically generated and should be regarded as a code template only. 1623 * // It will require modifications to work: 1624 * // - It may require correct/in-range values for request initialization. 1625 * // - It may require specifying regional endpoints when creating the service client as shown in 1626 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1627 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1628 * UpdateTableSpecRequest request = 1629 * UpdateTableSpecRequest.newBuilder() 1630 * .setTableSpec(TableSpec.newBuilder().build()) 1631 * .setUpdateMask(FieldMask.newBuilder().build()) 1632 * .build(); 1633 * TableSpec response = autoMlClient.updateTableSpec(request); 1634 * } 1635 * }</pre> 1636 * 1637 * @param request The request object containing all of the parameters for the API call. 1638 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1639 */ updateTableSpec(UpdateTableSpecRequest request)1640 public final TableSpec updateTableSpec(UpdateTableSpecRequest request) { 1641 return updateTableSpecCallable().call(request); 1642 } 1643 1644 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1645 /** 1646 * Updates a table spec. 1647 * 1648 * <p>Sample code: 1649 * 1650 * <pre>{@code 1651 * // This snippet has been automatically generated and should be regarded as a code template only. 1652 * // It will require modifications to work: 1653 * // - It may require correct/in-range values for request initialization. 1654 * // - It may require specifying regional endpoints when creating the service client as shown in 1655 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1656 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1657 * UpdateTableSpecRequest request = 1658 * UpdateTableSpecRequest.newBuilder() 1659 * .setTableSpec(TableSpec.newBuilder().build()) 1660 * .setUpdateMask(FieldMask.newBuilder().build()) 1661 * .build(); 1662 * ApiFuture<TableSpec> future = autoMlClient.updateTableSpecCallable().futureCall(request); 1663 * // Do something. 1664 * TableSpec response = future.get(); 1665 * } 1666 * }</pre> 1667 */ updateTableSpecCallable()1668 public final UnaryCallable<UpdateTableSpecRequest, TableSpec> updateTableSpecCallable() { 1669 return stub.updateTableSpecCallable(); 1670 } 1671 1672 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1673 /** 1674 * Gets a column spec. 1675 * 1676 * <p>Sample code: 1677 * 1678 * <pre>{@code 1679 * // This snippet has been automatically generated and should be regarded as a code template only. 1680 * // It will require modifications to work: 1681 * // - It may require correct/in-range values for request initialization. 1682 * // - It may require specifying regional endpoints when creating the service client as shown in 1683 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1684 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1685 * ColumnSpecName name = 1686 * ColumnSpecName.of( 1687 * "[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]"); 1688 * ColumnSpec response = autoMlClient.getColumnSpec(name); 1689 * } 1690 * }</pre> 1691 * 1692 * @param name Required. The resource name of the column spec to retrieve. 1693 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1694 */ getColumnSpec(ColumnSpecName name)1695 public final ColumnSpec getColumnSpec(ColumnSpecName name) { 1696 GetColumnSpecRequest request = 1697 GetColumnSpecRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 1698 return getColumnSpec(request); 1699 } 1700 1701 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1702 /** 1703 * Gets a column spec. 1704 * 1705 * <p>Sample code: 1706 * 1707 * <pre>{@code 1708 * // This snippet has been automatically generated and should be regarded as a code template only. 1709 * // It will require modifications to work: 1710 * // - It may require correct/in-range values for request initialization. 1711 * // - It may require specifying regional endpoints when creating the service client as shown in 1712 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1713 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1714 * String name = 1715 * ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]") 1716 * .toString(); 1717 * ColumnSpec response = autoMlClient.getColumnSpec(name); 1718 * } 1719 * }</pre> 1720 * 1721 * @param name Required. The resource name of the column spec to retrieve. 1722 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1723 */ getColumnSpec(String name)1724 public final ColumnSpec getColumnSpec(String name) { 1725 GetColumnSpecRequest request = GetColumnSpecRequest.newBuilder().setName(name).build(); 1726 return getColumnSpec(request); 1727 } 1728 1729 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1730 /** 1731 * Gets a column spec. 1732 * 1733 * <p>Sample code: 1734 * 1735 * <pre>{@code 1736 * // This snippet has been automatically generated and should be regarded as a code template only. 1737 * // It will require modifications to work: 1738 * // - It may require correct/in-range values for request initialization. 1739 * // - It may require specifying regional endpoints when creating the service client as shown in 1740 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1741 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1742 * GetColumnSpecRequest request = 1743 * GetColumnSpecRequest.newBuilder() 1744 * .setName( 1745 * ColumnSpecName.of( 1746 * "[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]") 1747 * .toString()) 1748 * .setFieldMask(FieldMask.newBuilder().build()) 1749 * .build(); 1750 * ColumnSpec response = autoMlClient.getColumnSpec(request); 1751 * } 1752 * }</pre> 1753 * 1754 * @param request The request object containing all of the parameters for the API call. 1755 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1756 */ getColumnSpec(GetColumnSpecRequest request)1757 public final ColumnSpec getColumnSpec(GetColumnSpecRequest request) { 1758 return getColumnSpecCallable().call(request); 1759 } 1760 1761 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1762 /** 1763 * Gets a column spec. 1764 * 1765 * <p>Sample code: 1766 * 1767 * <pre>{@code 1768 * // This snippet has been automatically generated and should be regarded as a code template only. 1769 * // It will require modifications to work: 1770 * // - It may require correct/in-range values for request initialization. 1771 * // - It may require specifying regional endpoints when creating the service client as shown in 1772 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1773 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1774 * GetColumnSpecRequest request = 1775 * GetColumnSpecRequest.newBuilder() 1776 * .setName( 1777 * ColumnSpecName.of( 1778 * "[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]") 1779 * .toString()) 1780 * .setFieldMask(FieldMask.newBuilder().build()) 1781 * .build(); 1782 * ApiFuture<ColumnSpec> future = autoMlClient.getColumnSpecCallable().futureCall(request); 1783 * // Do something. 1784 * ColumnSpec response = future.get(); 1785 * } 1786 * }</pre> 1787 */ getColumnSpecCallable()1788 public final UnaryCallable<GetColumnSpecRequest, ColumnSpec> getColumnSpecCallable() { 1789 return stub.getColumnSpecCallable(); 1790 } 1791 1792 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1793 /** 1794 * Lists column specs in a table spec. 1795 * 1796 * <p>Sample code: 1797 * 1798 * <pre>{@code 1799 * // This snippet has been automatically generated and should be regarded as a code template only. 1800 * // It will require modifications to work: 1801 * // - It may require correct/in-range values for request initialization. 1802 * // - It may require specifying regional endpoints when creating the service client as shown in 1803 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1804 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1805 * TableSpecName parent = 1806 * TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]"); 1807 * for (ColumnSpec element : autoMlClient.listColumnSpecs(parent).iterateAll()) { 1808 * // doThingsWith(element); 1809 * } 1810 * } 1811 * }</pre> 1812 * 1813 * @param parent Required. The resource name of the table spec to list column specs from. 1814 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1815 */ listColumnSpecs(TableSpecName parent)1816 public final ListColumnSpecsPagedResponse listColumnSpecs(TableSpecName parent) { 1817 ListColumnSpecsRequest request = 1818 ListColumnSpecsRequest.newBuilder() 1819 .setParent(parent == null ? null : parent.toString()) 1820 .build(); 1821 return listColumnSpecs(request); 1822 } 1823 1824 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1825 /** 1826 * Lists column specs in a table spec. 1827 * 1828 * <p>Sample code: 1829 * 1830 * <pre>{@code 1831 * // This snippet has been automatically generated and should be regarded as a code template only. 1832 * // It will require modifications to work: 1833 * // - It may require correct/in-range values for request initialization. 1834 * // - It may require specifying regional endpoints when creating the service client as shown in 1835 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1836 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1837 * String parent = 1838 * TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]").toString(); 1839 * for (ColumnSpec element : autoMlClient.listColumnSpecs(parent).iterateAll()) { 1840 * // doThingsWith(element); 1841 * } 1842 * } 1843 * }</pre> 1844 * 1845 * @param parent Required. The resource name of the table spec to list column specs from. 1846 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1847 */ listColumnSpecs(String parent)1848 public final ListColumnSpecsPagedResponse listColumnSpecs(String parent) { 1849 ListColumnSpecsRequest request = ListColumnSpecsRequest.newBuilder().setParent(parent).build(); 1850 return listColumnSpecs(request); 1851 } 1852 1853 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1854 /** 1855 * Lists column specs in a table spec. 1856 * 1857 * <p>Sample code: 1858 * 1859 * <pre>{@code 1860 * // This snippet has been automatically generated and should be regarded as a code template only. 1861 * // It will require modifications to work: 1862 * // - It may require correct/in-range values for request initialization. 1863 * // - It may require specifying regional endpoints when creating the service client as shown in 1864 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1865 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1866 * ListColumnSpecsRequest request = 1867 * ListColumnSpecsRequest.newBuilder() 1868 * .setParent( 1869 * TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]") 1870 * .toString()) 1871 * .setFieldMask(FieldMask.newBuilder().build()) 1872 * .setFilter("filter-1274492040") 1873 * .setPageSize(883849137) 1874 * .setPageToken("pageToken873572522") 1875 * .build(); 1876 * for (ColumnSpec element : autoMlClient.listColumnSpecs(request).iterateAll()) { 1877 * // doThingsWith(element); 1878 * } 1879 * } 1880 * }</pre> 1881 * 1882 * @param request The request object containing all of the parameters for the API call. 1883 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1884 */ listColumnSpecs(ListColumnSpecsRequest request)1885 public final ListColumnSpecsPagedResponse listColumnSpecs(ListColumnSpecsRequest request) { 1886 return listColumnSpecsPagedCallable().call(request); 1887 } 1888 1889 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1890 /** 1891 * Lists column specs in a table spec. 1892 * 1893 * <p>Sample code: 1894 * 1895 * <pre>{@code 1896 * // This snippet has been automatically generated and should be regarded as a code template only. 1897 * // It will require modifications to work: 1898 * // - It may require correct/in-range values for request initialization. 1899 * // - It may require specifying regional endpoints when creating the service client as shown in 1900 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1901 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1902 * ListColumnSpecsRequest request = 1903 * ListColumnSpecsRequest.newBuilder() 1904 * .setParent( 1905 * TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]") 1906 * .toString()) 1907 * .setFieldMask(FieldMask.newBuilder().build()) 1908 * .setFilter("filter-1274492040") 1909 * .setPageSize(883849137) 1910 * .setPageToken("pageToken873572522") 1911 * .build(); 1912 * ApiFuture<ColumnSpec> future = 1913 * autoMlClient.listColumnSpecsPagedCallable().futureCall(request); 1914 * // Do something. 1915 * for (ColumnSpec element : future.get().iterateAll()) { 1916 * // doThingsWith(element); 1917 * } 1918 * } 1919 * }</pre> 1920 */ 1921 public final UnaryCallable<ListColumnSpecsRequest, ListColumnSpecsPagedResponse> listColumnSpecsPagedCallable()1922 listColumnSpecsPagedCallable() { 1923 return stub.listColumnSpecsPagedCallable(); 1924 } 1925 1926 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1927 /** 1928 * Lists column specs in a table spec. 1929 * 1930 * <p>Sample code: 1931 * 1932 * <pre>{@code 1933 * // This snippet has been automatically generated and should be regarded as a code template only. 1934 * // It will require modifications to work: 1935 * // - It may require correct/in-range values for request initialization. 1936 * // - It may require specifying regional endpoints when creating the service client as shown in 1937 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1938 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1939 * ListColumnSpecsRequest request = 1940 * ListColumnSpecsRequest.newBuilder() 1941 * .setParent( 1942 * TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]") 1943 * .toString()) 1944 * .setFieldMask(FieldMask.newBuilder().build()) 1945 * .setFilter("filter-1274492040") 1946 * .setPageSize(883849137) 1947 * .setPageToken("pageToken873572522") 1948 * .build(); 1949 * while (true) { 1950 * ListColumnSpecsResponse response = autoMlClient.listColumnSpecsCallable().call(request); 1951 * for (ColumnSpec element : response.getColumnSpecsList()) { 1952 * // doThingsWith(element); 1953 * } 1954 * String nextPageToken = response.getNextPageToken(); 1955 * if (!Strings.isNullOrEmpty(nextPageToken)) { 1956 * request = request.toBuilder().setPageToken(nextPageToken).build(); 1957 * } else { 1958 * break; 1959 * } 1960 * } 1961 * } 1962 * }</pre> 1963 */ 1964 public final UnaryCallable<ListColumnSpecsRequest, ListColumnSpecsResponse> listColumnSpecsCallable()1965 listColumnSpecsCallable() { 1966 return stub.listColumnSpecsCallable(); 1967 } 1968 1969 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1970 /** 1971 * Updates a column spec. 1972 * 1973 * <p>Sample code: 1974 * 1975 * <pre>{@code 1976 * // This snippet has been automatically generated and should be regarded as a code template only. 1977 * // It will require modifications to work: 1978 * // - It may require correct/in-range values for request initialization. 1979 * // - It may require specifying regional endpoints when creating the service client as shown in 1980 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1981 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 1982 * ColumnSpec columnSpec = ColumnSpec.newBuilder().build(); 1983 * ColumnSpec response = autoMlClient.updateColumnSpec(columnSpec); 1984 * } 1985 * }</pre> 1986 * 1987 * @param columnSpec Required. The column spec which replaces the resource on the server. 1988 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1989 */ updateColumnSpec(ColumnSpec columnSpec)1990 public final ColumnSpec updateColumnSpec(ColumnSpec columnSpec) { 1991 UpdateColumnSpecRequest request = 1992 UpdateColumnSpecRequest.newBuilder().setColumnSpec(columnSpec).build(); 1993 return updateColumnSpec(request); 1994 } 1995 1996 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1997 /** 1998 * Updates a column spec. 1999 * 2000 * <p>Sample code: 2001 * 2002 * <pre>{@code 2003 * // This snippet has been automatically generated and should be regarded as a code template only. 2004 * // It will require modifications to work: 2005 * // - It may require correct/in-range values for request initialization. 2006 * // - It may require specifying regional endpoints when creating the service client as shown in 2007 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2008 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2009 * UpdateColumnSpecRequest request = 2010 * UpdateColumnSpecRequest.newBuilder() 2011 * .setColumnSpec(ColumnSpec.newBuilder().build()) 2012 * .setUpdateMask(FieldMask.newBuilder().build()) 2013 * .build(); 2014 * ColumnSpec response = autoMlClient.updateColumnSpec(request); 2015 * } 2016 * }</pre> 2017 * 2018 * @param request The request object containing all of the parameters for the API call. 2019 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2020 */ updateColumnSpec(UpdateColumnSpecRequest request)2021 public final ColumnSpec updateColumnSpec(UpdateColumnSpecRequest request) { 2022 return updateColumnSpecCallable().call(request); 2023 } 2024 2025 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2026 /** 2027 * Updates a column spec. 2028 * 2029 * <p>Sample code: 2030 * 2031 * <pre>{@code 2032 * // This snippet has been automatically generated and should be regarded as a code template only. 2033 * // It will require modifications to work: 2034 * // - It may require correct/in-range values for request initialization. 2035 * // - It may require specifying regional endpoints when creating the service client as shown in 2036 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2037 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2038 * UpdateColumnSpecRequest request = 2039 * UpdateColumnSpecRequest.newBuilder() 2040 * .setColumnSpec(ColumnSpec.newBuilder().build()) 2041 * .setUpdateMask(FieldMask.newBuilder().build()) 2042 * .build(); 2043 * ApiFuture<ColumnSpec> future = autoMlClient.updateColumnSpecCallable().futureCall(request); 2044 * // Do something. 2045 * ColumnSpec response = future.get(); 2046 * } 2047 * }</pre> 2048 */ updateColumnSpecCallable()2049 public final UnaryCallable<UpdateColumnSpecRequest, ColumnSpec> updateColumnSpecCallable() { 2050 return stub.updateColumnSpecCallable(); 2051 } 2052 2053 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2054 /** 2055 * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field 2056 * when it completes. When you create a model, several model evaluations are created for it: a 2057 * global evaluation, and one evaluation for each annotation spec. 2058 * 2059 * <p>Sample code: 2060 * 2061 * <pre>{@code 2062 * // This snippet has been automatically generated and should be regarded as a code template only. 2063 * // It will require modifications to work: 2064 * // - It may require correct/in-range values for request initialization. 2065 * // - It may require specifying regional endpoints when creating the service client as shown in 2066 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2067 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2068 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 2069 * Model model = Model.newBuilder().build(); 2070 * Model response = autoMlClient.createModelAsync(parent, model).get(); 2071 * } 2072 * }</pre> 2073 * 2074 * @param parent Required. Resource name of the parent project where the model is being created. 2075 * @param model Required. The model to create. 2076 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2077 */ createModelAsync( LocationName parent, Model model)2078 public final OperationFuture<Model, OperationMetadata> createModelAsync( 2079 LocationName parent, Model model) { 2080 CreateModelRequest request = 2081 CreateModelRequest.newBuilder() 2082 .setParent(parent == null ? null : parent.toString()) 2083 .setModel(model) 2084 .build(); 2085 return createModelAsync(request); 2086 } 2087 2088 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2089 /** 2090 * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field 2091 * when it completes. When you create a model, several model evaluations are created for it: a 2092 * global evaluation, and one evaluation for each annotation spec. 2093 * 2094 * <p>Sample code: 2095 * 2096 * <pre>{@code 2097 * // This snippet has been automatically generated and should be regarded as a code template only. 2098 * // It will require modifications to work: 2099 * // - It may require correct/in-range values for request initialization. 2100 * // - It may require specifying regional endpoints when creating the service client as shown in 2101 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2102 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2103 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 2104 * Model model = Model.newBuilder().build(); 2105 * Model response = autoMlClient.createModelAsync(parent, model).get(); 2106 * } 2107 * }</pre> 2108 * 2109 * @param parent Required. Resource name of the parent project where the model is being created. 2110 * @param model Required. The model to create. 2111 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2112 */ createModelAsync( String parent, Model model)2113 public final OperationFuture<Model, OperationMetadata> createModelAsync( 2114 String parent, Model model) { 2115 CreateModelRequest request = 2116 CreateModelRequest.newBuilder().setParent(parent).setModel(model).build(); 2117 return createModelAsync(request); 2118 } 2119 2120 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2121 /** 2122 * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field 2123 * when it completes. When you create a model, several model evaluations are created for it: a 2124 * global evaluation, and one evaluation for each annotation spec. 2125 * 2126 * <p>Sample code: 2127 * 2128 * <pre>{@code 2129 * // This snippet has been automatically generated and should be regarded as a code template only. 2130 * // It will require modifications to work: 2131 * // - It may require correct/in-range values for request initialization. 2132 * // - It may require specifying regional endpoints when creating the service client as shown in 2133 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2134 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2135 * CreateModelRequest request = 2136 * CreateModelRequest.newBuilder() 2137 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 2138 * .setModel(Model.newBuilder().build()) 2139 * .build(); 2140 * Model response = autoMlClient.createModelAsync(request).get(); 2141 * } 2142 * }</pre> 2143 * 2144 * @param request The request object containing all of the parameters for the API call. 2145 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2146 */ createModelAsync( CreateModelRequest request)2147 public final OperationFuture<Model, OperationMetadata> createModelAsync( 2148 CreateModelRequest request) { 2149 return createModelOperationCallable().futureCall(request); 2150 } 2151 2152 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2153 /** 2154 * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field 2155 * when it completes. When you create a model, several model evaluations are created for it: a 2156 * global evaluation, and one evaluation for each annotation spec. 2157 * 2158 * <p>Sample code: 2159 * 2160 * <pre>{@code 2161 * // This snippet has been automatically generated and should be regarded as a code template only. 2162 * // It will require modifications to work: 2163 * // - It may require correct/in-range values for request initialization. 2164 * // - It may require specifying regional endpoints when creating the service client as shown in 2165 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2166 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2167 * CreateModelRequest request = 2168 * CreateModelRequest.newBuilder() 2169 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 2170 * .setModel(Model.newBuilder().build()) 2171 * .build(); 2172 * OperationFuture<Model, OperationMetadata> future = 2173 * autoMlClient.createModelOperationCallable().futureCall(request); 2174 * // Do something. 2175 * Model response = future.get(); 2176 * } 2177 * }</pre> 2178 */ 2179 public final OperationCallable<CreateModelRequest, Model, OperationMetadata> createModelOperationCallable()2180 createModelOperationCallable() { 2181 return stub.createModelOperationCallable(); 2182 } 2183 2184 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2185 /** 2186 * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field 2187 * when it completes. When you create a model, several model evaluations are created for it: a 2188 * global evaluation, and one evaluation for each annotation spec. 2189 * 2190 * <p>Sample code: 2191 * 2192 * <pre>{@code 2193 * // This snippet has been automatically generated and should be regarded as a code template only. 2194 * // It will require modifications to work: 2195 * // - It may require correct/in-range values for request initialization. 2196 * // - It may require specifying regional endpoints when creating the service client as shown in 2197 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2198 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2199 * CreateModelRequest request = 2200 * CreateModelRequest.newBuilder() 2201 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 2202 * .setModel(Model.newBuilder().build()) 2203 * .build(); 2204 * ApiFuture<Operation> future = autoMlClient.createModelCallable().futureCall(request); 2205 * // Do something. 2206 * Operation response = future.get(); 2207 * } 2208 * }</pre> 2209 */ createModelCallable()2210 public final UnaryCallable<CreateModelRequest, Operation> createModelCallable() { 2211 return stub.createModelCallable(); 2212 } 2213 2214 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2215 /** 2216 * Gets a model. 2217 * 2218 * <p>Sample code: 2219 * 2220 * <pre>{@code 2221 * // This snippet has been automatically generated and should be regarded as a code template only. 2222 * // It will require modifications to work: 2223 * // - It may require correct/in-range values for request initialization. 2224 * // - It may require specifying regional endpoints when creating the service client as shown in 2225 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2226 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2227 * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); 2228 * Model response = autoMlClient.getModel(name); 2229 * } 2230 * }</pre> 2231 * 2232 * @param name Required. Resource name of the model. 2233 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2234 */ getModel(ModelName name)2235 public final Model getModel(ModelName name) { 2236 GetModelRequest request = 2237 GetModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 2238 return getModel(request); 2239 } 2240 2241 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2242 /** 2243 * Gets a model. 2244 * 2245 * <p>Sample code: 2246 * 2247 * <pre>{@code 2248 * // This snippet has been automatically generated and should be regarded as a code template only. 2249 * // It will require modifications to work: 2250 * // - It may require correct/in-range values for request initialization. 2251 * // - It may require specifying regional endpoints when creating the service client as shown in 2252 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2253 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2254 * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); 2255 * Model response = autoMlClient.getModel(name); 2256 * } 2257 * }</pre> 2258 * 2259 * @param name Required. Resource name of the model. 2260 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2261 */ getModel(String name)2262 public final Model getModel(String name) { 2263 GetModelRequest request = GetModelRequest.newBuilder().setName(name).build(); 2264 return getModel(request); 2265 } 2266 2267 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2268 /** 2269 * Gets a model. 2270 * 2271 * <p>Sample code: 2272 * 2273 * <pre>{@code 2274 * // This snippet has been automatically generated and should be regarded as a code template only. 2275 * // It will require modifications to work: 2276 * // - It may require correct/in-range values for request initialization. 2277 * // - It may require specifying regional endpoints when creating the service client as shown in 2278 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2279 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2280 * GetModelRequest request = 2281 * GetModelRequest.newBuilder() 2282 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 2283 * .build(); 2284 * Model response = autoMlClient.getModel(request); 2285 * } 2286 * }</pre> 2287 * 2288 * @param request The request object containing all of the parameters for the API call. 2289 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2290 */ getModel(GetModelRequest request)2291 public final Model getModel(GetModelRequest request) { 2292 return getModelCallable().call(request); 2293 } 2294 2295 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2296 /** 2297 * Gets a model. 2298 * 2299 * <p>Sample code: 2300 * 2301 * <pre>{@code 2302 * // This snippet has been automatically generated and should be regarded as a code template only. 2303 * // It will require modifications to work: 2304 * // - It may require correct/in-range values for request initialization. 2305 * // - It may require specifying regional endpoints when creating the service client as shown in 2306 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2307 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2308 * GetModelRequest request = 2309 * GetModelRequest.newBuilder() 2310 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 2311 * .build(); 2312 * ApiFuture<Model> future = autoMlClient.getModelCallable().futureCall(request); 2313 * // Do something. 2314 * Model response = future.get(); 2315 * } 2316 * }</pre> 2317 */ getModelCallable()2318 public final UnaryCallable<GetModelRequest, Model> getModelCallable() { 2319 return stub.getModelCallable(); 2320 } 2321 2322 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2323 /** 2324 * Lists models. 2325 * 2326 * <p>Sample code: 2327 * 2328 * <pre>{@code 2329 * // This snippet has been automatically generated and should be regarded as a code template only. 2330 * // It will require modifications to work: 2331 * // - It may require correct/in-range values for request initialization. 2332 * // - It may require specifying regional endpoints when creating the service client as shown in 2333 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2334 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2335 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); 2336 * for (Model element : autoMlClient.listModels(parent).iterateAll()) { 2337 * // doThingsWith(element); 2338 * } 2339 * } 2340 * }</pre> 2341 * 2342 * @param parent Required. Resource name of the project, from which to list the models. 2343 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2344 */ listModels(LocationName parent)2345 public final ListModelsPagedResponse listModels(LocationName parent) { 2346 ListModelsRequest request = 2347 ListModelsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); 2348 return listModels(request); 2349 } 2350 2351 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2352 /** 2353 * Lists models. 2354 * 2355 * <p>Sample code: 2356 * 2357 * <pre>{@code 2358 * // This snippet has been automatically generated and should be regarded as a code template only. 2359 * // It will require modifications to work: 2360 * // - It may require correct/in-range values for request initialization. 2361 * // - It may require specifying regional endpoints when creating the service client as shown in 2362 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2363 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2364 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); 2365 * for (Model element : autoMlClient.listModels(parent).iterateAll()) { 2366 * // doThingsWith(element); 2367 * } 2368 * } 2369 * }</pre> 2370 * 2371 * @param parent Required. Resource name of the project, from which to list the models. 2372 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2373 */ listModels(String parent)2374 public final ListModelsPagedResponse listModels(String parent) { 2375 ListModelsRequest request = ListModelsRequest.newBuilder().setParent(parent).build(); 2376 return listModels(request); 2377 } 2378 2379 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2380 /** 2381 * Lists models. 2382 * 2383 * <p>Sample code: 2384 * 2385 * <pre>{@code 2386 * // This snippet has been automatically generated and should be regarded as a code template only. 2387 * // It will require modifications to work: 2388 * // - It may require correct/in-range values for request initialization. 2389 * // - It may require specifying regional endpoints when creating the service client as shown in 2390 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2391 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2392 * ListModelsRequest request = 2393 * ListModelsRequest.newBuilder() 2394 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 2395 * .setFilter("filter-1274492040") 2396 * .setPageSize(883849137) 2397 * .setPageToken("pageToken873572522") 2398 * .build(); 2399 * for (Model element : autoMlClient.listModels(request).iterateAll()) { 2400 * // doThingsWith(element); 2401 * } 2402 * } 2403 * }</pre> 2404 * 2405 * @param request The request object containing all of the parameters for the API call. 2406 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2407 */ listModels(ListModelsRequest request)2408 public final ListModelsPagedResponse listModels(ListModelsRequest request) { 2409 return listModelsPagedCallable().call(request); 2410 } 2411 2412 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2413 /** 2414 * Lists models. 2415 * 2416 * <p>Sample code: 2417 * 2418 * <pre>{@code 2419 * // This snippet has been automatically generated and should be regarded as a code template only. 2420 * // It will require modifications to work: 2421 * // - It may require correct/in-range values for request initialization. 2422 * // - It may require specifying regional endpoints when creating the service client as shown in 2423 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2424 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2425 * ListModelsRequest request = 2426 * ListModelsRequest.newBuilder() 2427 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 2428 * .setFilter("filter-1274492040") 2429 * .setPageSize(883849137) 2430 * .setPageToken("pageToken873572522") 2431 * .build(); 2432 * ApiFuture<Model> future = autoMlClient.listModelsPagedCallable().futureCall(request); 2433 * // Do something. 2434 * for (Model element : future.get().iterateAll()) { 2435 * // doThingsWith(element); 2436 * } 2437 * } 2438 * }</pre> 2439 */ listModelsPagedCallable()2440 public final UnaryCallable<ListModelsRequest, ListModelsPagedResponse> listModelsPagedCallable() { 2441 return stub.listModelsPagedCallable(); 2442 } 2443 2444 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2445 /** 2446 * Lists models. 2447 * 2448 * <p>Sample code: 2449 * 2450 * <pre>{@code 2451 * // This snippet has been automatically generated and should be regarded as a code template only. 2452 * // It will require modifications to work: 2453 * // - It may require correct/in-range values for request initialization. 2454 * // - It may require specifying regional endpoints when creating the service client as shown in 2455 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2456 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2457 * ListModelsRequest request = 2458 * ListModelsRequest.newBuilder() 2459 * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) 2460 * .setFilter("filter-1274492040") 2461 * .setPageSize(883849137) 2462 * .setPageToken("pageToken873572522") 2463 * .build(); 2464 * while (true) { 2465 * ListModelsResponse response = autoMlClient.listModelsCallable().call(request); 2466 * for (Model element : response.getModelList()) { 2467 * // doThingsWith(element); 2468 * } 2469 * String nextPageToken = response.getNextPageToken(); 2470 * if (!Strings.isNullOrEmpty(nextPageToken)) { 2471 * request = request.toBuilder().setPageToken(nextPageToken).build(); 2472 * } else { 2473 * break; 2474 * } 2475 * } 2476 * } 2477 * }</pre> 2478 */ listModelsCallable()2479 public final UnaryCallable<ListModelsRequest, ListModelsResponse> listModelsCallable() { 2480 return stub.listModelsCallable(); 2481 } 2482 2483 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2484 /** 2485 * Deletes a model. Returns `google.protobuf.Empty` in the 2486 * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` 2487 * in the [metadata][google.longrunning.Operation.metadata] field. 2488 * 2489 * <p>Sample code: 2490 * 2491 * <pre>{@code 2492 * // This snippet has been automatically generated and should be regarded as a code template only. 2493 * // It will require modifications to work: 2494 * // - It may require correct/in-range values for request initialization. 2495 * // - It may require specifying regional endpoints when creating the service client as shown in 2496 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2497 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2498 * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); 2499 * autoMlClient.deleteModelAsync(name).get(); 2500 * } 2501 * }</pre> 2502 * 2503 * @param name Required. Resource name of the model being deleted. 2504 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2505 */ deleteModelAsync(ModelName name)2506 public final OperationFuture<Empty, OperationMetadata> deleteModelAsync(ModelName name) { 2507 DeleteModelRequest request = 2508 DeleteModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 2509 return deleteModelAsync(request); 2510 } 2511 2512 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2513 /** 2514 * Deletes a model. Returns `google.protobuf.Empty` in the 2515 * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` 2516 * in the [metadata][google.longrunning.Operation.metadata] field. 2517 * 2518 * <p>Sample code: 2519 * 2520 * <pre>{@code 2521 * // This snippet has been automatically generated and should be regarded as a code template only. 2522 * // It will require modifications to work: 2523 * // - It may require correct/in-range values for request initialization. 2524 * // - It may require specifying regional endpoints when creating the service client as shown in 2525 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2526 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2527 * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); 2528 * autoMlClient.deleteModelAsync(name).get(); 2529 * } 2530 * }</pre> 2531 * 2532 * @param name Required. Resource name of the model being deleted. 2533 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2534 */ deleteModelAsync(String name)2535 public final OperationFuture<Empty, OperationMetadata> deleteModelAsync(String name) { 2536 DeleteModelRequest request = DeleteModelRequest.newBuilder().setName(name).build(); 2537 return deleteModelAsync(request); 2538 } 2539 2540 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2541 /** 2542 * Deletes a model. Returns `google.protobuf.Empty` in the 2543 * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` 2544 * in the [metadata][google.longrunning.Operation.metadata] field. 2545 * 2546 * <p>Sample code: 2547 * 2548 * <pre>{@code 2549 * // This snippet has been automatically generated and should be regarded as a code template only. 2550 * // It will require modifications to work: 2551 * // - It may require correct/in-range values for request initialization. 2552 * // - It may require specifying regional endpoints when creating the service client as shown in 2553 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2554 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2555 * DeleteModelRequest request = 2556 * DeleteModelRequest.newBuilder() 2557 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 2558 * .build(); 2559 * autoMlClient.deleteModelAsync(request).get(); 2560 * } 2561 * }</pre> 2562 * 2563 * @param request The request object containing all of the parameters for the API call. 2564 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2565 */ deleteModelAsync( DeleteModelRequest request)2566 public final OperationFuture<Empty, OperationMetadata> deleteModelAsync( 2567 DeleteModelRequest request) { 2568 return deleteModelOperationCallable().futureCall(request); 2569 } 2570 2571 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2572 /** 2573 * Deletes a model. Returns `google.protobuf.Empty` in the 2574 * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` 2575 * in the [metadata][google.longrunning.Operation.metadata] field. 2576 * 2577 * <p>Sample code: 2578 * 2579 * <pre>{@code 2580 * // This snippet has been automatically generated and should be regarded as a code template only. 2581 * // It will require modifications to work: 2582 * // - It may require correct/in-range values for request initialization. 2583 * // - It may require specifying regional endpoints when creating the service client as shown in 2584 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2585 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2586 * DeleteModelRequest request = 2587 * DeleteModelRequest.newBuilder() 2588 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 2589 * .build(); 2590 * OperationFuture<Empty, OperationMetadata> future = 2591 * autoMlClient.deleteModelOperationCallable().futureCall(request); 2592 * // Do something. 2593 * future.get(); 2594 * } 2595 * }</pre> 2596 */ 2597 public final OperationCallable<DeleteModelRequest, Empty, OperationMetadata> deleteModelOperationCallable()2598 deleteModelOperationCallable() { 2599 return stub.deleteModelOperationCallable(); 2600 } 2601 2602 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2603 /** 2604 * Deletes a model. Returns `google.protobuf.Empty` in the 2605 * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` 2606 * in the [metadata][google.longrunning.Operation.metadata] field. 2607 * 2608 * <p>Sample code: 2609 * 2610 * <pre>{@code 2611 * // This snippet has been automatically generated and should be regarded as a code template only. 2612 * // It will require modifications to work: 2613 * // - It may require correct/in-range values for request initialization. 2614 * // - It may require specifying regional endpoints when creating the service client as shown in 2615 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2616 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2617 * DeleteModelRequest request = 2618 * DeleteModelRequest.newBuilder() 2619 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 2620 * .build(); 2621 * ApiFuture<Operation> future = autoMlClient.deleteModelCallable().futureCall(request); 2622 * // Do something. 2623 * future.get(); 2624 * } 2625 * }</pre> 2626 */ deleteModelCallable()2627 public final UnaryCallable<DeleteModelRequest, Operation> deleteModelCallable() { 2628 return stub.deleteModelCallable(); 2629 } 2630 2631 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2632 /** 2633 * Deploys a model. If a model is already deployed, deploying it with the same parameters has no 2634 * effect. Deploying with different parametrs (as e.g. changing 2635 * 2636 * <p>[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) 2637 * will reset the deployment state without pausing the model's availability. 2638 * 2639 * <p>Only applicable for Text Classification, Image Object Detection , Tables, and Image 2640 * Segmentation; all other domains manage deployment automatically. 2641 * 2642 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 2643 * when it completes. 2644 * 2645 * <p>Sample code: 2646 * 2647 * <pre>{@code 2648 * // This snippet has been automatically generated and should be regarded as a code template only. 2649 * // It will require modifications to work: 2650 * // - It may require correct/in-range values for request initialization. 2651 * // - It may require specifying regional endpoints when creating the service client as shown in 2652 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2653 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2654 * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); 2655 * autoMlClient.deployModelAsync(name).get(); 2656 * } 2657 * }</pre> 2658 * 2659 * @param name Required. Resource name of the model to deploy. 2660 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2661 */ deployModelAsync(ModelName name)2662 public final OperationFuture<Empty, OperationMetadata> deployModelAsync(ModelName name) { 2663 DeployModelRequest request = 2664 DeployModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 2665 return deployModelAsync(request); 2666 } 2667 2668 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2669 /** 2670 * Deploys a model. If a model is already deployed, deploying it with the same parameters has no 2671 * effect. Deploying with different parametrs (as e.g. changing 2672 * 2673 * <p>[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) 2674 * will reset the deployment state without pausing the model's availability. 2675 * 2676 * <p>Only applicable for Text Classification, Image Object Detection , Tables, and Image 2677 * Segmentation; all other domains manage deployment automatically. 2678 * 2679 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 2680 * when it completes. 2681 * 2682 * <p>Sample code: 2683 * 2684 * <pre>{@code 2685 * // This snippet has been automatically generated and should be regarded as a code template only. 2686 * // It will require modifications to work: 2687 * // - It may require correct/in-range values for request initialization. 2688 * // - It may require specifying regional endpoints when creating the service client as shown in 2689 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2690 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2691 * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); 2692 * autoMlClient.deployModelAsync(name).get(); 2693 * } 2694 * }</pre> 2695 * 2696 * @param name Required. Resource name of the model to deploy. 2697 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2698 */ deployModelAsync(String name)2699 public final OperationFuture<Empty, OperationMetadata> deployModelAsync(String name) { 2700 DeployModelRequest request = DeployModelRequest.newBuilder().setName(name).build(); 2701 return deployModelAsync(request); 2702 } 2703 2704 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2705 /** 2706 * Deploys a model. If a model is already deployed, deploying it with the same parameters has no 2707 * effect. Deploying with different parametrs (as e.g. changing 2708 * 2709 * <p>[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) 2710 * will reset the deployment state without pausing the model's availability. 2711 * 2712 * <p>Only applicable for Text Classification, Image Object Detection , Tables, and Image 2713 * Segmentation; all other domains manage deployment automatically. 2714 * 2715 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 2716 * when it completes. 2717 * 2718 * <p>Sample code: 2719 * 2720 * <pre>{@code 2721 * // This snippet has been automatically generated and should be regarded as a code template only. 2722 * // It will require modifications to work: 2723 * // - It may require correct/in-range values for request initialization. 2724 * // - It may require specifying regional endpoints when creating the service client as shown in 2725 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2726 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2727 * DeployModelRequest request = 2728 * DeployModelRequest.newBuilder() 2729 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 2730 * .build(); 2731 * autoMlClient.deployModelAsync(request).get(); 2732 * } 2733 * }</pre> 2734 * 2735 * @param request The request object containing all of the parameters for the API call. 2736 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2737 */ deployModelAsync( DeployModelRequest request)2738 public final OperationFuture<Empty, OperationMetadata> deployModelAsync( 2739 DeployModelRequest request) { 2740 return deployModelOperationCallable().futureCall(request); 2741 } 2742 2743 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2744 /** 2745 * Deploys a model. If a model is already deployed, deploying it with the same parameters has no 2746 * effect. Deploying with different parametrs (as e.g. changing 2747 * 2748 * <p>[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) 2749 * will reset the deployment state without pausing the model's availability. 2750 * 2751 * <p>Only applicable for Text Classification, Image Object Detection , Tables, and Image 2752 * Segmentation; all other domains manage deployment automatically. 2753 * 2754 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 2755 * when it completes. 2756 * 2757 * <p>Sample code: 2758 * 2759 * <pre>{@code 2760 * // This snippet has been automatically generated and should be regarded as a code template only. 2761 * // It will require modifications to work: 2762 * // - It may require correct/in-range values for request initialization. 2763 * // - It may require specifying regional endpoints when creating the service client as shown in 2764 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2765 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2766 * DeployModelRequest request = 2767 * DeployModelRequest.newBuilder() 2768 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 2769 * .build(); 2770 * OperationFuture<Empty, OperationMetadata> future = 2771 * autoMlClient.deployModelOperationCallable().futureCall(request); 2772 * // Do something. 2773 * future.get(); 2774 * } 2775 * }</pre> 2776 */ 2777 public final OperationCallable<DeployModelRequest, Empty, OperationMetadata> deployModelOperationCallable()2778 deployModelOperationCallable() { 2779 return stub.deployModelOperationCallable(); 2780 } 2781 2782 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2783 /** 2784 * Deploys a model. If a model is already deployed, deploying it with the same parameters has no 2785 * effect. Deploying with different parametrs (as e.g. changing 2786 * 2787 * <p>[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) 2788 * will reset the deployment state without pausing the model's availability. 2789 * 2790 * <p>Only applicable for Text Classification, Image Object Detection , Tables, and Image 2791 * Segmentation; all other domains manage deployment automatically. 2792 * 2793 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 2794 * when it completes. 2795 * 2796 * <p>Sample code: 2797 * 2798 * <pre>{@code 2799 * // This snippet has been automatically generated and should be regarded as a code template only. 2800 * // It will require modifications to work: 2801 * // - It may require correct/in-range values for request initialization. 2802 * // - It may require specifying regional endpoints when creating the service client as shown in 2803 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2804 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2805 * DeployModelRequest request = 2806 * DeployModelRequest.newBuilder() 2807 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 2808 * .build(); 2809 * ApiFuture<Operation> future = autoMlClient.deployModelCallable().futureCall(request); 2810 * // Do something. 2811 * future.get(); 2812 * } 2813 * }</pre> 2814 */ deployModelCallable()2815 public final UnaryCallable<DeployModelRequest, Operation> deployModelCallable() { 2816 return stub.deployModelCallable(); 2817 } 2818 2819 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2820 /** 2821 * Undeploys a model. If the model is not deployed this method has no effect. 2822 * 2823 * <p>Only applicable for Text Classification, Image Object Detection and Tables; all other 2824 * domains manage deployment automatically. 2825 * 2826 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 2827 * when it completes. 2828 * 2829 * <p>Sample code: 2830 * 2831 * <pre>{@code 2832 * // This snippet has been automatically generated and should be regarded as a code template only. 2833 * // It will require modifications to work: 2834 * // - It may require correct/in-range values for request initialization. 2835 * // - It may require specifying regional endpoints when creating the service client as shown in 2836 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2837 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2838 * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); 2839 * autoMlClient.undeployModelAsync(name).get(); 2840 * } 2841 * }</pre> 2842 * 2843 * @param name Required. Resource name of the model to undeploy. 2844 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2845 */ undeployModelAsync(ModelName name)2846 public final OperationFuture<Empty, OperationMetadata> undeployModelAsync(ModelName name) { 2847 UndeployModelRequest request = 2848 UndeployModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 2849 return undeployModelAsync(request); 2850 } 2851 2852 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2853 /** 2854 * Undeploys a model. If the model is not deployed this method has no effect. 2855 * 2856 * <p>Only applicable for Text Classification, Image Object Detection and Tables; all other 2857 * domains manage deployment automatically. 2858 * 2859 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 2860 * when it completes. 2861 * 2862 * <p>Sample code: 2863 * 2864 * <pre>{@code 2865 * // This snippet has been automatically generated and should be regarded as a code template only. 2866 * // It will require modifications to work: 2867 * // - It may require correct/in-range values for request initialization. 2868 * // - It may require specifying regional endpoints when creating the service client as shown in 2869 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2870 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2871 * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); 2872 * autoMlClient.undeployModelAsync(name).get(); 2873 * } 2874 * }</pre> 2875 * 2876 * @param name Required. Resource name of the model to undeploy. 2877 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2878 */ undeployModelAsync(String name)2879 public final OperationFuture<Empty, OperationMetadata> undeployModelAsync(String name) { 2880 UndeployModelRequest request = UndeployModelRequest.newBuilder().setName(name).build(); 2881 return undeployModelAsync(request); 2882 } 2883 2884 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2885 /** 2886 * Undeploys a model. If the model is not deployed this method has no effect. 2887 * 2888 * <p>Only applicable for Text Classification, Image Object Detection and Tables; all other 2889 * domains manage deployment automatically. 2890 * 2891 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 2892 * when it completes. 2893 * 2894 * <p>Sample code: 2895 * 2896 * <pre>{@code 2897 * // This snippet has been automatically generated and should be regarded as a code template only. 2898 * // It will require modifications to work: 2899 * // - It may require correct/in-range values for request initialization. 2900 * // - It may require specifying regional endpoints when creating the service client as shown in 2901 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2902 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2903 * UndeployModelRequest request = 2904 * UndeployModelRequest.newBuilder() 2905 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 2906 * .build(); 2907 * autoMlClient.undeployModelAsync(request).get(); 2908 * } 2909 * }</pre> 2910 * 2911 * @param request The request object containing all of the parameters for the API call. 2912 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2913 */ undeployModelAsync( UndeployModelRequest request)2914 public final OperationFuture<Empty, OperationMetadata> undeployModelAsync( 2915 UndeployModelRequest request) { 2916 return undeployModelOperationCallable().futureCall(request); 2917 } 2918 2919 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2920 /** 2921 * Undeploys a model. If the model is not deployed this method has no effect. 2922 * 2923 * <p>Only applicable for Text Classification, Image Object Detection and Tables; all other 2924 * domains manage deployment automatically. 2925 * 2926 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 2927 * when it completes. 2928 * 2929 * <p>Sample code: 2930 * 2931 * <pre>{@code 2932 * // This snippet has been automatically generated and should be regarded as a code template only. 2933 * // It will require modifications to work: 2934 * // - It may require correct/in-range values for request initialization. 2935 * // - It may require specifying regional endpoints when creating the service client as shown in 2936 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2937 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2938 * UndeployModelRequest request = 2939 * UndeployModelRequest.newBuilder() 2940 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 2941 * .build(); 2942 * OperationFuture<Empty, OperationMetadata> future = 2943 * autoMlClient.undeployModelOperationCallable().futureCall(request); 2944 * // Do something. 2945 * future.get(); 2946 * } 2947 * }</pre> 2948 */ 2949 public final OperationCallable<UndeployModelRequest, Empty, OperationMetadata> undeployModelOperationCallable()2950 undeployModelOperationCallable() { 2951 return stub.undeployModelOperationCallable(); 2952 } 2953 2954 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2955 /** 2956 * Undeploys a model. If the model is not deployed this method has no effect. 2957 * 2958 * <p>Only applicable for Text Classification, Image Object Detection and Tables; all other 2959 * domains manage deployment automatically. 2960 * 2961 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 2962 * when it completes. 2963 * 2964 * <p>Sample code: 2965 * 2966 * <pre>{@code 2967 * // This snippet has been automatically generated and should be regarded as a code template only. 2968 * // It will require modifications to work: 2969 * // - It may require correct/in-range values for request initialization. 2970 * // - It may require specifying regional endpoints when creating the service client as shown in 2971 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2972 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 2973 * UndeployModelRequest request = 2974 * UndeployModelRequest.newBuilder() 2975 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 2976 * .build(); 2977 * ApiFuture<Operation> future = autoMlClient.undeployModelCallable().futureCall(request); 2978 * // Do something. 2979 * future.get(); 2980 * } 2981 * }</pre> 2982 */ undeployModelCallable()2983 public final UnaryCallable<UndeployModelRequest, Operation> undeployModelCallable() { 2984 return stub.undeployModelCallable(); 2985 } 2986 2987 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2988 /** 2989 * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A 2990 * model is considered export-able if and only if it has an export format defined for it in 2991 * 2992 * <p>[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. 2993 * 2994 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 2995 * when it completes. 2996 * 2997 * <p>Sample code: 2998 * 2999 * <pre>{@code 3000 * // This snippet has been automatically generated and should be regarded as a code template only. 3001 * // It will require modifications to work: 3002 * // - It may require correct/in-range values for request initialization. 3003 * // - It may require specifying regional endpoints when creating the service client as shown in 3004 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3005 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3006 * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); 3007 * ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build(); 3008 * autoMlClient.exportModelAsync(name, outputConfig).get(); 3009 * } 3010 * }</pre> 3011 * 3012 * @param name Required. The resource name of the model to export. 3013 * @param outputConfig Required. The desired output location and configuration. 3014 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3015 */ exportModelAsync( ModelName name, ModelExportOutputConfig outputConfig)3016 public final OperationFuture<Empty, OperationMetadata> exportModelAsync( 3017 ModelName name, ModelExportOutputConfig outputConfig) { 3018 ExportModelRequest request = 3019 ExportModelRequest.newBuilder() 3020 .setName(name == null ? null : name.toString()) 3021 .setOutputConfig(outputConfig) 3022 .build(); 3023 return exportModelAsync(request); 3024 } 3025 3026 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3027 /** 3028 * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A 3029 * model is considered export-able if and only if it has an export format defined for it in 3030 * 3031 * <p>[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. 3032 * 3033 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 3034 * when it completes. 3035 * 3036 * <p>Sample code: 3037 * 3038 * <pre>{@code 3039 * // This snippet has been automatically generated and should be regarded as a code template only. 3040 * // It will require modifications to work: 3041 * // - It may require correct/in-range values for request initialization. 3042 * // - It may require specifying regional endpoints when creating the service client as shown in 3043 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3044 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3045 * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); 3046 * ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build(); 3047 * autoMlClient.exportModelAsync(name, outputConfig).get(); 3048 * } 3049 * }</pre> 3050 * 3051 * @param name Required. The resource name of the model to export. 3052 * @param outputConfig Required. The desired output location and configuration. 3053 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3054 */ exportModelAsync( String name, ModelExportOutputConfig outputConfig)3055 public final OperationFuture<Empty, OperationMetadata> exportModelAsync( 3056 String name, ModelExportOutputConfig outputConfig) { 3057 ExportModelRequest request = 3058 ExportModelRequest.newBuilder().setName(name).setOutputConfig(outputConfig).build(); 3059 return exportModelAsync(request); 3060 } 3061 3062 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3063 /** 3064 * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A 3065 * model is considered export-able if and only if it has an export format defined for it in 3066 * 3067 * <p>[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. 3068 * 3069 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 3070 * when it completes. 3071 * 3072 * <p>Sample code: 3073 * 3074 * <pre>{@code 3075 * // This snippet has been automatically generated and should be regarded as a code template only. 3076 * // It will require modifications to work: 3077 * // - It may require correct/in-range values for request initialization. 3078 * // - It may require specifying regional endpoints when creating the service client as shown in 3079 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3080 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3081 * ExportModelRequest request = 3082 * ExportModelRequest.newBuilder() 3083 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 3084 * .setOutputConfig(ModelExportOutputConfig.newBuilder().build()) 3085 * .build(); 3086 * autoMlClient.exportModelAsync(request).get(); 3087 * } 3088 * }</pre> 3089 * 3090 * @param request The request object containing all of the parameters for the API call. 3091 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3092 */ exportModelAsync( ExportModelRequest request)3093 public final OperationFuture<Empty, OperationMetadata> exportModelAsync( 3094 ExportModelRequest request) { 3095 return exportModelOperationCallable().futureCall(request); 3096 } 3097 3098 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3099 /** 3100 * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A 3101 * model is considered export-able if and only if it has an export format defined for it in 3102 * 3103 * <p>[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. 3104 * 3105 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 3106 * when it completes. 3107 * 3108 * <p>Sample code: 3109 * 3110 * <pre>{@code 3111 * // This snippet has been automatically generated and should be regarded as a code template only. 3112 * // It will require modifications to work: 3113 * // - It may require correct/in-range values for request initialization. 3114 * // - It may require specifying regional endpoints when creating the service client as shown in 3115 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3116 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3117 * ExportModelRequest request = 3118 * ExportModelRequest.newBuilder() 3119 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 3120 * .setOutputConfig(ModelExportOutputConfig.newBuilder().build()) 3121 * .build(); 3122 * OperationFuture<Empty, OperationMetadata> future = 3123 * autoMlClient.exportModelOperationCallable().futureCall(request); 3124 * // Do something. 3125 * future.get(); 3126 * } 3127 * }</pre> 3128 */ 3129 public final OperationCallable<ExportModelRequest, Empty, OperationMetadata> exportModelOperationCallable()3130 exportModelOperationCallable() { 3131 return stub.exportModelOperationCallable(); 3132 } 3133 3134 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3135 /** 3136 * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A 3137 * model is considered export-able if and only if it has an export format defined for it in 3138 * 3139 * <p>[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. 3140 * 3141 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 3142 * when it completes. 3143 * 3144 * <p>Sample code: 3145 * 3146 * <pre>{@code 3147 * // This snippet has been automatically generated and should be regarded as a code template only. 3148 * // It will require modifications to work: 3149 * // - It may require correct/in-range values for request initialization. 3150 * // - It may require specifying regional endpoints when creating the service client as shown in 3151 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3152 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3153 * ExportModelRequest request = 3154 * ExportModelRequest.newBuilder() 3155 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 3156 * .setOutputConfig(ModelExportOutputConfig.newBuilder().build()) 3157 * .build(); 3158 * ApiFuture<Operation> future = autoMlClient.exportModelCallable().futureCall(request); 3159 * // Do something. 3160 * future.get(); 3161 * } 3162 * }</pre> 3163 */ exportModelCallable()3164 public final UnaryCallable<ExportModelRequest, Operation> exportModelCallable() { 3165 return stub.exportModelCallable(); 3166 } 3167 3168 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3169 /** 3170 * Exports examples on which the model was evaluated (i.e. which were in the TEST set of the 3171 * dataset the model was created from), together with their ground truth annotations and the 3172 * annotations created (predicted) by the model. The examples, ground truth and predictions are 3173 * exported in the state they were at the moment the model was evaluated. 3174 * 3175 * <p>This export is available only for 30 days since the model evaluation is created. 3176 * 3177 * <p>Currently only available for Tables. 3178 * 3179 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 3180 * when it completes. 3181 * 3182 * <p>Sample code: 3183 * 3184 * <pre>{@code 3185 * // This snippet has been automatically generated and should be regarded as a code template only. 3186 * // It will require modifications to work: 3187 * // - It may require correct/in-range values for request initialization. 3188 * // - It may require specifying regional endpoints when creating the service client as shown in 3189 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3190 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3191 * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); 3192 * ExportEvaluatedExamplesOutputConfig outputConfig = 3193 * ExportEvaluatedExamplesOutputConfig.newBuilder().build(); 3194 * autoMlClient.exportEvaluatedExamplesAsync(name, outputConfig).get(); 3195 * } 3196 * }</pre> 3197 * 3198 * @param name Required. The resource name of the model whose evaluated examples are to be 3199 * exported. 3200 * @param outputConfig Required. The desired output location and configuration. 3201 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3202 */ exportEvaluatedExamplesAsync( ModelName name, ExportEvaluatedExamplesOutputConfig outputConfig)3203 public final OperationFuture<Empty, OperationMetadata> exportEvaluatedExamplesAsync( 3204 ModelName name, ExportEvaluatedExamplesOutputConfig outputConfig) { 3205 ExportEvaluatedExamplesRequest request = 3206 ExportEvaluatedExamplesRequest.newBuilder() 3207 .setName(name == null ? null : name.toString()) 3208 .setOutputConfig(outputConfig) 3209 .build(); 3210 return exportEvaluatedExamplesAsync(request); 3211 } 3212 3213 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3214 /** 3215 * Exports examples on which the model was evaluated (i.e. which were in the TEST set of the 3216 * dataset the model was created from), together with their ground truth annotations and the 3217 * annotations created (predicted) by the model. The examples, ground truth and predictions are 3218 * exported in the state they were at the moment the model was evaluated. 3219 * 3220 * <p>This export is available only for 30 days since the model evaluation is created. 3221 * 3222 * <p>Currently only available for Tables. 3223 * 3224 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 3225 * when it completes. 3226 * 3227 * <p>Sample code: 3228 * 3229 * <pre>{@code 3230 * // This snippet has been automatically generated and should be regarded as a code template only. 3231 * // It will require modifications to work: 3232 * // - It may require correct/in-range values for request initialization. 3233 * // - It may require specifying regional endpoints when creating the service client as shown in 3234 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3235 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3236 * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); 3237 * ExportEvaluatedExamplesOutputConfig outputConfig = 3238 * ExportEvaluatedExamplesOutputConfig.newBuilder().build(); 3239 * autoMlClient.exportEvaluatedExamplesAsync(name, outputConfig).get(); 3240 * } 3241 * }</pre> 3242 * 3243 * @param name Required. The resource name of the model whose evaluated examples are to be 3244 * exported. 3245 * @param outputConfig Required. The desired output location and configuration. 3246 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3247 */ exportEvaluatedExamplesAsync( String name, ExportEvaluatedExamplesOutputConfig outputConfig)3248 public final OperationFuture<Empty, OperationMetadata> exportEvaluatedExamplesAsync( 3249 String name, ExportEvaluatedExamplesOutputConfig outputConfig) { 3250 ExportEvaluatedExamplesRequest request = 3251 ExportEvaluatedExamplesRequest.newBuilder() 3252 .setName(name) 3253 .setOutputConfig(outputConfig) 3254 .build(); 3255 return exportEvaluatedExamplesAsync(request); 3256 } 3257 3258 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3259 /** 3260 * Exports examples on which the model was evaluated (i.e. which were in the TEST set of the 3261 * dataset the model was created from), together with their ground truth annotations and the 3262 * annotations created (predicted) by the model. The examples, ground truth and predictions are 3263 * exported in the state they were at the moment the model was evaluated. 3264 * 3265 * <p>This export is available only for 30 days since the model evaluation is created. 3266 * 3267 * <p>Currently only available for Tables. 3268 * 3269 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 3270 * when it completes. 3271 * 3272 * <p>Sample code: 3273 * 3274 * <pre>{@code 3275 * // This snippet has been automatically generated and should be regarded as a code template only. 3276 * // It will require modifications to work: 3277 * // - It may require correct/in-range values for request initialization. 3278 * // - It may require specifying regional endpoints when creating the service client as shown in 3279 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3280 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3281 * ExportEvaluatedExamplesRequest request = 3282 * ExportEvaluatedExamplesRequest.newBuilder() 3283 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 3284 * .setOutputConfig(ExportEvaluatedExamplesOutputConfig.newBuilder().build()) 3285 * .build(); 3286 * autoMlClient.exportEvaluatedExamplesAsync(request).get(); 3287 * } 3288 * }</pre> 3289 * 3290 * @param request The request object containing all of the parameters for the API call. 3291 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3292 */ exportEvaluatedExamplesAsync( ExportEvaluatedExamplesRequest request)3293 public final OperationFuture<Empty, OperationMetadata> exportEvaluatedExamplesAsync( 3294 ExportEvaluatedExamplesRequest request) { 3295 return exportEvaluatedExamplesOperationCallable().futureCall(request); 3296 } 3297 3298 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3299 /** 3300 * Exports examples on which the model was evaluated (i.e. which were in the TEST set of the 3301 * dataset the model was created from), together with their ground truth annotations and the 3302 * annotations created (predicted) by the model. The examples, ground truth and predictions are 3303 * exported in the state they were at the moment the model was evaluated. 3304 * 3305 * <p>This export is available only for 30 days since the model evaluation is created. 3306 * 3307 * <p>Currently only available for Tables. 3308 * 3309 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 3310 * when it completes. 3311 * 3312 * <p>Sample code: 3313 * 3314 * <pre>{@code 3315 * // This snippet has been automatically generated and should be regarded as a code template only. 3316 * // It will require modifications to work: 3317 * // - It may require correct/in-range values for request initialization. 3318 * // - It may require specifying regional endpoints when creating the service client as shown in 3319 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3320 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3321 * ExportEvaluatedExamplesRequest request = 3322 * ExportEvaluatedExamplesRequest.newBuilder() 3323 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 3324 * .setOutputConfig(ExportEvaluatedExamplesOutputConfig.newBuilder().build()) 3325 * .build(); 3326 * OperationFuture<Empty, OperationMetadata> future = 3327 * autoMlClient.exportEvaluatedExamplesOperationCallable().futureCall(request); 3328 * // Do something. 3329 * future.get(); 3330 * } 3331 * }</pre> 3332 */ 3333 public final OperationCallable<ExportEvaluatedExamplesRequest, Empty, OperationMetadata> exportEvaluatedExamplesOperationCallable()3334 exportEvaluatedExamplesOperationCallable() { 3335 return stub.exportEvaluatedExamplesOperationCallable(); 3336 } 3337 3338 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3339 /** 3340 * Exports examples on which the model was evaluated (i.e. which were in the TEST set of the 3341 * dataset the model was created from), together with their ground truth annotations and the 3342 * annotations created (predicted) by the model. The examples, ground truth and predictions are 3343 * exported in the state they were at the moment the model was evaluated. 3344 * 3345 * <p>This export is available only for 30 days since the model evaluation is created. 3346 * 3347 * <p>Currently only available for Tables. 3348 * 3349 * <p>Returns an empty response in the [response][google.longrunning.Operation.response] field 3350 * when it completes. 3351 * 3352 * <p>Sample code: 3353 * 3354 * <pre>{@code 3355 * // This snippet has been automatically generated and should be regarded as a code template only. 3356 * // It will require modifications to work: 3357 * // - It may require correct/in-range values for request initialization. 3358 * // - It may require specifying regional endpoints when creating the service client as shown in 3359 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3360 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3361 * ExportEvaluatedExamplesRequest request = 3362 * ExportEvaluatedExamplesRequest.newBuilder() 3363 * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 3364 * .setOutputConfig(ExportEvaluatedExamplesOutputConfig.newBuilder().build()) 3365 * .build(); 3366 * ApiFuture<Operation> future = 3367 * autoMlClient.exportEvaluatedExamplesCallable().futureCall(request); 3368 * // Do something. 3369 * future.get(); 3370 * } 3371 * }</pre> 3372 */ 3373 public final UnaryCallable<ExportEvaluatedExamplesRequest, Operation> exportEvaluatedExamplesCallable()3374 exportEvaluatedExamplesCallable() { 3375 return stub.exportEvaluatedExamplesCallable(); 3376 } 3377 3378 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3379 /** 3380 * Gets a model evaluation. 3381 * 3382 * <p>Sample code: 3383 * 3384 * <pre>{@code 3385 * // This snippet has been automatically generated and should be regarded as a code template only. 3386 * // It will require modifications to work: 3387 * // - It may require correct/in-range values for request initialization. 3388 * // - It may require specifying regional endpoints when creating the service client as shown in 3389 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3390 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3391 * ModelEvaluationName name = 3392 * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]"); 3393 * ModelEvaluation response = autoMlClient.getModelEvaluation(name); 3394 * } 3395 * }</pre> 3396 * 3397 * @param name Required. Resource name for the model evaluation. 3398 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3399 */ getModelEvaluation(ModelEvaluationName name)3400 public final ModelEvaluation getModelEvaluation(ModelEvaluationName name) { 3401 GetModelEvaluationRequest request = 3402 GetModelEvaluationRequest.newBuilder() 3403 .setName(name == null ? null : name.toString()) 3404 .build(); 3405 return getModelEvaluation(request); 3406 } 3407 3408 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3409 /** 3410 * Gets a model evaluation. 3411 * 3412 * <p>Sample code: 3413 * 3414 * <pre>{@code 3415 * // This snippet has been automatically generated and should be regarded as a code template only. 3416 * // It will require modifications to work: 3417 * // - It may require correct/in-range values for request initialization. 3418 * // - It may require specifying regional endpoints when creating the service client as shown in 3419 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3420 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3421 * String name = 3422 * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]") 3423 * .toString(); 3424 * ModelEvaluation response = autoMlClient.getModelEvaluation(name); 3425 * } 3426 * }</pre> 3427 * 3428 * @param name Required. Resource name for the model evaluation. 3429 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3430 */ getModelEvaluation(String name)3431 public final ModelEvaluation getModelEvaluation(String name) { 3432 GetModelEvaluationRequest request = 3433 GetModelEvaluationRequest.newBuilder().setName(name).build(); 3434 return getModelEvaluation(request); 3435 } 3436 3437 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3438 /** 3439 * Gets a model evaluation. 3440 * 3441 * <p>Sample code: 3442 * 3443 * <pre>{@code 3444 * // This snippet has been automatically generated and should be regarded as a code template only. 3445 * // It will require modifications to work: 3446 * // - It may require correct/in-range values for request initialization. 3447 * // - It may require specifying regional endpoints when creating the service client as shown in 3448 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3449 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3450 * GetModelEvaluationRequest request = 3451 * GetModelEvaluationRequest.newBuilder() 3452 * .setName( 3453 * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]") 3454 * .toString()) 3455 * .build(); 3456 * ModelEvaluation response = autoMlClient.getModelEvaluation(request); 3457 * } 3458 * }</pre> 3459 * 3460 * @param request The request object containing all of the parameters for the API call. 3461 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3462 */ getModelEvaluation(GetModelEvaluationRequest request)3463 public final ModelEvaluation getModelEvaluation(GetModelEvaluationRequest request) { 3464 return getModelEvaluationCallable().call(request); 3465 } 3466 3467 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3468 /** 3469 * Gets a model evaluation. 3470 * 3471 * <p>Sample code: 3472 * 3473 * <pre>{@code 3474 * // This snippet has been automatically generated and should be regarded as a code template only. 3475 * // It will require modifications to work: 3476 * // - It may require correct/in-range values for request initialization. 3477 * // - It may require specifying regional endpoints when creating the service client as shown in 3478 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3479 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3480 * GetModelEvaluationRequest request = 3481 * GetModelEvaluationRequest.newBuilder() 3482 * .setName( 3483 * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]") 3484 * .toString()) 3485 * .build(); 3486 * ApiFuture<ModelEvaluation> future = 3487 * autoMlClient.getModelEvaluationCallable().futureCall(request); 3488 * // Do something. 3489 * ModelEvaluation response = future.get(); 3490 * } 3491 * }</pre> 3492 */ 3493 public final UnaryCallable<GetModelEvaluationRequest, ModelEvaluation> getModelEvaluationCallable()3494 getModelEvaluationCallable() { 3495 return stub.getModelEvaluationCallable(); 3496 } 3497 3498 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3499 /** 3500 * Lists model evaluations. 3501 * 3502 * <p>Sample code: 3503 * 3504 * <pre>{@code 3505 * // This snippet has been automatically generated and should be regarded as a code template only. 3506 * // It will require modifications to work: 3507 * // - It may require correct/in-range values for request initialization. 3508 * // - It may require specifying regional endpoints when creating the service client as shown in 3509 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3510 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3511 * ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); 3512 * for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent).iterateAll()) { 3513 * // doThingsWith(element); 3514 * } 3515 * } 3516 * }</pre> 3517 * 3518 * @param parent Required. Resource name of the model to list the model evaluations for. If 3519 * modelId is set as "-", this will list model evaluations from across all models of the 3520 * parent location. 3521 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3522 */ listModelEvaluations(ModelName parent)3523 public final ListModelEvaluationsPagedResponse listModelEvaluations(ModelName parent) { 3524 ListModelEvaluationsRequest request = 3525 ListModelEvaluationsRequest.newBuilder() 3526 .setParent(parent == null ? null : parent.toString()) 3527 .build(); 3528 return listModelEvaluations(request); 3529 } 3530 3531 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3532 /** 3533 * Lists model evaluations. 3534 * 3535 * <p>Sample code: 3536 * 3537 * <pre>{@code 3538 * // This snippet has been automatically generated and should be regarded as a code template only. 3539 * // It will require modifications to work: 3540 * // - It may require correct/in-range values for request initialization. 3541 * // - It may require specifying regional endpoints when creating the service client as shown in 3542 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3543 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3544 * String parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); 3545 * for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent).iterateAll()) { 3546 * // doThingsWith(element); 3547 * } 3548 * } 3549 * }</pre> 3550 * 3551 * @param parent Required. Resource name of the model to list the model evaluations for. If 3552 * modelId is set as "-", this will list model evaluations from across all models of the 3553 * parent location. 3554 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3555 */ listModelEvaluations(String parent)3556 public final ListModelEvaluationsPagedResponse listModelEvaluations(String parent) { 3557 ListModelEvaluationsRequest request = 3558 ListModelEvaluationsRequest.newBuilder().setParent(parent).build(); 3559 return listModelEvaluations(request); 3560 } 3561 3562 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3563 /** 3564 * Lists model evaluations. 3565 * 3566 * <p>Sample code: 3567 * 3568 * <pre>{@code 3569 * // This snippet has been automatically generated and should be regarded as a code template only. 3570 * // It will require modifications to work: 3571 * // - It may require correct/in-range values for request initialization. 3572 * // - It may require specifying regional endpoints when creating the service client as shown in 3573 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3574 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3575 * ListModelEvaluationsRequest request = 3576 * ListModelEvaluationsRequest.newBuilder() 3577 * .setParent(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 3578 * .setFilter("filter-1274492040") 3579 * .setPageSize(883849137) 3580 * .setPageToken("pageToken873572522") 3581 * .build(); 3582 * for (ModelEvaluation element : autoMlClient.listModelEvaluations(request).iterateAll()) { 3583 * // doThingsWith(element); 3584 * } 3585 * } 3586 * }</pre> 3587 * 3588 * @param request The request object containing all of the parameters for the API call. 3589 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3590 */ listModelEvaluations( ListModelEvaluationsRequest request)3591 public final ListModelEvaluationsPagedResponse listModelEvaluations( 3592 ListModelEvaluationsRequest request) { 3593 return listModelEvaluationsPagedCallable().call(request); 3594 } 3595 3596 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3597 /** 3598 * Lists model evaluations. 3599 * 3600 * <p>Sample code: 3601 * 3602 * <pre>{@code 3603 * // This snippet has been automatically generated and should be regarded as a code template only. 3604 * // It will require modifications to work: 3605 * // - It may require correct/in-range values for request initialization. 3606 * // - It may require specifying regional endpoints when creating the service client as shown in 3607 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3608 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3609 * ListModelEvaluationsRequest request = 3610 * ListModelEvaluationsRequest.newBuilder() 3611 * .setParent(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 3612 * .setFilter("filter-1274492040") 3613 * .setPageSize(883849137) 3614 * .setPageToken("pageToken873572522") 3615 * .build(); 3616 * ApiFuture<ModelEvaluation> future = 3617 * autoMlClient.listModelEvaluationsPagedCallable().futureCall(request); 3618 * // Do something. 3619 * for (ModelEvaluation element : future.get().iterateAll()) { 3620 * // doThingsWith(element); 3621 * } 3622 * } 3623 * }</pre> 3624 */ 3625 public final UnaryCallable<ListModelEvaluationsRequest, ListModelEvaluationsPagedResponse> listModelEvaluationsPagedCallable()3626 listModelEvaluationsPagedCallable() { 3627 return stub.listModelEvaluationsPagedCallable(); 3628 } 3629 3630 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3631 /** 3632 * Lists model evaluations. 3633 * 3634 * <p>Sample code: 3635 * 3636 * <pre>{@code 3637 * // This snippet has been automatically generated and should be regarded as a code template only. 3638 * // It will require modifications to work: 3639 * // - It may require correct/in-range values for request initialization. 3640 * // - It may require specifying regional endpoints when creating the service client as shown in 3641 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3642 * try (AutoMlClient autoMlClient = AutoMlClient.create()) { 3643 * ListModelEvaluationsRequest request = 3644 * ListModelEvaluationsRequest.newBuilder() 3645 * .setParent(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) 3646 * .setFilter("filter-1274492040") 3647 * .setPageSize(883849137) 3648 * .setPageToken("pageToken873572522") 3649 * .build(); 3650 * while (true) { 3651 * ListModelEvaluationsResponse response = 3652 * autoMlClient.listModelEvaluationsCallable().call(request); 3653 * for (ModelEvaluation element : response.getModelEvaluationList()) { 3654 * // doThingsWith(element); 3655 * } 3656 * String nextPageToken = response.getNextPageToken(); 3657 * if (!Strings.isNullOrEmpty(nextPageToken)) { 3658 * request = request.toBuilder().setPageToken(nextPageToken).build(); 3659 * } else { 3660 * break; 3661 * } 3662 * } 3663 * } 3664 * }</pre> 3665 */ 3666 public final UnaryCallable<ListModelEvaluationsRequest, ListModelEvaluationsResponse> listModelEvaluationsCallable()3667 listModelEvaluationsCallable() { 3668 return stub.listModelEvaluationsCallable(); 3669 } 3670 3671 @Override close()3672 public final void close() { 3673 stub.close(); 3674 } 3675 3676 @Override shutdown()3677 public void shutdown() { 3678 stub.shutdown(); 3679 } 3680 3681 @Override isShutdown()3682 public boolean isShutdown() { 3683 return stub.isShutdown(); 3684 } 3685 3686 @Override isTerminated()3687 public boolean isTerminated() { 3688 return stub.isTerminated(); 3689 } 3690 3691 @Override shutdownNow()3692 public void shutdownNow() { 3693 stub.shutdownNow(); 3694 } 3695 3696 @Override awaitTermination(long duration, TimeUnit unit)3697 public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { 3698 return stub.awaitTermination(duration, unit); 3699 } 3700 3701 public static class ListDatasetsPagedResponse 3702 extends AbstractPagedListResponse< 3703 ListDatasetsRequest, 3704 ListDatasetsResponse, 3705 Dataset, 3706 ListDatasetsPage, 3707 ListDatasetsFixedSizeCollection> { 3708 createAsync( PageContext<ListDatasetsRequest, ListDatasetsResponse, Dataset> context, ApiFuture<ListDatasetsResponse> futureResponse)3709 public static ApiFuture<ListDatasetsPagedResponse> createAsync( 3710 PageContext<ListDatasetsRequest, ListDatasetsResponse, Dataset> context, 3711 ApiFuture<ListDatasetsResponse> futureResponse) { 3712 ApiFuture<ListDatasetsPage> futurePage = 3713 ListDatasetsPage.createEmptyPage().createPageAsync(context, futureResponse); 3714 return ApiFutures.transform( 3715 futurePage, 3716 input -> new ListDatasetsPagedResponse(input), 3717 MoreExecutors.directExecutor()); 3718 } 3719 ListDatasetsPagedResponse(ListDatasetsPage page)3720 private ListDatasetsPagedResponse(ListDatasetsPage page) { 3721 super(page, ListDatasetsFixedSizeCollection.createEmptyCollection()); 3722 } 3723 } 3724 3725 public static class ListDatasetsPage 3726 extends AbstractPage<ListDatasetsRequest, ListDatasetsResponse, Dataset, ListDatasetsPage> { 3727 ListDatasetsPage( PageContext<ListDatasetsRequest, ListDatasetsResponse, Dataset> context, ListDatasetsResponse response)3728 private ListDatasetsPage( 3729 PageContext<ListDatasetsRequest, ListDatasetsResponse, Dataset> context, 3730 ListDatasetsResponse response) { 3731 super(context, response); 3732 } 3733 createEmptyPage()3734 private static ListDatasetsPage createEmptyPage() { 3735 return new ListDatasetsPage(null, null); 3736 } 3737 3738 @Override createPage( PageContext<ListDatasetsRequest, ListDatasetsResponse, Dataset> context, ListDatasetsResponse response)3739 protected ListDatasetsPage createPage( 3740 PageContext<ListDatasetsRequest, ListDatasetsResponse, Dataset> context, 3741 ListDatasetsResponse response) { 3742 return new ListDatasetsPage(context, response); 3743 } 3744 3745 @Override createPageAsync( PageContext<ListDatasetsRequest, ListDatasetsResponse, Dataset> context, ApiFuture<ListDatasetsResponse> futureResponse)3746 public ApiFuture<ListDatasetsPage> createPageAsync( 3747 PageContext<ListDatasetsRequest, ListDatasetsResponse, Dataset> context, 3748 ApiFuture<ListDatasetsResponse> futureResponse) { 3749 return super.createPageAsync(context, futureResponse); 3750 } 3751 } 3752 3753 public static class ListDatasetsFixedSizeCollection 3754 extends AbstractFixedSizeCollection< 3755 ListDatasetsRequest, 3756 ListDatasetsResponse, 3757 Dataset, 3758 ListDatasetsPage, 3759 ListDatasetsFixedSizeCollection> { 3760 ListDatasetsFixedSizeCollection(List<ListDatasetsPage> pages, int collectionSize)3761 private ListDatasetsFixedSizeCollection(List<ListDatasetsPage> pages, int collectionSize) { 3762 super(pages, collectionSize); 3763 } 3764 createEmptyCollection()3765 private static ListDatasetsFixedSizeCollection createEmptyCollection() { 3766 return new ListDatasetsFixedSizeCollection(null, 0); 3767 } 3768 3769 @Override createCollection( List<ListDatasetsPage> pages, int collectionSize)3770 protected ListDatasetsFixedSizeCollection createCollection( 3771 List<ListDatasetsPage> pages, int collectionSize) { 3772 return new ListDatasetsFixedSizeCollection(pages, collectionSize); 3773 } 3774 } 3775 3776 public static class ListTableSpecsPagedResponse 3777 extends AbstractPagedListResponse< 3778 ListTableSpecsRequest, 3779 ListTableSpecsResponse, 3780 TableSpec, 3781 ListTableSpecsPage, 3782 ListTableSpecsFixedSizeCollection> { 3783 createAsync( PageContext<ListTableSpecsRequest, ListTableSpecsResponse, TableSpec> context, ApiFuture<ListTableSpecsResponse> futureResponse)3784 public static ApiFuture<ListTableSpecsPagedResponse> createAsync( 3785 PageContext<ListTableSpecsRequest, ListTableSpecsResponse, TableSpec> context, 3786 ApiFuture<ListTableSpecsResponse> futureResponse) { 3787 ApiFuture<ListTableSpecsPage> futurePage = 3788 ListTableSpecsPage.createEmptyPage().createPageAsync(context, futureResponse); 3789 return ApiFutures.transform( 3790 futurePage, 3791 input -> new ListTableSpecsPagedResponse(input), 3792 MoreExecutors.directExecutor()); 3793 } 3794 ListTableSpecsPagedResponse(ListTableSpecsPage page)3795 private ListTableSpecsPagedResponse(ListTableSpecsPage page) { 3796 super(page, ListTableSpecsFixedSizeCollection.createEmptyCollection()); 3797 } 3798 } 3799 3800 public static class ListTableSpecsPage 3801 extends AbstractPage< 3802 ListTableSpecsRequest, ListTableSpecsResponse, TableSpec, ListTableSpecsPage> { 3803 ListTableSpecsPage( PageContext<ListTableSpecsRequest, ListTableSpecsResponse, TableSpec> context, ListTableSpecsResponse response)3804 private ListTableSpecsPage( 3805 PageContext<ListTableSpecsRequest, ListTableSpecsResponse, TableSpec> context, 3806 ListTableSpecsResponse response) { 3807 super(context, response); 3808 } 3809 createEmptyPage()3810 private static ListTableSpecsPage createEmptyPage() { 3811 return new ListTableSpecsPage(null, null); 3812 } 3813 3814 @Override createPage( PageContext<ListTableSpecsRequest, ListTableSpecsResponse, TableSpec> context, ListTableSpecsResponse response)3815 protected ListTableSpecsPage createPage( 3816 PageContext<ListTableSpecsRequest, ListTableSpecsResponse, TableSpec> context, 3817 ListTableSpecsResponse response) { 3818 return new ListTableSpecsPage(context, response); 3819 } 3820 3821 @Override createPageAsync( PageContext<ListTableSpecsRequest, ListTableSpecsResponse, TableSpec> context, ApiFuture<ListTableSpecsResponse> futureResponse)3822 public ApiFuture<ListTableSpecsPage> createPageAsync( 3823 PageContext<ListTableSpecsRequest, ListTableSpecsResponse, TableSpec> context, 3824 ApiFuture<ListTableSpecsResponse> futureResponse) { 3825 return super.createPageAsync(context, futureResponse); 3826 } 3827 } 3828 3829 public static class ListTableSpecsFixedSizeCollection 3830 extends AbstractFixedSizeCollection< 3831 ListTableSpecsRequest, 3832 ListTableSpecsResponse, 3833 TableSpec, 3834 ListTableSpecsPage, 3835 ListTableSpecsFixedSizeCollection> { 3836 ListTableSpecsFixedSizeCollection(List<ListTableSpecsPage> pages, int collectionSize)3837 private ListTableSpecsFixedSizeCollection(List<ListTableSpecsPage> pages, int collectionSize) { 3838 super(pages, collectionSize); 3839 } 3840 createEmptyCollection()3841 private static ListTableSpecsFixedSizeCollection createEmptyCollection() { 3842 return new ListTableSpecsFixedSizeCollection(null, 0); 3843 } 3844 3845 @Override createCollection( List<ListTableSpecsPage> pages, int collectionSize)3846 protected ListTableSpecsFixedSizeCollection createCollection( 3847 List<ListTableSpecsPage> pages, int collectionSize) { 3848 return new ListTableSpecsFixedSizeCollection(pages, collectionSize); 3849 } 3850 } 3851 3852 public static class ListColumnSpecsPagedResponse 3853 extends AbstractPagedListResponse< 3854 ListColumnSpecsRequest, 3855 ListColumnSpecsResponse, 3856 ColumnSpec, 3857 ListColumnSpecsPage, 3858 ListColumnSpecsFixedSizeCollection> { 3859 createAsync( PageContext<ListColumnSpecsRequest, ListColumnSpecsResponse, ColumnSpec> context, ApiFuture<ListColumnSpecsResponse> futureResponse)3860 public static ApiFuture<ListColumnSpecsPagedResponse> createAsync( 3861 PageContext<ListColumnSpecsRequest, ListColumnSpecsResponse, ColumnSpec> context, 3862 ApiFuture<ListColumnSpecsResponse> futureResponse) { 3863 ApiFuture<ListColumnSpecsPage> futurePage = 3864 ListColumnSpecsPage.createEmptyPage().createPageAsync(context, futureResponse); 3865 return ApiFutures.transform( 3866 futurePage, 3867 input -> new ListColumnSpecsPagedResponse(input), 3868 MoreExecutors.directExecutor()); 3869 } 3870 ListColumnSpecsPagedResponse(ListColumnSpecsPage page)3871 private ListColumnSpecsPagedResponse(ListColumnSpecsPage page) { 3872 super(page, ListColumnSpecsFixedSizeCollection.createEmptyCollection()); 3873 } 3874 } 3875 3876 public static class ListColumnSpecsPage 3877 extends AbstractPage< 3878 ListColumnSpecsRequest, ListColumnSpecsResponse, ColumnSpec, ListColumnSpecsPage> { 3879 ListColumnSpecsPage( PageContext<ListColumnSpecsRequest, ListColumnSpecsResponse, ColumnSpec> context, ListColumnSpecsResponse response)3880 private ListColumnSpecsPage( 3881 PageContext<ListColumnSpecsRequest, ListColumnSpecsResponse, ColumnSpec> context, 3882 ListColumnSpecsResponse response) { 3883 super(context, response); 3884 } 3885 createEmptyPage()3886 private static ListColumnSpecsPage createEmptyPage() { 3887 return new ListColumnSpecsPage(null, null); 3888 } 3889 3890 @Override createPage( PageContext<ListColumnSpecsRequest, ListColumnSpecsResponse, ColumnSpec> context, ListColumnSpecsResponse response)3891 protected ListColumnSpecsPage createPage( 3892 PageContext<ListColumnSpecsRequest, ListColumnSpecsResponse, ColumnSpec> context, 3893 ListColumnSpecsResponse response) { 3894 return new ListColumnSpecsPage(context, response); 3895 } 3896 3897 @Override createPageAsync( PageContext<ListColumnSpecsRequest, ListColumnSpecsResponse, ColumnSpec> context, ApiFuture<ListColumnSpecsResponse> futureResponse)3898 public ApiFuture<ListColumnSpecsPage> createPageAsync( 3899 PageContext<ListColumnSpecsRequest, ListColumnSpecsResponse, ColumnSpec> context, 3900 ApiFuture<ListColumnSpecsResponse> futureResponse) { 3901 return super.createPageAsync(context, futureResponse); 3902 } 3903 } 3904 3905 public static class ListColumnSpecsFixedSizeCollection 3906 extends AbstractFixedSizeCollection< 3907 ListColumnSpecsRequest, 3908 ListColumnSpecsResponse, 3909 ColumnSpec, 3910 ListColumnSpecsPage, 3911 ListColumnSpecsFixedSizeCollection> { 3912 ListColumnSpecsFixedSizeCollection( List<ListColumnSpecsPage> pages, int collectionSize)3913 private ListColumnSpecsFixedSizeCollection( 3914 List<ListColumnSpecsPage> pages, int collectionSize) { 3915 super(pages, collectionSize); 3916 } 3917 createEmptyCollection()3918 private static ListColumnSpecsFixedSizeCollection createEmptyCollection() { 3919 return new ListColumnSpecsFixedSizeCollection(null, 0); 3920 } 3921 3922 @Override createCollection( List<ListColumnSpecsPage> pages, int collectionSize)3923 protected ListColumnSpecsFixedSizeCollection createCollection( 3924 List<ListColumnSpecsPage> pages, int collectionSize) { 3925 return new ListColumnSpecsFixedSizeCollection(pages, collectionSize); 3926 } 3927 } 3928 3929 public static class ListModelsPagedResponse 3930 extends AbstractPagedListResponse< 3931 ListModelsRequest, 3932 ListModelsResponse, 3933 Model, 3934 ListModelsPage, 3935 ListModelsFixedSizeCollection> { 3936 createAsync( PageContext<ListModelsRequest, ListModelsResponse, Model> context, ApiFuture<ListModelsResponse> futureResponse)3937 public static ApiFuture<ListModelsPagedResponse> createAsync( 3938 PageContext<ListModelsRequest, ListModelsResponse, Model> context, 3939 ApiFuture<ListModelsResponse> futureResponse) { 3940 ApiFuture<ListModelsPage> futurePage = 3941 ListModelsPage.createEmptyPage().createPageAsync(context, futureResponse); 3942 return ApiFutures.transform( 3943 futurePage, input -> new ListModelsPagedResponse(input), MoreExecutors.directExecutor()); 3944 } 3945 ListModelsPagedResponse(ListModelsPage page)3946 private ListModelsPagedResponse(ListModelsPage page) { 3947 super(page, ListModelsFixedSizeCollection.createEmptyCollection()); 3948 } 3949 } 3950 3951 public static class ListModelsPage 3952 extends AbstractPage<ListModelsRequest, ListModelsResponse, Model, ListModelsPage> { 3953 ListModelsPage( PageContext<ListModelsRequest, ListModelsResponse, Model> context, ListModelsResponse response)3954 private ListModelsPage( 3955 PageContext<ListModelsRequest, ListModelsResponse, Model> context, 3956 ListModelsResponse response) { 3957 super(context, response); 3958 } 3959 createEmptyPage()3960 private static ListModelsPage createEmptyPage() { 3961 return new ListModelsPage(null, null); 3962 } 3963 3964 @Override createPage( PageContext<ListModelsRequest, ListModelsResponse, Model> context, ListModelsResponse response)3965 protected ListModelsPage createPage( 3966 PageContext<ListModelsRequest, ListModelsResponse, Model> context, 3967 ListModelsResponse response) { 3968 return new ListModelsPage(context, response); 3969 } 3970 3971 @Override createPageAsync( PageContext<ListModelsRequest, ListModelsResponse, Model> context, ApiFuture<ListModelsResponse> futureResponse)3972 public ApiFuture<ListModelsPage> createPageAsync( 3973 PageContext<ListModelsRequest, ListModelsResponse, Model> context, 3974 ApiFuture<ListModelsResponse> futureResponse) { 3975 return super.createPageAsync(context, futureResponse); 3976 } 3977 } 3978 3979 public static class ListModelsFixedSizeCollection 3980 extends AbstractFixedSizeCollection< 3981 ListModelsRequest, 3982 ListModelsResponse, 3983 Model, 3984 ListModelsPage, 3985 ListModelsFixedSizeCollection> { 3986 ListModelsFixedSizeCollection(List<ListModelsPage> pages, int collectionSize)3987 private ListModelsFixedSizeCollection(List<ListModelsPage> pages, int collectionSize) { 3988 super(pages, collectionSize); 3989 } 3990 createEmptyCollection()3991 private static ListModelsFixedSizeCollection createEmptyCollection() { 3992 return new ListModelsFixedSizeCollection(null, 0); 3993 } 3994 3995 @Override createCollection( List<ListModelsPage> pages, int collectionSize)3996 protected ListModelsFixedSizeCollection createCollection( 3997 List<ListModelsPage> pages, int collectionSize) { 3998 return new ListModelsFixedSizeCollection(pages, collectionSize); 3999 } 4000 } 4001 4002 public static class ListModelEvaluationsPagedResponse 4003 extends AbstractPagedListResponse< 4004 ListModelEvaluationsRequest, 4005 ListModelEvaluationsResponse, 4006 ModelEvaluation, 4007 ListModelEvaluationsPage, 4008 ListModelEvaluationsFixedSizeCollection> { 4009 createAsync( PageContext<ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation> context, ApiFuture<ListModelEvaluationsResponse> futureResponse)4010 public static ApiFuture<ListModelEvaluationsPagedResponse> createAsync( 4011 PageContext<ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation> 4012 context, 4013 ApiFuture<ListModelEvaluationsResponse> futureResponse) { 4014 ApiFuture<ListModelEvaluationsPage> futurePage = 4015 ListModelEvaluationsPage.createEmptyPage().createPageAsync(context, futureResponse); 4016 return ApiFutures.transform( 4017 futurePage, 4018 input -> new ListModelEvaluationsPagedResponse(input), 4019 MoreExecutors.directExecutor()); 4020 } 4021 ListModelEvaluationsPagedResponse(ListModelEvaluationsPage page)4022 private ListModelEvaluationsPagedResponse(ListModelEvaluationsPage page) { 4023 super(page, ListModelEvaluationsFixedSizeCollection.createEmptyCollection()); 4024 } 4025 } 4026 4027 public static class ListModelEvaluationsPage 4028 extends AbstractPage< 4029 ListModelEvaluationsRequest, 4030 ListModelEvaluationsResponse, 4031 ModelEvaluation, 4032 ListModelEvaluationsPage> { 4033 ListModelEvaluationsPage( PageContext<ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation> context, ListModelEvaluationsResponse response)4034 private ListModelEvaluationsPage( 4035 PageContext<ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation> 4036 context, 4037 ListModelEvaluationsResponse response) { 4038 super(context, response); 4039 } 4040 createEmptyPage()4041 private static ListModelEvaluationsPage createEmptyPage() { 4042 return new ListModelEvaluationsPage(null, null); 4043 } 4044 4045 @Override createPage( PageContext<ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation> context, ListModelEvaluationsResponse response)4046 protected ListModelEvaluationsPage createPage( 4047 PageContext<ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation> 4048 context, 4049 ListModelEvaluationsResponse response) { 4050 return new ListModelEvaluationsPage(context, response); 4051 } 4052 4053 @Override createPageAsync( PageContext<ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation> context, ApiFuture<ListModelEvaluationsResponse> futureResponse)4054 public ApiFuture<ListModelEvaluationsPage> createPageAsync( 4055 PageContext<ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation> 4056 context, 4057 ApiFuture<ListModelEvaluationsResponse> futureResponse) { 4058 return super.createPageAsync(context, futureResponse); 4059 } 4060 } 4061 4062 public static class ListModelEvaluationsFixedSizeCollection 4063 extends AbstractFixedSizeCollection< 4064 ListModelEvaluationsRequest, 4065 ListModelEvaluationsResponse, 4066 ModelEvaluation, 4067 ListModelEvaluationsPage, 4068 ListModelEvaluationsFixedSizeCollection> { 4069 ListModelEvaluationsFixedSizeCollection( List<ListModelEvaluationsPage> pages, int collectionSize)4070 private ListModelEvaluationsFixedSizeCollection( 4071 List<ListModelEvaluationsPage> pages, int collectionSize) { 4072 super(pages, collectionSize); 4073 } 4074 createEmptyCollection()4075 private static ListModelEvaluationsFixedSizeCollection createEmptyCollection() { 4076 return new ListModelEvaluationsFixedSizeCollection(null, 0); 4077 } 4078 4079 @Override createCollection( List<ListModelEvaluationsPage> pages, int collectionSize)4080 protected ListModelEvaluationsFixedSizeCollection createCollection( 4081 List<ListModelEvaluationsPage> pages, int collectionSize) { 4082 return new ListModelEvaluationsFixedSizeCollection(pages, collectionSize); 4083 } 4084 } 4085 } 4086